Commit f5aca251 by Jaxon

feat(绩效方案): 实现绩效方案提交功能并优化UI

- 新增绩效方案数据转换工具,将前端表单数据转换为后端API所需格式
- 实现绩效方案提交功能,调用后端API保存方案配置
- 优化门店选择组件样式和交互,修复模板语法问题
- 调整商品级联选择器布局,添加旋转图标
- 重构绩效规则选择组件,使用Vuex绑定表单字段
- 统一代码格式,修复ESLint警告
- 更新VS Code拼写检查配置,添加"Cascader"单词
1 parent bdaef0ae
......@@ -3,7 +3,8 @@
"src/locales"
],
"cSpell.words": [
"vuex"
"vuex",
"Cascader"
],
"explorer.compactFolders": false,
"scm.compactFolders": false,
......
module.exports = {
gscPost: (url, data, _config = {}) => {
return window.$gscApi.post(url, data, _config)
}
}
gscPost: (url, data, _config = {}) => {
return window.$gscApi.post(url, data, _config);
},
};
import { BrowserTracing } from "@sentry/tracing";
// 接入sentry
import * as Sentry from "@sentry/vue";
import { Request } from "glsk-toolkit";
// Vue
import Vue from "vue"
// import axios from 'axios'
// import i18n from './i18n'
import App from "./App"
import Vue from "vue";
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload";
import { config } from "@/common/baseConfig";
import GLMapSdk from "@/common/glsk-mapapi-sdk";
import notice from "@/common/notice";
import util from "@/libs/util.js";
// 针对template模板中使用可选链操作符
import chaining from "@/plugin/chaining";
// 核心插件
import d2Admin from "@/plugin/d2admin"
import d2Admin from "@/plugin/d2admin";
// store
import store from "@/store/index"
// 针对template模板中使用可选链操作符
import chaining from "@/plugin/chaining"
// 接入sentry
import * as Sentry from "@sentry/vue"
import { BrowserTracing } from "@sentry/tracing"
import store from "@/store/index";
// import axios from 'axios'
// import i18n from './i18n'
import App from "./App";
// import D2Crud from '@d2-projects/d2-crud'
// 菜单和路由设置
import router from "./router"
import "default-passive-events"
import notice from "@/common/notice"
import "element-ui/lib/theme-chalk/index.css"
import { config } from "@/common/baseConfig"
import GLMapSdk from "@/common/glsk-mapapi-sdk"
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload"
import { Request } from "glsk-toolkit"
import util from "@/libs/util.js"
import router from "./router";
import "default-passive-events";
import "element-ui/lib/theme-chalk/index.css";
Vue.prototype.$mapapi = new GLMapSdk()
Vue.prototype.$mapapi = new GLMapSdk();
Vue.use(VueLazyload, {
// 懒加载默认加载图片
loading:
// 懒加载默认加载图片
loading:
"https://img02.glsx.com.cn/weapp/resource/saas/dj/images/img_loading.png",
attempt: 3 // 尝试加载次数
})
attempt: 3, // 尝试加载次数
});
// 实例化
process.env.NODE_ENV === "production" &&
Sentry.init({
Vue,
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//]
})
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
logErrors: true,
// 解决火狐浏览器 无法捕获错误的问题
beforeSend(event, hint) {
const isNonErrorException =
event.exception.values[0].value.startsWith(
"Non-Error exception captured"
) ||
hint.originalException.message.startsWith(
"Non-Error exception captured"
)
if (isNonErrorException) {
// We want to ignore those kind of errors
return null
}
return event
}
// "send-default-pii": true
})
process.env.NODE_ENV === "production"
&& Sentry.init({
Vue,
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
logErrors: true,
// 解决火狐浏览器 无法捕获错误的问题
beforeSend(event, hint) {
const isNonErrorException
= event.exception.values[0].value.startsWith(
"Non-Error exception captured",
)
|| hint.originalException.message.startsWith(
"Non-Error exception captured",
);
if (isNonErrorException) {
// We want to ignore those kind of errors
return null;
}
return event;
},
// "send-default-pii": true
});
// d2Admin 已导入
// import ElementUI from 'element-ui'
// Vue.use(ElementUI)
// 核心插件
Vue.use(d2Admin)
Vue.use(chaining)
Vue.use(d2Admin);
Vue.use(chaining);
// Vue.use(GLCombiForm)
Vue.prototype.notice = notice
Vue.prototype.notice = notice;
const isProd = process.env.NODE_ENV === "production"
const isProd = process.env.NODE_ENV === "production";
// console.log(isProd)
if (!isProd) {
Vue.config.devtools = true
Vue.config.devtools = true;
}
Vue.prototype.$EventBus = new Vue()
Vue.prototype.$EventBus = new Vue();
Vue.directive("preventReClick", {
bind: (el, binding) => {
let time = binding.value // 防抖时间
if (!time) {
// 用户若不设置防抖时间,则默认1s
time = 1000
}
let fun
el.addEventListener(
"click",
(event) => {
if (!fun) {
// 第一次执行
fun = setTimeout(() => {
fun = null
}, time)
} else {
// 直接取消当前事件
event && event.stopImmediatePropagation()
}
},
true
)
}
})
let baseConfig = config
bind: (el, binding) => {
let time = binding.value; // 防抖时间
if (!time) {
// 用户若不设置防抖时间,则默认1s
time = 1000;
}
let fun;
el.addEventListener(
"click",
(event) => {
if (!fun) {
// 第一次执行
fun = setTimeout(() => {
fun = null;
}, time);
} else {
// 直接取消当前事件
event && event.stopImmediatePropagation();
}
},
true,
);
},
});
let baseConfig = config;
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch(
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config"
"https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config",
)
.then(
(response) => {
// 处理http响应
return response.json()
},
(error) => {
// 处理错误
console.log(error)
}
)
.then((response) => {
const { code, data } = response
console.log("response", code, response)
if (code == "200") {
console.log(data)
baseConfig = data
// console.log("baseConfig", baseConfig)
// window.$fetchConfig = data
} else {
baseConfig = response
window.$fetchConfig = response
console.log(response)
window.$gscApi = new Request({
...response.gsc,
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
session: {
requiresSession: true,
sessionId: (_) => util.cookies.get("token")
},
events: {
error: (error, config) => {
Vue.prototype.$message.error(error.msg)
},
logout: (response, config) => {
store.dispatch("d2admin/user/clear")
util.cookies.remove("token")
router.replace("/login")
Vue.prototype.$message.error("登录超时,请重新登录")
}
}
})
console.log(window.$gscApi, "========")
}
})
.finally(() => {
init()
})
.then(
(response) => {
// 处理http响应
return response.json();
},
(error) => {
// 处理错误
console.log(error);
},
)
.then((response) => {
const { code, data } = response;
console.log("response", code, response);
if (code == "200") {
console.log(data);
baseConfig = data;
// console.log("baseConfig", baseConfig)
// window.$fetchConfig = data
} else {
baseConfig = response;
window.$fetchConfig = response;
console.log(response);
window.$gscApi = new Request({
...response.gsc,
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
session: {
requiresSession: true,
sessionId: _ => util.cookies.get("token"),
},
events: {
error: (error, config) => {
Vue.prototype.$message.error(error.msg);
},
logout: (response, config) => {
store.dispatch("d2admin/user/clear");
util.cookies.remove("token");
router.replace("/login");
Vue.prototype.$message.error("登录超时,请重新登录");
},
},
});
console.log(window.$gscApi, "========");
}
})
.finally(() => {
init();
});
function init() {
new Vue({
router,
store,
// i18n,
render: (h) => {
// baseConfig.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// data
// console.log(data)
Vue.prototype.baseConfig = baseConfig
return h(App)
},
created() {
// 系统配置
Vue.config.devtools = true
// 展示系统信息
this.$store.commit("d2admin/releases/versionShow")
// 用户登录后从数据库加载一系列的设置
this.$store.dispatch("d2admin/account/load")
// 获取并记录用户 UA
this.$store.commit("d2admin/ua/get")
// 初始化全屏监听
this.$store.dispatch("d2admin/fullscreen/listen")
},
mounted() {}
}).$mount("#app")
new Vue({
router,
store,
// i18n,
render: (h) => {
// baseConfig.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// data
// console.log(data)
Vue.prototype.baseConfig = baseConfig;
return h(App);
},
created() {
// 系统配置
Vue.config.devtools = true;
// 展示系统信息
this.$store.commit("d2admin/releases/versionShow");
// 用户登录后从数据库加载一系列的设置
this.$store.dispatch("d2admin/account/load");
// 获取并记录用户 UA
this.$store.commit("d2admin/ua/get");
// 初始化全屏监听
this.$store.dispatch("d2admin/fullscreen/listen");
},
mounted() {},
}).$mount("#app");
}
export { baseConfig }
export { baseConfig };
......@@ -48,8 +48,18 @@
prop="productLabel"
width="180px">
<template #header="{ $index }">
<div>
<div class="product-cascader-wrapper">
<span class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;position: absolute;left:6px;top:50%; transform: translate(0, -50%);padding:0">
</span>
<!-- <el-button style="position: absolute;left:6px;top:50%; transform: translate(0, -50%);padding:0"
title="删除列"
type="text"
@click="handleRemoveProductsCol(index)">
<i class="el-icon-delete" />
</el-button> -->
<GoodsCategoryCascader v-model="curParamsConfig.ParamsType1Products[index].productLabel" @change="handleProductChange" />
<!-- <el-cascader v-model="curParamsConfig.ParamsType1Products[index].productLabel"
......@@ -58,7 +68,7 @@
@change="handleProductChange">
</el-cascader> -->
<el-button style="position: absolute;right:6px;"
<el-button style="position: absolute;right:6px;top:50%; transform: translate(0, -50%);padding:0"
title="删除列"
type="text"
@click="handleRemoveProductsCol(index)">
......
......@@ -201,6 +201,7 @@ export default {
margin-left: 6px;
cursor: pointer;
transition: color 200ms;
transform: rotate(90deg);
&:hover {
color: #2a58ad;
}
......
......@@ -95,8 +95,7 @@ export default {
},
},
rules: {},
// 临时给组件用,会转换成OptionsItem 存储到 fromData里
assessmentFactorValue: [],
assessmentFactorOptions,
isUpdating: false, // 防止循环更新
// 提成基数和提成方式的对应关系:基数 <-> 方式
......@@ -108,8 +107,9 @@ export default {
};
},
computed: {
// 临时给组件用,会转换成OptionsItem 存储到 fromData里
...mapState("PerformanceFormStore", ["formData"]),
assessmentFactorValue: bindFormFields("assessmentFactorValue"),
assessmentFactor: bindFormFields("assessmentFactor"),
checkList: bindFormFields("checkList"),
commissionBases: bindFormFields("commissionBases"),
......
......@@ -13,25 +13,29 @@
</el-date-picker>
</el-form-item> -->
<d2-table v-if="selectedMerchantsList.length > 0"
ref="selectedMerTable"
:search-form="{}"
:table-params="tableParams"
:hasPage="false"
:table-data="selectedMerchantsList">
<div slot="auth-button" slot-scope="scope">
<el-button type="text" size="mini" @click="handleDeleteMer(scope.scope, scope.index)">
删除
</el-button>
</div>
</d2-table>
<d2-table v-if="selectedMerchantsList.length > 0"
ref="selectedMerTable"
:has-page="false"
:search-form="{}"
:table-data="selectedMerchantsList"
:table-params="tableParams">
<template #auth-button="scope">
<div>
<el-button size="mini"
type="text"
@click="handleDeleteMer(scope.scope, scope.index)">
删除
</el-button>
</div>
</template>
</d2-table>
<el-dialog :before-close="handleCloseDialog"
<el-dialog v-if="dialog.storeApply.visible"
:before-close="handleCloseDialog"
custom-class="store-select-dialog"
:title="dialog.storeApply.title"
:visible.sync="dialog.storeApply.visible"
:width="dialog.storeApply.width"
v-if="dialog.storeApply.visible">
:width="dialog.storeApply.width">
<StoreSelect ref="storeSelect" />
<template #footer>
<span class="dialog-footer">
......@@ -46,7 +50,7 @@
<script>
import { mapMutations, mapState } from "vuex";
import { deepClone } from "@/common/util"
import { deepClone } from "@/common/util";
import StoreSelect from "../storeSelect/index.vue";
export default {
......@@ -66,35 +70,35 @@ export default {
},
selectedMerchantsList: [],
tableParams: {
listName: 'list',
tableOption: true,
listName: "list",
tableOption: true,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName',
width: '471'
},
{
label: '品牌名称',
prop: 'brandName',
width: '471',
formatter: cellValue => {
{
label: "门店名称",
prop: "merchantName",
width: "471",
},
{
label: "品牌名称",
prop: "brandName",
width: "471",
formatter: (cellValue) => {
// 按 brandId 分组,相同 brandId 的子品牌放一起,并在前面展示品牌名
const groupMap = {};
cellValue.checkBrands.forEach(brand => {
if (!groupMap[brand.brandId]) {
groupMap[brand.brandId] = {
brandName: brand.brandName,
childNames: []
};
}
groupMap[brand.brandId].childNames.push(brand.childName);
});
return Object.values(groupMap).map(item => `${item.brandName}-${item.childNames.join('/')}`).join(';') || '-';
const groupMap = {};
cellValue.checkBrands.forEach((brand) => {
if (!groupMap[brand.brandId]) {
groupMap[brand.brandId] = {
brandName: brand.brandName,
childNames: [],
};
}
groupMap[brand.brandId].childNames.push(brand.childName);
});
return Object.values(groupMap).map(item => `${item.brandName}-${item.childNames.join("/")}`).join(";") || "-";
},
},
}
]
}
],
},
};
},
computed: {
......@@ -105,42 +109,42 @@ export default {
methods: {
...mapMutations("PerformanceFormStore", ["setMerchantBrandRefList"]),
changeStoreApplyVisible() {
this.dialog.storeApply.visible = !this.dialog.storeApply.visible
this.dialog.storeApply.visible = !this.dialog.storeApply.visible;
},
handleCloseDialog() {
this.changeStoreApplyVisible()
this.changeStoreApplyVisible();
},
handleDeleteMer(row, idx) {
this.selectedMerchantsList.splice(idx, 1)
this.setMerchantBrandRefList(deepClone(this.selectedMerchantsList))
this.selectedMerchantsList.splice(idx, 1);
this.setMerchantBrandRefList(deepClone(this.selectedMerchantsList));
},
handleDialogConfirm() {
console.log(this.$refs.storeSelect.selectedMerchants)
this.selectedMerchantsList = Object.keys(this.$refs.storeSelect.selectedMerchants).map(key => this.$refs.storeSelect.selectedMerchants[key]) || []
console.log(this.selectedMerchantsList)
if(this.selectedMerchantsList.length == 0) {
this.$message({
message: "请选择门店及品牌",
type: "warning",
})
return
}
// let list = []
// selectedMerchantsList.forEach(item => {
// item.checkBrands.forEach(brand => {
// list.push({
// merchantId: item.merchantId,
// merchantName: item.merchantName,
// brandId: brand.brandId,
// brandName: brand.brandName,
// childId: brand.childId,
// childName: brand.childName,
// })
// })
// })
this.setMerchantBrandRefList(deepClone(this.selectedMerchantsList))
this.changeStoreApplyVisible()
console.log(this.$refs.storeSelect.selectedMerchants);
this.selectedMerchantsList = Object.keys(this.$refs.storeSelect.selectedMerchants).map(key => this.$refs.storeSelect.selectedMerchants[key]) || [];
console.log(this.selectedMerchantsList);
if (this.selectedMerchantsList.length === 0) {
this.$message({
message: "请选择门店及品牌",
type: "warning",
});
return;
}
// let list = []
// selectedMerchantsList.forEach(item => {
// item.checkBrands.forEach(brand => {
// list.push({
// merchantId: item.merchantId,
// merchantName: item.merchantName,
// brandId: brand.brandId,
// brandName: brand.brandName,
// childId: brand.childId,
// childName: brand.childName,
// })
// })
// })
this.setMerchantBrandRefList(deepClone(this.selectedMerchantsList));
this.changeStoreApplyVisible();
},
},
};
......
<template>
<div class="selection-store-wrapper" v-loading="loading">
<div v-loading="loading" class="selection-store-wrapper">
<div class="pre-select-store-wrapper">
<div class="title">
预选门店及品牌
......@@ -87,20 +87,24 @@
closable
disable-transitions
@close="handleRemoveSelectedBrandTag(brand, row, brandIndex)">
<el-tooltip class="tooltip-item"
effect="dark"
:content="brand.brandName + '+' + brand.childName"
placement="top">
<span class="tag-txt">{{ (brand.brandName || '') + (brand.brandName ? '+' : '') + (brand.childName || '') }}</span>
</el-tooltip>
<el-tooltip class="tooltip-item"
:content="`${brand.brandName}+${brand.childName}`"
effect="dark"
placement="top">
<span class="tag-txt">{{ (brand.brandName || '') + (brand.brandName ? '+' : '') + (brand.childName || '') }}</span>
</el-tooltip>
</el-tag>
</template>
</el-table-column>
<el-table-column label="删除" align="center" width="50px">
<template slot-scope="scope">
<el-button class="el-icon-delete" @click="handleDelete(scope.row)" type="text" />
</template>
</el-table-column>
<el-table-column align="center"
label="删除"
width="50px">
<template #default="scope">
<el-button class="el-icon-delete"
type="text"
@click="handleDelete(scope.row)" />
</template>
</el-table-column>
</el-table>
</div>
</div>
......@@ -108,10 +112,10 @@
</template>
<script>
// import { getStoreWithBrandList } from "@/api/mock/performance.mock.js";
import { deepClone } from "@/common/util"
import { getMerchantBrand } from "@api/resident.js";
import { mapGetters } from "vuex";
// import { getStoreWithBrandList } from "@/api/mock/performance.mock.js";
import { deepClone } from "@/common/util";
export default {
name: "",
......@@ -126,7 +130,7 @@ export default {
name: "",
currentPage: 1,
pageSize: 20,
total: 0
total: 0,
},
merchantTable: [],
selectedMerchants: {},
......@@ -149,11 +153,11 @@ export default {
const list = deepClone(this.getMerchantBrandRefList || []);
if (list.length > 0) {
const selected = {};
list.forEach(item => {
list.forEach((item) => {
selected[item.merchantId] = {
merchantId: item.merchantId,
merchantName: item.merchantName,
checkBrands: item.checkBrands || []
checkBrands: item.checkBrands || [],
};
});
this.selectedMerchants = selected;
......
import { last } from "lodash-es";
import store from "@/store";
export function convertDataToBackend(formData) {
console.log("formData", formData);
const goodsCategory = store.state.PerformanceFormStore.goodsCategory;
const productDefineList = store.state.PerformanceFormStore.productDefineList;
const { paramConfigList, merchantBrandRefList, ...data } = formData;
const requestData = {
schemaName: data.schemaName,
businessType: data.businessType,
effectiveMonth: data.storeConfig.effectiveMonth,
performanceConfigRule: {
assessmentFactors: data.assessmentFactorValue.join(","),
commissionBases: data.commissionBases.join(","),
commissionTypes: data.commissionTypes.join(","),
goodsConfigTypes: data.goodsConfigTypes.join(","),
},
paramConfigList: [],
merchantBrandRefList: [],
};
for (const paramConfig of paramConfigList) {
// 每一份表格
const { templateType, ParamsType1, ParamsType1Products } = paramConfig;
console.log(paramConfig);
if (templateType === "ParamsType1") {
// 处理ParamsType1 类型的表格
coverParamsType1(ParamsType1, ParamsType1Products, (item, { rowItem, row }, { productColItem, colIndex }) => {
requestData.paramConfigList.push({
...item,
assessmentFactor: paramConfig.assessmentFactor.value,
goodsConfigType: paramConfig.goodsConfigType,
...paramConfig.goodsConfigType === 0
? buildGoodsTypePayload(goodsCategory, paramConfig.ParamsType1Products[colIndex].productLabel)
: buildProductDefinePayload(productDefineList, paramConfig.ParamsType1Products[colIndex].productLabel),
});
});
}
}
// 整理门店
requestData.merchantBrandRefList = buildMerchantBrandPayload(merchantBrandRefList, data.businessType);
console.log("performanceConfigRule", requestData);
return requestData;
}
function buildProductDefinePayload(tree, pathIds) {
let currentLevel = tree;
let targetNode = null;
for (const id of pathIds) {
targetNode = currentLevel.find(item => item.id === id);
if (!targetNode)
break;
currentLevel = targetNode.children || [];
}
return {
productDefineId: targetNode?.id ?? null,
productDefineName: targetNode?.label ?? null,
};
}
function buildGoodsTypePayload(tree, pathIds) {
const result = {};
let currentLevel = tree;
pathIds.forEach((id, index) => {
const node = currentLevel.find(item => item.categoryType === id);
if (!node)
return;
if (index === 0) {
result.goodsType = node.categoryType;
result.goodsTypeName = node.categoryName;
} else if (index === 1) {
result.secondaryGoodsType = node.categoryType;
result.secondaryGoodsTypeName = node.categoryName;
} else if (index === 2) {
result.thirdLevelGoodsType = node.categoryType;
result.thirdLevelGoodsTypeName = node.categoryName;
}
currentLevel = node.children || [];
});
return result;
}
function coverParamsType1(ParamsType1, ParamsType1Products, fn) {
ParamsType1.forEach((rowItem, row) => {
ParamsType1Products.forEach((productColItem, colIndex) => {
const result = {
templateType: 1,
startValue: rowItem.priceRange[0],
endValue: rowItem.priceRange[1],
commissionType: rowItem.commissionTypes,
commissionBase: productColItem.productValue[row],
};
// 还要加多 一个goodsConfigType 字段
if (fn && typeof fn === "function") {
fn(result, { rowItem, row }, { productColItem, colIndex });
}
});
});
}
function buildMerchantBrandPayload(
merchantBrandRefList,
businessType,
) {
const result = [];
merchantBrandRefList.forEach((merchant) => {
const {
merchantId,
merchantName,
checkBrands = [],
} = merchant;
checkBrands.forEach((brand) => {
result.push({
merchantId,
merchantName,
brandId: brand.brandId,
brandName: brand.brandName,
childId: brand.childId,
childName: brand.childName,
businessType: String(businessType),
});
});
});
return result;
}
......@@ -72,12 +72,13 @@
<script>
import { mapMutations, mapState } from "vuex";
import { getAllCategory } from "@/api/product.js";
import { getTargetProductConfigListAPI } from "@/api/resident";
import { getTargetProductConfigListAPI, postSalaryPerformanceScheme } from "@/api/resident";
import ChannelConfig from "../components/channelConfig/index.vue";
import ParamConfigList from "../components/paramConfigList/index.vue";
import PerformanceRuleSelection from "../components/performanceRuleSelection/index.vue";
import StoreApply from "../components/storeApply/index.vue";
import { bindFormFields } from "../store/helper.js";
import { convertDataToBackend } from "../utils/index.js";
export default {
name: "PerformanceScheme",
......@@ -94,7 +95,7 @@ export default {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData"]),
...mapState("PerformanceFormStore", ["formData", "merchantBrandRefList"]),
schemaName: bindFormFields("schemaName"),
},
......@@ -113,8 +114,11 @@ export default {
}
});
},
handleSubmit() {
console.log(this.formData);
async handleSubmit() {
await postSalaryPerformanceScheme(convertDataToBackend({
...this.formData,
merchantBrandRefList: this.merchantBrandRefList,
}));
},
async initLoad() {
// 获取品类
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!