|
|
@@ -18,11 +18,11 @@
|
|
|
</el-tabs>
|
|
|
</template>
|
|
|
|
|
|
- <template #table-column-avatarUrl="{ scope }">
|
|
|
+ <template #table-column-cover="{ scope }">
|
|
|
<cl-avatar
|
|
|
shape="square"
|
|
|
:size="32"
|
|
|
- :src="scope.row.smallImgList[0]"
|
|
|
+ :src="scope.row.cover"
|
|
|
:style="{ margin: 'auto' }"
|
|
|
></cl-avatar>
|
|
|
</template>
|
|
|
@@ -248,7 +248,6 @@ export default {
|
|
|
weight:'',
|
|
|
ratio:''
|
|
|
},
|
|
|
- addOrModify: 1,
|
|
|
replaceFormRules: {
|
|
|
name: {
|
|
|
required: true,
|
|
|
@@ -262,11 +261,11 @@ export default {
|
|
|
required: true,
|
|
|
message: '请选择分类',
|
|
|
},
|
|
|
- bigUnit: {
|
|
|
+ bigUnitId: {
|
|
|
required: true,
|
|
|
message: '请选择大单位',
|
|
|
},
|
|
|
- smallUnit: {
|
|
|
+ smallUnitId: {
|
|
|
required: true,
|
|
|
message: '请选择小单位',
|
|
|
},
|
|
|
@@ -305,11 +304,11 @@ export default {
|
|
|
},
|
|
|
selBigUnitFn(val) {
|
|
|
let index = this.unitList.findIndex((e) => e.name == val);
|
|
|
- this.replaceForm.bigUnit = this.unitList[index].id;
|
|
|
+ this.replaceForm.bigUnitId = this.unitList[index].id;
|
|
|
},
|
|
|
selSmallUnitFn(val) {
|
|
|
let index = this.unitList.findIndex((e) => e.name == val);
|
|
|
- this.replaceForm.smallUnit = this.unitList[index].id;
|
|
|
+ this.replaceForm.smallUnitId = this.unitList[index].id;
|
|
|
},
|
|
|
getAllClass() {
|
|
|
if (!this.$util.isEmpty(this.itemClassList)) {
|
|
|
@@ -339,6 +338,7 @@ export default {
|
|
|
this.replaceForm = {
|
|
|
name: '',
|
|
|
alias: '',
|
|
|
+ classId:'',
|
|
|
cover: '',
|
|
|
bigUnitId: '',
|
|
|
bigUnit: '',
|
|
|
@@ -347,12 +347,30 @@ export default {
|
|
|
stockWarning:'',
|
|
|
cost:'',
|
|
|
addPrice:'',
|
|
|
+ className:'',
|
|
|
weight:'',
|
|
|
ratio:''
|
|
|
}
|
|
|
}else{
|
|
|
this.$service.item.getDetail({id:id}).then(async res => {
|
|
|
- this.replaceForm = res
|
|
|
+
|
|
|
+ let index = this.itemClassList.findIndex((e) => e.id == res.classId)
|
|
|
+ this.replaceForm.name = res.name
|
|
|
+ this.replaceForm.alias = res.alias
|
|
|
+ this.replaceForm.cover = res.cover
|
|
|
+ this.replaceForm.bigUnitId = res.bigUnitId
|
|
|
+ this.replaceForm.bigUnit = res.bigUnit
|
|
|
+ this.replaceForm.smallUnitId = res.smallUnitId
|
|
|
+ this.replaceForm.smallUnit = res.smallUnit
|
|
|
+ this.replaceForm.stockWarning = res.stockWarning
|
|
|
+ this.replaceForm.cost = res.cost
|
|
|
+ this.replaceForm.addPrice = res.addPrice
|
|
|
+ this.replaceForm.weight = res.weight
|
|
|
+ this.replaceForm.ratio = res.ratio
|
|
|
+ this.replaceForm.classId = res.classId
|
|
|
+ this.replaceForm.className = this.itemClassList[index].name
|
|
|
+ this.$forceUpdate()
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -387,6 +405,18 @@ export default {
|
|
|
align: 'center',
|
|
|
'min-width': 180,
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'cover',
|
|
|
+ label: '封面',
|
|
|
+ align: 'center',
|
|
|
+ 'min-width': 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'classId',
|
|
|
+ label: '分类',
|
|
|
+ align: 'center',
|
|
|
+ 'min-width': 100,
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'stockWarning',
|
|
|
label: '库存预警',
|
|
|
@@ -510,7 +540,7 @@ export default {
|
|
|
} else {
|
|
|
host = () => {
|
|
|
return this.$service.item.update({
|
|
|
- id: this.modifyData.id,
|
|
|
+ id: this.currentItemId,
|
|
|
...form,
|
|
|
})
|
|
|
}
|