Commit 80e0c3a3 by Jaxon

fix(performanceScheme): 修复价格区间起始值计算和商品品类组件选项传递

- 修复新增价格区间时起始值可能超出最大值的问题
- 修复商品品类级联组件选项传递问题,移除对Vuex状态的直接依赖
- 统一价格区间输入框属性绑定,使用assessmentFactorOptions.componentProps
1 parent 8fecf06c
<template>
<div class="">
<el-cascader clearable
:options="goodsCategory"
:options="options"
placeholder="请选择商品品类"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }"
:show-all-levels="false"
......@@ -17,6 +17,10 @@ import { mapState } from "vuex";
export default {
name: "",
props: {
options: {
type: Array,
default: () => [],
},
value: {
type: Array,
default: () => [],
......@@ -28,7 +32,7 @@ export default {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList", "commissionTypesOptions", "goodsCategory"]),
...mapState("PerformanceFormStore", ["formData", "goodsCategory"]),
},
mounted() {
......
......@@ -111,11 +111,11 @@ export default {
return;
}
}
const componentsPropsMax = this.curParamsConfig.assessmentFactorOptions.componentProps.max;
const lastPriceRange = last(this.curParamsConfig[templateType])?.priceRange || [0, 0];
const nPriceRange = [undefined, undefined];
if (lastPriceRange && lastPriceRange[1]) {
nPriceRange[0] = lastPriceRange[1] + 0.01;
nPriceRange[0] = lastPriceRange[1] >= componentsPropsMax ? undefined : lastPriceRange[1] + 0.01;
nPriceRange[1] = undefined;
}
this.curParamsConfig[templateType].push({
......
......@@ -14,7 +14,7 @@
:controls="false"
:disabled="$index === 0"
type="number"
v-bind="curParamsConfig.priceRangeProps"
v-bind="curParamsConfig.assessmentFactorOptions.componentProps"
@change="handlePriceRangeChange($index, 0)">
</EditableText>
<div class="tag">
......@@ -23,7 +23,7 @@
<EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[1]"
:controls="false"
type="number"
v-bind="curParamsConfig.priceRangeProps"
v-bind="curParamsConfig.assessmentFactorOptions.componentProps"
@change="handlePriceRangeChange($index, 1)">
</EditableText>
</div>
......@@ -67,6 +67,7 @@
</el-button> -->
<GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="curParamsConfig.ParamsType1Products[index].productLabel"
:options="goodsCategoryOptions"
@change="handleProductChange" />
<el-cascader v-else
......@@ -140,7 +141,11 @@ export default {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "commissionTypesOptions"]),
...mapState("PerformanceFormStore", {
formData: "formData",
commissionTypesOptions: "commissionTypesOptions",
goodsCategoryOptions: "goodsCategory",
}),
...mapGetters("PerformanceFormStore", ["getProductDefineListOptions"]),
productDefineListOptions() {
if (this.goodsCategory === 1) {
......
......@@ -10,7 +10,7 @@
:controls="false"
:disabled="$index === 0"
type="number"
v-bind="curParamsConfig.priceRangeProps">
v-bind="curParamsConfig.assessmentFactorOptions.componentProps">
</EditableText>
<div class="tag">
-
......@@ -18,7 +18,7 @@
<EditableText v-model="curParamsConfig.ParamsType2[$index].priceRange[1]"
:controls="false"
type="number"
v-bind="curParamsConfig.priceRangeProps">
v-bind="curParamsConfig.assessmentFactorOptions.componentProps">
</EditableText>
</div>
</template>
......@@ -32,6 +32,7 @@
<!-- 品类cascader -->
<GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="curParamsConfig.ParamsType2[$index].productLabel"
:options="goodsCategoryOptions"
@change="handleProductChange" />
<!-- 圈定套餐/商品 cascader -->
<el-cascader v-else
......@@ -137,7 +138,12 @@ export default {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList", "commissionTypesOptions"]),
...mapState("PerformanceFormStore", {
formData: "formData",
productDefineList: "productDefineList",
commissionTypesOptions: "commissionTypesOptions",
goodsCategoryOptions: "goodsCategory",
}),
...mapGetters("PerformanceFormStore", ["getProductDefineListOptions"]),
goodsCategory: {
get() {
......
......@@ -20,6 +20,7 @@
<GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="productValue"
clearable
:options="goodsCategoryOptions"
@change="handleProductChange" />
<el-cascader v-else
......@@ -60,6 +61,8 @@
<span style="margin:0 6px">2. </span>
<GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="productValue1"
clearable
:options="goodsCategoryOptions"
@change="handleProductChange" />
<el-cascader v-else
......@@ -128,7 +131,11 @@ export default {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList"]),
...mapState("PerformanceFormStore", {
formData: "formData",
productDefineList: "productDefineList",
goodsCategoryOptions: "goodsCategory",
}),
...mapGetters("PerformanceFormStore", ["getProductDefineListOptions"]),
goodsCategory: {
......
......@@ -13,6 +13,8 @@
<!-- 品类cascader -->
<GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="productValue"
clearable
:options="goodsCategoryOptions"
@change="handleProductChange" />
<!-- 圈定套餐/商品 cascader -->
<el-cascader v-else
......@@ -57,7 +59,11 @@ export default {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList"]),
...mapState("PerformanceFormStore", {
formData: "formData",
productDefineList: "productDefineList",
goodsCategoryOptions: "goodsCategory",
}),
...mapGetters("PerformanceFormStore", ["getProductDefineListOptions"]),
// 路径太长 简化
paramsType2CommissionTypes() {
......
......@@ -192,7 +192,6 @@ export const paramConfigListTemplate = {
// 对应下面两个大数组
templateType: "ParamsType1",
// sort:在添加的时候输入
// priceRangeProps 在新增时动态插入
// 只有paramsType1 需要. 这里不是paramsType1Table的行数据
// 每一个item 代表 一列
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!