Commit b77d2f07 by 张立顺

fix 修改提交逻辑

1 parent 0d52be43
......@@ -29,7 +29,7 @@
"dayjs": "^1.8.12",
"default-passive-events": "^2.0.0",
"echarts": "^5.3.2",
"element-ui": "^2.13.1",
"element-ui": "2.13.2",
"eslint-plugin-standard": "^5.0.0",
"file-saver": "^2.0.5",
"flex.css": "^1.1.7",
......
......@@ -784,27 +784,24 @@ export default {
const flag = array.every((item) => item)
return obj && flag
},
async handleWorking(){
const res = this.getParams()
const goodsTypeGroupRules = await this.getGoodsTypeGroupRules(
this.editableTabs
)
this.submitParams = {
...res,
goodsTypeGroupRules
}
},
async submit() {
// const res = await this.handlerConfirm()
async handleWorking() {
// const res = this.getParams()
// const goodsTypeGroupRules = await this.getGoodsTypeGroupRules(
// this.editableTabs
// )
// console.log(res, goodsTypeGroupRules, "goodsTypeGroupRules")
// if (!this.checkParamsType(res, goodsTypeGroupRules)) {
// this.$message.warning("请完善分账规则")
// return false
// }
// 并行执行关键异步操作
const [res, goodsTypeGroupRules] = await Promise.all([
this.getParams(),
this.getGoodsTypeGroupRules(this.editableTabs)
])
this.submitParams = {
...res,
goodsTypeGroupRules
}
console.log(this.submitParams, "this.submitParams ")
return this.submitParams
},
async submit() {
try {
// 并行执行关键异步操作
const [res, goodsTypeGroupRules] = await Promise.all([
......@@ -820,10 +817,8 @@ export default {
...res,
goodsTypeGroupRules
}
// console.log(this.submitParams, "this.submitParams ")
this.checkCalculateType()
this.verificationCodeVisible = true
console.log(this.submitParams, "this.submitParams ")
return true
} catch (error) {
console.log(error, "submitError")
......
......@@ -751,7 +751,7 @@ export default {
this.smsCode = smsCode
this.submitFormData()
},
handleWorking(){
handleWorking() {
return new Promise(async (resolve, reject) => {
// 校验重置数据 防止重复push
this.goodsTypeGroupRulesAll = []
......@@ -767,25 +767,24 @@ export default {
if (res) {
this.goodsTypeGroupRulesAll.push(res)
}
}
const {
shopMerchantTotalFeeCalculateType,
shopMerchantExpenseCategoryValue,
partnerMerchantTotalFeeCalculateType,
partnerMerchantExpenseCategoryValue
} = this.formObj
const params = {
// merchantId: this.merchantRow.merchantId,
// sceneType: this.merchantRow.scene,
goodsTypeGroupRules: this.goodsTypeGroupRulesAll,
shopMerchantTotalFeeCalculateType,
shopMerchantExpenseCategoryValue,
partnerMerchantTotalFeeCalculateType,
partnerMerchantExpenseCategoryValue
}
shopMerchantTotalFeeCalculateType,
shopMerchantExpenseCategoryValue,
partnerMerchantTotalFeeCalculateType,
partnerMerchantExpenseCategoryValue
} = this.formObj
const params = {
// merchantId: this.merchantRow.merchantId,
// sceneType: this.merchantRow.scene,
goodsTypeGroupRules: this.goodsTypeGroupRulesAll,
shopMerchantTotalFeeCalculateType,
shopMerchantExpenseCategoryValue,
partnerMerchantTotalFeeCalculateType,
partnerMerchantExpenseCategoryValue
}
this.submitParams = params
resolve(params)
})
},
// 提交信息
......
......@@ -105,10 +105,13 @@ export default {
},
async handleConfirm(confirmType) {
let settleDistributeRule
let reconciliationRule
if (confirmType == "save") {
const divisionSubmitResult = await this.$refs.divisionConfig.submit()
const financeSubmitResult = await this.$refs.financeConfig.submit()
const merchantSubmitResult = await this.$refs.merchant.submit()
const merchantSubmitResult = await this.$refs.shopMerchant.submit()
// console.log(!merchantSubmitResult, "merchantSubmitResult")
if (
!merchantSubmitResult ||
!divisionSubmitResult ||
......@@ -119,17 +122,21 @@ export default {
}
} else {
// 存草稿
this.$refs.divisionConfig.handleWorking()
this.$refs.financeConfig.handleWorking()
settleDistributeRule = await this.$refs.divisionConfig.handleWorking()
reconciliationRule = await this.$refs.financeConfig.handleWorking()
}
console.log(settleDistributeRule, "settleDistributeRule")
console.log(reconciliationRule, "reconciliationRule")
var params = {
saveDraft: confirmType == "draft",
businessCode: this.routeObj.businessCode,
goods: this.$refs.goodsInfo.submitParamsGoods(),
packages: this.$refs.goodsInfo.submitParamsPackages(),
merchant: this.$refs.shopMerchant.editData,
settleDistributeRule: this.$refs.divisionConfig.submitParams,
reconciliationRule: this.$refs.financeConfig.submitParams
settleDistributeRule:
settleDistributeRule || this.$refs.divisionConfig.submitParams,
reconciliationRule:
reconciliationRule || this.$refs.financeConfig.submitParams
}
console.log(params, "params----")
operationConfirmJson({ dataString: JSON.stringify(params) }).then(
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!