Commit 862da4e8 by Jaxon

feat(performanceScheme): 重构绩效方案模块的组件与状态管理

- 将绩效表单 store 导入路径修正为独立模块
- 修复 API 路径中的双斜杠错误并添加调试日志
- 重构参数配置组件的数据结构,分离 ParamsType1 和 ParamsType2 的字段定义
- 实现绩效规则选择中提成基数与提成方式的联动勾选逻辑
- 完善门店选择组件的品牌多选与已选状态管理
- 统一组件导出方式并移除旧的 index.js 入口文件
- 在 jsconfig 中添加 @api 路径映射以支持模块化导入
1 parent 26acc102
Showing 20 changed files with 668 additions and 340 deletions
...@@ -3,17 +3,22 @@ ...@@ -3,17 +3,22 @@
"target": "ES2020", "target": "ES2020",
// "jsx": "react-jsx", // "jsx": "react-jsx",
// "lib": ["ES2020", "DOM", "DOM.Iterable"], // "lib": ["ES2020", "DOM", "DOM.Iterable"],
"lib": ["ES2020"], "lib": [
"ES2020"
],
"useDefineForClassFields": true, "useDefineForClassFields": true,
/* Paths */ /* Paths */
"baseUrl": ".", "baseUrl": ".",
"module": "ESNext", "module": "ESNext",
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
"paths": { "paths": {
"@/*": ["src/*"] "@/*": [
"src/*"
],
"@api/*": [
"src/api/*"
]
}, },
"resolveJsonModule": true, "resolveJsonModule": true,
"allowImportingTsExtensions": false, "allowImportingTsExtensions": false,
...@@ -23,8 +28,14 @@ ...@@ -23,8 +28,14 @@
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"esModuleInterop": true, "esModuleInterop": true,
"isolatedModules": true, "isolatedModules": true,
"skipLibCheck": true, "skipLibCheck": true
}, },
"include": ["src/**/*"], "include": [
"exclude": ["node_modules", "dist", ".git"] "src/**/*"
],
"exclude": [
"node_modules",
"dist",
".git"
]
} }
\ No newline at end of file \ No newline at end of file
...@@ -5,108 +5,112 @@ ...@@ -5,108 +5,112 @@
* @Last Modified time: 2021-06-30 14:30:41 * @Last Modified time: 2021-06-30 14:30:41
*/ */
import axiosPackage from "axios";
import util from "@/libs/util.js";
import { baseConfig } from "@/main";
// import axios from "@/plugin/axios" // import axios from "@/plugin/axios"
import axios from "@/plugin/axios/index_code"; import axios from "@/plugin/axios/index_code"
import RequestMethods from "./request.methods"; import sign from "./sign"
import sign from "./sign"; import RequestMethods from "./request.methods"
import util from "@/libs/util.js"
function request(params = {}, method = RequestMethods.GET, noSignAttr = [], options = {}) { import { baseConfig } from "@/main"
import axiosPackage from "axios"
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
options = {}
) => {
// 兼容线上dj和scrm appkey和secret不一样的情况 // 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = ""; let apiName = ""
if (params.method.includes("dj.api.smartcarlife")) { if (params.method.includes("dj.api.smartcarlife")) {
apiName = "dj"; apiName = "dj"
} else if (params.method.includes("dj.api.script")) { } else if (params.method.includes("dj.api.script")) {
apiName = "script"; apiName = "script"
} else if (params.method.includes("dj.staff.api")) { } else if (params.method.includes("dj.staff.api")) {
apiName = "staff"; apiName = "staff"
} else if (params.method.includes("dj.smartcarlife.stock")) { } else if (params.method.includes("dj.smartcarlife.stock")) {
apiName = "dj.smartcarlife"; apiName = "dj.smartcarlife"
} else if (params.method.includes("risk.manage.api")) { } else if (params.method.includes("risk.manage.api")) {
apiName = "riskmanage"; apiName = "riskmanage"
} else { }else {
// console.log(params.method.split(".api")) // console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0]; apiName = params.method.split(".api")[0]
} }
// console.log("params.method", params.method) // console.log("params.method", params.method)
// console.log("apiName", apiName) // console.log("apiName", apiName)
// 为空报错 // 为空报错
if (!apiName) { if (!apiName) {
throw new Error("apiName is null"); throw new Error("apiName is null")
} }
const mappingName = { const mappingName = {
"dj.smartcarlife": "axios", "dj.smartcarlife": "axios",
"dj": "axios", dj: "axios",
"scrm": "axios2", scrm: "axios2",
"merchants": "axios3", merchants: "axios3",
"reportExport": "axios4", reportExport: "axios4",
"glsx.accounts.biz.common.pictureUpload": "common", "glsx.accounts.biz.common.pictureUpload": "common",
"clue": "axios5", clue: "axios5",
"dj.businessSchool": "axios6", "dj.businessSchool": "axios6",
"script": "axios7", script: "axios7",
"staff": "axios9", staff: "axios9",
"riskmanage": "axios10", riskmanage:"axios10",
}; }
const baseApiName = mappingName[apiName]; const baseApiName = mappingName[apiName]
// console.log(baseApiName, "baseApiName") // console.log(baseApiName, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey // params.appKey = baseConfig[baseApiName].appkey
if (baseApiName == "common") { if (baseApiName == "common") {
params.app_key = baseConfig[baseApiName].appkey; params.app_key = baseConfig[baseApiName].appkey
} else { } else {
params.appKey = baseConfig[baseApiName].appkey; params.appKey = baseConfig[baseApiName].appkey
} }
// console.log("params.appKey", params.appKey) // console.log("params.appKey", params.appKey)
params.timestamp = new Date().getTime(); params.timestamp = new Date().getTime()
params.v = "1.0.0"; params.v = "1.0.0"
params.format = "json"; params.format = "json"
params.locale = "zh_CN"; params.locale = "zh_CN"
if (params.method !== "dj.api.user.login") { if (params.method !== "dj.api.user.login") {
params.sessionId = util.cookies.get("token"); params.sessionId = util.cookies.get("token")
} }
/** /**
* mock - url = params.method * mock - url = params.method
* 调后端接口 - url = '' * 调后端接口 - url = ''
*/ */
const url = baseConfig[baseApiName].baseURL; const url = baseConfig[baseApiName].baseURL
// const url = "/api" // const url = "/api"
/** /**
* 调后端接口,请使用以下代码。 * 调后端接口,请使用以下代码。
*/ */
const signWay = { const signWay = {
"dj.smartcarlife": "sha1", "dj.smartcarlife": "sha1",
"dj": "sha1", dj: "sha1",
"scrm": "sha1", scrm: "sha1",
"glsx": "md5", glsx: "md5",
"glsx.accounts.biz.common.pictureUpload": "md5", "glsx.accounts.biz.common.pictureUpload": "md5",
"clue": "sha1", clue: "sha1",
"script": "sha1", script: "sha1",
"staff": "sha1", staff: "sha1",
"riskmanage": "sha1", riskmanage:'sha1'
}; }
// console.log(signWay[apiName], "baseApiName") // console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret; const secret = baseConfig[baseApiName].secret
const CancelToken = axiosPackage.CancelToken; const CancelToken = axiosPackage.CancelToken
let reqData var reqData =
= method === RequestMethods.POST method === RequestMethods.POST
? { ? {
baseURL: "/", baseURL: "/",
data: sign(params, noSignAttr, secret, signWay[apiName]), data: sign(params, noSignAttr, secret, signWay[apiName])
} }
: { params: sign(params, noSignAttr, secret, signWay[apiName]) }; : { params: sign(params, noSignAttr, secret, signWay[apiName]) }
reqData = Object.assign(reqData, options, {}); reqData = Object.assign(reqData, options, {})
// 请求进度 // 请求进度
if (params?.onProcess) { if (params?.onProcess) {
reqData.onUploadProgress = params.onProcess; reqData.onUploadProgress = params.onProcess
} }
// 取消请求 // 取消请求
if (params?.cancelFun) { if (params?.cancelFun) {
reqData.cancelToken = new CancelToken((c) => { reqData.cancelToken = new CancelToken(function excutor (c) {
params.cancelFun.cancel = c; params.cancelFun.cancel = c
}); })
} }
// console.log(method === RequestMethods.POST) // console.log(method === RequestMethods.POST)
// console.log(url) // console.log(url)
...@@ -115,11 +119,10 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti ...@@ -115,11 +119,10 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti
let axiosParams = { let axiosParams = {
url, url,
method, method,
...reqData, ...reqData
}; }
if (options.returnAll) if (options.returnAll) axiosParams.headers = { 'return-all': true }
axiosParams.headers = { "return-all": true }; return axios(axiosParams)
return axios(axiosParams);
/** /**
* mock,请使用以下代码。 * mock,请使用以下代码。
...@@ -130,4 +133,4 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti ...@@ -130,4 +133,4 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti
// params: sign(params, noSignAttr) // params: sign(params, noSignAttr)
// }) // })
} }
export default request; export default request
import Vue from "vue"; import Vue from "vue";
import Vuex from "vuex"; import Vuex from "vuex";
import { performanceFormStore } from "@/views/residentManage/salaryPerformance/performanceScheme"; import performanceFormStore from "@/views/residentManage/salaryPerformance/performanceScheme/store/performanceFormStore.js";
import d2admin, { storeResets } from "./modules/d2admin"; import d2admin, { storeResets } from "./modules/d2admin";
import FinancialRules from "./modules/FinancialRules"; import FinancialRules from "./modules/FinancialRules";
import goodsInfoData from "./modules/goodsInfoData"; import goodsInfoData from "./modules/goodsInfoData";
......
import request from "@/api/request"; import request from "@/api/request";
console.log("request", request);
const path = "dj.staff.api.service.merchant."; const path = "dj.staff.api.service.merchant.";
// 分页查询费用类目 // 分页查询费用类目
export function getStoreWithBrandList(data) { export function getStoreWithBrandList(data) {
// data.method = `${path}selectFeeCategoryList` // data.method = `${path}selectFeeCategoryList`
data.method = `${path}page.with.brand//1.0.0`; data.method = `${path}page.with.brand/1.0.0`;
data.url = "http://127.0.0.1:4523/m1/7746299-7491170-default/"; data.url = "http://127.0.0.1:4523/m1/7746299-7491170-default/";
return request(data); return request(data);
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</div> </div>
</div> </div>
<div class="table-wrapper"> <div class="table-wrapper">
<!-- <component :is="curParamsConfig.templateType" :config-index="configIndex"></component> --> <component :is="curParamsConfig.templateType" :config-index="configIndex"></component>
</div> </div>
</div> </div>
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<script> <script>
import { last } from "lodash-es"; import { last } from "lodash-es";
import { mapState } from "vuex"; import { mapState } from "vuex";
import { paramConfigListTemplate } from "../performanceRuleSelection/options.js";
import ParamsType1 from "./type1.vue"; import ParamsType1 from "./type1.vue";
import ParamsType2 from "./type2.vue"; import ParamsType2 from "./type2.vue";
...@@ -73,18 +74,21 @@ export default { ...@@ -73,18 +74,21 @@ export default {
}, },
methods: { methods: {
handleAppendTableColProduct() { handleAppendTableColProduct() {
if (this.curParamsConfig.templateType !== "ParamsType1") {
return;
}
if (this.curParamsConfig.products.length >= 10) { if (this.curParamsConfig.products.length >= 10) {
this.$message.warning("最多添加列商品"); this.$message.warning("最多添加列商品");
} }
this.curParamsConfig.products.push({ this.curParamsConfig.ParamsType1Products.push({
productLabel: "", ...structuredClone(paramConfigListTemplate.ParamsType1Products[0]),
productValue: [undefined],
optionList: [],
}); });
}, },
// 提成方式改变
handleCommissionTypesChange(row) { handleCommissionTypesChange(row) {
// TODO: 清空当前行的所有 products[index].productValue[$index] 的值 // TODO: 清空当前行的所有 products[index].productValue[$index] 的值
this.curParamsConfig.products.forEach((product) => { this.curParamsConfig.ParamsType1Products.forEach((product) => {
this.$set(product.productValue, row, undefined); this.$set(product.productValue, row, undefined);
}); });
}, },
...@@ -93,13 +97,16 @@ export default { ...@@ -93,13 +97,16 @@ export default {
}, },
handleAppendTableRow() { handleAppendTableRow() {
const templateType = this.curParamsConfig.templateType; const templateType = this.curParamsConfig.templateType;
const lastPriceRange = last(this.curParamsConfig.priceRange);
// this.curParamsConfig[templateType].push({ const nPriceRange = [undefined, undefined];
// priceRange: [undefined, undefined], if (lastPriceRange && lastPriceRange[1]) {
// }); nPriceRange[0] = lastPriceRange[1] + (this.curParamsConfig.priceRangeProps.precision ? 1 : 0.01);
nPriceRange[1] = undefined;
// this.curParamsConfig.priceRange.push(nPriceRange); }
// this.curParamsConfig.commissionTypes.push(undefined); this.curParamsConfig[templateType].push({
...structuredClone(paramConfigListTemplate[templateType][0]),
priceRange: nPriceRange,
});
}, },
}, },
}; };
......
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
:controls="false" :controls="false"
:disabled="$index === 0" :disabled="$index === 0"
type="number" type="number"
v-bind="curParamsConfig.componentProps"> v-bind="curParamsConfig.priceRangeProps">
</EditableText> </EditableText>
<div class="tag"> <div class="tag">
- -
</div> </div>
<EditableText v-model="curParamsConfig.priceRange[$index][1]" <EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[1]"
:controls="false" :controls="false"
type="number" type="number"
v-bind="curParamsConfig.componentProps"> v-bind="curParamsConfig.priceRangeProps">
</EditableText> </EditableText>
</div> </div>
</template> </template>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
min-width="180" min-width="180"
prop="commissionTypes"> prop="commissionTypes">
<template #default="{ $index }"> <template #default="{ $index }">
<el-select v-model="curParamsConfig.commissionTypes[$index]" <el-select v-model="curParamsConfig.ParamsType1[$index].commissionTypes"
placeholder="请选择" placeholder="请选择"
style="width:120px" style="width:120px"
@change="handleCommissionTypesChange($index)"> @change="handleCommissionTypesChange($index)">
...@@ -43,15 +43,14 @@ ...@@ -43,15 +43,14 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-for="(product, index) in curParamsConfig.products" <el-table-column v-for="(product, index) in curParamsConfig.ParamsType1Products"
:key="index" :key="index"
align="center" align="center"
prop="productLabel" prop="productLabel"
width="180px"> width="180px">
<template #header> <template #header="{ $index }">
<div> <div>
<el-cascader v-model="curParamsConfig.products[index].productLabel" <el-cascader v-model="curParamsConfig.ParamsType1Products[index].productLabel"
:options="getProductDefineListOptions" :options="getProductDefineListOptions"
:show-all-levels="false" :show-all-levels="false"
@change="handleProductChange"> @change="handleProductChange">
...@@ -67,9 +66,9 @@ ...@@ -67,9 +66,9 @@
</template> </template>
<template #default="{ $index }"> <template #default="{ $index }">
<EditableText v-model="curParamsConfig.products[index].productValue[$index]" <EditableText v-model="curParamsConfig.ParamsType1Products[index].productValue[$index]"
:controls="false" :controls="false"
v-bind="curParamsConfig.commissionTypes[$index] && commissionTypeEnum[curParamsConfig.commissionTypes[$index]].componentProps" v-bind="curParamsConfig.ParamsType1[$index].commissionTypes && commissionTypeEnum[curParamsConfig.ParamsType1[$index].commissionTypes].componentProps"
type="number"> type="number">
</EditableText> </EditableText>
</template> </template>
...@@ -164,17 +163,21 @@ export default { ...@@ -164,17 +163,21 @@ export default {
// 删除商品列 // 删除商品列
handleRemoveProductsCol(productCol) { handleRemoveProductsCol(productCol) {
this.curParamsConfig.products.splice(productCol, 1); this.curParamsConfig.ParamsType1Products.splice(productCol, 1);
}, },
handleCommissionTypesChange() {}, // 清空该行所有productValue
handleCommissionTypesChange(row) {
this.curParamsConfig.ParamsType1Products.forEach((product) => {
this.$set(product.productValue, row, undefined);
});
},
// 删除行 // 删除行
handleRemoveTableRow(row) { handleRemoveTableRow(row) {
this.curParamsConfig.priceRange.splice(row, 1); this.curParamsConfig.ParamsType1.splice(row, 1);
this.curParamsConfig.commissionTypes.splice(row, 1); // 同步删除 ParamsType1Products 里每个 product.productValue 的对应行
// 同步删除 products 里每个 product.productValue 的对应行 if (Array.isArray(this.curParamsConfig.ParamsType1Products)) {
if (Array.isArray(this.curParamsConfig.products)) { this.curParamsConfig.ParamsType1Products.forEach((product) => {
this.curParamsConfig.products.forEach((product) => {
if (Array.isArray(product.productValue)) { if (Array.isArray(product.productValue)) {
product.productValue.splice(row, 1); product.productValue.splice(row, 1);
} }
......
...@@ -2,25 +2,25 @@ ...@@ -2,25 +2,25 @@
<div class="params-config-table"> <div class="params-config-table">
<el-table border <el-table border
class="params-config-table" class="params-config-table"
:data="curParamsConfig.priceRange"> :data="curParamsConfig.ParamsType2">
<el-table-column align="center" <el-table-column align="center"
:label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`" :label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`"
width="270px"> width="270px">
<template #default="{ $index }"> <template #default="{ $index }">
<div class="assessment-factor-column"> <div class="assessment-factor-column">
<EditableText v-model="curParamsConfig.priceRange[$index][0]" <EditableText v-model="curParamsConfig.ParamsType2[$index].priceRange[0]"
:controls="false" :controls="false"
:disabled="$index === 0" :disabled="$index === 0"
type="number" type="number"
v-bind="curParamsConfig.componentProps"> v-bind="curParamsConfig.priceRangeProps">
</EditableText> </EditableText>
<div class="tag"> <div class="tag">
- -
</div> </div>
<EditableText v-model="curParamsConfig.priceRange[$index][1]" <EditableText v-model="curParamsConfig.ParamsType2[$index].priceRange[1]"
:controls="false" :controls="false"
type="number" type="number"
v-bind="curParamsConfig.componentProps"> v-bind="curParamsConfig.priceRangeProps">
</EditableText> </EditableText>
</div> </div>
</template> </template>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
label="商品分类" label="商品分类"
width="180"> width="180">
<template #default="{ $index }"> <template #default="{ $index }">
<el-cascader v-model="curParamsConfig.products[$index].productLabel" <el-cascader v-model="curParamsConfig.ParamsType2[$index].productLabel"
:options="getProductDefineListOptions" :options="getProductDefineListOptions"
:show-all-levels="false" :show-all-levels="false"
@change="handleProductChange"> @change="handleProductChange">
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
<el-table-column align="center"> <el-table-column align="center">
<template #header> <template #header>
<el-select v-model="curParamsConfig.commissionTypes" <el-form-item>
<el-select v-model="curParamsConfig.ParamsType2CommissionTypes"
placeholder="请选择" placeholder="请选择"
style="width:120px" style="width:120px"
@change="handleCommissionTypesChange"> @change="handleCommissionTypesChange">
...@@ -49,11 +50,20 @@ ...@@ -49,11 +50,20 @@
:label="subItem.label" :label="subItem.label"
:value="subItem.value" /> :value="subItem.value" />
</el-select> </el-select>
</el-form-item>
</template> </template>
<template #default="{ row }"> <template #default="{ $index }">
<div class="condition-wrapper">
<component :is="paramConfigConditionType[curParamsConfig.condition].component"></component> <component :is="paramConfigConditionType[curParamsConfig.ParamsType2[$index].condition].component"
:config-index="configIndex"
:row="$index" />
<span v-if="curParamsConfig.ParamsType2[$index].condition !== 0"
class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;"
@click="handleChangeCondition($index)">
</span>
</div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -62,14 +72,14 @@ ...@@ -62,14 +72,14 @@
label="操作" label="操作"
width="120"> width="120">
<template #default="{ $index }"> <template #default="{ $index }">
<el-button v-if="curParamsConfig.condition === 0" <el-button v-if="curParamsConfig.ParamsType2[$index].condition === 0"
type="text" type="text"
@click="handleChangeCondition()"> @click="curParamsConfig.ParamsType2[$index].condition = 1">
设置条件 设置条件
</el-button> </el-button>
<el-button v-else <el-button v-else
type="text" type="text"
@click="handleCancelConditionSetting()"> @click="handleCancelConditionSetting($index)">
取消条件 取消条件
</el-button> </el-button>
<el-button type="text" <el-button type="text"
...@@ -94,6 +104,8 @@ export default { ...@@ -94,6 +104,8 @@ export default {
components: { components: {
EditableText, EditableText,
Type0, Type0,
Type1,
Type2,
}, },
props: { props: {
configIndex: { configIndex: {
...@@ -140,15 +152,18 @@ export default { ...@@ -140,15 +152,18 @@ export default {
methods: { methods: {
handleCommissionTypesChange() {}, handleCommissionTypesChange() {},
handleRemoveTableRow() {}, handleRemoveTableRow() {},
handleCancelConditionSetting() { // 取消设置条件
this.curParamsConfig.condition = 0; handleCancelConditionSetting(row) {
this.curParamsConfig.ParamsType2[row].condition = 0;
}, },
handleChangeCondition(index) { // 条件变化
if (this.curParamsConfig.condition >= 2) { handleChangeCondition(row) {
this.curParamsConfig.condition = 1; const curCondition = this.curParamsConfig.ParamsType2[row].condition;
if (curCondition >= 2) {
this.curParamsConfig.ParamsType2[row].condition = 1;
return; return;
} }
this.curParamsConfig.condition += 1; this.curParamsConfig.ParamsType2[row].condition += 1;
}, },
handleProductChange(value) { handleProductChange(value) {
console.log("product change", value); console.log("product change", value);
...@@ -161,6 +176,21 @@ export default { ...@@ -161,6 +176,21 @@ export default {
.params-config-table { .params-config-table {
width: 100%; width: 100%;
margin-bottom: 20px !important; margin-bottom: 20px !important;
.condition-wrapper {
display: flex;
width: 100%;
bottom: 1px solid red;
align-items: center;
justify-content: flex-start;
> .icon {
margin-left: 6px;
cursor: pointer;
transition: color 200ms;
&:hover {
color: #2a58ad;
}
}
}
::v-deep .el-table { ::v-deep .el-table {
.el-table__header { .el-table__header {
th { th {
......
export { default as Type0 } from './type0.vue' export { default as Type0 } from "./type0.vue";
export { default as Type1 } from './type1.vue' export { default as Type1 } from "./type1.vue";
export { default as Type2 } from './type2.vue' export { default as Type2 } from "./type2.vue";
<template> <template>
<div class=""> <div class="param-config-type-2-condition-type">
<el-input></el-input> <el-form-item>
<el-input v-model="conditionTypeValue"></el-input>
</el-form-item>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from "vuex";
export default { export default {
name: "", name: "",
props: { props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
}, },
data() { data() {
...@@ -16,10 +28,14 @@ export default { ...@@ -16,10 +28,14 @@ export default {
}; };
}, },
computed: { computed: {
...mapState("PerformanceFormStore", ["formData"]),
conditionTypeValue() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType0;
},
}, },
mounted() { mounted() {
console.log("当前组件所有 inject 内容:", this.$parent); // Vue2 内部属性,存储注入的内容
}, },
methods: { methods: {
......
<template> <template>
<div class=""> <div class="param-config-type-2-condition-type">
<el-input></el-input> <el-input v-model="triggerCondition"></el-input>
<span>且按不足</span> <span>且</span>
<el-input></el-input> <el-select v-model="productValue"></el-select>
<span>订单数每单扣减</span> <span>渗透率在</span>
<el-input></el-input> <el-input v-model="permeabilityMin"></el-input>
<span>元.区间时执行</span> <span>~</span>
<el-input v-model="permeabilityMax"></el-input>
<span>区间时执行</span>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from "vuex";
export default { export default {
name: "", name: "",
props: { props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
}, },
data() { data() {
...@@ -21,7 +33,24 @@ export default { ...@@ -21,7 +33,24 @@ export default {
}; };
}, },
computed: { computed: {
...mapState("PerformanceFormStore", ["formData"]),
triggerCondition() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.triggerCondition;
},
productLabel() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productLabel;
},
productValue() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productValue;
},
permeabilityMin() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMin;
},
permeabilityMax() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMax;
},
}, },
mounted() { mounted() {
......
<template> <template>
<div class=""> <div class="param-config-type-2-condition-type">
<el-input></el-input> <el-input v-model="triggerCondition"></el-input>
<span>且</span> <span>且按不足</span>
<el-select></el-select> <el-input v-model="deductRate"></el-input>
<span>渗透率在</span> <span>订单数每单扣减</span>
<el-input></el-input> <el-input v-model="perOrderDeductAmount"></el-input>
<span>~</span> <span>元.区间时执行</span>
<el-input></el-input>
<span>区间时执行</span>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from "vuex";
export default { export default {
name: "", name: "",
props: { props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
}, },
data() { data() {
...@@ -23,6 +31,17 @@ export default { ...@@ -23,6 +31,17 @@ export default {
}; };
}, },
computed: { computed: {
...mapState("PerformanceFormStore", ["formData"]),
triggerCondition() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.triggerCondition;
},
deductRate() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.deductRate;
},
perOrderDeductAmount() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.perOrderDeductAmount;
},
}, },
mounted() { mounted() {
......
...@@ -99,6 +99,12 @@ export default { ...@@ -99,6 +99,12 @@ export default {
assessmentFactorValue: [], assessmentFactorValue: [],
assessmentFactorOptions, assessmentFactorOptions,
isUpdating: false, // 防止循环更新 isUpdating: false, // 防止循环更新
// 提成基数和提成方式的对应关系:基数 <-> 方式
commissionMapping: {
GMV: "BL", // GMV产值 <-> 比例
DDTC: "XS", // 单店总提成 <-> 系数
DDSL: "GDJE", // 升级订单数 <-> 固定金额
},
}; };
}, },
computed: { computed: {
...@@ -111,97 +117,86 @@ export default { ...@@ -111,97 +117,86 @@ export default {
goodsConfigTypes: bindFormFields("goodsConfigTypes"), goodsConfigTypes: bindFormFields("goodsConfigTypes"),
paramConfigList: bindFormFields("paramConfigList"), paramConfigList: bindFormFields("paramConfigList"),
}, },
watch: {
commissionTypes(newVal) {
// TODO: 还需要清空下方表格所有提成方式的值
this.setCommissionTypesOptions(newVal);
},
},
mounted() { mounted() {
}, },
methods: { methods: {
...mapMutations("PerformanceFormStore", ["setProductDefineList", "touchAssessment", "setCommissionTypesOptions"]), ...mapMutations("PerformanceFormStore", ["setProductDefineList", "touchAssessment", "setCommissionTypesOptions", "setCommissionBases", "setCommissionTypes"]),
/**
* 更新关联的复选框
* @param {Array} currentValues 当前变化的值
* @param {Array} targetValues 目标值数组
* @param {boolean} isBasesToTypes 是否从基数更新到方式
*/
updateLinkedCheckboxes(currentValues, targetValues, isBasesToTypes) {
const newTargetValues = [...targetValues];
Object.entries(this.commissionMapping).forEach(([baseKey, typeKey]) => {
if (isBasesToTypes) {
// 从基数更新方式
if (currentValues.includes(baseKey)) {
// 基数包含 -> 方式要包含
if (!newTargetValues.includes(typeKey)) {
newTargetValues.push(typeKey);
}
} else {
// 基数不包含 -> 方式要移除
const index = newTargetValues.indexOf(typeKey);
if (index > -1)
newTargetValues.splice(index, 1);
}
} else {
// 从方式更新基数
if (currentValues.includes(typeKey)) {
// 方式包含 -> 基数要包含
if (!newTargetValues.includes(baseKey)) {
newTargetValues.push(baseKey);
}
} else {
// 方式不包含 -> 基数要移除
const index = newTargetValues.indexOf(baseKey);
if (index > -1)
newTargetValues.splice(index, 1);
}
}
});
return newTargetValues;
},
handleGoodsConfigTypesChange(value) { handleGoodsConfigTypesChange(value) {
this.dialog.defineProducts.visible = true; this.dialog.defineProducts.visible = true;
}, },
handleDefineProductsDialogClose(productDefineList) { handleDefineProductsDialogClose(productDefineList) {
this.setProductDefineList(productDefineList); this.setProductDefineList(productDefineList);
this.dialog.defineProducts.visible = false; this.dialog.defineProducts.visible = false;
}, },
handleCommissionBasesChange(e) { handleCommissionBasesChange(e) {
if (this.isUpdating) if (this.isUpdating)
return; return;
this.isUpdating = true; this.isUpdating = true;
const newTypes = this.updateLinkedCheckboxes(e, this.commissionTypes, true);
const newTypes = [...this.commissionTypes]; this.setCommissionTypes(newTypes);
// GMV 产值 <-> 比例 (BL)
if (e.includes("GMV")) {
if (!newTypes.includes("BL"))
newTypes.push("BL");
} else {
const index = newTypes.indexOf("BL");
if (index > -1)
newTypes.splice(index, 1);
}
// 单店总提成 <-> 系数 (XS)
if (e.includes("DDTC")) {
if (!newTypes.includes("XS"))
newTypes.push("XS");
} else {
const index = newTypes.indexOf("XS");
if (index > -1)
newTypes.splice(index, 1);
}
// 升级订单数 <-> 固定金额 (GDJE)
if (e.includes("DDSL")) {
if (!newTypes.includes("GDJE"))
newTypes.push("GDJE");
} else {
const index = newTypes.indexOf("GDJE");
if (index > -1)
newTypes.splice(index, 1);
}
this.$set(this, "commissionTypes", newTypes);
this.$nextTick(() => { this.$nextTick(() => {
this.isUpdating = false; this.isUpdating = false;
}); });
}, },
handleCommissionTypesChange(e) { handleCommissionTypesChange(e) {
if (this.isUpdating) if (this.isUpdating)
return; return;
this.isUpdating = true; this.isUpdating = true;
const newBases = [...this.commissionBases]; const newBases = this.updateLinkedCheckboxes(e, this.commissionBases, false);
this.setCommissionBases(newBases);
// 比例 (BL) <-> GMV 产值
if (e.includes("BL")) {
if (!newBases.includes("GMV"))
newBases.push("GMV");
} else {
const index = newBases.indexOf("GMV");
if (index > -1)
newBases.splice(index, 1);
}
// 系数 (XS) <-> 单店总提成
if (e.includes("XS")) {
if (!newBases.includes("DDTC"))
newBases.push("DDTC");
} else {
const index = newBases.indexOf("DDTC");
if (index > -1)
newBases.splice(index, 1);
}
// 固定金额 (GDJE) <-> 升级订单数
if (e.includes("GDJE")) {
if (!newBases.includes("DDSL"))
newBases.push("DDSL");
} else {
const index = newBases.indexOf("DDSL");
if (index > -1)
newBases.splice(index, 1);
}
this.$set(this, "commissionBases", newBases);
this.$nextTick(() => { this.$nextTick(() => {
this.isUpdating = false; this.isUpdating = false;
}); });
......
...@@ -170,34 +170,62 @@ export const paramConfigListTemplate = { ...@@ -170,34 +170,62 @@ export const paramConfigListTemplate = {
// sort:在添加的时候输入 // sort:在添加的时候输入
// priceRangeProps 在新增时动态插入 // priceRangeProps 在新增时动态插入
ParamsType1: [ // 只有paramsType1 需要. 这里不是paramsType1Table的行数据
{ // 每一个item 代表 一列
priceRange: [0, undefined], // productValue里的顺序按照 row拍
commissionTypes: undefined, // 如果
products: [ ParamsType1Products: [
{ {
productLabel: "", productLabel: "",
productValue: [undefined], productValue: [undefined],
optionList: [], optionList: [],
}, },
], ],
// 下面两个数据都是放到table中, 一个item对应一行所需的数据
ParamsType1: [
{
priceRange: [0, undefined],
commissionTypes: undefined,
}, },
], ],
// 只有paramsType2 需要. 这里不是paramsType1Table的行数据
ParamsType2CommissionTypes: undefined,
ParamsType2: [ ParamsType2: [
{ {
// 仅有一个输入框
conditionType0: undefined,
conditionType1: {
// 触发条件
triggerCondition: undefined,
// 商品占位
productLabel: undefined,
// 商品值
productValue: undefined,
// 渗透率上下限
permeabilityMin: undefined,
permeabilityMax: undefined,
},
conditionType2: {
// 触发条件
triggerCondition: undefined,
// 渗透率上下限
// 扣减比例
deductRate: undefined,
// 每单扣减金额
perOrderDeductAmount: undefined,
},
// 渗透率的条件 // 渗透率的条件
condition: 0, condition: 0,
priceRange: [0, undefined], priceRange: [0, undefined],
commissionTypes: undefined, commissionTypes: undefined,
products: [
{
productLabel: "", productLabel: "",
productValue: [undefined], productValue: [undefined],
optionList: [], optionList: [],
}, },
], ],
},
],
// 渗透率的条件 // 渗透率的条件
condition: 0, condition: 0,
......
<template> <template>
<div class="selection-store-wrapper"> <div class="selection-table-store-wrapper">
<div class="pre-select-store-wrapper select-store-wrapper">
<div class="title">
预选门店及品牌
</div>
<div class="search-wrapper">
<el-input placeholder="请输入门店名称/商户号" style="width:362px" />
<el-input placeholder="请输入品牌名称" style="width:142px;margin-left: 12px;" />
<el-button size="small"
style="margin-left: 12px"
type="primary">
查询
</el-button>
</div>
<div class="store-list-wrapper">
<el-table>
<el-table-column label="门店名称"
prop="name" />
<el-table-column label="品牌名称"
prop="account" />
</el-table>
</div>
</div>
<div class="select-store-wrapper select-wrapper">
<div class="title">
已选门店及品牌
</div>
<div class="actions-wrapper">
<div>
门店名称(x项)
</div>
<div>
<el-button type="te xt">
清空
</el-button>
</div>
</div>
<div class="store-list-wrapper">
<el-tree></el-tree>
</div>
</div>
<baseDialog :dialog-config="dialog.storeApply.visible"
:is-show.sync="dialog.storeApply.visible"
@handleClick="handleDialogConfirm">
</baseDialog>
</div>
<!-- <el-form class=""
label-width="170px"
:model="formData"
:rules="rules">
<el-form-item label="分配门店账号:" prop="name"> <el-form-item label="分配门店账号:" prop="name">
<el-button size="small" @click="handleSelectStores"> <el-button size="small" @click="handleSelectStores">
<i class="el-icon-plus" style="font-size:14px" /> <i class="el-icon-plus" style="font-size:14px" />
<span>选择门店</span> <span>选择门店</span>
</el-button> </el-button>
<el-table :data="formData.table"
style="width: 100%">
<el-table-column label="门店名称"
prop="name" />
<el-table-column label="品牌名称"
prop="account" />
</el-table>
</el-form-item> </el-form-item>
<!-- <el-form-item label="生效月份:" prop="effectiveTime">
<el-form-item label="生效月份:" prop="effectiveTime">
<el-date-picker v-model="formData.effectiveTime" <el-date-picker v-model="formData.effectiveTime"
placeholder="选择日期" placeholder="选择日期"
type="month"> type="month">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item> -->
<el-dialog :before-close="handleCloseDialog"
custom-class="store-select-dialog"
:title="dialog.storeApply.title"
:visible.sync="dialog.storeApply.visible"
width="70%">
<StoreSelect />
<template #footer>
<span class="dialog-footer">
<el-button @click="dialog.storeApply.visible = false">取消</el-button>
<el-button type="primary" @click="dialog.storeApply.visible = false">确定</el-button>
</span>
</template>
</el-dialog>
</el-form> --> </div>
</template> </template>
<script> <script>
import { getStoreWithBrandList } from "../../api/index.js"; import StoreSelect from "../storeSelect/index.vue";
export default { export default {
name: "", name: "StoreApply",
props: { components: {
formData: { StoreSelect,
type: Object,
default: () => ({
}),
},
}, },
data() { data() {
return { return {
...@@ -102,6 +45,7 @@ export default { ...@@ -102,6 +45,7 @@ export default {
storeApply: { storeApply: {
title: "选择门店", title: "选择门店",
width: "60%", width: "60%",
visible: false,
}, },
}, },
...@@ -111,46 +55,44 @@ export default { ...@@ -111,46 +55,44 @@ export default {
}, },
async mounted() { async mounted() {
const data = await getStoreWithBrandList();
console.log("data", data);
}, },
methods: { methods: {
handleSelectStores() {}, handleCloseDialog() {},
handleSelectStores() {
this.dialog.storeApply.visible = true;
},
handleDialogConfirm() {}, handleDialogConfirm() {},
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.selection-store-wrapper { ::v-deep .store-select-dialog {
display: flex; .el-dialog__header {
width: 100%; border-bottom: 1px solid #e5e5e5;
.select-store-wrapper { }
&.pre-select-store-wrapper { .el-dialog__title {
flex: 1; color: #1d1d1d;
min-width: 616px; font-size: 16px;
.search-wrapper { font-weight: 500;
display: flex; line-height: 20px;
align-content: center;
padding: 12px 16px;
} }
.el-dialog__body {
padding-top: 20px;
padding-bottom: 20px;
.el-table {
&::before {
width: 0;
height: 0;
} }
&.select-store-wrapper {
margin-left: 24px;
min-width: 39%;
> .actions-wrapper {
display: flex;
align-content: center;
justify-content: space-between;
padding: 12px 16px;
} }
} }
> .title { .el-dialog__footer {
padding: 0 16px; border-top: 1px solid #e5e5e5;
line-height: 48px; padding-bottom: 10px;
background: #f5f5f5; .el-button {
color: #333; width: auto;
font-size: 16px;
} }
} }
} }
......
<template> <template>
<div class=""> <div class="selection-store-wrapper">
<div class="pre-select-store-wrapper">
<div class="title">
预选门店及品牌
</div>
<div class="search-wrapper">
<el-input v-model="queryParams.merchantName"
placeholder="请输入门店名称"
style="width:180px" />
<el-input v-model="queryParams.merchantId"
placeholder="请输入商户号"
style="width:180px;margin-left: 12px" />
<el-input v-model="queryParams.brandName"
placeholder="请输入品牌名称"
style="width:142px;margin-left: 12px;" />
<el-button size="small"
style="margin-left: 12px"
type="primary"
@click="getData">
查询
</el-button>
</div>
<div class="store-list-wrapper">
<el-table :data="merchantTable" height="450">
<el-table-column label="门店名称"
prop="merchantName" />
<el-table-column label="品牌名称">
<template #default="{ row, ...scope }">
<div>
<el-checkbox v-model="row.checkAll"
:indeterminate="row.isIndeterminate"
@change="handleCheckBrandAllChange($event, row, scope.$index)">
全选
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="row.checkBrands" @change="handleCheckedBrandChange($event, row, scope.$index)">
<el-checkbox v-for="brand in row.merchantBrandList"
:key="brand.brandId"
:label="brand.brandId">
{{ brand.brandName }}
</el-checkbox>
</el-checkbox-group>
</div>
</template>
</el-table-column>
</el-table>
<div style="padding-bottom:12px;">
<el-pagination background
:current-page="queryParams.pageNum"
:page-size="queryParams.pageSize"
:page-sizes="[5, 10, 20, 30, 40]"
:total="queryParams.total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange" />
</div>
</div>
</div>
<div class="selected-store-wrapper select-wrapper">
<div class="title">
已选门店及品牌
</div>
<div class="actions-wrapper">
<div class="selected-count">
门店名称({{ getSelectedMerchantTable.length }}项)
</div>
<el-button type="text"
@click="handleClearSelected">
清空
</el-button>
</div>
<div class="store-list-wrapper">
<el-table :data="getSelectedMerchantTable" height="450">
<el-table-column label="门店名称"
prop="merchantName" />
<el-table-column label="品牌名称">
<template #default="{ row }">
<el-tag v-for="(brand, brandIndex) in row.checkBrands"
:key="brand.brandId"
closable
disable-transitions
@close="handleRemoveSelectedBrandTag(brand, row, brandIndex)">
{{ brand.brandName }}
</el-tag>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
// import { getStoreWithBrandList } from "@/api/mock/performance.mock.js";
import { getMerchantBrand } from "@api/resident.js";
export default { export default {
name: "", name: "",
props: { props: {
...@@ -12,21 +109,171 @@ export default { ...@@ -12,21 +109,171 @@ export default {
}, },
data() { data() {
return { return {
queryParams: {
merchantId: "",
merchantName: "",
brandName: "",
name: "",
currentPage: 1,
pageSize: 20,
total: 99,
},
merchantTable: [],
selectedMerchants: {},
}; };
}, },
computed: { computed: {
getSelectedMerchantTable() {
// 从selectedMerchants直接读取,不再依赖merchantTable
return Object.values(this.selectedMerchants);
}, },
mounted() {
}, },
async mounted() {
await this.getData();
},
methods: { methods: {
handleCurrentChange() {},
handleSizeChange() {},
handleCheckBrandAllChange(val, row, index) {
if (val) {
// 全选:保存所有品牌的brandId
row.checkBrands = row.merchantBrandList.map(brand => brand.brandId);
// 同时更新selectedMerchants,保存完整的品牌对象
const selectedBrands = row.merchantBrandList.map(brand => ({
brandId: brand.brandId,
brandName: brand.brandName,
}));
this.$set(this.selectedMerchants, row.merchantId, {
merchantId: row.merchantId,
merchantName: row.merchantName,
checkBrands: selectedBrands,
});
} else {
// 取消全选
row.checkBrands = [];
this.$delete(this.selectedMerchants, row.merchantId);
}
row.isIndeterminate = false;
},
handleCheckedBrandChange(value, row, index) {
// value 是 brandId 数组
row.checkAll = value.length === row.merchantBrandList.length;
row.isIndeterminate = value.length > 0 && value.length < row.merchantBrandList.length;
// 将 brandId 数组转换为品牌对象数组,保存到 selectedMerchants
if (value.length > 0) {
const selectedBrands = value.map((brandId) => {
const brand = row.merchantBrandList.find(b => b.brandId === brandId);
return {
brandId: brand.brandId,
brandName: brand.brandName,
};
});
this.$set(this.selectedMerchants, row.merchantId, {
merchantId: row.merchantId,
merchantName: row.merchantName,
checkBrands: selectedBrands,
});
} else {
this.$delete(this.selectedMerchants, row.merchantId);
}
},
handleRemoveSelectedBrandTag(brand, row, brandIndex) {
// 从selectedMerchants中删除该品牌
const selectedMerchant = this.selectedMerchants[row.merchantId];
if (selectedMerchant) {
const idx = selectedMerchant.checkBrands.findIndex(b => b.brandId === brand.brandId);
if (idx > -1) {
selectedMerchant.checkBrands.splice(idx, 1);
}
// 如果没有品牌了,删除整个门店
if (selectedMerchant.checkBrands.length === 0) {
this.$delete(this.selectedMerchants, row.merchantId);
}
}
// 同时更新merchantTable中对应行的checkBrands (存储的是brandId)
const merchantRow = this.merchantTable.find(m => m.merchantId === row.merchantId);
if (merchantRow) {
const idx = merchantRow.checkBrands.findIndex(bid => bid === brand.brandId);
if (idx > -1) {
merchantRow.checkBrands.splice(idx, 1);
}
merchantRow.checkAll = merchantRow.checkBrands.length === merchantRow.merchantBrandList.length;
merchantRow.isIndeterminate = merchantRow.checkBrands.length > 0 && merchantRow.checkBrands.length < merchantRow.merchantBrandList.length;
}
},
/**
* 清空已选的所有门店和品牌
*/
handleClearSelected() {
// 清空selectedMerchants
this.selectedMerchants = {};
// 同时清空merchantTable中每一行的checkBrands
this.merchantTable.forEach((merchant) => {
merchant.checkBrands = [];
merchant.checkAll = false;
merchant.isIndeterminate = false;
});
},
async getData() {
console.log("this.queryParams", this.queryParams);
const { pageNum, list, pageSize } = await getMerchantBrand(this.queryParams);
list.forEach((merchant, index) => {
merchant.checkAll = false;
merchant.isIndeterminate = false;
merchant.checkBrands = [];
});
this.merchantTable = list;
this.queryParams.currentPage = pageNum;
this.queryParams.pageSize = pageSize;
},
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.selection-store-wrapper {
display: flex;
width: 100%;
> .pre-select-store-wrapper {
flex: 1;
min-width: 616px;
.search-wrapper {
display: flex;
align-content: center;
padding: 12px 16px;
}
}
> .selected-store-wrapper {
margin-left: 24px;
min-width: 39%;
> .actions-wrapper {
display: flex;
justify-content: space-between;
padding: 12px 16px;
.selected-count {
line-height: 36px;
}
}
}
.selected-store-wrapper,
.pre-select-store-wrapper {
border: 1px solid #e5e5e5;
.actions-wrapper,
.search-wrapper {
border-bottom: 1px solid #e5e5e5;
}
> .title {
line-height: 23px;
color: #333333;
font-size: 16px;
padding: 12px 16px;
background: #f5f5f5;
}
}
}
</style> </style>
export { default as FormItemHelp } from "./components/formItemHelp/index.vue";
export { default as ParamConfigList } from "./components/paramConfigList/index.vue";
export * from "./components/performanceRuleSelection/options.js";
export { default as StoreApply } from "./components/storeApply/index.vue";
export { default as StoreSelect } from "./components/storeSelect/index.vue";
export * from "./store/helper.js";
export { default as performanceFormStore } from "./store/performanceFormStore.js";
...@@ -74,6 +74,7 @@ export default { ...@@ -74,6 +74,7 @@ export default {
}, },
// 操作考核因子 // 操作考核因子
touchAssessment(state, selectedItems) { touchAssessment(state, selectedItems) {
console.log("selectedItems", selectedItems);
state.formData.assessmentFactor = selectedItems.sort((a, b) => a.sort - b.sort); state.formData.assessmentFactor = selectedItems.sort((a, b) => a.sort - b.sort);
if (!Array.isArray(state.formData.paramConfigList)) { if (!Array.isArray(state.formData.paramConfigList)) {
state.formData.paramConfigList = []; state.formData.paramConfigList = [];
...@@ -91,7 +92,7 @@ export default { ...@@ -91,7 +92,7 @@ export default {
? existingConfigMap.get(sort) ? existingConfigMap.get(sort)
: { : {
...structuredClone(paramConfigListTemplate), ...structuredClone(paramConfigListTemplate),
priceRangeProps: item.rangeProps, priceRangeProps: item.componentProps,
title: item.label, title: item.label,
assessmentFactor: item, assessmentFactor: item,
sort, sort,
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
label-width="170px" label-width="170px"
:model="formData" :model="formData"
:rules="rules"> :rules="rules">
<div class="warp-box">
<!-- <div class="warp-box">
<div class="title space-b"> <div class="title space-b">
<div class="title-wrap"> <div class="title-wrap">
<span>渠道配置</span> <span>渠道配置</span>
...@@ -48,7 +47,7 @@ ...@@ -48,7 +47,7 @@
class="params-config-list" class="params-config-list"
:config-index="index" /> :config-index="index" />
</div> </div>
</div> --> </div>
<div class="warp-box"> <div class="warp-box">
<div class="title space-b"> <div class="title space-b">
...@@ -79,6 +78,9 @@ import PerformanceRuleSelection from "../components/performanceRuleSelection/ind ...@@ -79,6 +78,9 @@ import PerformanceRuleSelection from "../components/performanceRuleSelection/ind
import StoreApply from "../components/storeApply/index.vue"; import StoreApply from "../components/storeApply/index.vue";
import { bindFormFields } from "../store/helper.js"; import { bindFormFields } from "../store/helper.js";
console.log("StoreApply", StoreApply);
console.log("PerformanceRuleSelection", PerformanceRuleSelection);
export default { export default {
name: "PerformanceScheme", name: "PerformanceScheme",
components: { components: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!