Przeglądaj źródła

零售和供货商的花材管理允许批量修改

jf 5 lat temu
rodzic
commit
b654dbc41d
2 zmienionych plików z 116 dodań i 80 usunięć
  1. 41 23
      ghs/src/views/item/list.vue
  2. 75 57
      hd/src/views/item/list.vue

+ 41 - 23
ghs/src/views/item/list.vue

@@ -50,32 +50,41 @@
 				>
 				>
 			</template>
 			</template>
 
 
-      <template #table-column-addPrice="{scope}">
+		<template #table-header-cost>
+			<div class="set-sort">
+				<span>每扎成本价</span>
+				<el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
+				<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+			</div>
+		</template>
+		<template #table-column-cost="{scope}">
+			<span v-if="!costPrice">{{ scope.row.cost }}</span>
+			<el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
+		</template>
+		<template #table-header-addPrice>
+			<div class="set-sort">
+				<span>每扎加价</span>
+				<el-button v-if="!canAddPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showAddPrice" class="show"></el-button>
+				<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+			</div>
+		</template>
+      	<template #table-column-addPrice="{scope}">
         <span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
         <span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
         <el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
         <el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
       </template>
       </template>
+	  	<template #table-header-weight>
+		<div class="set-sort">
+			<span>重量(公斤)</span>
+			<el-button v-if="!costWeight" icon="el-icon-edit-outline" size="small" type="text" @click="showWeight" class="show"></el-button>
+			<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+		</div>
+	  </template>
+		<template #table-column-weight="{scope}">
+			<span v-if="!costWeight">{{ scope.row.weight }}</span>
+			<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.weight" @blur="changeSort(scope.row, 'weight')"></el-input>
+		</template>
 
 
-      <template #table-header-addPrice>
-        <div class="set-sort">
-          <span>每扎加价</span>
-          <el-button v-if="!canAddPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showAddPrice" class="show"></el-button>
-          <el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
-        </div>
-      </template>
 
 
-      <template #table-header-cost>
-        <div class="set-sort">
-          <span>每扎成本价</span>
-          <el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
-          <el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
-        </div>
-      </template>
-
-
-      <template #table-column-cost="{scope}">
-        <span v-if="!costPrice">{{ scope.row.cost }}</span>
-        <el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
-      </template>
       <template #slot-add-goods-btn>
       <template #slot-add-goods-btn>
         <el-button type="primary" size="mini" @click="addFn()">添加</el-button>
         <el-button type="primary" size="mini" @click="addFn()">添加</el-button>
       </template>
       </template>
@@ -202,6 +211,7 @@ export default {
       },
       },
       canAddPrice:false,
       canAddPrice:false,
       costPrice: false,
       costPrice: false,
+	  costWeight: false,
       classId: 0,
       classId: 0,
       className:'',
       className:'',
       showItemModal: false,
       showItemModal: false,
