Commit 1f033386 by 张立顺

feat 功能联调

1 parent bd5ff9e9
......@@ -785,25 +785,38 @@ export default {
return obj && flag
},
async submit() {
const res = await this.handlerConfirm()
const goodsTypeGroupRules = await this.getGoodsTypeGroupRules(
this.editableTabs
)
if (!this.checkParamsType(res, goodsTypeGroupRules)) {
this.$message.warning("请完善分账规则")
return false
}
// const res = await this.handlerConfirm()
// const goodsTypeGroupRules = await this.getGoodsTypeGroupRules(
// this.editableTabs
// )
// console.log(res, goodsTypeGroupRules, "goodsTypeGroupRules")
// if (!this.checkParamsType(res, goodsTypeGroupRules)) {
// this.$message.warning("请完善分账规则")
// return false
// }
try {
// 并行执行关键异步操作
const [res, goodsTypeGroupRules] = await Promise.all([
this.handlerConfirm(),
this.getGoodsTypeGroupRules(this.editableTabs)
])
if (!this.checkParamsType(res, goodsTypeGroupRules)) {
this.$message.warning("请完善分账规则")
return
}
this.submitParams = {
...res,
goodsTypeGroupRules
}
console.log(this.submitParams, "this.submitParams ")
// console.log(this.submitParams, "this.submitParams ")
this.checkCalculateType()
this.verificationCodeVisible = true
console.log(this.submitParams, "this.submitParams ")
return true
} catch (error) {}
} catch (error) {
console.log(error, "submitError")
}
// if (!res || !goodsTypeGroupRules) return false // 没有通过检验
},
checkCalculateType() {
......
......@@ -1445,10 +1445,8 @@ export default {
this.$refs.classification.validate(async (valid) => {
// console.log(valid)
if (valid) {
// console.log(this.getParams())
const obj = this.getParams()
const res = await this.$refs.tableAccount.handleConfirm()
// console.log("res", { ...obj, merchantDistributionRules: res })
res
? resolve({ ...obj, merchantDistributionRules: res })
: resolve(false)
......@@ -1463,31 +1461,15 @@ export default {
const res = this.$refs.tableAccount.getTableAccountParams()
// console.log("res", { ...obj, merchantDistributionRules: res })
return { ...obj, merchantDistributionRules: res }
// : resolve(false)
// return new Promise((resolve, reject) => {
// this.$refs.classification.validate(async (valid) => {
// console.log(valid)
// if (valid) {
// // console.log(this.getParams())
// const obj = this.getParams()
// const res = await this.$refs.tableAccount.handleConfirm()
// console.log("res", { ...obj, merchantDistributionRules: res })
// res
// ? resolve({ ...obj, merchantDistributionRules: res })
// : resolve(false)
// } else {
// resolve(false)
// }
// })
// })
},
setCalculateError(index, item, flag = true) {
if (this.classificationObj[item][index])
if (this.classificationObj[item][index]) {
this.$set(
this.classificationObj[item][index],
"calculateModeError",
flag
)
}
}
},
beforeDestroy() {
......
......@@ -103,22 +103,14 @@ export default {
console.log("新建---")
this.addMerVisible = !this.addMerVisible
},
handleConfirm(confirmType) {
// this.$refs.divisionConfig.submit()
// this.$refs.financeConfig.submit()
async handleConfirm(confirmType) {
const divisionSubmitResult = await this.$refs.divisionConfig.submit()
const financeSubmitResult = await this.$refs.financeConfig.submit()
if (confirmType == "save") {
// console.log(
// !this.$refs.shopMerchant.submit(),
// !this.$refs.divisionConfig.submit(),
// !this.$refs.financeConfig.submit()
// )
// 各模块校验
if (
// !this.$refs.shopMerchant.submit() ||
!this.$refs.divisionConfig.submit() ||
!this.$refs.financeConfig.submit()
) {
return true
if (!divisionSubmitResult || !financeSubmitResult) {
// 校验失败,处理逻辑
return
}
}
var params = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!