Commit 1f033386 by 张立顺

feat 功能联调

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