@@ -377,7 +387,7 @@ export default {
               prop: 'cost',
               prop: 'cost',
               label: '每扎成本价',
               label: '每扎成本价',
               align: 'center',
               align: 'center',
-              'min-width': 120
+              'min-width': 130
             },
             },
             {
             {
               prop: 'addPrice',
               prop: 'addPrice',
@@ -389,7 +399,7 @@ export default {
               prop: 'weight',
               prop: 'weight',
               label: '重量(公斤)',
               label: '重量(公斤)',
               align: 'center',
               align: 'center',
-              'min-width': 90
+              'min-width': 130
             },
             },
             {
             {
               prop: 'unit',
               prop: 'unit',
@@ -456,6 +466,10 @@ export default {
     showAddPrice(){
     showAddPrice(){
       this.initData = []
       this.initData = []
        this.canAddPrice = true
        this.canAddPrice = true
+    },
+  	showWeight(){
+      this.initData = []
+       this.costWeight = true
     },
     },
     showSort (e) {
     showSort (e) {
       this.initData = []
       this.initData = []
@@ -467,6 +481,7 @@ export default {
         this.sort.status = false;
         this.sort.status = false;
         this.canAddPrice = false
         this.canAddPrice = false
         this.costPrice = false
         this.costPrice = false
+        this.costWeight = false
         return;
         return;
       }
       }
       this.dataList.form.data = JSON.stringify(this.initData)
       this.dataList.form.data = JSON.stringify(this.initData)
@@ -477,6 +492,7 @@ export default {
       this.sort.status = false;
       this.sort.status = false;
       this.canAddPrice = false
       this.canAddPrice = false
       this.costPrice = false
       this.costPrice = false
+      this.costWeight = false
     },
     },
     replaceBtnFn(id) {
     replaceBtnFn(id) {
       this.addDialog = true
       this.addDialog = true
@@ -516,6 +532,8 @@ export default {
         obj.addPrice = d.addPrice
         obj.addPrice = d.addPrice
       } else if(type == 'cost') {
       } else if(type == 'cost') {
         obj.cost  = d.cost 
         obj.cost  = d.cost 
+      }else if(type == 'weight') {
+        obj.weight  = d.weight
       }
       }
       this.initData.push(obj)
       this.initData.push(obj)
     }
     }

+ 75 - 57
hd/src/views/item/list.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<div class="app-list-content">
 	<div class="app-list-content">
 		<x-crud
 		<x-crud
-				class="liu-crud-wrap"
-				@load="onLoad"
+			class="liu-crud-wrap"
+			@load="onLoad"
 		>
 		>
 			<template #slot-tabs>
 			<template #slot-tabs>
 				<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="tabClick">
 				<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="tabClick">
@@ -13,10 +13,10 @@
 
 
 			<template #table-column-cover="{ scope }">
 			<template #table-column-cover="{ scope }">
 				<cl-avatar
 				<cl-avatar
-						shape="square"
-						:size="32"
-						:src="scope.row.cover"
-						:style="{ margin: 'auto' }"
+					shape="square"
+					:size="32"
+					:src="scope.row.cover"
+					:style="{ margin: 'auto' }"
 				></cl-avatar>
 				></cl-avatar>
 			</template>
 			</template>
 
 
@@ -44,17 +44,23 @@
 
 
 			<template #slot-modify="{ scope }">
 			<template #slot-modify="{ scope }">
 				<el-button
 				<el-button
-						type="text"
-						@click.native.stop="replaceBtnFn(scope.row.id)"
+					type="text"
+					@click.native.stop="replaceBtnFn(scope.row.id)"
 				>修改</el-button
 				>修改</el-button
 				>
 				>
 			</template>
 			</template>
 
 
-			<template #table-column-addPrice="{scope}">
-				<span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
-				<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
+			<template #table-header-cost>
+				<div class="set-sort">
+					<span>每扎成本价</span>
+					<el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
+					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
+				</div>
+			</template>
+			<template #table-column-cost="{scope}">
+				<span v-if="!costPrice">{{ scope.row.cost }}</span>
+				<el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
 			</template>
 			</template>
-
 			<template #table-header-addPrice>
 			<template #table-header-addPrice>
 				<div class="set-sort">
 				<div class="set-sort">
 					<span>每扎加价</span>
 					<span>每扎加价</span>
@@ -62,20 +68,23 @@
 					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
 					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
 				</div>
 				</div>
 			</template>
 			</template>
-
-			<template #table-header-cost>
+			<template #table-column-addPrice="{scope}">
+				<span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
+				<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
+			</template>
+			<template #table-header-weight>
 				<div class="set-sort">
 				<div class="set-sort">
-					<span>每扎成本价</span>
-					<el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
+					<span>重量(公斤)</span>
+					<el-button v-if="!costWeight" icon="el-icon-edit-outline" size="small" type="text" @click="showWeight" class="show"></el-button>
 					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
 					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
 				</div>
 				</div>
 			</template>
 			</template>
+			<template #table-column-weight="{scope}">
+				<span v-if="!costWeight">{{ scope.row.weight }}</span>
+				<el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.weight" @blur="changeSort(scope.row, 'weight')"></el-input>
+			</template>
 
 
 
 
-			<template #table-column-cost="{scope}">
-				<span v-if="!costPrice">{{ scope.row.cost }}</span>
-				<el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
-			</template>
 			<template #slot-add-goods-btn>
 			<template #slot-add-goods-btn>
 				<el-button type="primary" size="mini" @click="addFn()">添加</el-button>
 				<el-button type="primary" size="mini" @click="addFn()">添加</el-button>
 			</template>
 			</template>
@@ -85,32 +94,32 @@
 		</item-list-layer>
 		</item-list-layer>
 		<!-- 新增弹窗 -->
 		<!-- 新增弹窗 -->
 		<el-dialog
 		<el-dialog
-				title="修改花材"
-				:visible.sync="addDialog"
-				:close-on-click-modal="false"
-				width="600px"
+			title="修改花材"
+			:visible.sync="addDialog"
+			:close-on-click-modal="false"
+			width="600px"
 		>
 		>
 			<div class="ad-modal-content">
 			<div class="ad-modal-content">
 				<el-form
 				<el-form
-						:model="replaceForm"
-						:rules="replaceFormRules"
-						ref="replaceForm"
-						label-width="100px"
-						class="demo-form"
+					:model="replaceForm"
+					:rules="replaceFormRules"
+					ref="replaceForm"
+					label-width="100px"
+					class="demo-form"
 				>
 				>
 					<el-form-item label="名称" prop="name">
 					<el-form-item label="名称" prop="name">
 						<el-input
 						<el-input
-								v-model="replaceForm.name"
-								placeholder="请输入名称"
-								size="small"
+							v-model="replaceForm.name"
+							placeholder="请输入名称"
+							size="small"
 						></el-input>
 						></el-input>
 					</el-form-item>
 					</el-form-item>
 
 
 					<el-form-item label="别名" prop="alias">
 					<el-form-item label="别名" prop="alias">
 						<el-input
 						<el-input
-								v-model="replaceForm.alias"
-								placeholder="请输入别名"
-								size="small"
+							v-model="replaceForm.alias"
+							placeholder="请输入别名"
+							size="small"
 						></el-input>
 						></el-input>
 					</el-form-item>
 					</el-form-item>
 
 
@@ -121,15 +130,15 @@
 
 
 					<el-form-item label="分类" prop="classId">
 					<el-form-item label="分类" prop="classId">
 						<el-select
 						<el-select
-								v-model="replaceForm.className"
-								size="small"
-								placeholder="请选择分类"
-								@change="selClassFn"
+							v-model="replaceForm.className"
+							size="small"
+							placeholder="请选择分类"
+							@change="selClassFn"
 						>
 						>
 							<el-option
 							<el-option
-									v-for="(item, index) in itemClassList"
-									:key="index"
-									:value="item.name"
+								v-for="(item, index) in itemClassList"
+								:key="index"
+								:value="item.name"
 							>{{ item.name }}</el-option
 							>{{ item.name }}</el-option
 							>
 							>
 						</el-select>
 						</el-select>
@@ -137,33 +146,33 @@
 
 
 					<el-form-item label="库存预警" prop="stockWarning">
 					<el-form-item label="库存预警" prop="stockWarning">
 						<el-input
 						<el-input
-								v-model="replaceForm.stockWarning"
-								placeholder="请输入数值"
-								size="small"
+							v-model="replaceForm.stockWarning"
+							placeholder="请输入数值"
+							size="small"
 						></el-input>
 						></el-input>
 					</el-form-item>
 					</el-form-item>
 
 
 					<el-form-item label="每扎重量" prop="weight">
 					<el-form-item label="每扎重量" prop="weight">
 						<el-input
 						<el-input
-								v-model="replaceForm.weight"
-								placeholder="请输入斤数"
-								size="small"
+							v-model="replaceForm.weight"
+							placeholder="请输入斤数"
+							size="small"
 						></el-input>
 						></el-input>
 					</el-form-item>
 					</el-form-item>
 
 
 					<el-form-item label="每扎成本价" prop="cost">
 					<el-form-item label="每扎成本价" prop="cost">
 						<el-input
 						<el-input
-								v-model="replaceForm.cost"
-								placeholder="请输入成本价"
-								size="small"
+							v-model="replaceForm.cost"
+							placeholder="请输入成本价"
+							size="small"
 						></el-input>
 						></el-input>
 					</el-form-item>
 					</el-form-item>
 
 
 					<el-form-item label="每扎加价" prop="addPrice">
 					<el-form-item label="每扎加价" prop="addPrice">
 						<el-input
 						<el-input
-								v-model="replaceForm.addPrice"
-								placeholder="请输入加价"
-								size="small"
+							v-model="replaceForm.addPrice"
+							placeholder="请输入加价"
+							size="small"
 						></el-input>
 						></el-input>
 					</el-form-item>
 					</el-form-item>
 
 
@@ -202,6 +211,7 @@
 				},
 				},
 				canAddPrice:false,
 				canAddPrice:false,
 				costPrice: false,
 				costPrice: false,
+				costWeight: false,
 				classId: 0,
 				classId: 0,
 				className:'',
 				className:'',
 				showItemModal: false,
 				showItemModal: false,
@@ -359,7 +369,7 @@
 								prop: 'name',
 								prop: 'name',
 								label: '名称',
 								label: '名称',
 								align: 'center',
 								align: 'center',
-								'min-width': 100
+								'min-width': 180
 							},
 							},
 							{
 							{
 								prop: 'className',
 								prop: 'className',
@@ -377,7 +387,7 @@
 								prop: 'cost',
 								prop: 'cost',
 								label: '每扎成本价',
 								label: '每扎成本价',
 								align: 'center',
 								align: 'center',
-								'min-width': 120
+								'min-width': 130
 							},
 							},
 							{
 							{
 								prop: 'addPrice',
 								prop: 'addPrice',
@@ -389,7 +399,7 @@
 								prop: 'weight',
 								prop: 'weight',
 								label: '重量(公斤)',
 								label: '重量(公斤)',
 								align: 'center',
 								align: 'center',
-								'min-width': 90
+								'min-width': 130
 							},
 							},
 							{
 							{
 								prop: 'unit',
 								prop: 'unit',
@@ -457,6 +467,10 @@
 				this.initData = []
 				this.initData = []
 				this.canAddPrice = true
 				this.canAddPrice = true
 			},
 			},
