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

@ -130,7 +130,8 @@ export default {
},
handleAddCondition() {
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) }])
form.setFieldsValue({
fliter_condition: nextKeys,
@ -166,7 +167,6 @@ export default {
x.id = this.generateRandomString(8)
return x
})
record.fliter_condition.forEach((x, i) => {
record[`profit${i}`] = x.profit
record[`profit_rate${i}`] = x.profit_rate
@ -181,7 +181,7 @@ export default {
}
if (record.open_channel) {
const list = record.open_channel
const channelAry = []
const channelAry=[]
this.checkList.map((item) => {
if (list.indexOf(item.id) != -1) {
channelAry.push(item.name)
@ -193,7 +193,7 @@ export default {
!isEmpty(form.getFieldsValue()) &&
$nextTick(() => {
form.setFieldsValue(
pick(record, ['open_channel', 'fliter_condition', ...profitAry, ...profitRateAry, ...categoryAry])
pick(record, ['open_channel', 'fliter_condition',...profitAry, ...profitRateAry, ...categoryAry])
)
this.$forceUpdate()
})
@ -209,7 +209,9 @@ export default {
Api.info()
.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.setFieldsValue()
@ -243,6 +245,7 @@ export default {
}
})
params.open_channel = values.open_channel ? values.open_channel.join(',') : ''
params.fliter_condition = params.fliter_condition.length > 0 ? params.fliter_condition : []
this.isLoading = true
Api.update({ form: params })
.then((result) => {

Loading…
Cancel
Save