|
|
@ -130,7 +130,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleAddCondition() { |
|
|
|
handleAddCondition() { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
const keys = form.getFieldValue('fliter_condition') |
|
|
|
const key = form.getFieldValue('fliter_condition') |
|
|
|
|
|
|
|
const keys = key ? key : [] |
|
|
|
const nextKeys = keys.concat([{ category: '', profit: '', profit_rate: '', id: this.generateRandomString(8) }]) |
|
|
|
const nextKeys = keys.concat([{ category: '', profit: '', profit_rate: '', id: this.generateRandomString(8) }]) |
|
|
|
form.setFieldsValue({ |
|
|
|
form.setFieldsValue({ |
|
|
|
fliter_condition: nextKeys, |
|
|
|
fliter_condition: nextKeys, |
|
|
@ -166,7 +167,6 @@ export default { |
|
|
|
x.id = this.generateRandomString(8) |
|
|
|
x.id = this.generateRandomString(8) |
|
|
|
return x |
|
|
|
return x |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
record.fliter_condition.forEach((x, i) => { |
|
|
|
record.fliter_condition.forEach((x, i) => { |
|
|
|
record[`profit${i}`] = x.profit |
|
|
|
record[`profit${i}`] = x.profit |
|
|
|
record[`profit_rate${i}`] = x.profit_rate |
|
|
|
record[`profit_rate${i}`] = x.profit_rate |
|
|
@ -209,7 +209,9 @@ export default { |
|
|
|
Api.info() |
|
|
|
Api.info() |
|
|
|
.then((result) => { |
|
|
|
.then((result) => { |
|
|
|
// 当前记录 |
|
|
|
// 当前记录 |
|
|
|
result.data.storeInfo.open_channel = result.data.storeInfo.open_channel.split(',') |
|
|
|
result.data.storeInfo.open_channel = result.data.storeInfo.open_channel |
|
|
|
|
|
|
|
? result.data.storeInfo.open_channel.split(',') |
|
|
|
|
|
|
|
: undefined |
|
|
|
this.record = result.data.storeInfo |
|
|
|
this.record = result.data.storeInfo |
|
|
|
// 设置默认值 |
|
|
|
// 设置默认值 |
|
|
|
this.setFieldsValue() |
|
|
|
this.setFieldsValue() |
|
|
@ -243,6 +245,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
params.open_channel = values.open_channel ? values.open_channel.join(',') : '' |
|
|
|
params.open_channel = values.open_channel ? values.open_channel.join(',') : '' |
|
|
|
|
|
|
|
params.fliter_condition = params.fliter_condition.length > 0 ? params.fliter_condition : [] |
|
|
|
this.isLoading = true |
|
|
|
this.isLoading = true |
|
|
|
Api.update({ form: params }) |
|
|
|
Api.update({ form: params }) |
|
|
|
.then((result) => { |
|
|
|
.then((result) => { |
|
|
|