Commit 36861bb7 by 张立顺

fix bug

1 parent 32c8c682
...@@ -88,6 +88,14 @@ export default { ...@@ -88,6 +88,14 @@ export default {
callback() callback()
} }
} }
var specificationDetailListOther = (rule, value, callback) => {
console.log(this.formObj.specificationDetailList, 'this.formObj.specificationDetailList')
if (!this.formObj.specificationDetailList.some(item => item.useStatus == 0)) {
callback(new Error('至少启用一个规格'))
} else {
callback()
}
}
return { return {
productServiceItemList: [], productServiceItemList: [],
extendServicePartList: [], extendServicePartList: [],
...@@ -107,12 +115,15 @@ export default { ...@@ -107,12 +115,15 @@ export default {
{ required: true, message: '请输入自定义保障部件', trigger: 'blur' }, { required: true, message: '请输入自定义保障部件', trigger: 'blur' },
{ validator: validateSupportPositionOther, trigger: 'blur' } { validator: validateSupportPositionOther, trigger: 'blur' }
], ],
contractList: [{ required: true, message: '请选择关联合同', trigger: ['blur', 'change'] }] contractList: [{ required: true, message: '请选择关联合同', trigger: ['blur', 'change'] }],
// specificationDetailList: [{ required: true, message: '请选择规格', trigger: ['blur', 'change'] }] specificationDetailList: [
{ required: true, message: '请选择规格', trigger: ['blur', 'change'] },
{ validator: specificationDetailListOther, trigger: 'blur' }
]
}, },
formObj: { formObj: {
contractList: [] contractList: [],
// specificationDetailList: [] specificationDetailList: []
}, },
formData: [ formData: [
{ {
...@@ -353,7 +364,7 @@ export default { ...@@ -353,7 +364,7 @@ export default {
const arr = confirmShopData.map(item => { const arr = confirmShopData.map(item => {
// item.upgradePriceEmpty = true // item.upgradePriceEmpty = true
// item.specificationDataEmpty = true // item.specificationDataEmpty = true
if (item.useStatus == 1) { if (item.useStatus == 0) {
// 启用才需要校验 // 启用才需要校验
item.salesCostEmpty = true item.salesCostEmpty = true
item.insuranceCostEmpty = true item.insuranceCostEmpty = true
...@@ -375,7 +386,7 @@ export default { ...@@ -375,7 +386,7 @@ export default {
try { try {
requiredList.map(it => { requiredList.map(it => {
console.log(it, item[it], 'it') console.log(it, item[it], 'it')
if (this.filterEmpty(item[it]) && item.useStatus != 0) { if (this.filterEmpty(item[it]) && item.useStatus == 0) {
throw it throw it
} }
}) })
...@@ -467,6 +478,8 @@ export default { ...@@ -467,6 +478,8 @@ export default {
return params return params
}, },
commit() { commit() {
const confirmShopData = deepClone(this.goodsInfoData.goodsSpecificationList)
this.$set(this.formObj, 'specificationDetailList', confirmShopData)
let params = { let params = {
id: this.routeInfo.type != 1 ? this.routeInfo.id : '', id: this.routeInfo.type != 1 ? this.routeInfo.id : '',
serviceName: this.formObj.serviceName, serviceName: this.formObj.serviceName,
...@@ -486,6 +499,7 @@ export default { ...@@ -486,6 +499,7 @@ export default {
// 没有通过校验 // 没有通过校验
return false return false
} }
// return
let skuData = this.handleAddConfirm(this.goodsInfoData, 2) let skuData = this.handleAddConfirm(this.goodsInfoData, 2)
params = { params = {
...params, ...params,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!