Commit d85357dd by wangzhihui

Merge branch 'feature/salaryPerformance' into SAAS+V5.6.1

2 parents 0dda2386 a3439f25
Showing 59 changed files with 3881 additions and 404 deletions
...@@ -2,8 +2,8 @@ root = true ...@@ -2,8 +2,8 @@ root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_style = space indent_style = tab
indent_size = 2 indent_size = 4
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
# 忽略目录
build/
tests/
node_modules/
# node 覆盖率文件
coverage/
# 忽略文件
**/*-min.js
**/*.min.js
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/essential',
'@vue/prettier'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
module.exports = {
root: true,
parserOptions: {
// parser: '@babel/eslint-parser'
ecmaVersion: 2020
},
env: {
browser: true
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevent
// ion consider switching to `plugin:vue/strongly-recommended` or
// `plugin:vue/recommended` for stricter rules.
"plugin:vue/essential",
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
"standard",
"plugin:vue/strongly-recommended",
"@vue/standard"
// '@vue/typescript/recommended'
],
// required to lint *.vue files
plugins: ["vue"],
globals: {
NODE_ENV: false,
_: false,
echarts: false
},
rules: {
"vue/max-attributes-per-line": [
0,
{
singleline: 10,
multiline: {
max: 2,
allowFirstLine: false
}
}
],
"vue/html-closing-bracket-newline": [
"error",
{
singleline: "never",
multiline: "never"
}
],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline": "off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
"arrow-spacing": [
2,
{
before: true,
after: true
}
],
"no-var": "off",
eqeqeq: "off",
// 'no-eval': ['error', { allowIndirect: false }], // default is false
"no-eval": "off", // default is false
// allow async-await
"generator-star-spacing": "off",
// 'block-spacing': [2, 'always'],
"brace-style": [
2,
"1tbs",
{
allowSingleLine: true
}
],
"comma-dangle": [2, "never"],
"comma-spacing": [
2,
{
before: false,
after: true
}
],
"comma-style": [2, "last"],
curly: [2, "multi-line"],
"dot-location": [2, "property"],
indent: [
2,
2,
{
SwitchCase: 1
}
],
"key-spacing": [
2,
{
beforeColon: false,
afterColon: true
}
],
"keyword-spacing": [
2,
{
before: true,
after: true
}
],
"new-cap": [
2,
{
newIsCap: true,
capIsNew: false
}
],
"no-extra-parens": [2, "functions"],
"no-floating-decimal": 2,
"no-multi-spaces": 2,
"no-multiple-empty-lines": [
2,
{
max: 1
}
],
"no-trailing-spaces": 2,
quotes: [
0,
"single",
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
semi: [2, "never"],
"space-before-blocks": [2, "always"],
// 'space-before-function-paren': [2, 'never'],
"space-before-function-paren": 0,
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [
2,
{
words: true,
nonwords: false
}
],
"spaced-comment": [2, "always"],
"prefer-const": 2,
"node/no-callback-literal": 'off',
"no-unused-expressions": "off",
camelcase: 'off',
"no-undef": 'off',
"vue/html-self-closing": 'off',
"array-callback-return": 'off'
}
}
...@@ -12,7 +12,6 @@ yarn-error.log* ...@@ -12,7 +12,6 @@ yarn-error.log*
# Editor directories and files # Editor directories and files
.idea .idea
.vscode
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
......
{
"singleQuote": false,
"semi": false,
"trailingComma": "none"
}
{
"recommendations": [
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode"
]
}
\ No newline at end of file \ No newline at end of file
{
"i18n-ally.localesPaths": [
"src/locales"
],
"cSpell.words": [
"vuex",
"Cascader"
],
"explorer.compactFolders": false,
"scm.compactFolders": false,
"problems.decorations.enabled": false,
"eslint.format.enable": true,
"vetur.validation.template": false,
"vetur.validation.script": false,
"vetur.validation.style": true,
"vetur.ignoreProjectWarning": false,
"vetur.experimental.templateInterpolationService": false,
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"editor.autoIndent": "full",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"i18n-ally.sourceLanguage": "zh-chs"
}
\ No newline at end of file \ No newline at end of file
{
"Vue 2 Component": {
"prefix": "vue2",
"body": [
"<template>",
" <div class=\"$1\">",
" $0",
" </div>",
"</template>",
"",
"<script>",
"export default {",
" name: '$2',",
" data() {",
" return {",
" $3",
" };",
" },",
" props: {",
" $4",
" },",
" computed: {",
" $5",
" },",
" methods: {",
" $6",
" },",
" mounted() {",
" $7",
" }",
"};",
"</script>",
"",
"<style scoped lang=\"scss\">",
"$8",
"</style>"
],
"description": "Vue 2 单文件组件模板"
},
"Vuex Store Template (Vue2)": {
"prefix": "vuexstore2",
"body": [
"export default {",
" state: {",
" ${1:count}: ${2:0},",
" },",
" getters: {",
" ${3:get${1/(.*)/${1:/capitalize}/}}: state => state.${1},",
" },",
" mutations: {",
" set${1/(.*)/${1:/capitalize}/}(state, payload) {",
" state.${1} = payload;",
" },",
" increment${1/(.*)/${1:/capitalize}/}(state, payload = 1) {",
" state.${1} += payload;",
" }",
" },",
" actions: {",
" ${4:increment${1/(.*)/${1:/capitalize}/}Async}({ commit }, payload) {",
" setTimeout(() => {",
" commit('increment${1/(.*)/${1:/capitalize}/}', payload);",
" }, 1000);",
" }",
" },",
"};"
],
"description": "Vue 2 + Vuex 3 的 store 模板"
}
}
import antfu from "@antfu/eslint-config";
export default antfu({
markdown: true,
vue: true,
css: true,
jsonc: true,
json: true,
ignores: [
// 忽略uni_modules目录
"**/uni_modules/",
"dist",
// unplugin-auto-import 生成的类型文件,每次提交都改变,所以加入这里吧,与 .gitignore 配合使用
"auto-import.d.ts",
],
stylistic: {
"indent": "tab", // 4个空格
"quotes": "double", // or 'double'
"semi": true,
"array-bracket-spacing": ["error", "always"],
},
rules: {
"vue/no-deprecated-delete-set": "off",
"vue/no-deprecated-dollar-listeners-api": "off",
"vue/require-explicit-emits": "off",
"eqeqeq": "warn",
"vue/v-on-event-hyphenation": "off",
"style/no-tabs": "off",
"vue/no-deprecated-v-bind-sync": "off",
"vue/no-lone-template": "off",
"vue/no-mutating-props": "off",
// 强制:Vue 多行 HTML 元素的内容前后必须换行
"vue/multiline-html-element-content-newline": [
"error",
{
ignoreWhenEmpty: false, // 即使元素内容为空,也要求换行(如 <div>\n</div>)
ignores: [], // 无忽略的元素(所有多行元素都生效)
allowEmptyLines: true, // 允许内容前后存在空白行
},
],
// 强制:Vue HTML 标签闭合括号不换行
"vue/html-closing-bracket-newline": [
"error",
{
singleline: "never", // 单行标签:闭合括号不换行(如 <image src="xxx" />)
multiline: "never", // 多行标签:闭合括号不换行(如 <image\n src="xxx"\n/>)
},
],
// 强制:Vue HTML 元素自闭合格式(如 <image /> 而非 <image></image>)
"vue/html-self-closing": [
"error",
{
html: {
void: "any", // 原生空标签(如 <img>)允许任意自闭合格式
normal: "any", // 原生普通标签(如 <div>)允许任意自闭合格式
component: "any", // 自定义组件(如 <MyComponent>)允许任意自闭合格式
},
svg: "any", // SVG 标签允许任意自闭合格式
math: "any", // MathML 标签允许任意自闭合格式
},
],
// 强制:Vue HTML 模板中标签缩进 4 个空格
"vue/html-indent": [
"error",
4,
{
attribute: 1, // 属性相对于标签缩进 1 级(4 个空格)
baseIndent: 1, // 基础缩进 1 级(适配组件嵌套场景)
closeBracket: 0, // 闭合标签与属性对齐(不额外缩进)
alignAttributesVertically: true, // 多行属性时垂直对齐(如所有属性左侧对齐)
ignores: [], // 无忽略的标签
},
],
"vue/attributes-order": ["error", {
order: [
"DEFINITION", // is
"LIST_RENDERING", // v-for
"CONDITIONALS", // v-if v-else-if v-else v-show v-cloak
"RENDER_MODIFIERS", // v-once v-pre
"GLOBAL", // id
"UNIQUE", // ref key
"SLOT", // v-slot slot
"TWO_WAY_BINDING", // v-model
"OTHER_DIRECTIVES", // v-custom-directive
"OTHER_ATTR", // 自定义属性和其他
"EVENTS", // @click @focus
"CONTENT", // v-text v-html
],
alphabetical: true, // 是否在同组内再按字母排序(建议 false,官方默认顺序更好)
}],
// 强制:Vue SFC 中块的顺序(template -> script -> style)
"vue/block-order": [
"error",
{
order: ["template", "script", "style"], // 固定三个核心块的顺序
},
],
// 强制:Vue 元素首属性的换行格式
"vue/first-attribute-linebreak": [
"error",
{
singleline: "beside", // 单行属性:首属性紧跟标签名(不换行)
multiline: "beside", // 多行属性:首属性也紧跟标签名(注:原注释描述与配置冲突,按配置「不换行」,如需换行可改为 "below")
},
],
// 强制:Vue 元素属性每行最多数量限制
"vue/max-attributes-per-line": [
"error",
{
singleline: 2, // 单行元素最多允许 2 个属性(如 <image src="xxx" alt="xxx">)
multiline: 1, // 多行元素每行最多 1 个属性(每个属性单独一行)
},
],
// 关闭:unused-imports 插件的「禁止未使用变量」检测(与 no-unused-vars 功能重叠,同步关闭)
"unused-imports/no-unused-vars": "off",
// 关闭:禁止无限制使用 eslint-disable 注释(允许临时禁用多个规则,按需关闭)
"eslint-comments/no-unlimited-disable": "off",
// 关闭:检查 JSDoc 注释中参数名与实际参数是否一致(无需强制 JSDoc 规范时关闭)
"jsdoc/check-param-names": "off",
// 强制:代码块前必须加空格(如 function fn() { 前加空格,报错级别 error)
"space-before-blocks": "error",
// 关闭:禁止使用 console(开发环境保留 console.log 便于调试,按需关闭)
"no-console": "off",
"style/brace-style": ["error", "1tbs"],
},
formatters: {
/**
* Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
* By default uses Prettier
*/
css: true,
scss: true,
less: true,
/**
* Format HTML files
* By default uses Prettier
*/
html: true,
},
});
{
"compilerOptions": {
"target": "ES2020",
// "jsx": "react-jsx",
// "lib": ["ES2020", "DOM", "DOM.Iterable"],
"lib": [
"ES2020"
],
"useDefineForClassFields": true,
/* Paths */
"baseUrl": ".",
"module": "ESNext",
/* Bundler mode */
"moduleResolution": "bundler",
"paths": {
"@/*": [
"src/*"
],
"@api/*": [
"src/api/*"
]
},
"resolveJsonModule": true,
"allowImportingTsExtensions": false,
"allowJs": true,
"checkJs": false,
"noEmit": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"skipLibCheck": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"dist",
".git"
]
}
\ No newline at end of file \ No newline at end of file
This diff could not be displayed because it is too large.
...@@ -23,14 +23,15 @@ ...@@ -23,14 +23,15 @@
"@sentry/webpack-plugin": "^1.18.9", "@sentry/webpack-plugin": "^1.18.9",
"ali-oss": "^6.22.0", "ali-oss": "^6.22.0",
"axios": "^0.18.0", "axios": "^0.18.0",
"baseline-browser-mapping": "^2.9.13",
"better-scroll": "^1.15.2", "better-scroll": "^1.15.2",
"bignumber.js": "^9.1.1", "bignumber.js": "^9.1.1",
"caniuse-lite": "^1.0.30001763",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"dayjs": "^1.8.12", "dayjs": "^1.8.12",
"default-passive-events": "^2.0.0", "default-passive-events": "^2.0.0",
"echarts": "^5.3.2", "echarts": "^5.3.2",
"element-ui": "2.13.2", "element-ui": "2.13.2",
"eslint-plugin-standard": "^5.0.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"flex.css": "^1.1.7", "flex.css": "^1.1.7",
"fuse.js": "^3.4.4", "fuse.js": "^3.4.4",
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"jspdf": "^2.5.1", "jspdf": "^2.5.1",
"lodash-es": "^4.17.22",
"lowdb": "^1.0.0", "lowdb": "^1.0.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"number-precision": "^1.6.0", "number-precision": "^1.6.0",
...@@ -68,23 +70,19 @@ ...@@ -68,23 +70,19 @@
"yarn": "^1.22.19" "yarn": "^1.22.19"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^6.7.3",
"@babel/core": "^7.12.16", "@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@kazupon/vue-i18n-loader": "^0.4.1", "@kazupon/vue-i18n-loader": "^0.4.1",
"@vue/cli-plugin-babel": "~5.0.8", "@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-unit-jest": "~5.0.8", "@vue/cli-plugin-unit-jest": "~5.0.8",
"@vue/cli-service": "~5.0.8", "@vue/cli-service": "~5.0.8",
"@vue/eslint-config-standard": "^6.1.0", "@vue/compiler-sfc": "^3.5.26",
"@vue/test-utils": "1.0.0-beta.29", "@vue/test-utils": "1.0.0-beta.29",
"@vue/vue2-jest": "^27.0.0-alpha.3", "@vue/vue2-jest": "^27.0.0-alpha.3",
"babel-core": "7.0.0-bridge.0", "babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.6.0", "babel-jest": "^23.6.0",
"eslint": "^7.32.0", "eslint": "^9.39.2",
"eslint-plugin-import": "^2.25.3", "eslint-plugin-format": "^1.2.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^7.0.0",
"jest": "^27.1.0", "jest": "^27.1.0",
"md5": "^2.3.0", "md5": "^2.3.0",
"postcss-preset-env": "^7.7.2", "postcss-preset-env": "^7.7.2",
...@@ -94,5 +92,8 @@ ...@@ -94,5 +92,8 @@
"script-loader": "^0.7.2", "script-loader": "^0.7.2",
"vue-template-compiler": "^2.5.21", "vue-template-compiler": "^2.5.21",
"webpack": "^5.74.0" "webpack": "^5.74.0"
},
"volta": {
"node": "14.21.3"
} }
} }
module.exports = { module.exports = {
gscPost: (url, data, _config = {}) => { gscPost: (url, data, _config = {}) => {
return window.$gscApi.post(url, data, _config) return window.$gscApi.post(url, data, _config);
} },
} };
import { mockRequest } from "./request.mock";
const path = "dj.staff.api.service.merchant.";
// 分页查询费用类目
export function getStoreWithBrandList(data) {
// data.method = `${path}selectFeeCategoryList`
data.method = `${path}page.with.brand`;
return mockRequest(data);
}
/**
* Mock Service using Axios
* Mock Server Address: http://127.0.0.1:4523/m1/7746299-7491170-default/
*
* 单入口架构,通过不同的服务路径(dj.staff.api.service.merchant.page.with.brand)来决定调用后端哪个服务
*/
import axios from "axios";
// Mock 基础配置
const MOCK_BASE_URL = "http://127.0.0.1:4523/m1/7746299-7491170-default";
/**
* 创建 Mock Axios 实例
*/
const mockAxios = axios.create({
baseURL: MOCK_BASE_URL,
timeout: 10000,
headers: {
"Content-Type": "application/json",
},
});
/**
* Mock 服务包装器
*
* @param {object} params - 请求参数对象
* @param {string} params.method - 服务方法名称,如 'dj.staff.api.service.merchant.page.with.brand'
* @param {string} params.version - API版本,默认 '1.0.0'
* @param {object} params.data - 请求数据
* @param {string} method - HTTP方法,默认 'get'
* @returns {Promise} axios请求Promise
*
* @example
* mockRequest({
* method: 'dj.staff.api.service.merchant.page.with.brand',
* version: '1.0.0',
* data: {
* currentPage: 11,
* pageSize: 11,
* name: 'sss'
* }
* }, 'get')
*/
function mockRequest(params = {}, httpMethod = "post") {
const {
method = "",
data = {},
version = "1.0.0",
} = params;
if (!method) {
throw new Error("method is required in params");
}
// 构建请求URL
// 格式: /dj.staff.api.service.merchant.page.with.brand/1.0.0
const url = `/${method}/${version}`;
// 准备请求配置
const config = {
method: httpMethod.toLowerCase(),
url,
};
// 根据HTTP方法处理参数
if (httpMethod.toLowerCase() === "post" || httpMethod.toLowerCase() === "put") {
config.data = data;
} else {
// GET请求,将参数作为query string
config.params = {
"ropRequestContext.key": data["ropRequestContext.key"] || "",
...data,
};
}
return mockAxios(config);
}
/**
* 便捷方法 - GET 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockGet(params = {}) {
return mockRequest(params, "get");
}
/**
* 便捷方法 - POST 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockPost(params = {}) {
return mockRequest(params, "post");
}
/**
* 便捷方法 - PUT 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockPut(params = {}) {
return mockRequest(params, "put");
}
/**
* 便捷方法 - DELETE 请求
* @param {object} params - 请求参数
* @returns {Promise}
*/
function mockDelete(params = {}) {
return mockRequest(params, "delete");
}
/**
* 请求拦截器
*/
mockAxios.interceptors.request.use(
(config) => {
return config;
},
(error) => {
return Promise.reject(error);
},
);
/**
* 响应拦截器
*/
mockAxios.interceptors.response.use(
(response) => {
console.log("Mock Response:", response.data);
return response.data;
},
(error) => {
console.error("Mock Error:", error);
return Promise.reject(error);
},
);
export default mockAxios;
export {
mockDelete,
mockGet,
mockPost,
mockPut,
mockRequest,
};
/**
* 规范化树形数据为统一结构 {label, value, children}。
*
* - 从 labelKeys/valueKeys 中按顺序取第一个存在的字段作为 label/value。
* - 从 childrenKeys 中按顺序取第一个为数组的字段作为 children,并递归处理。
* - 当某字段不存在时,label/value 会回退为空字符串,children 回退为空数组。
*
* @typedef {object} NormalizedNode
* @property {string} label 标签文本
* @property {any} value 节点值(可能为字符串、数字等)
* @property {NormalizedNode[]} children 子节点列表
* @property {boolean} [leaf] 当原始项无子节点字段时为 false
*
* @param {Array<Record<string, any>>} data 输入的树形数据数组
* @param {object} [options] 可选配置
* @param {string[]} [options.labelKeys] 候选标签字段顺序
* @param {string[]} [options.valueKeys] 候选值字段顺序
* @param {string[]} [options.childrenKeys] 候选子节点字段顺序
* @returns {NormalizedNode[]} 规范化后的树数据
*/
export function normalizeTree(
data,
{
labelKeys,
valueKeys,
childrenKeys,
outputKeys,
} = {
labelKeys: ["label", "name", "title", "defineName", "itemName"],
valueKeys: ["value", "id", "deptId", "itemId"],
childrenKeys: ["children", "nodes", "childrenList", "itemList"],
outputKeys: {
label: "label",
value: "value",
children: "children",
},
},
) {
if (!Array.isArray(data))
return [];
return data.map((item) => {
const label = labelKeys.find(k => item[k] != null);
const value = valueKeys.find(k => item[k] != null);
const childrenKey = childrenKeys.find(k => Array.isArray(item[k]));
const next = { ...item };
if (!(outputKeys.label in next))
next[outputKeys.label] = label ? item[label] : "";
if (!(outputKeys.value in next))
next[outputKeys.value] = value ? item[value] : "";
if (childrenKey) {
next[outputKeys.children] = normalizeTree(item[childrenKey], {
labelKeys,
valueKeys,
childrenKeys,
outputKeys,
});
} else if (!("leaf" in next)) {
next.leaf = false;
}
return next;
});
}
...@@ -430,6 +430,7 @@ export const Util = { ...@@ -430,6 +430,7 @@ export const Util = {
} }
} else { } else {
that[formName].forEach((item, index) => { that[formName].forEach((item, index) => {
if (item.type === "select" && that.baseData[item.optionsName]?.length) { if (item.type === "select" && that.baseData[item.optionsName]?.length) {
that.$set( that.$set(
that[formName][index], that[formName][index],
......
<script>
export default {
name: "EditableText",
inheritAttrs: false,
props: {
value: {
type: [String, Number],
default: undefined,
},
type: {
type: String,
default: "text", // text | number
},
precision: {
type: Number,
default: 2,
},
placeholder: {
type: String,
default: "请输入",
},
debug: {
type: Boolean,
default: false,
},
},
data() {
return {
editing: false,
innerValue: null,
};
},
computed: {
// 缓存判空结果
isEmpty() {
return this.value === "" || this.value === null || this.value === undefined;
},
// 缓存格式化后的数值
formattedValue() {
if (this.type !== "number" || this.isEmpty) {
return this.value;
}
const num = Number(this.value);
return Number.isNaN(num) ? this.value : num.toFixed(this.precision);
},
// 缓存显示值
displayValue() {
return this.isEmpty ? this.placeholder : (this.type === "number" ? this.formattedValue : this.value);
},
// 缓存 class 名称
showingClass() {
const classes = ["el-input_showing"];
if (this.$attrs.disabled)
classes.push("is-disabled");
if (this.isEmpty)
classes.push("has-placeholder");
return classes.join(" ");
},
// 当前编辑的值(编辑时使用 innerValue,否则使用 value)
currentValue() {
return this.editing ? this.innerValue : this.value;
},
},
methods: {
startEdit() {
if (this.$attrs.disabled)
return;
this.editing = true;
this.innerValue = this.value;
this.$nextTick(() => {
this.$refs.input?.focus();
});
},
confirm() {
this.editing = false;
// 只在值真正改变时才触发事件
if (this.innerValue !== this.value) {
this.$emit("input", this.innerValue);
this.$emit("change", this.innerValue);
}
},
cancel() {
this.editing = false;
this.innerValue = this.value;
},
handleInput(val) {
this.innerValue = val;
this.$emit("input", val);
},
handleBlur(e) {
this.confirm();
this.$listeners.blur?.(e);
},
handleKeydown(e) {
if (e.key === "Enter") {
this.confirm();
} else if (e.key === "Escape") {
this.cancel();
}
},
renderInput(h) {
const commonOn = {
...this.$listeners,
input: this.handleInput,
blur: this.handleBlur,
keydown: this.handleKeydown,
};
// number 类型
if (this.type === "number") {
return h("el-input-number", {
ref: "input",
props: {
...this.$attrs,
value: this.currentValue,
precision: this.precision,
},
on: commonOn,
});
}
// text 类型
return h("el-input", {
ref: "input",
props: {
...this.$attrs,
value: this.currentValue,
placeholder: this.placeholder,
},
on: commonOn,
});
},
},
render(h) {
if (this.debug || this.editing) {
return this.renderInput(h);
}
return h(
"div",
{
class: this.showingClass,
on: {
click: this.startEdit,
},
},
this.displayValue,
);
},
};
</script>
<style lang="scss">
.el-input_showing {
background-color: #fff;
border-radius: 4px;
height: 36px;
line-height: 36px;
border: 1px solid #dcdfe6;
font-size: 14px;
display: inline-block;
padding: 0 15px;
color: #606266;
cursor: "text";
vertical-align: middle;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&.is-disabled {
background-color: #f5f7fa;
color: #c0c4cc;
cursor: not-allowed;
}
&.has-placeholder {
color: #c0c4cc;
}
}
.el-form-item.is-error {
.el-input_showing {
border-color: #f56c6c;
}
}
</style>
import { BrowserTracing } from "@sentry/tracing";
// 接入sentry
import * as Sentry from "@sentry/vue";
import { Request } from "glsk-toolkit";
// Vue // Vue
import Vue from "vue" import Vue from "vue";
// import axios from 'axios' // import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
// import i18n from './i18n' import VueLazyload from "vue-lazyload";
import App from "./App"
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 // store
import store from "@/store/index" import store from "@/store/index";
// 针对template模板中使用可选链操作符 // import axios from 'axios'
import chaining from "@/plugin/chaining" // import i18n from './i18n'
import App from "./App";
// 接入sentry
import * as Sentry from "@sentry/vue"
import { BrowserTracing } from "@sentry/tracing"
// import D2Crud from '@d2-projects/d2-crud' // import D2Crud from '@d2-projects/d2-crud'
// 菜单和路由设置 // 菜单和路由设置
import router from "./router" import router from "./router";
import "default-passive-events" import "default-passive-events";
import notice from "@/common/notice" import "element-ui/lib/theme-chalk/index.css";
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"
Vue.prototype.$mapapi = new GLMapSdk() Vue.prototype.$mapapi = new GLMapSdk();
Vue.use(VueLazyload, { Vue.use(VueLazyload, {
// 懒加载默认加载图片 // 懒加载默认加载图片
loading: loading:
"https://img02.glsx.com.cn/weapp/resource/saas/dj/images/img_loading.png", "https://img02.glsx.com.cn/weapp/resource/saas/dj/images/img_loading.png",
attempt: 3 // 尝试加载次数 attempt: 3, // 尝试加载次数
}) });
// 实例化 // 实例化
process.env.NODE_ENV === "production" && process.env.NODE_ENV === "production"
Sentry.init({ && Sentry.init({
Vue, Vue,
dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24", dsn: "https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24",
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4', // dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [ integrations: [
new BrowserTracing({ new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router), routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//] tracingOrigins: ["localhost", "my-site-url.com", /^\//],
}) }),
], ],
// Set tracesSampleRate to 1.0 to capture 100% // Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring. // of transactions for performance monitoring.
...@@ -52,119 +52,119 @@ process.env.NODE_ENV === "production" && ...@@ -52,119 +52,119 @@ process.env.NODE_ENV === "production" &&
logErrors: true, logErrors: true,
// 解决火狐浏览器 无法捕获错误的问题 // 解决火狐浏览器 无法捕获错误的问题
beforeSend(event, hint) { beforeSend(event, hint) {
const isNonErrorException = const isNonErrorException
event.exception.values[0].value.startsWith( = event.exception.values[0].value.startsWith(
"Non-Error exception captured" "Non-Error exception captured",
) ||
hint.originalException.message.startsWith(
"Non-Error exception captured"
) )
|| hint.originalException.message.startsWith(
"Non-Error exception captured",
);
if (isNonErrorException) { if (isNonErrorException) {
// We want to ignore those kind of errors // We want to ignore those kind of errors
return null return null;
}
return event
} }
return event;
},
// "send-default-pii": true // "send-default-pii": true
}) });
// d2Admin 已导入 // d2Admin 已导入
// import ElementUI from 'element-ui' // import ElementUI from 'element-ui'
// Vue.use(ElementUI) // Vue.use(ElementUI)
// 核心插件 // 核心插件
Vue.use(d2Admin) Vue.use(d2Admin);
Vue.use(chaining) Vue.use(chaining);
// Vue.use(GLCombiForm) // 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) // console.log(isProd)
if (!isProd) { if (!isProd) {
Vue.config.devtools = true Vue.config.devtools = true;
} }
Vue.prototype.$EventBus = new Vue() Vue.prototype.$EventBus = new Vue();
Vue.directive("preventReClick", { Vue.directive("preventReClick", {
bind: (el, binding) => { bind: (el, binding) => {
let time = binding.value // 防抖时间 let time = binding.value; // 防抖时间
if (!time) { if (!time) {
// 用户若不设置防抖时间,则默认1s // 用户若不设置防抖时间,则默认1s
time = 1000 time = 1000;
} }
let fun let fun;
el.addEventListener( el.addEventListener(
"click", "click",
(event) => { (event) => {
if (!fun) { if (!fun) {
// 第一次执行 // 第一次执行
fun = setTimeout(() => { fun = setTimeout(() => {
fun = null fun = null;
}, time) }, time);
} else { } else {
// 直接取消当前事件 // 直接取消当前事件
event && event.stopImmediatePropagation() event && event.stopImmediatePropagation();
} }
}, },
true true,
) );
} },
}) });
let baseConfig = config let baseConfig = config;
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取 // 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch( 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( .then(
(response) => { (response) => {
// 处理http响应 // 处理http响应
return response.json() return response.json();
}, },
(error) => { (error) => {
// 处理错误 // 处理错误
console.log(error) console.log(error);
} },
) )
.then((response) => { .then((response) => {
const { code, data } = response const { code, data } = response;
console.log("response", code, response) console.log("response", code, response);
if (code == "200") { if (code == "200") {
console.log(data) console.log(data);
baseConfig = data baseConfig = data;
// console.log("baseConfig", baseConfig) // console.log("baseConfig", baseConfig)
// window.$fetchConfig = data // window.$fetchConfig = data
} else { } else {
baseConfig = response baseConfig = response;
window.$fetchConfig = response window.$fetchConfig = response;
console.log(response) console.log(response);
window.$gscApi = new Request({ window.$gscApi = new Request({
...response.gsc, ...response.gsc,
// baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade', // baseURL:'http://192.168.3.145:9898/gsc-vcp-web-facade',
// baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade', // baseURL: 'http://gsc.test.glsx.com.cn/gsc-vcp-web-facade',
session: { session: {
requiresSession: true, requiresSession: true,
sessionId: (_) => util.cookies.get("token") sessionId: _ => util.cookies.get("token"),
}, },
events: { events: {
error: (error, config) => { error: (error, config) => {
Vue.prototype.$message.error(error.msg) Vue.prototype.$message.error(error.msg);
}, },
logout: (response, config) => { logout: (response, config) => {
store.dispatch("d2admin/user/clear") store.dispatch("d2admin/user/clear");
util.cookies.remove("token") util.cookies.remove("token");
router.replace("/login") router.replace("/login");
Vue.prototype.$message.error("登录超时,请重新登录") Vue.prototype.$message.error("登录超时,请重新登录");
} },
} },
}) });
console.log(window.$gscApi, "========") console.log(window.$gscApi, "========");
} }
}) })
.finally(() => { .finally(() => {
init() init();
}) });
function init() { function init() {
new Vue({ new Vue({
router, router,
...@@ -174,22 +174,22 @@ function init() { ...@@ -174,22 +174,22 @@ function init() {
// baseConfig.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router' // baseConfig.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// data // data
// console.log(data) // console.log(data)
Vue.prototype.baseConfig = baseConfig Vue.prototype.baseConfig = baseConfig;
return h(App) return h(App);
}, },
created() { created() {
// 系统配置 // 系统配置
Vue.config.devtools = true Vue.config.devtools = true;
// 展示系统信息 // 展示系统信息
this.$store.commit("d2admin/releases/versionShow") this.$store.commit("d2admin/releases/versionShow");
// 用户登录后从数据库加载一系列的设置 // 用户登录后从数据库加载一系列的设置
this.$store.dispatch("d2admin/account/load") this.$store.dispatch("d2admin/account/load");
// 获取并记录用户 UA // 获取并记录用户 UA
this.$store.commit("d2admin/ua/get") this.$store.commit("d2admin/ua/get");
// 初始化全屏监听 // 初始化全屏监听
this.$store.dispatch("d2admin/fullscreen/listen") this.$store.dispatch("d2admin/fullscreen/listen");
}, },
mounted() {} mounted() {},
}).$mount("#app") }).$mount("#app");
} }
export { baseConfig } export { baseConfig };
import store from "@/store" import axios from "axios";
import axios from "axios" import { Message } from "element-ui";
import { Message } from "element-ui" import Qs from "qs";
import util from "@/libs/util" import util from "@/libs/util";
import router from "@/router" import { baseConfig } from "@/main";
import { baseConfig } from "@/main" import router from "@/router";
import Qs from "qs" import store from "@/store";
axios.defaults.withCredentials = true
axios.defaults.withCredentials = true;
// const expiresMinute = 60 // 过期时间(分钟) // const expiresMinute = 60 // 过期时间(分钟)
// 创建一个错误 // 创建一个错误
export function errorCreate (msg) { export function errorCreate(msg) {
const error = new Error(msg) const error = new Error(msg);
errorLog(error) errorLog(error);
throw error throw error;
} }
// 记录和显示错误 // 记录和显示错误
function errorLog (error) { function errorLog(error) {
console.log("error", error.toString(), error);
// 添加到日志 // 添加到日志
store.dispatch("d2admin/log/push", { store.dispatch("d2admin/log/push", {
message: "数据请求异常", message: "数据请求异常",
type: "danger", type: "danger",
meta: { meta: {
error error,
} },
}) });
// 打印到控制台 // 打印到控制台
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
util.log.danger(">>>>>> Error >>>>>>") util.log.danger(">>>>>> Error >>>>>>");
console.log(error) console.log(error);
} }
// 显示提示 // 显示提示
Message({ Message({
message: error.message, message: error.message,
type: "error", type: "error",
duration: 5 * 1000 duration: 5 * 1000,
}) });
} }
// 网络请求公用地址 http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS // 网络请求公用地址 http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
// VUE_APP_API=http://192.168.3.191:8944/router // VUE_APP_API=http://192.168.3.191:8944/router
...@@ -43,15 +45,15 @@ const service = axios.create({ ...@@ -43,15 +45,15 @@ const service = axios.create({
timeout: 300000, // 请求超时时间 timeout: 300000, // 请求超时时间
transformRequest: [ transformRequest: [
function (data) { function (data) {
return Qs.stringify(data) return Qs.stringify(data);
} },
] ],
}) });
// 请求拦截器 // 请求拦截器
service.interceptors.request.use( service.interceptors.request.use(
(config) => { (config) => {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
await store.commit("d2admin/loading/set", true) await store.commit("d2admin/loading/set", true);
// const uuid = util.cookies.get('uuid') // const uuid = util.cookies.get('uuid')
// 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作) // 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作)
// if (!LogExternals.some(u => u === url || (params && u === params.method)) && !uuid) { // if (!LogExternals.some(u => u === url || (params && u === params.method)) && !uuid) {
...@@ -72,18 +74,18 @@ service.interceptors.request.use( ...@@ -72,18 +74,18 @@ service.interceptors.request.use(
// console.log(config.data.method) // console.log(config.data.method)
if (process.env.NODE_ENV == "development") { if (process.env.NODE_ENV == "development") {
// 处理图片开发环境没用的问题 // 处理图片开发环境没用的问题
const type = Object.prototype.toString.call(config.data) const type = Object.prototype.toString.call(config.data);
const methodList = [ const methodList = [
"dj.api.common.uploadImg", "dj.api.common.uploadImg",
"dj.api.common.ocr.recognition" "dj.api.common.ocr.recognition",
// "dj.api.smartcarlife.sms.sendSmsCode" // "dj.api.smartcarlife.sms.sendSmsCode"
] ];
if ( if (
type == "[object Object]" && type == "[object Object]"
methodList.includes(config.data.method) && methodList.includes(config.data.method)
) { ) {
config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router" config.url = "http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router";
return resolve(config) return resolve(config);
} }
} }
// if (config.isPoint) { // if (config.isPoint) {
...@@ -94,21 +96,21 @@ service.interceptors.request.use( ...@@ -94,21 +96,21 @@ service.interceptors.request.use(
// config.url = baseConfig.axios.baseURL // config.url = baseConfig.axios.baseURL
// } // }
// console.log(config) // console.log(config)
resolve(config) resolve(config);
}) });
}, },
(error) => { (error) => {
store.commit("d2admin/loading/set", false) store.commit("d2admin/loading/set", false);
// 发送失败 // 发送失败
console.log(error) console.log(error);
Promise.reject(error) Promise.reject(error);
} },
) );
// 响应拦截器 // 响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
// console.log(response) // console.log(response)
store.commit("d2admin/loading/set", false) store.commit("d2admin/loading/set", false);
// dataAxios 是 axios 返回数据中的 data // dataAxios 是 axios 返回数据中的 data
// const dataAxios = { // const dataAxios = {
// code: "20", // code: "20",
...@@ -116,48 +118,49 @@ service.interceptors.response.use( ...@@ -116,48 +118,49 @@ service.interceptors.response.use(
// solution: "将添加会话ID请求参数", // solution: "将添加会话ID请求参数",
// subErrors: null // subErrors: null
// } // }
const dataAxios = response.data const dataAxios = response.data;
const ruleResult = baseConfig.axios.result const ruleResult = baseConfig.axios.result;
const errCodeMsg = baseConfig.errCode const errCodeMsg = baseConfig.errCode;
const errCodes = Object.keys(errCodeMsg) const errCodes = Object.keys(errCodeMsg);
const returnAll = response.config.headers['return-all'] const returnAll = response.config.headers["return-all"];
// console.log("baseConfig", baseConfig) // console.log("baseConfig", baseConfig)
// console.log("response", response) // console.log("response", response)
// console.log("errCodes", errCodes) // console.log("errCodes", errCodes)
// 这个状态码是和后端约定的 // 这个状态码是和后端约定的
// 有 code 代表这是一个后端接口 可以进行进一步的判断 // 有 code 代表这是一个后端接口 可以进行进一步的判断
var goBackArr = ["20", "21"] let goBackArr = ["20", "21"];
// console.log(dataAxios[ruleResult.code_key]) // console.log(dataAxios[ruleResult.code_key])
if (goBackArr.includes(dataAxios[ruleResult.code_key])) { if (goBackArr.includes(dataAxios[ruleResult.code_key])) {
// await store.dispatch('d2admin/account/logout') // await store.dispatch('d2admin/account/logout')
store.dispatch("d2admin/user/clear") store.dispatch("d2admin/user/clear");
util.cookies.remove("token") util.cookies.remove("token");
router.replace("/login") router.replace("/login");
// return Promise.reject(new Error("登录超时,请重新登录")) // return Promise.reject(new Error("登录超时,请重新登录"))
return errorCreate("登录超时,请重新登录") return errorCreate("登录超时,请重新登录");
// return Promise.reject(new Error(response.message || 'Error')) // return Promise.reject(new Error(response.message || 'Error'))
} }
if (returnAll) return dataAxios if (returnAll)
const codeValue = dataAxios[ruleResult.code_key] || dataAxios.returnCode return dataAxios;
const codeValue = dataAxios[ruleResult.code_key] || dataAxios.returnCode;
switch (+codeValue) { switch (+codeValue) {
case ruleResult.code_success_value: case ruleResult.code_success_value:
// [ 示例 ] code === 0 代表没有错误 // [ 示例 ] code === 0 代表没有错误
return dataAxios[ruleResult.data_key] return dataAxios[ruleResult.data_key];
case ruleResult.code_error_value: case ruleResult.code_error_value:
// [ 示例 ] code === -1 代表需将返回的message弹窗展示 // [ 示例 ] code === -1 代表需将返回的message弹窗展示
return errorCreate(`${dataAxios[ruleResult.message_key]}`) return errorCreate(`${dataAxios[ruleResult.message_key]}`);
default: default:
// 不是正确的 code // 不是正确的 code
// console.log(dataAxios) // console.log(dataAxios)
// errorCreate(`${dataAxios[ruleResult.message_key]}`) // errorCreate(`${dataAxios[ruleResult.message_key]}`)
if (errCodes.includes(dataAxios[ruleResult.code_key])) { if (errCodes.includes(dataAxios[ruleResult.code_key])) {
return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`) return errorCreate(`${errCodeMsg[dataAxios[ruleResult.code_key]]}`);
} else { } else {
// 返回约定定义之外的错误码直接取message // 返回约定定义之外的错误码直接取message
return errorCreate(`${dataAxios[ruleResult.message_key]}`) return errorCreate(`${dataAxios[ruleResult.message_key]}`);
} }
break break;
} }
}, },
...@@ -165,52 +168,53 @@ service.interceptors.response.use( ...@@ -165,52 +168,53 @@ service.interceptors.response.use(
if (error && error.response) { if (error && error.response) {
switch (error.response.status) { switch (error.response.status) {
case 400: case 400:
error.message = "请求错误" error.message = "请求错误";
break break;
case 401: case 401:
error.message = "未授权,请登录" error.message = "未授权,请登录";
break break;
case 403: case 403:
error.message = "拒绝访问" error.message = "拒绝访问";
break break;
case 404: case 404:
error.message = `请求地址出错: ${error.response.config.url}` error.message = `请求地址出错: ${error.response.config.url}`;
break break;
case 408: case 408:
error.message = "请求超时" error.message = "请求超时";
break break;
case 500: case 500:
error.message = "服务器内部错误" error.message = "服务器内部错误";
break break;
case 501: case 501:
error.message = "服务未实现" error.message = "服务未实现";
break break;
case 502: case 502:
error.message = "网关错误" error.message = "网关错误";
break break;
case 503: case 503:
error.message = "服务不可用" error.message = "服务不可用";
break break;
case 504: case 504:
error.message = "网关超时" error.message = "网关超时";
break break;
case 505: case 505:
error.message = "HTTP版本不受支持" error.message = "HTTP版本不受支持";
break break;
default: default:
break break;
} }
} }
if (error && error?.stack?.indexOf("timeout") > -1) { if (error && error?.stack?.indexOf("timeout") > -1) {
if (error.stack.indexOf("5000ms")) { if (error.stack.indexOf("5000ms")) {
error.message = "查询超时,请刷新页面重试!" error.message = "查询超时,请刷新页面重试!";
} }
// console.log('超时') // console.log('超时')
// console.log(error) // console.log(error)
} }
store.commit("d2admin/loading/set", false) store.commit("d2admin/loading/set", false);
if (!error.__CANCEL__) errorLog(error) // 取消请求 不做错误提示 if (!error.__CANCEL__)
return Promise.reject(error) errorLog(error); // 取消请求 不做错误提示
} return Promise.reject(error);
) },
export default service );
export default service;
...@@ -783,14 +783,38 @@ export const routerName = { ...@@ -783,14 +783,38 @@ export const routerName = {
path: "/performanceScheme", path: "/performanceScheme",
name: "performanceScheme", name: "performanceScheme",
meta: { meta: {
title: "新增绩效方案", title: "绩效方案",
authId: "912120101", authId: "912120101",
parentId: "91212", parentId: "91212",
sideHidden: true, sideHidden: true,
activePath: "/salaryPerformance" activePath: "/salaryPerformance"
}, },
component: _import("residentManage/salaryPerformance/performanceScheme") component: _import("residentManage/salaryPerformance/performanceScheme/view/index")
}, },
// 912120102: {
// path: "/configureCommissionPlan",
// name: "configureCommissionPlan",
// meta: {
// title: "提成方案配置",
// authId: "912120101",
// parentId: "91212",
// sideHidden: true,
// activePath: "/salaryPerformance"
// },
// component: _import("residentManage/salaryPerformance/configureCommissionPlan/view/index")
// },
// 912120103: {
// path: "/configureStoreCommissionPlan",
// name: "configureStoreCommissionPlan",
// meta: {
// title: "门店提成方案",
// authId: "912120101",
// parentId: "91212",
// sideHidden: true,
// activePath: "/salaryPerformance"
// },
// component: _import("residentManage/salaryPerformance/configureStoreCommissionPlan/view/index")
// },
91213: { 91213: {
path: "/inStorePoints", path: "/inStorePoints",
name: "inStorePoints", name: "inStorePoints",
......
import Vue from "vue" import Vue from "vue";
import Vuex from "vuex" import Vuex from "vuex";
import performanceFormStore from "@/views/residentManage/salaryPerformance/performanceScheme/store/performanceFormStore.js";
import d2admin, { storeResets } from "./modules/d2admin";
import FinancialRules from "./modules/FinancialRules";
import goodsInfoData from "./modules/goodsInfoData";
import d2admin, { storeResets } from "./modules/d2admin"
import goodsInfoData from "./modules/goodsInfoData"
import FinancialRules from "./modules/FinancialRules"
Vue.prototype.$StoreReset = function () { Vue.prototype.$StoreReset = function () {
return new Promise((resolve) => { return new Promise((resolve) => {
storeResets.forEach((reset) => this.dispatch(reset)) storeResets.forEach(reset => this.dispatch(reset));
resolve() resolve();
}) });
} };
Vue.use(Vuex) Vue.use(Vuex);
const isProd = process.env.NODE_ENV === "production" const isProd = process.env.NODE_ENV === "production";
// console.log(isProd) // console.log(isProd)
if (!isProd) { if (!isProd) {
Vue.config.devtools = true Vue.config.devtools = true;
} }
export default new Vuex.Store({ export default new Vuex.Store({
modules: { modules: {
d2admin, d2admin,
goodsInfoData, goodsInfoData,
FinancialRules FinancialRules,
} PerformanceFormStore: performanceFormStore,
}) },
});
...@@ -291,7 +291,7 @@ export default { ...@@ -291,7 +291,7 @@ export default {
} }
}, },
{ {
label: "运营有效引荐数", label: "运营修正有效引荐数",
prop: "reviewedEffectiveCount", prop: "reviewedEffectiveCount",
minWidth: "150", minWidth: "150",
formatter:(cellValue)=>{ formatter:(cellValue)=>{
......
...@@ -260,7 +260,7 @@ export default { ...@@ -260,7 +260,7 @@ export default {
} }
] ]
}, },
businessTypeList: { 0: "权益", 1: "延保", 2: "轻改" }, businessTypeList: { 0: "轻改", 1: "权益", 2: "延保" },
basicVisible: false, basicVisible: false,
deductionVisible: false deductionVisible: false
} }
......
...@@ -147,9 +147,30 @@ export default { ...@@ -147,9 +147,30 @@ export default {
this.$refs.commissionTable.refreshTable(true, true) this.$refs.commissionTable.refreshTable(true, true)
}, },
// 新增提成方案 // 新增提成方案
handleAdd() {}, handleAdd() {
const params = JSON.stringify({
page: 'commissionPlanList'
})
this.$router.push({
name: 'performanceScheme',
query: {
params
}
})
},
//调整参数 //调整参数
handleParameter(data) {} handleParameter(data) {
const params = JSON.stringify({
page: 'commissionPlanList',
id: data.id
})
this.$router.push({
name: 'performanceScheme',
query: {
params
}
})
},
} }
} }
</script> </script>
......
...@@ -237,9 +237,7 @@ export default { ...@@ -237,9 +237,7 @@ export default {
watch: { watch: {
isClose: { isClose: {
handler(val) { handler(val) {
if (val) {
this.picOptions.isClose = val this.picOptions.isClose = val
}
}, },
immediate: true immediate: true
} }
......
...@@ -158,12 +158,14 @@ export default { ...@@ -158,12 +158,14 @@ export default {
}, },
// 编辑方案 // 编辑方案
handleToEdit(row) { handleToEdit(row) {
this.close({ tagName: "/performanceScheme" }) const params = JSON.stringify({
page: 'performanceList',
id: row.id
})
this.$router.push({ this.$router.push({
path: "/performanceScheme", name: "performanceScheme",
query: { query: {
addOrEdit: "edit", params
params: JSON.stringify(row)
} }
}) })
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 'wangzhihui' '1733904062@qq.com' * @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-01-21 11:17:18 * @Date: 2026-01-21 11:17:18
* @LastEditors: 'wangzhihui' '1733904062@qq.com' * @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-01-28 10:40:21 * @LastEditTime: 2026-01-29 15:06:21
* @FilePath: \dj-car-life-system\src\views\residentManage\salaryPerformance\index.vue * @FilePath: \dj-car-life-system\src\views\residentManage\salaryPerformance\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -54,9 +54,10 @@ export default { ...@@ -54,9 +54,10 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.$route.params)
if (this.$route.params.tabPane) { if (this.$route.params.tabPane) {
this.activeName = this.$route.params.tabPane this.activeName = this.$route.params.tabPane
this.tabName = this.$route.params.tabLabel this.tabName = this.$route.params.tabName
} }
}, },
watch: {}, watch: {},
......
import request from "@/api/request";
console.log("request", request);
const path = "dj.staff.api.service.merchant.";
// 分页查询费用类目
export function getStoreWithBrandList(data) {
// data.method = `${path}selectFeeCategoryList`
data.method = `${path}page.with.brand/1.0.0`;
data.url = "http://127.0.0.1:4523/m1/7746299-7491170-default/";
return request(data);
}
<template>
<div>
<el-form-item label="适配业务:" prop="businessType" >
<el-radio-group v-model="businessType">
<el-radio label="0">
轻改
</el-radio>
<el-radio label="1">
延保
</el-radio>
<el-radio label="2">
权益
</el-radio>
</el-radio-group>
</el-form-item>
</div>
</template>
<script>
import { bindFormFields } from "../../store/helper";
export default {
name: "",
props: {
},
data() {
return {
};
},
computed: {
businessType: bindFormFields("businessType"),
},
mounted() {
},
methods: {
},
};
</script>
<style scoped lang="scss">
</style>
<template>
<el-tooltip v-bind="$attrs" popper-class="form-item-help-tooltip">
<span class="el-icon-info" style="font-size: 14px;color:#999999" />
</el-tooltip>
</template>
<script>
export default {
// 可选,避免属性挂到 B 的根节点
inheritAttrs: false,
};
</script>
<style lang="scss">
.form-item-help-tooltip {
width: auto !important;
min-width: 120px;
}
</style>>
<template>
<div class="">
<el-cascader :options="goodsCategory"
placeholder="请选择商品品类"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }"
:show-all-levels="false"
:value="value"
@change="handleProductChange">
</el-cascader>
</div>
</template>
<script>
import { mapState } from "vuex";
export default {
name: "",
props: {
value: {
type: Array,
default: () => [],
},
},
data() {
return {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList", "commissionTypesOptions", "goodsCategory"]),
},
mounted() {
},
methods: {
handleProductChange(value) {
this.$emit("input", value);
this.$emit("change", value);
},
},
};
</script>
<template>
<div class="performance-parameter-config-wrapper">
<div class="table-header-wrapper">
<el-form-item class="template-type-form-item"
label="模板类型:"
prop="templateType">
<el-radio-group v-model="curParamsConfig.templateType">
<el-radio label="ParamsType1">
适配通用配置
</el-radio>
<el-radio label="ParamsType2">
适配渗透率配置
</el-radio>
</el-radio-group>
</el-form-item>
<div class="table-btn-wrapper">
<el-button v-if="curParamsConfig.templateType === 'ParamsType1'"
size="small"
@click="handleAppendTableColProduct">
<i class="el-icon-plus" style="font-size:14px" />
<span>新增商品一列</span>
</el-button>
<el-button size="small"
style="margin-left: 8px;"
@click="handleAppendTableRow">
<i class="el-icon-plus" style="font-size:14px" />
<span>新增一行</span>
</el-button>
</div>
</div>
<div class="table-wrapper">
<component :is="curParamsConfig.templateType" :config-index="configIndex"></component>
</div>
</div>
</template>
<script>
import { last } from "lodash-es";
import { mapState } from "vuex";
import { paramConfigListTemplate } from "../performanceRuleSelection/options.js";
import ParamsType1 from "./type1.vue";
import ParamsType2 from "./type2.vue";
export default {
name: "",
components: {
ParamsType1,
ParamsType2,
},
props: {
configIndex: {
type: Number,
required: true,
},
},
data() {
return {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData"]),
curParamsConfig: {
get() {
return this.formData.paramConfigList[this.configIndex];
},
set(value) {
this.formData.paramConfigList[this.configIndex] = value;
},
},
},
mounted() {
},
methods: {
// 为ParamConfigTyp1 添加列
handleAppendTableColProduct() {
if (this.curParamsConfig.templateType !== "ParamsType1") {
return;
}
if (this.curParamsConfig.ParamsType1Products.length >= 10) {
this.$message.warning("最多添加列商品");
}
this.curParamsConfig.ParamsType1Products.push({
...structuredClone(paramConfigListTemplate.ParamsType1Products[0]),
});
},
// 新增一行
handleAppendTableRow() {
const templateType = this.curParamsConfig.templateType;
const lastPriceRange = last(this.curParamsConfig[templateType])?.priceRange || [0, 0];
const nPriceRange = [undefined, undefined];
if (lastPriceRange && lastPriceRange[1]) {
nPriceRange[0] = lastPriceRange[1] + (this.curParamsConfig.priceRangeProps.precision ? 1 : 0.01);
nPriceRange[1] = undefined;
}
this.curParamsConfig[templateType].push({
...structuredClone(paramConfigListTemplate[templateType][0]),
priceRange: nPriceRange,
});
},
},
};
</script>
<style scoped lang="scss">
.performance-parameter-config-wrapper {
.table-header-wrapper {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 4px;
::v-deep .el-form-item {
margin-bottom: 0 !important;
}
}
}
</style>
<template>
<div class="params-config-table">
<el-table border
class="params-config-table"
:data="curParamsConfig.ParamsType1">
<el-table-column align="center"
:label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`"
width="270px">
<template #default="{ $index }">
<div class="assessment-factor-column">
<EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[0]"
:controls="false"
:disabled="$index === 0"
type="number"
v-bind="curParamsConfig.priceRangeProps">
</EditableText>
<div class="tag">
-
</div>
<EditableText v-model="curParamsConfig.ParamsType1[$index].priceRange[1]"
:controls="false"
type="number"
v-bind="curParamsConfig.priceRangeProps">
</EditableText>
</div>
</template>
</el-table-column>
<el-table-column align="center"
label="提成方式"
min-width="180"
prop="commissionTypes">
<template #default="{ $index }">
<el-select v-model="curParamsConfig.ParamsType1[$index].commissionTypes"
placeholder="请选择"
style="width:120px"
@change="handleCommissionTypesChange($index)">
<el-option v-for="subItem in commissionTypesOptions"
:key="subItem.value"
:label="subItem.label"
:value="subItem.value" />
</el-select>
</template>
</el-table-column>
<el-table-column v-for="(product, index) in curParamsConfig.ParamsType1Products"
:key="index"
align="center"
prop="productLabel"
width="180px">
<template #header="{ $index }">
<div class="product-cascader-wrapper">
<span v-if="showGoodsConfigTypesBtn"
class="el-icon-sort icon"
@click="handleChangeGoodsConfigTypes($index)">
</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-if="goodsCategory === 0"
v-model="curParamsConfig.ParamsType1Products[index].productLabel"
@change="handleProductChange" />
<el-cascader v-else
v-model="curParamsConfig.ParamsType1Products[index].productLabel"
:options="getProductDefineListOptions"
placeholder="请选择圈定商品/套餐"
:show-all-levels="false"
@change="handleProductChange">
</el-cascader>
<el-button style="position: absolute;right:6px;top:50%; transform: translate(0, -50%);padding:0"
title="删除列"
type="text"
@click="handleRemoveProductsCol(index)">
<i class="el-icon-delete" />
</el-button>
</div>
</template>
<template #default="{ $index }">
<EditableText v-model="curParamsConfig.ParamsType1Products[index].productValue[$index]"
:controls="false"
v-bind="curParamsConfig.ParamsType1[$index].commissionTypes && commissionTypeEnum[curParamsConfig.ParamsType1[$index].commissionTypes].componentProps"
type="number">
</EditableText>
</template>
</el-table-column>
<el-table-column align="center"
fixed="right"
label="操作"
width="68px">
<template #default="{ $index }">
<el-button v-if="$index !== 0"
type="text"
@click="handleRemoveTableRow($index)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue";
import GoodsCategoryCascader from "../goodsCategoryCascader/index.vue";
import { commissionTypeEnum } from "../performanceRuleSelection/options";
export default {
name: "",
components: {
EditableText,
GoodsCategoryCascader,
},
props: {
configIndex: {
type: Number,
required: true,
},
},
data() {
return {
commissionTypeEnum,
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList", "commissionTypesOptions"]),
getProductDefineListOptions() {
const res = [];
if (this.formData.goodsConfigTypes.includes("-1")) {
res.push({
label: "商品/套餐",
value: -1,
children: this.productDefineList,
});
}
return res;
},
paramsTables: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType1;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType1 = value;
},
},
goodsCategory: {
get() {
return this.formData.paramConfigList[this.configIndex].goodsCategory;
},
set(value) {
this.formData.paramConfigList[this.configIndex].goodsCategory = value;
},
},
showGoodsConfigTypesBtn() {
return this.formData.goodsConfigTypes.length >= 2 && !this.hasSelectedProduct;
},
hasSelectedProduct() {
console.log("this.curParamsConfig.ParamsType1Products.filter(product => product.productLabel.length > 0);", this.curParamsConfig.ParamsType1Products.find(product => product.productLabel.length > 0));
return this.curParamsConfig.ParamsType1Products.find(product => product.productLabel.length > 0);
},
curParamsConfig: {
get() {
return this.formData.paramConfigList[this.configIndex];
},
set(value) {
this.formData.paramConfigList[this.configIndex] = value;
},
},
},
mounted() {
},
methods: {
handleProductChange(value) {
console.log("product change", value);
},
// 切换商品类型
handleChangeGoodsConfigTypes() {
this.goodsCategory = this.goodsCategory === 0 ? 1 : 0;
},
// 删除商品列
handleRemoveProductsCol(productCol) {
this.curParamsConfig.ParamsType1Products.splice(productCol, 1);
},
// 清空该行所有productValue
handleCommissionTypesChange(row) {
this.curParamsConfig.ParamsType1Products.forEach((product) => {
this.$set(product.productValue, row, undefined);
});
},
// 删除行
handleRemoveTableRow(row) {
this.curParamsConfig.ParamsType1.splice(row, 1);
// 同步删除 ParamsType1Products 里每个 product.productValue 的对应行
if (Array.isArray(this.curParamsConfig.ParamsType1Products)) {
this.curParamsConfig.ParamsType1Products.forEach((product) => {
if (Array.isArray(product.productValue)) {
product.productValue.splice(row, 1);
}
});
}
},
},
};
</script>
<style scoped lang="scss">
.params-config-table {
width: 100%;
margin-bottom: 20px !important;
::v-deep .el-table {
.product-cascader-wrapper {
.icon {
line-height: normal;
height: 14px;
vertical-align: middle;
position: absolute;
left: 6px;
top: 50%;
transform: rotate(90deg);
transform: translate(0, -50%);
padding: 0;
cursor: pointer;
}
}
.el-table__header {
th {
background-color: #f2f4f7;
padding: 4px 0 !important;
.cell {
padding: 0 12px 0 12px;
position: relative;
}
}
}
.el-table__row {
.assessment-factor-column {
display: flex;
align-items: center;
justify-content: center;
.el-input {
min-width: 80px;
}
.el-input-number {
min-width: 80px;
}
.el-input_showing {
min-width: 80px;
}
}
td {
padding-top: 10px !important;
padding-bottom: 10px !important;
}
.tag {
margin: 0 2px;
}
}
.el-input {
width: 120px;
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
.el-input-number {
width: 120px;
height: 32px;
line-height: 32px;
}
.el-input_showing {
width: 120px;
height: 32px;
line-height: 30px;
}
}
}
</style>
<template>
<div class="params-config-table">
<el-table border
class="params-config-table"
:data="curParamsConfig.ParamsType2">
<el-table-column align="center"
:label="`考核因子${curParamsConfig.sort}:${curParamsConfig.title}`"
width="270px">
<template #default="{ $index }">
<div class="assessment-factor-column">
<EditableText v-model="curParamsConfig.ParamsType2[$index].priceRange[0]"
:controls="false"
:disabled="$index === 0"
type="number"
v-bind="curParamsConfig.priceRangeProps">
</EditableText>
<div class="tag">
-
</div>
<EditableText v-model="curParamsConfig.ParamsType2[$index].priceRange[1]"
:controls="false"
type="number"
v-bind="curParamsConfig.priceRangeProps">
</EditableText>
</div>
</template>
</el-table-column>
<el-table-column align="center"
label="商品分类"
width="180">
<template #default="{ $index }">
<div class="product-category-wrapper">
<!-- 品类cascader -->
<GoodsCategoryCascader v-if="goodsCategory === 0"
v-model="curParamsConfig.ParamsType2[$index].productLabel"
@change="handleProductChange" />
<!-- 圈定套餐/商品 cascader -->
<el-cascader v-model="curParamsConfig.ParamsType2[$index].productLabel"
:options="getProductDefineListOptions"
:show-all-levels="false"
@change="handleProductChange">
</el-cascader>
<span v-if="showGoodsConfigTypesBtn"
class="el-icon-sort icon"
style="line-height:normal;height:14px; vertical-align: middle;"
@click="handleChangeGoodsConfigTypes($index)">
</span>
</div>
</template>
</el-table-column>
<el-table-column align="center">
<template #header>
<el-select v-model="curParamsConfig.ParamsType2CommissionTypes"
placeholder="请选择"
style="width:120px"
@change="handleCommissionTypesChange">
<el-option v-for="subItem in commissionTypesOptions"
:key="subItem.value"
:label="subItem.label"
:value="subItem.value" />
</el-select>
</template>
<template #default="{ $index }">
<div class="condition-wrapper">
<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>
</el-table-column>
<el-table-column align="center"
fixed="right"
label="操作"
width="120">
<template #default="{ $index }">
<el-button v-if="curParamsConfig.ParamsType2[$index].condition === 0"
type="text"
@click="curParamsConfig.ParamsType2[$index].condition = 1">
设置条件
</el-button>
<el-button v-else
type="text"
@click="handleCancelConditionSetting($index)">
取消条件
</el-button>
<el-button type="text"
@click="handleRemoveTableRow($index)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue";
import GoodsCategoryCascader from "../goodsCategoryCascader/index.vue";
import { paramConfigConditionType } from "../performanceRuleSelection/options.js";
import { Type0, Type1, Type2, Type3, Type4 } from "./type2components/index.js";
export default {
name: "",
components: {
EditableText,
GoodsCategoryCascader,
Type0,
Type1,
Type2,
Type3,
Type4,
},
props: {
configIndex: {
type: Number,
required: true,
},
},
data() {
return {
paramConfigConditionType,
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList", "commissionTypesOptions", "goodsCategory"]),
curParamsConfig() {
return this.formData.paramConfigList[this.configIndex];
},
showGoodsConfigTypesBtn() {
return this.formData.goodsConfigTypes.length >= 2 && !this.hasSelectedProduct;
},
hasSelectedProduct() {
console.log("this.curParamsConfig.ParamsType1Products.filter(product => product.productLabel.length > 0);", this.curParamsConfig.ParamsType1Products.find(product => product.productLabel.length > 0));
return this.curParamsConfig.ParamsType2.find(product => product.productLabel.length > 0);
},
getProductDefineListOptions() {
return this.productDefineList;
},
},
mounted() {
},
methods: {
handleChangeGoodsConfigTypes() {
this.goodsCategory = this.goodsCategory === 0 ? 1 : 0;
},
// 提成方式改变
handleCommissionTypesChange() {},
// 删除行
handleRemoveTableRow(row) {
this.curParamsConfig.ParamsType2.splice(row, 1);
},
// 取消设置条件
handleCancelConditionSetting(row) {
this.curParamsConfig.ParamsType2[row].condition = 0;
},
// 条件变化
handleChangeCondition(row) {
const curCondition = this.curParamsConfig.ParamsType2[row].condition;
if (curCondition >= 4) {
this.curParamsConfig.ParamsType2[row].condition = 1;
return;
}
this.curParamsConfig.ParamsType2[row].condition += 1;
},
handleProductChange(value) {
console.log("product change", value);
},
},
};
</script>
<style scoped lang="scss">
.params-config-table {
width: 100%;
margin-bottom: 20px !important;
.condition-wrapper {
display: flex;
width: 100%;
bottom: 1px solid red;
align-items: center;
justify-content: flex-start;
}
.product-category-wrapper {
display: flex;
align-items: center;
justify-content: center;
> .icon {
margin-left: 6px;
cursor: pointer;
transition: color 200ms;
transform: rotate(90deg);
&:hover {
color: #2a58ad;
}
}
}
::v-deep .el-table {
.el-table__header {
th {
background-color: #f2f4f7;
padding: 4px 0 !important;
.cell {
padding: 0 12px 0 12px;
position: relative;
}
}
}
.el-table__row {
.assessment-factor-column {
display: flex;
align-items: center;
justify-content: center;
.el-input {
min-width: 80px;
}
.el-input-number {
min-width: 80px;
}
.el-input_showing {
min-width: 80px;
}
}
td {
padding-top: 10px !important;
padding-bottom: 10px !important;
}
.tag {
margin: 0 2px;
}
}
.el-input {
width: 120px;
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
.el-input-number {
width: 120px;
height: 32px;
line-height: 32px;
}
.el-input_showing {
width: 120px;
height: 32px;
line-height: 30px;
}
}
}
</style>
export { default as Type0 } from "./type0.vue";
export { default as Type1 } from "./type1.vue";
export { default as Type2 } from "./type2.vue";
export { default as Type3 } from "./type3.vue";
export { default as Type4 } from "./type4.vue";
<template>
<div class="param-config-type-2-condition-type">
<EditableText v-model="conditionTypeValue"
:controls="false"
type="number"
v-bind="getComponentsProp">
</EditableText>
</div>
</template>
<script>
import { mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue";
import { commissionTypeEnum } from "../../performanceRuleSelection/options";
export default {
name: "",
components: {
EditableText,
},
props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
},
data() {
return {
};
},
// v-bind="curParamsConfig.ParamsType1[$index].commissionTypes && commissionTypeEnum[curParamsConfig.ParamsType1[$index].commissionTypes].componentProps"
computed: {
...mapState("PerformanceFormStore", ["formData"]),
paramsType2CommissionTypes() {
return this.formData.paramConfigList[this.configIndex].ParamsType2CommissionTypes;
},
getComponentsProp() {
return this.paramsType2CommissionTypes ? commissionTypeEnum[this.paramsType2CommissionTypes].componentProps : {};
},
conditionTypeValue: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType0;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType0 = value;
},
},
},
mounted() {
console.log("当前组件所有 inject 内容:", this.$parent); // Vue2 内部属性,存储注入的内容
},
methods: {
},
};
</script>
<style scoped lang="scss">
.param-config-type-2-condition-type {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
</style>
<template>
<span class="param-config-type-2-condition-type">
<div>
<EditableText v-model="triggerCondition"
:controls="false"
type="number"
v-bind="getComponentsProp">
</EditableText>
</div>
<div style="margin:0 6px">
且
</div>
<div>
<div style="display:flex;align-items:center;">
<span class="label">
1.
</span>
<el-cascader v-model="productValue"
:options="getProductDefineListOptions"
:show-all-levels="false"
@change="handleProductChange">
</el-cascader>
<span class="label">
渗透率在
</span>
<EditableText v-model="permeabilityMin"
:controls="false"
:max="100"
:min="0"
:precision="2"
type="number">
</EditableText>
<span class="label">
~
</span>
<EditableText v-model="permeabilityMax"
:controls="false"
:max="100"
:min="0"
:precision="2"
type="number">
</EditableText>
<span class="label">
区间时执行
</span>
</div>
<div style="display:flex;align-items:center;">
<span>2. </span>
<el-cascader v-model="productValue1"
:options="getProductDefineListOptions"
:show-all-levels="false"
@change="handleProductChange">
</el-cascader>
<span class="label">
渗透率在
</span>
<EditableText v-model="permeabilityMin1"
:controls="false"
:max="100"
:min="0"
:precision="2"
type="number">
</EditableText>
<span class="label">
~
</span>
<EditableText v-model="permeabilityMax1"
:controls="false"
:max="100"
:min="0"
:precision="2"
type="number">
</EditableText>
<span class="label">
区间时执行
</span>
</div>
</div>
</span>
</template>
<script>
import { mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue";
import { commissionTypeEnum } from "../../performanceRuleSelection/options";
export default {
name: "",
components: {
EditableText,
},
props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
},
data() {
return {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList"]),
// 商品选择项
getProductDefineListOptions() {
return this.productDefineList;
},
// 路径太长 简化
paramsType2CommissionTypes() {
return this.formData.paramConfigList[this.configIndex].ParamsType2CommissionTypes;
},
// 提成方式 的值 决定 的 组件传参
getComponentsProp() {
return this.paramsType2CommissionTypes ? commissionTypeEnum[this.paramsType2CommissionTypes].componentProps : {};
},
triggerCondition: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.triggerCondition;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.triggerCondition = value;
},
},
productLabel: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productLabel;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productLabel = value;
},
},
productValue: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productValue;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productValue = value;
},
},
permeabilityMin: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMin;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMin = value;
},
},
permeabilityMax: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMax;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMax = value;
},
},
productValue1: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productValue1;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.productValue1 = value;
},
},
permeabilityMin1: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMin1;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMin1 = value;
},
},
permeabilityMax1: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMax1;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType1.permeabilityMax1 = value;
},
},
},
mounted() {
},
methods: {
// TODO: 商品切换
handleProductChange() {
},
},
};
</script>
<style scoped lang="scss">
.param-config-type-2-condition-type {
// overflow-x: auto;
display: flex;
// flex-wrap: nowrap;
align-items: center;
> span.label {
color: #666666;
font-size: 14px;
font-weight: 400;
line-height: 18px;
margin: 0 6px;
// white-space: nowrap;
}
}
</style>
<template>
<div class="param-config-type-2-condition-type">
<EditableText v-model="triggerCondition"
:controls="false"
type="number"
v-bind="getComponentsProp">
</EditableText>
<span class="label">且按不足</span>
<EditableText v-model="deductRate"
:controls="false"
:max="100"
:min="0"
:precision="2"
type="number">
</EditableText>
<span class="label">订单数每单扣减</span>
<EditableText v-model="perOrderDeductAmount"
:controls="false"
:max="999999"
:min="0"
:precision="2"
type="number">
</EditableText>
<span class="label">元.区间时执行</span>
</div>
</template>
<script>
import { mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue";
import { commissionTypeEnum } from "../../performanceRuleSelection/options";
export default {
name: "",
components: {
EditableText,
},
props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
},
data() {
return {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData"]),
// 路径太长 简化
paramsType2CommissionTypes() {
return this.formData.paramConfigList[this.configIndex].ParamsType2CommissionTypes;
},
// 提成方式 的值 决定 的 组件传参
getComponentsProp() {
return this.paramsType2CommissionTypes ? commissionTypeEnum[this.paramsType2CommissionTypes].componentProps : {};
},
triggerCondition: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.triggerCondition;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.triggerCondition = value;
},
},
deductRate: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.deductRate;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.deductRate = value;
},
},
perOrderDeductAmount: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.perOrderDeductAmount;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType2.perOrderDeductAmount = value;
},
},
},
mounted() {
},
methods: {
},
};
</script>
<style scoped lang="scss">
.param-config-type-2-condition-type {
> span.label {
color: #666666;
font-size: 14px;
font-weight: 400;
line-height: 18px;
margin: 0 6px;
}
}
</style>
<template>
<span class="param-config-type-2-condition-type">
<EditableText v-model="triggerCondition"
:controls="false"
type="number"
v-bind="getComponentsProp">
</EditableText>
<span class="label">
且
</span>
<span class="label">
整体增加指标达成奖励
</span>
<EditableText v-model="increaseReward"
:controls="false"
:max="999999"
:min="0"
:precision="2"
type="number">
</EditableText>
<span class="label">
元
</span>
</span>
</template>
<script>
import { mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue";
import { commissionTypeEnum } from "../../performanceRuleSelection/options";
export default {
name: "",
components: {
EditableText,
},
props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
},
data() {
return {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList"]),
// 商品选择项
getProductDefineListOptions() {
return this.productDefineList;
},
// 路径太长 简化
paramsType2CommissionTypes() {
return this.formData.paramConfigList[this.configIndex].ParamsType2CommissionTypes;
},
// 提成方式 的值 决定 的 组件传参
getComponentsProp() {
return this.paramsType2CommissionTypes ? commissionTypeEnum[this.paramsType2CommissionTypes].componentProps : {};
},
triggerCondition: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.triggerCondition;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.triggerCondition = value;
},
},
productLabel: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productLabel;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productLabel = value;
},
},
productValue: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productValue;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productValue = value;
},
},
increaseReward: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.increaseReward;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.increaseReward = value;
},
},
},
mounted() {
},
methods: {
// TODO: 商品切换
handleProductChange() {
},
},
};
</script>
<style scoped lang="scss">
.param-config-type-2-condition-type {
// overflow-x: auto;
// display: flex;
// flex-wrap: nowrap;
// align-items: center;
> span.label {
color: #666666;
font-size: 14px;
font-weight: 400;
line-height: 18px;
margin: 0 6px;
// white-space: nowrap;
}
}
</style>
<template>
<span class="param-config-type-2-condition-type">
<EditableText v-model="triggerCondition"
:controls="false"
type="number"
v-bind="getComponentsProp">
</EditableText>
<span class="label">
且
</span>
<span class="label">
提出
</span>
<el-cascader v-model="productValue"
:options="getProductDefineListOptions"
:show-all-levels="false"
@change="handleProductChange">
</el-cascader>
<span class="label">
的订单计算提出
</span>
</span>
</template>
<script>
import { mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue";
import { commissionTypeEnum } from "../../performanceRuleSelection/options";
export default {
name: "",
components: {
EditableText,
},
props: {
configIndex: {
type: Number,
required: true,
},
row: {
type: Number,
required: true,
},
},
data() {
return {
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList"]),
// 商品选择项
getProductDefineListOptions() {
return this.productDefineList;
},
// 路径太长 简化
paramsType2CommissionTypes() {
return this.formData.paramConfigList[this.configIndex].ParamsType2CommissionTypes;
},
// 提成方式 的值 决定 的 组件传参
getComponentsProp() {
return this.paramsType2CommissionTypes ? commissionTypeEnum[this.paramsType2CommissionTypes].componentProps : {};
},
triggerCondition: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.triggerCondition;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.triggerCondition = value;
},
},
productValue: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue = value;
},
},
productValue1: {
get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue1;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue1 = value;
},
},
},
mounted() {
},
methods: {
// TODO: 商品切换
handleProductChange() {
},
},
};
</script>
<style scoped lang="scss">
.param-config-type-2-condition-type {
// overflow-x: auto;
// display: flex;
// flex-wrap: nowrap;
// align-items: center;
> span.label {
color: #666666;
font-size: 14px;
font-weight: 400;
line-height: 18px;
margin: 0 6px;
// white-space: nowrap;
}
}
</style>
<template>
<div>
<el-form-item label="考核因子:" prop="assessmentFactorValue">
<el-checkbox-group v-model="assessmentFactorValue" @change="handleAssessmentFactorChange">
<div v-for="(item, index) in assessmentFactorOptions"
:key="index"
class="check-box-wrapper">
<el-checkbox :label="item.value">
{{ item.label }}
</el-checkbox>
<FormItemHelp v-if="item.showHelp"
:content="item.tips"
style="margin-left: 6px;" />
</div>
</el-checkbox-group>
</el-form-item>
<el-form-item label="提成基数:" prop="commissionBases">
<el-checkbox-group v-model="commissionBases" @change="handleCommissionBasesChange">
<div class="check-box-wrapper">
<el-checkbox label="GMV">
GMV产值
</el-checkbox>
<FormItemHelp content="业务产值" style="margin-left: 6px;" />
</div>
<div class="check-box-wrapper">
<el-checkbox label="DDTC">
单店总提成
</el-checkbox>
<FormItemHelp content="单店员工提成总和" style="margin-left: 6px;" />
</div>
<div class="check-box-wrapper">
<el-checkbox label="SJDDS">
升级订单数
</el-checkbox>
<FormItemHelp content="成交数" style="margin-left: 6px;" />
</div>
</el-checkbox-group>
</el-form-item>
<el-form-item label="提成方式:" prop="commissionTypes">
<el-checkbox-group v-model="commissionTypes" @change="handleCommissionTypesChange">
<el-checkbox label="BL">
比例
</el-checkbox>
<el-checkbox label="XS">
系数
</el-checkbox>
<el-checkbox label="GDJE">
固定金额
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="商品分类:"
prop="goodsConfigTypes">
<el-checkbox-group v-model="goodsConfigTypes"
class="checkbox-group-product-category ">
<el-checkbox label="0">
品类
</el-checkbox>
<el-checkbox label="1">
<el-button size="small" @click="handleGoodsConfigTypesChange">
圈定商品/套餐
</el-button>
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<DefineProductsDialog v-if="dialog.defineProducts.visible"
:define-visible="dialog.defineProducts.visible"
@dialogClose="handleDefineProductsDialogClose" />
</div>
</template>
<script>
import { mapMutations, mapState } from "vuex";
import DefineProductsDialog from "@/views/residentManage/salaryPerformance/components/defineProductsDialog.vue";
import { bindFormFields } from "../../store/helper";
import FormItemHelp from "../formItemHelp/index.vue";
import { assessmentFactorOptions } from "./options";
export default {
name: "PerformanceRuleSelection",
components: {
FormItemHelp,
DefineProductsDialog,
},
props: {
},
data() {
return {
dialog: {
defineProducts: {
visible: false,
},
},
rules: {},
assessmentFactorOptions,
isUpdating: false, // 防止循环更新
// 提成基数和提成方式的对应关系:基数 <-> 方式
commissionMapping: {
GMV: "BL", // GMV产值 <-> 比例
DDTC: "XS", // 单店总提成 <-> 系数
DDSL: "GDJE", // 升级订单数 <-> 固定金额
},
};
},
computed: {
// 临时给组件用,会转换成OptionsItem 存储到 fromData里
...mapState("PerformanceFormStore", ["formData"]),
assessmentFactorValue: bindFormFields("assessmentFactorValue"),
assessmentFactor: bindFormFields("assessmentFactor"),
checkList: bindFormFields("checkList"),
commissionBases: bindFormFields("commissionBases"),
commissionTypes: bindFormFields("commissionTypes"),
goodsConfigTypes: bindFormFields("goodsConfigTypes"),
paramConfigList: bindFormFields("paramConfigList"),
},
watch: {
commissionTypes(newVal) {
// TODO: 还需要清空下方表格所有提成方式的值
// this.setCommissionTypesOptions(newVal);
},
},
mounted() {
},
methods: {
...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) {
this.dialog.defineProducts.visible = true;
},
handleDefineProductsDialogClose(productDefineList) {
this.setProductDefineList(productDefineList);
this.dialog.defineProducts.visible = false;
},
handleCommissionBasesChange(e) {
if (this.isUpdating)
return;
this.isUpdating = true;
const newTypes = this.updateLinkedCheckboxes(e, this.commissionTypes, true);
this.setCommissionTypes(newTypes);
this.$nextTick(() => {
this.isUpdating = false;
});
},
handleCommissionTypesChange(e) {
if (this.isUpdating)
return;
this.isUpdating = true;
const newBases = this.updateLinkedCheckboxes(e, this.commissionBases, false);
this.setCommissionBases(newBases);
this.$nextTick(() => {
this.isUpdating = false;
});
},
handleAssessmentFactorChange(value) {
// 根据 value 数组从 assessmentFactorOptions 中找出对应的完整项
const selectedItems = this.assessmentFactorOptions.filter(item => value.includes(item.value));
this.touchAssessment(selectedItems);
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-form-item {
margin-bottom: 4px;
}
::v-deep .el-checkbox-group {
display: flex;
align-items: center;
flex-wrap: wrap;
margin-bottom: -4px;
&.checkbox-group-product-category {
display: flex;
}
.check-box-wrapper {
display: flex;
align-items: center;
margin-right: 34px;
margin-bottom: 4px;
&:last-child {
margin-right: 0;
}
}
.el-checkbox {
&.is-bordered {
display: flex;
width: fit-content;
align-items: center;
}
.el-checkbox__label {
padding-left: 7px;
}
}
}
</style>
export const assessmentFactorOptions = [
{
label: "个人月度总值",
value: 1,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "考核业务总产值",
showHelp: true,
sort: 1,
},
{
label: "个人月度单店产值",
value: 2,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "考核单店业务产值",
showHelp: true,
sort: 2,
},
{
label: "个人客户渗透率",
value: 3,
componentProps: {
max: 100,
min: 0,
precision: 2,
placeholder: "请输入",
},
tips: "主订单成交数/个人应触客数",
showHelp: true,
sort: 3,
},
{
label: "个人单品渗透率",
value: 4,
componentProps: {
max: 100,
min: 0,
precision: 2,
placeholder: "请输入",
},
tips: "子订单成交数/个人应触客数",
showHelp: true,
sort: 4,
},
{
label: "高客单价",
value: 5,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "品类订单高产值",
showHelp: true,
sort: 5,
},
{
label: "总触客客单价(适用园区店)",
value: 6,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "所有门店产值/所有门店个人实际售前触客数",
showHelp: true,
sort: 6,
},
{
label: "触客客单价",
value: 7,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "单店产值/个人实际售前触客数",
showHelp: true,
sort: 7,
},
{
label: "升级客单价",
value: 8,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "单店总产值/主订单成交数",
showHelp: true,
sort: 8,
},
{
label: "交车客单价",
value: 9,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "单店总产值/个人应触客数",
showHelp: true,
sort: 9,
},
{
label: "门店触客率(交车)",
value: 10,
componentProps: {
max: 100,
min: 0,
precision: 2,
placeholder: "请输入",
},
tips: "门店实际触客台次/交车数",
showHelp: true,
sort: 10,
},
{
label: "门店触客率(有效引荐)",
value: 11,
componentProps: {
max: 100,
min: 0,
precision: 2,
placeholder: "请输入",
},
tips: "门店实际触客台次/有效引荐数",
showHelp: true,
sort: 11,
},
{
label: "升级订单数",
value: 12,
componentProps: {
max: 9999999,
min: 0,
placeholder: "请输入",
},
tips: "主订单成交数",
showHelp: true,
sort: 12,
},
];
export const paramConfigConditionType = {
0: {
component: "Type0",
},
1: {
component: "Type1",
},
2: {
component: "Type2",
},
3: {
component: "Type3",
},
4: {
component: "Type4",
},
};
// 模板对象 一个table 对应一个paramConfigListTemplate数据
// 也对应 type1.vue 与 type2.vue 中的 curParamsConfig
export const paramConfigListTemplate = {
title: "",
// 对应下面两个大数组
templateType: "ParamsType1",
// sort:在添加的时候输入
// priceRangeProps 在新增时动态插入
// 只有paramsType1 需要. 这里不是paramsType1Table的行数据
// 每一个item 代表 一列
// productValue里的顺序按照 row拍
// 表格中的商品类型 品类 / 圈定套餐.
// 两个虽然数据格式都是树形,但是操作逻辑不通,所以只能用两个组件分别渲染
// 这个值决定了用哪个组件
goodsCategory: 0,
ParamsType1Products: [
{
productLabel: [],
productValue: [undefined],
optionList: [],
},
],
// 下面两个数据都是放到table中, 一个item对应一行所需的数据
ParamsType1: [
{
priceRange: [0, undefined],
commissionTypes: undefined,
},
],
// 只有paramsType2 需要. 这里不是paramsType1Table的行数据
ParamsType2CommissionTypes: undefined,
ParamsType2: [
{
// 仅有一个输入框
conditionType0: undefined,
conditionType1: {
// 触发条件
triggerCondition: undefined,
// 商品占位
productLabel: undefined,
// 商品值
productValue: undefined,
// 渗透率上下限
permeabilityMin: undefined,
permeabilityMax: undefined,
productLabel1: undefined,
// 商品值
productValue1: undefined,
// 渗透率上下限
permeabilityMin1: undefined,
permeabilityMax1: undefined,
},
conditionType2: {
// 触发条件
triggerCondition: undefined,
// 渗透率上下限
// 扣减比例
deductRate: undefined,
// 每单扣减金额
perOrderDeductAmount: undefined,
},
conditionType3: {
// 触发条件
triggerCondition: undefined,
// 商品值
productValue: undefined,
// 奖励值
increaseReward: undefined,
},
conditionType4: {
// 触发条件
triggerCondition: undefined,
// 商品值
productValue: undefined,
},
// 渗透率的条件
condition: 0,
priceRange: [0, undefined],
commissionTypes: undefined,
productLabel: [],
productValue: [undefined],
optionList: [],
},
],
};
// 模板对象
export const commissionTypeEnum = {
BL: {
label: "提成比例%",
value: "BL",
componentProps: {
max: 100,
min: 0,
precision: 2,
placeholder: "请输入提成比例",
},
},
XS: {
label: "系数",
value: "XS",
componentProps: {
max: 10,
min: 0,
precision: 2,
placeholder: "请输入系数",
},
},
GDJE: {
label: "固定金额",
value: "GDJE",
componentProps: {
max: 999999,
min: 0,
precision: 2,
placeholder: "请输入固定金额",
},
},
};
<template>
<div class="selection-table-store-wrapper">
<el-form-item label="分配门店账号:" prop="name">
<el-button size="small" @click="changeStoreApplyVisible">
<i class="el-icon-plus" style="font-size:14px" />
<span>选择门店</span>
</el-button>
</el-form-item>
<!-- <el-form-item label="生效月份:" prop="effectiveTime">
<el-date-picker v-model="formData.effectiveTime"
placeholder="选择日期"
type="month">
</el-date-picker>
</el-form-item> -->
<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 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">
<StoreSelect ref="storeSelect" />
<template #footer>
<span class="dialog-footer">
<el-button @click="handleCloseDialog">取消</el-button>
<el-button type="primary" @click="handleDialogConfirm">确定</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import { mapGetters, mapMutations, mapState } from "vuex";
import { deepClone } from "@/common/util";
import StoreSelect from "../storeSelect/index.vue";
export default {
name: "StoreApply",
components: {
StoreSelect,
},
data() {
return {
rules: {},
dialog: {
storeApply: {
title: "应用到门店及品牌",
width: "1092px",
visible: false,
},
},
selectedMerchantsList: [],
tableParams: {
listName: "list",
tableOption: true,
tableColumns: [
{
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(";") || "-";
},
},
],
},
};
},
computed: {
...mapGetters("PerformanceFormStore", ["getMerchantBrandRefList"]),
},
async mounted() {
this.selectedMerchantsList = this.getMerchantBrandRefList || [];
console.log(this.selectedMerchantsList, "0000");
},
methods: {
...mapMutations("PerformanceFormStore", ["setMerchantBrandRefList"]),
changeStoreApplyVisible() {
this.dialog.storeApply.visible = !this.dialog.storeApply.visible;
},
handleCloseDialog() {
this.changeStoreApplyVisible();
},
handleDeleteMer(row, idx) {
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();
},
},
};
</script>
<style scoped lang="scss">
::v-deep .store-select-dialog {
.el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
.el-dialog__title {
color: #1d1d1d;
font-size: 16px;
font-weight: 500;
line-height: 20px;
}
.el-dialog__body {
padding-top: 20px;
padding-bottom: 20px;
.el-table {
&::before {
width: 0;
height: 0;
}
}
}
.el-dialog__footer {
border-top: 1px solid #e5e5e5;
padding-bottom: 10px;
.el-button {
width: auto;
}
}
}
</style>
import { get, isFunction } from "lodash-es";
import store from "@/store";
// paramKey 支持长字符串 'a.b[1].c'
export function bindFormFields(getPath) {
return {
get() {
return get(store.state.PerformanceFormStore.formData, isFunction(getPath) ? getPath().call(this) : getPath);
},
set(value) {
store.commit(
"PerformanceFormStore/updateFormField",
{ key: isFunction(getPath) ? getPath.call(this) : getPath, value },
);
},
};
}
import { groupBy } from "lodash";
import { assessmentFactorOptions } from "../components/performanceRuleSelection/options";
export function convertBackendToData(data) {
const { merchantBrandRefList, paramConfigList, performanceConfigRule, ...lists } = data;
const response = {
...lists,
merchantBrandRefList: dealInterfaceBrand(merchantBrandRefList),
paramConfigList: coverParamConfigList(paramConfigList),
};
return response;
}
const templateType = {
1: "ParamsType1",
2: "ParamsType2",
};
const tableEnum = {
title: "",
templateType: "ParamsType1",
goodsCategory: 0,
ParamsType1Products: [
// { productLabel: [], productValue: [], optionList: [] },
],
ParamsType1: [],
ParamsType2: [],
priceRangeProps: [],
assessmentFactor: {},
sort: -1,
};
function getAssessmentFactorOptionsTitle(assessmentFactorValue) {
const item = assessmentFactorOptions.find(item => item.value === assessmentFactorValue);
return item;
}
// 转换 表格数据
export function coverParamConfigList(paramConfigList) {
// 通过assessmentFactor 区分表格数量
// 通过 rowId = String(startValue) + Staring(endValue) 区分行
const tableList = groupBy(paramConfigList, "assessmentFactor");
const _paramConfigList = [];
console.log("tableList", tableList);
if (tableList && Object.keys(tableList).length) {
for (let tableIndex in tableList) {
console.log("table");
const tableItem = tableList[tableIndex][0];
const table = tableList[tableIndex];
// 因为每一个table的数据是一样的,所以直接取0位
const baseTable = structuredClone(tableEnum);
baseTable.title = getAssessmentFactorOptionsTitle(tableItem.assessmentFactor)?.label; // 找enum
baseTable.templateType = templateType[tableList[tableIndex][0].templateType];
baseTable.goodsCategory = tableList[tableIndex][0].goodsConfigType;
console.log("baseTable", baseTable);
const rowTable = groupBy(tableList[tableIndex], item => String(item.startValue) + String(item.endValue));
const colTable = groupBy(table, item => String(item.goodsType) + String(item.secondaryGoodsType) + String(item.thirdLevelGoodsType));
Object.keys(colTable).forEach((colIndex, colEachIndex) => {
const colItem = colTable[colIndex][colEachIndex];
const paramsTypeProductsItem = {
productLabel: [colItem.goodsType],
productValue: [],
optionList: [],
};
colItem.secondaryGoodsType && paramsTypeProductsItem.productLabel.push(colItem.secondaryGoodsType);
colItem.thirdLevelGoodsType && paramsTypeProductsItem.productLabel.push(colItem.thirdLevelGoodsType);
Object.keys(rowTable).forEach((rowIndex, rowEachIndex) => {
const rowItem = rowTable[rowIndex][rowEachIndex];
paramsTypeProductsItem.productValue.push(rowItem.commissionTypeValue);
});
baseTable.ParamsType1Products.push(paramsTypeProductsItem);
// if (!baseTable.ParamsType1Products[colEachIndex]) {
// baseTable.ParamsType1Products[colEachIndex] = {
// productLabel: [colItem.goodsType, colItem.secondaryGoodsType, colItem.thirdLevelGoodsType],
// productValue: [colItem.commissionTypeValue],
// optionList: [],
// };
// } else {
// baseTable.ParamsType1Products[colEachIndex].productValue.push(colItem.commissionTypeValue);
// }
});
Object.keys(rowTable).forEach((rowIndex, rowEachIndex) => {
console.log("hang", rowTable[rowIndex]);
const rowItem = rowTable[rowIndex][0];
if (baseTable.templateType === "ParamsType1") {
console.log(333, rowItem.startValue, rowItem.endValue);
baseTable.ParamsType1.push({
priceRange: [rowItem.startValue, rowItem.endValue],
commissionTypes: rowItem.commissionType,
});
}
// const colTable = groupBy(rowTable[rowIndex], item => String(item.goodsType) + String(item.secondaryGoodsType) + String(item.thirdLevelGoodsType));
// for (let productColIndex in colTable) {
// const colItem = colTable[productColIndex][0];
// if (!baseTable.ParamsType1Products[rowEachIndex]) {
// baseTable.ParamsType1Products[rowEachIndex] = {
// productLabel: [colItem.goodsType, colItem.secondaryGoodsType, colItem.thirdLevelGoodsType],
// productValue: [colItem.commissionTypeValue],
// optionList: [],
// };
// } else {
// baseTable.ParamsType1Products[rowEachIndex].productValue.push(colItem.commissionTypeValue);
// }
// }
});
_paramConfigList.push(baseTable);
// handleParamsType1Product(tableList[tableIndex]);
}
}
return _paramConfigList;
}
// 转换 门店数据
function dealInterfaceBrand(brandList) {
const map = new Map();
(brandList || []).forEach((item) => {
const key = item.merchantId;
if (!map.has(key)) {
map.set(key, {
merchantId: item.merchantId,
merchantName: item.merchantName,
checkBrands: [],
});
}
const group = map.get(key);
group.checkBrands.push({
brandId: item.brandId,
brandName: item.brandName,
childId: item.childId,
childName: item.childName,
});
});
return Array.from(map.values());
}
import { last } from "lodash-es";
import store from "@/store";
const commissionTypesCoverCommissionBase = {
BL: "GMV",
XS: "DDTC",
GDJE: "SJDDS",
};
export function convertDataToBackend(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, ParamsType2 } = paramConfig;
if (templateType === "ParamsType1") {
// 处理ParamsType1 类型的表格
coverParamsType1(ParamsType1, ParamsType1Products, (item, { rowItem, row }, { productColItem, colIndex }) => {
requestData.paramConfigList.push({
...item,
assessmentFactor: paramConfig.assessmentFactor.value,
goodsConfigType: paramConfig.goodsCategory,
commissionTypeValue: productColItem.productValue[row],
...paramConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, paramConfig.ParamsType1Products[colIndex].productLabel)
: buildProductDefinePayload(productDefineList, paramConfig.ParamsType1Products[colIndex].productLabel),
});
});
}
if (templateType === "ParamsType2") {
coverParamsType2(ParamsType2, (result, { paramsType2Item, paramsType2Index }) => {
requestData.paramConfigList.push({
...result,
commissionType: paramConfig.ParamsType2CommissionTypes,
commissionBase: commissionTypesCoverCommissionBase[paramConfig.ParamsType2CommissionTypes],
assessmentFactor: paramConfig.assessmentFactor.value,
goodsConfigType: paramConfig.goodsCategory,
...paramConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, paramsType2Item.productLabel)
: buildProductDefinePayload(productDefineList, paramsType2Item.productLabel),
performanceParamConfigConditions: getPerformanceParamConfigConditions(paramsType2Item, paramConfig),
});
});
}
}
// 整理门店
// requestData.merchantBrandRefList = buildMerchantBrandPayload(merchantBrandRefList, data.businessType);
return requestData;
}
// 通过paramsConfig 获取 configCondition的列表
function getPerformanceParamConfigConditions(paramsType2Item, paramsConfig) {
const goodsCategory = store.state.PerformanceFormStore.goodsCategory;
const productDefineList = store.state.PerformanceFormStore.productDefineList;
const buildGoodsTypePayloadOptions = {
level1Id: "conditionGoodsType",
level2Id: "conditionSecondaryGoodsType",
level3Id: "conditionThirdLevelGoodsType",
level1Name: "conditionGoodsTypeName",
level2Name: "conditionSecondaryGoodsTypeName",
level3Name: "conditionThirdLevelGoodsTypeName",
};
const conditionItem = [{
conditionType: paramsType2Item.condition,
// conditionGoodsConfigType: paramsConfig.goodsCategory,
// conditionStartValue: "",
// conditionEndValue: "",
}];
if (paramsType2Item.condition === 0) {
return conditionItem;
}
// 合并到 conditionItem 的第一位里
let extend = {};
const conditionParamsData = paramsType2Item[`conditionType${paramsType2Item.condition}`];
if (paramsType2Item.condition === 1) {
extend.conditionStartValue = conditionParamsData.permeabilityMin;
extend.conditionEndValue = conditionParamsData.permeabilityMax;
extend = {
...extend,
...paramsConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue, buildGoodsTypePayloadOptions)
: buildProductDefinePayload(productDefineList, conditionParamsData.productValue),
};
conditionItem.push({
conditionStartValue: conditionParamsData.permeabilityMin1,
conditionEndValue: conditionParamsData.permeabilityMax1,
...paramsConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue1, buildGoodsTypePayloadOptions)
: buildProductDefinePayload(productDefineList, conditionParamsData.productValue1),
});
}
if (paramsType2Item.condition === 2) {
extend.conditionEndValue = conditionParamsData.deductRate;
extend.conditionCommissionTypeValue = conditionParamsData.perOrderDeductAmount;
}
if (paramsType2Item.condition === 3) {
extend.conditionCommissionTypeValue = conditionParamsData.increaseReward;
}
if (paramsType2Item.condition === 4) {
extend
= paramsConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue, buildGoodsTypePayloadOptions)
: buildProductDefinePayload(productDefineList, conditionParamsData.productValue);
}
conditionItem[0] = {
...conditionItem[0],
...extend,
};
return conditionItem;
}
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, options = {
level1Id: "goodsType",
level1Name: "goodsTypeName",
level2Id: "secondaryGoodsType",
level2Name: "secondaryGoodsTypeName",
level3Id: "thirdLevelGoodsType",
level3Name: "thirdLevelGoodsTypeName",
}) {
const result = {};
let currentLevel = tree;
pathIds.forEach((id, index) => {
const node = currentLevel.find(item => item.categoryType === id);
if (!node)
return;
if (index === 0) {
result[options.level1Id] = node.categoryType;
result[options.level1Name] = node.categoryName;
} else if (index === 1) {
result[options.level2Id] = node.categoryType;
result[options.level2Name] = node.categoryName;
} else if (index === 2) {
result[options.level3Id] = node.categoryType;
result[options.level3Name] = 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: commissionTypesCoverCommissionBase[rowItem.commissionTypes],
};
// 还要加多 一个goodsConfigType 字段
if (fn && typeof fn === "function") {
fn(result, { rowItem, row }, { productColItem, colIndex });
}
});
});
}
function coverParamsType2(ParamsType2, fn) {
ParamsType2.forEach((rowItem, rowIndex) => {
const result = {
templateType: 1,
startValue: rowItem.priceRange[0],
endValue: rowItem.priceRange[1],
commissionTypeValue: rowItem.condition === 0 ? rowItem.conditionType0 : rowItem[`conditionType${rowItem.condition}`].triggerCondition,
};
// 还要加多 一个goodsConfigType 字段
if (fn && typeof fn === "function") {
fn(result, {
paramsType2Item: rowItem,
paramsType2Index: rowIndex,
});
}
});
}
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;
}
\ No newline at end of file \ No newline at end of file
<template>
<d2-container v-loading="$store.state.d2admin.loading.value" class="performance-scheme-wrapper">
<el-form class="form-performance-name"
label-width="170px"
:model="formData"
:rules="rules">
<div v-if="routeParams.page == 'performanceList'" class="warp-box">
<div class="title space-b">
<div class="title-wrap">
<span>渠道配置</span>
</div>
</div>
<div class="warp-content">
<ChannelConfig></ChannelConfig>
</div>
</div>
<div class="warp-box">
<div class="title space-b">
<div class="title-wrap">
<span>绩效规则选择</span>
</div>
</div>
<div class="warp-content">
<PerformanceRuleSelection />
</div>
</div>
<div class="warp-box">
<div class="title space-b">
<div class="title-wrap">
<span>绩效参数配置</span>
</div>
</div>
<div class="warp-content">
<el-form-item label="当前方案名称:" prop="name">
<el-input v-model="schemaName"
clearable
maxlength="20"
placeholder="请输入当前方案名称"
style="width:290px" />
</el-form-item>
<ParamConfigList v-for="(parameter, index) in formData.paramConfigList"
:key="parameter.sort"
class="params-config-list"
:config-index="index" />
</div>
</div>
<div class="warp-box">
<div class="title space-b">
<div class="title-wrap">
<span>应用到门店</span>
</div>
</div>
<div class="warp-content">
<StoreApply />
</div>
</div>
<div class="btn-box">
<el-button v-if="routeParams.id" size="small" type="primary" class="btn check-btn" @click="handleCheck">
提交审核
</el-button>
<el-button size="small" class="btn save-btn" @click="handleSubmit">
保存
</el-button>
<el-button size="small" class="btn cancel-btn" @click="handleCancel">
取消
</el-button>
</div>
</el-form>
<detail-dialog
v-if="detailVisible"
:detailVisible="detailVisible"
:id="routeParams.id"
:isEdit="true"
@dialogClose="handleCheckClose"
></detail-dialog>
</d2-container>
</template>
<script>
import { groupBy } from "lodash-es";
import { mapGetters, mapMutations, mapState } from "vuex";
import { getAllCategory } from "@/api/product.js";
import { getPerformanceConfigDetailAPI, 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 { assessmentFactorOptions } from "../components/performanceRuleSelection/options.js";
import StoreApply from "../components/storeApply/index.vue";
import { bindFormFields } from "../store/helper.js";
import { convertBackendToData, coverParamConfigList } from "../utils/convertBackendToData.js";
import { convertDataToBackend } from "../utils/index.js";
import detailDialog from "../../components/approvalView"
export default {
name: "PerformanceScheme",
components: {
PerformanceRuleSelection,
ParamConfigList,
ChannelConfig,
StoreApply,
detailDialog,
},
data() {
return {
// 页面来源 page: 提成方案配置 commissionPlanList; 门店提成方案 performanceList
routeParams: {
page: "commissionPlanList",
},
detailVisible: false,
rules: {
},
};
},
computed: {
...mapState("PerformanceFormStore", ["formData"]),
...mapGetters("PerformanceFormStore", ["getMerchantBrandRefList"]),
schemaName: bindFormFields("schemaName"),
},
created() {
},
async mounted() {
this.routeParams = this.$route.query?.params
? JSON.parse(this.$route.query?.params)
: {};
console.log(this.routeParams);
await this.initLoad();
if (this.routeParams.id) {
await this.getDetail();
}
},
methods: {
...mapMutations("PerformanceFormStore", ["setFormData", "setProductDefineList", "setGoodsCategory", "setMerchantBrandRefList", "touchAssessment", "setParamConfigList"]),
submitTest() {
this.$refs.formTest1.validate((valid) => {
if (valid) {
console.log("提交");
}
});
},
async initLoad() {
// 获取品类
const { list } = await getAllCategory({ pageSize: 9999, currentPage: 1 });
this.setGoodsCategory(list);
// 获取圈定商品/套餐
const res = await getTargetProductConfigListAPI({ currentPage: 1, pageSize: 999 });
this.setProductDefineList(res?.list);
},
handleCheck() {
this.handleCheckClose()
},
handleCheckClose() {
this.detailVisible = !this.detailVisible
},
async handleSubmit() {
await postSalaryPerformanceScheme(convertDataToBackend({
...this.formData,
merchantBrandRefList: this.merchantBrandRefList,
}));
},
handleCancel() {
console.log(this.routeParams.page, '----')
// this.$EventBus.$emit("salaryPerformanceTab", {
// tabName: this.routeParams.page
// })
this.$router.push({
name: 'salaryPerformance',
params:{
tabPane:this.routeParams.page == 'performanceList' ? '1' : '0',
tabName: this.routeParams.page
}
})
},
async getDetail() {
const res = await getPerformanceConfigDetailAPI({ id: 214 });
// console.log("coverParamConfigList(res.paramConfigList),", coverParamConfigList(res.paramConfigList));
this.setParamConfigList(coverParamConfigList(res.paramConfigList));
const assessmentValue = Object.keys(groupBy(res.paramConfigList, "assessmentFactor"));
const selectedItems = assessmentFactorOptions.filter(item => assessmentValue.includes(item.value));
this.touchAssessment(selectedItems);
// this.setMerchantBrandRefList(this.dealInterfaceBrand(res?.merchantBrandRefList || []));
// this.setFormData(convertBackendToData(res));
},
},
};
</script>
<style lang="scss" scoped>
.performance-scheme-wrapper {
.warp-box {
background: #fff;
margin-bottom: 16px;
position: relative;
.title {
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
display: flex;
align-items: center;
margin-bottom: 16px;
.title-wrap {
display: flex;
align-items: center;
}
.merchant-text {
font-size: 14px;
font-weight: normal;
color: #666666;
}
}
.space-b {
justify-content: space-between;
}
::v-deep .el-form-item__label {
padding: 0;
}
.warp-content {
padding: 0 20px 20px;
.params-config-list {
border-bottom: 1px solid #e5e5e5;
margin-top: 18px;
&:first-child {
margin-top: 0;
}
&:last-child {
border-bottom: 0;
}
}
}
}
.btn-box {
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
.btn {
box-sizing: border-box;
font-size: 14px;
height: 32px;
padding: 5px 14px;
line-height: 22px;
border-radius: 4px;
line-height: 22px;
}
.check-btn {
border: 1px solid #2a58ad;
background: #2a58ad;
color: #ffffff;
}
.save-btn {
width: 76px;
border: 1px solid #2a58ad;
background: #eff3f6;
color: #2A58AD;
}
.cancel-btn {
color: #666666;
width: 56px;
background: #e8e8e8;
}
}
.form-performance-name {
::v-deep .el-form-item {
margin-bottom: 14px;
.el-input {
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
}
}
}
</style>
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!