Commit 5e5529ac by 前端

Merge branch 'wangzh_dev_2.3.0' into 'v2.3.0'

套餐编辑数量限制

See merge request !169
2 parents b1331d24 07e917d4
...@@ -122,6 +122,7 @@ export default { ...@@ -122,6 +122,7 @@ export default {
merchantId: 44184606, merchantId: 44184606,
merchantName: '', merchantName: '',
setmealContentRules: false, setmealContentRules: false,
isConfig: false,
//弹窗 //弹窗
//弹窗2(提示弹窗) //弹窗2(提示弹窗)
isTipDialogVisible: false, isTipDialogVisible: false,
...@@ -304,7 +305,7 @@ export default { ...@@ -304,7 +305,7 @@ export default {
}) })
}, },
submitForm(formName) { submitForm(formName) {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(async valid => {
if (!valid) { if (!valid) {
if (this.choseItemList.length <= 0) { if (this.choseItemList.length <= 0) {
this.setmealContentRules = true this.setmealContentRules = true
...@@ -315,11 +316,13 @@ export default { ...@@ -315,11 +316,13 @@ export default {
this.setmealContentRules = true this.setmealContentRules = true
return return
} }
if (this.id) { if (this.id) {
//需要调config的接口???? //需要调config的接口????
// scrm.api.equity.package.service.config // scrm.api.equity.package.service.config
this.configFun()
//调修改的接口 //调修改的接口
this.configFun().then(result => {
if (!result) {
let param = {} let param = {}
param.id = this.id param.id = this.id
param.merchantId = this.merchantId param.merchantId = this.merchantId
...@@ -351,6 +354,8 @@ export default { ...@@ -351,6 +354,8 @@ export default {
.finally(() => { .finally(() => {
this.sloading = false this.sloading = false
}) })
}
})
} else { } else {
//调创建的接口 //调创建的接口
let params = {} let params = {}
...@@ -388,6 +393,7 @@ export default { ...@@ -388,6 +393,7 @@ export default {
}) })
}, },
configFun() { configFun() {
return new Promise(resolve => {
let params = {} let params = {}
params.id = this.id params.id = this.id
let list = this.choseItemList let list = this.choseItemList
...@@ -396,7 +402,16 @@ export default { ...@@ -396,7 +402,16 @@ export default {
params[`list[${i}].serviceId`] = list[i].id params[`list[${i}].serviceId`] = list[i].id
} }
configSetMeal(params).then(res => { configSetMeal(params).then(res => {
console.log('配置接口', res.data) if (res.code == -1) {
this.$message({
message: res.message,
type: 'error'
})
resolve(true)
} else {
resolve(false)
}
})
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!