master
fanfan 6 months ago
parent 274ba3c10b
commit 35a93cf7f5
  1. 15
      src/views/goods/filter/Index.vue

@ -37,7 +37,7 @@
:treeData="formData.categoryList" :treeData="formData.categoryList"
treeCheckable treeCheckable
allowClear allowClear
treeCheckStrictly showCheckedStrategy="SHOW_ALL"
@select="onSelect(index, $event)" @select="onSelect(index, $event)"
@focus="handleSelectChange(index)" @focus="handleSelectChange(index)"
v-decorator="[`category${k.id}`, { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]" v-decorator="[`category${k.id}`, { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]"
@ -232,7 +232,7 @@ export default {
record.fliter_condition.forEach((x, i) => { record.fliter_condition.forEach((x, i) => {
record[`profit${x.id}`] = x.profit record[`profit${x.id}`] = x.profit
record[`profit_rate${x.id}`] = x.profit_rate record[`profit_rate${x.id}`] = x.profit_rate
record[`category${x.id}`] = this.formatCategoryIds(x.category) record[`category${x.id}`] = x.category
categoryAry.push(`category${x.id}`) categoryAry.push(`category${x.id}`)
profitAry.push(`profit${x.id}`) profitAry.push(`profit${x.id}`)
profitRateAry.push(`profit_rate${x.id}`) profitRateAry.push(`profit_rate${x.id}`)
@ -298,6 +298,7 @@ export default {
// api // api
onFormSubmit(values) { onFormSubmit(values) {
const params = {} const params = {}
params.fliter_condition = values.fliter_condition.map((x, i) => { params.fliter_condition = values.fliter_condition.map((x, i) => {
return { return {
@ -306,11 +307,11 @@ export default {
profit_rate: values[`profit_rate${x.id}`], profit_rate: values[`profit_rate${x.id}`],
} }
}) })
if (params.fliter_condition.length > 0) { // if (params.fliter_condition.length > 0) {
params.fliter_condition.forEach((item) => { // params.fliter_condition.forEach((item) => {
item.category = Array.from(item.category, ({ value }) => value) // item.category = Array.from(item.category, ({ value }) => value)
}) // })
} // }
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 : [] params.fliter_condition = params.fliter_condition.length > 0 ? params.fliter_condition : []
this.isLoading = true this.isLoading = true

Loading…
Cancel
Save