Commit 118b2bbb by 张立顺

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

…stem into SAAS+V5.8.0
2 parents c654565f a22c9f68
Showing 25 changed files with 1054 additions and 280 deletions
import request from "./request" import request from "./request"
import RequestMethods from "./request.methods" import RequestMethods from "./request.methods"
import { getScenesByParams } from "./senseManage"
const path = "dj.api.smartcarlife.feeCategory." const path = "dj.api.smartcarlife.feeCategory."
/** 费用类目-基础场景下拉(启用场景),兼容多种列表字段包裹 */
export function getFeeCategorySceneOptions() {
return getScenesByParams({
pageNum: 1,
pageSize: 10000,
status: 1
}).then((res) => {
const list = Array.isArray(res)
? res
: (res && (res.list || res.records || res.data)) || []
return Array.isArray(list) ? list : []
})
}
// 分页查询费用类目 // 分页查询费用类目
export function selectFeeCategoryList(data) { export function selectFeeCategoryList(data) {
// data.method = `${path}selectFeeCategoryList` // data.method = `${path}selectFeeCategoryList`
......
...@@ -13,7 +13,7 @@ import axios from "@/plugin/axios/index_code"; ...@@ -13,7 +13,7 @@ import axios from "@/plugin/axios/index_code";
import RequestMethods from "./request.methods"; import RequestMethods from "./request.methods";
import sign from "./sign"; import sign from "./sign";
function request(params = {}, method = RequestMethods.GET, noSignAttr = [], options = {}) { function request (params = {}, method = RequestMethods.GET, noSignAttr = [], options = {}) {
// 兼容线上dj和scrm appkey和secret不一样的情况 // 兼容线上dj和scrm appkey和secret不一样的情况
let apiName = ""; let apiName = "";
if (params.method.includes("dj.api.smartcarlife")) { if (params.method.includes("dj.api.smartcarlife")) {
...@@ -33,6 +33,8 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti ...@@ -33,6 +33,8 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti
} else if (params.method.includes("dj.pad.api")) { } else if (params.method.includes("dj.pad.api")) {
// rop-dj-pad 等方法名含 dj.pad,split(".api") 会得到 dj.pad 无 mapping;签名与 appKey 沿用 dj // rop-dj-pad 等方法名含 dj.pad,split(".api") 会得到 dj.pad 无 mapping;签名与 appKey 沿用 dj
apiName = "dj"; apiName = "dj";
} else if (params.method.includes("dj.api.oaapproval")) {
apiName = "oaapproval";
} else { } else {
// console.log(params.method.split(".api")) // console.log(params.method.split(".api"))
apiName = params.method.split(".api")[0]; apiName = params.method.split(".api")[0];
...@@ -58,6 +60,7 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti ...@@ -58,6 +60,7 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti
"riskmanage": "axios10", "riskmanage": "axios10",
"strategy": "axios_strategy", "strategy": "axios_strategy",
"supervisor": "axios_supervisor", "supervisor": "axios_supervisor",
"oaapproval": "axios_oaapproval"
}; };
const baseApiName = mappingName[apiName]; const baseApiName = mappingName[apiName];
// console.log(baseApiName, "baseApiName") // console.log(baseApiName, "baseApiName")
...@@ -94,6 +97,7 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti ...@@ -94,6 +97,7 @@ function request(params = {}, method = RequestMethods.GET, noSignAttr = [], opti
"script": "sha1", "script": "sha1",
"staff": "sha1", "staff": "sha1",
"riskmanage": "sha1", "riskmanage": "sha1",
"oaapproval": "sha1",
}; };
// console.log(signWay[apiName], "baseApiName") // console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret; const secret = baseConfig[baseApiName].secret;
......
import request from "./request" /*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-01-12 14:51:21
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-04-27 17:26:28
* @FilePath: \dj-car-life-system\src\api\salesManagement.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import request from "./request";
// 分页查询潜客数据 // 分页查询潜客数据
export function potentialCustomersPage(data) { export function potentialCustomersPage(data) {
data.method = 'dj.api.smartcarlife.sale.potentialCustomers.page' data.method = "dj.api.smartcarlife.sale.potentialCustomers.page";
return request(data, "post") return request(data, "post");
} }
// 潜客详情数据 // 潜客详情数据
export function potentialCustomersDetail(data) { export function potentialCustomersDetail(data) {
data.method = 'dj.api.smartcarlife.sale.potentialCustomers.detail' data.method = "dj.api.smartcarlife.sale.potentialCustomers.detail";
return request(data, "post") return request(data, "post");
} }
// 首次绑定/重新绑定4S店 // 首次绑定/重新绑定4S店
export function bind4SStore(data) { export function bind4SStore(data) {
data.method = 'dj.api.smartcarlife.sale.potentialCustomers.bind' data.method = "dj.api.smartcarlife.sale.potentialCustomers.bind";
return request(data, "post") return request(data, "post");
} }
// 潜客信息核验提交(与新增商户字段一致;method 待后端确认后替换) // 潜客信息核验提交(与新增商户字段一致;method 待后端确认后替换)
...@@ -26,30 +34,51 @@ export function potentialCustomersInfoVerify(data) { ...@@ -26,30 +34,51 @@ export function potentialCustomersInfoVerify(data) {
// 分页查询大区 // 分页查询大区
export function regionPage(data) { export function regionPage(data) {
data.method = 'dj.api.smartcarlife.sale.region.page' data.method = "dj.api.smartcarlife.sale.region.page";
return request(data, "post") return request(data, "post");
} }
// 获取大区人员 // 获取大区人员
export function regionUserList(data) { export function regionUserList(data) {
data.method = 'dj.api.smartcarlife.sale.region.userList' data.method = "dj.api.smartcarlife.sale.region.userList";
return request(data, "post") return request(data, "post");
} }
// 更新大区人员 // 更新大区人员
export function updateRegionUser(data) { export function updateRegionUser(data) {
data.method = 'dj.api.smartcarlife.sale.region.updateRegionUser' data.method = "dj.api.smartcarlife.sale.region.updateRegionUser";
return request(data, "post") return request(data, "post");
} }
// 区域运营模块接口 // 区域运营模块接口
// 区域运营管理人员列表 // 区域运营管理人员列表
export function organizationUserList(data) { export function organizationUserList(data) {
data.method = 'dj.api.script.province.organization.list' data.method = "dj.api.script.province.organization.list";
return request(data, "post") return request(data, "post");
} }
// 区域运营管理编辑 // 区域运营管理编辑
export function organizationUserUpdate(data) { export function organizationUserUpdate(data) {
data.method = 'dj.api.script.province.organization.upd' data.method = "dj.api.script.province.organization.upd";
return request(data, "post") return request(data, "post");
}
// 关店管理列表/rop-dj-smartcarlife/router/dj.api.smartcarlife.sale.closeStore.page
export function closeStorePage(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.page";
return request(data, "post");
}
//是否关店
export function closeStoreConfirm(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.confirm";
return request(data, "post");
}
// 关店详情
export function closeStoreDetail(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.detail";
return request(data, "post");
}
export function storeApprovePageQuery(data) {
data.method = "dj.api.oaapproval.store.approve.pageQuery";
return request(data, "post");
} }
...@@ -21,7 +21,7 @@ export function disableScene(data) { ...@@ -21,7 +21,7 @@ export function disableScene(data) {
// 获取公共业务场景列表 // 获取公共业务场景列表
export function getScenesByParams(data) { export function getScenesByParams(data) {
data.method = `${path}scene.getScenesByParams`; data.method = `${path}scene.getScenesByParams`;
return request(data, "post"); return request(data, "get");
} }
// 获取场景标签 // 获取场景标签
......
...@@ -34,8 +34,8 @@ Vue.use(VueLazyload, { ...@@ -34,8 +34,8 @@ Vue.use(VueLazyload, {
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",
// 与 vue.config 中 SentryWebpackPlugin.release 一致,sourcemap 才能正确解析栈 // 与 vue.config 中 SentryWebpackPlugin.release 一致,sourcemap 才能正确解析栈
...@@ -54,12 +54,12 @@ process.env.NODE_ENV === "production" ...@@ -54,12 +54,12 @@ 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( hint.originalException.message.startsWith(
"Non-Error exception captured", "Non-Error exception captured"
); );
if (isNonErrorException) { if (isNonErrorException) {
// We want to ignore those kind of errors // We want to ignore those kind of errors
...@@ -68,7 +68,7 @@ process.env.NODE_ENV === "production" ...@@ -68,7 +68,7 @@ process.env.NODE_ENV === "production"
return event; return event;
}, },
// "send-default-pii": true // "send-default-pii": true
}); });
// d2Admin 已导入 // d2Admin 已导入
// import ElementUI from 'element-ui' // import ElementUI from 'element-ui'
...@@ -109,7 +109,7 @@ Vue.directive("preventReClick", { ...@@ -109,7 +109,7 @@ Vue.directive("preventReClick", {
event && event.stopImmediatePropagation(); event && event.stopImmediatePropagation();
} }
}, },
true, true
); );
}, },
}); });
...@@ -117,7 +117,7 @@ let baseConfig = config; ...@@ -117,7 +117,7 @@ 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-cym"
) )
.then( .then(
(response) => { (response) => {
...@@ -127,7 +127,7 @@ fetch( ...@@ -127,7 +127,7 @@ fetch(
(error) => { (error) => {
// 处理错误 // 处理错误
console.log(error); console.log(error);
}, }
) )
.then((response) => { .then((response) => {
const { code, data } = response; const { code, data } = response;
...@@ -147,7 +147,7 @@ fetch( ...@@ -147,7 +147,7 @@ fetch(
// 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) => {
......
...@@ -167,4 +167,37 @@ export const routerName = { ...@@ -167,4 +167,37 @@ export const routerName = {
"salesManagement/availableInStores/tigaListingAndSalesContract/index" "salesManagement/availableInStores/tigaListingAndSalesContract/index"
), ),
}, },
92105: {
path: "/closeStore",
name: "closeStore",
meta: {
title: "关店管理",
authId: "92105",
parentId: "921",
cache: false,
},
auth: [
{
authId: "9210501",
parentId: "92105",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport",
},
{
authId: "9210502",
parentId: "92105",
label: "详情",
handle: "handleDetail",
},
{
authId: "9210503",
parentId: "92105",
label: "关店确认",
handle: "handleCloseStore",
},
],
component: _import("salesManagement/closeStore/index"),
},
}; };
...@@ -670,6 +670,7 @@ ...@@ -670,6 +670,7 @@
import { getParkStore, getServiceStore } from "@api/editCustomer"; import { getParkStore, getServiceStore } from "@api/editCustomer";
import * as api from "@api/finance"; import * as api from "@api/finance";
import { getPlatformMerchantList, getTransferData } from "@api/index"; import { getPlatformMerchantList, getTransferData } from "@api/index";
import { getScenesByParams } from "@api/senseManage";
// import moment from 'moment' // import moment from 'moment'
import dayjs from "dayjs"; import dayjs from "dayjs";
import * as echarts from "echarts"; import * as echarts from "echarts";
...@@ -747,25 +748,25 @@ export default { ...@@ -747,25 +748,25 @@ export default {
}, },
{ {
label: "业务场景", label: "业务场景",
name: "channelType", name: "subSceneType",
type: "select", type: "select",
multiple: true, multiple: true,
collapseTags: true, collapseTags: true,
optionList: [], optionList: [],
optionId: "value", optionId: "id",
optionLabel: "name", optionLabel: "name",
optionsName: "channelTypeList", optionsName: "subSceneTypeList",
changeAttr: (value) => { changeAttr: (value) => {
if (!Array.isArray(value)) { if (!Array.isArray(value)) {
return; return;
} }
if (!value.length) { if (!value.length) {
this.searchForm.channelType = [""]; this.searchForm.baseSceneCode = [""];
return; return;
} }
if (value.includes("") && value.length > 1) { if (value.includes("") && value.length > 1) {
// 多选时,“全部”与具体值互斥;以最后一次选择为准 // 多选时,“全部”与具体值互斥;以最后一次选择为准
this.searchForm.channelType this.searchForm.baseSceneCodeList
= value[value.length - 1] === "" = value[value.length - 1] === ""
? [""] ? [""]
: value.filter(v => v !== ""); : value.filter(v => v !== "");
...@@ -876,8 +877,6 @@ export default { ...@@ -876,8 +877,6 @@ export default {
label: "渠道", label: "渠道",
name: "channelType", name: "channelType",
type: "select", type: "select",
multiple: true,
collapseTags: true,
optionList: [], optionList: [],
optionId: "value", optionId: "value",
optionLabel: "name", optionLabel: "name",
...@@ -938,6 +937,7 @@ export default { ...@@ -938,6 +937,7 @@ export default {
manageTypeList: deepClone(manageTypeList), manageTypeList: deepClone(manageTypeList),
PlatformMerchantList: [], PlatformMerchantList: [],
channelTypeList: [], channelTypeList: [],
subSceneTypeList: [],
reconciliationFlagList: [], reconciliationFlagList: [],
}, },
total: 0, total: 0,
...@@ -1092,6 +1092,11 @@ export default { ...@@ -1092,6 +1092,11 @@ export default {
this.baseData.PlatformMerchantList = res; this.baseData.PlatformMerchantList = res;
this.getOptionsList(); this.getOptionsList();
}); });
getScenesByParams({}).then((res) => {
const list = Array.isArray(res) ? res : (Array.isArray(res?.data) ? res.data : []);
this.baseData.subSceneTypeList = list.map(({ id, name }) => ({ id, name }));
this.getOptionsList();
});
this.getBaseData(); this.getBaseData();
}, },
methods: { methods: {
......
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2026-02-04 10:27:58
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2026-04-27 15:43:24
* @FilePath: \dj-car-life-system\src\views\residentManage\inStoreManage\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 驻店管理 - 列表 --> <!-- 驻店管理 - 列表 -->
<template> <template>
<div> <div>
......
...@@ -77,10 +77,10 @@ ...@@ -77,10 +77,10 @@
@click="handleDetail(scope.scope)" @click="handleDetail(scope.scope)"
>查看</el-button> >查看</el-button>
<!--👇 仅系统状态=“草稿”的记录可操作 --> <!--👇 仅系统状态=“草稿”的记录可操作 -->
<!-- <el-button <el-button
type="text" type="text"
@click="handleEdit(scope.scope)" @click="handleEdit(scope.scope)"
>编辑</el-button> --> >编辑</el-button>
<!--👇 仅审批状态=“已驳回”“已撤销”“通过后撤销”的记录可操作 --> <!--👇 仅审批状态=“已驳回”“已撤销”“通过后撤销”的记录可操作 -->
<el-button <el-button
type="text" type="text"
...@@ -105,7 +105,7 @@ import { ...@@ -105,7 +105,7 @@ import {
LISTING_TYPE, LISTING_TYPE,
LISTING_TYPE_OPTIONS LISTING_TYPE_OPTIONS
} from './constant' } from './constant'
import { getPurchaseOrderList } from '@/api/purchaseShopping.js' import { storeApprovePageQuery } from '@/api/salesManagement.js'
export default { export default {
name: 'availableInStores', name: 'availableInStores',
components: { components: {
...@@ -113,40 +113,40 @@ export default { ...@@ -113,40 +113,40 @@ export default {
data () { data () {
return { return {
searchForm: { searchForm: {
a: '', businessCode: '',
b: '', trafficPartyInfo: '',
c: '', workWechatCode: '',
d: '', approveType: '',
e: '', systemStatus: '',
f: '', approveStatus: '',
g: '', shelfType: '',
h: '' baseSceneCode: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
tableData: [], tableData: [],
showFormData: [ showFormData: [
{ {
label: '单据编码', label: '单据编码',
name: 'a', name: 'businessCode',
maxlength: 20, maxlength: 20,
addHtml: 'customInput' addHtml: 'customInput'
}, },
{ {
label: '流量方信息', label: '流量方信息',
name: 'b', name: 'trafficPartyInfo',
type: 'input', type: 'input',
isClear: true, isClear: true,
maxlength: 50 maxlength: 50
}, },
{ {
label: '审批编码', label: '审批编码',
name: 'c', name: 'workWechatCode',
maxlength: 20, maxlength: 20,
addHtml: 'customInput' addHtml: 'customInput'
}, },
{ {
label: '审批类型', label: '审批类型',
name: 'd', name: 'approveType',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
}, },
{ {
label: '系统状态', label: '系统状态',
name: 'e', name: 'systemStatus',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
}, },
{ {
label: '审批状态', label: '审批状态',
name: 'f', name: 'approveStatus',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
...@@ -173,7 +173,7 @@ export default { ...@@ -173,7 +173,7 @@ export default {
}, },
{ {
label: '上架类型', label: '上架类型',
name: 'g', name: 'shelfType',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
...@@ -182,7 +182,7 @@ export default { ...@@ -182,7 +182,7 @@ export default {
}, },
{ {
label: '业务场景', label: '业务场景',
name: 'h', name: 'baseSceneCode',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
...@@ -190,7 +190,7 @@ export default { ...@@ -190,7 +190,7 @@ export default {
optionsName: 'businessSceneOptions' optionsName: 'businessSceneOptions'
} }
], ],
getListApi: getPurchaseOrderList, getListApi: storeApprovePageQuery,
// 表格参数 // 表格参数
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
...@@ -201,56 +201,55 @@ export default { ...@@ -201,56 +201,55 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '单据编码', label: '单据编码',
prop: 'a' prop: 'businessCode'
}, },
{ {
label: '上架类型', label: '上架类型',
prop: 'b', prop: 'shelfTypeName',
// formatter: (cellValue) => {
// return deepClone(LISTING_TYPE_OPTIONS.find(item => item.id == cellValue.shelfType)?.label);
// },
}, },
{ {
label: '业务场景', label: '业务场景',
prop: 'c', prop: 'sceneTypeName',
}, },
{ {
label: '流量方信息', label: '流量方信息',
prop: 'd', prop: 'trafficPartyInfo',
minWidth: 120, minWidth: 120,
}, },
{ {
label: '审批类型', label: '审批类型',
prop: 'e', prop: 'approveTypeName',
// formatter: (cellValue) => {
// return deepClone(APPROVAL_TYPE_OPTIONS.find(item => item.id == cellValue.approveType)?.label);
// },
}, },
{ {
label: '审批编码', label: '审批编码',
prop: 'f', prop: 'workWechatCode',
}, },
{ {
label: '提交时间', label: '提交时间',
prop: 'g', prop: 'submitDate',
// formatter: (cellValue) => {
// return defaultPutStatusOptions.find(item => item.id == cellValue.putStatus)?.label || '-'
// },
// className: (cellValue) => {
// return {
// 1: 'ashSpot',
// 2: 'greenSpot',
// 3: 'yellowSpot'
// }[cellValue.putStatus]
// }
}, },
{ {
label: '提交人', label: '提交人',
prop: 'h' prop: 'createdBy'
}, },
{ {
label: '系统状态', label: '系统状态',
prop: 'i', prop: 'systemStatusName',
// formatter: (cellValue) => {
// return deepClone(SYSTEM_STATUS_OPTIONS.find(item => item.id == cellValue.systemStatus)?.label);
// },
}, },
{ {
label: '审批状态', label: '审批状态',
prop: 'j', prop: 'approveStatus',
formatter: (cellValue) => { formatter: (cellValue) => {
return deepClone(approveStatusOpt.find(item => item.confId === cellValue.approveStatus)?.confValue); return deepClone(approveStatusOpt.find(item => item.confId == cellValue.approveStatus)?.confValue);
}, },
className: (cellValue) => { className: (cellValue) => {
return { return {
......
...@@ -41,15 +41,15 @@ export default { ...@@ -41,15 +41,15 @@ export default {
data () { data () {
return { return {
businessInformation: [ businessInformation: [
{ label: '嘀加毛利', key: 'a', type: 'text' }, { label: '嘀加毛利', key: 'b-a', type: 'text' },
{ label: '嘀加毛利率', key: 'b', type: 'text' }, { label: '嘀加毛利率', key: 'b-b', type: 'text' },
{ label: '预估交付数/月', key: 'c', filterRule: 'integerRange', min: 0, max: 999999, maxlength: 6 }, { label: '预估交付数/月', key: 'b-c', filterRule: 'integerRange', min: 0, max: 999999, maxlength: 6 },
{ label: '预估触客率', key: 'd', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 }, { label: '预估触客率', key: 'b-d', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '人员成本', key: 'e', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '人员成本', key: 'personnelCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '房租', key: 'f', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '房租', key: 'rentCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '折旧与摊销', key: 'g', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '折旧与摊销', key: 'depreciationCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '其他(水电、耗材等)', key: 'h', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '其他(水电、耗材等)', key: 'otherCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '门店单台利润额', key: 'i', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '门店单台利润额', key: 'b-j', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
] ]
} }
}, },
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
label-width="150px" label-width="150px"
size="small" size="small"
:rules="rules" :rules="rules"
@submit.native.prevent="handleSubmit"
> >
<template v-for="(item,index) in salesCategoryList"> <template v-for="(item,index) in salesCategoryList">
<div <div
...@@ -129,23 +130,23 @@ export default { ...@@ -129,23 +130,23 @@ export default {
loading: false, loading: false,
data: {}, data: {},
rules: { rules: {
a: [{ required: true, validator: validatorFrom }], productType: [{ required: true, validator: validatorFrom }],
b: [{ required: true, validator: validatorFrom }], productCategory: [{ required: true, validator: validatorFrom }],
c: [{ required: true, validator: validatorFrom }], feeSettlementMode: [{ required: true, validator: validatorFrom }],
d: [{ required: true, validator: validatorFrom }], penetrationRate: [{ required: true, validator: validatorFrom }],
e: [{ required: true, validator: validatorFrom }], conversionRate: [{ required: true, validator: validatorFrom }],
f: [{ required: true, validator: validatorFrom }], revenuePerCar: [{ required: true, validator: validatorFrom }],
g: [{ required: true, validator: validatorFrom }], g: [{ required: true, validator: validatorFrom }],
h: [{ required: true, validator: validatorFrom }], upgradePrice: [{ required: true, validator: validatorFrom }],
i: [{ required: true, validator: validatorFrom }], revenue: [{ required: true, validator: validatorFrom }],
j: [{ required: true, validator: validatorFrom }], trafficFee: [{ required: true, validator: validatorFrom }],
k: [{ required: true, validator: validatorFrom }], marketFee1: [{ required: true, validator: validatorFrom }],
l: [{ required: true, validator: validatorFrom }], marketFee2: [{ required: true, validator: validatorFrom }],
m: [{ required: true, validator: validatorFrom }], incentive1: [{ required: true, validator: validatorFrom }],
n: [{ required: true, validator: validatorFrom }], incentive2: [{ required: true, validator: validatorFrom }],
o: [{ required: true, validator: validatorFrom }], resourceFee: [{ required: true, validator: validatorFrom }],
p: [{ required: true, validator: validatorFrom }], productCost: [{ required: true, validator: validatorFrom }],
q: [{ required: true, validator: validatorFrom }], recyclingFilm: [{ required: true, validator: validatorFrom }],
} }
} }
}, },
......
...@@ -119,12 +119,12 @@ export default { ...@@ -119,12 +119,12 @@ export default {
componentData: {}, componentData: {},
editStatus: false, editStatus: false,
trafficProviderInformation: [ trafficProviderInformation: [
{ label: '流量方信息', key: 'a', type: 'input', disabled: true }, { label: '流量方信息', key: 'trafficPartyName', type: 'input', disabled: true },
{ label: '集团(上级商户)', key: 'b', type: 'input', disabled: true }, { label: '集团(上级商户)', key: 'parentPartnerName', type: 'input', disabled: true },
{ label: '开通场景', key: 'c', type: 'input', disabled: true }, { label: '开通场景', key: 't-c', type: 'input', disabled: true },
{ label: '签约主体', key: 'd', type: 'select', options: [] }, { label: '签约主体', key: 'contractingMerchantName', type: 'select', options: [] },
{ {
label: '业务模式', key: 'e', type: 'select', options: [ label: '业务模式', key: 'businessMode', type: 'select', options: [
{ {
label: '直营渠道', label: '直营渠道',
value: '1' value: '1'
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
] ]
}, },
{ {
label: '运营模式', key: 'f', type: 'select', options: [ label: '运营模式', key: 'operationMode', type: 'select', options: [
{ {
label: '直营', label: '直营',
value: '1' value: '1'
...@@ -151,15 +151,15 @@ export default { ...@@ -151,15 +151,15 @@ export default {
}, },
] ]
}, },
{ label: '服务商2/F公司', key: 'g', type: 'select', options: [] }, { label: '服务商2/F公司', key: 't-g', type: 'select', options: [] },
{ label: '服务商', key: 'h', type: 'select', options: [] }, { label: '服务商', key: 't-h', type: 'select', options: [] },
{ label: '上级服务商', key: 'i', type: 'input', options: [], maxlength: 50 }, { label: '上级服务商', key: 't-i', type: 'input', options: [], maxlength: 50 },
{ label: '园区店', key: 'j', type: 'select', options: [] }, { label: '园区店', key: 't-j', type: 'select', options: [] },
], ],
customerInformation: [ customerInformation: [
{ label: '区域运营', key: 'l', type: 'select', options: [] }, { label: '区域运营', key: 'areaOpId', type: 'select', options: [] },
{ label: '线上运营', key: 'm', type: 'select', options: [] }, { label: '线上运营', key: 'onlineOpId', type: 'select', options: [] },
{ label: '区域督导', key: 'n', type: 'select', options: [] }, { label: '区域督导', key: 'regionSupervisorId', type: 'select', options: [] },
] ]
} }
}, },
......
const SALES_CATEGORY_LIST = [ const SALES_CATEGORY_LIST = [
{ {
title: '销售范围', list: [ title: '销售范围', list: [
{ label: '类型', key: 'a', type: 'select', options: [] }, { label: '类型', key: 'productType', type: 'select', options: [] },
{ label: '销售品类', key: 'b', type: 'select', options: [] }, { label: '销售品类', key: 'productCategory', type: 'select', options: [] },
{ {
label: '流量费结算模式', key: 'c', type: 'select', options: [ label: '流量费结算模式', key: 'feeSettlementMode', type: 'select', options: [
{ label: '按信息量', value: '1' }, { label: '按信息量', value: '1' },
{ label: '按有效流量', value: '2' }, { label: '按有效流量', value: '2' },
{ label: '按销售额', value: '3' }, { label: '按销售额', value: '3' },
...@@ -14,32 +14,32 @@ const SALES_CATEGORY_LIST = [ ...@@ -14,32 +14,32 @@ const SALES_CATEGORY_LIST = [
}, },
{ {
title: '兜底要求', list: [ title: '兜底要求', list: [
{ label: '渗透率', key: 'd', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 }, { label: '渗透率', key: 'penetrationRate', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '转化率', key: 'e', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 }, { label: '转化率', key: 'conversionRate', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '单车采购产值', key: 'f', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '单车采购产值', key: 'revenuePerCar', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
] ]
}, },
{ {
title: '预估经营数据', list: [ title: '预估经营数据', list: [
{ label: '转化率', key: 'g', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 }, { label: '转化率', key: 'g', type: 'input', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '升级客单价', key: 'h', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '升级客单价', key: 'upgradePrice', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '产值', key: 'i', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '产值', key: 'revenue', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
] ]
}, },
{ {
title: '商务政策', list: [ title: '商务政策', list: [
{ label: '流量费', key: 'j', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '流量费', key: 'trafficFee', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '管理层市场费1', key: 'k', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '管理层市场费1', key: 'marketFee1', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '管理层市场费2', key: 'l', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '管理层市场费2', key: 'marketFee2', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '一线阳光激励1', key: 'm', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '一线阳光激励1', key: 'incentive1', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '一线阳光激励2', key: 'n', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '一线阳光激励2', key: 'incentive2', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '资源费', key: 'o', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '资源费', key: 'resourceFee', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
] ]
}, },
{ {
title: '预估运营成本', list: [ title: '预估运营成本', list: [
{ label: '产品成本', key: 'p', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '产品成本', key: 'productCost', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '原厂回收膜', key: 'q', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '原厂回收膜', key: 'recyclingFilm', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
] ]
}, },
] ]
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
:size="size" :size="size"
class="step-select" class="step-select"
:disabled="trafficProviderInformationDisabled" :disabled="trafficProviderInformationDisabled"
@change="changeMerchant"
> >
<el-option <el-option
v-for="item in infoForm.trafficProviderInformation" v-for="item in infoForm.trafficPartyDetails"
:key="item.merchantId" :key="item.merchantId"
:label="item.merchantName" :label="item.merchantName"
:value="item.merchantId" :value="item.merchantId"
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
</el-select> </el-select>
</div> </div>
<TrafficProviderInformation <TrafficProviderInformation
:data="infoForm.trafficProviderInformation.find(item => item.merchantId === merchantId)" :data="infoForm.trafficPartyDetails.find(item => item.merchantId === merchantId)"
:isViewMode="isViewMode" :isViewMode="isViewMode"
@updateData="updateTrafficProviderInformation" @updateData="updateTrafficProviderInformation"
@edit="trafficProviderInformationDisabled = $event" @edit="trafficProviderInformationDisabled = $event"
...@@ -50,15 +51,15 @@ ...@@ -50,15 +51,15 @@
<div class="step-title"> <div class="step-title">
销售品类 销售品类
<el-select <el-select
v-model="goodsId" v-model="productValue"
:size="size" :size="size"
class="step-select" class="step-select"
> >
<el-option <el-option
v-for="item in infoForm.salesCategory" v-for="(item, p_index) in productDetails"
:key="item.goodsId" :key="`product-${p_index}`"
:label="item.goodsName" :label="item.productType + '+' + item.productCategory"
:value="item.goodsId" :value="item.productType + '+' + item.productCategory"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -113,37 +114,43 @@ export default { ...@@ -113,37 +114,43 @@ export default {
formRef () { formRef () {
return this.$refs.formRef return this.$refs.formRef
}, },
rules () { productDetails () {
return { return this.infoForm.trafficPartyDetails.find(item => item.merchantId == this.merchantId)?.productDetails || []
// Add your rules here
} }
}, },
salesCategoryData () {
let { goodsId } = this
return this.infoForm.salesCategory.find(item => item.goodsId == goodsId)
},
},
data () { data () {
return { return {
size: 'mini', size: 'mini',
merchantId: '1', merchantId: '1',
goodsId: '1', productValue: '类型1+品类1-1',
/**表单 */ /**表单 */
infoForm: { infoForm: {
/**流量方信息 */ /**流量方信息 */
trafficProviderInformation: [ trafficPartyDetails: [
{ merchantId: '1', merchantName: ' merchantName', i: 123 }, {
{ merchantId: '2', merchantName: ' merchantName2', i: 456 } merchantId: '1', merchantName: ' merchantName',
i: 123, productDetails: [
{ productType: '类型1', productCategory: ' 品类1-1' },
{ productType: '类型1', productCategory: ' 品类1-2' }
]
},
{
merchantId: '2', merchantName: ' merchantName2',
i: 456, productDetails: [
{ productType: '类型2', productCategory: ' 品类2-1' },
{ productType: '类型2', productCategory: ' 品类2-2' }
]
}
], ],
businessInformation: {}, businessInformation: {},
salesCategory: [
{ goodsId: '1', goodsName: ' goodsName' },
{ goodsId: '2', goodsName: ' goodsName2' }
]
}, },
salesCategoryData: {},
basicinformationData: {}, // 基础信息数据 basicinformationData: {}, // 基础信息数据
basicinformationFormList: [], // 基础信息表单列表 basicinformationFormList: [], // 基础信息表单列表
trafficProviderInformationDisabled: false, trafficProviderInformationDisabled: false,
rules: {
}
} }
}, },
...@@ -155,8 +162,13 @@ export default { ...@@ -155,8 +162,13 @@ export default {
}, },
updateTrafficProviderInformation (data) { updateTrafficProviderInformation (data) {
let { merchantId } = this, let { merchantId } = this,
index = this.infoForm.trafficProviderInformation.findIndex(item => item.merchantId === merchantId) index = this.infoForm.trafficPartyDetails.findIndex(item => item.merchantId === merchantId)
this.$set(this.infoForm.trafficProviderInformation, index, data) this.$set(this.infoForm.trafficPartyDetails, index, data)
},
changeMerchant (merchantId) {
this.merchantId = merchantId
let [productDetails] = this.productDetails
this.productValue = productDetails.productType + '+' + productDetails.productCategory
}, },
} }
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
.step-content { .step-content {
background: #fff; background: #fff;
margin-right: 24px;
margin-left: 24px;
.step-title { .step-title {
position: sticky; position: sticky;
......
...@@ -192,7 +192,7 @@ export default { ...@@ -192,7 +192,7 @@ export default {
} }
.layout { .layout {
height: calc(100vh - 125px); height: calc(100vh - 125px);
padding: 0 24px; // padding: 0 24px;
box-sizing: border-box; box-sizing: border-box;
.detail-box { .detail-box {
position: relative; position: relative;
......
<!-- 关店详情弹窗 -->
<template>
<el-dialog title="详情" class="detail-dialog" :visible.sync="visible" width="1080px" @close="handleClose"
:close-on-click-modal="false">
<div class="detail-content" v-loading="loading">
<!-- 门店详情标题与状态 -->
<div class="section-header">
<span class="section-title">门店详情</span>
<span :class="['status-tag', detailInfo.status == 1 ? 'status-warning' : 'status-success']">
{{ detailInfo.status == 1 ? '待关店' : (detailInfo.status == 3 ? '已关店' : '') }}
</span>
</div>
<!-- 门店详情表单展示 -->
<div class="section-body">
<glsx-combi-form class="show-form-container" ref="showFormRef" :label-width="labelWidth" :form-obj="detailInfo"
:form-data="showFormData">
</glsx-combi-form>
</div>
<!-- 关店风险 -->
<div class="section-header mt-20">
<span class="section-title">关店风险</span>
</div>
<div class="section-body">
<div class="risk-alert">
<i class="el-icon-warning risk-icon"></i>
<span class="risk-text">{{ detailInfo.hitRuleTypeName || '-' }}</span>
</div>
</div>
<!-- 操作记录 -->
<template v-if="recordList && recordList.length > 0">
<div class="section-header mt-20">
<span class="section-title">操作记录</span>
</div>
<div class="section-body">
<div class="record-list">
<div class="record-item" v-for="(item, index) in recordList" :key="index">
<div class="record-col">操作人:<span class="record-val">{{ item.confirmedByName || '-' }}</span></div>
<div class="record-col">操作时间:<span class="record-val">{{ item.closeTime || '-' }}</span></div>
<div class="record-col">关店原因:<span class="record-val">{{ getReasonText(item) }}</span></div>
</div>
</div>
</div>
</template>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleClose">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import { closeStoreDetail } from '@api/salesManagement'
import { busTypeOpt, cooperModeOpt } from '../../constant/baseData'
export default {
name: 'CloseStoreDetailDialog',
props: {
dialogVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => null
}
},
data() {
const editItemStyle = {
width: "50%",
marginRight: '0px',
marginBottom: '10px'
}
const contentStyle = {
width: "180px",
display: 'inline-block',
'word-break': 'break-all',
'white-space': 'pre-wrap',
color: '#333'
}
return {
loading: false,
labelWidth: '140px',
detailInfo: {},
recordList: [], // 操作记录列表
showFormData: [
{
label: '门店名称',
name: 'storeName',
type: 'showTxt',
style: editItemStyle,
txtStyle: contentStyle
},
{
label: '业务类型',
name: 'businessTypeList',
type: 'showTxt',
style: editItemStyle,
txtStyle: contentStyle,
formatter: (cellValue) => {
return cellValue.businessTypeList ? cellValue.businessTypeList.map(item => busTypeOpt.find(opt => opt.confId == item.businessType)?.confLabel || '').join(',') : '-'
}
},
{
label: '合作模式',
name: 'cooperationMode',
type: 'showTxt',
style: editItemStyle,
txtStyle: contentStyle,
formatter: (cellValue) => {
return cooperModeOpt.find(opt => opt.confId == cellValue.cooperationMode)?.confLabel || '-'
}
},
{
label: '主营品牌',
name: 'brandList',
type: 'showTxt',
style: editItemStyle,
txtStyle: contentStyle,
formatter: (cellValue) => {
return cellValue.brandList ? cellValue.brandList.map(item => item.subBrandName).join(',') : '-'
}
},
{
label: '关联商户',
name: 'merchantName',
type: 'showTxt',
style: editItemStyle,
txtStyle: contentStyle,
formatter: (cellValue) => {
return ((cellValue.merchantName || '') + (cellValue.merchantId ? ('(' + cellValue.merchantId + ')') : '')) || '-'
}
},
{
label: '所在地区',
name: 'area',
type: 'showTxt',
style: editItemStyle,
txtStyle: contentStyle,
formatter: (cellValue) => {
return (cellValue.provinceName || '') + (cellValue.city || '') + (cellValue.districtName || '') || '-'
}
},
{
label: '详细地址',
name: 'address',
type: 'showTxt',
style: { width: '100%', marginRight: '0px', marginBottom: '10px' },
txtStyle: { ...contentStyle, width: '500px' }
}
]
}
},
computed: {
visible: {
get() {
return this.dialogVisible
},
set(val) {
this.$emit('update:dialogVisible', val)
}
}
},
watch: {
dialogVisible(val) {
if (val && this.recordInfo) {
this.getDetail()
}
}
},
methods: {
handleClose() {
this.visible = false
},
getDetail() {
this.loading = true
this.detailInfo = { ...this.recordInfo }
closeStoreDetail({ id: this.recordInfo.id }).then(res => {
this.loading = false
if (res) {
this.detailInfo = { ...this.detailInfo, ...res }
this.recordList = res.recordList || []
if (this.recordList.length === 0 && this.detailInfo.status === 3) {
this.recordList.push({
confirmedByName: this.detailInfo.confirmedByName || this.detailInfo.followUpPersonName,
closeTime: this.detailInfo.closeTime,
confirmReason: this.detailInfo.confirmReason,
confirmRemark: this.detailInfo.confirmRemark
})
}
}
}).catch(() => {
this.loading = false
})
},
getReasonText(item) {
if (!item.confirmReason) return '-';
if (item.confirmReason === '其他') {
return '其他 - ' + (item.confirmRemark || '');
}
return item.confirmReason;
}
}
}
</script>
<style scoped lang="scss">
.detail-dialog {
::v-deep .el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
::v-deep .el-dialog__body {
padding: 20px 30px;
}
::v-deep .el-dialog__footer {
border-top: 1px solid #e5e5e5;
padding: 10px 20px;
}
}
.detail-content {
.mt-20 {
margin-top: 20px;
}
.section-header {
display: flex;
align-items: center;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #f0f0f0;
.section-title {
font-size: 16px;
font-weight: bold;
color: #333;
margin-right: 15px;
}
.status-tag {
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
border: 1px solid transparent;
}
.status-warning {
color: #ff9900;
background: #fff5e6;
border-color: #ff9900;
}
.status-success {
color: #19be6b;
background: #e8f8f0;
border-color: #19be6b;
}
}
.section-body {
::v-deep .el-form-item {
margin-bottom: 0;
}
::v-deep .el-form-item__label {
color: #666;
}
.risk-alert {
display: flex;
align-items: center;
background-color: #fff8f0;
border-radius: 4px;
padding: 12px 16px;
.risk-icon {
color: #ff9900;
font-size: 18px;
margin-right: 10px;
}
.risk-text {
color: #333;
font-size: 14px;
}
}
.record-list {
.record-item {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
font-size: 14px;
.record-col {
color: #666;
flex: 1;
.record-val {
color: #333;
}
}
}
}
}
}
</style>
<!-- 关店确认弹窗 -->
<template>
<el-dialog title="关店确认" class="close-dialog" :visible.sync="visible" width="700px" @close="handleClose"
:close-on-click-modal="false">
<glsx-combi-form ref="editFormRef" class="edit-form-container" default-width="400px" :default-width="defaultWidth"
:form-data="editFormData" :form-obj="addForm" :form-ref="editChildRef" :form-rules="formRules" :is-block="isBlock"
:label-width="labelWidth">
<template #confirmResultHtml>
<el-radio-group v-model="addForm.confirmResult" @change="handleResultChange">
<el-radio :label="1">是</el-radio>
<el-radio :label="2">否</el-radio>
</el-radio-group>
</template>
</glsx-combi-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleSubmit" :loading="loading">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import { closeStoreConfirm } from '@api/salesManagement'
export default {
name: 'CloseStoreDialog',
props: {
dialogVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => null
}
},
data() {
return {
loading: false,
labelWidth: "140px",
defaultWidth: "400px",
editChildRef: "editChildRef",
isBlock: true,
addForm: {
confirmResult: 1, // 默认选是
confirmReason: '合作渗透率连续未达标,终止合作', // 默认原因
confirmRemark: ''
},
editFormData: [
{
label: "是否关闭此门店:",
name: "confirmResult",
addHtml: "confirmResultHtml",
},
{
label: "关店原因:",
name: "confirmReason",
type: "select",
isClear: true,
optionList: [
{ label: '合作渗透率连续未达标,终止合作', value: '合作渗透率连续未达标,终止合作' },
{ label: '无人员稳定在岗', value: '无人员稳定在岗' },
{ label: '三方切换', value: '三方切换' },
{ label: '其他', value: '其他' }
],
optionId: "value",
optionLabel: "label",
isHide: false,
changeAttr: (value) => {
const index = this.editFormData.findIndex(item => item.name === 'confirmRemark');
if (index > -1) {
if (value !== '其他') {
this.addForm.confirmRemark = ''
}
this.$set(this.editFormData[index], 'isHide', value !== '其他');
}
}
},
{
label: "关店原因:",
name: "confirmRemark",
placeholder: "请输入",
type: "textarea",
showLimit: true,
isClear: true,
maxlength: 50,
rows: 4,
isHide: true
}
],
formRules: {
confirmResult: [
{ required: true, message: '请选择是否关闭此门店', trigger: 'change' }
],
confirmReason: [
{
required: true, validator: (rule, value, callback) => {
if (this.addForm.confirmResult === 1 && !value) {
callback(new Error('请选择关店原因'));
} else {
callback();
}
}, trigger: 'change'
}
],
confirmRemark: [
{
required: true, validator: (rule, value, callback) => {
if (this.addForm.confirmResult === 1 && this.addForm.confirmReason === '其他' && !value) {
callback(new Error('请输入关店原因'));
} else {
callback();
}
}, trigger: 'blur'
}
]
}
}
},
computed: {
visible: {
get() {
return this.dialogVisible
},
set(val) {
this.$emit('update:dialogVisible', val)
}
}
},
watch: {
dialogVisible(val) {
if (val) {
this.addForm = {
confirmResult: 1,
confirmReason: '合作渗透率连续未达标,终止合作',
confirmRemark: ''
}
// 重置时也需要恢复动态显示状态
const reasonIdx = this.editFormData.findIndex(item => item.name === 'confirmReason');
const remarkIdx = this.editFormData.findIndex(item => item.name === 'confirmRemark');
if (reasonIdx > -1) this.$set(this.editFormData[reasonIdx], 'isHide', false);
if (remarkIdx > -1) this.$set(this.editFormData[remarkIdx], 'isHide', true);
if (this.$refs.editFormRef && this.$refs.editFormRef.$refs[this.editChildRef]) {
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate()
}
}
}
},
methods: {
handleClose() {
this.visible = false
},
handleResultChange(val) {
const reasonIdx = this.editFormData.findIndex(item => item.name === 'confirmReason');
const remarkIdx = this.editFormData.findIndex(item => item.name === 'confirmRemark');
if (val === 2) {
if (reasonIdx > -1) this.$set(this.editFormData[reasonIdx], 'isHide', true);
if (remarkIdx > -1) this.$set(this.editFormData[remarkIdx], 'isHide', true);
this.addForm.confirmReason = '';
this.addForm.confirmRemark = '';
} else {
if (reasonIdx > -1) this.$set(this.editFormData[reasonIdx], 'isHide', false);
this.addForm.confirmReason = '合作渗透率连续未达标,终止合作';
if (remarkIdx > -1) this.$set(this.editFormData[remarkIdx], 'isHide', true);
}
if (this.$refs.editFormRef && this.$refs.editFormRef.$refs[this.editChildRef]) {
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate();
}
},
handleSubmit() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) {
this.loading = true
const params = {
id: this.recordInfo.id,
confirmResult: this.addForm.confirmResult,
}
if (this.addForm.confirmResult === 1) {
params.confirmReason = this.addForm.confirmReason
if (this.addForm.confirmReason === '其他') {
params.confirmRemark = this.addForm.confirmRemark
}
}
closeStoreConfirm(params).then(() => {
this.$message.success('操作成功')
this.loading = false
this.visible = false
this.$emit('refresh')
}).catch(() => {
this.loading = false
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.close-dialog {
::v-deep {
.el-input__count {
right: 10px !important;
bottom: 1px !important;
font-size: 12px;
color: #999999;
}
}
::v-deep {
.el-dialog__footer {
border-top: 1px solid #e5e5e5 !important;
}
}
::v-deep .el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
}
</style>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
item.confLabel }}</el-radio> item.confLabel }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="" prop="applicationSceneTypes"> <el-form-item label="" prop="baseSceneCodeList">
<span class="tips-block" slot="label"> <span class="tips-block" slot="label">
<span class="tips-label">应用场景</span> <span class="tips-label">应用场景</span>
<el-tooltip popper-class="tooltip-class" effect="dark" placement="right"> <el-tooltip popper-class="tooltip-class" effect="dark" placement="right">
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<span class="tips-icon" /> <span class="tips-icon" />
</el-tooltip>: </el-tooltip>:
</span> </span>
<el-checkbox-group v-model="form.applicationSceneTypes"> <el-checkbox-group v-model="form.baseSceneCodeList">
<el-checkbox v-for="(item, index) in sceneTypeList" :key="index" :label="item.confId">{{ item.confValue <el-checkbox v-for="(item, index) in sceneTypeList" :key="item.baseSceneCode || index" :label="item.baseSceneCode">{{ item.name
}}</el-checkbox> }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<!-- <p class="tips"> <!-- <p class="tips">
...@@ -116,15 +116,14 @@ ...@@ -116,15 +116,14 @@
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { addFeeCategory, editFeeCategory, queryById } from '@api/costCategory' import { addFeeCategory, editFeeCategory, queryById, getFeeCategorySceneOptions } from '@api/costCategory'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { sceneCodeList } from '@/common/constants.js'
export default { export default {
name: 'EditLedger', name: 'EditLedger',
data() { data() {
return { return {
sceneTypeList: deepClone(sceneCodeList), sceneTypeList: [],
objList: [ objList: [
{ {
confId: 1, confId: 1,
...@@ -153,14 +152,16 @@ export default { ...@@ -153,14 +152,16 @@ export default {
feeCategoryName: '', feeCategoryName: '',
feeCategoryType: 1, // 1= 分账类目;2= 对账类目; feeCategoryType: 1, // 1= 分账类目;2= 对账类目;
categoryToSort: 1, categoryToSort: 1,
applicationSceneTypes: [], baseSceneCodeList: [],
applicationObjectType: 1, applicationObjectType: 1,
formType: 1, formType: 1,
tableData: [] tableData: []
}, },
formRules: { formRules: {
applicationSceneTypes: [{ baseSceneCodeList: [{
required: true, required: true,
type: 'array',
min: 1,
message: '请选择应用场景', message: '请选择应用场景',
trigger: 'change' trigger: 'change'
}], }],
...@@ -189,12 +190,7 @@ export default { ...@@ -189,12 +190,7 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
this.addOrEdit = this.$route.params.addOrEdit this.initPage()
if (this.addOrEdit === 'edit') {
this.isDisabled = true
this.recordId = this.$route.params.info.id
this.getById(this.recordId)
}
}, },
methods: { methods: {
...@@ -202,6 +198,16 @@ export default { ...@@ -202,6 +198,16 @@ export default {
get: 'd2admin/base/get', get: 'd2admin/base/get',
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
async initPage() {
const list = await getFeeCategorySceneOptions()
this.sceneTypeList = list || []
this.addOrEdit = this.$route.params.addOrEdit
if (this.addOrEdit === 'edit') {
this.isDisabled = true
this.recordId = this.$route.params.info.id
this.getById(this.recordId)
}
},
changeFormType(e) { changeFormType(e) {
console.log(e) console.log(e)
if (this.form.formType == '2') { if (this.form.formType == '2') {
...@@ -225,7 +231,7 @@ export default { ...@@ -225,7 +231,7 @@ export default {
// return item.applicationSceneType // return item.applicationSceneType
// }) // })
// } // }
this.form.applicationSceneTypes = res.applicationSceneTypes this.form.baseSceneCodeList = res.baseSceneCodeList || []
this.form.applicationObjectType = res.applicationObjectType this.form.applicationObjectType = res.applicationObjectType
this.form.tableData = res.feeCategoryChildren this.form.tableData = res.feeCategoryChildren
...@@ -284,6 +290,7 @@ export default { ...@@ -284,6 +290,7 @@ export default {
this.$refs.editLedgerFrom.validate(valid => { this.$refs.editLedgerFrom.validate(valid => {
if (valid) { if (valid) {
const params = deepClone(this.form) const params = deepClone(this.form)
delete params.applicationSceneTypes
console.log(params) console.log(params)
if (params.formType == 2) { if (params.formType == 2) {
if (params.tableData && params.tableData.length > 1) { if (params.tableData && params.tableData.length > 1) {
...@@ -336,8 +343,9 @@ export default { ...@@ -336,8 +343,9 @@ export default {
this.$router.push({ this.$router.push({
name: 'costCategoryManage', name: 'costCategoryManage',
params: { params: {
activeName: this.$route.params.activeName activeName: this.$route.params.activeName || 'ledger'
} },
query: { listRefresh: '1' }
}) })
this.close({ tagName: '/editLedger' }) this.close({ tagName: '/editLedger' })
}, },
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
item.confLabel }}</el-radio> item.confLabel }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="" prop="applicationSceneTypes"> <el-form-item label="" prop="baseSceneCodeList">
<span class="tips-block" slot="label"> <span class="tips-block" slot="label">
<span class="tips-label">应用场景</span> <span class="tips-label">应用场景</span>
<el-tooltip popper-class="tooltip-class" effect="dark" placement="right"> <el-tooltip popper-class="tooltip-class" effect="dark" placement="right">
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<span class="tips-icon" /> <span class="tips-icon" />
</el-tooltip>: </el-tooltip>:
</span> </span>
<el-checkbox-group v-model="form.applicationSceneTypes"> <el-checkbox-group v-model="form.baseSceneCodeList">
<el-checkbox v-for="(item, index) in sceneTypeList" :key="index" :label="item.confId">{{ item.confValue <el-checkbox v-for="(item, index) in sceneTypeList" :key="item.baseSceneCode || index" :label="item.baseSceneCode">{{ item.name
}}</el-checkbox> }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
...@@ -94,15 +94,14 @@ ...@@ -94,15 +94,14 @@
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { addFeeCategory, editFeeCategory, queryById } from '@api/costCategory' import { addFeeCategory, editFeeCategory, queryById, getFeeCategorySceneOptions } from '@api/costCategory'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { sceneCodeList } from '@/common/constants.js'
export default { export default {
name: 'EditReconciliation', name: 'EditReconciliation',
data() { data() {
return { return {
sceneTypeList: deepClone(sceneCodeList), sceneTypeList: [],
objList: [ objList: [
{ {
confId: 1, confId: 1,
...@@ -129,7 +128,7 @@ export default { ...@@ -129,7 +128,7 @@ export default {
form: { form: {
feeCategoryName: '', // 费用类目名称 feeCategoryName: '', // 费用类目名称
formType: 1, // 费用类型 formType: 1, // 费用类型
applicationSceneTypes: [], // 应用场景 baseSceneCodeList: [], // 应用场景(基础场景编码)
applicationObjectType: 1, applicationObjectType: 1,
feeCategoryType: 2, // 1= 分账类目;2= 对账类目; feeCategoryType: 2, // 1= 分账类目;2= 对账类目;
categoryToSort: 1, categoryToSort: 1,
...@@ -141,8 +140,10 @@ export default { ...@@ -141,8 +140,10 @@ export default {
message: '请输入费用类目名称', message: '请输入费用类目名称',
trigger: 'blur' trigger: 'blur'
}], }],
applicationSceneTypes: [{ baseSceneCodeList: [{
required: true, required: true,
type: 'array',
min: 1,
message: '请选择应用场景', message: '请选择应用场景',
trigger: 'change' trigger: 'change'
}], }],
...@@ -166,12 +167,7 @@ export default { ...@@ -166,12 +167,7 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
this.addOrEdit = this.$route.params.addOrEdit this.initPage()
if (this.addOrEdit === 'edit') {
this.isDisabled = true
this.recordId = this.$route.params.info.id
this.getById(this.recordId)
}
}, },
methods: { methods: {
...@@ -180,6 +176,17 @@ export default { ...@@ -180,6 +176,17 @@ export default {
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
async initPage() {
const list = await getFeeCategorySceneOptions()
this.sceneTypeList = list || []
this.addOrEdit = this.$route.params.addOrEdit
if (this.addOrEdit === 'edit') {
this.isDisabled = true
this.recordId = this.$route.params.info.id
this.getById(this.recordId)
}
},
changeFormType(e) { changeFormType(e) {
if (this.form.formType == '2') { if (this.form.formType == '2') {
this.form.tableData = [ this.form.tableData = [
...@@ -195,7 +202,7 @@ export default { ...@@ -195,7 +202,7 @@ export default {
queryById({ id: id, feeCategoryType: 2 }).then(res => { queryById({ id: id, feeCategoryType: 2 }).then(res => {
this.form.feeCategoryName = res.feeCategoryName this.form.feeCategoryName = res.feeCategoryName
this.form.feeCategoryNameId = res?.feeCategoryNameId || '' this.form.feeCategoryNameId = res?.feeCategoryNameId || ''
this.form.applicationSceneTypes = res.applicationSceneTypes this.form.baseSceneCodeList = res.baseSceneCodeList || []
this.form.applicationObjectType = res.applicationObjectType this.form.applicationObjectType = res.applicationObjectType
this.form.tableData = res.feeCategoryChildren this.form.tableData = res.feeCategoryChildren
...@@ -264,6 +271,7 @@ export default { ...@@ -264,6 +271,7 @@ export default {
} }
} }
delete params.tableData delete params.tableData
delete params.applicationSceneTypes
this.$confirm("保存后该费用类目将按照设定应用到对账规则中,是否确定保存?", "提示", { this.$confirm("保存后该费用类目将按照设定应用到对账规则中,是否确定保存?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
...@@ -296,10 +304,11 @@ export default { ...@@ -296,10 +304,11 @@ export default {
this.$router.push({ this.$router.push({
name: 'costCategoryManage', name: 'costCategoryManage',
params: { params: {
activeName: this.$route.params.activeName activeName: this.$route.params.activeName || 'reconciliation'
} },
query: { listRefresh: '1' }
}) })
this.close({ tagName: '/editLedger' }) this.close({ tagName: '/editReconciliation' })
}, },
showDemo() { showDemo() {
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
</el-tabs> </el-tabs>
</div> </div>
<div> <div>
<ledger-list v-if="activeName === 'ledger'" /> <ledger-list v-if="activeName === 'ledger'" ref="ledgerListRef" />
<reconciliation-list v-if="activeName === 'reconciliation'" /> <reconciliation-list v-if="activeName === 'reconciliation'" ref="reconciliationListRef" />
</div> </div>
</d2-container> </d2-container>
</template> </template>
...@@ -36,9 +36,43 @@ export default { ...@@ -36,9 +36,43 @@ export default {
if (this.$route.params.activeName) { if (this.$route.params.activeName) {
this.activeName = this.$route.params.activeName this.activeName = this.$route.params.activeName
} }
this.refreshListIfNeeded()
}, },
methods: {} watch: {
$route() {
if (this.$route.params.activeName) {
this.activeName = this.$route.params.activeName
}
this.refreshListIfNeeded()
}
},
methods: {
/** 从详情/编辑页返回时带 query.listRefresh=1,刷新当前 Tab 列表 */
refreshListIfNeeded() {
if (this.$route.name !== 'costCategoryManage' || this.$route.query.listRefresh !== '1') {
return
}
if (this.$route.params.activeName) {
this.activeName = this.$route.params.activeName
}
this.$nextTick(() => {
if (this.activeName === 'ledger') {
const child = this.$refs.ledgerListRef
if (child && child.refreshList) child.refreshList()
} else {
const child = this.$refs.reconciliationListRef
if (child && child.refreshList) child.refreshList()
}
this.$router.replace({
name: 'costCategoryManage',
params: { activeName: this.activeName },
query: {}
})
})
}
}
} }
</script> </script>
......
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { selectFeeCategoryList, deleteFeeCategory } from '@api/costCategory' import { selectFeeCategoryList, deleteFeeCategory, getFeeCategorySceneOptions } from '@api/costCategory'
import { sceneCodeList, sceneList, targetType } from '@/common/constants.js' import { sceneList, targetType } from '@/common/constants.js'
export default { export default {
name: 'LedgerList', name: 'LedgerList',
data() { data() {
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
searchForm: { searchForm: {
feeCategoryType: 1, feeCategoryType: 1,
feeCategoryName: '', feeCategoryName: '',
applicationSceneType: '', baseSceneCodeList: [],
applicationObjectType: '', applicationObjectType: '',
formType: '' formType: ''
}, },
...@@ -76,12 +76,13 @@ export default { ...@@ -76,12 +76,13 @@ export default {
keyFn: this.keyDowmGetList keyFn: this.keyDowmGetList
}, { }, {
label: '应用场景', label: '应用场景',
name: 'applicationSceneType', name: 'baseSceneCodeList',
type: 'select', type: 'select',
multiple: true,
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: 'confId', optionId: 'baseSceneCode',
optionLabel: 'confValue', optionLabel: 'name',
optionsName: 'sceneTypeList' optionsName: 'sceneTypeList'
}, { }, {
label: '应用对象', label: '应用对象',
...@@ -105,7 +106,7 @@ export default { ...@@ -105,7 +106,7 @@ export default {
} }
], ],
// maxLength: 10, // maxLength: 10,
getListApi: selectFeeCategoryList, getListApi: null,
// 表格参数 // 表格参数
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
...@@ -140,20 +141,17 @@ export default { ...@@ -140,20 +141,17 @@ export default {
} }
}, { }, {
label: '应用场景', label: '应用场景',
prop: 'applicationSceneTypes', prop: 'baseSceneNameList',
addHtml: 'applicationSceneTypes', addHtml: 'applicationSceneTypes',
width: '300', width: '300',
formatter: (cellValue) => { formatter: (cellValue) => {
// applicationSceneTypes const names = cellValue.baseSceneNameList
if (names && names.length) return names.join(',')
const scenes = cellValue.applicationSceneTypes const scenes = cellValue.applicationSceneTypes
if (scenes && scenes.length > 0) { if (scenes && scenes.length > 0) {
const list = scenes.map(item => { return scenes.map((item) => sceneList[item]).filter(Boolean).join(',')
return sceneList[item]
})
return list.join(",")
} else {
return ''
} }
return ''
} }
}, { }, {
label: '应用对象', label: '应用对象',
...@@ -198,7 +196,7 @@ export default { ...@@ -198,7 +196,7 @@ export default {
confLabel: '可拓展' confLabel: '可拓展'
} }
], ],
sceneTypeList: deepClone(sceneCodeList) sceneTypeList: []
}, },
hideOptList: [1, 2, 3, 4, 5] hideOptList: [1, 2, 3, 4, 5]
} }
...@@ -230,6 +228,11 @@ export default { ...@@ -230,6 +228,11 @@ export default {
// relationCategoryDialog // relationCategoryDialog
}, },
// 须在 created 中赋值:子组件 d2-table 的 mounted 早于父组件 mounted,否则 getListApi 仍为 null,不会触发首次 refreshTable
created() {
this.getListApi = this.fetchFeeCategoryList
},
mounted() { mounted() {
this.getBaseData() this.getBaseData()
this.$nextTick(() => { this.$nextTick(() => {
...@@ -240,6 +243,30 @@ export default { ...@@ -240,6 +243,30 @@ export default {
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
refreshList() {
if (this.$refs.ledgerListTable) {
this.$refs.ledgerListTable.refreshTable()
}
},
fetchFeeCategoryList(params) {
const p = { ...params }
if (Array.isArray(p.baseSceneCodeList)) {
p.baseSceneCodeList = p.baseSceneCodeList.filter(Boolean)
if (!p.baseSceneCodeList.length) delete p.baseSceneCodeList
}
return selectFeeCategoryList(p)
},
baseSceneDisplayText(cellValue) {
const names = cellValue.baseSceneNameList
if (names && names.length) {
return names.join(',')
}
const scenes = cellValue.applicationSceneTypes
if (scenes && scenes.length > 0) {
return scenes.map((item) => sceneList[item]).filter(Boolean).join(',')
}
return ''
},
formTypeFilter(ele, lenght) { formTypeFilter(ele, lenght) {
// console.log(ele) // console.log(ele)
// console.log(lenght) // console.log(lenght)
...@@ -256,18 +283,13 @@ export default { ...@@ -256,18 +283,13 @@ export default {
} }
}, },
applicationSceneTypesFliter(cellValue, lenght) { applicationSceneTypesFliter(cellValue, lenght) {
// applicationSceneTypes const text = this.baseSceneDisplayText(cellValue) || '-'
const scenes = cellValue.applicationSceneTypes if (!lenght || text === '-') return text
if (scenes && scenes.length > 0) { return text.length > lenght ? text.substring(0, lenght) + '\u2026' : text.substring(0, lenght)
const list = scenes.map(item => {
return sceneList[item]
})
return lenght ? (list.join(",")?.length > lenght ? list.join(",").substring(0, lenght) + '\u2026' : list.join(",").substring(0, lenght)) : list.join(",")
} else {
return '-'
}
}, },
async getBaseData() { async getBaseData() {
const list = await getFeeCategorySceneOptions()
this.baseData.sceneTypeList = list || []
this.getOptionsList() this.getOptionsList()
}, },
// 1是自建 2是系统内置 (不允许修改) // 1是自建 2是系统内置 (不允许修改)
...@@ -287,7 +309,7 @@ export default { ...@@ -287,7 +309,7 @@ export default {
this.searchForm = { this.searchForm = {
feeCategoryType: 1, feeCategoryType: 1,
feeCategoryName: '', feeCategoryName: '',
applicationSceneType: '', baseSceneCodeList: [],
applicationObjectType: '', applicationObjectType: '',
formType: '' formType: ''
} }
......
...@@ -51,17 +51,17 @@ ...@@ -51,17 +51,17 @@
</template> </template>
<script> <script>
import { Util, deepClone } from '@/common/util' import { Util } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { selectFeeCategoryList, deleteFeeCategory } from '@api/costCategory' import { selectFeeCategoryList, deleteFeeCategory, getFeeCategorySceneOptions } from '@api/costCategory'
import { sceneCodeList, sceneList, targetType } from '@/common/constants.js' import { sceneList, targetType } from '@/common/constants.js'
export default { export default {
name: 'ReconciliationList', name: 'ReconciliationList',
data() { data() {
return { return {
searchForm: { searchForm: {
feeCategoryType: 2, feeCategoryType: 2,
applicationSceneType: '', baseSceneCodeList: [],
applicationObjectType: '', applicationObjectType: '',
feeCategoryName: '', feeCategoryName: '',
formType: '' formType: ''
...@@ -75,12 +75,13 @@ export default { ...@@ -75,12 +75,13 @@ export default {
keyFn: this.keyDowmGetList keyFn: this.keyDowmGetList
}, { }, {
label: '应用场景', label: '应用场景',
name: 'applicationSceneType', name: 'baseSceneCodeList',
type: 'select', type: 'select',
multiple: true,
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: 'confId', optionId: 'baseSceneCode',
optionLabel: 'confValue', optionLabel: 'name',
optionsName: 'sceneTypeList' optionsName: 'sceneTypeList'
}, { }, {
label: '应用对象', label: '应用对象',
...@@ -101,7 +102,7 @@ export default { ...@@ -101,7 +102,7 @@ export default {
optionLabel: 'confLabel', optionLabel: 'confLabel',
optionsName: 'formTypeList' optionsName: 'formTypeList'
}], }],
getListApi: selectFeeCategoryList, getListApi: null,
// 表格参数 // 表格参数
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
...@@ -124,7 +125,7 @@ export default { ...@@ -124,7 +125,7 @@ export default {
width: '300' width: '300'
}, { }, {
label: '应用场景', label: '应用场景',
prop: 'feeCategorySceneList', prop: 'baseSceneNameList',
addHtml: 'applicationSceneTypes', addHtml: 'applicationSceneTypes',
width: '300' width: '300'
...@@ -159,7 +160,7 @@ export default { ...@@ -159,7 +160,7 @@ export default {
confLabel: '平台方' confLabel: '平台方'
} }
], ],
sceneTypeList: deepClone(sceneCodeList), sceneTypeList: [],
formTypeList: [ formTypeList: [
{ {
confId: 1, confId: 1,
...@@ -177,6 +178,11 @@ export default { ...@@ -177,6 +178,11 @@ export default {
}, },
// 须在 created 中赋值:子组件 d2-table 的 mounted 早于父组件 mounted,否则 getListApi 仍为 null,不会触发首次 refreshTable
created() {
this.getListApi = this.fetchFeeCategoryList
},
mounted() { mounted() {
this.getBaseData() this.getBaseData()
this.$nextTick(() => { this.$nextTick(() => {
...@@ -187,7 +193,33 @@ export default { ...@@ -187,7 +193,33 @@ export default {
methods: { methods: {
...mapActions({ close: 'd2admin/page/close' }), ...mapActions({ close: 'd2admin/page/close' }),
refreshList() {
if (this.$refs.reconciliationListTable) {
this.$refs.reconciliationListTable.refreshTable()
}
},
fetchFeeCategoryList(params) {
const p = { ...params }
if (Array.isArray(p.baseSceneCodeList)) {
p.baseSceneCodeList = p.baseSceneCodeList.filter(Boolean)
if (!p.baseSceneCodeList.length) delete p.baseSceneCodeList
}
return selectFeeCategoryList(p)
},
baseSceneDisplayText(cellValue) {
const names = cellValue.baseSceneNameList
if (names && names.length) {
return names.join(',')
}
const scenes = cellValue.applicationSceneTypes
if (scenes && scenes.length > 0) {
return scenes.map((item) => sceneList[item]).filter(Boolean).join(',')
}
return ''
},
async getBaseData() { async getBaseData() {
const list = await getFeeCategorySceneOptions()
this.baseData.sceneTypeList = list || []
this.getOptionsList() this.getOptionsList()
}, },
...@@ -221,16 +253,9 @@ export default { ...@@ -221,16 +253,9 @@ export default {
// } // }
}, },
applicationSceneTypesFliter(cellValue, lenght) { applicationSceneTypesFliter(cellValue, lenght) {
// applicationSceneTypes const text = this.baseSceneDisplayText(cellValue) || '-'
const scenes = cellValue.applicationSceneTypes if (!lenght || text === '-') return text
if (scenes && scenes.length > 0) { return text.length > lenght ? text.substring(0, lenght) + '\u2026' : text.substring(0, lenght)
const list = scenes.map(item => {
return sceneList[item]
})
return lenght ? (list.join(",")?.length > lenght ? list.join(",").substring(0, lenght) + '\u2026' : list.join(",").substring(0, lenght)) : list.join(",")
} else {
return '-'
}
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
...@@ -243,7 +268,7 @@ export default { ...@@ -243,7 +268,7 @@ export default {
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
feeCategoryType: 2, feeCategoryType: 2,
applicationSceneType: '', baseSceneCodeList: [],
applicationObjectType: '', applicationObjectType: '',
feeCategoryName: '', feeCategoryName: '',
formType: '' formType: ''
......
...@@ -26,20 +26,26 @@ ...@@ -26,20 +26,26 @@
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<template #scene-tag="scope"> <template #scene-tag="scope">
<span class="scene-tag"> <template v-if="scope.scope.tagNames && scope.scope.tagNames.length">
<span v-for="item in scope.scope.tagNames"
:key="item.tagId"
class="scene-tag">
{{ getSceneTagLabel(scope.scope) }} {{ getSceneTagLabel(scope.scope) }}
</span> </span>
</template> </template>
<template #stockManagementModeHtml="scope"> <span v-else>-</span>
</template>
<template #statusHtml="scope">
<div class="taskStatus"> <div class="taskStatus">
<div class="spot" :class="[scope.scope.stockManagementMode === 1 ? 'greenSpot' : 'ashSpot']"></div> <div class="spot" :class="[scope.scope.status === 1 ? 'greenSpot' : 'ashSpot']"></div>
<div>{{ scope.scope.statusName }}</div> <div>{{ scope.scope.status === 1 ? "启用" : "禁用" }}</div>
</div> </div>
</template> </template>
<template #auth-button="scope"> <template #auth-button="scope">
<el-switch v-model="scope.scope.stockManagementMode" <el-switch v-model="scope.scope.status"
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
:disabled="!!scope.scope._statusSwitchLoading"
@change="(val) => handleStatusSwitch(val, scope.scope)" /> @change="(val) => handleStatusSwitch(val, scope.scope)" />
</template> </template>
</d2-table> </d2-table>
...@@ -49,10 +55,9 @@ ...@@ -49,10 +55,9 @@
<script> <script>
// import { getList } from "@api/serviceManage"; // import { getList } from "@api/serviceManage";
import { getList } from "@api/senseManage"; import { disableScene, enableScene, getList, getSceneTags } from "@api/senseManage";
import { mapActions } from "vuex"; import { mapActions } from "vuex";
import { merchantStoreServiceList, procureModeList } from "@/common/constants"; import { procureModeList } from "@/common/constants";
import { deepClone, Util } from "@/common/util";
export default { export default {
name: "SenseManage", name: "SenseManage",
...@@ -67,7 +72,7 @@ export default { ...@@ -67,7 +72,7 @@ export default {
}, },
showFormData: [{ showFormData: [{
label: "场景名称", label: "场景名称",
name: "merchantNameKeyWord", name: "name",
type: "input", type: "input",
placeholder: "请输入", placeholder: "请输入",
isClear: true, isClear: true,
...@@ -122,17 +127,14 @@ export default { ...@@ -122,17 +127,14 @@ export default {
label: "状态", label: "状态",
prop: "status", prop: "status",
width: 120, width: 120,
addHtml: "stockManagementModeHtml", addHtml: "statusHtml",
}], }],
}, },
baseData: {
merchantStoreServiceList: deepClone(merchantStoreServiceList),
},
}; };
}, },
mounted() { mounted() {
this.getOptionsList(); this.loadSceneTagOptions();
}, },
methods: { methods: {
...@@ -140,19 +142,24 @@ export default { ...@@ -140,19 +142,24 @@ export default {
get: "d2admin/base/get", get: "d2admin/base/get",
close: "d2admin/page/close", close: "d2admin/page/close",
}), }),
getOptionsList() { async loadSceneTagOptions() {
this.showFormData.forEach((item, index) => { const idx = this.showFormData.findIndex(i => i.name === "merchantType");
if (item.type === "select") { if (idx < 0) {
if (!item.multiple && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== "全部") { return;
const temp = {};
temp[this.showFormData[index].optionId] = "";
temp[this.showFormData[index].optionLabel] = "全部";
this.baseData[item.optionsName].unshift(temp);
} }
this.$set(this.showFormData[index], "optionList", this.baseData[item.optionsName]); try {
const res = await getSceneTags({});
const list = res?.data?.list || res?.data || res?.result || [];
const optionList = (Array.isArray(list) ? list : [])
.map(it => ({
confId: it?.confId ?? it?.tagId ?? it?.id,
confLabel: it?.confLabel ?? it?.tagName ?? it?.name ?? it?.label,
}))
.filter(it => it.confId !== undefined && it.confLabel);
this.$set(this.showFormData[idx], "optionList", optionList);
} catch (e) {
this.$set(this.showFormData[idx], "optionList", []);
} }
});
console.log(this.showFormData, "showFormData");
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
...@@ -179,7 +186,11 @@ export default { ...@@ -179,7 +186,11 @@ export default {
}, },
async handleStatusSwitch(val, row) { async handleStatusSwitch(val, row) {
const prevVal = val === 1 ? 0 : 1; const prevVal = val === 1 ? 0 : 1;
// 切换为禁用时需要二次确认;取消则回滚开关状态 this.$set(row, "status", prevVal);
if (!row?.id) {
this.$message?.error?.("缺少场景ID,无法切换状态");
return;
}
if (val === 0) { if (val === 0) {
try { try {
await this.$confirm("禁用后,此场景将暂时无法在新门店上架,已上架的门店不受影响,确定继续?", "提示", { await this.$confirm("禁用后,此场景将暂时无法在新门店上架,已上架的门店不受影响,确定继续?", "提示", {
...@@ -187,14 +198,25 @@ export default { ...@@ -187,14 +198,25 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}); });
row.stockManagementMode = val;
} catch (e) { } catch (e) {
row.stockManagementMode = prevVal;
}
return; return;
} }
}
row.stockManagementMode = val; this.$set(row, "_statusSwitchLoading", true);
try {
if (val === 1) {
await enableScene({ id: row.id });
} else {
await disableScene({ id: row.id });
}
this.$set(row, "status", val);
this.$message?.success?.(val === 1 ? "已启用" : "已禁用");
} catch (e) {
this.$set(row, "status", prevVal);
this.$message?.error?.(e?.message || "操作失败,请稍后重试");
} finally {
this.$set(row, "_statusSwitchLoading", false);
}
}, },
getSceneTagLabel(row) { getSceneTagLabel(row) {
const idx = Number(row?.procurementType) - 1; const idx = Number(row?.procurementType) - 1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!