|
@@ -443,7 +443,12 @@ export default {
|
|
|
message: '现金金额不能为空',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ goodsCategoryId: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择商品分类',
|
|
|
+ trigger: 'blur'
|
|
|
+ }]
|
|
|
},
|
|
|
categoryList: [],
|
|
|
brandList: [],
|
|
@@ -557,8 +562,8 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getGoods(id).then((response) => {
|
|
|
this.form = response.data
|
|
|
- this.form.brandId = Number(this.form.brandId)
|
|
|
- this.form.goodsCategoryId = Number(this.form.goodsCategoryId)
|
|
|
+ this.form.brandId = this.form.brandId ? Number(this.form.brandId) : ''
|
|
|
+ this.form.goodsCategoryId = this.form.goodsCategoryId ? Number(this.form.goodsCategoryId) : ''
|
|
|
if (this.form.goodsImgs != null && this.form.goodsImgs != '') {
|
|
|
this.form.goodsImgs.split(',').forEach((item) => {
|
|
|
const vo = {
|
|
@@ -568,6 +573,7 @@ export default {
|
|
|
this.imgsList.push(vo)
|
|
|
})
|
|
|
}
|
|
|
+ this.form = JSON.parse(JSON.stringify(this.form))
|
|
|
this.open = true
|
|
|
this.title = '修改商品管理'
|
|
|
})
|