Commit d1e7ec30 by 张立顺

Merge branch 'SAAS+V5.6.1' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.6.1
2 parents 6cdd301c 5176dab7
Showing 51 changed files with 2645 additions and 620 deletions
...@@ -4247,6 +4247,27 @@ ...@@ -4247,6 +4247,27 @@
"whatwg-fetch": "^3.6.2" "whatwg-fetch": "^3.6.2"
}, },
"dependencies": { "dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"acorn-walk": { "acorn-walk": {
"version": "8.2.0", "version": "8.2.0",
"resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz", "resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz",
...@@ -4782,27 +4803,6 @@ ...@@ -4782,27 +4803,6 @@
"lodash": "^4.17.4" "lodash": "^4.17.4"
} }
}, },
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"@vue/vue2-jest": { "@vue/vue2-jest": {
"version": "27.0.0", "version": "27.0.0",
"resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz", "resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",
......
...@@ -597,6 +597,16 @@ export function postSalaryPerformanceScheme(data) { ...@@ -597,6 +597,16 @@ export function postSalaryPerformanceScheme(data) {
data.method = `dj.staff.api.performance.config.add`; data.method = `dj.staff.api.performance.config.add`;
return request(data, "post"); return request(data, "post");
} }
// 新增 工资绩效 方案
export function postBrandMerchant(data) {
data.method = `dj.staff.api.performance.config.valid.merchant.brand.by.merchant`;
return request(data, "post");
}
// 新增 工资绩效 方案
export function getConfigMerchantDetail(data) {
data.method = `dj.staff.api.performance.config.merchant.detail`;
return request(data, "post");
}
// 校验圈定产品/套餐是否可被删除 // 校验圈定产品/套餐是否可被删除
export function checkProductDefineAPI(data) { export function checkProductDefineAPI(data) {
......
...@@ -258,7 +258,8 @@ export const uploadCustodyAgreement = (data = {}) => { ...@@ -258,7 +258,8 @@ export const uploadCustodyAgreement = (data = {}) => {
*/ */
export const webPayDepositApplication = (data = {}) => { export const webPayDepositApplication = (data = {}) => {
return gscPost("/evalElectronicContract/webPayDepositApplication", data, { return gscPost("/evalElectronicContract/webPayDepositApplication", data, {
timeout: 30000 timeout: 30000,
returnAll: true
}) })
} }
/** /**
...@@ -266,7 +267,8 @@ export const webPayDepositApplication = (data = {}) => { ...@@ -266,7 +267,8 @@ export const webPayDepositApplication = (data = {}) => {
*/ */
export const webPayFinalApplication = (data = {}) => { export const webPayFinalApplication = (data = {}) => {
return gscPost("/evalElectronicContract/webPayFinalApplication", data, { return gscPost("/evalElectronicContract/webPayFinalApplication", data, {
timeout: 30000 timeout: 30000,
returnAll: true
}) })
} }
/** /**
......
...@@ -1809,7 +1809,7 @@ export const planStatusTypeOpt = [ ...@@ -1809,7 +1809,7 @@ export const planStatusTypeOpt = [
export const planStatusTypeOptMap = { export const planStatusTypeOptMap = {
1: "#2CCA74", 1: "#2CCA74",
2: "#EB4E4E", 2: "#EB4E4E",
0: "#999999" 0: "#999999",
} }
export const openOrderStatusOpt = [ export const openOrderStatusOpt = [
{ confId: 0, confValue: "已锁定" }, { confId: 0, confValue: "已锁定" },
...@@ -1826,7 +1826,6 @@ export const paymentMethodOpt = [ ...@@ -1826,7 +1826,6 @@ export const paymentMethodOpt = [
export const statusList = [ export const statusList = [
{ confId: 2, confValue: "生效" }, { confId: 2, confValue: "生效" },
{ confId: 1, confValue: "审批中" }, { confId: 1, confValue: "审批中" },
{ confId: 0, confValue: "草稿" },
{ confId: 3, confValue: "未生效" } { confId: 3, confValue: "未生效" }
] ]
...@@ -1845,6 +1844,7 @@ export const signerTypeOpt = [ ...@@ -1845,6 +1844,7 @@ export const signerTypeOpt = [
{ confId: 1, confValue: "企业委托" }, { confId: 1, confValue: "企业委托" },
{ confId: 2, confValue: "企业" } { confId: 2, confValue: "企业" }
] ]
export const reviewStatusOpts = [ export const reviewStatusOpts = [
{ {
confId: 0, confId: 0,
...@@ -1935,5 +1935,18 @@ export const goodsAuditStatusList = [ ...@@ -1935,5 +1935,18 @@ export const goodsAuditStatusList = [
{ {
confId: '4', confId: '4',
confLabel: '审批驳回' confLabel: '审批驳回'
} }]
// 企微主体
// 1-惠州广联 3-优加
export const wechatTypeOpt = [
{ confId: 1, confValue: "惠州广联" },
{ confId: 3, confValue: "优加" }
]
// 合同企业主体(内部主体)
// contractOrg: hzglsk-惠州广联、szyjzh-优加
export const contractOrgOpt = [
{ confId: "hzglsk", confValue: "惠州广联" },
{ confId: "szyjzh", confValue: "优加" }
] ]
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 { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload";
import { config } from "@/common/baseConfig";
import GLMapSdk from "@/common/glsk-mapapi-sdk";
import notice from "@/common/notice";
import util from "@/libs/util.js";
// 针对template模板中使用可选链操作符
import chaining from "@/plugin/chaining";
// 核心插件
import d2Admin from "@/plugin/d2admin";
// store
import store from "@/store/index";
// import axios from 'axios' // import axios from 'axios'
// import i18n from './i18n' // import i18n from './i18n'
import App from "./App"; import App from "./App"
// 核心插件
import d2Admin from "@/plugin/d2admin"
// store
import store from "@/store/index"
// 针对template模板中使用可选链操作符
import chaining from "@/plugin/chaining"
// 接入sentry
import * as Sentry from "@sentry/vue"
import { BrowserTracing } from "@sentry/tracing"
// import 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 "element-ui/lib/theme-chalk/index.css"; import notice from "@/common/notice"
import "element-ui/lib/theme-chalk/index.css"
import { config } from "@/common/baseConfig"
import GLMapSdk from "@/common/glsk-mapapi-sdk"
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload"
import { Request } from "glsk-toolkit"
import util from "@/libs/util.js"
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 }
...@@ -59,6 +59,19 @@ const PAY_MENTMETHOD_OPTIONS = Object.keys(PAY_MENTMETHOD_MAP).map((key) => { ...@@ -59,6 +59,19 @@ const PAY_MENTMETHOD_OPTIONS = Object.keys(PAY_MENTMETHOD_MAP).map((key) => {
value: key value: key
} }
}) })
// 合同企业主体(内部主体)
// wechatType: 1-惠州广联、3-优加
const wechatType_MAP = {
1: "惠州广联",
3: "优加"
}
const wechatType_OPTIONS = Object.keys(wechatType_MAP).map((key) => {
return {
label: wechatType_MAP[key],
value: key
}
})
module.exports = { module.exports = {
RECEIPT_STATUS, RECEIPT_STATUS,
PUSH_STATUS, PUSH_STATUS,
...@@ -70,5 +83,7 @@ module.exports = { ...@@ -70,5 +83,7 @@ module.exports = {
RECEIPT_STATUS_OPTIONS, RECEIPT_STATUS_OPTIONS,
NB_TRANSFER_STATUS_OPTIONS, NB_TRANSFER_STATUS_OPTIONS,
PAY_MENTMETHOD_OPTIONS, PAY_MENTMETHOD_OPTIONS,
PAY_MENTMETHOD_MAP PAY_MENTMETHOD_MAP,
wechatType_OPTIONS,
wechatType_MAP
} }
...@@ -7,16 +7,14 @@ ...@@ -7,16 +7,14 @@
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:form-data="showFormData" :form-data="showFormData"
label-width="130px" label-width="130px">
>
<template #inputRangeHtml> <template #inputRangeHtml>
<input-range <input-range
start-placeholder="最小金额" start-placeholder="最小金额"
end-placeholder="最大金额" end-placeholder="最大金额"
:display-value="searchForm.amtList" :display-value="searchForm.amtList"
max-length="15" max-length="15"
input-max-length="15" input-max-length="15"></input-range>
></input-range>
</template> </template>
<template #selectDatePickerHtml> <template #selectDatePickerHtml>
<div class="select-date-picker"> <div class="select-date-picker">
...@@ -24,14 +22,12 @@ ...@@ -24,14 +22,12 @@
v-model="searchForm.dateType" v-model="searchForm.dateType"
placeholder="请选择" placeholder="请选择"
@change="searchForm.dateValue = ''" @change="searchForm.dateValue = ''"
class="select" class="select">
>
<el-option <el-option
v-for="(subItem, subIndex) in selectOption" v-for="(subItem, subIndex) in selectOption"
:key="subIndex" :key="subIndex"
:label="subItem.label" :label="subItem.label"
:value="subItem.value" :value="subItem.value" />
/>
</el-select> </el-select>
<el-date-picker <el-date-picker
class="date-picker" class="date-picker"
...@@ -42,8 +38,7 @@ ...@@ -42,8 +38,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:picker-options="rangePickerOptions" :picker-options="rangePickerOptions"
:default-time="['00:00:00', '23:59:59']" :default-time="['00:00:00', '23:59:59']" />
/>
</div> </div>
</template> </template>
</d2-search> </d2-search>
...@@ -58,13 +53,11 @@ ...@@ -58,13 +53,11 @@
<d2-table-header> <d2-table-header>
<span <span
data-event-code="usedcar_payment_push_list" data-event-code="usedcar_payment_push_list"
style="margin-right: 10px" style="margin-right: 10px">
>
<auth-button <auth-button
category="Button" category="Button"
:show-btn-ids="['9051401']" :show-btn-ids="['9051401']"
:loading="pushPayBillLoading" :loading="pushPayBillLoading" />
/>
</span> </span>
<span data-event-code="usedcar_payment_management_list_export"> <span data-event-code="usedcar_payment_management_list_export">
<auth-button category="Button" :show-btn-ids="['9051402']" /> <auth-button category="Button" :show-btn-ids="['9051402']" />
...@@ -75,16 +68,14 @@ ...@@ -75,16 +68,14 @@
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn">
>
<div slot="statusHtml" slot-scope="scope"> <div slot="statusHtml" slot-scope="scope">
<span <span
class="circle" class="circle"
:style="{ :style="{
background: background:
baseData[scope.columnsObj.colorKey][scope.scope[scope.prop]] baseData[scope.columnsObj.colorKey][scope.scope[scope.prop]]
}" }"></span>
></span>
{{ {{
baseData[scope.columnsObj.enumKey][scope.scope[scope.prop]] || "-" baseData[scope.columnsObj.enumKey][scope.scope[scope.prop]] || "-"
}} }}
...@@ -98,8 +89,7 @@ ...@@ -98,8 +89,7 @@
id: scope.scope.id id: scope.scope.id
}) })
" "
data-event-code="usedcar_payment_detail" data-event-code="usedcar_payment_detail">
>
<auth-button :data="scope.scope" :show-btn-ids="['9051403']" /> <auth-button :data="scope.scope" :show-btn-ids="['9051403']" />
</span> </span>
<!-- 回单 --> <!-- 回单 -->
...@@ -112,8 +102,7 @@ ...@@ -112,8 +102,7 @@
<detailDialog <detailDialog
:visible="detailDialogVisible" :visible="detailDialogVisible"
:params-obj="detailDialogParams" :params-obj="detailDialogParams"
@dialogClose="closeDetailDialog" @dialogClose="closeDetailDialog" />
/>
</d2-container> </d2-container>
</template> </template>
...@@ -135,7 +124,9 @@ import { ...@@ -135,7 +124,9 @@ import {
RECEIPT_STATUS_OPTIONS, RECEIPT_STATUS_OPTIONS,
NB_TRANSFER_STATUS_OPTIONS, NB_TRANSFER_STATUS_OPTIONS,
PAY_MENTMETHOD_OPTIONS, PAY_MENTMETHOD_OPTIONS,
PAY_MENTMETHOD_MAP PAY_MENTMETHOD_MAP,
wechatType_OPTIONS,
wechatType_MAP
} from "./contant" } from "./contant"
import detailDialog from "./components/detailDialog.vue" import detailDialog from "./components/detailDialog.vue"
import { todayEndPickerOptions } from "@/common/format" import { todayEndPickerOptions } from "@/common/format"
...@@ -179,7 +170,8 @@ export default { ...@@ -179,7 +170,8 @@ export default {
amtList: [], amtList: [],
dateType: "payment", dateType: "payment",
dateValue: "", dateValue: "",
paymentMethod: "全部" paymentMethod: "全部",
wechatType: ""
}, },
showFormData: [ showFormData: [
{ {
...@@ -298,6 +290,16 @@ export default { ...@@ -298,6 +290,16 @@ export default {
optionId: "label", optionId: "label",
optionLabel: "label", optionLabel: "label",
optionsName: "PAY_MENTMETHOD_OPTIONS" optionsName: "PAY_MENTMETHOD_OPTIONS"
},
{
label: "内部主体",
name: "wechatType",
type: "select",
isClear: true,
optionList: [],
optionId: "value",
optionLabel: "label",
optionsName: "wechatType_OPTIONS"
} }
], ],
// 基本数据 // 基本数据
...@@ -311,7 +313,9 @@ export default { ...@@ -311,7 +313,9 @@ export default {
pushStatus: deepClone(PUSH_STATUS), pushStatus: deepClone(PUSH_STATUS),
nbTransferStatus: deepClone(NB_TRANSFER_STATUS), nbTransferStatus: deepClone(NB_TRANSFER_STATUS),
PAY_MENTMETHOD_OPTIONS: deepClone(PAY_MENTMETHOD_OPTIONS), PAY_MENTMETHOD_OPTIONS: deepClone(PAY_MENTMETHOD_OPTIONS),
PAY_MENTMETHOD_MAP: deepClone(PAY_MENTMETHOD_MAP) PAY_MENTMETHOD_MAP: deepClone(PAY_MENTMETHOD_MAP),
wechatType_OPTIONS: deepClone(wechatType_OPTIONS),
wechatType_MAP: deepClone(wechatType_MAP)
}, },
getListApi: getUsedCarPaymentList, getListApi: getUsedCarPaymentList,
searchFormSearch: {}, searchFormSearch: {},
...@@ -422,6 +426,14 @@ export default { ...@@ -422,6 +426,14 @@ export default {
label: "付款方式", label: "付款方式",
prop: "paymentMethod", prop: "paymentMethod",
minWidth: 120 minWidth: 120
},
{
label: "内部主体",
prop: "wechatType",
minWidth: 120,
formatter: (cellValue) => {
return this.baseData.wechatType_MAP[cellValue.wechatType] || "-"
}
} }
] ]
}, },
......
...@@ -524,10 +524,14 @@ ...@@ -524,10 +524,14 @@
<!-- 取消分账 --> <!-- 取消分账 -->
<auth-button slot="auth-button" v-if="scope.row.profitAllocationStatus == 5" :show-btn-ids="['9040135']" <auth-button slot="auth-button" v-if="scope.row.profitAllocationStatus == 5" :show-btn-ids="['9040135']"
:data="scope.row" /> :data="scope.row" />
<div>
<!-- 通过 --> <!-- 通过 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040147']" :data="scope.row" /> <auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040147']" :data="scope.row" />
</div>
<div>
<!-- 驳回 --> <!-- 驳回 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040148']" :data="scope.row" /> <auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040148']" :data="scope.row" />
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -505,10 +505,14 @@ ...@@ -505,10 +505,14 @@
</el-button> --> </el-button> -->
<!-- 取消分账 --> <!-- 取消分账 -->
<auth-button v-if="scope.row.profitAllocationStatus == 5" :show-btn-ids="['9040107']" :data="scope.row" /> <auth-button v-if="scope.row.profitAllocationStatus == 5" :show-btn-ids="['9040107']" :data="scope.row" />
<div>
<!-- 通过 --> <!-- 通过 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040147']" :data="scope.row" /> <auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040147']" :data="scope.row" />
</div>
<div>
<!-- 驳回 --> <!-- 驳回 -->
<auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040148']" :data="scope.row" /> <auth-button v-if="scope.row.goodsOrderApplyStatus == 2" :show-btn-ids="['9040148']" :data="scope.row" />
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -45,7 +45,11 @@ ...@@ -45,7 +45,11 @@
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
> >
<div slot="imageUrls" slot-scope="scope" class="coverImage-preview"> <div
slot="imageUrls"
slot-scope="scope"
class="coverImage-preview"
>
<glsx-preview <glsx-preview
:image-url-arr=" :image-url-arr="
scope.scope.imageUrls scope.scope.imageUrls
...@@ -57,7 +61,12 @@ ...@@ -57,7 +61,12 @@
></glsx-preview> ></glsx-preview>
</div> </div>
<template slot="remark" slot-scope="scope"> <template slot="remark" slot-scope="scope">
<el-popover placement="top" width="fit-content" trigger="hover"> <template v-if="scope.scope.remark">
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div class="tags-popover"> <div class="tags-popover">
{{ scope.scope.remark || "-" }} {{ scope.scope.remark || "-" }}
</div> </div>
...@@ -66,8 +75,15 @@ ...@@ -66,8 +75,15 @@
}}</span> }}</span>
</el-popover> </el-popover>
</template> </template>
<template v-else>-</template>
</template>
<template slot="merchantName" slot-scope="scope"> <template slot="merchantName" slot-scope="scope">
<el-popover placement="top" width="fit-content" trigger="hover"> <template v-if="scope.scope.merchantName">
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div class="tags-popover"> <div class="tags-popover">
{{ scope.scope.merchantName || "-" }} {{ scope.scope.merchantName || "-" }}
</div> </div>
...@@ -76,6 +92,8 @@ ...@@ -76,6 +92,8 @@
}}</span> }}</span>
</el-popover> </el-popover>
</template> </template>
<template v-else>-</template>
</template>
<!--状态 --> <!--状态 -->
<div slot="statusHtml" slot-scope="scope"> <div slot="statusHtml" slot-scope="scope">
<div class="online-status"> <div class="online-status">
...@@ -83,9 +101,11 @@ ...@@ -83,9 +101,11 @@
class="dot" class="dot"
:style="{ :style="{
background: getStatusColor( background: getStatusColor(
scope && scope.scope && scope.scope.isReviewed, scope &&
scope.scope &&
scope.scope.isReviewed,
'reviewStatusOptMap' 'reviewStatusOptMap'
) ),
}" }"
></span> ></span>
{{ {{
...@@ -101,7 +121,10 @@ ...@@ -101,7 +121,10 @@
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<span <span
style="margin-right: 8px" style="margin-right: 8px"
v-if="scope.scope.isReviewed == 2 || scope.scope.isReviewed == 1" v-if="
scope.scope.isReviewed == 2 ||
scope.scope.isReviewed == 1
"
> >
<auth-button <auth-button
slot="auth-button" slot="auth-button"
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
@handleClose="closeDialogVisible" @handleClose="closeDialogVisible"
@handleConfirm="handleUpdateConfirm" @handleConfirm="handleUpdateConfirm"
:slotArr="slotArr" :slotArr="slotArr"
class="batch-modify-salary-dialog"
> >
<template slot="effectiveMonth"> <template slot="effectiveMonth">
<el-date-picker <el-date-picker
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
size="small" size="small"
:clearable="false" :clearable="false"
value-format="yyyy-MM" value-format="yyyy-MM"
class="effectiveMonth"
> >
</el-date-picker> </el-date-picker>
</template> </template>
...@@ -62,7 +64,7 @@ export default { ...@@ -62,7 +64,7 @@ export default {
}, },
isUpdateDialogConfig: { isUpdateDialogConfig: {
title: "批量修改薪资占比", title: "批量修改薪资占比",
width: "500px", width: "480px",
okText: "确定" okText: "确定"
}, },
isUpdateForm: { isUpdateForm: {
...@@ -111,6 +113,9 @@ export default { ...@@ -111,6 +113,9 @@ export default {
this.validatePercent(value, callback), this.validatePercent(value, callback),
trigger: "blur" trigger: "blur"
} }
],
effectiveMonth: [
{ required: true, message: "请选择", trigger: "change" }
] ]
}, },
baseData: {}, baseData: {},
...@@ -195,4 +200,10 @@ export default { ...@@ -195,4 +200,10 @@ export default {
} }
} }
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.batch-modify-salary-dialog{
::v-deep .el-date-editor.el-input{
width: 290px!important;
}
}
</style>
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
></glsx-preview> ></glsx-preview>
</div> </div>
<template slot="remark" slot-scope="scope"> <template slot="remark" slot-scope="scope">
<template v-if="scope.scope.remark">
<el-popover placement="top" width="fit-content" trigger="hover"> <el-popover placement="top" width="fit-content" trigger="hover">
<div class="tags-popover"> <div class="tags-popover">
{{ scope.scope.remark || "-" }} {{ scope.scope.remark || "-" }}
...@@ -86,7 +87,10 @@ ...@@ -86,7 +87,10 @@
}}</span> }}</span>
</el-popover> </el-popover>
</template> </template>
<template v-else>-</template>
</template>
<template slot="replyContent" slot-scope="scope"> <template slot="replyContent" slot-scope="scope">
<template v-if="scope.scope.replyContent">
<el-popover placement="top" width="fit-content" trigger="hover"> <el-popover placement="top" width="fit-content" trigger="hover">
<div class="tags-popover"> <div class="tags-popover">
{{ scope.scope.replyContent || "-" }} {{ scope.scope.replyContent || "-" }}
...@@ -96,6 +100,8 @@ ...@@ -96,6 +100,8 @@
}}</span> }}</span>
</el-popover> </el-popover>
</template> </template>
<template v-else>-</template>
</template>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<el-button <el-button
size="small" size="small"
...@@ -421,6 +427,9 @@ export default { ...@@ -421,6 +427,9 @@ export default {
.el-popper { .el-popper {
width: 300px !important; width: 300px !important;
} }
.el-date-editor.el-input, .el-date-editor.el-input__inner{
width:100% !important;
}
} }
.content { .content {
position: absolute; position: absolute;
......
...@@ -19,18 +19,18 @@ ...@@ -19,18 +19,18 @@
</template> </template>
<script> <script>
import { interviewResultOpt, processResultOpt } from "@/common/constants.js" import { interviewResultOpt, processResultOpt } from "@/common/constants.js";
import { import {
getSalaryAppealDetail, getSalaryAppealDetail,
replySalaryAppeal replySalaryAppeal,
} from "@/api/salaryManagement.js" } from "@/api/salaryManagement.js";
import detailComp from "../../../salaryPerformance/components/detailComp.vue" import detailComp from "../../../salaryPerformance/components/detailComp.vue";
import { Util, deepClone, getStatusItem } from "@/common/util" import { Util, deepClone, getStatusItem } from "@/common/util";
import dayjs from "dayjs" import dayjs from "dayjs";
export default { export default {
name: "approvalView", name: "approvalView",
components: { components: {
detailComp detailComp,
}, },
data() { data() {
return { return {
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
rules: {}, rules: {},
dialogConfig: { dialogConfig: {
title: "去答复", title: "去答复",
width: "720px" width: "720px",
}, },
loading: false, loading: false,
isShow: true, isShow: true,
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
{ {
title: "姓名", title: "姓名",
key: "staffName", key: "staffName",
col: 24 col: 24,
}, },
{ {
title: "本月实际出勤天数", title: "本月实际出勤天数",
...@@ -60,8 +60,8 @@ export default { ...@@ -60,8 +60,8 @@ export default {
formatter: (val) => { formatter: (val) => {
return val.actualAttendanceDays return val.actualAttendanceDays
? val.actualAttendanceDays + "天" ? val.actualAttendanceDays + "天"
: "-" : "-";
} },
}, },
{ {
title: "申请修改实际出勤天数", title: "申请修改实际出勤天数",
...@@ -71,17 +71,20 @@ export default { ...@@ -71,17 +71,20 @@ export default {
formatter: (val) => { formatter: (val) => {
return val.applyActualAttendanceDays return val.applyActualAttendanceDays
? val.applyActualAttendanceDays + "天" ? val.applyActualAttendanceDays + "天"
: "-" : "-";
} },
}, },
{ {
title: "平板录音完成总数", title: "平板录音完成总数",
key: "padRecordNum", key: "padRecordNum",
col: 24, col: 24,
isHidden: true, isHidden: true,
formatter: (val) => { formatter: (val) => {
return val.padRecordNum ? val.padRecordNum + "条" : "-" return val.padRecordNum
} ? val.padRecordNum + "条"
: "-";
},
}, },
{ {
title: "申诉修改平板录音数", title: "申诉修改平板录音数",
...@@ -91,37 +94,39 @@ export default { ...@@ -91,37 +94,39 @@ export default {
formatter: (val) => { formatter: (val) => {
return val.applyPadRecordNum return val.applyPadRecordNum
? val.applyPadRecordNum + "条" ? val.applyPadRecordNum + "条"
: "-" : "-";
} },
}, },
{ {
title: "截图说明", title: "截图说明",
key: "attachmentListCopy", key: "attachmentListCopy",
type: "imgList", type: "imgList",
col: 24 col: 24,
}, },
{ {
title: "备注", title: "备注",
key: "remark", key: "remark",
col: 24 col: 24,
}, },
{ {
title: "确认实际出勤天数", title: "确认实际出勤天数",
key: "confirmActualAttendanceDays", key: "confirmActualAttendanceDays",
isEdit: true, isEdit: true,
col: 24, col: 24,
maxLength: 5,
type: "input", type: "input",
append: "天", append: "天",
isHidden: true isHidden: true,
}, },
{ {
title: "确认平板录音数", title: "确认平板录音数",
key: "confirmPadRecordNum", key: "confirmPadRecordNum",
isEdit: true, isEdit: true,
col: 24, col: 24,
maxLength: 5,
append: "条", append: "条",
type: "input", type: "input",
isHidden: true isHidden: true,
}, },
{ {
title: "处理回复", title: "处理回复",
...@@ -129,169 +134,179 @@ export default { ...@@ -129,169 +134,179 @@ export default {
isEdit: true, isEdit: true,
col: 24, col: 24,
type: "textarea", type: "textarea",
placeholder: "描述处理结果,驻店在小程序上可查看(500字以内)", placeholder:
maxLength: 500 "描述处理结果,驻店在小程序上可查看(500字以内)",
} maxLength: 500,
] },
}
], ],
baseData: {} },
} ],
baseData: {},
};
}, },
props: { props: {
detailVisible: { detailVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
id: { id: {
type: String | Number, type: String | Number,
default: "" default: "",
} },
}, },
computed: { computed: {
visible: { visible: {
get() { get() {
return this.detailVisible return this.detailVisible;
}, },
set(newVal) { set(newVal) {
this.$emit("dialogClose", { flag: newVal, attrName: "detailVisible" }) this.$emit("dialogClose", {
} flag: newVal,
} attrName: "detailVisible",
});
},
},
}, },
watch: { watch: {
detailVisible: { detailVisible: {
handler(val) { handler(val) {
console.log(val) console.log(val);
this.getDetail() this.getDetail();
},
immediate: true,
}, },
immediate: true
}
}, },
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
async getDetail() { async getDetail() {
let result = await getSalaryAppealDetail({ id: this.id }) let result = await getSalaryAppealDetail({ id: this.id });
result.attachmentListCopy = this.formatterImg(result.attachmentList) result.attachmentListCopy = this.formatterImg(
result.confirmActualAttendanceDays = result.applyActualAttendanceDays result.attachmentList
result.confirmPadRecordNum = result.applyPadRecordNum );
result.confirmActualAttendanceDays =
result.applyActualAttendanceDays;
result.confirmPadRecordNum = result.applyPadRecordNum;
// 申诉类型(1:考勤,2:平板录音) // 申诉类型(1:考勤,2:平板录音)
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "confirmActualAttendanceDays") this.findAttrIdx("infoData", "confirmActualAttendanceDays")
].isHidden = result.appealType == 1 ? false : true ].isHidden = result.appealType == 1 ? false : true;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "actualAttendanceDays") this.findAttrIdx("infoData", "actualAttendanceDays")
].isHidden = result.appealType == 1 ? false : true ].isHidden = result.appealType == 1 ? false : true;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "applyActualAttendanceDays") this.findAttrIdx("infoData", "applyActualAttendanceDays")
].isHidden = result.appealType == 1 ? false : true ].isHidden = result.appealType == 1 ? false : true;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "padRecordNum") this.findAttrIdx("infoData", "padRecordNum")
].isHidden = result.appealType == 1 ? true : false ].isHidden = result.appealType == 1 ? true : false;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "applyPadRecordNum") this.findAttrIdx("infoData", "applyPadRecordNum")
].isHidden = result.appealType == 1 ? true : false ].isHidden = result.appealType == 1 ? true : false;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "confirmPadRecordNum") this.findAttrIdx("infoData", "confirmPadRecordNum")
].isHidden = result.appealType == 1 ? true : false ].isHidden = result.appealType == 1 ? true : false;
this.detailInfo = result this.detailInfo = result;
}, },
formatterImg(val) { formatterImg(val) {
let arr = [] let arr = [];
val.forEach((item) => { val.forEach((item) => {
arr.push(item.fileUrl) arr.push(item.fileUrl);
}) });
return arr return arr;
}, },
validateBeforeSave() { validateBeforeSave() {
if ( if (
this.detailInfo.appealType == 1 && this.detailInfo.appealType == 1 &&
!this.detailInfo.confirmActualAttendanceDays !this.detailInfo.confirmActualAttendanceDays
) { ) {
this.$message.error("请输入确认实际出勤天数") this.$message.error("请输入确认实际出勤天数");
return false return false;
} }
// 新增:确认实际出勤天数需为整数,且不得超过当月最大天数 // 新增:确认实际出勤天数需为整数,且不得超过当月最大天数
if (this.detailInfo.appealType == 1) { if (this.detailInfo.appealType == 1) {
const v = this.detailInfo.confirmActualAttendanceDays const v = this.detailInfo.confirmActualAttendanceDays;
const s = String(v).trim() const s = String(v).trim();
if (!/^\d+$/.test(s)) { if (!/^\d+$/.test(s)) {
this.$message.error("确认实际出勤天数需为整数") this.$message.error("确认实际出勤天数需为整数");
return false return false;
} }
// 依据记录月份计算当月最大天数,优先取 appealMonth / evaluationMonth / salaryMonth // 依据记录月份计算当月最大天数,优先取 appealMonth / evaluationMonth / salaryMonth
const monthStr = const monthStr =
this.detailInfo.appealMonth || this.detailInfo.appealMonth ||
this.detailInfo.evaluationMonth || this.detailInfo.evaluationMonth ||
this.detailInfo.salaryMonth this.detailInfo.salaryMonth;
const maxDays = monthStr const maxDays = monthStr
? dayjs(monthStr, "YYYY-MM").daysInMonth() ? dayjs(monthStr, "YYYY-MM").daysInMonth()
: dayjs().daysInMonth() : dayjs().daysInMonth();
if (Number(s) > maxDays) { if (Number(s) > maxDays) {
this.$message.error( this.$message.error(
`确认实际出勤天数不能大于当月最大天数(${maxDays}天)` `确认实际出勤天数不能大于当月最大天数(${maxDays}天)`
) );
return false return false;
} }
this.detailInfo.confirmActualAttendanceDays = Number(s) this.detailInfo.confirmActualAttendanceDays = Number(s);
} }
if ( if (
this.detailInfo.appealType == 2 && this.detailInfo.appealType == 2 &&
!this.detailInfo.confirmPadRecordNum !this.detailInfo.confirmPadRecordNum
) { ) {
this.$message.error("请输入确认平板录音数") this.$message.error("请输入确认平板录音数");
return false return false;
} }
// 新增:确认平板录音数需为整数 // 新增:确认平板录音数需为整数
if (this.detailInfo.appealType == 2) { if (this.detailInfo.appealType == 2) {
const v = this.detailInfo.confirmPadRecordNum const v = this.detailInfo.confirmPadRecordNum;
const s = String(v).trim() const s = String(v).trim();
if (!/^\d+$/.test(s)) { if (!/^\d+$/.test(s)) {
this.$message.error("确认平板录音数需为整数") this.$message.error("确认平板录音数需为整数");
return false return false;
} }
this.detailInfo.confirmPadRecordNum = Number(s) this.detailInfo.confirmPadRecordNum = Number(s);
} }
return true return true;
}, },
handleClick() { handleClick() {
if (!this.validateBeforeSave()) return if (!this.validateBeforeSave()) return;
let params = { let params = {
appealRecordId: this.detailInfo.id, appealRecordId: this.detailInfo.id,
replyContent: this.detailInfo.replyContent replyContent: this.detailInfo.replyContent,
} };
if (this.detailInfo.appealType == 1) { if (this.detailInfo.appealType == 1) {
params.confirmActualAttendanceDays = params.confirmActualAttendanceDays =
this.detailInfo.confirmActualAttendanceDays this.detailInfo.confirmActualAttendanceDays;
} else { } else {
params.confirmPadRecordNum = this.detailInfo.confirmPadRecordNum params.confirmPadRecordNum =
this.detailInfo.confirmPadRecordNum;
} }
replySalaryAppeal(params) replySalaryAppeal(params)
.then((res) => { .then((res) => {
if (res) { if (res) {
this.$message.success("操作成功") this.$message.success("操作成功");
} }
}) })
.finally((err) => { .finally((err) => {
this.visible = false this.visible = false;
}) });
}, },
handleClose() { handleClose() {
console.log("handleClose") console.log("handleClose");
}, },
findAttrIdx(formName, name) { findAttrIdx(formName, name) {
var index = this.configData[0][formName].findIndex((k) => k.key == name) var index = this.configData[0][formName].findIndex(
return index || 0 (k) => k.key == name
} );
} return index || 0;
} },
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../../../salaryPerformance/components/detail.scss"; @import "../../../salaryPerformance/components/detail.scss";
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
v-model="infoForm.merchantIds" v-model="infoForm.merchantIds"
multiple multiple
collapse-tags collapse-tags
:multiple-limit="10"
@change="updateStaffList('staffPhoneList')" @change="updateStaffList('staffPhoneList')"
> >
<el-option <el-option
...@@ -48,7 +47,6 @@ ...@@ -48,7 +47,6 @@
v-model="infoForm.staffPhoneList" v-model="infoForm.staffPhoneList"
multiple multiple
collapse-tags collapse-tags
:multiple-limit="10"
> >
<el-option <el-option
v-for="item in baseData.staffList" v-for="item in baseData.staffList"
...@@ -96,7 +94,7 @@ ...@@ -96,7 +94,7 @@
>模板下载</el-button >模板下载</el-button
> --> > -->
<div class="tips-text"> <div class="tips-text">
选择员工在近3个月内的工资导出文件,批量修订后导入更新 支持批量修订近3个月内到工资导出文件后导入更新
</div> </div>
<div class="file_box" v-if="fileName"> <div class="file_box" v-if="fileName">
<div class="file_name">{{ fileName }}</div> <div class="file_name">{{ fileName }}</div>
...@@ -135,7 +133,6 @@ ...@@ -135,7 +133,6 @@
v-model="infoForm.exportMerchantIds" v-model="infoForm.exportMerchantIds"
multiple multiple
collapse-tags collapse-tags
:multiple-limit="10"
@change="updateStaffList('salaryMerchantList')" @change="updateStaffList('salaryMerchantList')"
> >
<el-option <el-option
...@@ -154,7 +151,6 @@ ...@@ -154,7 +151,6 @@
v-model="infoForm.exportStaffPhoneList" v-model="infoForm.exportStaffPhoneList"
multiple multiple
collapse-tags collapse-tags
:multiple-limit="10"
> >
<el-option <el-option
v-for="item in baseData.exportStaffList" v-for="item in baseData.exportStaffList"
......
...@@ -252,7 +252,7 @@ export default { ...@@ -252,7 +252,7 @@ export default {
optionsName: "directLeaderList" optionsName: "directLeaderList"
}, },
{ {
label: "工资绩效", label: "含工资人员",
name: "salaryStaffPhone", name: "salaryStaffPhone",
type: "select", type: "select",
isClear: true, isClear: true,
......
<!-- 详情 --> <!-- 详情 -->
<template> <template>
<baseDialog <baseDialog
:dialog-config="dialogConfig" class="accountDailog"
:config="config" :config="config"
:dialog-config="dialogConfig"
:is-show.sync="visible" :is-show.sync="visible"
class="accountDailog"
@handleClick="handleClick" @handleClick="handleClick"
> >
<div class="sun-dialog" v-loading="loading"> <div v-loading="loading" class="sun-dialog">
<div class="approve-info"> <div class="approve-info">
提交后经由嘀加企微,推送到审批人<span 提交后经由嘀加企微,推送到审批人
<template
v-if="
detailInfo.examineData && detailInfo.examineData.length
"
><span
v-for="(item, index) in detailInfo.examineData" v-for="(item, index) in detailInfo.examineData"
:key="index + 'exam'" :key="`${index}exam`"
>{{ item.approverName }}{{ item.approverMobile }}</span >
>,抄送人<span {{ item.approverName }}{{ item.approverMobile }}
</span> </template
><span v-else>-</span>,抄送人
<template
v-if="detailInfo.referData && detailInfo.referData.length"
>
<span
v-for="(item, index) in detailInfo.referData" v-for="(item, index) in detailInfo.referData"
:key="index + 'refer'" :key="`${index}refer`"
>{{ item.approverName }}{{ item.approverMobile }}</span >
>,审批人通过方案后,方案正式生效 {{ item.approverName }}{{ item.approverMobile }}
</span></template
>
<span v-else>-</span>,审批人通过方案后,方案正式生效
</div> </div>
<template v-if="detailInfo"> <template v-if="detailInfo">
<detailComp <DetailComp
:configData="configData" :config-data="configData"
:detailInfo="detailInfo" :detail-info="detailInfo"
:is-close="isEdit"
:rules="rules" :rules="rules"
:isClose="isEdit"
> >
<template #merchantBrandRefList> <template #merchantBrandRefList>
<div <div
class="merchantBrand-box"
v-if=" v-if="
detailInfo.merchantBrandList && detailInfo.merchantBrandList &&
detailInfo.merchantBrandList.length detailInfo.merchantBrandList.length
" "
class="merchantBrand-box"
> >
<div <div
class="box"
v-for="item in detailInfo.merchantBrandList" v-for="item in detailInfo.merchantBrandList"
:key="item.merchantId" :key="item.merchantId"
class="box"
> >
<div class="merchantName"> <div class="merchantName">
{{ item.merchantName }} {{ item.merchantName }}
</div> </div>
<div class="brands"> <div class="brands">
<div <div
class="brand"
v-for="tag in item.child" v-for="tag in item.child"
:key="tag.childId" :key="tag.childId"
class="brand"
> >
{{ tag.childName }} {{ tag.childName }}
</div> </div>
...@@ -55,15 +69,15 @@ ...@@ -55,15 +69,15 @@
</div> </div>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</detailComp> </DetailComp>
<template v-if="!isEdit"> <template v-if="!isEdit">
<el-form label-width="150px" style="margin-top: -60px"> <el-form label-width="150px" style="margin-top: -60px">
<el-row <el-row
:gutter="20"
:key="index"
v-for="( v-for="(
item, index item, index
) in detailInfo.approveOperationRecordList" ) in detailInfo.approveOperationRecordList"
:key="index"
:gutter="20"
> >
<el-col :span="12"> <el-col :span="12">
<el-form-item label="审批人:"> <el-form-item label="审批人:">
...@@ -73,20 +87,22 @@ ...@@ -73,20 +87,22 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="审批意见:"> <el-form-item label="审批意见:">
<!-- 将 v-html 改为纯文本插值,并应用换行样式 --> <!-- 将 v-html 改为纯文本插值,并应用换行样式 -->
<span class="opinion-text">{{ <span class="opinion-text">
{{
formatOpinionText( formatOpinionText(
item.approveOpinion item.approveOpinion
) || "-" ) || "-"
}}</span> }}
</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-form label-width="150px" v-if="detailInfo.referData"> <el-form v-if="detailInfo.referData" label-width="150px">
<el-row <el-row
:gutter="20"
:key="index"
v-for="(item, index) in detailInfo.referData" v-for="(item, index) in detailInfo.referData"
:key="index"
:gutter="20"
> >
<el-col :span="24"> <el-col :span="24">
<el-form-item label="查阅人:"> <el-form-item label="查阅人:">
...@@ -102,19 +118,35 @@ ...@@ -102,19 +118,35 @@
</template> </template>
<script> <script>
import { interviewResultOpt, processResultOpt } from "@/common/constants.js"; import { getPerformanceConfigDetailAPI } from "@/api/resident";
import { import {
getApproveConfig,
getConfigApprovetDetail, getConfigApprovetDetail,
submitConfigApprove, submitConfigApprove,
getApproveConfig,
} from "@/api/salaryManagement.js"; } from "@/api/salaryManagement.js";
import { getPerformanceConfigDetailAPI } from "@/api/resident"; import { interviewResultOpt, processResultOpt } from "@/common/constants.js";
import { deepClone, getStatusItem, Util } from "@/common/util";
import detailComp from "./detailComp.vue"; import detailComp from "./detailComp.vue";
import { Util, deepClone, getStatusItem } from "@/common/util";
export default { export default {
name: "approvalView", name: "ApprovalView",
components: { components: {
detailComp, DetailComp: detailComp,
},
props: {
detailVisible: {
type: Boolean,
default: false,
},
id: {
type: Number || String,
default: "",
},
isEdit: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
...@@ -203,23 +235,9 @@ export default { ...@@ -203,23 +235,9 @@ export default {
interviewResultOpt, interviewResultOpt,
processResultOpt, processResultOpt,
}, },
isConfirm: false,
}; };
}, },
props: {
detailVisible: {
type: Boolean,
default: false,
},
id: {
type: Number || String,
default: "",
},
isEdit: {
type: Boolean,
default: false,
},
},
computed: { computed: {
visible: { visible: {
get() { get() {
...@@ -228,6 +246,7 @@ export default { ...@@ -228,6 +246,7 @@ export default {
set(newVal) { set(newVal) {
this.$emit("dialogClose", { this.$emit("dialogClose", {
isConfirm: this.isConfirm,
flag: newVal, flag: newVal,
attrName: "detailVisible", attrName: "detailVisible",
}); });
...@@ -264,11 +283,12 @@ export default { ...@@ -264,11 +283,12 @@ export default {
approveAttachments: this.detailInfo.editAttachmentImgs.length approveAttachments: this.detailInfo.editAttachmentImgs.length
? this.detailInfo.editAttachmentImgs.join(",") ? this.detailInfo.editAttachmentImgs.join(",")
: "", : "",
} };
submitConfigApprove(params) submitConfigApprove(params)
.then((res) => { .then((res) => {
if (res) { if (res) {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.isConfirm = true;
} }
}) })
.finally((err) => { .finally((err) => {
...@@ -303,16 +323,16 @@ export default { ...@@ -303,16 +323,16 @@ export default {
this.loading = false; this.loading = false;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "approveRemark") this.findAttrIdx("infoData", "approveRemark")
].isHidden = !this.isEdit ? false : true; ].isHidden = !!this.isEdit;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "attachmentImgs") this.findAttrIdx("infoData", "attachmentImgs")
].isHidden = !this.isEdit ? false : true; ].isHidden = !!this.isEdit;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "editApproveRemark") this.findAttrIdx("infoData", "editApproveRemark")
].isHidden = this.isEdit ? false : true; ].isHidden = !this.isEdit;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "editAttachmentImgs") this.findAttrIdx("infoData", "editAttachmentImgs")
].isHidden = this.isEdit ? false : true; ].isHidden = !this.isEdit;
// this.detailInfo = res // this.detailInfo = res
Object.assign(this.detailInfo, res); Object.assign(this.detailInfo, res);
...@@ -347,16 +367,16 @@ export default { ...@@ -347,16 +367,16 @@ export default {
this.loading = false; this.loading = false;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "approveRemark") this.findAttrIdx("infoData", "approveRemark")
].isHidden = !this.isEdit ? false : true; ].isHidden = !!this.isEdit;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "attachmentImgs") this.findAttrIdx("infoData", "attachmentImgs")
].isHidden = !this.isEdit ? false : true; ].isHidden = !!this.isEdit;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "editApproveRemark") this.findAttrIdx("infoData", "editApproveRemark")
].isHidden = this.isEdit ? false : true; ].isHidden = !this.isEdit;
this.configData[0].infoData[ this.configData[0].infoData[
this.findAttrIdx("infoData", "editAttachmentImgs") this.findAttrIdx("infoData", "editAttachmentImgs")
].isHidden = this.isEdit ? false : true; ].isHidden = !this.isEdit;
this.detailInfo = res; this.detailInfo = res;
// console.log(this.detailInfo, "this.detailInfo") // console.log(this.detailInfo, "this.detailInfo")
...@@ -401,7 +421,7 @@ export default { ...@@ -401,7 +421,7 @@ export default {
return result; return result;
}, },
findAttrIdx(formName, name) { findAttrIdx(formName, name) {
var index = this.configData[0][formName].findIndex( let index = this.configData[0][formName].findIndex(
(k) => k.key == name (k) => k.key == name
); );
return index || 0; return index || 0;
...@@ -422,6 +442,7 @@ export default { ...@@ -422,6 +442,7 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./detail.scss"; @import "./detail.scss";
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
...@@ -501,6 +522,7 @@ export default { ...@@ -501,6 +522,7 @@ export default {
border-radius: 4px; border-radius: 4px;
border: 1px solid #00000026; border: 1px solid #00000026;
padding: 3px 8px; padding: 3px 8px;
margin-bottom: 8px;
} }
} }
} }
......
...@@ -4,55 +4,76 @@ ...@@ -4,55 +4,76 @@
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<span> <span>
<el-button type="primary" size="small" @click="handleAdd" <el-button size="small" type="primary" @click="handleAdd">
>新增提成方案</el-button 新增提成方案
> </el-button>
</span> </span>
</d2-table-header> </d2-table-header>
<d2-table <d2-table
ref="commissionTable" ref="commissionTable"
:get-list-api="getListApi"
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi"
> >
<!-- 状态 --> <!-- 状态 -->
<div slot="statusHtml" slot-scope="scope"> <template #statusHtml="scope">
<div>
<div <div
v-if="
scope.scope.status === 0 || scope.scope.status
"
class="online-status" class="online-status"
v-if="scope.scope.status === 0 || scope.scope.status"
> >
<span <span
class="dot" class="dot"
:style="{ :style="{
background: getStatusColor( background: getStatusColor(
scope && scope.scope && scope.scope.status, scope &&
scope.scope &&
scope.scope.status,
'statusTypeOptMap' 'statusTypeOptMap'
) ),
}" }"
></span> >
{{ getStatusItem(baseData, "statusList", scope.scope, "status") }} </span>
{{
getStatusItem(
baseData,
"statusList",
scope.scope,
"status"
)
}}
</div> </div>
<span v-else>-</span> <span v-else>-</span>
</div> </div>
<div slot="auth-button" slot-scope="scope"> </template>
<el-button type="text" @click="handleParameter(scope.scope)" <template #auth-button="scope">
>调整参数</el-button <div>
<el-button
type="text"
@click="handleParameter(scope.scope)"
> >
调整参数
</el-button>
</div> </div>
</template>
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { Util, deepClone, getStatusItem, getStatusColor } from "@/common/util" import { getConfigList } from "@api/salaryManagement";
import { getConfigList } from "@api/salaryManagement"
import { import {
outputValue_businessOpt, outputValue_businessOpt,
statusList, statusList,
statusTypeOptMap statusTypeOptMap,
} from "@/common/constants" } from "@/common/constants";
import { deepClone, getStatusColor, getStatusItem, Util } from "@/common/util";
export default { export default {
name: "commissionPlanList", name: "CommissionPlanList",
data() { data() {
return { return {
getStatusColor, getStatusColor,
...@@ -61,12 +82,12 @@ export default { ...@@ -61,12 +82,12 @@ export default {
tableParams: { tableParams: {
listName: "list", listName: "list",
tableOption: { tableOption: {
width: "100" width: "100",
}, },
tableColumns: [ tableColumns: [
{ {
label: "提成方案名称", label: "提成方案名称",
prop: "schemeName" prop: "schemeName",
}, },
{ {
label: "业务", label: "业务",
...@@ -77,8 +98,8 @@ export default { ...@@ -77,8 +98,8 @@ export default {
"businessTypeOpt", "businessTypeOpt",
cellValue, cellValue,
"businessType" "businessType"
) );
} },
}, },
{ {
label: "应用门店数", label: "应用门店数",
...@@ -86,25 +107,26 @@ export default { ...@@ -86,25 +107,26 @@ export default {
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.applicationQuantity || return cellValue.applicationQuantity ||
cellValue.applicationQuantity === 0 cellValue.applicationQuantity === 0
? cellValue.applicationQuantity + "家" ? `${cellValue.applicationQuantity}家`
: "-" : "-";
} },
}, },
{ {
label: "状态", label: "状态",
prop: "status", prop: "status",
minWidth: 120, minWidth: 120,
addHtml: "statusHtml" addHtml: "statusHtml",
}, },
{ {
label: "生效月份", label: "生效月份",
prop: "effectiveMonth", prop: "effectiveMonth",
formatter: (cellValue) => { formatter: (cellValue) => {
// 生效月份(格式:yyyy-MM)转成2026年1月 // 生效月份(格式:yyyy-MM)转成2026年1月
if (!cellValue.effectiveMonth) return "-" if (!cellValue.effectiveMonth) return "-";
const [year, month] = cellValue.effectiveMonth.split("-") const [year, month] =
return `${year}年${parseInt(month)}月` cellValue.effectiveMonth.split("-");
} return `${year}年${Number.parseInt(month)}月`;
},
}, },
{ {
label: "更新时间", label: "更新时间",
...@@ -113,67 +135,64 @@ export default { ...@@ -113,67 +135,64 @@ export default {
return Util.dateFormate( return Util.dateFormate(
cellValue.updatedDate, cellValue.updatedDate,
"YYYY-MM-DD HH:mm:ss" "YYYY-MM-DD HH:mm:ss"
) );
} },
} },
] ],
}, },
baseData: { baseData: {
businessTypeOpt: [ businessTypeOpt: [
{ {
confId: 2, confId: 2,
confValue: "单延保" confValue: "单延保",
}, },
{ {
confId: 1, confId: 1,
confValue: "广联权益" confValue: "广联权益",
}, },
{ {
confId: 0, confId: 0,
confValue: "轻改" confValue: "轻改",
} },
], ],
statusList: deepClone(statusList), statusList: [
statusTypeOptMap: deepClone(statusTypeOptMap) { confId: 2, confValue: "生效" },
{ confId: 1, confValue: "审批中" },
{ confId: 0, confValue: "草稿" },
{ confId: 3, confValue: "未生效" },
],
statusTypeOptMap: deepClone(statusTypeOptMap),
}, },
searchFormSearch: {} searchFormSearch: {},
} };
}, },
mounted() {}, mounted() {},
methods: { methods: {
handleSearch() { handleSearch() {
this.page = this.$options.data.call(this).page this.page = this.$options.data.call(this).page;
this.$refs.commissionTable.refreshTable(true, true) this.$refs.commissionTable.refreshTable(true, true);
}, },
// 新增提成方案 // 新增提成方案
handleAdd() { handleAdd() {
const params = JSON.stringify({
page: 'commissionPlanList'
})
this.$router.push({ this.$router.push({
name: 'performanceScheme', // 提成方案
query: { path: "/configureCommissionPlan",
params });
}
})
}, },
//调整参数 // 调整参数
handleParameter(data) { handleParameter(data) {
const params = JSON.stringify({
page: 'commissionPlanList',
id: data.id
})
this.$router.push({ this.$router.push({
name: 'performanceScheme', path: "/configureCommissionPlan",
query: { query: {
params id: data.id,
}
})
}, },
} });
} },
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.month-class { .month-class {
width: 100% !important; width: 100% !important;
......
...@@ -119,7 +119,13 @@ export default { ...@@ -119,7 +119,13 @@ export default {
storeIdList: [], storeIdList: [],
statusTypeOptMap: deepClone(statusTypeOptMap), statusTypeOptMap: deepClone(statusTypeOptMap),
businessTypeOpts: deepClone(outputValue_businessOpt), businessTypeOpts: deepClone(outputValue_businessOpt),
statusList: deepClone(statusList) statusList: deepClone(statusList),
// approveStatusOpt:[
// { confId: 2, confValue: "生效" },
// { confId: 1, confValue: "审批中" },
// { confId: 0, confValue: "草稿" },
// { confId: 3, confValue: "未生效" }
// ]
} }
} }
}, },
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
> >
<template slot="merchantNames" slot-scope="scope">
{{scope.scope.merchantNames||'-'}} {{scope.scope.merchantId}}
</template>
<template slot="brandNames" slot-scope="scope"> <template slot="brandNames" slot-scope="scope">
<template <template
v-if="scope.scope.brandNames && scope.scope.brandNames.length > 20" v-if="scope.scope.brandNames && scope.scope.brandNames.length > 20"
...@@ -73,7 +76,8 @@ export default { ...@@ -73,7 +76,8 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: "门店名称", label: "门店名称",
prop: "merchantNames" prop: "merchantNames",
addHtml: "merchantNames"
}, },
{ {
label: "品牌", label: "品牌",
...@@ -158,16 +162,13 @@ export default { ...@@ -158,16 +162,13 @@ export default {
}, },
// 编辑方案 // 编辑方案
handleToEdit(row) { handleToEdit(row) {
const params = JSON.stringify({ console.log(row);
page: 'performanceList',
id: row.id
})
this.$router.push({ this.$router.push({
name: "performanceScheme", path: "/configureStoreCommissionPlan",
query: { query: {
params id: row.merchantId,
} },
}) });
} }
} }
} }
......
<template> <template>
<div> <div>
<el-form-item label="适配业务:" prop="businessType" > <el-form-item label="适配业务:" prop="businessType">
<el-radio-group v-model="businessType"> <el-radio-group v-model="businessType" @change="handleChangeBusinessType">
<el-radio label="0"> <el-radio :disabled="!businessTypes.includes(0)" :label="0">
轻改 轻改
</el-radio> </el-radio>
<el-radio label="1"> <el-radio :disabled="!businessTypes.includes(1)" :label="1">
延保 延保
</el-radio> </el-radio>
<el-radio label="2"> <el-radio :disabled="!businessTypes.includes(2)" :label="2">
权益 权益
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="品牌:"
prop="businessType">
<el-radio-group v-model="businessType" @change="handleChangeBusinessType">
<el-radio v-for="item in brandMerchant"
:key="item.businessType"
:label="item.businessType">
{{ item.childBrandNames }}
</el-radio>
</el-radio-group>
</el-form-item>
</div> </div>
</template> </template>
...@@ -22,25 +32,43 @@ import { bindFormFields } from "../../store/helper"; ...@@ -22,25 +32,43 @@ import { bindFormFields } from "../../store/helper";
export default { export default {
name: "", name: "",
props: { props: {
brandMerchant: {
type: Array,
require: true,
},
}, },
data() { data() {
return { return {
businessType: undefined,
}; };
}, },
computed: { computed: {
businessType: bindFormFields("businessType"), businessTypes() {
return this.brandMerchant.map(item => item.businessType);
}, },
mounted() { brandList() {
return this.brandMerchant.map(item => item.childBrandNames);
},
},
async mounted() {
setTimeout(() => {
if (this.brandMerchant[0]?.businessType) {
this.businessType = this.brandMerchant[0].businessType;
this.handleChangeBusinessType(this.businessType);
}
}, 300);
}, },
methods: { methods: {
handleChangeBusinessType(e) {
const item = this.brandMerchant.find(item => item.businessType === e);
if (item) {
this.$emit("changeBusiness", item);
}
},
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>
<template> <template>
<div class=""> <div class="">
<el-cascader :options="goodsCategory" <el-cascader
clearable
:options="visible ? computedGoodsCategory : goodsCategory"
placeholder="请选择商品品类" placeholder="请选择商品品类"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }" :props="{
checkStrictly: true,
label: 'categoryName',
value: 'categoryType',
}"
:show-all-levels="false" :show-all-levels="false"
:value="value" :value="value"
@change="handleProductChange"> @change="handleProductChange"
@visible-change="handleVisibleChange"
>
</el-cascader> </el-cascader>
</div> </div>
</template> </template>
...@@ -14,30 +22,311 @@ ...@@ -14,30 +22,311 @@
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
name: "", name: "GoodsCategoryCascader",
props: { props: {
value: { value: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
/**
* Config Index in formData.paramConfigList
* Used to isolate the scope of disabled checks to the current assessment factor table.
*/
configIndex: {
type: Number,
default: undefined,
},
/**
* Index of the current item in the list (ParamsType1Products or ParamsType2)
* Used to identify "self" to avoid filtering out other identical selections.
*/
index: {
type: Number,
default: undefined,
},
/**
* Whether to allow duplicate selections.
* true: Allows duplicate selections within the same table, but still prevents containment relationships.
* false: Globally unique within the table (no duplicates, no containment).
*/
allowRepeat: {
type: Boolean,
default: false,
},
/**
* Value of the "All" option.
* If this value is encountered, it is treated as containing everything.
*/
allValue: {
type: [String, Number],
default: -1,
},
/**
* Path to the value in the item object.
* Supports dot notation for nested paths (e.g., "conditionType4.productValue").
*/
valuePath: {
type: String,
default: "productLabel",
},
/**
* List of all value paths to check for conflicts in the same row.
* If not provided, defaults to [valuePath].
*/
conflictPaths: {
type: Array,
default: () => [],
},
}, },
data() { data() {
return { return {
visible: false,
}; };
}, },
computed: { computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList", "commissionTypesOptions", "goodsCategory"]), ...mapState("PerformanceFormStore", [
"formData",
"productDefineList",
"commissionTypesOptions",
"goodsCategory",
]),
occupiedPaths() {
const paths = [];
// Determine the scope: specific config (if index provided) or all configs
let targetConfigs = [];
// We need to know the original index of the config to compare with this.configIndex
let targetConfigIndices = [];
if (this.configIndex !== undefined && this.configIndex !== null) {
const config = this.formData.paramConfigList[this.configIndex];
if (config) {
targetConfigs = [config];
targetConfigIndices = [this.configIndex];
}
} else {
targetConfigs = this.formData.paramConfigList || [];
targetConfigIndices = targetConfigs.map((_, i) => i);
}
targetConfigs.forEach((config, i) => {
const actualConfigIndex = targetConfigIndices[i];
const isCurrentConfig = actualConfigIndex === this.configIndex;
// Determine check paths
const pathsToCheck =
this.conflictPaths && this.conflictPaths.length > 0
? this.conflictPaths
: [this.valuePath];
// Type 1
if (
config.ParamsType1Products &&
Array.isArray(config.ParamsType1Products)
) {
const isActiveList = config.templateType === "ParamsType1";
config.ParamsType1Products.forEach((item, itemIdx) => {
pathsToCheck.forEach((path) => {
// Skip self: matches both index and path
if (
isCurrentConfig &&
isActiveList &&
itemIdx === this.index &&
path === this.valuePath
) {
return;
}
const val = this.getValueByPath(item, path);
if (Array.isArray(val) && val.length > 0) {
paths.push(val);
}
});
});
}
// Type 2
if (config.ParamsType2 && Array.isArray(config.ParamsType2)) {
const isActiveList = config.templateType === "ParamsType2";
config.ParamsType2.forEach((item, itemIdx) => {
pathsToCheck.forEach((path) => {
// Skip self: matches both index and path
if (
isCurrentConfig &&
isActiveList &&
itemIdx === this.index &&
path === this.valuePath
) {
return;
}
const val = this.getValueByPath(item, path);
if (Array.isArray(val) && val.length > 0) {
paths.push(val);
}
});
});
}
});
// If index prop is NOT provided (backward compatibility), fallback to value filtering
if (this.index === undefined || this.index === null) {
const currentPath = this.value || [];
return paths.filter((p) => {
if (p.length !== currentPath.length) return true;
for (let i = 0; i < p.length; i++) {
if (p[i] != currentPath[i]) return true;
}
return false;
});
}
return paths;
}, },
mounted() {
computedGoodsCategory() {
// Fast path: if no goods category data, return empty
if (!this.goodsCategory || !this.goodsCategory.length) return [];
const occupiedPaths = this.occupiedPaths;
const allValue = this.allValue;
const myValue = this.value || [];
// Check if I have selected "All" (Local Lock)
// We use loose equality for value check
const iHaveAll = myValue.length === 1 && myValue[0] == allValue;
// Check if I have selected something else (Local Lock)
const iHaveOthers = myValue.length > 0 && !iHaveAll;
// Check if "All" is selected by anyone else (Global Lock)
const hasAllSelectedByOthers = occupiedPaths.some(
(path) => path.length === 1 && path[0] == allValue
);
const process = (nodes, parentPath) => {
return nodes.map((node) => {
// Build path for current node
const currentPath = parentPath
? [...parentPath, node.categoryType]
: [node.categoryType];
// Check if this node is "All" (loose equality)
const isAllNode = node.categoryType == allValue;
let isDisabled = false;
if (isAllNode) {
// Logic for "All" Node
// 1. If I have selected "Others", "All" is disabled (Must clear others first)
if (iHaveOthers) {
isDisabled = true;
}
// 2. If others have selected "All", check allowRepeat
else if (hasAllSelectedByOthers) {
isDisabled = !this.allowRepeat;
}
// 3. If any other items are occupied (by others), "All" is disabled (Containment)
// Note: We check if occupiedPaths contains ANY non-All items.
// Actually, if occupiedPaths has ANY items (and we handled "All" above),
// it means there's a conflict because "All" contains everything.
// But we need to be careful: if occupiedPaths only contains "All", we handled it in step 2.
// So we check if occupiedPaths has items that are NOT "All".
else {
const hasOthersOccupied = occupiedPaths.some(
(path) =>
!(path.length === 1 && path[0] == allValue)
);
if (hasOthersOccupied) {
isDisabled = true;
}
}
} else {
// Logic for "Other" Nodes
// 1. If I have selected "All", "Others" are disabled (Must clear All first)
if (iHaveAll) {
isDisabled = true;
}
// 2. If others have selected "All", "Others" are disabled (Containment)
else if (hasAllSelectedByOthers) {
isDisabled = true;
}
// 3. Standard containment check against occupiedPaths
else {
isDisabled = occupiedPaths.some((occupied) => {
const len = Math.min(
currentPath.length,
occupied.length
);
// Check for prefix match
let isPrefixMatch = true;
for (let i = 0; i < len; i++) {
if (currentPath[i] != occupied[i]) {
isPrefixMatch = false;
break;
}
}
if (isPrefixMatch) {
// If strict containment (lengths differ) -> Parent/Child conflict -> Always Disabled
if (
currentPath.length !== occupied.length
) {
return true;
}
// If exact match (lengths same) -> Duplicate -> Check allowRepeat
return !this.allowRepeat;
}
return false;
});
}
}
const newNode = {
...node,
disabled: isDisabled,
};
if (newNode.children && newNode.children.length > 0) {
newNode.children = process(
newNode.children,
currentPath
);
}
return newNode;
});
};
return process(this.goodsCategory, null);
},
}, },
mounted() {},
methods: { methods: {
getValueByPath(obj, path) {
if (!obj || !path) return undefined;
const keys = path.split(".");
let result = obj;
for (const key of keys) {
if (result === null || result === undefined) return undefined;
result = result[key];
}
return result;
},
handleProductChange(value) { handleProductChange(value) {
this.$emit("input", value); this.$emit("input", value);
this.$emit("change", value); this.$emit("change", value);
}, },
handleVisibleChange(isVisible) {
this.visible = isVisible;
},
}, },
}; };
</script> </script>
.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;
padding-right: 10px;
.el-input {
min-width: 80px;
}
.el-input-number {
min-width: 80px;
}
.el-input_showing {
min-width: 80px;
}
.tag {
margin: 0 6px;
}
}
td {
padding-top: 10px !important;
padding-bottom: 10px !important;
}
.tag {
margin: 0 2px;
}
}
.el-input {
width: 140px;
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
.el-input-number {
width: 140px;
height: 32px;
line-height: 32px;
}
.el-input_showing {
width: 140px;
height: 32px;
line-height: 30px;
}
}
}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<el-radio label="ParamsType1"> <el-radio label="ParamsType1">
适配通用配置 适配通用配置
</el-radio> </el-radio>
<el-radio label="ParamsType2"> <el-radio v-if="[3, 4].includes(curParamsAssessFactorValue)" label="ParamsType2">
适配渗透率配置 适配渗透率配置
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
...@@ -31,12 +31,11 @@ ...@@ -31,12 +31,11 @@
<div class="table-wrapper"> <div class="table-wrapper">
<component :is="curParamsConfig.templateType" :config-index="configIndex"></component> <component :is="curParamsConfig.templateType" :config-index="configIndex"></component>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { last } from "lodash-es"; import { isObject, last } from "lodash-es";
import { mapState } from "vuex"; import { mapState } from "vuex";
import { paramConfigListTemplate } from "../performanceRuleSelection/options.js"; import { paramConfigListTemplate } from "../performanceRuleSelection/options.js";
import ParamsType1 from "./type1.vue"; import ParamsType1 from "./type1.vue";
...@@ -62,12 +61,19 @@ export default { ...@@ -62,12 +61,19 @@ export default {
...mapState("PerformanceFormStore", ["formData"]), ...mapState("PerformanceFormStore", ["formData"]),
curParamsConfig: { curParamsConfig: {
get() { get() {
console.log("this.formData.paramConfigList[this.configIndex]", this.formData.paramConfigList[this.configIndex]);
return this.formData.paramConfigList[this.configIndex]; return this.formData.paramConfigList[this.configIndex];
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex] = value; this.formData.paramConfigList[this.configIndex] = value;
}, },
}, },
curParamsAssessFactorValue() {
if (isObject(this.curParamsConfig.assessmentFactor)) {
return this.curParamsConfig.assessmentFactor?.value;
}
return this.curParamsConfig.assessmentFactor;
},
}, },
mounted() { mounted() {
...@@ -90,10 +96,29 @@ export default { ...@@ -90,10 +96,29 @@ export default {
handleAppendTableRow() { handleAppendTableRow() {
const templateType = this.curParamsConfig.templateType; const templateType = this.curParamsConfig.templateType;
// 检查现有数据,确保没有初始值或结束值为空的行
const existingRows = this.curParamsConfig[templateType] || [];
for (let i = 0; i < existingRows.length; i++) {
const row = existingRows[i];
const priceRange = row?.priceRange || [];
const startValue = priceRange[0];
const endValue = priceRange[1];
// 检查初始值或结束值是否为空(undefined、null、空字符串)
if (startValue === undefined || startValue === null || startValue === "") {
this.$message.warning("存在初始值为空的行,请先完善数据后再新增");
return;
}
if (endValue === undefined || endValue === null || endValue === "") {
this.$message.warning("存在结束值为空的行,请先完善数据后再新增");
return;
}
}
const lastPriceRange = last(this.curParamsConfig[templateType])?.priceRange || [0, 0]; const lastPriceRange = last(this.curParamsConfig[templateType])?.priceRange || [0, 0];
const nPriceRange = [undefined, undefined]; const nPriceRange = [undefined, undefined];
if (lastPriceRange && lastPriceRange[1]) { if (lastPriceRange && lastPriceRange[1]) {
nPriceRange[0] = lastPriceRange[1] + (this.curParamsConfig.priceRangeProps.precision ? 1 : 0.01); nPriceRange[0] = lastPriceRange[1] + 0.01;
nPriceRange[1] = undefined; nPriceRange[1] = undefined;
} }
this.curParamsConfig[templateType].push({ this.curParamsConfig[templateType].push({
......
...@@ -99,6 +99,7 @@ export default { ...@@ -99,6 +99,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.param-config-type-2-condition-type { .param-config-type-2-condition-type {
padding-left: 10px;
> span.label { > span.label {
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
......
<template> <template>
<span class="param-config-type-2-condition-type"> <span class="param-config-type-2-condition-type">
<EditableText v-model="triggerCondition" <EditableText
v-model="triggerCondition"
:controls="false" :controls="false"
type="number" type="number"
v-bind="getComponentsProp"> v-bind="getComponentsProp"
>
</EditableText> </EditableText>
<span class="label"> <span class="label"> 且 </span>
且 <GoodsCategoryCascader
</span> v-if="goodsCategory === 0"
<span class="label"> :config-index="configIndex"
整体增加指标达成奖励 :index="row"
</span> :value-path="'conditionType3.productValue'"
<EditableText v-model="increaseReward" allowRepeat
v-model="productValue"
@change="handleProductChange"
/>
<!-- 圈定套餐/商品 cascader -->
<ProductDefineCascader
v-else
v-model="productValue"
:index="row"
:value-path="'conditionType3.productValue'"
:config-index="configIndex"
:allow-repeat="true"
@change="handleProductChange"
/>
<span class="label"> 整体增加指标达成奖励 </span>
<EditableText
v-model="increaseReward"
:controls="false" :controls="false"
:max="999999" :max="999999"
:min="0" :min="0"
:precision="2" :precision="2"
type="number"> type="number"
>
</EditableText> </EditableText>
<span class="label"> <span class="label"> 元 </span>
元
</span>
</span> </span>
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapGetters, mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue"; import EditableText from "@/components/editableText/index.vue";
import { commissionTypeEnum } from "../../performanceRuleSelection/options"; import { commissionTypeEnum } from "../../performanceRuleSelection/options";
import GoodsCategoryCascader from "../../goodsCategoryCascader/index.vue";
import ProductDefineCascader from "../../prodectDefine/index.vue";
export default { export default {
name: "", name: "",
components: { components: {
EditableText, EditableText,
GoodsCategoryCascader,
ProductDefineCascader,
}, },
props: { props: {
configIndex: { configIndex: {
...@@ -43,70 +63,85 @@ export default { ...@@ -43,70 +63,85 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
}, },
data() { data() {
return { return {};
};
}, },
computed: { computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList"]), ...mapState("PerformanceFormStore", ["formData", "productDefineList"]),
// 商品选择项 ...mapGetters("PerformanceFormStore", ["getProductDefineListOptions"]),
getProductDefineListOptions() {
return this.productDefineList;
},
// 路径太长 简化 // 路径太长 简化
paramsType2CommissionTypes() { paramsType2CommissionTypes() {
return this.formData.paramConfigList[this.configIndex].ParamsType2CommissionTypes; return this.formData.paramConfigList[this.configIndex]
.ParamsType2CommissionTypes;
}, },
// 提成方式 的值 决定 的 组件传参 // 提成方式 的值 决定 的 组件传参
getComponentsProp() { getComponentsProp() {
return this.paramsType2CommissionTypes ? commissionTypeEnum[this.paramsType2CommissionTypes].componentProps : {}; return this.paramsType2CommissionTypes
? commissionTypeEnum[this.paramsType2CommissionTypes]
.componentProps
: {};
},
goodsCategory: {
get() {
return this.formData.paramConfigList[this.configIndex]
.goodsCategory;
},
set(value) {
this.formData.paramConfigList[this.configIndex].goodsCategory =
value;
},
}, },
triggerCondition: { triggerCondition: {
get() { get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.triggerCondition; return this.formData.paramConfigList[this.configIndex]
.ParamsType2[this.row].conditionType3.triggerCondition;
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.triggerCondition = value; this.formData.paramConfigList[this.configIndex].ParamsType2[
this.row
].conditionType3.triggerCondition = value;
}, },
}, },
productLabel: { productLabel: {
get() { get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productLabel; return this.formData.paramConfigList[this.configIndex]
.ParamsType2[this.row].conditionType3.productLabel;
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productLabel = value; this.formData.paramConfigList[this.configIndex].ParamsType2[
this.row
].conditionType3.productLabel = value;
}, },
}, },
productValue: { productValue: {
get() { get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productValue; return this.formData.paramConfigList[this.configIndex]
.ParamsType2[this.row].conditionType3.productValue;
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.productValue = value; this.formData.paramConfigList[this.configIndex].ParamsType2[
this.row
].conditionType3.productValue = value;
}, },
}, },
increaseReward: { increaseReward: {
get() { get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.increaseReward; return this.formData.paramConfigList[this.configIndex]
.ParamsType2[this.row].conditionType3.increaseReward;
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType3.increaseReward = value; this.formData.paramConfigList[this.configIndex].ParamsType2[
this.row
].conditionType3.increaseReward = value;
}, },
}, },
}, },
mounted() { mounted() {},
},
methods: { methods: {
// TODO: 商品切换 // TODO: 商品切换
handleProductChange() { handleProductChange() {},
},
}, },
}; };
</script> </script>
...@@ -114,9 +149,9 @@ export default { ...@@ -114,9 +149,9 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.param-config-type-2-condition-type { .param-config-type-2-condition-type {
// overflow-x: auto; // overflow-x: auto;
// display: flex; display: flex;
// flex-wrap: nowrap; // flex-wrap: nowrap;
// align-items: center; align-items: center;
> span.label { > span.label {
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
......
<template> <template>
<span class="param-config-type-2-condition-type"> <span class="param-config-type-2-condition-type">
<EditableText v-model="triggerCondition" <EditableText
v-model="triggerCondition"
:controls="false" :controls="false"
type="number" type="number"
v-bind="getComponentsProp"> v-bind="getComponentsProp"
>
</EditableText> </EditableText>
<span class="label"> <span class="label"> 且 </span>
且 <!-- 品类cascader -->
</span> <GoodsCategoryCascader
<span class="label"> v-if="goodsCategory === 0"
提出 :config-index="configIndex"
</span> :index="row"
<el-cascader v-model="productValue" :value-path="'conditionType4.productValue'"
:options="getProductDefineListOptions" :conflict-paths="[
:show-all-levels="false" 'conditionType4.productValue',
@change="handleProductChange"> 'conditionType4.productValue1',
</el-cascader> ]"
<span class="label"> allowRepeat
的订单计算提出 v-model="productValue"
</span> @change="handleProductChange"
/>
<!-- 圈定套餐/商品 cascader -->
<ProductDefineCascader
v-else
v-model="productValue"
:index="row"
:value-path="'conditionType4.productValue'"
:conflict-paths="[
'conditionType4.productValue',
'conditionType4.productValue1',
]"
:config-index="configIndex"
:allow-repeat="true"
@change="handleProductChange"
/>
<span class="label"> 剔除 </span>
<GoodsCategoryCascader
v-if="goodsCategory === 0"
:config-index="configIndex"
:index="row"
:value-path="'conditionType4.productValue1'"
:conflict-paths="[
'conditionType4.productValue',
'conditionType4.productValue1',
]"
allowRepeat
v-model="productValue1"
@change="handleProductChange"
/>
<!-- 圈定套餐/商品 cascader -->
<ProductDefineCascader
v-else
v-model="productValue1"
:index="row"
:value-path="'conditionType4.productValue1'"
:conflict-paths="[
'conditionType4.productValue',
'conditionType4.productValue1',
]"
:config-index="configIndex"
:allow-repeat="true"
@change="handleProductChange"
/>
<span class="label"> 的订单计算提成 </span>
</span> </span>
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapGetters, mapState } from "vuex";
import EditableText from "@/components/editableText/index.vue"; import EditableText from "@/components/editableText/index.vue";
import { commissionTypeEnum } from "../../performanceRuleSelection/options"; import { commissionTypeEnum } from "../../performanceRuleSelection/options";
import GoodsCategoryCascader from "../../goodsCategoryCascader/index.vue";
import ProductDefineCascader from "../../prodectDefine/index.vue";
export default { export default {
name: "", name: "",
components: { components: {
EditableText, EditableText,
GoodsCategoryCascader,
ProductDefineCascader,
}, },
props: { props: {
configIndex: { configIndex: {
...@@ -41,61 +91,73 @@ export default { ...@@ -41,61 +91,73 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
}, },
data() { data() {
return { return {};
};
}, },
computed: { computed: {
...mapState("PerformanceFormStore", ["formData", "productDefineList"]), ...mapState("PerformanceFormStore", ["formData", "productDefineList"]),
// 商品选择项 ...mapGetters("PerformanceFormStore", ["getProductDefineListOptions"]),
getProductDefineListOptions() {
return this.productDefineList;
},
// 路径太长 简化 // 路径太长 简化
paramsType2CommissionTypes() { paramsType2CommissionTypes() {
return this.formData.paramConfigList[this.configIndex].ParamsType2CommissionTypes; return this.formData.paramConfigList[this.configIndex]
.ParamsType2CommissionTypes;
}, },
// 提成方式 的值 决定 的 组件传参 // 提成方式 的值 决定 的 组件传参
getComponentsProp() { getComponentsProp() {
return this.paramsType2CommissionTypes ? commissionTypeEnum[this.paramsType2CommissionTypes].componentProps : {}; return this.paramsType2CommissionTypes
? commissionTypeEnum[this.paramsType2CommissionTypes]
.componentProps
: {};
}, },
triggerCondition: { triggerCondition: {
get() { get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.triggerCondition; return this.formData.paramConfigList[this.configIndex]
.ParamsType2[this.row].conditionType4.triggerCondition;
},
set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[
this.row
].conditionType4.triggerCondition = value;
},
},
goodsCategory: {
get() {
return this.formData.paramConfigList[this.configIndex]
.goodsCategory;
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.triggerCondition = value; this.formData.paramConfigList[this.configIndex].goodsCategory =
value;
}, },
}, },
productValue: { productValue: {
get() { get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue; return this.formData.paramConfigList[this.configIndex]
.ParamsType2[this.row].conditionType4.productValue;
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue = value; this.formData.paramConfigList[this.configIndex].ParamsType2[
this.row
].conditionType4.productValue = value;
}, },
}, },
productValue1: { productValue1: {
get() { get() {
return this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue1; return this.formData.paramConfigList[this.configIndex]
.ParamsType2[this.row].conditionType4.productValue1;
}, },
set(value) { set(value) {
this.formData.paramConfigList[this.configIndex].ParamsType2[this.row].conditionType4.productValue1 = value; this.formData.paramConfigList[this.configIndex].ParamsType2[
this.row
].conditionType4.productValue1 = value;
}, },
}, },
}, },
mounted() { mounted() {},
},
methods: { methods: {
// TODO: 商品切换 // TODO: 商品切换
handleProductChange() { handleProductChange() {},
},
}, },
}; };
</script> </script>
...@@ -103,9 +165,9 @@ export default { ...@@ -103,9 +165,9 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.param-config-type-2-condition-type { .param-config-type-2-condition-type {
// overflow-x: auto; // overflow-x: auto;
// display: flex; display: flex;
// flex-wrap: nowrap; // flex-wrap: nowrap;
// align-items: center; align-items: center;
> span.label { > span.label {
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
......
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
<el-form-item label="商品分类:" <el-form-item label="商品分类:"
prop="goodsConfigTypes"> prop="goodsConfigTypes">
<el-checkbox-group v-model="goodsConfigTypes" <el-checkbox-group v-model="goodsConfigTypes"
class="checkbox-group-product-category "> class="checkbox-group-product-category "
@change="handleGoodsConfigTypesGroupChange">
<el-checkbox label="0"> <el-checkbox label="0">
品类 品类
</el-checkbox> </el-checkbox>
...@@ -65,6 +66,20 @@ ...@@ -65,6 +66,20 @@
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="适配业务:" prop="businessType">
<el-radio-group v-model="businessType" @change="handleBusinessTypeChange">
<el-radio :label="0">
轻改
</el-radio>
<el-radio :label="2">
延保
</el-radio>
<el-radio :label="1">
权益
</el-radio>
</el-radio-group>
</el-form-item>
<DefineProductsDialog v-if="dialog.defineProducts.visible" <DefineProductsDialog v-if="dialog.defineProducts.visible"
:define-visible="dialog.defineProducts.visible" :define-visible="dialog.defineProducts.visible"
@dialogClose="handleDefineProductsDialogClose" /> @dialogClose="handleDefineProductsDialogClose" />
...@@ -102,7 +117,7 @@ export default { ...@@ -102,7 +117,7 @@ export default {
commissionMapping: { commissionMapping: {
GMV: "BL", // GMV产值 <-> 比例 GMV: "BL", // GMV产值 <-> 比例
DDTC: "XS", // 单店总提成 <-> 系数 DDTC: "XS", // 单店总提成 <-> 系数
DDSL: "GDJE", // 升级订单数 <-> 固定金额 SJDDS: "GDJE", // 升级订单数 <-> 固定金额
}, },
}; };
}, },
...@@ -111,16 +126,16 @@ export default { ...@@ -111,16 +126,16 @@ export default {
...mapState("PerformanceFormStore", ["formData"]), ...mapState("PerformanceFormStore", ["formData"]),
assessmentFactorValue: bindFormFields("assessmentFactorValue"), assessmentFactorValue: bindFormFields("assessmentFactorValue"),
assessmentFactor: bindFormFields("assessmentFactor"), assessmentFactor: bindFormFields("assessmentFactor"),
checkList: bindFormFields("checkList"),
commissionBases: bindFormFields("commissionBases"), commissionBases: bindFormFields("commissionBases"),
commissionTypes: bindFormFields("commissionTypes"), commissionTypes: bindFormFields("commissionTypes"),
goodsConfigTypes: bindFormFields("goodsConfigTypes"), goodsConfigTypes: bindFormFields("goodsConfigTypes"),
paramConfigList: bindFormFields("paramConfigList"), paramConfigList: bindFormFields("paramConfigList"),
businessType: bindFormFields("businessType"),
}, },
watch: { watch: {
commissionTypes(newVal) { commissionTypes(newVal) {
// TODO: 还需要清空下方表格所有提成方式的值 // TODO: 还需要清空下方表格所有提成方式的值
// this.setCommissionTypesOptions(newVal); this.setCommissionTypesOptions(newVal);
}, },
}, },
mounted() { mounted() {
...@@ -128,6 +143,15 @@ export default { ...@@ -128,6 +143,15 @@ export default {
methods: { methods: {
...mapMutations("PerformanceFormStore", ["setProductDefineList", "touchAssessment", "setCommissionTypesOptions", "setCommissionBases", "setCommissionTypes"]), ...mapMutations("PerformanceFormStore", ["setProductDefineList", "touchAssessment", "setCommissionTypesOptions", "setCommissionBases", "setCommissionTypes"]),
handleGoodsConfigTypesGroupChange(e) {
if (e.length === 1) {
// TODO: 强力设置表格内的所有goodType
}
// 只验证当前字段
this.validateCurrentField("goodsConfigTypes");
},
/** /**
* 更新关联的复选框 * 更新关联的复选框
* @param {Array} currentValues 当前变化的值 * @param {Array} currentValues 当前变化的值
...@@ -187,6 +211,8 @@ export default { ...@@ -187,6 +211,8 @@ export default {
this.setCommissionTypes(newTypes); this.setCommissionTypes(newTypes);
this.$nextTick(() => { this.$nextTick(() => {
this.isUpdating = false; this.isUpdating = false;
// 只验证当前字段
this.validateCurrentField("commissionBases");
}); });
}, },
...@@ -199,6 +225,8 @@ export default { ...@@ -199,6 +225,8 @@ export default {
this.setCommissionBases(newBases); this.setCommissionBases(newBases);
this.$nextTick(() => { this.$nextTick(() => {
this.isUpdating = false; this.isUpdating = false;
// 只验证当前字段
this.validateCurrentField("commissionTypes");
}); });
}, },
...@@ -206,6 +234,20 @@ export default { ...@@ -206,6 +234,20 @@ export default {
// 根据 value 数组从 assessmentFactorOptions 中找出对应的完整项 // 根据 value 数组从 assessmentFactorOptions 中找出对应的完整项
const selectedItems = this.assessmentFactorOptions.filter(item => value.includes(item.value)); const selectedItems = this.assessmentFactorOptions.filter(item => value.includes(item.value));
this.touchAssessment(selectedItems); this.touchAssessment(selectedItems);
// 只验证当前字段
this.validateCurrentField("assessmentFactorValue");
},
handleBusinessTypeChange() {
// 只验证当前字段
this.validateCurrentField("businessType");
},
// 验证当前字段(只验证单个字段,不触发全表单验证)
validateCurrentField(prop) {
// 通过 $parent 访问父组件的表单引用
const form = this.$parent?.$refs?.form;
if (form && !this.$parent?.shouldValidateAll) {
form.validateField(prop, () => {});
}
}, },
}, },
}; };
......
<template>
<div class="">
<el-cascader
clearable
:options="visible ? computedOptions : getProductDefineListOptions"
placeholder="请选择"
:props="{checkStrictly: true}"
:show-all-levels="false"
:value="value"
@change="handleProductChange"
@visible-change="handleVisibleChange"
>
</el-cascader>
</div>
</template>
<script>
import { mapState, mapGetters } from "vuex";
export default {
name: "ProductDefineCascader",
props: {
value: {
type: Array,
default: () => [],
},
/**
* Config Index in formData.paramConfigList
* Used to isolate the scope of disabled checks to the current assessment factor table.
*/
configIndex: {
type: Number,
default: undefined,
},
/**
* Index of the current item in the list
* Used to identify "self" to avoid filtering out other identical selections.
*/
index: {
type: Number,
default: undefined,
},
/**
* Whether to allow duplicate selections.
*/
allowRepeat: {
type: Boolean,
default: false,
},
/**
* Value of the "All" option.
*/
allValue: {
type: [String, Number],
default: -1,
},
/**
* Custom label/value field names
*/
/**
* Path to the value in the item object.
* Supports dot notation for nested paths (e.g., "conditionType4.productValue").
*/
valuePath: {
type: String,
default: "productLabel",
},
/**
* List of all value paths to check for conflicts in the same row.
* If not provided, defaults to [valuePath].
*/
conflictPaths: {
type: Array,
default: () => [],
},
},
data() {
return {
visible: false,
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "getProductDefineListOptions"]),
...mapGetters("PerformanceFormStore", ["getProductDefineListOptions"]),
occupiedPaths() {
const paths = [];
// Determine the scope: specific config (if index provided) or all configs
let targetConfigs = [];
let targetConfigIndices = [];
if (this.configIndex !== undefined && this.configIndex !== null) {
const config = this.formData.paramConfigList[this.configIndex];
if (config) {
targetConfigs = [config];
targetConfigIndices = [this.configIndex];
}
} else {
targetConfigs = this.formData.paramConfigList || [];
targetConfigIndices = targetConfigs.map((_, i) => i);
}
targetConfigs.forEach((config, i) => {
const actualConfigIndex = targetConfigIndices[i];
const isCurrentConfig = actualConfigIndex === this.configIndex;
// Determine check paths
const pathsToCheck =
this.conflictPaths && this.conflictPaths.length > 0
? this.conflictPaths
: [this.valuePath];
// Type 1
if (
config.ParamsType1Products &&
Array.isArray(config.ParamsType1Products)
) {
const isActiveList = config.templateType === "ParamsType1";
config.ParamsType1Products.forEach((item, itemIdx) => {
pathsToCheck.forEach((path) => {
// Skip self
if (
isCurrentConfig &&
isActiveList &&
itemIdx === this.index &&
path === this.valuePath
) {
return;
}
const val = this.getValueByPath(item, path);
if (Array.isArray(val) && val.length > 0) {
paths.push(val);
}
});
});
}
// Type 2
if (config.ParamsType2 && Array.isArray(config.ParamsType2)) {
const isActiveList = config.templateType === "ParamsType2";
config.ParamsType2.forEach((item, itemIdx) => {
pathsToCheck.forEach((path) => {
// Skip self
if (
isCurrentConfig &&
isActiveList &&
itemIdx === this.index &&
path === this.valuePath
) {
return;
}
const val = this.getValueByPath(item, path);
if (Array.isArray(val) && val.length > 0) {
paths.push(val);
}
});
});
}
});
// Fallback for backward compatibility
if (this.index === undefined || this.index === null) {
const currentPath = this.value || [];
return paths.filter((p) => {
if (p.length !== currentPath.length) return true;
for (let i = 0; i < p.length; i++) {
if (p[i] != currentPath[i]) return true;
}
return false;
});
}
return paths;
},
computedOptions() {
if (!this.getProductDefineListOptions || !this.getProductDefineListOptions.length)
return [];
const occupiedPaths = this.occupiedPaths;
const allValue = this.allValue;
const myValue = this.value || [];
const valueField = "value";
const childrenField = "children";
// Check if I have selected "All" (Local Lock)
const iHaveAll = myValue.length === 1 && myValue[0] == allValue;
// Check if I have selected something else (Local Lock)
const iHaveOthers = myValue.length > 0 && !iHaveAll;
// Check if "All" is selected by anyone else (Global Lock)
const hasAllSelectedByOthers = occupiedPaths.some(
(path) => path.length === 1 && path[0] == allValue
);
const process = (nodes, parentPath) => {
return nodes.map((node) => {
const nodeValue = node[valueField];
// Build path for current node
const currentPath = parentPath
? [...parentPath, nodeValue]
: [nodeValue];
// Check if this node is "All" (loose equality)
const isAllNode = nodeValue == allValue;
let isDisabled = false;
if (isAllNode) {
// Logic for "All" Node
if (iHaveOthers) {
isDisabled = true;
} else if (hasAllSelectedByOthers) {
isDisabled = !this.allowRepeat;
} else {
const hasOthersOccupied = occupiedPaths.some(
(path) =>
!(path.length === 1 && path[0] == allValue)
);
if (hasOthersOccupied) {
isDisabled = true;
}
}
} else {
// Logic for "Other" Nodes
if (iHaveAll) {
isDisabled = true;
} else if (hasAllSelectedByOthers) {
isDisabled = true;
} else {
isDisabled = occupiedPaths.some((occupied) => {
const len = Math.min(
currentPath.length,
occupied.length
);
let isPrefixMatch = true;
for (let i = 0; i < len; i++) {
if (currentPath[i] != occupied[i]) {
isPrefixMatch = false;
break;
}
}
if (isPrefixMatch) {
if (
currentPath.length !== occupied.length
) {
return true;
}
return !this.allowRepeat;
}
return false;
});
}
}
const newNode = {
...node,
disabled: isDisabled,
};
if (node[childrenField] && node[childrenField].length > 0) {
newNode[childrenField] = process(
node[childrenField],
currentPath
);
}
return newNode;
});
};
return process(this.getProductDefineListOptions, null);
},
},
mounted() {},
methods: {
getValueByPath(obj, path) {
if (!obj || !path) return undefined;
const keys = path.split(".");
let result = obj;
for (const key of keys) {
if (result === null || result === undefined) return undefined;
result = result[key];
}
return result;
},
handleProductChange(value) {
this.$emit("input", value);
this.$emit("change", value);
},
handleVisibleChange(isVisible) {
this.visible = isVisible;
},
},
};
</script>
...@@ -13,11 +13,12 @@ ...@@ -13,11 +13,12 @@
</el-date-picker> </el-date-picker>
</el-form-item> --> </el-form-item> -->
<d2-table v-if="selectedMerchantsList.length > 0" <d2-table v-if="merchantBrandRefList.length > 0"
ref="selectedMerTable" ref="selectedMerTable"
:has-page="false" :has-page="false"
:search-form="{}" :search-form="{}"
:table-data="selectedMerchantsList" style="padding-left:170px;margin-bottom:14px"
:table-data="merchantBrandRefList"
:table-params="tableParams"> :table-params="tableParams">
<template #auth-button="scope"> <template #auth-button="scope">
<div> <div>
...@@ -29,9 +30,19 @@ ...@@ -29,9 +30,19 @@
</div> </div>
</template> </template>
</d2-table> </d2-table>
<el-form-item label="生效月份:" prop="effectiveMonth">
<el-date-picker v-model="effectiveMonth"
format="yyyy-MM"
:picker-options="pickerOptions"
placeholder="请选择"
type="month"
value-format="yyyy-MM"
@change="handleEffectiveMonthChange">
</el-date-picker>
</el-form-item>
<el-dialog v-if="dialog.storeApply.visible" <el-dialog v-if="dialog.storeApply.visible"
:before-close="handleCloseDialog" :before-close="handleCloseDialog"
:close-on-click-modal="false"
custom-class="store-select-dialog" custom-class="store-select-dialog"
:title="dialog.storeApply.title" :title="dialog.storeApply.title"
:visible.sync="dialog.storeApply.visible" :visible.sync="dialog.storeApply.visible"
...@@ -68,7 +79,6 @@ export default { ...@@ -68,7 +79,6 @@ export default {
visible: false, visible: false,
}, },
}, },
selectedMerchantsList: [],
tableParams: { tableParams: {
listName: "list", listName: "list",
tableOption: true, tableOption: true,
...@@ -99,14 +109,38 @@ export default { ...@@ -99,14 +109,38 @@ export default {
}, },
], ],
}, },
pickerOptions: {
disabledDate(time) {
// 最早:2025-01
const min = new Date(2025, 0, 1).getTime();
// 最晚:当前月份往后 1 年(当月 + 12 个月)
const now = new Date();
const max = new Date(
now.getFullYear(),
now.getMonth() + 12,
1,
).getTime();
const t = time.getTime();
return t < min || t > max;
},
},
}; };
}, },
computed: { computed: {
...mapGetters("PerformanceFormStore", ["getMerchantBrandRefList"]), ...mapState("PerformanceFormStore", ["merchantBrandRefList", "formData"]),
effectiveMonth: {
get() {
return this.formData.effectiveMonth;
},
set(value) {
this.formData.effectiveMonth = value;
},
},
}, },
async mounted() { async mounted() {
this.selectedMerchantsList = this.getMerchantBrandRefList || [];
console.log(this.selectedMerchantsList, "0000");
}, },
methods: { methods: {
...mapMutations("PerformanceFormStore", ["setMerchantBrandRefList"]), ...mapMutations("PerformanceFormStore", ["setMerchantBrandRefList"]),
...@@ -118,36 +152,32 @@ export default { ...@@ -118,36 +152,32 @@ export default {
}, },
handleDeleteMer(row, idx) { handleDeleteMer(row, idx) {
this.selectedMerchantsList.splice(idx, 1); this.merchantBrandRefList.splice(idx, 1);
this.setMerchantBrandRefList(deepClone(this.selectedMerchantsList));
}, },
handleDialogConfirm() { handleDialogConfirm() {
console.log(this.$refs.storeSelect.selectedMerchants); const selectedMerchantList = Object.keys(this.$refs.storeSelect.selectedMerchants).map(key => this.$refs.storeSelect.selectedMerchants[key]) || [];
this.selectedMerchantsList = Object.keys(this.$refs.storeSelect.selectedMerchants).map(key => this.$refs.storeSelect.selectedMerchants[key]) || []; if (selectedMerchantList.length === 0) {
console.log(this.selectedMerchantsList);
if (this.selectedMerchantsList.length === 0) {
this.$message({ this.$message({
message: "请选择门店及品牌", message: "请选择门店及品牌",
type: "warning", type: "warning",
}); });
return; return;
} }
// let list = [] this.setMerchantBrandRefList(deepClone(selectedMerchantList));
// 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(); this.changeStoreApplyVisible();
}, },
handleEffectiveMonthChange() {
// 只验证当前字段
this.validateCurrentField("effectiveMonth");
},
// 验证当前字段(只验证单个字段,不触发全表单验证)
validateCurrentField(prop) {
// 通过 $parent 访问父组件的表单引用
const form = this.$parent?.$refs?.form;
if (form && !this.$parent?.shouldValidateAll) {
form.validateField(prop, () => {});
}
},
}, },
}; };
</script> </script>
......
import { groupBy } from "lodash"; import { groupBy } from "lodash";
import { assessmentFactorOptions } from "../components/performanceRuleSelection/options"; import { assessmentFactorOptions } from "../components/performanceRuleSelection/options";
import { setBackendAllGoods, setBackendConditionGoods, setBackendGoods } from "./help";
export function convertBackendToData(data) { export function convertBackendToData(data) {
// merchantBrandModelPageBrands merchantBrandRefList 接口返回的字段不一样
const { merchantBrandRefList, paramConfigList, performanceConfigRule, ...lists } = data; const { merchantBrandRefList, paramConfigList, performanceConfigRule, ...lists } = data;
const response = { const response = {
...lists, ...lists,
...handlePerformanceConfigRule(performanceConfigRule),
merchantBrandRefList: dealInterfaceBrand(merchantBrandRefList), merchantBrandRefList: dealInterfaceBrand(merchantBrandRefList),
paramConfigList: coverParamConfigList(paramConfigList), paramConfigList: coverParamConfigList(paramConfigList),
}; };
return response; return response;
} }
function handlePerformanceConfigRule(configRule) {
console.log("configRule", configRule);
if (!configRule) {
console.warn("后端数据缺少 performanceConfigRule");
return {};
}
return {
assessmentFactorValue: configRule.assessmentFactors.split(","),
commissionBases: configRule.commissionBases.split(","),
commissionTypes: configRule.commissionTypes.split(","),
goodsConfigTypes: configRule.goodsConfigTypes.split(","),
};
}
const templateType = { const templateType = {
1: "ParamsType1", 1: "ParamsType1",
...@@ -23,9 +40,10 @@ const tableEnum = { ...@@ -23,9 +40,10 @@ const tableEnum = {
// { productLabel: [], productValue: [], optionList: [] }, // { productLabel: [], productValue: [], optionList: [] },
], ],
ParamsType1: [], ParamsType1: [],
ParamsType2CommissionTypes: undefined,
ParamsType2: [], ParamsType2: [],
priceRangeProps: [], priceRangeProps: [],
assessmentFactor: {}, assessmentFactor: undefined,
sort: -1, sort: -1,
}; };
...@@ -41,10 +59,8 @@ export function coverParamConfigList(paramConfigList) { ...@@ -41,10 +59,8 @@ export function coverParamConfigList(paramConfigList) {
const tableList = groupBy(paramConfigList, "assessmentFactor"); const tableList = groupBy(paramConfigList, "assessmentFactor");
const _paramConfigList = []; const _paramConfigList = [];
console.log("tableList", tableList);
if (tableList && Object.keys(tableList).length) { if (tableList && Object.keys(tableList).length) {
for (let tableIndex in tableList) { for (const tableIndex in tableList) {
console.log("table");
const tableItem = tableList[tableIndex][0]; const tableItem = tableList[tableIndex][0];
const table = tableList[tableIndex]; const table = tableList[tableIndex];
// 因为每一个table的数据是一样的,所以直接取0位 // 因为每一个table的数据是一样的,所以直接取0位
...@@ -52,67 +68,101 @@ export function coverParamConfigList(paramConfigList) { ...@@ -52,67 +68,101 @@ export function coverParamConfigList(paramConfigList) {
baseTable.title = getAssessmentFactorOptionsTitle(tableItem.assessmentFactor)?.label; // 找enum baseTable.title = getAssessmentFactorOptionsTitle(tableItem.assessmentFactor)?.label; // 找enum
baseTable.templateType = templateType[tableList[tableIndex][0].templateType]; baseTable.templateType = templateType[tableList[tableIndex][0].templateType];
baseTable.goodsCategory = tableList[tableIndex][0].goodsConfigType; baseTable.goodsCategory = tableList[tableIndex][0].goodsConfigType;
baseTable.assessmentFactor = Number(tableIndex);
if (baseTable.templateType === "ParamsType2") {
baseTable.ParamsType2CommissionTypes = tableList[tableIndex][0].commissionType;
}
console.log("baseTable", baseTable); console.log("baseTable", baseTable);
const rowTable = groupBy(tableList[tableIndex], item => String(item.startValue) + String(item.endValue)); 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)); const colTable = groupBy(table, item => String(item.goodsType) + String(item.secondaryGoodsType) + String(item.thirdLevelGoodsType));
// 整理ParamsType1Products
if (baseTable.templateType === "ParamsType1") {
Object.keys(colTable).forEach((colIndex, colEachIndex) => { Object.keys(colTable).forEach((colIndex, colEachIndex) => {
const colItem = colTable[colIndex][colEachIndex]; const colItem = colTable[colIndex][colEachIndex];
const paramsTypeProductsItem = { const paramsTypeProductsItem = {
productLabel: [colItem.goodsType], productLabel: [],
productValue: [], productValue: [],
optionList: [], optionList: [],
}; };
if ([1, 2].includes(colItem.goodsConfigType)) {
colItem.secondaryGoodsType && paramsTypeProductsItem.productLabel.push(colItem.secondaryGoodsType); console.error("error", colItem);
colItem.thirdLevelGoodsType && paramsTypeProductsItem.productLabel.push(colItem.thirdLevelGoodsType); colItem.productDefineId && paramsTypeProductsItem.productLabel.push(colItem.productDefineId);
} else {
setBackendGoods(colItem, paramsTypeProductsItem);
}
Object.keys(rowTable).forEach((rowIndex, rowEachIndex) => { Object.keys(rowTable).forEach((rowIndex, rowEachIndex) => {
const rowItem = rowTable[rowIndex][rowEachIndex]; console.log("rowTable", rowTable);
paramsTypeProductsItem.productValue.push(rowItem.commissionTypeValue); console.log("rowIndex", rowIndex);
console.log("rowEachIndex", rowEachIndex);
const rowItem = rowTable[rowIndex][0];
paramsTypeProductsItem.productValue.push(rowItem?.commissionTypeValue);
}); });
baseTable.ParamsType1Products.push(paramsTypeProductsItem); 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) => { Object.keys(rowTable).forEach((rowIndex, rowEachIndex) => {
// 整理 ParamsType1
console.log("hang", rowTable[rowIndex]); console.log("hang", rowTable[rowIndex]);
const rowItem = rowTable[rowIndex][0]; const rowItem = rowTable[rowIndex][0];
if (baseTable.templateType === "ParamsType1") { if (baseTable.templateType === "ParamsType1") {
console.log(333, rowItem.startValue, rowItem.endValue);
baseTable.ParamsType1.push({ baseTable.ParamsType1.push({
priceRange: [rowItem.startValue, rowItem.endValue], priceRange: [rowItem.startValue, rowItem.endValue],
commissionTypes: rowItem.commissionType, commissionTypes: rowItem.commissionType,
}); });
} }
if (baseTable.templateType === "ParamsType2") {
console.log("ParamsType2 => rowItem", rowItem);
// const colTable = groupBy(rowTable[rowIndex], item => String(item.goodsType) + String(item.secondaryGoodsType) + String(item.thirdLevelGoodsType)); const rowItemParamConfig = rowItem.performanceParamConfigConditions;
// for (let productColIndex in colTable) { const conditionType = rowItemParamConfig.length ? rowItemParamConfig[0].conditionType : 0;
// const colItem = colTable[productColIndex][0]; const conditionKey = `conditionType${conditionType}`;
// if (!baseTable.ParamsType1Products[rowEachIndex]) { const paramsType2Item = {
// baseTable.ParamsType1Products[rowEachIndex] = { condition: conditionType,
// productLabel: [colItem.goodsType, colItem.secondaryGoodsType, colItem.thirdLevelGoodsType], priceRange: [rowItem.startValue, rowItem.endValue],
// productValue: [colItem.commissionTypeValue], productLabel: [],
// optionList: [], };
// }; setBackendAllGoods(rowItem, paramsType2Item);
// } else {
// baseTable.ParamsType1Products[rowEachIndex].productValue.push(colItem.commissionTypeValue); if (conditionType === 0) {
// } paramsType2Item.conditionType0 = rowItem.commissionTypeValue;
// } } else {
paramsType2Item[conditionKey] = {
triggerCondition: rowItem.commissionTypeValue,
productValue: [],
};
setBackendConditionGoods(rowItemParamConfig[0], paramsType2Item[conditionKey], "productValue");
// 到这里 conditionType4 已经解决
if (conditionType === 3) {
paramsType2Item[conditionKey].increaseReward = rowItemParamConfig[0].conditionCommissionTypeValue;
}
if (conditionType === 2) {
paramsType2Item[conditionKey].deductRate = rowItemParamConfig[0].conditionEndValue;
paramsType2Item[conditionKey].perOrderDeductAmount = rowItemParamConfig[0].conditionCommissionTypeValue;
}
if (conditionType === 1) {
// 要先排序. 小的在前面
rowItemParamConfig.sort((a, b) => a.id - b.id);
paramsType2Item[conditionKey].permeabilityMin = rowItemParamConfig[0].conditionStartValue;
paramsType2Item[conditionKey].permeabilityMax = rowItemParamConfig[0].conditionEndValue;
paramsType2Item[conditionKey].productValue1 = [];
setBackendConditionGoods(rowItemParamConfig[1], paramsType2Item[conditionKey], "productValue1");
paramsType2Item[conditionKey].permeabilityMin1 = rowItemParamConfig[1].conditionStartValue;
paramsType2Item[conditionKey].permeabilityMax1 = rowItemParamConfig[1].conditionEndValue;
}
}
console.log("paramsType2Item", paramsType2Item);
baseTable.ParamsType2.push(paramsType2Item);
}
}); });
_paramConfigList.push(baseTable); _paramConfigList.push(baseTable);
// handleParamsType1Product(tableList[tableIndex]);
} }
} }
console.log("即将返回出去的 _paramConfigList", _paramConfigList);
return _paramConfigList; return _paramConfigList;
} }
......
export function setBackendGoodsValue(backendDta, paramsConfig, options = {
key: "conditionProductDefineId",
paramsKey: "productValue1",
}) {
backendDta[options.key] && paramsConfig[options.paramsKey].push(backendDta[options.key]);
}
export function setBackendConditionGoods(backendDta, paramsConfig, valueKey = "productValue") {
setBackendGoodsValue(backendDta, paramsConfig, {
key: "conditionProductDefineId",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "conditionGoodsType",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "conditionSecondaryGoodsType",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "conditionThirdLevelGoodsType",
paramsKey: valueKey,
});
}
export function setBackendGoods(backendDta, paramsConfig, valueKey = "productLabel") {
setBackendGoodsValue(backendDta, paramsConfig, {
key: "goodsType",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "secondaryGoodsType",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "thirdLevelGoodsType",
paramsKey: valueKey,
});
}
export function setBackendAllGoods(backendDta, paramsConfig, valueKey = "productLabel") {
setBackendGoodsValue(backendDta, paramsConfig, {
key: "productDefineId",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "goodsType",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "secondaryGoodsType",
paramsKey: valueKey,
});
setBackendGoodsValue(backendDta, paramsConfig, {
key: "thirdLevelGoodsType",
paramsKey: valueKey,
});
}
import { last } from "lodash-es"; import { isObject, last } from "lodash-es";
import store from "@/store"; import store from "@/store";
const commissionTypesCoverCommissionBase = { const commissionTypesCoverCommissionBase = {
...@@ -13,9 +13,12 @@ export function convertDataToBackend(formData) { ...@@ -13,9 +13,12 @@ export function convertDataToBackend(formData) {
const { paramConfigList, merchantBrandRefList, ...data } = formData; const { paramConfigList, merchantBrandRefList, ...data } = formData;
const requestData = { const requestData = {
schemaName: data.schemaName,
// 注意是scheme
schemeName: data.schemeName,
schemeType: data.schemeType,
businessType: data.businessType, businessType: data.businessType,
effectiveMonth: data.storeConfig.effectiveMonth, effectiveMonth: data.effectiveMonth,
performanceConfigRule: { performanceConfigRule: {
assessmentFactors: data.assessmentFactorValue.join(","), assessmentFactors: data.assessmentFactorValue.join(","),
commissionBases: data.commissionBases.join(","), commissionBases: data.commissionBases.join(","),
...@@ -25,6 +28,9 @@ export function convertDataToBackend(formData) { ...@@ -25,6 +28,9 @@ export function convertDataToBackend(formData) {
paramConfigList: [], paramConfigList: [],
merchantBrandRefList: [], merchantBrandRefList: [],
}; };
if (data.originPerformanceConfigId) {
requestData.originPerformanceConfigId = data.originPerformanceConfigId;
}
for (const paramConfig of paramConfigList) { for (const paramConfig of paramConfigList) {
// 每一份表格 // 每一份表格
const { templateType, ParamsType1, ParamsType1Products, ParamsType2 } = paramConfig; const { templateType, ParamsType1, ParamsType1Products, ParamsType2 } = paramConfig;
...@@ -34,7 +40,7 @@ export function convertDataToBackend(formData) { ...@@ -34,7 +40,7 @@ export function convertDataToBackend(formData) {
coverParamsType1(ParamsType1, ParamsType1Products, (item, { rowItem, row }, { productColItem, colIndex }) => { coverParamsType1(ParamsType1, ParamsType1Products, (item, { rowItem, row }, { productColItem, colIndex }) => {
requestData.paramConfigList.push({ requestData.paramConfigList.push({
...item, ...item,
assessmentFactor: paramConfig.assessmentFactor.value, assessmentFactor: isObject(paramConfig.assessmentFactor) ? paramConfig.assessmentFactor.value : paramConfig.assessmentFactor,
goodsConfigType: paramConfig.goodsCategory, goodsConfigType: paramConfig.goodsCategory,
commissionTypeValue: productColItem.productValue[row], commissionTypeValue: productColItem.productValue[row],
...paramConfig.goodsCategory === 0 ...paramConfig.goodsCategory === 0
...@@ -50,7 +56,7 @@ export function convertDataToBackend(formData) { ...@@ -50,7 +56,7 @@ export function convertDataToBackend(formData) {
...result, ...result,
commissionType: paramConfig.ParamsType2CommissionTypes, commissionType: paramConfig.ParamsType2CommissionTypes,
commissionBase: commissionTypesCoverCommissionBase[paramConfig.ParamsType2CommissionTypes], commissionBase: commissionTypesCoverCommissionBase[paramConfig.ParamsType2CommissionTypes],
assessmentFactor: paramConfig.assessmentFactor.value, assessmentFactor: isObject(paramConfig.assessmentFactor) ? paramConfig.assessmentFactor.value : paramConfig.assessmentFactor,
goodsConfigType: paramConfig.goodsCategory, goodsConfigType: paramConfig.goodsCategory,
...paramConfig.goodsCategory === 0 ...paramConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, paramsType2Item.productLabel) ? buildGoodsTypePayload(goodsCategory, paramsType2Item.productLabel)
...@@ -60,8 +66,11 @@ export function convertDataToBackend(formData) { ...@@ -60,8 +66,11 @@ export function convertDataToBackend(formData) {
}); });
} }
} }
console.log("convertDataToBackend", merchantBrandRefList);
// 整理门店 // 整理门店
// requestData.merchantBrandRefList = buildMerchantBrandPayload(merchantBrandRefList, data.businessType); if (merchantBrandRefList && merchantBrandRefList.length) {
requestData.merchantBrandRefList = buildMerchantBrandPayload(merchantBrandRefList, data.businessType);
}
return requestData; return requestData;
} }
...@@ -78,10 +87,15 @@ function getPerformanceParamConfigConditions(paramsType2Item, paramsConfig) { ...@@ -78,10 +87,15 @@ function getPerformanceParamConfigConditions(paramsType2Item, paramsConfig) {
level2Name: "conditionSecondaryGoodsTypeName", level2Name: "conditionSecondaryGoodsTypeName",
level3Name: "conditionThirdLevelGoodsTypeName", level3Name: "conditionThirdLevelGoodsTypeName",
}; };
const buildProductDefinePayloadOptions = {
id: "conditionProductDefineId",
name: "conditionProductDefineName",
type: "conditionGoodsConfigType",
};
console.log("paramsConfigdddsss", paramsConfig);
const conditionItem = [{ const conditionItem = [{
conditionType: paramsType2Item.condition, conditionType: paramsType2Item.condition,
// conditionGoodsConfigType: paramsConfig.goodsCategory, conditionGoodsConfigType: paramsConfig.goodsCategory,
// conditionStartValue: "", // conditionStartValue: "",
// conditionEndValue: "", // conditionEndValue: "",
}]; }];
...@@ -94,21 +108,40 @@ function getPerformanceParamConfigConditions(paramsType2Item, paramsConfig) { ...@@ -94,21 +108,40 @@ function getPerformanceParamConfigConditions(paramsType2Item, paramsConfig) {
const conditionParamsData = paramsType2Item[`conditionType${paramsType2Item.condition}`]; const conditionParamsData = paramsType2Item[`conditionType${paramsType2Item.condition}`];
// 如果 conditionParamsData 不存在,直接返回空的 conditionItem
if (!conditionParamsData) {
return conditionItem;
}
if (paramsType2Item.condition === 1) { if (paramsType2Item.condition === 1) {
// 检查四个渗透率字段是否有值
const hasPermeabilityValue
= (conditionParamsData.permeabilityMax !== undefined && conditionParamsData.permeabilityMax !== null && conditionParamsData.permeabilityMax !== "")
|| (conditionParamsData.permeabilityMax1 !== undefined && conditionParamsData.permeabilityMax1 !== null && conditionParamsData.permeabilityMax1 !== "")
|| (conditionParamsData.permeabilityMin !== undefined && conditionParamsData.permeabilityMin !== null && conditionParamsData.permeabilityMin !== "")
|| (conditionParamsData.permeabilityMin1 !== undefined && conditionParamsData.permeabilityMin1 !== null && conditionParamsData.permeabilityMin1 !== "");
// 如果四个渗透率字段全部没有值,直接返回空的 conditionItem,不进行后续处理
if (!hasPermeabilityValue) {
return conditionItem;
}
extend.conditionStartValue = conditionParamsData.permeabilityMin; extend.conditionStartValue = conditionParamsData.permeabilityMin;
extend.conditionEndValue = conditionParamsData.permeabilityMax; extend.conditionEndValue = conditionParamsData.permeabilityMax;
extend = { extend = {
...extend, ...extend,
...paramsConfig.goodsCategory === 0 ...paramsConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue, buildGoodsTypePayloadOptions) ? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue || [], buildGoodsTypePayloadOptions)
: buildProductDefinePayload(productDefineList, conditionParamsData.productValue), : buildProductDefinePayload(productDefineList, conditionParamsData.productValue || [], buildProductDefinePayloadOptions),
}; };
conditionItem.push({ conditionItem.push({
conditionType: paramsType2Item.condition,
conditionStartValue: conditionParamsData.permeabilityMin1, conditionStartValue: conditionParamsData.permeabilityMin1,
conditionEndValue: conditionParamsData.permeabilityMax1, conditionEndValue: conditionParamsData.permeabilityMax1,
conditionGoodsConfigType: paramsConfig.goodsCategory,
...paramsConfig.goodsCategory === 0 ...paramsConfig.goodsCategory === 0
? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue1, buildGoodsTypePayloadOptions) ? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue1 || [], buildGoodsTypePayloadOptions)
: buildProductDefinePayload(productDefineList, conditionParamsData.productValue1), : buildProductDefinePayload(productDefineList, conditionParamsData.productValue1 || [], buildProductDefinePayloadOptions),
}); });
} }
if (paramsType2Item.condition === 2) { if (paramsType2Item.condition === 2) {
...@@ -119,19 +152,36 @@ function getPerformanceParamConfigConditions(paramsType2Item, paramsConfig) { ...@@ -119,19 +152,36 @@ function getPerformanceParamConfigConditions(paramsType2Item, paramsConfig) {
extend.conditionCommissionTypeValue = conditionParamsData.increaseReward; extend.conditionCommissionTypeValue = conditionParamsData.increaseReward;
} }
if (paramsType2Item.condition === 4) { if (paramsType2Item.condition === 4) {
extend extend = {
= paramsConfig.goodsCategory === 0 ...extend,
? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue, buildGoodsTypePayloadOptions) ...paramsConfig.goodsCategory === 0
: buildProductDefinePayload(productDefineList, conditionParamsData.productValue); ? buildGoodsTypePayload(goodsCategory, conditionParamsData.productValue || [], buildGoodsTypePayloadOptions)
: buildProductDefinePayload(productDefineList, conditionParamsData.productValue || [], buildProductDefinePayloadOptions),
};
} }
conditionItem[0] = { conditionItem[0] = {
...conditionItem[0], ...conditionItem[0],
...extend, ...extend,
}; };
return conditionItem; return conditionItem;
} }
function buildProductDefinePayload(tree, pathIds) { function buildProductDefinePayload(tree, pathIds, options = {
id: "productDefineId",
name: "productDefineName",
type: "goodsConfigType",
}) {
// 如果 pathIds 不存在或不是数组,返回空对象
if (!pathIds || !Array.isArray(pathIds) || pathIds.length === 0) {
return {
[options.id]: null,
[options.name]: null,
[options.type]: null,
};
}
let currentLevel = tree; let currentLevel = tree;
let targetNode = null; let targetNode = null;
...@@ -143,8 +193,9 @@ function buildProductDefinePayload(tree, pathIds) { ...@@ -143,8 +193,9 @@ function buildProductDefinePayload(tree, pathIds) {
} }
return { return {
productDefineId: targetNode?.id ?? null, [options.id]: targetNode?.id ?? null,
productDefineName: targetNode?.label ?? null, [options.name]: targetNode?.label ?? null,
[options.type]: targetNode?.defineType,
}; };
} }
...@@ -158,10 +209,19 @@ function buildGoodsTypePayload(tree, pathIds, options = { ...@@ -158,10 +209,19 @@ function buildGoodsTypePayload(tree, pathIds, options = {
}) { }) {
const result = {}; const result = {};
let currentLevel = tree;
// 如果 pathIds 不存在或不是数组,返回空对象
if (!pathIds || !Array.isArray(pathIds) || pathIds.length === 0) {
return result;
}
pathIds.forEach((id, index) => { pathIds.forEach((id, index) => {
const node = currentLevel.find(item => item.categoryType === id); let node = {};
traverseTree(tree, (_node) => {
if (id === _node.categoryType) {
node = _node;
}
});
if (!node) if (!node)
return; return;
...@@ -175,12 +235,22 @@ function buildGoodsTypePayload(tree, pathIds, options = { ...@@ -175,12 +235,22 @@ function buildGoodsTypePayload(tree, pathIds, options = {
result[options.level3Id] = node.categoryType; result[options.level3Id] = node.categoryType;
result[options.level3Name] = node.categoryName; result[options.level3Name] = node.categoryName;
} }
currentLevel = node.children || [];
}); });
return result; return result;
} }
function traverseTree(tree, callback) {
if (!Array.isArray(tree))
return;
for (const node of tree) {
callback(node);
if (Array.isArray(node.children) && node.children.length) {
traverseTree(node.children, callback);
}
}
}
function coverParamsType1(ParamsType1, ParamsType1Products, fn) { function coverParamsType1(ParamsType1, ParamsType1Products, fn) {
ParamsType1.forEach((rowItem, row) => { ParamsType1.forEach((rowItem, row) => {
...@@ -200,10 +270,11 @@ function coverParamsType1(ParamsType1, ParamsType1Products, fn) { ...@@ -200,10 +270,11 @@ function coverParamsType1(ParamsType1, ParamsType1Products, fn) {
}); });
} }
// 整理商户品牌数据
function coverParamsType2(ParamsType2, fn) { function coverParamsType2(ParamsType2, fn) {
ParamsType2.forEach((rowItem, rowIndex) => { ParamsType2.forEach((rowItem, rowIndex) => {
const result = { const result = {
templateType: 1, templateType: 2,
startValue: rowItem.priceRange[0], startValue: rowItem.priceRange[0],
endValue: rowItem.priceRange[1], endValue: rowItem.priceRange[1],
commissionTypeValue: rowItem.condition === 0 ? rowItem.conditionType0 : rowItem[`conditionType${rowItem.condition}`].triggerCondition, commissionTypeValue: rowItem.condition === 0 ? rowItem.conditionType0 : rowItem[`conditionType${rowItem.condition}`].triggerCondition,
...@@ -240,7 +311,7 @@ function buildMerchantBrandPayload( ...@@ -240,7 +311,7 @@ function buildMerchantBrandPayload(
brandName: brand.brandName, brandName: brand.brandName,
childId: brand.childId, childId: brand.childId,
childName: brand.childName, childName: brand.childName,
businessType: String(businessType), businessType,
}); });
}); });
}); });
......
.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;
}
}
}
}
}
<template>
<d2-container v-loading="$store.state.d2admin.loading.value" class="performance-scheme-wrapper">
<el-form ref="form"
class="form-performance-name"
label-width="170px"
:model="formData"
:rules="rules"
:validate-on-rule-change="false">
<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="schemeName">
<el-input v-model="schemeName"
clearable
maxlength="20"
placeholder="请输入当前方案名称"
style="width:290px"
@blur="handleFieldBlur('schemeName')" />
</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 class="btn check-btn"
size="small"
type="primary"
@click="handleSubmitCheck">
提交审核
</el-button>
<el-button class="btn save-btn"
size="small"
@click="handleSubmitSave(true)">
保存
</el-button>
<el-button class="btn cancel-btn"
size="small"
@click="handleCancelSubmit">
取消
</el-button>
</div>
</el-form>
<DetailDialog v-if="detailVisible"
:id="id"
:detail-visible="detailVisible"
:is-edit="true"
@dialogClose="handleCheckClose">
</DetailDialog>
</d2-container>
</template>
<script>
import { groupBy } from "lodash-es";
import { mapMutations, mapState } from "vuex";
import { getAllCategory } from "@/api/product.js";
import {
getPerformanceConfigDetailAPI,
getTargetProductConfigListAPI,
postSalaryPerformanceScheme,
} from "@/api/resident";
import DetailDialog from "../../components/approvalView";
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 } from "../utils/convertBackendToData.js";
import { convertDataToBackend } from "../utils/index.js";
import { getFormRules, validateParamConfigList } from "../utils/rules.js";
// 提成方案配置
export default {
name: "",
components: {
PerformanceRuleSelection,
ParamConfigList,
StoreApply,
DetailDialog,
},
beforeRouteLeave(to, from, next) {
// 离开页面时, 清空数据
this.resetFormData();
next();
},
props: {},
data() {
return {
id: 0,
rules: {},
detailVisible: false,
shouldValidateAll: false, // 是否应该验证所有字段
};
},
computed: {
...mapState("PerformanceFormStore", [
"formData",
"merchantBrandRefList",
]),
schemeName: bindFormFields("schemeName"),
},
watch: {
formData: {
handler() {
// 当formData变化时,更新rules
this.rules = getFormRules(this.formData, this.merchantBrandRefList);
},
deep: true,
immediate: true,
},
merchantBrandRefList: {
handler() {
// 当门店列表变化时,更新rules
this.rules = getFormRules(this.formData, this.merchantBrandRefList);
},
deep: true,
},
},
async mounted() {
await this.initLoad();
if (this.$route?.query?.id) {
this.id = this.$route.query.id;
await this.getData(this.$route?.query?.id);
}
},
methods: {
...mapMutations("PerformanceFormStore", [
"setFormData",
"setProductDefineList",
"setGoodsCategory",
"setMerchantBrandRefList",
"touchAssessment",
"setAssessmentFactorValue",
"setParamConfigList",
"resetFormData",
]),
// 提交审核
async handleSubmitCheck() {
await this.handleSubmitSave();
this.detailVisible = !this.detailVisible;
},
handleCheckClose(e) {
this.detailVisible = !this.detailVisible;
if (e.isConfirm) {
this.handleCancelSubmit();
}
},
// 处理单个字段失焦事件,只验证当前字段
handleFieldBlur(prop) {
if (!this.shouldValidateAll && this.$refs.form) {
this.$refs.form.validateField(prop, () => {});
}
},
// 提交保存
async handleSubmitSave(isConfirm = false) {
console.log("handleSubmitSave", this.formData);
// 设置需要验证所有字段
this.shouldValidateAll = true;
// 表单校验
try {
await this.$refs.form.validate();
} catch (error) {
this.$message.warning("请完善表单信息");
this.shouldValidateAll = false;
return;
}
this.shouldValidateAll = false;
// 校验门店列表
if (!this.merchantBrandRefList || this.merchantBrandRefList.length === 0) {
this.$message.warning("请至少选择一个门店");
return;
}
// 校验参数配置列表
const paramConfigError = validateParamConfigList(this.formData);
if (paramConfigError) {
this.$message.warning(paramConfigError);
return;
}
console.log(this.formData, "this.formData");
const params = convertDataToBackend({
...this.formData,
merchantBrandRefList: this.merchantBrandRefList,
});
if (this.formData.id) {
params.id = this.formData.id;
if (this.formData.schemeType) {
params.schemeType = this.formData.schemeType;
}
}
const res = await postSalaryPerformanceScheme(params);
this.id = res;
console.log(res, "res");
if (res && isConfirm) {
this.$message.success("保存成功");
this.handleCancelSubmit();
}
// console.log("handleSubmitSave", params);
// await postSalaryPerformanceScheme(params);
// await postSalaryPerformanceScheme();
},
// 取消按钮
handleCancelSubmit() {
if (window.history.length > 1) {
this.$router.back();
} else {
this.$router.replace("/salaryPerformance"); // 兜底页
}
},
async initLoad() {
// 获取品类
const { list } = await getAllCategory({
pageSize: 9999,
currentPage: 1,
});
// 添加全部选项
const allOption = { categoryType: -1, categoryName: "全部" };
list.unshift(allOption);
this.setGoodsCategory(list);
// 获取圈定商品/套餐
const res = await getTargetProductConfigListAPI({
currentPage: 1,
pageSize: 999,
});
this.setProductDefineList(res?.list);
},
async getData(id) {
const data = await getPerformanceConfigDetailAPI({ id });
if (!data) {
this.$message.error("获取数据失败");
return;
}
const { merchantBrandRefList, ...performance } =
convertBackendToData(data);
this.setMerchantBrandRefList(merchantBrandRefList);
const assessmentKeys = Object.keys(
groupBy(performance.paramConfigList, "assessmentFactor")
).map(Number);
const selectAssessment = assessmentFactorOptions.filter((item) =>
assessmentKeys.includes(item.value)
);
this.touchAssessment(selectAssessment);
this.setFormData(performance);
this.setAssessmentFactorValue(assessmentKeys);
},
},
};
</script>
<style scoped lang="scss">
@import "./common.scss";
</style>
<template>
<d2-container v-loading="$store.state.d2admin.loading.value"
class="performance-scheme-wrapper">
<el-form ref="form"
class="form-performance-name"
label-width="170px"
:model="formData"
:rules="rules"
:validate-on-rule-change="false">
<div class="warp-box">
<div class="title space-b">
<div class="title-wrap">
<span>渠道配置</span>
</div>
</div>
<div class="warp-content">
<ChannelConfig v-if="brandMerchantList.length"
:brand-merchant="brandMerchantList"
@changeBusiness="handleChangeBusinessType">
</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="schemeName">
<el-input v-model="schemeName"
clearable
maxlength="20"
placeholder="请输入当前方案名称"
style="width: 290px"
@blur="handleFieldBlur('schemeName')" />
</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">
<el-form-item label="生效月份:" prop="effectiveMonth">
<el-date-picker v-model="effectiveMonth"
format="yyyy-MM"
:picker-options="pickerOptions"
placeholder="请选择"
type="month"
value-format="yyyy-MM"
@blur="handleFieldBlur('effectiveMonth')">
</el-date-picker>
</el-form-item>
</div>
</div>
<div class="btn-box">
<el-button class="btn check-btn"
size="small"
type="primary"
@click="handleSubmitCheck">
提交审核
</el-button>
<el-button class="btn cancel-btn"
size="small"
@click="handleCancel">
取消
</el-button>
</div>
</el-form>
<DetailDialog v-if="detailVisible"
:id="detailVisibleId"
:detail-visible="detailVisible"
:is-edit="true"
@dialogClose="handleCheckClose">
</DetailDialog>
</d2-container>
</template>
<script>
import { groupBy } from "lodash-es";
import { mapMutations, mapState } from "vuex";
import { getAllCategory } from "@/api/product.js";
import {
getConfigMerchantDetail,
getTargetProductConfigListAPI,
postBrandMerchant,
postSalaryPerformanceScheme,
} from "@/api/resident";
import detailDialog from "../../components/approvalView";
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 { bindFormFields } from "../store/helper.js";
import { convertBackendToData } from "../utils/convertBackendToData.js";
import { convertDataToBackend } from "../utils/index.js";
import { getFormRules, validateParamConfigList } from "../utils/rules.js";
// 门店提成方案
export default {
name: "",
components: {
PerformanceRuleSelection,
ParamConfigList,
ChannelConfig,
DetailDialog: detailDialog,
},
props: {},
data() {
return {
brandMerchantList: [],
rules: {},
detailVisible: false,
detailVisibleId: undefined,
shouldValidateAll: false, // 是否应该验证所有字段
pickerOptions: {
disabledDate(time) {
// 最早:2025-01
const min = new Date(2025, 0, 1).getTime();
// 最晚:当前月份往后 1 年(当月 + 12 个月)
const now = new Date();
const max = new Date(
now.getFullYear(),
now.getMonth() + 12,
1,
).getTime();
const t = time.getTime();
return t < min || t > max;
},
},
};
},
computed: {
...mapState("PerformanceFormStore", ["formData", "merchantBrandRefList"]),
schemeName: bindFormFields("schemeName"),
effectiveMonth: {
get() {
return this.formData.effectiveMonth;
},
set(value) {
this.formData.effectiveMonth = value;
},
},
},
watch: {
formData: {
handler() {
// 当formData变化时,更新rules
this.rules = getFormRules(this.formData, this.merchantBrandRefList);
},
deep: true,
immediate: true,
},
merchantBrandRefList: {
handler() {
// 当门店列表变化时,更新rules
this.rules = getFormRules(this.formData, this.merchantBrandRefList);
},
deep: true,
},
},
async mounted() {
console.log("this.$route.query", this.$route.query);
if (this.$route.query?.id) {
await this.getData(this.$route.query?.id);
}
},
methods: {
...mapMutations("PerformanceFormStore", [
"setFormData",
"setProductDefineList",
"setGoodsCategory",
"setMerchantBrandRefList",
"touchAssessment",
"setAssessmentFactorValue",
"setParamConfigList",
"resetFormData",
]),
async handleChangeBusinessType({ id }) {
const data = await getConfigMerchantDetail({
id,
merchantId: this.$route.query?.id,
});
const performance = convertBackendToData(data);
const assessmentKeys = Object.keys(
groupBy(performance.paramConfigList, "assessmentFactor"),
).map(Number);
const selectAssessment = assessmentFactorOptions.filter(item =>
assessmentKeys.includes(item.value),
);
this.touchAssessment(selectAssessment);
this.setFormData({
...performance,
id,
});
this.setAssessmentFactorValue(assessmentKeys);
this.setMerchantBrandRefList(data.merchantBrandRefList);
},
handleCheckClose(e) {
this.detailVisible = !this.detailVisible;
if (e.isConfirm) {
this.handleCancelSubmit();
}
},
// 处理单个字段失焦事件,只验证当前字段
handleFieldBlur(prop) {
if (!this.shouldValidateAll && this.$refs.form) {
this.$refs.form.validateField(prop, () => {});
}
},
// 提交审核
async handleSubmitCheck() {
// 表单校验
this.shouldValidateAll = true;
try {
await this.$refs.form.validate();
} catch (error) {
this.$message.warning("请完善表单信息");
this.shouldValidateAll = false;
return;
}
this.shouldValidateAll = false;
// 校验参数配置列表
const paramConfigError = validateParamConfigList(this.formData);
if (paramConfigError) {
this.$message.warning(paramConfigError);
return;
}
const params = convertDataToBackend({
...this.formData,
// 门店提成方案不需要门店列表,传空数组
merchantBrandRefList: [],
});
if (this.formData.id) {
params.id = this.formData.id;
}
if (this.formData.schemeType) {
params.schemeType = this.formData.schemeType;
}
this.detailVisibleId = await postSalaryPerformanceScheme(params);
if (this.detailVisibleId) {
this.detailVisible = !this.detailVisible;
}
},
// 取消按钮
handleCancelSubmit() {
if (window.history.length > 1) {
this.$router.back();
} else {
this.$router.replace("/salaryPerformance"); // 兜底页
}
},
async getData(id) {
this.brandMerchantList = await postBrandMerchant({
merchantId: id,
});
// 获取品类
const { list } = await getAllCategory({
pageSize: 9999,
currentPage: 1,
});
this.setGoodsCategory(list);
// 获取圈定商品/套餐
const res = await getTargetProductConfigListAPI({
currentPage: 1,
pageSize: 999,
});
this.setProductDefineList(res?.list);
console.log(this.brandMerchantList);
},
handleCancel() {
// 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,
// },
// });
if (window.history.length > 1) {
this.$router.back();
} else {
this.$router.replace("/salaryPerformance"); // 兜底页
}
},
},
};
</script>
<style scoped lang="scss">
@import "./common.scss";
</style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
label-width="170px" label-width="170px"
:model="formData" :model="formData"
:rules="rules"> :rules="rules">
<div v-if="routeParams.page == 'performanceList'" class="warp-box"> <div class="warp-box">
<div class="title space-b"> <div class="title space-b">
<div class="title-wrap"> <div class="title-wrap">
<span>渠道配置</span> <span>渠道配置</span>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</div> </div>
<div class="warp-content"> <div class="warp-content">
<el-form-item label="当前方案名称:" prop="name"> <el-form-item label="当前方案名称:" prop="name">
<el-input v-model="schemaName" <el-input v-model="schemeName"
clearable clearable
maxlength="20" maxlength="20"
placeholder="请输入当前方案名称" placeholder="请输入当前方案名称"
...@@ -61,24 +61,30 @@ ...@@ -61,24 +61,30 @@
</div> </div>
<div class="btn-box"> <div class="btn-box">
<el-button v-if="routeParams.id" size="small" type="primary" class="btn check-btn" @click="handleCheck"> <el-button class="btn check-btn"
size="small"
type="primary"
@click="handleCheck">
提交审核 提交审核
</el-button> </el-button>
<el-button size="small" class="btn save-btn" @click="handleSubmit"> <el-button class="btn save-btn"
size="small"
@click="handleSubmit">
保存 保存
</el-button> </el-button>
<el-button size="small" class="btn cancel-btn" @click="handleCancel"> <el-button class="btn cancel-btn"
size="small"
@click="handleCancel">
取消 取消
</el-button> </el-button>
</div> </div>
</el-form> </el-form>
<detail-dialog <DetailDialog v-if="detailVisible"
v-if="detailVisible"
:detailVisible="detailVisible"
:id="routeParams.id" :id="routeParams.id"
:isEdit="true" :detail-visible="detailVisible"
@dialogClose="handleCheckClose" :is-edit="true"
></detail-dialog> @dialogClose="handleCheckClose">
</DetailDialog>
</d2-container> </d2-container>
</template> </template>
...@@ -87,6 +93,7 @@ import { groupBy } from "lodash-es"; ...@@ -87,6 +93,7 @@ import { groupBy } from "lodash-es";
import { mapGetters, mapMutations, mapState } from "vuex"; import { mapGetters, mapMutations, mapState } from "vuex";
import { getAllCategory } from "@/api/product.js"; import { getAllCategory } from "@/api/product.js";
import { getPerformanceConfigDetailAPI, getTargetProductConfigListAPI, postSalaryPerformanceScheme } from "@/api/resident"; import { getPerformanceConfigDetailAPI, getTargetProductConfigListAPI, postSalaryPerformanceScheme } from "@/api/resident";
import detailDialog from "../../components/approvalView";
import ChannelConfig from "../components/channelConfig/index.vue"; import ChannelConfig from "../components/channelConfig/index.vue";
import ParamConfigList from "../components/paramConfigList/index.vue"; import ParamConfigList from "../components/paramConfigList/index.vue";
import PerformanceRuleSelection from "../components/performanceRuleSelection/index.vue"; import PerformanceRuleSelection from "../components/performanceRuleSelection/index.vue";
...@@ -95,7 +102,6 @@ import StoreApply from "../components/storeApply/index.vue"; ...@@ -95,7 +102,6 @@ import StoreApply from "../components/storeApply/index.vue";
import { bindFormFields } from "../store/helper.js"; import { bindFormFields } from "../store/helper.js";
import { convertBackendToData, coverParamConfigList } from "../utils/convertBackendToData.js"; import { convertBackendToData, coverParamConfigList } from "../utils/convertBackendToData.js";
import { convertDataToBackend } from "../utils/index.js"; import { convertDataToBackend } from "../utils/index.js";
import detailDialog from "../../components/approvalView"
export default { export default {
name: "PerformanceScheme", name: "PerformanceScheme",
...@@ -104,7 +110,7 @@ export default { ...@@ -104,7 +110,7 @@ export default {
ParamConfigList, ParamConfigList,
ChannelConfig, ChannelConfig,
StoreApply, StoreApply,
detailDialog, DetailDialog: detailDialog,
}, },
data() { data() {
return { return {
...@@ -120,8 +126,7 @@ export default { ...@@ -120,8 +126,7 @@ export default {
computed: { computed: {
...mapState("PerformanceFormStore", ["formData"]), ...mapState("PerformanceFormStore", ["formData"]),
...mapGetters("PerformanceFormStore", ["getMerchantBrandRefList"]), ...mapGetters("PerformanceFormStore", ["getMerchantBrandRefList"]),
schemaName: bindFormFields("schemaName"), schemeName: bindFormFields("schemeName"),
}, },
created() { created() {
...@@ -130,7 +135,6 @@ export default { ...@@ -130,7 +135,6 @@ export default {
this.routeParams = this.$route.query?.params this.routeParams = this.$route.query?.params
? JSON.parse(this.$route.query?.params) ? JSON.parse(this.$route.query?.params)
: {}; : {};
console.log(this.routeParams);
await this.initLoad(); await this.initLoad();
if (this.routeParams.id) { if (this.routeParams.id) {
await this.getDetail(); await this.getDetail();
...@@ -155,10 +159,10 @@ export default { ...@@ -155,10 +159,10 @@ export default {
}, },
handleCheck() { handleCheck() {
this.handleCheckClose() this.handleCheckClose();
}, },
handleCheckClose() { handleCheckClose() {
this.detailVisible = !this.detailVisible this.detailVisible = !this.detailVisible;
}, },
async handleSubmit() { async handleSubmit() {
...@@ -168,17 +172,17 @@ export default { ...@@ -168,17 +172,17 @@ export default {
})); }));
}, },
handleCancel() { handleCancel() {
console.log(this.routeParams.page, '----') console.log(this.routeParams.page, "----");
// this.$EventBus.$emit("salaryPerformanceTab", { // this.$EventBus.$emit("salaryPerformanceTab", {
// tabName: this.routeParams.page // tabName: this.routeParams.page
// }) // })
this.$router.push({ this.$router.push({
name: 'salaryPerformance', name: "salaryPerformance",
params:{ params: {
tabPane:this.routeParams.page == 'performanceList' ? '1' : '0', tabPane: this.routeParams.page == "performanceList" ? "1" : "0",
tabName: this.routeParams.page tabName: this.routeParams.page,
} },
}) });
}, },
async getDetail() { async getDetail() {
const res = await getPerformanceConfigDetailAPI({ id: 214 }); const res = await getPerformanceConfigDetailAPI({ id: 214 });
...@@ -266,7 +270,7 @@ export default { ...@@ -266,7 +270,7 @@ export default {
width: 76px; width: 76px;
border: 1px solid #2a58ad; border: 1px solid #2a58ad;
background: #eff3f6; background: #eff3f6;
color: #2A58AD; color: #2a58ad;
} }
.cancel-btn { .cancel-btn {
color: #666666; color: #666666;
......
...@@ -48,7 +48,12 @@ ...@@ -48,7 +48,12 @@
></glsx-preview> ></glsx-preview>
</div> </div>
<template slot="remark" slot-scope="scope"> <template slot="remark" slot-scope="scope">
<el-popover placement="top" width="fit-content" trigger="hover"> <template v-if="scope.scope.remark">
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div class="tags-popover"> <div class="tags-popover">
{{ scope.scope.remark || "-" }} {{ scope.scope.remark || "-" }}
</div> </div>
...@@ -57,8 +62,15 @@ ...@@ -57,8 +62,15 @@
}}</span> }}</span>
</el-popover> </el-popover>
</template> </template>
<template v-else>-</template>
</template>
<template slot="merchantName" slot-scope="scope"> <template slot="merchantName" slot-scope="scope">
<el-popover placement="top" width="fit-content" trigger="hover"> <template v-if="scope.scope.merchantName">
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div class="tags-popover"> <div class="tags-popover">
{{ scope.scope.merchantName || "-" }} {{ scope.scope.merchantName || "-" }}
</div> </div>
...@@ -67,6 +79,8 @@ ...@@ -67,6 +79,8 @@
}}</span> }}</span>
</el-popover> </el-popover>
</template> </template>
<template v-else>-</template>
</template>
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
...@@ -151,7 +165,7 @@ export default { ...@@ -151,7 +165,7 @@ export default {
} }
}, },
{ {
label: "线上有效引荐数", label: "运营修正有效引荐数",
prop: "reviewedEffectiveCount", prop: "reviewedEffectiveCount",
minWidth: "150", minWidth: "150",
formatter:(cellValue)=>{ formatter:(cellValue)=>{
......
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
class="show-search" class="show-search"
:search-form="searchForm" :search-form="searchForm"
:label-width="'120px'" :label-width="'120px'"
:form-data="showFormData" :form-data="showFormData">
>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch"> <el-button size="small" type="primary" @click="handleSearch">
...@@ -22,24 +21,21 @@ ...@@ -22,24 +21,21 @@
<auth-button <auth-button
category="Button" category="Button"
:show-btn-ids="['9200203']" :show-btn-ids="['9200203']"
data-event-code="evaluation_management_list_export" data-event-code="evaluation_management_list_export" />
/>
</d2-table-header> </d2-table-header>
<d2-table <d2-table
ref="table" ref="table"
:get-list-api="getListApi" :get-list-api="getListApi"
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn">
>
<div slot="coverImage" slot-scope="scope" class="coverImage-preview"> <div slot="coverImage" slot-scope="scope" class="coverImage-preview">
<glsx-preview <glsx-preview
:image-url-arr=" :image-url-arr="
scope.scope.coverImage ? [scope.scope.coverImage] : [noDataUrl] scope.scope.coverImage ? [scope.scope.coverImage] : [noDataUrl]
" "
:pic-options="picOptions" :pic-options="picOptions"
limit="1" limit="1"></glsx-preview>
></glsx-preview>
</div> </div>
<!-- 评估单状态 --> <!-- 评估单状态 -->
<div slot="statusHtml" slot-scope="scope"> <div slot="statusHtml" slot-scope="scope">
...@@ -48,8 +44,7 @@ ...@@ -48,8 +44,7 @@
class="dot" class="dot"
:style="{ :style="{
background: baseData.evaluationStatusOptMap[scope.scope.status] background: baseData.evaluationStatusOptMap[scope.scope.status]
}" }"></span>
></span>
{{ {{
baseData.evaluationStatusOpt.find( baseData.evaluationStatusOpt.find(
(item) => item.confId == scope.scope.status (item) => item.confId == scope.scope.status
...@@ -72,8 +67,7 @@ ...@@ -72,8 +67,7 @@
id: scope.scope.id id: scope.scope.id
}) })
" "
data-event-code="evaluation_management_image_download" data-event-code="evaluation_management_image_download">
>
<auth-button :data="scope.scope" :show-btn-ids="['9200206']" /> <auth-button :data="scope.scope" :show-btn-ids="['9200206']" />
</span> </span>
</div> </div>
...@@ -94,7 +88,8 @@ import { ...@@ -94,7 +88,8 @@ import {
hasAccidentOpt, hasAccidentOpt,
evaluationStatusOpt, evaluationStatusOpt,
evaluationStatusOptMap, evaluationStatusOptMap,
evaluationSourceOpt evaluationSourceOpt,
contractOrgOpt
} from "@/common/constants.js" } from "@/common/constants.js"
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin" import reportTrackPageMixin from "@/mixins/reportTrackPageMixin"
...@@ -286,6 +281,20 @@ export default { ...@@ -286,6 +281,20 @@ export default {
) )
return statusItem ? statusItem.confValue : "-" return statusItem ? statusItem.confValue : "-"
} }
},
{
label: "内部主体",
prop: "contractOrg",
minWidth: 120,
formatter: (cellValue) => {
const statusItem = this.getStatusItem(
this.baseData,
"contractOrgOpt",
cellValue,
"contractOrg"
)
return statusItem ? statusItem.confValue : "-"
}
} }
] ]
}, },
...@@ -309,7 +318,8 @@ export default { ...@@ -309,7 +318,8 @@ export default {
evalOrderTime: [], evalOrderTime: [],
evalOrderNo: "", evalOrderNo: "",
evalOperatorName: "", evalOperatorName: "",
source: "" source: "",
contractOrg: ""
}, },
showFormData: [ showFormData: [
{ {
...@@ -474,6 +484,16 @@ export default { ...@@ -474,6 +484,16 @@ export default {
optionId: "confId", optionId: "confId",
optionLabel: "confValue", optionLabel: "confValue",
optionsName: "evaluationSourceOpt" optionsName: "evaluationSourceOpt"
},
{
label: "内部主体",
name: "contractOrg",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "contractOrgOpt"
} }
], ],
baseData: { baseData: {
...@@ -484,7 +504,8 @@ export default { ...@@ -484,7 +504,8 @@ export default {
hasAccidentOpt: deepClone(hasAccidentOpt), hasAccidentOpt: deepClone(hasAccidentOpt),
evaluationStatusOpt: deepClone(evaluationStatusOpt), evaluationStatusOpt: deepClone(evaluationStatusOpt),
evaluationStatusOptMap: deepClone(evaluationStatusOptMap), evaluationStatusOptMap: deepClone(evaluationStatusOptMap),
evaluationSourceOpt: deepClone(evaluationSourceOpt) evaluationSourceOpt: deepClone(evaluationSourceOpt),
contractOrgOpt: deepClone(contractOrgOpt)
}, },
track_event_code: "evaluation_management" track_event_code: "evaluation_management"
} }
......
...@@ -7,9 +7,36 @@ ...@@ -7,9 +7,36 @@
<div class="item" v-for="(item, index) in configData" :key="index"> <div class="item" v-for="(item, index) in configData" :key="index">
<div class="flex top_box"> <div class="flex top_box">
<div class="title" v-if="item.title">{{ item.title }}</div> <div class="title" v-if="item.title">{{ item.title }}</div>
<el-button class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==1 && activeStep == 0" @click="approve(1)"> 发起定金审批 </el-button> <el-button
<el-button class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==1 && activeStep == 2" @click="approve(2)"> 发起尾款审批 </el-button> class="top-btn"
<el-button class="top-btn" type="primary" size="small" v-if="item.infoData &&detailInfo.paymentType ==2 && activeStep == 2 " @click="approve(2)"> 发起全款审批 </el-button> type="primary"
size="small"
v-preventReClick
:loading="approveLoading.deposit"
v-if="item.infoData && detailInfo.paymentType == 1 && activeStep == 0"
@click="approve(1)">
发起定金审批
</el-button>
<el-button
class="top-btn"
type="primary"
size="small"
v-preventReClick
:loading="approveLoading.final"
v-if="item.infoData && detailInfo.paymentType == 1 && activeStep == 2"
@click="approve(2)">
发起尾款审批
</el-button>
<el-button
class="top-btn"
type="primary"
size="small"
v-preventReClick
:loading="approveLoading.final"
v-if="item.infoData && detailInfo.paymentType == 2 && activeStep == 2"
@click="approve(2)">
发起全款审批
</el-button>
</div> </div>
<div class="detail-content"> <div class="detail-content">
...@@ -377,6 +404,10 @@ export default { ...@@ -377,6 +404,10 @@ export default {
videoStr: "?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast", videoStr: "?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast",
btnLoding: false, btnLoding: false,
loading: false, loading: false,
approveLoading: {
deposit: false, // 定金审批loading
final: false // 尾款/全款审批loading
},
id: this.$route.query.id, id: this.$route.query.id,
rules: { rules: {
description: [ description: [
...@@ -1041,13 +1072,36 @@ export default { ...@@ -1041,13 +1072,36 @@ export default {
if (res.data.code == 0 && res.data.data == 2) { if (res.data.code == 0 && res.data.data == 2) {
const params = { contractNo: this.detailInfo.contractNo, evalOrderNo: this.detailInfo.evalOrderNo } const params = { contractNo: this.detailInfo.contractNo, evalOrderNo: this.detailInfo.evalOrderNo }
if (type == 1) { if (type == 1) {
await webPayDepositApplication(params) this.approveLoading.deposit = true
try {
const res1 = await webPayDepositApplication(params)
console.log(res1, '78787')
if (res1.data.code == 0) {
this.handleCancel() this.handleCancel()
this.$message.success("操作成功") this.$message.success("操作成功")
} else {
this.$message.error(res1.data.msg)
}
} catch (error) {
this.$message.error("操作失败")
} finally {
this.approveLoading.deposit = false
}
} else if (type == 2) { } else if (type == 2) {
await webPayFinalApplication(params) this.approveLoading.final = true
try {
const res2 = await webPayFinalApplication(params)
if (res2.data.code == 0) {
this.handleCancel() this.handleCancel()
this.$message.success("操作成功") this.$message.success("操作成功")
} else {
this.$message.error(res2.data.msg)
}
} catch (error) {
this.$message.error("操作失败")
} finally {
this.approveLoading.final = false
}
} }
} else { } else {
this.$message.error('暂时无法审批') this.$message.error('暂时无法审批')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!