main
fanfan 6 months ago
parent c193a9da15
commit f8abcd9e3e
  1. 9
      src/views/goods/filter/Index.vue

@ -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) => {

Loading…
Cancel
Save