Commit 8887103c by Lin

优化 buildSubmitData 方法,简化 merchantId 的赋值逻辑,并在 bySystemMerchant 为 true 时动态添加 potentialCustomerId 字段。

1 parent 61fa62a7
...@@ -646,8 +646,10 @@ Page({ ...@@ -646,8 +646,10 @@ Page({
// 构建提交数据 // 构建提交数据
buildSubmitData() { buildSubmitData() {
const { formList, bySystemMerchant } = this.data const { formList, bySystemMerchant } = this.data
const merchantId = formList[FORM_FIELDS.MERCHANT].value || null
return { return {
merchantId: formList[FORM_FIELDS.MERCHANT].value || null, merchantId,
...(bySystemMerchant ? { potentialCustomerId: merchantId } : {}),
merchantName: formList[FORM_FIELDS.MERCHANT].displayValue, merchantName: formList[FORM_FIELDS.MERCHANT].displayValue,
// salesVolume: bySystemMerchant ? formList[FORM_FIELDS.SALES].value : null, // salesVolume: bySystemMerchant ? formList[FORM_FIELDS.SALES].value : null,
// brand: bySystemMerchant ? formList[FORM_FIELDS.BRANDS].displayValue : null, // brand: bySystemMerchant ? formList[FORM_FIELDS.BRANDS].displayValue : null,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!