+			showWeight(){
+				this.initData = []
+				this.costWeight = true
+			},
 			showSort (e) {
 			showSort (e) {
 				this.initData = []
 				this.initData = []
 				this.sort.status = true;
 				this.sort.status = true;
@@ -467,6 +481,7 @@
 					this.sort.status = false;
 					this.sort.status = false;
 					this.canAddPrice = false
 					this.canAddPrice = false
 					this.costPrice = false
 					this.costPrice = false
+					this.costWeight = false
 					return;
 					return;
 				}
 				}
 				this.dataList.form.data = JSON.stringify(this.initData)
 				this.dataList.form.data = JSON.stringify(this.initData)
@@ -477,6 +492,7 @@
 				this.sort.status = false;
 				this.sort.status = false;
 				this.canAddPrice = false
 				this.canAddPrice = false
 				this.costPrice = false
 				this.costPrice = false
+				this.costWeight = false
 			},
 			},
 			replaceBtnFn(id) {
 			replaceBtnFn(id) {
 				this.addDialog = true
 				this.addDialog = true
@@ -516,6 +532,8 @@
 					obj.addPrice = d.addPrice
 					obj.addPrice = d.addPrice
 				} else if(type == 'cost') {
 				} else if(type == 'cost') {
 					obj.cost  = d.cost
 					obj.cost  = d.cost
+				}else if(type == 'weight') {
+					obj.weight  = d.weight
 				}
 				}
 				this.initData.push(obj)
 				this.initData.push(obj)
 			}
 			}