|
@@ -663,7 +663,7 @@ export default {
|
|
disabled: true,
|
|
disabled: true,
|
|
defaultValue: '',
|
|
defaultValue: '',
|
|
placeholder: '请输入${title}',
|
|
placeholder: '请输入${title}',
|
|
- validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
|
|
+ // validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '多属性',
|
|
title: '多属性',
|
|
@@ -1087,69 +1087,69 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (!formData.unit) {
|
|
|
|
- //此时为多单位
|
|
|
|
- // if (formData.meList.length < 2) {
|
|
|
|
- // this.$message.warning('多单位的商品条码行数至少要有两行,请再新增一行条码信息!')
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- if (formData.meList[0].commodityUnit != basicUnit) {
|
|
|
|
- this.$message.warning(
|
|
|
|
- '条码之后的单位填写有误,单位【' +
|
|
|
|
- formData.meList[0].commodityUnit +
|
|
|
|
- '】请修改为【' +
|
|
|
|
- basicUnit +
|
|
|
|
- '】!'
|
|
|
|
- )
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (formData.meList[1].commodityUnit != otherUnit) {
|
|
|
|
- this.$message.warning(
|
|
|
|
- '条码之后的单位填写有误,单位【' +
|
|
|
|
- formData.meList[1].commodityUnit +
|
|
|
|
- '】请修改为【' +
|
|
|
|
- otherUnit +
|
|
|
|
- '】!'
|
|
|
|
- )
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // if (!formData.unit) {
|
|
|
|
+ // // 此时为多单位
|
|
|
|
+ // if (formData.meList.length < 2) {
|
|
|
|
+ // this.$message.warning('多单位的商品条码行数至少要有两行,请再新增一行条码信息!')
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // if (formData.meList[0].commodityUnit != basicUnit) {
|
|
|
|
+ // this.$message.warning(
|
|
|
|
+ // '条码之后的单位填写有误,单位【' +
|
|
|
|
+ // formData.meList[0].commodityUnit +
|
|
|
|
+ // '】请修改为【' +
|
|
|
|
+ // basicUnit +
|
|
|
|
+ // '】!'
|
|
|
|
+ // )
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // if (formData.meList[1].commodityUnit != otherUnit) {
|
|
|
|
+ // this.$message.warning(
|
|
|
|
+ // '条码之后的单位填写有误,单位【' +
|
|
|
|
+ // formData.meList[1].commodityUnit +
|
|
|
|
+ // '】请修改为【' +
|
|
|
|
+ // otherUnit +
|
|
|
|
+ // '】!'
|
|
|
|
+ // )
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
let skuCount = 0
|
|
let skuCount = 0
|
|
for (let i = 0; i < formData.meList.length; i++) {
|
|
for (let i = 0; i < formData.meList.length; i++) {
|
|
- let commodityUnit = formData.meList[i].commodityUnit
|
|
|
|
- if (formData.unit) {
|
|
|
|
- if (commodityUnit != formData.unit) {
|
|
|
|
- this.$message.warning(
|
|
|
|
- '条码之后的单位填写有误,单位【' + commodityUnit + '】请修改为【' + formData.unit + '】!'
|
|
|
|
- )
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- } else if (formData.unitId) {
|
|
|
|
- if (
|
|
|
|
- commodityUnit != basicUnit &&
|
|
|
|
- commodityUnit != otherUnit &&
|
|
|
|
- commodityUnit != otherUnitTwo &&
|
|
|
|
- commodityUnit != otherUnitThree
|
|
|
|
- ) {
|
|
|
|
- let warnInfo =
|
|
|
|
- '条码之后的单位填写有误,单位【' +
|
|
|
|
- commodityUnit +
|
|
|
|
- '】请修改为【' +
|
|
|
|
- basicUnit +
|
|
|
|
- '】或【' +
|
|
|
|
- otherUnit +
|
|
|
|
- '】'
|
|
|
|
- if (otherUnitTwo) {
|
|
|
|
- warnInfo += '或【' + otherUnitTwo + '】'
|
|
|
|
- }
|
|
|
|
- if (otherUnitThree) {
|
|
|
|
- warnInfo += '或【' + otherUnitThree + '】'
|
|
|
|
- }
|
|
|
|
- warnInfo += '!'
|
|
|
|
- this.$message.warning(warnInfo)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // let commodityUnit = formData.meList[i].commodityUnit
|
|
|
|
+ // if (formData.unit) {
|
|
|
|
+ // if (commodityUnit != formData.unit) {
|
|
|
|
+ // this.$message.warning(
|
|
|
|
+ // '条码之后的单位填写有误,单位【' + commodityUnit + '】请修改为【' + formData.unit + '】!'
|
|
|
|
+ // )
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // } else if (formData.unitId) {
|
|
|
|
+ // if (
|
|
|
|
+ // commodityUnit != basicUnit &&
|
|
|
|
+ // commodityUnit != otherUnit &&
|
|
|
|
+ // commodityUnit != otherUnitTwo &&
|
|
|
|
+ // commodityUnit != otherUnitThree
|
|
|
|
+ // ) {
|
|
|
|
+ // let warnInfo =
|
|
|
|
+ // '条码之后的单位填写有误,单位【' +
|
|
|
|
+ // commodityUnit +
|
|
|
|
+ // '】请修改为【' +
|
|
|
|
+ // basicUnit +
|
|
|
|
+ // '】或【' +
|
|
|
|
+ // otherUnit +
|
|
|
|
+ // '】'
|
|
|
|
+ // if (otherUnitTwo) {
|
|
|
|
+ // warnInfo += '或【' + otherUnitTwo + '】'
|
|
|
|
+ // }
|
|
|
|
+ // if (otherUnitThree) {
|
|
|
|
+ // warnInfo += '或【' + otherUnitThree + '】'
|
|
|
|
+ // }
|
|
|
|
+ // warnInfo += '!'
|
|
|
|
+ // this.$message.warning(warnInfo)
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
if (formData.sku) {
|
|
if (formData.sku) {
|
|
skuCount++
|
|
skuCount++
|
|
}
|
|
}
|
|
@@ -1411,7 +1411,17 @@ export default {
|
|
},
|
|
},
|
|
onAdded(event) {
|
|
onAdded(event) {
|
|
const { row, target } = event
|
|
const { row, target } = event
|
|
- target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: '' } }])
|
|
|
|
|
|
+ let formUnit = ''
|
|
|
|
+ // 勾选多单位
|
|
|
|
+ if(this.unitChecked){
|
|
|
|
+ const obj = this.unitList.find(item => item.id === this.form.getFieldValue('unitId'))
|
|
|
|
+ if(obj){
|
|
|
|
+ formUnit = obj.basicUnit
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ formUnit = this.form.getFieldValue('unit')
|
|
|
|
+ }
|
|
|
|
+ target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit } }])
|
|
},
|
|
},
|
|
onDeleted(value) {
|
|
onDeleted(value) {
|
|
this.meDeleteIdList = value
|
|
this.meDeleteIdList = value
|