|
@@ -488,17 +488,16 @@ export default {
|
|
console.log(_this.setTableData)
|
|
console.log(_this.setTableData)
|
|
if (_this.form.discountType != '0' && _this.setTableData) {
|
|
if (_this.form.discountType != '0' && _this.setTableData) {
|
|
const hasTemp = _this.setTableData.some(item => {
|
|
const hasTemp = _this.setTableData.some(item => {
|
|
- if (_this.form.discountType == '2' || _this.setTableData.length == 1) {
|
|
|
|
|
|
+ if (_this.form.discountType == '2') {
|
|
return item.provinceValue == undefined || item.cityValue == undefined || item.specialValue == undefined
|
|
return item.provinceValue == undefined || item.cityValue == undefined || item.specialValue == undefined
|
|
}
|
|
}
|
|
- return item.orginAmountValue == 0 || item.provinceValue == undefined || item.cityValue == undefined || item.specialValue == undefined
|
|
|
|
|
|
+ return item.orginAmountValue == undefined || item.provinceValue == undefined || item.cityValue == undefined || item.specialValue == undefined
|
|
})
|
|
})
|
|
if (hasTemp) {
|
|
if (hasTemp) {
|
|
- _this.$message.warning(_this.form.discountType == '2' || _this.setTableData.length == 1 ? '特价规则条件不能为空!' : '特价规则条件不能为空且原价金额必需大于0!')
|
|
|
|
|
|
+ _this.$message.warning('特价规则条件不能为空!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- console.log(_this.form)
|
|
|
|
// 验证表格必填项
|
|
// 验证表格必填项
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
if (form.gateFlag === '1') {
|
|
if (form.gateFlag === '1') {
|
|
@@ -525,7 +524,6 @@ export default {
|
|
if (_this.isJudge(form.specialProductList, '特价')) {
|
|
if (_this.isJudge(form.specialProductList, '特价')) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- console.log(form)
|
|
|
|
// 校验产品折扣手动输入必填项
|
|
// 校验产品折扣手动输入必填项
|
|
if (form.discountType === '0') {
|
|
if (form.discountType === '0') {
|
|
const isCountEmpty = _this.isNumEmpty(form.specialProductList)
|
|
const isCountEmpty = _this.isNumEmpty(form.specialProductList)
|
|
@@ -542,7 +540,6 @@ export default {
|
|
form.cityValue = _this.setTableData[0].cityValue
|
|
form.cityValue = _this.setTableData[0].cityValue
|
|
form.specialValue = _this.setTableData[0].specialValue
|
|
form.specialValue = _this.setTableData[0].specialValue
|
|
} else {
|
|
} else {
|
|
- console.log(form)
|
|
|
|
// 折扣
|
|
// 折扣
|
|
form.specialDiscountList = _this.setTableData.map((item, index) => {
|
|
form.specialDiscountList = _this.setTableData.map((item, index) => {
|
|
return {
|
|
return {
|
|
@@ -554,7 +551,6 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- console.log(form)
|
|
|
|
// 组后端所需数据
|
|
// 组后端所需数据
|
|
form.promotionSn = _this.promotionSn
|
|
form.promotionSn = _this.promotionSn
|
|
// 门槛描述
|
|
// 门槛描述
|
|
@@ -581,7 +577,6 @@ export default {
|
|
}
|
|
}
|
|
infoDetail += `<div>${form.borrowTimeLimtType ? '产品累计:' + (form.borrowTimeLimtType == 'LENGTH_YEAR' ? '近一年' : '本年度') : ''}${form.borrowedShowFlag === '1' ? ',加盟商显示“转促”标签;' : ''}</div>`
|
|
infoDetail += `<div>${form.borrowTimeLimtType ? '产品累计:' + (form.borrowTimeLimtType == 'LENGTH_YEAR' ? '近一年' : '本年度') : ''}${form.borrowedShowFlag === '1' ? ',加盟商显示“转促”标签;' : ''}</div>`
|
|
form.ruleInfo = infoDetail
|
|
form.ruleInfo = infoDetail
|
|
- console.log(form)
|
|
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
promotionSave(form).then(res => {
|
|
promotionSave(form).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|