shish 3 ani în urmă
părinte
comite
c8de84ca6b
2 a modificat fișierele cu 29 adăugiri și 21 ștergeri
  1. 7 9
      pt/src/views/item-cat-relate/list.vue
  2. 22 12
      pt/src/views/item/list.vue

+ 7 - 9
pt/src/views/item-cat-relate/list.vue

@@ -28,6 +28,9 @@
 			<template #table-header-inTurn>
 			<template #table-header-inTurn>
 				<div class="set-sort">
 				<div class="set-sort">
 					<span>排序</span>
 					<span>排序</span>
+					<el-button v-if="!sort.status" icon="el-icon-edit-outline" size="small" type="text" @click="showSort" class="show" >
+					</el-button>
+					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary" >完成</el-button >
 				</div>
 				</div>
 			</template>
 			</template>
 
 
@@ -185,19 +188,14 @@ export default {
 		hideSort(e) {
 		hideSort(e) {
 			this.sort.status = false;
 			this.sort.status = false;
 		},
 		},
-
 		changeSort(d) {
 		changeSort(d) {
-			this.$service.goods
-				.sort({
-					inTurn: d.inTurn,
-					id: d.id,
-				})
+			this.$service.goods .sort({ inTurn: d.inTurn, id: d.id, })
 				.then(() => {
 				.then(() => {
-					this.$message.success('修改成功');
-					this.refresh();
+					this.$message.success('修改成功')
+					this.refresh()
 				})
 				})
 				.catch((err) => {
 				.catch((err) => {
-					this.$message.error(err);
+					this.$message.error(err)
 				});
 				});
 		}
 		}
 	},
 	},

+ 22 - 12
pt/src/views/item/list.vue

@@ -60,18 +60,9 @@
 			<template #table-header-inTurn>
 			<template #table-header-inTurn>
 				<div class="set-sort">
 				<div class="set-sort">
 					<span>排序</span>
 					<span>排序</span>
-					<el-button
-						v-if="!sort.status"
-						icon="el-icon-edit-outline"
-						size="small"
-						type="text"
-						@click="showSort"
-						class="show"
-					></el-button>
-
-					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary"
-						>完成</el-button
-					>
+					<el-button v-if="!sort.status" icon="el-icon-edit-outline" size="small" type="text" @click="showSort" class="show" >
+					</el-button>
+					<el-button class="hide" v-else size="mini" @click="hideSort" type="primary" >完成</el-button >
 				</div>
 				</div>
 			</template>
 			</template>
 
 
@@ -174,6 +165,14 @@
 						></el-input>
 						></el-input>
 					</el-form-item>
 					</el-form-item>
 
 
+					<el-form-item label="排序" prop="inTurn">
+						<el-input
+							v-model="replaceForm.inTurn"
+							placeholder="请输入数值"
+							size="small"
+						></el-input>
+					</el-form-item>
+
 
 
 				</el-form>
 				</el-form>
 			</div>
 			</div>
@@ -220,6 +219,7 @@ export default {
 				smallUnit: '',
 				smallUnit: '',
 				stockWarning:'',
 				stockWarning:'',
 				weight:'',
 				weight:'',
+				inTurn:100,
 				ratio:'',
 				ratio:'',
 				ratioType:0,
 				ratioType:0,
 				ratioTypeName:''
 				ratioTypeName:''
@@ -256,6 +256,10 @@ export default {
 				weight: {
 				weight: {
 					required: true,
 					required: true,
 					message: '重量不能为空',
 					message: '重量不能为空',
+				},
+				inTurn: {
+					required: true,
+					message: '排序不能为空',
 				}
 				}
 			},
 			},
 			//分类列表
 			//分类列表
@@ -321,6 +325,7 @@ export default {
 					stockWarning:'',
 					stockWarning:'',
 					className:'',
 					className:'',
 					weight:'',
 					weight:'',
+					inTurn:100,
 					ratio:'',
 					ratio:'',
 					ratioType:0,
 					ratioType:0,
 					py:''
 					py:''
@@ -359,6 +364,10 @@ export default {
 						weight: {
 						weight: {
 							required: true,
 							required: true,
 								message: '重量不能为空',
 								message: '重量不能为空',
+						},
+						inTurn:{
+							required:true,
+							message:'排序不能为空',
 						}
 						}
 					};
 					};
 					let index = this.itemClassList.findIndex((e) => e.id == res.classId)
 					let index = this.itemClassList.findIndex((e) => e.id == res.classId)
@@ -370,6 +379,7 @@ export default {
 					this.replaceForm.smallUnit = res.smallUnit
 					this.replaceForm.smallUnit = res.smallUnit
 					this.replaceForm.stockWarning = res.stockWarning
 					this.replaceForm.stockWarning = res.stockWarning
 					this.replaceForm.weight = res.weight
 					this.replaceForm.weight = res.weight
+					this.replaceForm.inTurn = res.inTurn
 					this.replaceForm.ratio = res.ratio
 					this.replaceForm.ratio = res.ratio
 					this.replaceForm.ratioType = res.ratioType
 					this.replaceForm.ratioType = res.ratioType
 					if(res.ratioType == 0){
 					if(res.ratioType == 0){