Commit 0d5922b4 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 b23adaf1 51b882e7
Showing 35 changed files with 1038 additions and 640 deletions
...@@ -13,7 +13,12 @@ import axios from "@/plugin/axios/index_code"; ...@@ -13,7 +13,12 @@ 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")) {
...@@ -35,7 +40,11 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt ...@@ -35,7 +40,11 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt
apiName = "dj"; apiName = "dj";
} else if (params.method.includes("dj.api.oaapproval")) { } else if (params.method.includes("dj.api.oaapproval")) {
apiName = "oaapproval"; apiName = "oaapproval";
} else if (params.method.includes("merchants.api.open.createMerchantWithPermissions")) { } else if (
params.method.includes(
"merchants.api.open.createMerchantWithPermissions"
)
) {
/** 开放平台创建商户 — 与同网关 oaapproval 一致,使用 axios_oaapproval / baseURL */ /** 开放平台创建商户 — 与同网关 oaapproval 一致,使用 axios_oaapproval / baseURL */
apiName = "oaapproval"; apiName = "oaapproval";
} else { } else {
...@@ -51,19 +60,19 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt ...@@ -51,19 +60,19 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt
} }
const mappingName = { const mappingName = {
"dj.smartcarlife": "axios", "dj.smartcarlife": "axios",
"dj": "axios", dj: "axios",
"scrm": "axios2", scrm: "axios2",
"merchants": "axios3", merchants: "axios3",
"reportExport": "axios4", reportExport: "axios4",
"glsx.accounts.biz.common.pictureUpload": "common", "glsx.accounts.biz.common.pictureUpload": "common",
"clue": "axios5", clue: "axios5",
"dj.businessSchool": "axios6", "dj.businessSchool": "axios6",
"script": "axios7", script: "axios7",
"staff": "axios9", staff: "axios9",
"riskmanage": "axios10", riskmanage: "axios10",
"strategy": "axios_strategy", strategy: "axios_strategy",
"supervisor": "axios_supervisor", supervisor: "axios_supervisor",
"oaapproval": "axios_oaapproval" oaapproval: "axios_oaapproval",
}; };
const baseApiName = mappingName[apiName]; const baseApiName = mappingName[apiName];
// console.log(baseApiName, "baseApiName") // console.log(baseApiName, "baseApiName")
...@@ -92,25 +101,25 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt ...@@ -92,25 +101,25 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt
*/ */
const signWay = { const signWay = {
"dj.smartcarlife": "sha1", "dj.smartcarlife": "sha1",
"dj": "sha1", dj: "sha1",
"scrm": "sha1", scrm: "sha1",
"glsx": "md5", glsx: "md5",
"glsx.accounts.biz.common.pictureUpload": "md5", "glsx.accounts.biz.common.pictureUpload": "md5",
"clue": "sha1", clue: "sha1",
"script": "sha1", script: "sha1",
"staff": "sha1", staff: "sha1",
"riskmanage": "sha1", riskmanage: "sha1",
"oaapproval": "sha1", oaapproval: "sha1",
}; };
// console.log(signWay[apiName], "baseApiName") // console.log(signWay[apiName], "baseApiName")
const secret = baseConfig[baseApiName].secret; const secret = baseConfig[baseApiName].secret;
const CancelToken = axiosPackage.CancelToken; const CancelToken = axiosPackage.CancelToken;
let reqData let reqData =
= method === RequestMethods.POST method === RequestMethods.POST
? { ? {
baseURL: "/", baseURL: "/",
data: sign(params, noSignAttr, secret, signWay[apiName]), data: sign(params, noSignAttr, secret, signWay[apiName]),
} }
: { params: sign(params, noSignAttr, secret, signWay[apiName]) }; : { params: sign(params, noSignAttr, secret, signWay[apiName]) };
reqData = Object.assign(reqData, options, {}); reqData = Object.assign(reqData, options, {});
...@@ -133,8 +142,7 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt ...@@ -133,8 +142,7 @@ function request (params = {}, method = RequestMethods.GET, noSignAttr = [], opt
method, method,
...reqData, ...reqData,
}; };
if (options.returnAll) if (options.returnAll) axiosParams.headers = { "return-all": true };
axiosParams.headers = { "return-all": true };
return axios(axiosParams); return axios(axiosParams);
/** /**
......
...@@ -805,7 +805,7 @@ export function findAllSceneByMerchantIdApi(data = {}) { ...@@ -805,7 +805,7 @@ export function findAllSceneByMerchantIdApi(data = {}) {
} }
export function assignStoreApi(data = {}) { export function assignStoreApi(data = {}) {
data.method = "j.api.smartcarlife.staffBaseInfo.account.merchant.assign"; data.method = "dj.api.smartcarlife.staffBaseInfo.account.merchant.assign";
return request(data, "post"); return request(data, "post");
} }
//北森岗位 //北森岗位
......
...@@ -37,6 +37,7 @@ export function potentialCustomersInfoVerify(data) { ...@@ -37,6 +37,7 @@ export function potentialCustomersInfoVerify(data) {
export function potentialCustomersCheckMerchantName(data) { export function potentialCustomersCheckMerchantName(data) {
data.method = data.method =
"dj.api.smartcarlife.sale.potentialCustomers.checkMerchantName"; "dj.api.smartcarlife.sale.potentialCustomers.checkMerchantName";
data.method = "dj.api.smartcarlife.sale.potentialCustomers.infoVerify";
return request(data, "post"); return request(data, "post");
} }
...@@ -85,8 +86,66 @@ export function closeStoreDetail(data) { ...@@ -85,8 +86,66 @@ export function closeStoreDetail(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.detail"; data.method = "dj.api.smartcarlife.sale.closeStore.detail";
return request(data, "post"); return request(data, "post");
} }
// 关店操作记录
export function closeStoreOperateLogList(data) {
data.method = "dj.api.smartcarlife.sale.closeStore.operateLog.list";
return request(data, "post");
}
/**
* 分页查询门店上架审批单
*/
export function storeApprovePageQuery(data) { export function storeApprovePageQuery(data) {
data.method = "dj.api.oaapproval.store.approve.pageQuery"; data.method = "dj.api.oaapproval.store.approve.pageQuery";
return request(data, "post"); return request(data, "post");
} }
/**
*创建门店上架审批单(草稿)
*/
export function storeApproveCreateDraft(data) {
data.method = "dj.api.oaapproval.store.approve.createDraft";
return request(data, "post", ["file"]);
}
/**
*查询门店上架审批单详情
*/
export function storeApproveQueryDetail(data) {
data.method = "dj.api.oaapproval.store.approve.queryDetail";
return request(data, "post");
}
/**
* 编辑门店上架审批单
*/
export function storeApproveEditDraft(data) {
data.method = "dj.api.oaapproval.store.approve.editDraft";
return request(data, "post");
}
/**
*
* 重新发起审批单
*/
export function storeApproveReSubmit(data) {
data.method = "dj.api.oaapproval.store.approve.reSubmit";
return request(data, "post");
}
/**
* 查询销售范围类型列表
*/
export function queryProductTypes(data = {}) {
data.method = "dj.api.oaapproval.store.approve.queryProductTypes";
return request(data, "post");
}
/**
* 查询销售品类列表
*/
export function queryProductCategories(data = {}) {
data.method = "dj.api.oaapproval.store.approve.queryProductCategories";
return request(data, "post");
}
...@@ -39,7 +39,7 @@ export const priceUnitTypeList = [ ...@@ -39,7 +39,7 @@ export const priceUnitTypeList = [
{ value: 19, label: "位" }, { value: 19, label: "位" },
{ value: 20, label: "页" }, { value: 20, label: "页" },
{ value: 21, label: "张" }, { value: 21, label: "张" },
{ value: 22, label: "车" } { value: 22, label: "车" },
]; ];
/** /**
...@@ -427,8 +427,8 @@ export function limitPrice( ...@@ -427,8 +427,8 @@ export function limitPrice(
}; };
regRule = regRule || "priceReg"; regRule = regRule || "priceReg";
if ( if (
newValue && newValue
((minValue && newValue < minValue) || (maxValue && newValue > maxValue)) && ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))
) { ) {
return oldValue || ""; return oldValue || "";
} }
...@@ -437,18 +437,18 @@ export function limitPrice( ...@@ -437,18 +437,18 @@ export function limitPrice(
newValue = newValue + ""; newValue = newValue + "";
let interger = newValue.split(".")[0]; let interger = newValue.split(".")[0];
let point = newValue.split(".")[1]; let point = newValue.split(".")[1];
let intergerNum = let intergerNum
interger.length > intergerDigit = interger.length > intergerDigit
? oldValue.split(".")[0] ? oldValue.split(".")[0]
: interger; : interger;
let pointNum = let pointNum
point.length > pointDigit ? point.slice(0, pointDigit) : point; = point.length > pointDigit ? point.slice(0, pointDigit) : point;
newValue = pointDigit newValue = pointDigit
? intergerNum + "." + pointNum ? intergerNum + "." + pointNum
: newValue.split(".")[0]; : newValue.split(".")[0];
} else { } else {
newValue = newValue
newValue.length > intergerDigit = newValue.length > intergerDigit
? oldValue.slice(0, intergerDigit) ? oldValue.slice(0, intergerDigit)
: newValue; : newValue;
} }
...@@ -481,13 +481,13 @@ export const appointDays = 35; ...@@ -481,13 +481,13 @@ export const appointDays = 35;
export const afterTodayOptions = { export const afterTodayOptions = {
disabledDate(date) { disabledDate(date) {
if ( if (
date < new Date(new Date().toLocaleDateString()) || date < new Date(new Date().toLocaleDateString())
date > || date
new Date( > new Date(
new Date().setDate( new Date().setDate(
new Date().getDate() + (appointDays - 1), new Date().getDate() + (appointDays - 1),
), ),
) )
) { ) {
return true; return true;
} }
...@@ -549,8 +549,8 @@ export const sceneList = { ...@@ -549,8 +549,8 @@ export const sceneList = {
}; };
// 新场景 // 新场景
export const newSceneList = { export const newSceneList = {
1: "权益类", 0: "权益类",
2: "轻改类" 1: "轻改类",
}; };
// 导流方下拉选项对应 // 导流方下拉选项对应
export const attrToVal = [ export const attrToVal = [
...@@ -1111,9 +1111,9 @@ export const businessOptShowText = { ...@@ -1111,9 +1111,9 @@ export const businessOptShowText = {
}; };
// 预警管理 所属业务 显示文字 // 预警管理 所属业务 显示文字
export const orderBusinessType = { export const orderBusinessType = {
0: "轻改", "0": "轻改",
1: "权益", "1": "权益",
2: "延保", "2": "延保",
"-1": "其他", "-1": "其他",
}; };
...@@ -1679,14 +1679,14 @@ export const evaluationSourceOpt = [ ...@@ -1679,14 +1679,14 @@ export const evaluationSourceOpt = [
{ confId: 4, confValue: "车况生成" }, { confId: 4, confValue: "车况生成" },
]; ];
export const evaluationStatusOptMap = { export const evaluationStatusOptMap = {
10: "#FDB757", "10": "#FDB757",
20: "#2CCA74", "20": "#2CCA74",
30: "#2CCA74", "30": "#2CCA74",
31: "#2CCA74", "31": "#2CCA74",
32: "#2CCA74", "32": "#2CCA74",
40: "#2CCA74", "40": "#2CCA74",
50: "#2CCA74", "50": "#2CCA74",
100: "#8C8C8C", "100": "#8C8C8C",
"-1": "#EB4E4E", "-1": "#EB4E4E",
}; };
// 合同类型 // 合同类型
......
...@@ -7,22 +7,21 @@ ...@@ -7,22 +7,21 @@
btn-ok-label="下载" btn-ok-label="下载"
@closeDialog="handleClose" @closeDialog="handleClose"
@confirmDialog="handleAddConfirm"> @confirmDialog="handleAddConfirm">
<!-- <el-button v-if="isTmpl" slot="btn-end" type="primary" @click="handleSystemBill" :loading="$store.state.d2admin.loading.value">系统对账</el-button> -->
<el-form ref="accountForm" <el-form ref="accountForm"
v-loading="loading" v-loading="loading"
:model="infoForm" :model="infoForm"
:rules="formRules" :rules="formRules"
label-width="120px"> label-width="120px">
<el-form-item label="业务线:" prop="businessLine"> <el-form-item label="业务线:" prop="sceneType">
<el-select v-model="infoForm.businessLine" style="width:400px"> <el-select v-model="infoForm.sceneType" style="width:400px">
<el-option v-for="item in baseData.businessLineList" <el-option v-for="item in baseData.sceneTypeList"
:key="item.confId" :key="item.confId"
:label="item.confLabel" :label="item.confLabel"
:value="item.confId" /> :value="item.confId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="业务场景:" prop="sceneType"> <el-form-item label="业务场景:" prop="baseSceneCodeList">
<el-select v-model="infoForm.sceneType" <el-select v-model="infoForm.baseSceneCodeList"
multiple multiple
collapse-tags collapse-tags
style="width:400px" style="width:400px"
...@@ -166,6 +165,7 @@ ...@@ -166,6 +165,7 @@
<script> <script>
import { getBillTmplAdapter, getMetaTmpl, getShopList, getTmplList } from "@api/accountManage"; import { getBillTmplAdapter, getMetaTmpl, getShopList, getTmplList } from "@api/accountManage";
import { getMerchantPageSearch } from "@api/publicAccount"; import { getMerchantPageSearch } from "@api/publicAccount";
import { getScenesByParams } from "@api/senseManage";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { mapActions, mapState } from "vuex"; import { mapActions, mapState } from "vuex";
import { import {
...@@ -203,6 +203,7 @@ export default { ...@@ -203,6 +203,7 @@ export default {
return { return {
loading: false, loading: false,
multipleLimit: 10, multipleLimit: 10,
sceneTypeList: [],
// 判断是否是模版模式 // 判断是否是模版模式
isTmpl: false, isTmpl: false,
localTmplList: deepClone(localTmplList), localTmplList: deepClone(localTmplList),
...@@ -250,8 +251,8 @@ export default { ...@@ -250,8 +251,8 @@ export default {
payEndDate: "", payEndDate: "",
reportType: "1", reportType: "1",
shopMerchantId: "", shopMerchantId: "",
businessLine: "", sceneType: "",
sceneType: [""], baseSceneCodeList: [""],
reconciliationStatus: "all", reconciliationStatus: "all",
packageMerge: false, packageMerge: false,
templateId: "", templateId: "",
...@@ -267,8 +268,8 @@ export default { ...@@ -267,8 +268,8 @@ export default {
}, },
formRules: { formRules: {
businessLine: [{ required: true, message: "请选择业务线", trigger: "change" }], sceneType: [{ required: true, message: "请选择业务线", trigger: "change" }],
sceneType: [{ required: true, message: "请选择业务场景", trigger: "change" }], baseSceneCodeList: [{ required: true, message: "请选择业务场景", trigger: "change" }],
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }], merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
merchant: [ merchant: [
{ required: true, message: "请选择对账商户", trigger: "change" }, { required: true, message: "请选择对账商户", trigger: "change" },
...@@ -287,23 +288,10 @@ export default { ...@@ -287,23 +288,10 @@ export default {
// 基本数据 // 基本数据
baseData: { baseData: {
sceneTypeList: [{ sceneTypeList: [{
confId: "1", confId: "0",
confLabel: "精品升级",
}, {
confId: "2",
confLabel: "次新车转化",
}, {
confId: "3",
confLabel: "售后众筹",
}, {
confId: "4",
confLabel: "积分商城",
}],
businessLineList: [{
confId: "1",
confLabel: "权益类", confLabel: "权益类",
}, { }, {
confId: "2", confId: "1",
confLabel: "轻改类", confLabel: "轻改类",
}], }],
reconStatusList: [{ reconStatusList: [{
...@@ -349,11 +337,15 @@ export default { ...@@ -349,11 +337,15 @@ export default {
dowloadList: state => state.d2admin.user.dowloadList, dowloadList: state => state.d2admin.user.dowloadList,
}), }),
sceneTypeOptionList() { sceneTypeOptionList() {
// 选项 = 全部 + 当前业务线下的场景 // 选项 = 全部 + 当前业务线动态获取的场景列表
// 目前场景列表是静态配置;后续如改成按业务线动态加载,这里只需要替换 filteredList 的来源即可。 const inputList = Array.isArray(this.sceneTypeList) ? this.sceneTypeList : [];
const filteredList = Array.isArray(this.baseData.sceneTypeList) const filteredList = inputList
? this.baseData.sceneTypeList .map((item) => {
: []; const confId = item?.confId ?? item?.id;
const confLabel = item?.confLabel ?? item?.name;
return { confId, confLabel };
})
.filter(item => item.confId !== undefined && item.confId !== null && item.confId !== "");
return [ return [
{ confId: "", confLabel: "全部" }, { confId: "", confLabel: "全部" },
...filteredList, ...filteredList,
...@@ -365,15 +357,18 @@ export default { ...@@ -365,15 +357,18 @@ export default {
"scene": { "scene": {
handler(val) { handler(val) {
const sceneStr = val == null ? "" : String(val); const sceneStr = val == null ? "" : String(val);
const exists = this.baseData.businessLineList.some(i => i.confId === sceneStr); const exists = this.baseData.sceneTypeList.some(i => i.confId === sceneStr);
this.infoForm.businessLine = exists ? sceneStr : (this.baseData.businessLineList[0]?.confId || ""); this.infoForm.sceneType = exists ? sceneStr : (this.baseData.sceneTypeList[0]?.confId || "");
// 首次打开弹框时,确保能根据当前业务线拉取“业务场景”列表
this.syncSceneTypeList();
}, },
immediate: true, immediate: true,
}, },
"infoForm.businessLine": { "infoForm.sceneType": {
handler() { handler() {
// 切换业务线时,业务场景默认回到“全部” // 切换业务线时,业务场景默认回到“全部”
this.infoForm.sceneType = [""]; this.infoForm.baseSceneCodeList = [""];
this.syncSceneTypeList();
}, },
}, },
}, },
...@@ -399,17 +394,38 @@ export default { ...@@ -399,17 +394,38 @@ export default {
methods: { methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]), ...mapActions("d2admin/user", ["actionSetDownloadList"]),
syncSceneTypeList() {
const sceneType = Number(this.infoForm?.sceneType);
if (this.infoForm?.sceneType === "" || this.infoForm?.sceneType === null || this.infoForm?.sceneType === undefined || Number.isNaN(sceneType)) {
this.sceneTypeList = [];
return;
}
getScenesByParams({ sceneType }).then((res) => {
const list = Array.isArray(res)
? res
: (Array.isArray(res?.data) ? res.data : []);
const normalized = list
.map(item => ({
confId: item?.baseSceneCode,
confLabel: item?.name,
}))
.filter(item => item.confId !== undefined && item.confId !== null && item.confId !== "");
this.sceneTypeList = normalized;
}).catch(() => {
this.sceneTypeList = [];
});
},
handleSceneTypeChange(value) { handleSceneTypeChange(value) {
if (!Array.isArray(value)) { if (!Array.isArray(value)) {
return; return;
} }
if (!value.length) { if (!value.length) {
this.infoForm.sceneType = [""]; this.infoForm.baseSceneCodeList = [""];
return; return;
} }
if (value.includes("") && value.length > 1) { if (value.includes("") && value.length > 1) {
// 多选时,“全部”与具体值互斥;以最后一次选择为准 // 多选时,“全部”与具体值互斥;以最后一次选择为准
this.infoForm.sceneType = value[value.length - 1] === "" this.infoForm.baseSceneCodeList = value[value.length - 1] === ""
? [""] ? [""]
: value.filter(v => v !== ""); : value.filter(v => v !== "");
} }
...@@ -635,6 +651,7 @@ export default { ...@@ -635,6 +651,7 @@ export default {
params.reportType = infoForm.reportType; params.reportType = infoForm.reportType;
} }
params.sceneType = this.scene; params.sceneType = this.scene;
params.baseSceneCodeList = infoForm.baseSceneCodeList;
// 对账状态 // 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus); infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus);
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType) // infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
btn-ok-label="系统对账" btn-ok-label="系统对账"
@closeDialog="handleClose" @closeDialog="handleClose"
@confirmDialog="handleSystemBill"> @confirmDialog="handleSystemBill">
<!-- <el-button v-if="isTmpl" slot="btn-end" type="primary" @click="handleSystemBill" :loading="$store.state.d2admin.loading.value">系统对账</el-button> -->
<el-form ref="accountForm" <el-form ref="accountForm"
v-loading="loading" v-loading="loading"
:model="infoForm" :model="infoForm"
:rules="formRules" :rules="formRules"
label-width="120px"> label-width="120px">
<el-form-item label="业务线:" prop="businessLine"> <el-form-item label="业务场景:" prop="sceneType">
<el-select v-model="infoForm.businessLine" style="width:400px"> <el-select v-model="infoForm.sceneType" style="width:400px">
<el-option v-for="item in baseData.businessLineList" <el-option v-for="item in baseData.businessLineList"
:key="item.confId" :key="item.confId"
:label="item.confLabel" :label="item.confLabel"
...@@ -34,25 +34,8 @@ ...@@ -34,25 +34,8 @@
</el-radio> --> </el-radio> -->
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="infoForm.merchantType == '7'"
label="账单类型:"
prop="reportType">
<el-radio-group v-model="infoForm.reportType" @change="judgeTmpl">
<el-radio label="1">
普通对账单
</el-radio>
<el-radio label="2">
安装费对账单
</el-radio>
<el-radio label="3">
营销费对账单
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="对账商户:" prop="merchant"> <el-form-item label="对账商户:" prop="merchant">
<el-select v-model="infoForm.merchant" <el-select v-model="infoForm.merchant"
multiple
:multiple-limit="multipleLimit"
filterable filterable
style="width:400px" style="width:400px"
@change="handleChangeMerchant"> @change="handleChangeMerchant">
...@@ -62,7 +45,7 @@ ...@@ -62,7 +45,7 @@
:value="item.merchantId" /> :value="item.merchantId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="isTmpl && infoForm.merchantType == '7'" <el-form-item v-if="isTmpl && infoForm.merchantType === '7'"
label="流量方:" label="流量方:"
prop="shopMerchantId"> prop="shopMerchantId">
<el-select v-model="infoForm.shopMerchantId" style="width:400px"> <el-select v-model="infoForm.shopMerchantId" style="width:400px">
...@@ -94,6 +77,14 @@ ...@@ -94,6 +77,14 @@
:picker-options="pickerOptions0" :picker-options="pickerOptions0"
style="width:185px" /> style="width:185px" />
</el-form-item> </el-form-item>
<el-form-item label="对账状态:" prop="reconciliationStatus">
<el-select v-model="infoForm.reconciliationStatus" style="width:400px">
<el-option v-for="item in baseData.reconStatusList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
</el-select>
</el-form-item>
<el-form-item v-if="isTmpl" <el-form-item v-if="isTmpl"
label="套餐合并" label="套餐合并"
prop="packageMerge"> prop="packageMerge">
...@@ -223,11 +214,11 @@ export default { ...@@ -223,11 +214,11 @@ export default {
}, },
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
infoForm: { infoForm: {
sceneType: "",
merchantType: "2", merchantType: "2",
merchant: [], merchant: "",
payStartDate: "", payStartDate: "",
payEndDate: "", payEndDate: "",
reportType: "1",
shopMerchantId: "", shopMerchantId: "",
businessLine: "", businessLine: "",
reconciliationStatus: "all", reconciliationStatus: "all",
...@@ -245,7 +236,7 @@ export default { ...@@ -245,7 +236,7 @@ export default {
}, },
formRules: { formRules: {
businessLine: [{ required: true, message: "请选择业务线", trigger: "change" }], sceneType: [{ required: true, message: "请选择业务场景", trigger: "change" }],
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }], merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
merchant: [ merchant: [
{ required: true, message: "请选择对账商户", trigger: "change" }, { required: true, message: "请选择对账商户", trigger: "change" },
...@@ -255,7 +246,7 @@ export default { ...@@ -255,7 +246,7 @@ export default {
{ required: true, message: "请选择时间", trigger: "change" }, { required: true, message: "请选择时间", trigger: "change" },
{ required: true, trigger: "change", validator: validateLonlat }, { required: true, trigger: "change", validator: validateLonlat },
], ],
reconciliationStatus: [{ required: true, message: "请选择业务场景", trigger: "change" }], reconciliationStatus: [{ required: true, message: "请选择对账状态", trigger: "change" }],
packageMerge: [{ required: true, message: "请选择套餐合并", trigger: "change" }], packageMerge: [{ required: true, message: "请选择套餐合并", trigger: "change" }],
templateId: [{ required: false, message: "请选择对账模式", trigger: "change" }], templateId: [{ required: false, message: "请选择对账模式", trigger: "change" }],
fieldsJson: [{ required: false, message: "请选择对账字段", trigger: "change" }], fieldsJson: [{ required: false, message: "请选择对账字段", trigger: "change" }],
...@@ -265,10 +256,10 @@ export default { ...@@ -265,10 +256,10 @@ export default {
baseData: { baseData: {
businessLineList: [{ businessLineList: [{
confId: "1", confId: "1",
confLabel: "权益类", confLabel: "精品升级",
}, { }, {
confId: "2", confId: "0",
confLabel: "轻改类", confLabel: "会员权益升级",
}], }],
reconStatusList: [{ reconStatusList: [{
confId: "all", confId: "all",
...@@ -356,7 +347,7 @@ export default { ...@@ -356,7 +347,7 @@ export default {
params.merchantTypeList = merchantTypeList; params.merchantTypeList = merchantTypeList;
getMerchantPageSearch(params).then((res) => { getMerchantPageSearch(params).then((res) => {
this.baseData.merchantList = res.list; this.baseData.merchantList = res.list;
this.infoForm.merchant = []; this.infoForm.merchant = "";
}).finally(() => { }).finally(() => {
this.loading = false; this.loading = false;
}); });
...@@ -365,10 +356,14 @@ export default { ...@@ -365,10 +356,14 @@ export default {
handleChangeMerchant(e) { handleChangeMerchant(e) {
console.log(e); console.log(e);
this.infoForm.shopMerchantId = ""; this.infoForm.shopMerchantId = "";
if (!e) {
this.baseData.shopMerchantList = [];
return;
}
const params = { const params = {
currentPage: 1, currentPage: 1,
pageSize: 9999, pageSize: 9999,
partnerMerchantId: e[0], partnerMerchantId: e,
scene: this.scene, scene: this.scene,
}; };
getShopList(params).then((res) => { getShopList(params).then((res) => {
...@@ -392,13 +387,13 @@ export default { ...@@ -392,13 +387,13 @@ export default {
/** /**
* 商户类型 - 商户类型value - 是否有模版 * 商户类型 - 商户类型value - 是否有模版
* 流量方 - 2 - 是 * 流量方 - 2 - 是
* 服务商 - 7 - 仅“服务商对账单”(reportType = 4)时,是有模版 * 其他商户类型 - 否
* 园区店 - 6 - 否 * 园区店 - 6 - 否
*/ */
judgeTmpl() { judgeTmpl() {
this.isTmpl = this.infoForm.merchantType == "2"; this.isTmpl = this.infoForm.merchantType == "2";
this.merchantTypeStr = this.typeObj[this.infoForm.merchantType]; this.merchantTypeStr = this.typeObj[this.infoForm.merchantType];
this.infoForm.merchant = []; this.infoForm.merchant = "";
this.resetTmplData(); this.resetTmplData();
}, },
...@@ -539,15 +534,15 @@ export default { ...@@ -539,15 +534,15 @@ export default {
// console.log(infoForm) // console.log(infoForm)
let params = {}; let params = {};
let merchantList = []; let merchantList = [];
let obj; const currentMerchant = this.baseData.merchantList.find(
infoForm.merchant.forEach((item) => { mer => mer.merchantId === infoForm.merchant,
obj = {}; );
obj.merchantId = item; if (currentMerchant) {
obj.merchantName = this.baseData.merchantList.find( merchantList.push({
mer => mer.merchantId === item, merchantId: infoForm.merchant,
).merchantName; merchantName: currentMerchant.merchantName,
merchantList.push(obj); });
}); }
params.payStartDate = infoForm.payStartDate + " 00:00:00"; params.payStartDate = infoForm.payStartDate + " 00:00:00";
params.payEndDate = infoForm.payEndDate + " 23:59:59"; params.payEndDate = infoForm.payEndDate + " 23:59:59";
merchantList.forEach((item, index) => { merchantList.forEach((item, index) => {
...@@ -557,12 +552,11 @@ export default { ...@@ -557,12 +552,11 @@ export default {
params[merchantId] = item.merchantId; params[merchantId] = item.merchantId;
}); });
params.merchantType = infoForm.merchantType; params.merchantType = infoForm.merchantType;
if (infoForm.merchantType == "7") { params.sceneType = infoForm.sceneType;
params.reportType = infoForm.reportType;
}
params.sceneType = this.scene;
// 对账状态 // 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus); if (infoForm.reconciliationStatus !== "all") {
params.reconciliationStatus = infoForm.reconciliationStatus;
}
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType) // infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
if (infoForm.shopMerchantId) { if (infoForm.shopMerchantId) {
params.shopMerchantId = infoForm.shopMerchantId; params.shopMerchantId = infoForm.shopMerchantId;
...@@ -580,7 +574,7 @@ export default { ...@@ -580,7 +574,7 @@ export default {
handleSystemBill() { handleSystemBill() {
this.$refs.accountForm.validate((valid) => { this.$refs.accountForm.validate((valid) => {
if (valid) { if (valid) {
if (this.infoForm.merchant.length == 1) { if (this.infoForm.merchant) {
let params = this.getParams(); let params = this.getParams();
params.orderCurrentPage = 1; params.orderCurrentPage = 1;
params.orderPageSize = 10; params.orderPageSize = 10;
...@@ -590,7 +584,7 @@ export default { ...@@ -590,7 +584,7 @@ export default {
this.$emit("handleBill", { billTmplInfo: res }); this.$emit("handleBill", { billTmplInfo: res });
}); });
} else { } else {
this.$message.warning("仅支持单商户进行系统对账"); this.$message.warning("请选择对账商户");
} }
} }
}); });
......
...@@ -5,20 +5,9 @@ ...@@ -5,20 +5,9 @@
class="header" class="header"
style="background: #e7eaec"> style="background: #e7eaec">
<!-- @tab-click="tabClick" --> <!-- @tab-click="tabClick" -->
<el-tabs v-if="false" v-model="searchForm.sceneType">
<el-tab-pane :label="sceneList['1']" name="1" />
<el-tab-pane v-if="!specialAccout"
:label="sceneList['2']"
name="2" />
<el-tab-pane v-if="!specialAccout"
:label="sceneList['3']"
name="3" />
<el-tab-pane :label="sceneList['0']" name="0" />
<el-tab-pane :label="sceneList['4']" name="4" />
</el-tabs>
<el-tabs v-model="searchForm.sceneType"> <el-tabs v-model="searchForm.sceneType">
<el-tab-pane :label="newSceneList['0']" name="0" />
<el-tab-pane :label="newSceneList['1']" name="1" /> <el-tab-pane :label="newSceneList['1']" name="1" />
<el-tab-pane :label="newSceneList['2']" name="2" />
</el-tabs> </el-tabs>
<!-- <el-card class="finance_list_summary" :body-style="{ padding: 0 }" v-show="sunmmaryVisible"> --> <!-- <el-card class="finance_list_summary" :body-style="{ padding: 0 }" v-show="sunmmaryVisible"> -->
<!-- 汇总模块暂不显示 --> <!-- 汇总模块暂不显示 -->
...@@ -232,33 +221,15 @@ ...@@ -232,33 +221,15 @@
label="主订单编号" label="主订单编号"
width="170" width="170"
align="center" /> align="center" />
<!-- <el-table-column v-if="isSubOrder" <el-table-column prop="baseSceneName"
prop="orderCode"
label="子订单编号"
width="170"
align="center">
</el-table-column> -->
<!-- 仅会员权益场景显示 -->
<!-- <el-table-column v-if="searchForm.sceneType == 0" prop="businessType" label="所属业务" align="center">
<template slot-scope="scope">
<span v-if="scope.row.businessType">{{
scope.row.businessType == "2" ? "延保" : "权益"
}}</span>
<span v-else>-</span>
</template>
</el-table-column> -->
<el-table-column prop="businessType"
label="业务场景" label="业务场景"
width="170"
align="center"> align="center">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.businessType"> <span>{{ scope.row.baseSceneName || "-" }}</span>
{{
scope.row.businessType == "2" ? "延保" : "权益"
}}
</span>
<span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="customerName" <el-table-column prop="customerName"
label="客户姓名" label="客户姓名"
align="center"> align="center">
...@@ -715,7 +686,7 @@ export default { ...@@ -715,7 +686,7 @@ export default {
totalObj: {}, totalObj: {},
summayData: {}, summayData: {},
searchForm: { searchForm: {
sceneType: "1", sceneType: "0",
time: "", time: "",
yqMerchantId: "", yqMerchantId: "",
merchantId: "", merchantId: "",
...@@ -723,9 +694,10 @@ export default { ...@@ -723,9 +694,10 @@ export default {
divisionType: "", divisionType: "",
platformMerchantId: "", platformMerchantId: "",
outboundStatus: "", outboundStatus: "",
channelType: [""], channelType: "",
subSceneType: [""],
baseSceneCodeList: [""],
businessModel: "", businessModel: "",
businessType: "",
reconciliationFlag: "", reconciliationFlag: "",
}, },
searchSelectObj: { searchSelectObj: {
...@@ -753,24 +725,30 @@ export default { ...@@ -753,24 +725,30 @@ export default {
multiple: true, multiple: true,
collapseTags: true, collapseTags: true,
optionList: [], optionList: [],
optionId: "id", optionId: "baseSceneCode",
optionLabel: "name", optionLabel: "name",
optionsName: "subSceneTypeList", optionsName: "subSceneTypeList",
changeAttr: (value) => { changeAttr: (value) => {
if (!Array.isArray(value)) { if (!Array.isArray(value)) {
return; return;
} }
if (!value.length) { const ALL = "";
this.searchForm.baseSceneCode = [""]; let next = value
return; .filter(v => v !== undefined && v !== null)
.map(v => (typeof v === "string" ? v : String(v)));
// 去重(以 baseSceneCode 作为唯一值)
next = Array.from(new Set(next));
// 空选择:视为“全部”
if (!next.length) {
next = [ALL];
} }
if (value.includes("") && value.length > 1) { // 多选时,“全部”与具体值互斥;以最后一次选择为准(排他)
// 多选时,“全部”与具体值互斥;以最后一次选择为准 if (next.includes(ALL) && next.length > 1) {
this.searchForm.baseSceneCodeList next = next[next.length - 1] === ALL ? [ALL] : next.filter(v => v !== ALL);
= value[value.length - 1] === ""
? [""]
: value.filter(v => v !== "");
} }
// v-model 绑定在 subSceneType,同时同步给后端入参 baseSceneCodeList
this.searchForm.subSceneType = next;
this.searchForm.baseSceneCodeList = next;
}, },
}, },
{ {
...@@ -882,19 +860,8 @@ export default { ...@@ -882,19 +860,8 @@ export default {
optionLabel: "name", optionLabel: "name",
optionsName: "channelTypeList", optionsName: "channelTypeList",
changeAttr: (value) => { changeAttr: (value) => {
if (!Array.isArray(value)) { // 单选:element-ui el-select 的 v-model 应为 String/Number
return; this.searchForm.channelType = value ?? "";
}
if (!value.length) {
this.searchForm.channelType = [""];
return;
}
if (value.includes("") && value.length > 1) {
this.searchForm.channelType
= value[value.length - 1] === ""
? [""]
: value.filter(v => v !== "");
}
}, },
}, },
{ {
...@@ -907,15 +874,6 @@ export default { ...@@ -907,15 +874,6 @@ export default {
optionsName: "manageTypeList", optionsName: "manageTypeList",
}, },
{ {
label: "所属业务",
name: "businessType",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "businessTypeList",
},
{
label: "对账状态", label: "对账状态",
name: "reconciliationFlag", name: "reconciliationFlag",
type: "select", type: "select",
...@@ -1023,18 +981,12 @@ export default { ...@@ -1023,18 +981,12 @@ export default {
// this.showFormData[this.findFormIdx('yqMerchantId')].isHide = true // this.showFormData[this.findFormIdx('yqMerchantId')].isHide = true
// } // }
// this.showFormData[this.findFormIdx('merchantId')].isHide = true // this.showFormData[this.findFormIdx('merchantId')].isHide = true
this.showFormData[this.findFormIdx("businessModel")].isHide = true; // this.showFormData[this.findFormIdx("businessModel")].isHide = true;
this.showFormData[this.findFormIdx("yqMerchantId")].isHide = false; this.showFormData[this.findFormIdx("yqMerchantId")].isHide = false;
this.showFormData[this.findFormIdx("merchantId")].isHide = false; this.showFormData[this.findFormIdx("merchantId")].isHide = false;
this.sellerName_visible = false; this.sellerName_visible = false;
this.shopProfitType_visible = false; this.shopProfitType_visible = false;
this.yq_visible = true; this.yq_visible = true;
if (val == 4) {
// 非会员权益隐藏所属业务筛选项
this.showFormData[this.findFormIdx("businessType")].isHide = true;
} else {
this.showFormData[this.findFormIdx("businessType")].isHide = false;
}
} else if (val == 1) { } else if (val == 1) {
/** /**
1.1场景 1.1场景
...@@ -1056,9 +1008,9 @@ export default { ...@@ -1056,9 +1008,9 @@ export default {
this.sellerName_visible = true; this.sellerName_visible = true;
this.shopProfitType_visible = false; this.shopProfitType_visible = false;
this.yq_visible = true; this.yq_visible = true;
this.showFormData[this.findFormIdx("businessType")].isHide = true; // 非会员权益隐藏所属业务筛选项
} }
this.handleReset(val); this.handleReset(val);
this.syncSubSceneTypeList();
this.getList(); this.getList();
this.getTotal(); this.getTotal();
}, },
...@@ -1092,17 +1044,33 @@ export default { ...@@ -1092,17 +1044,33 @@ 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: {
...mapActions({ close: "d2admin/page/close" }), ...mapActions({ close: "d2admin/page/close" }),
...mapActions("d2admin/user", ["actionSetDownloadList"]), ...mapActions("d2admin/user", ["actionSetDownloadList"]),
...mapActions("d2admin/base", ["get"]), ...mapActions("d2admin/base", ["get"]),
syncSubSceneTypeList() {
const sceneType = Number(this.searchForm?.sceneType);
if (sceneType === "" || sceneType === null || sceneType === undefined) {
this.baseData.subSceneTypeList = [];
this.getOptionsList();
return;
}
getScenesByParams({ sceneType }).then((res) => {
const list = Array.isArray(res)
? res
: (Array.isArray(res?.data) ? res.data : []);
const normalized = list
.map(item => ({
baseSceneCode: item?.baseSceneCode,
name: item?.name,
}))
.filter(item => item.baseSceneCode !== undefined && item.baseSceneCode !== null);
this.baseData.subSceneTypeList = normalized.map(({ baseSceneCode, name }) => ({ baseSceneCode, name }));
this.getOptionsList();
});
},
handleAccountConfirm() { handleAccountConfirm() {
this.fileVisible = true; this.fileVisible = true;
}, },
...@@ -1136,10 +1104,6 @@ export default { ...@@ -1136,10 +1104,6 @@ export default {
async getBaseData() { async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType); this.baseData.channelTypeList = await this.get(BaseData.channelType);
this.positionTypeList = await this.get(BaseData.positionTypeList); this.positionTypeList = await this.get(BaseData.positionTypeList);
this.baseData.businessTypeList = [
{ confId: "1", confLabel: "权益" },
{ confId: "2", confLabel: "延保" },
];
this.baseData.reconciliationFlagList = [ this.baseData.reconciliationFlagList = [
{ confId: "Y", confLabel: "已对账" }, { confId: "Y", confLabel: "已对账" },
{ confId: "N", confLabel: "未对账" }, { confId: "N", confLabel: "未对账" },
...@@ -1168,10 +1132,11 @@ export default { ...@@ -1168,10 +1132,11 @@ export default {
divisionType: "", divisionType: "",
platformMerchantId: "", platformMerchantId: "",
outboundStatus: "", outboundStatus: "",
channelType: [""], channelType: "",
subSceneType: [""],
baseSceneCodeList: [""],
businessModel: "", businessModel: "",
sceneType, sceneType,
businessType: "",
reconciliationFlag: "", reconciliationFlag: "",
}; };
this.searchSelectObj = { this.searchSelectObj = {
...@@ -1440,13 +1405,16 @@ export default { ...@@ -1440,13 +1405,16 @@ export default {
? this.searchForm.channelType.join(",") ? this.searchForm.channelType.join(",")
: this.searchForm.channelType; : this.searchForm.channelType;
} }
if (Array.isArray(this.searchForm.baseSceneCodeList) && this.searchForm.baseSceneCodeList.length) {
const selected = this.searchForm.baseSceneCodeList;
// “全部”= 不传;否则保持数组类型传给后端
if (!selected.includes("")) {
params.baseSceneCodeList = selected;
}
}
if (this.searchForm.sceneType) { if (this.searchForm.sceneType) {
params.sceneType = this.searchForm.sceneType; params.sceneType = this.searchForm.sceneType;
} }
// 会员权益场景添加所属业务筛选字段
if (this.searchForm?.sceneType == 0 && this.searchForm?.businessType) {
params.businessType = this.searchForm?.businessType;
}
if (this.searchForm.reconciliationFlag) { if (this.searchForm.reconciliationFlag) {
params.reconciliationFlag = this.searchForm?.reconciliationFlag; params.reconciliationFlag = this.searchForm?.reconciliationFlag;
} }
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
</div> </div>
<el-form-item label="入职门店:" prop="merchantId"> <el-form-item label="入职门店:" prop="merchantId">
<el-select v-model="infoForm.merchantId" placeholder="请选择入职门店" style="width: 432px" remote <el-select v-model="infoForm.merchantId" placeholder="请选择入职门店" style="width: 432px" reserve-keyword
reserve-keyword filterable :remote-method="remoteMethod" @change="changeMerchant"> filterable @change="changeMerchant">
<el-option v-for="(item, index) in merchantList" :key="index" :label="item.merchantName" <el-option v-for="(item, index) in merchantList" :key="index" :label="item.merchantName"
:value="item.merchantId"></el-option> :value="item.merchantId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="业务场景:" prop="sceneCodeList"> <el-form-item label="适配业务:" prop="sceneCodeList">
<el-checkbox-group v-model="infoForm.sceneCodeList" @change="changeStaffSceneLabel"> <el-checkbox-group v-model="infoForm.sceneCodeList" @change="changeStaffSceneLabel">
<div v-for="item in sceneOptionList" :key="item.baseSceneCode" style="margin-bottom: 8px;"> <div v-for="item in sceneOptionList" :key="item.baseSceneCode" style="margin-bottom: 8px;">
<el-checkbox :label="item.baseSceneCode">{{ item.baseSceneCodeName }}</el-checkbox> <el-checkbox :label="item.baseSceneCode">{{ item.baseSceneCodeName }}</el-checkbox>
...@@ -71,6 +71,7 @@ export default { ...@@ -71,6 +71,7 @@ export default {
merchantId: "", merchantId: "",
merchantName: "", merchantName: "",
sceneCodeList: [], sceneCodeList: [],
yqMerchantList: []
}, },
formRules: { formRules: {
merchantId: [ merchantId: [
...@@ -96,25 +97,21 @@ export default { ...@@ -96,25 +97,21 @@ export default {
}, },
}, },
mounted() { mounted() {
// Initialize form with defaults if available this.findAllMerchantPage()
const initialMerchantName = this.detail.merchantName || (this.detail.merchantList && this.detail.merchantList.length > 0 ? this.detail.merchantList[0].merchantName : ""); const initialMerchantName = this.detail.staffBeisenBaseInfoDTO ? this.detail.staffBeisenBaseInfoDTO.merchantName : "";
const initialMerchantId = this.detail.merchantId || (this.detail.merchantList && this.detail.merchantList.length > 0 ? this.detail.merchantList[0].merchantId : ""); const initialMerchantId = this.detail.staffBeisenBaseInfoDTO ? this.detail.staffBeisenBaseInfoDTO.merchantId : "";
if (initialMerchantName) { if (initialMerchantName && initialMerchantId) {
this.merchantList = [{ merchantId: initialMerchantId, merchantName: initialMerchantName }];
this.infoForm.merchantId = initialMerchantId; this.infoForm.merchantId = initialMerchantId;
this.infoForm.merchantName = initialMerchantName; this.infoForm.merchantName = initialMerchantName;
this.getSceneList(initialMerchantId); this.getSceneList(initialMerchantId);
} else {
this.remoteMethod("");
} }
}, },
methods: { methods: {
remoteMethod(query) { findAllMerchantPage(query) {
const params = { const params = {
currentPage: 1, currentPage: 1,
pageSize: 50, pageSize: 99999
merchantName: query || "",
}; };
findAllMerchantPageApi(params).then((res) => { findAllMerchantPageApi(params).then((res) => {
this.merchantList = res.list || []; this.merchantList = res.list || [];
...@@ -123,6 +120,7 @@ export default { ...@@ -123,6 +120,7 @@ export default {
changeMerchant(val) { changeMerchant(val) {
const selected = this.merchantList.find((item) => item.merchantId === val); const selected = this.merchantList.find((item) => item.merchantId === val);
this.infoForm.merchantName = selected ? selected.merchantName : ""; this.infoForm.merchantName = selected ? selected.merchantName : "";
this.infoForm.merchantId = selected ? selected.merchantId : "";
this.infoForm.sceneCodeList = []; this.infoForm.sceneCodeList = [];
this.sceneOptionList = []; this.sceneOptionList = [];
this.updateRelatedYqMerchantNames(); this.updateRelatedYqMerchantNames();
...@@ -142,15 +140,23 @@ export default { ...@@ -142,15 +140,23 @@ export default {
const selectedScenes = this.sceneOptionList.filter(item => const selectedScenes = this.sceneOptionList.filter(item =>
this.infoForm.sceneCodeList.includes(item.baseSceneCode) this.infoForm.sceneCodeList.includes(item.baseSceneCode)
); );
const names = []; const yqMerchantList = [];
this.infoForm.yqMerchantList = [];
selectedScenes.forEach(scene => { selectedScenes.forEach(scene => {
if (scene.yqMerchant && scene.yqMerchant.merchantName) { if (scene.serviceList && scene.serviceList.length > 0) {
if (!names.includes(scene.yqMerchant.merchantName)) { yqMerchantList.push(...scene.serviceList);
names.push(scene.yqMerchant.merchantName);
}
} }
}); });
this.relatedYqMerchantNames = names.join(","); //过滤重复的商家
yqMerchantList.forEach(item => {
if (!this.infoForm.yqMerchantList.some(yqMerchant => yqMerchant.yqMerchantId === item.merchantId)) {
this.infoForm.yqMerchantList.push({
yqMerchantName: item.merchantName,
yqMerchantId: item.merchantId
});
}
});
this.relatedYqMerchantNames = this.infoForm.yqMerchantList.map(item => item.yqMerchantName).join(",");
}, },
handleAddConfirm() { handleAddConfirm() {
this.$refs.editFormRef.validate((valid) => { this.$refs.editFormRef.validate((valid) => {
...@@ -162,11 +168,7 @@ export default { ...@@ -162,11 +168,7 @@ export default {
const sceneList = selectedScenes.map(scene => { const sceneList = selectedScenes.map(scene => {
return { return {
baseSceneCode: scene.baseSceneCode, baseSceneCode: scene.baseSceneCode,
sceneType: scene.sceneType, sceneType: scene.sceneType
yqMerchantList: scene.yqMerchant ? [{
yqMerchantName: scene.yqMerchant.merchantName,
yqMerchantId: scene.yqMerchant.merchantId
}] : []
}; };
}); });
...@@ -174,8 +176,9 @@ export default { ...@@ -174,8 +176,9 @@ export default {
staffId: this.detail.staffId || this.detail.id, staffId: this.detail.staffId || this.detail.id,
merchantName: this.infoForm.merchantName, merchantName: this.infoForm.merchantName,
merchantId: this.infoForm.merchantId, merchantId: this.infoForm.merchantId,
sceneList: sceneList sceneList: sceneList,
}; yqMerchantList: this.infoForm.yqMerchantList
}
assignStoreApi(params).then(() => { assignStoreApi(params).then(() => {
this.$message.success("分配门店成功"); this.$message.success("分配门店成功");
......
<!-- 禁用账号弹窗 --> <!-- 禁用账号弹窗 -->
<template> <template>
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="confirmDisable" :config="baseDialogConfig"> <baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="confirmDisable"
:config="baseDialogConfig">
<div class="disable-dialog-content"> <div class="disable-dialog-content">
<div style="background: #f8f8f8; padding: 15px; border-radius: 4px; margin-bottom: 20px;"> <div style="background: #f8f8f8; padding: 15px; border-radius: 4px; margin-bottom: 20px;">
<div style="font-weight: bold; margin-bottom: 10px; color: #333; font-size: 14px;">基本信息</div> <div style="font-weight: bold; margin-bottom: 10px; color: #333; font-size: 14px;">基本信息</div>
...@@ -9,7 +10,7 @@ ...@@ -9,7 +10,7 @@
<span style="color: #666;">员工姓名:</span><span style="color: #333;">{{ staffName }}</span> <span style="color: #666;">员工姓名:</span><span style="color: #333;">{{ staffName }}</span>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<span style="color: #666;">业务场景:</span><span style="color: #333;">{{ formattedSceneLabel }}</span> <span style="color: #666;">适配业务:</span><span style="color: #333;">{{ formattedSceneLabel }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="font-size: 14px; line-height: 28px;"> <el-row style="font-size: 14px; line-height: 28px;">
...@@ -20,7 +21,8 @@ ...@@ -20,7 +21,8 @@
</div> </div>
<div style="display: flex; align-items: flex-start;"> <div style="display: flex; align-items: flex-start;">
<i class="el-icon-warning" style="color: #ff9900; font-size: 24px; margin-right: 12px; margin-top: 2px;"></i> <i class="el-icon-warning"
style="color: #ff9900; font-size: 24px; margin-right: 12px; margin-top: 2px;"></i>
<div> <div>
<div style="font-size: 16px; font-weight: bold; color: #333; margin-bottom: 8px;">确认禁用该员工的门店账号?</div> <div style="font-size: 16px; font-weight: bold; color: #333; margin-bottom: 8px;">确认禁用该员工的门店账号?</div>
<div style="font-size: 14px; color: #999;">禁用后,该账号将无法登录业务端开展业务。</div> <div style="font-size: 14px; color: #999;">禁用后,该账号将无法登录业务端开展业务。</div>
...@@ -72,8 +74,11 @@ export default { ...@@ -72,8 +74,11 @@ export default {
}, },
baseDialogConfig() { baseDialogConfig() {
return { return {
confirmText: "禁用", showClose: true,
cancelText: "取消", appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: "取 消",
confirm_name: "禁用",
} }
}, },
merchantName() { merchantName() {
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
</div> </div>
<div class="info-item flex"> <div class="info-item flex">
<label>岗位:</label> <label>岗位:</label>
<span>{{ detail.jobType || "-" }}</span> <span>{{ detail.staffBeisenBaseInfoDTO ? detail.staffBeisenBaseInfoDTO.oidJobPost || '-' : "-"
}}</span>
</div> </div>
<!-- <div class="info-item flex"> <!-- <div class="info-item flex">
<label>适配业务:</label> <label>适配业务:</label>
...@@ -207,7 +208,7 @@ ...@@ -207,7 +208,7 @@
<!-- N:未删除;I:禁用 --> <!-- N:未删除;I:禁用 -->
<el-switch v-model="scope.scope.deletedFlag" active-value="N" inactive-value="I" <el-switch v-model="scope.scope.deletedFlag" active-value="N" inactive-value="I"
@change="(e) => switchChange(scope.scope)"></el-switch> @change="(e) => switchChange(scope.scope)"></el-switch>
<span>{{ scope.scope.deletedFlag === 'I' ? '禁用账号' : '启用账号' }}</span> <span>{{ scope.scope.deletedFlag === 'N' ? '禁用账号' : '启用账号' }}</span>
</template> </template>
</d2-table> </d2-table>
...@@ -668,23 +669,22 @@ ...@@ -668,23 +669,22 @@
</el-form> </el-form>
<!-- 分配门店 --> <!-- 分配门店 -->
<AssignStoreDialog v-if="allocateStoreVisible" :visibleSync.sync="allocateStoreVisible" :detail="detail" <AssignStoreDialog v-if="allocateStoreVisible" :visibleSync.sync="allocateStoreVisible"
:jobTypeList="jobTypeList" @dialogClose="closeAllocateStoreDialog"> :detail="{ ...detail, staffId: queryData.id }" @refreshTable="closeAllocateStoreDialog">
</AssignStoreDialog> </AssignStoreDialog>
<!-- 分配门店 --> <!-- 分配门店 -->
<!-- <allocate-store-dialog :allocate-store-visible="allocateStoreVisible" :detail="detail" :jobTypeList="jobTypeList" <!-- <allocate-store-dialog :allocate-store-visible="allocateStoreVisible" :detail="detail" :jobTypeList="jobTypeList"
v-if="allocateStoreVisible" @dialogClose="closeAllocateStoreDialog"></allocate-store-dialog> --> v-if="allocateStoreVisible" @dialogClose="closeAllocateStoreDialog"></allocate-store-dialog> -->
<!-- 北森同步 --> <!-- 北森同步 -->
<sync-bei-sen-dialog :sync-bei-sen-visible="syncBeiSenVisible" :detail="detail" v-if="syncBeiSenVisible" <sync-bei-sen-dialog :sync-bei-sen-visible="syncBeiSenVisible" :detail="detail" :satffId="queryData.id"
@dialogClose="closeSyncBeiSenDialog" @refreshDetail="getDetail"></sync-bei-sen-dialog> v-if="syncBeiSenVisible" @dialogClose="closeSyncBeiSenDialog" @refreshDetail="getDetail"></sync-bei-sen-dialog>
<!-- 禁用账号二次确认弹窗 --> <!-- 禁用账号二次确认弹窗 -->
<disable-account-dialog :disable-dialog-visible="disableDialogVisible" :current-row="currentDisableRow" <disable-account-dialog :disable-dialog-visible="disableDialogVisible" :current-row="currentDisableRow"
:staff-name="detail.staffName" :staff-name="detail.staffName"
:formatted-scene-label="currentDisableRow ? filterStr(currentDisableRow.staffSceneLabel, staffSceneLabelList) : ''" :formatted-scene-label="currentDisableRow ? currentDisableRow.accountSceneStr : ''" v-if="disableDialogVisible"
v-if="disableDialogVisible" @dialogClose="closeDisableDialog" @refreshDetail="getDetail" @dialogClose="closeDisableDialog" @refreshDetail="getDetail" @disableFailed="handleDisableFailed">
@disableFailed="handleDisableFailed">
</disable-account-dialog> </disable-account-dialog>
</div> </div>
</template> </template>
...@@ -843,13 +843,7 @@ export default { ...@@ -843,13 +843,7 @@ export default {
{ {
label: "适配业务", label: "适配业务",
prop: "staffSceneLabel", prop: "accountSceneStr"
formatter: (row) => {
return this.filterStr(
row.staffSceneLabel,
this.staffSceneLabelList
);
},
}, },
{ {
label: "开通时间", label: "开通时间",
...@@ -1303,23 +1297,24 @@ export default { ...@@ -1303,23 +1297,24 @@ export default {
}, },
switchChange(row) { switchChange(row) {
this.currentDisableRow = row;
this.disableDialogVisible = true;
// N启用状态==》禁止二次弹窗 // N启用状态==》禁止二次弹窗
// if (row.deletedFlag === 'N') { if (row.deletedFlag === 'I') {
// // 当切换到禁用时,弹出自定义确认框 // 当切换到禁用时,弹出自定义确认框
// this.currentDisableRow = row; //添加阻止switch 切换状态
// this.disableDialogVisible = true; row.deletedFlag = 'N';
// } else { this.currentDisableRow = row;
this.disableDialogVisible = true;
} else {
// // 当切换到启用时,直接调用接口 // 当切换到启用时,直接调用接口
// beiSenEmployeeDisableApi({ accountId: row.id }).then(() => { beiSenEmployeeDisableApi({ accountId: row.id }).then(() => {
// this.$message.success('账号已启用'); this.$message.success('账号已启用');
// this.getDetail(); this.getDetail();
// }).catch(() => { }).catch(() => {
// row.deletedFlag = 'I'; // 恢复状态 row.deletedFlag = 'I'; // 恢复状态
// }); });
// } }
}, },
closeDisableDialog() { closeDisableDialog() {
...@@ -1578,13 +1573,13 @@ export default { ...@@ -1578,13 +1573,13 @@ export default {
// 分配门店 // 分配门店
handleAllocateStore() { handleAllocateStore() {
this.closeAllocateStoreDialog(); this.allocateStoreVisible = !this.allocateStoreVisible;
}, },
closeAllocateStoreDialog(e) { closeAllocateStoreDialog(e) {
if (e?.flag) {
this.getDetail(); this.getDetail();
}
this.allocateStoreVisible = !this.allocateStoreVisible; this.allocateStoreVisible = !this.allocateStoreVisible;
}, },
...@@ -1627,24 +1622,7 @@ export default { ...@@ -1627,24 +1622,7 @@ export default {
entryTime: new Date(this.detail.entryTime), entryTime: new Date(this.detail.entryTime),
hireType: hireType:
this.detail.hireType || this.detail.hireType, this.detail.hireType || this.detail.hireType,
jobType:
this.detail.jobType == this.detail.levelType
? !this.isEmpty(
this.detail.nextMonthJobType
)
? this.detail.nextMonthJobType
: this.detail.jobType
: this.detail.levelType,
workingStatus: this.detail.workingStatus, workingStatus: this.detail.workingStatus,
mentorName: this.detail.mentorPhone
? this.mentorPhoneList?.find(
(item) =>
item.confId ==
this.detail.mentorPhone
)?.confValue || this.detail.mentorName
: "",
titleType: this.detail.titleType,
mentorPhone: this.detail.mentorPhone,
// basicSalary: // basicSalary:
// this.detail.basicSalary == this.detail.baseSalary // this.detail.basicSalary == this.detail.baseSalary
// ? !this.isEmpty(this.detail.nextMonthBasicSalary) // ? !this.isEmpty(this.detail.nextMonthBasicSalary)
......
...@@ -3,21 +3,19 @@ ...@@ -3,21 +3,19 @@
<baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="submitSyncBeiSen" <baseDialog :dialog-config="dialogConfig" :is-show.sync="visible" @handleClick="submitSyncBeiSen"
:config="baseDialogConfig"> :config="baseDialogConfig">
<div class="sync-beisen-dialog"> <div class="sync-beisen-dialog">
<div style="display: flex; gap: 10px; margin-bottom: 20px;"> <div class="search-container">
<el-input v-model="syncSearchForm.staffName" placeholder="请输入姓名" style="width: 200px" clearable></el-input> <el-input v-model="syncSearchForm.staffName" placeholder="请输入姓名" class="search-input" clearable></el-input>
<el-input v-model="syncSearchForm.mobilePhone" placeholder="请输入手机号" style="width: 200px" <el-input v-model="syncSearchForm.mobilePhone" placeholder="请输入手机号" class="search-input"
clearable></el-input> clearable></el-input>
<el-button type="primary" @click="handleSyncSearch">查询</el-button> <el-button type="primary" @click="handleSyncSearch">查询</el-button>
</div> </div>
<div v-loading="syncLoading" <div v-loading="syncLoading" class="result-container">
style="min-height: 100px; max-height: 400px; overflow-y: auto; padding: 10px; border: 1px solid #EBEEF5; border-radius: 4px;"> <div v-if="!syncResultList.length" class="empty-state">
<div v-if="!syncResultList.length" style="text-align: center; color: #909399; margin-top: 40px;"> <img src="@/assets/empty.png" alt="" class="empty-img">
<i class="el-icon-document" style="font-size: 40px; margin-bottom: 10px; display: block;"></i> <span class="empty-text">未查询到匹配的北森员工数据</span>
未查询到匹配的北森员工数据
</div> </div>
<el-radio-group v-else v-model="selectedBeiSenUserId" <el-radio-group v-else v-model="selectedBeiSenUserId" class="radio-group-list">
style="display: flex; flex-direction: column; gap: 15px;">
<el-radio v-for="item in syncResultList" :key="item.userID" :label="item.userID"> <el-radio v-for="item in syncResultList" :key="item.userID" :label="item.userID">
{{ item.name }} | {{ item.mobilePhone }} {{ item.name }} | {{ item.mobilePhone }}
</el-radio> </el-radio>
...@@ -37,10 +35,10 @@ export default { ...@@ -37,10 +35,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
detail: { satffId: {
type: Object, type: Number,
default: () => ({}), default: 0,
}, }
}, },
data() { data() {
return { return {
...@@ -102,9 +100,12 @@ export default { ...@@ -102,9 +100,12 @@ export default {
}); });
}, },
submitSyncBeiSen() { submitSyncBeiSen() {
if (!this.selectedBeiSenUserId) return; if (!this.selectedBeiSenUserId) {
this.$message.warning("请选择北森员工");
return;
}
const params = { const params = {
staffId: this.detail.id, // detail is fetched from staffBaseInfoPageList/getDetail, usually has id staffId: this.satffId,
beiSenUserID: this.selectedBeiSenUserId beiSenUserID: this.selectedBeiSenUserId
}; };
beiSenEmployeeSingleSyncApi(params).then(() => { beiSenEmployeeSingleSyncApi(params).then(() => {
...@@ -117,8 +118,51 @@ export default { ...@@ -117,8 +118,51 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped lang="scss">
.sync-beisen-dialog { .sync-beisen-dialog {
padding: 0 20px; padding: 0 20px;
} }
.search-container {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
.search-input {
width: 200px;
}
.result-container {
background-color: #F5F7FA;
min-height: 100px;
max-height: 400px;
overflow-y: auto;
padding: 16px;
border: 1px solid #ECEEF5;
border-radius: 4px;
}
.empty-state {
margin-top: 40px;
display: flex;
flex-direction: column;
align-items: center;
}
.empty-img {
width: 64px;
margin-bottom: 10px;
display: block;
}
.empty-text {
color: #999999;
}
.radio-group-list {
display: flex;
flex-direction: column;
gap: 15px;
}
</style> </style>
<!--
* @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>
...@@ -28,7 +21,10 @@ ...@@ -28,7 +21,10 @@
<d2-table-header> <d2-table-header>
<template #left> <template #left>
<span class="left"> <span class="left">
<auth-button category="Button" :show-btn-ids="['9120506']" /> <span class="tips_text">
仅展示「深圳嘀加」服务商的驻店员工,以及「广联数科」商户下员工
</span>
<!-- <auth-button category="Button" :show-btn-ids="['9120506']" /> -->
</span> </span>
</template> </template>
<span style="display: inline-block; margin-right: 10px"> <span style="display: inline-block; margin-right: 10px">
...@@ -52,9 +48,7 @@ ...@@ -52,9 +48,7 @@
</span> </span>
<auth-button category="Button" :show-btn-ids="['9120507']" /> <auth-button category="Button" :show-btn-ids="['9120507']" />
</d2-table-header> </d2-table-header>
<span class="tips_text">
仅展示「深圳嘀加」服务商的驻店员工,以及「广联数科」商户下员工
</span>
<d2-table ref="recordTable" :before-search-fn="beforeSearchFn" class="inStoreTable" <d2-table ref="recordTable" :before-search-fn="beforeSearchFn" class="inStoreTable"
:get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams"> :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams">
<template #auth-button="scope"> <template #auth-button="scope">
...@@ -62,9 +56,9 @@ ...@@ -62,9 +56,9 @@
<!-- <auth-button :data="scope.scope" /> --> <!-- <auth-button :data="scope.scope" /> -->
<auth-button :data="scope.scope" :show-btn-ids="['9120505']" /> <auth-button :data="scope.scope" :show-btn-ids="['9120505']" />
<!-- 待激活 --> <!-- 待激活 -->
<span style="margin-left:10px;"> <!-- <span style="margin-left:10px;" v-if="scope.scope.workingStatus == 2"> -->
<auth-button :data="scope.scope" :show-btn-ids="['9120516']" /> <auth-button :data="scope.scope" :show-btn-ids="['9120516']" />
</span> <!-- </span> -->
</div> </div>
</template> </template>
...@@ -149,10 +143,9 @@ export default { ...@@ -149,10 +143,9 @@ export default {
searchForm: { searchForm: {
staffName: "", staffName: "",
staffPhone: "", staffPhone: "",
staffSceneLabel: "", baseSceneCode: "",
merchantName: "", merchantName: "",
hireType: "", oIdJobPostId: "",
jobType: "",
workingStatus: "", workingStatus: "",
createdSource: "", createdSource: "",
directLeaderPhones: [], directLeaderPhones: [],
...@@ -187,7 +180,7 @@ export default { ...@@ -187,7 +180,7 @@ export default {
}, },
{ {
label: "适配业务", label: "适配业务",
name: "staffSceneLabel", name: "baseSceneCode",
type: "select", type: "select",
isClear: true, isClear: true,
optionList: [], optionList: [],
...@@ -201,24 +194,14 @@ export default { ...@@ -201,24 +194,14 @@ export default {
type: "input", type: "input",
isClear: true, isClear: true,
}, },
// {
// label: "招聘通道",
// name: "hireType",
// type: "select",
// isClear: true,
// optionList: [],
// optionId: "confId",
// optionLabel: "confValue",
// optionsName: "hireTypeList",
// },
{ {
label: "岗位", label: "岗位",
name: "jobType", name: "oIdJobPostId",
type: "select", type: "select",
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: "confId", optionId: "oid",
optionLabel: "confValue", optionLabel: "name",
optionsName: "jobTypeList", optionsName: "jobTypeList",
}, },
...@@ -278,10 +261,10 @@ export default { ...@@ -278,10 +261,10 @@ export default {
}, },
{ {
label: "适配业务", label: "适配业务",
prop: "staffSceneLabel", prop: "accountSceneStr",
width: "160px", width: "160px",
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.staffSceneLabel || "-"; return cellValue.accountSceneStr || "-";
}, },
}, },
{ {
...@@ -304,23 +287,16 @@ export default { ...@@ -304,23 +287,16 @@ export default {
}, },
{ {
label: "岗位", label: "岗位",
prop: "jobType", prop: "oidJobPost"
formatter: (cellValue) => {
// return filterStr(
// cellValue.jobType,
// this.baseData.jobTypeList,
// cellValue.hireType,
// );
},
}, },
{ {
label: "渠道", label: "渠道",
prop: "createdSource", prop: "createdSource",
formatter: (cellValue) => { formatter: (cellValue) => {
// return filterStr( return filterStr(
// cellValue.createdSource, cellValue.createdSource,
// this.baseData.createdSourceList, this.baseData.createdSourceList,
// ); );
}, },
}, },
...@@ -363,7 +339,7 @@ export default { ...@@ -363,7 +339,7 @@ export default {
prop: "workingStatus", prop: "workingStatus",
width: "120px", width: "120px",
formatter: (cellValue) => { formatter: (cellValue) => {
return (this.baseData.workingStatusList.find(item => item.confId === cellValue.workingStatus) || {}).confValue || "-"; return (this.baseData.workingStatusList.find(item => item.confId == cellValue.workingStatus) || {}).confValue || "-";
}, },
...@@ -395,12 +371,16 @@ export default { ...@@ -395,12 +371,16 @@ export default {
], ],
createdSourceList: [ createdSourceList: [
{ confId: "1", confValue: "账户中心" }, { confId: "1", confValue: "账户中心" },
{ confId: "2", confValue: "SCRM" },
{ confId: "3", confValue: "生意助手" }, { confId: "3", confValue: "生意助手" },
{ confId: "4", confValue: "门店助手" },
{ confId: "5", confValue: "服务商SAAS" }, { confId: "5", confValue: "服务商SAAS" },
{ confId: "6", confValue: "D+" }, { confId: "8", confValue: "北森同步" },
{ confId: "7", confValue: "员工版小程序" }, // { confId: "2", confValue: "SCRM" },
// { confId: "4", confValue: "门店助手" },
// { confId: "6", confValue: "D+" },
// { confId: "7", confValue: "员工版小程序" },
], ],
commissionList: [], commissionList: [],
}, },
...@@ -485,15 +465,18 @@ export default { ...@@ -485,15 +465,18 @@ export default {
getLeaderList(), getLeaderList(),
getCommissionListApi(), getCommissionListApi(),
getStaffSceneLabelList(), getStaffSceneLabelList(),
beiSenJobPostPageApi() beiSenJobPostPageApi({
pageNum: 1,
paseSize: 99999
})
]); ]);
console.log(jobTypeList, 'jobTypeList')
// 上级领导列表查询 // 上级领导列表查询
this.baseData.directLeaderList = directLeaderList; this.baseData.directLeaderList = directLeaderList;
// 工资绩效 // 工资绩效
this.baseData.commissionList = [{ staffName: "全部", staffPhone: "all" }].concat(commissionList); this.baseData.commissionList = [{ staffName: "全部", staffPhone: "all" }].concat(commissionList);
this.baseData.staffSceneLabelList = staffSceneLabelList; this.baseData.staffSceneLabelList = staffSceneLabelList;
this.baseData.jobTypeList = jobTypeList; this.baseData.jobTypeList = jobTypeList.list;
getOptionsList(this, "showFormData", true); getOptionsList(this, "showFormData", true);
getOptionsList(this, "showFormData", false, "directLeaderPhones"); getOptionsList(this, "showFormData", false, "directLeaderPhones");
getOptionsList(this, "showFormData", false, "commissionList"); getOptionsList(this, "showFormData", false, "commissionList");
...@@ -555,10 +538,9 @@ export default { ...@@ -555,10 +538,9 @@ export default {
staffName: "", staffName: "",
salaryStaffPhone: "", salaryStaffPhone: "",
staffPhone: "", staffPhone: "",
staffSceneLabel: "", baseSceneCode: "",
merchantName: "", merchantName: "",
hireType: "", oIdJobPostId: "",
jobType: "",
workingStatus: "", workingStatus: "",
createdSource: "", createdSource: "",
directLeaderPhones: [], directLeaderPhones: [],
......
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
<template> <template>
<auth-button <auth-button
category="Button" category="Button"
:data="{approvalType:1}" :data="{approveType:1}"
:show-btn-ids="['9210401']" :show-btn-ids="['9210401']"
/> />
<span style="margin-left: 10px;"> <span style="margin-left: 10px;">
<auth-button <auth-button
category="Button" category="Button"
:data="{approvalType:2}" :data="{approveType:2}"
:show-btn-ids="[ '9210402']" :show-btn-ids="[ '9210402']"
/> />
</span> </span>
...@@ -78,11 +78,13 @@ ...@@ -78,11 +78,13 @@
>查看</el-button> >查看</el-button>
<!--👇 仅系统状态=“草稿”的记录可操作 --> <!--👇 仅系统状态=“草稿”的记录可操作 -->
<el-button <el-button
v-if="scope.scope.systemStatus == 1"
type="text" type="text"
@click="handleEdit(scope.scope)" @click="handleEdit(scope.scope)"
>编辑</el-button> >编辑</el-button>
<!--👇 仅审批状态=“已驳回”“已撤销”“通过后撤销”的记录可操作 --> <!--👇 仅审批状态=“已驳回”“已撤销”“通过后撤销”的记录可操作 -->
<el-button <el-button
v-if="[3,4,5].includes(scope.scope.approveStatus)"
type="text" type="text"
@click="handleEdit(scope.scope,'reapply')" @click="handleEdit(scope.scope,'reapply')"
>重新发起</el-button> >重新发起</el-button>
...@@ -106,6 +108,9 @@ import { ...@@ -106,6 +108,9 @@ import {
LISTING_TYPE_OPTIONS LISTING_TYPE_OPTIONS
} from './constant' } from './constant'
import { storeApprovePageQuery } from '@/api/salesManagement.js' import { storeApprovePageQuery } from '@/api/salesManagement.js'
import {
getStaffSceneLabelList,
} from "@api/resident";
export default { export default {
name: 'availableInStores', name: 'availableInStores',
components: { components: {
...@@ -185,8 +190,8 @@ export default { ...@@ -185,8 +190,8 @@ export default {
name: 'baseSceneCode', name: 'baseSceneCode',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'id', optionId: 'baseSceneCode',
optionLabel: 'label', optionLabel: 'name',
optionsName: 'businessSceneOptions' optionsName: 'businessSceneOptions'
} }
], ],
...@@ -201,18 +206,17 @@ export default { ...@@ -201,18 +206,17 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '单据编码', label: '单据编码',
prop: 'businessCode' prop: 'businessCode',
minWidth: 120,
}, },
{ {
label: '上架类型', label: '上架类型',
prop: 'shelfTypeName', prop: 'shelfTypeName',
// formatter: (cellValue) => {
// return deepClone(LISTING_TYPE_OPTIONS.find(item => item.id == cellValue.shelfType)?.label);
// },
}, },
{ {
label: '业务场景', label: '业务场景',
prop: 'sceneTypeName', prop: 'sceneTypeName',
minWidth: 120,
}, },
{ {
label: '流量方信息', label: '流量方信息',
...@@ -222,13 +226,12 @@ export default { ...@@ -222,13 +226,12 @@ export default {
{ {
label: '审批类型', label: '审批类型',
prop: 'approveTypeName', prop: 'approveTypeName',
// formatter: (cellValue) => { minWidth: 120,
// return deepClone(APPROVAL_TYPE_OPTIONS.find(item => item.id == cellValue.approveType)?.label);
// },
}, },
{ {
label: '审批编码', label: '审批编码',
prop: 'workWechatCode', prop: 'workWechatCode',
minWidth: 120,
}, },
{ {
label: '提交时间', label: '提交时间',
...@@ -241,15 +244,12 @@ export default { ...@@ -241,15 +244,12 @@ export default {
{ {
label: '系统状态', label: '系统状态',
prop: 'systemStatusName', prop: 'systemStatusName',
// formatter: (cellValue) => {
// return deepClone(SYSTEM_STATUS_OPTIONS.find(item => item.id == cellValue.systemStatus)?.label);
// },
}, },
{ {
label: '审批状态', label: '审批状态',
prop: 'approveStatus', 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 {
...@@ -278,16 +278,23 @@ export default { ...@@ -278,16 +278,23 @@ export default {
}, },
mounted () { mounted () {
this.getBaseData() this.getStaffSceneLabelList()
}, },
methods: { methods: {
getBaseData () { getStaffSceneLabelList () {
getStaffSceneLabelList().then(res => {
this.getBaseData('businessSceneOptions', res)
})
},
getBaseData (key, val) {
this.baseData = { this.baseData = {
approvalTypeOptions: deepClone(APPROVAL_TYPE_OPTIONS), approvalTypeOptions: deepClone(APPROVAL_TYPE_OPTIONS),
systemStatusOptions: deepClone(SYSTEM_STATUS_OPTIONS), systemStatusOptions: deepClone(SYSTEM_STATUS_OPTIONS),
approveStatusOpt: deepClone(approveStatusOpt), approveStatusOpt: deepClone(approveStatusOpt),
listingTypeOptions: deepClone(LISTING_TYPE_OPTIONS) listingTypeOptions: deepClone(LISTING_TYPE_OPTIONS),
businessSceneOptions: deepClone(val)
} }
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]) { if (item.type === 'select' && this.baseData[item.optionsName]) {
...@@ -325,18 +332,22 @@ export default { ...@@ -325,18 +332,22 @@ export default {
}) })
}, },
// 根据审批类型跳转到对应页面 // 根据审批类型跳转到对应页面
navigateToApprovalPage (query) { navigateToApprovalPage (params) {
const routeMap = { const routeMap = {
1: 'tigaListingAndSalesContract', 1: 'tigaListingAndSalesContract',
2: 'addAndModifyTheListing' 2: 'addAndModifyTheListing'
} }
const routeName = routeMap[query.approvalType] const routeName = routeMap[params.approveType]
if (!routeName) { if (!routeName) {
this.$message.warning('未知的审批类型') this.$message.warning('未知的审批类型')
return return
} }
const query = {
approveType: params.approveType
}
if (params.businessCode) query.businessCode = params.businessCode
if (params.pageType) query.pageType = params.pageType
this.$router.push({ this.$router.push({
name: routeName, name: routeName,
query query
......
...@@ -149,10 +149,10 @@ ...@@ -149,10 +149,10 @@
:style="{ width: '530px' }" :style="{ width: '530px' }"
> >
<el-option <el-option
v-for="subItem in options.sceneType" v-for="subItem in options.sceneTypeOpts"
:key="subItem.confId" :key="subItem.sceneType"
:label="subItem.confValue" :label="subItem.name"
:value="subItem.confId" :value="subItem.sceneType"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -271,7 +271,9 @@ import GlOssApi from "glsk-oss-jssdk"; ...@@ -271,7 +271,9 @@ import GlOssApi from "glsk-oss-jssdk";
import { mapActions, mapState } from "vuex"; import { mapActions, mapState } from "vuex";
import { getMerchantPage } from "@api/shelfManage.js"; import { getMerchantPage } from "@api/shelfManage.js";
import { baseConfig } from "@/main"; import { baseConfig } from "@/main";
import {
getStaffSceneLabelList,
} from "@api/resident";
export default { export default {
name: 'StepOne', name: 'StepOne',
components: { components: {
...@@ -300,17 +302,23 @@ export default { ...@@ -300,17 +302,23 @@ export default {
merchantId: "", // 4s店商户号, merchantId: "", // 4s店商户号,
shelfType: 1, // 上架类型:1-单店模式 2-项目制批量上架 shelfType: 1, // 上架类型:1-单店模式 2-项目制批量上架
sceneType: 1, sceneType: 1,
baseSceneCode: ''
}, },
uploadKey: Date.now(), uploadKey: Date.now(),
options: { options: {
merchant: [], merchant: [],
shelfType: shelfTypeOpt, shelfType: shelfTypeOpt,
sceneType: [ sceneTypeOpts: []
{ confId: 1, confValue: "精品升级" }, },
{ confId: 0, confValue: "会员权益升级" }, }
] },
watch: {
'infoForm.sceneType': {
handler (val) {
this.infoForm.baseSceneCode = this.options.sceneTypeOpts.find(item => item.sceneType == val)?.baseSceneCode || ''
}, },
immediate: true,
deep: true,
} }
}, },
computed: { computed: {
...@@ -367,8 +375,12 @@ export default { ...@@ -367,8 +375,12 @@ export default {
formRef () { formRef () {
return this.$refs.formRef return this.$refs.formRef
}, },
sceneTypeName () {
return this.options.sceneTypeOpts.find(item => item.sceneType == this.infoForm.sceneType)?.name || ''
}
}, },
mounted () { mounted () {
this.getStaffSceneLabelList();
this.GlOssApi = new GlOssApi({ this.GlOssApi = new GlOssApi({
baseConfig, baseConfig,
}); });
...@@ -376,6 +388,10 @@ export default { ...@@ -376,6 +388,10 @@ export default {
methods: { methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]), ...mapActions("d2admin/user", ["actionSetDownloadList"]),
...mapActions({ close: "d2admin/page/close" }), ...mapActions({ close: "d2admin/page/close" }),
async getStaffSceneLabelList () {
const res = await getStaffSceneLabelList();
this.options.sceneTypeOpts = res;
},
handleFileChange (file, fileList, targetItem) { handleFileChange (file, fileList, targetItem) {
// return false // return false
// // setTimeout(() => { // // setTimeout(() => {
...@@ -431,7 +447,17 @@ export default { ...@@ -431,7 +447,17 @@ export default {
this.GlOssApi.multipartUpload(file, success, fail, bucketName, fileType); this.GlOssApi.multipartUpload(file, success, fail, bucketName, fileType);
}, },
exportTemplate () { exportTemplate () {
let { shelfType } = this.infoForm,
name = {
1: '门店上架模版-单店模式',
2: '门店上架模版-项目制批量上架'
}[shelfType]
const link = document.createElement("a");
link.href = `https://img02.glsx.com.cn/weapp/resource/saas/xlsx/${name}.xlsx`
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(link.href);
}, },
handleOnExceed (files, fileList) { handleOnExceed (files, fileList) {
this.$message({ this.$message({
......
<template> <template>
<div class="business-information-container"> <div class="business-information-container">
<div class="business-information-content">
<template v-for="(i,index) in businessInformation"> <el-form
<el-form-item ref="formRef"
class="business-information-item" label-width="150px"
:label="i.label + ':'" :model="componentData"
:key="index" :size="size"
> :rules="rules"
<template v-if="i.type == 'text' || isViewMode">{{ data[i.key] || '-' }}</template> >
<template v-else> <div class="business-information-content">
<el-input
v-model="data[i.key]" <template v-for="(i,index) in fixedInfo">
@input="filterInputVal(i,$event,'data')" <el-form-item
:maxlength="i.maxlength || -1" class="business-information-item"
></el-input> :label="i.label + ':'"
</template> :key="`fixedInfo${index}`"
</el-form-item> >
</template> {{ getData(i.key) || '-' }}
</div> </el-form-item>
</template>
<template v-for="(i,index) in businessInformation">
<el-form-item
class="business-information-item"
:label="i.label + ':'"
:key="`businessInformation${index}`"
:prop="i.key"
>
<template v-if="i.type == 'text' || isViewMode">{{ componentData[i.key] || '-' }}</template>
<template v-else>
<el-input
v-model="componentData[i.key]"
@input="filterInputVal(i,$event,'data')"
:maxlength="i.maxlength || -1"
></el-input>
</template>
</el-form-item>
</template>
</div>
</el-form>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { deepClone } from '@/common/util'
import { isView } from '@/views/goods/shelfManage/utils'; import { isView } from '@/views/goods/shelfManage/utils';
import componentsMixin from './mixins.js'; import componentsMixin from './mixins.js';
export default { export default {
...@@ -37,25 +58,60 @@ export default { ...@@ -37,25 +58,60 @@ export default {
default: false default: false
} }
}, },
inject: ['size'],
watch: {
data: {
handler (newVal) {
this.componentData = deepClone(newVal)
},
deep: true,
immediate: true
}
},
computed: {
formRef () {
return this.$refs.formRef
},
djGrossProfit () {
return 123
},
djGpr () {
return 1
}
},
data () { data () {
return { return {
componentData: {},
fixedInfo: [
{ label: '嘀加毛利', key: 'djGrossProfit', type: 'text' },
{ label: '嘀加毛利率', key: 'djGpr', type: 'text' },
],
businessInformation: [ businessInformation: [
{ label: '嘀加毛利', key: 'b-a', type: 'text' }, { label: '预估交付数/月', key: 'deliveryCount', filterRule: 'integerRange', min: 0, max: 999999, maxlength: 6 },
{ label: '嘀加毛利率', key: 'b-b', type: 'text' }, { label: '预估触客率', key: 'customerTouchRate', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '预估交付数/月', key: 'b-c', filterRule: 'integerRange', min: 0, max: 999999, maxlength: 6 },
{ label: '预估触客率', key: 'b-d', filterRule: 'decimalRange', min: 0, max: 100, precision: 2 },
{ label: '人员成本', key: 'personnelCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '人员成本', key: 'personnelCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '房租', key: 'rentCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '房租', key: 'rentCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '折旧与摊销', key: 'depreciationCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '折旧与摊销', key: 'depreciationCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '其他(水电、耗材等)', key: 'otherCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '其他(水电、耗材等)', key: 'otherCost', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
{ label: '门店单台利润额', key: 'b-j', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '门店单台利润额', key: 'storeProfitPerCar', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
] ],
rules: {
deliveryCount: [{ required: true, message: '请输入预估交付数/月', trigger: 'blur' }],
customerTouchRate: [{ required: true, message: '请输入预估触客率', trigger: 'blur' }],
personnelCost: [{ required: true, message: '请输入人员成本', trigger: 'blur' }],
rentCost: [{ required: true, message: '请输入房租', trigger: 'blur' }],
depreciationCost: [{ required: true, message: '请输入折旧与摊销', trigger: 'blur' }],
otherCost: [{ required: true, message: '请输入其他(水电、耗材等)', trigger: 'blur' }],
storeProfitPerCar: [{ required: true, message: '请输入门店单台利润额', trigger: 'blur' }]
}
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
getData (key) {
return this[key]
}
} }
} }
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
v-model="data[i.key]" v-model="data[i.key]"
:placeholder="`请选择${i.label}`" :placeholder="`请选择${i.label}`"
class="select" class="select"
:disabled="setDisabled(i)"
> >
<el-option <el-option
v-for="option in i.options" v-for="option in i.options"
...@@ -92,21 +93,12 @@ ...@@ -92,21 +93,12 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import data from '@/views/stockManage/returnManage/constant/data'; import data from '@/views/stockManage/returnManage/constant/data';
import { SALES_CATEGORY_LIST } from './constant' import { SALES_CATEGORY_LIST, SALES_CATEGORY_RULES } from './constant'
import componentsMixin from './mixins.js'; import componentsMixin from './mixins.js';
import { queryProductTypes, queryProductCategories } from '@/api/salesManagement.js'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
const validatorFrom = (rule, value, callback) => {
let { field, required } = rule,
list = [],
label = ''
SALES_CATEGORY_LIST.map(i => {
if (i.list) list.push(...i.list)
})
label = list.find(i => i.key === field)?.label || ''
if (required && (value == null || value == '' || value == undefined)) callback(new Error(`${label}不能为空`))
else callback()
}
export default { export default {
mixins: [componentsMixin], mixins: [componentsMixin],
name: 'SalesCategoryDetail', name: 'SalesCategoryDetail',
...@@ -120,34 +112,15 @@ export default { ...@@ -120,34 +112,15 @@ export default {
default: () => ({}) default: () => ({})
}, },
}, },
inject: ['GET_BASE_SCENE_CODE'],
data () { data () {
return { return {
salesCategoryList: deepClone(SALES_CATEGORY_LIST), salesCategoryList: deepClone(SALES_CATEGORY_LIST),
size: 'small', size: 'small',
viewKey: Date.now(), viewKey: Date.now(),
detailInfo: {
},
loading: false, loading: false,
data: {}, data: {},
rules: { rules: SALES_CATEGORY_RULES
productType: [{ required: true, validator: validatorFrom }],
productCategory: [{ required: true, validator: validatorFrom }],
feeSettlementMode: [{ required: true, validator: validatorFrom }],
penetrationRate: [{ required: true, validator: validatorFrom }],
conversionRate: [{ required: true, validator: validatorFrom }],
revenuePerCar: [{ required: true, validator: validatorFrom }],
g: [{ required: true, validator: validatorFrom }],
upgradePrice: [{ required: true, validator: validatorFrom }],
revenue: [{ required: true, validator: validatorFrom }],
trafficFee: [{ required: true, validator: validatorFrom }],
marketFee1: [{ required: true, validator: validatorFrom }],
marketFee2: [{ required: true, validator: validatorFrom }],
incentive1: [{ required: true, validator: validatorFrom }],
incentive2: [{ required: true, validator: validatorFrom }],
resourceFee: [{ required: true, validator: validatorFrom }],
productCost: [{ required: true, validator: validatorFrom }],
recyclingFilm: [{ required: true, validator: validatorFrom }],
}
} }
}, },
computed: { computed: {
...@@ -159,6 +132,9 @@ export default { ...@@ -159,6 +132,9 @@ export default {
this.close() this.close()
} }
}, },
baseSceneCode () {
return this.GET_BASE_SCENE_CODE()
},
}, },
watch: { watch: {
dialogShow: { dialogShow: {
...@@ -168,14 +144,41 @@ export default { ...@@ -168,14 +144,41 @@ export default {
immediate: true, immediate: true,
deep: true deep: true
}, },
'data.productType': {
handler (val) {
if (val) {
this.queryProductCategories()
}
},
immediate: true,
deep: true
},
item: {
handler (val) {
this.data = val
},
immediate: true,
deep: true
},
}, },
mounted () { mounted () {
}, },
methods: { methods: {
init () { init () {
this.queryProductTypes()
// this.loading = true // this.loading = true
this.viewKey = Date.now() this.viewKey = Date.now()
}, },
async queryProductTypes () {
const { items } = await queryProductTypes({ baseSceneCode: this.baseSceneCode })
this.salesCategoryList[0].list[0].options = items.map(i => ({ label: i, value: i }))
},
async queryProductCategories () {
const { items } = await queryProductCategories({ baseSceneCode: this.baseSceneCode, productType: this.data.productType })
this.salesCategoryList[0].list[1].options = items.map(i => ({ label: i, value: i }))
if (this.data.productCategory && !items.includes(this.data.productCategory)) this.data.productCategory = ''
},
close () { close () {
this.$emit('update:dialogVisible', false) this.$emit('update:dialogVisible', false)
}, },
...@@ -186,6 +189,13 @@ export default { ...@@ -186,6 +189,13 @@ export default {
} }
}) })
}, },
setDisabled (i) {
let flag = false
if (i.key == 'productCategory') {
flag = !this.data.productType
}
return flag
}
} }
} }
</script> </script>
......
...@@ -12,68 +12,88 @@ ...@@ -12,68 +12,88 @@
:size="size" :size="size"
plain plain
type="info" type="info"
v-if="" v-if="length > 1"
>删除</el-button> >删除</el-button>
</div> </div>
<template v-for="(item,index) in salesCategoryList"> <el-form
<div ref="formRef"
class="sales-category-item-box" label-width="150px"
:key="index" :model="componentData"
> :size="size"
<div class="sub-title">{{ item.title }}</div> :rules="rules"
<div class="sales-category-content"> >
<template v-for="(i,ind) in item.list"> <template v-for="(item,index) in salesCategoryList">
<el-form-item <div
class="sales-category-item" class="sales-category-item-box"
:label="i.label + ':'" :key="index"
:key="ind" >
> <div class="sub-title">{{ item.title }}</div>
{{ componentData[i.key] || '-' }} <div class="sales-category-content">
<template v-for="(i,ind) in item.list">
<el-form-item
class="sales-category-item"
:label="i.label + ':'"
:key="ind"
:prop="i.key"
>
{{ componentData[i.key] != null ? componentData[i.key] : '-' }}
</el-form-item> </el-form-item>
</template> </template>
</div>
</div> </div>
</div> </template>
</template> </el-form>
<EditSalesCategory
<SalesCategoryDetail
:dialogVisible.sync="salesCategoryDetailVisible" :dialogVisible.sync="salesCategoryDetailVisible"
:item="currentItem" :item="currentItem"
@submit="handleEditSalesCategory"
/> />
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { SALES_CATEGORY_LIST } from './constant' import { SALES_CATEGORY_LIST, SALES_CATEGORY_RULES } from './constant'
import SalesCategoryDetail from './SalesCategoryDetail.vue' import EditSalesCategory from './EditSalesCategory.vue'
export default { export default {
name: 'SalesCategory', name: 'SalesCategory',
components: { SalesCategoryDetail }, components: { EditSalesCategory },
props: { props: {
data: { data: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
} },
length: {
type: Number,
default: 0
},
}, },
inject: ['size'], inject: ['size'],
watch: { watch: {
data: { data: {
handler (newVal) { handler (newVal) {
console.log(newVal, '===')
this.componentData = deepClone(newVal) this.componentData = deepClone(newVal)
}, },
deep: true, deep: true,
immediate: true immediate: true
} }
}, },
computed: {
formRef () {
return this.$refs.formRef
},
},
data () { data () {
return { return {
componentData: {}, componentData: {},
editStatus: false, editStatus: false,
salesCategoryList: deepClone(SALES_CATEGORY_LIST), salesCategoryList: deepClone(SALES_CATEGORY_LIST),
salesCategoryDetailVisible: false, salesCategoryDetailVisible: false,
currentItem: {} currentItem: {},
rules: SALES_CATEGORY_RULES
} }
}, },
mounted () { mounted () {
...@@ -91,7 +111,33 @@ export default { ...@@ -91,7 +111,33 @@ export default {
this.salesCategoryDetailVisible = true this.salesCategoryDetailVisible = true
}, },
deleteSalesCategory () { deleteSalesCategory () {
this.$confirm("删除后不可恢复,是否确定删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
}).then(async () => {
this.$emit('delete', this.data)
// const data = await deleteStrategy({
// id: item.id
// })
// if (data) {
// this.$emit('refresh')
// this.$message.success('操作成功')
// this.close()
// } else this.$message.error('操作失败')
})
},
handleEditSalesCategory (data) {
console.log(data)
if (data.edit) {
delete data.edit
this.$emit('edit', data)
this.salesCategoryDetailVisible = false
} else {
this.$emit('add', data)
this.salesCategoryDetailVisible = false
}
} }
} }
} }
......
...@@ -5,9 +5,9 @@ const SALES_CATEGORY_LIST = [ ...@@ -5,9 +5,9 @@ const SALES_CATEGORY_LIST = [
{ label: '销售品类', key: 'productCategory', type: 'select', options: [] }, { label: '销售品类', key: 'productCategory', type: 'select', options: [] },
{ {
label: '流量费结算模式', key: 'feeSettlementMode', type: 'select', options: [ label: '流量费结算模式', key: 'feeSettlementMode', type: 'select', options: [
{ label: '按信息量', value: '1' }, { label: '按信息量', value: '按信息量' },
{ label: '按有效流量', value: '2' }, { label: '按有效流量', value: '按有效流量' },
{ label: '按销售额', value: '3' }, { label: '按销售额', value: '按销售额' },
] ]
}, },
] ]
...@@ -21,7 +21,7 @@ const SALES_CATEGORY_LIST = [ ...@@ -21,7 +21,7 @@ const SALES_CATEGORY_LIST = [
}, },
{ {
title: '预估经营数据', list: [ title: '预估经营数据', list: [
{ label: '转化率', key: 'g', 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: 'upgradePrice', 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: 'revenue', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 }, { label: '产值', key: 'revenue', type: 'input', filterRule: 'decimalRange', min: 0, max: 999999, precision: 2 },
] ]
...@@ -43,5 +43,34 @@ const SALES_CATEGORY_LIST = [ ...@@ -43,5 +43,34 @@ const SALES_CATEGORY_LIST = [
] ]
}, },
] ]
const VAILIDATOR_FROM = (rule, value, callback) => {
module.exports = { SALES_CATEGORY_LIST } let { field, required } = rule,
list = [],
label = ''
SALES_CATEGORY_LIST.map(i => {
if (i.list) list.push(...i.list)
})
label = list.find(i => i.key === field)?.label || ''
if (required && (value === null || value === '' || value === undefined)) callback(new Error(`${label}不能为空`))
else callback()
}
const SALES_CATEGORY_RULES = {
productType: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'change' }],
productCategory: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'change' }],
feeSettlementMode: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
penetrationRate: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
conversionRate: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
revenuePerCar: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
conversionRate: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
upgradePrice: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
revenue: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
trafficFee: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
marketFee1: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
marketFee2: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
incentive1: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
incentive2: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
resourceFee: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
productCost: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
recyclingFilm: [{ required: true, validator: VAILIDATOR_FROM, trigger: 'blur' }],
}
module.exports = { SALES_CATEGORY_LIST, SALES_CATEGORY_RULES }
...@@ -38,13 +38,64 @@ ...@@ -38,13 +38,64 @@
type="info" type="info"
>取消</el-button> >取消</el-button>
</div> </div>
<el-dialog
:close-on-click-modal="false"
:show-close="false"
title="提示"
:visible.sync="dialogVisible"
width="30%"
>
<template v-if="!updateStatus">
<div class="dialog-content">
<div class="dialog-tips-big">
正在处理中
</div>
<div class="dialog-tips-small">
说明:系统正在加急导入中,请耐心等待;导入过程中,请不要退出当前操作,否则将导致本次提交无效。
</div>
</div>
</template>
<template v-else>
<div
v-if="errorFileUrl"
class="dialog-content"
>
<div class="dialog-tips-big">
处理失败。可点击 <span>下载失败模版</span> 查看失败原因。
</div>
</div>
<div
v-else
class="dialog-content"
>
<div class="dialog-tips-big">
处理成功,可返回列表查看。
</div>
</div>
</template>
<template #footer>
<span class="dialog-footer">
<el-button
v-if="updateStatus"
type="primary"
@click="nextStep"
>
{{!errorFileUrl ? '继续下一步' : '确定'}}
</el-button>
</span>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { mapActions, mapState } from "vuex";
import StepOne from './components/StepOne.vue'; import StepOne from './components/StepOne.vue';
import StepTwo from './components/StepTwo/index.vue'; import StepTwo from './components/StepTwo/index.vue';
import { getWorkwechatTemplate, getBusisDetailBasic } from "@api/shelfManage.js"; import { getWorkwechatTemplate, getBusisDetailBasic } from "@api/shelfManage.js";
import { storeApproveCreateDraft, storeApproveEditDraft, storeApproveQueryDetail } from '@/api/salesManagement.js'
import { deepClone } from "@/common/util";
export default { export default {
name: 'tigaListingAndSalesContract', name: 'tigaListingAndSalesContract',
...@@ -54,7 +105,8 @@ export default { ...@@ -54,7 +105,8 @@ export default {
}, },
provide () { provide () {
return { return {
GET_PAGE_TYPE: () => this.pageType GET_PAGE_TYPE: () => this.pageType,
GET_BASE_SCENE_CODE: () => this.baseSceneCode,
} }
}, },
data () { data () {
...@@ -63,53 +115,62 @@ export default { ...@@ -63,53 +115,62 @@ export default {
pageComplete: false, pageComplete: false,
pageType: '', pageType: '',
templateInfo: [], templateInfo: [],
shelfTypeDisabled: false shelfTypeDisabled: false,
dialogVisible: false,
updateStatus: false,
updatePercentage: 0,
errorFileUrl: "",
baseSceneCode: '',
businessCode: ''
} }
}, },
watch: {
},
computed: { computed: {
stepOneRef () { stepOneRef () {
return this.$refs.stepOneRef return this.$refs.stepOneRef
}, },
stepTwoRef () { stepTwoRef () {
return this.$refs.stepTwoRef return this.$refs.stepTwoRef
} },
}, },
mounted () { mounted () {
return this.getDetail() this.step = 2
let { approvalType, pageType, id } = this.$route.query this.pageComplete = true
setTimeout(() => {
this.baseSceneCode = '100101'
}, 2e3)
return
let { approveType, pageType, businessCode } = this.$route.query
if (pageType) { if (pageType) {
this.businessCode = businessCode
this.pageType = pageType this.pageType = pageType
if (pageType == 'view') return this.getDetail(id) if (pageType == 'view') return this.getDetail(businessCode, pageType)
else if (pageType == 'reapply') this.getReapplyInfo(id) else if (pageType == 'reapply') this.getReapplyInfo(businessCode)
else this.getApprovalTemplate(approvalType) else {
this.getApprovalTemplate(approveType, pageType, businessCode)
}
} else { } else {
this.getApprovalTemplate(approvalType) this.getApprovalTemplate(approveType)
} }
}, },
methods: { methods: {
async getDetail (id) { async getDetail (businessCode, pageType) {
this.step = 2 const data = await storeApproveQueryDetail({ businessCode })
if (pageType == 'view') {
this.step = 2
} else {
}
this.pageComplete = true this.pageComplete = true
}, },
/**获取审批模板 */ /**获取审批模板 */
async getApprovalTemplate (type) { async getApprovalTemplate (type, pageType, businessCode) {
try { try {
const data = await getWorkwechatTemplate({ id: type }) const data = await getWorkwechatTemplate({ id: type })
if (data) { if (data) {
const { propertyList } = data const { propertyList } = data
// propertyList.push({
// controlId: 'AA',
// inputType: 6,
// placeholder: "请选择",
// require: 1,
// options: [
// { key: '1', value: '选项1' },
// { key: '2', value: '选项2' },
// { key: '3', value: '选项3' },
// { key: '4', value: '选项4' },
// ],
// title: '测试多选标题'
// })
if (propertyList && propertyList.length) this.templateInfo = propertyList.map((item) => { if (propertyList && propertyList.length) this.templateInfo = propertyList.map((item) => {
if (item.inputType === 7) { if (item.inputType === 7) {
item.uploadFileList = []; item.uploadFileList = [];
...@@ -117,8 +178,11 @@ export default { ...@@ -117,8 +178,11 @@ export default {
} }
return item; return item;
}) })
this.pageComplete = true
this.step = 1 this.step = 1
if (pageType) {
this.getDetail(businessCode, pageType)
} else this.pageComplete = true
} else throw '获取模板信息失败' } else throw '获取模板信息失败'
} catch (error) { } catch (error) {
this.$message.error(error) this.$message.error(error)
...@@ -160,25 +224,97 @@ export default { ...@@ -160,25 +224,97 @@ export default {
} }
}, },
async submit () { async submit () {
let { step } = this let { step } = this
if (step == 1) { if (step == 1) {
console.log(this.stepOneRef.infoForm, this.templateInfo) this.clearStatus()
this.stepOneRef.formRef.validate(async (valid) => { this.stepOneRef.formRef.validate(async (valid) => {
if (valid) { if (valid) {
let { infoForm } = this.stepOneRef let { infoForm, sceneTypeName } = this.stepOneRef,
this.stepTwoRef.basicinformationData = infoForm { approveType } = this.$route.query,
this.stepTwoRef.basicinformationFormList = this.templateInfo basicApproveInfo = this.templateInfo.map((item) => {
this.step = 2 // 1.文本;2.多行文本;3.数字;4.金额;5.单选;6.多选;7.附件
if ([1, 2, 3, 4, 5].includes(item.inputType)) {
item.value = infoForm[item.controlId] || "";
} else if (item.inputType === 6) {
item.value = infoForm[item.controlId].join(",");
} else if (item.inputType === 7) {
if (item.files && item.files.length > 0) {
const urls = item.files.map(file => file.fileUrl);
const fileNames = item.files.map((file) => {
let name = file.fileUrl?.split("/").pop();
name = name?.split(".").slice(0, -1).join(".");
return name;
});
item.value = urls.join(",");
item.fileNames = fileNames.join(",");
}
}
return item;
})
const params = {
sceneType: infoForm.sceneType,
file: infoForm.fileInfo,
basicApproveInfo: JSON.stringify(basicApproveInfo),
approveType: approveType,
shelfType: infoForm.shelfType,
submitFlag: 0,
baseSceneCode: infoForm.baseSceneCode,
}
if (infoForm.shelfType == 1) {
params.merchantId = infoForm.merchantId;
params.merchantName = infoForm.merchantName;
}
this.baseSceneCode = infoForm.baseSceneCode
this.dialogVisible = true;
const { errorFileUrl, trafficPartyDetails, businessCode } = await storeApproveCreateDraft(params)
this.updateStatus = true;
this.businessCode = businessCode
if (errorFileUrl) {
this.errorFileUrl = errorFileUrl
} else {
this.stepTwoRef.basicinformationFormList = this.templateInfo
infoForm.sceneTypeName = sceneTypeName
this.stepTwoRef.init({
basicinformationFormList: this.templateInfo,
basicinformationData: infoForm,
infoForm: trafficPartyDetails
})
}
} }
}) })
} else { } else {
console.log(this.stepTwoRef.infoForm) this.stepTwoRef.validate(async (valid, data) => {
this.stepTwoRef.formRef.validate(async (valid) => {
if (valid) { if (valid) {
console.log(data)
let { businessCode } = this,
{ trafficValidationData, businessValidationData, productDetails } = data,
trafficPartyDetails = {
...trafficValidationData,
...businessValidationData,
},
parmas = {
businessCode,
trafficPartyDetails
}
parmas.trafficPartyDetails.productDetails = productDetails
console.log(parmas)
// 提交 // 提交
} }
}) })
} }
},
nextStep () {
if (!this.errorFileUrl) {
this.step = 2
}
this.clearStatus()
},
clearStatus () {
this.dialogVisible = false
this.errorFileUrl = ""
this.updateStatus = false
} }
} }
} }
...@@ -217,5 +353,21 @@ export default { ...@@ -217,5 +353,21 @@ export default {
.fixed-btn-box { .fixed-btn-box {
height: 86px; height: 86px;
} }
.dialog-content {
text-align: center;
.dialog-tips-big {
font-size: 16px;
color: #333333;
margin-bottom: 20px;
span {
cursor: pointer;
color: rgba(42, 88, 173, 1);
}
}
.dialog-tips-small {
font-size: 12px;
color: #666666;
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</div> </div>
<!-- 关店风险 --> <!-- 关店风险 -->
<div class="section-header mt-20"> <div class="section-header mt-20" v-if="detailInfo.hitRuleTypeName">
<span class="section-title">关店风险</span> <span class="section-title">关店风险</span>
</div> </div>
<div class="section-body"> <div class="section-body">
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<div class="section-body"> <div class="section-body">
<div class="record-list"> <div class="record-list">
<div class="record-item" v-for="(item, index) in recordList" :key="index"> <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.operatedByName || '-' }}</span></div>
<div class="record-col">操作时间:<span class="record-val">{{ item.closeTime || '-' }}</span></div> <div class="record-col">操作时间:<span class="record-val">{{ item.operatedTime || '-' }}</span></div>
<div class="record-col">关店原因:<span class="record-val">{{ getReasonText(item) }}</span></div> <div class="record-col">关店原因:<span class="record-val">{{ getReasonText(item) }}</span></div>
</div> </div>
</div> </div>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</template> </template>
<script> <script>
import { closeStoreDetail } from '@api/salesManagement' import { closeStoreDetail, closeStoreOperateLogList } from '@api/salesManagement'
import { busTypeOpt, cooperModeOpt } from '../../constant/baseData' import { busTypeOpt, cooperModeOpt } from '../../constant/baseData'
export default { export default {
...@@ -100,52 +100,40 @@ export default { ...@@ -100,52 +100,40 @@ export default {
}, },
{ {
label: '业务类型', label: '业务类型',
name: 'businessTypeList', name: 'businessTypes',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle, txtStyle: contentStyle,
formatter: (cellValue) => {
return cellValue.businessTypeList ? cellValue.businessTypeList.map(item => busTypeOpt.find(opt => opt.confId == item.businessType)?.confLabel || '').join(',') : '-'
}
}, },
{ {
label: '合作模式', label: '合作模式',
name: 'cooperationMode', name: 'cooperationModeName',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle, txtStyle: contentStyle
formatter: (cellValue) => {
return cooperModeOpt.find(opt => opt.confId == cellValue.cooperationMode)?.confLabel || '-'
}
}, },
{ {
label: '主营品牌', label: '主营品牌',
name: 'brandList', name: 'mainBrands',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle, txtStyle: contentStyle
formatter: (cellValue) => {
return cellValue.brandList ? cellValue.brandList.map(item => item.subBrandName).join(',') : '-'
}
}, },
{ {
label: '关联商户', label: '关联商户',
name: 'merchantName', name: 'relatedMerchant',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle, txtStyle: contentStyle
formatter: (cellValue) => {
return ((cellValue.merchantName || '') + (cellValue.merchantId ? ('(' + cellValue.merchantId + ')') : '')) || '-'
}
}, },
{ {
label: '所在地区', label: '所在地区',
name: 'area', name: 'areaName',
type: 'showTxt', type: 'showTxt',
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle, txtStyle: contentStyle,
formatter: (cellValue) => { formatter: (cellValue) => {
return (cellValue.provinceName || '') + (cellValue.city || '') + (cellValue.districtName || '') || '-' return (cellValue.areaName || '') + (cellValue.city || '') + (cellValue.districtName || '') || '-'
} }
}, },
{ {
...@@ -161,6 +149,7 @@ export default { ...@@ -161,6 +149,7 @@ export default {
computed: { computed: {
visible: { visible: {
get() { get() {
return this.dialogVisible return this.dialogVisible
}, },
set(val) { set(val) {
...@@ -168,14 +157,15 @@ export default { ...@@ -168,14 +157,15 @@ export default {
} }
} }
}, },
watch: { mounted() {
dialogVisible(val) { if (this.visible) {
if (val && this.recordInfo) { this.getDetail()
this.getDetail() this.closeStoreOperateLogList()
}
} }
}, },
methods: { methods: {
handleClose() { handleClose() {
this.visible = false this.visible = false
}, },
...@@ -187,21 +177,18 @@ export default { ...@@ -187,21 +177,18 @@ export default {
this.loading = false this.loading = false
if (res) { if (res) {
this.detailInfo = { ...this.detailInfo, ...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(() => { }).catch(() => {
this.loading = false this.loading = false
}) })
}, },
closeStoreOperateLogList() {
closeStoreOperateLogList({ id: this.recordInfo.id }).then(res => {
if (res) {
this.recordList = res || []
}
})
},
getReasonText(item) { getReasonText(item) {
if (!item.confirmReason) return '-'; if (!item.confirmReason) return '-';
if (item.confirmReason === '其他') { if (item.confirmReason === '其他') {
...@@ -280,13 +267,13 @@ export default { ...@@ -280,13 +267,13 @@ export default {
.risk-alert { .risk-alert {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #fff8f0; background-color: #FEF4E8;
border-radius: 4px; border-radius: 4px;
padding: 12px 16px; padding: 16px 20px;
.risk-icon { .risk-icon {
color: #ff9900; color: #ff9900;
font-size: 18px; font-size: 20px;
margin-right: 10px; margin-right: 10px;
} }
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
btn-ok-label="关闭" @closeDialog="handleClose" @confirmDialog="handleClose"> btn-ok-label="关闭" @closeDialog="handleClose" @confirmDialog="handleClose">
<el-tabs v-model="activeTab" class="detail-dialog-tabs"> <el-tabs v-model="activeTab" class="detail-dialog-tabs">
<el-tab-pane label="门店详情" name="store"> <el-tab-pane label="门店详情" name="store">
<potential-customer-store-detail-section v-if="recordInfo && recordInfo.id != null" <potential-customer-store-detail-section v-if="recordInfo && recordInfo.id != null" :record-id="recordInfo.id"
:record-id="recordInfo.id" :show-visit-record="true" :show-section-title="false" /> :show-visit-record="true" :show-section-title="false" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="商户信息" name="merchant"> <el-tab-pane label="商户信息" name="merchant">
<div class="detail-info merchant-info-pane"> <div class="detail-info merchant-info-pane">
...@@ -139,12 +139,12 @@ export default { ...@@ -139,12 +139,12 @@ export default {
props: { props: {
detailVisible: { detailVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
recordInfo: { recordInfo: {
type: Object, type: Object,
default: () => { } default: () => { },
} },
}, },
methods: { methods: {
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { busTypeOpt, cooperModeOpt, flowSituateOpt, potentialCustomerOpt } from '../constant/baseData' import { busTypeOpt, cooperModeOpt, flowSituateOpt, potentialCustomerOpt } from '../constant/baseData'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { potentialCustomersPage, regionUserList, bind4SStore, potentialCustomersInfoVerify } from '@api/salesManagement' import { potentialCustomersPage, regionUserList, bind4SStore } from '@api/salesManagement'
import CustomerDetailDialog from '../components/CustomerDetailDialog.vue' import CustomerDetailDialog from '../components/CustomerDetailDialog.vue'
import PotentialCustomerStoreDetailSection from '../components/PotentialCustomerStoreDetailSection.vue' import PotentialCustomerStoreDetailSection from '../components/PotentialCustomerStoreDetailSection.vue'
import InfoVerifyMerchantDialog from '@/components/merchantVerify/InfoVerifyMerchantDialog.vue' import InfoVerifyMerchantDialog from '@/components/merchantVerify/InfoVerifyMerchantDialog.vue'
...@@ -118,6 +118,10 @@ export default { ...@@ -118,6 +118,10 @@ export default {
name: "3" name: "3"
}, },
{ {
label: '已绑定',
name: "4"
},
{
label: '未签约', label: '未签约',
name: "2" name: "2"
} }
...@@ -133,10 +137,7 @@ export default { ...@@ -133,10 +137,7 @@ export default {
flowSituation: '', flowSituation: '',
salesPersonId: '', salesPersonId: '',
signedDate: '', signedDate: '',
expectedDate: '', expectedDate: ''
isBind: '',
merchantName: '',
storeName: ''
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [{ showFormData: [{
...@@ -260,7 +261,7 @@ export default { ...@@ -260,7 +261,7 @@ export default {
maxlength: '50', maxlength: '50',
isClear: true isClear: true
}, { }, {
label: '商户名称', label: '关联商户',
name: 'merchantName', name: 'merchantName',
type: 'input', type: 'input',
maxlength: '50', maxlength: '50',
...@@ -452,11 +453,7 @@ export default { ...@@ -452,11 +453,7 @@ export default {
}, },
// 详情 // 详情
detailVisible: false, detailVisible: false,
recordInfo: null, recordInfo: null
// 信息核验(提交函数由 API 模块导入,便于替换为后端最终契约)
infoVerifyVisible: false,
infoVerifyRow: null,
infoVerifySubmit: potentialCustomersInfoVerify
} }
}, },
computed: { computed: {
...@@ -542,10 +539,7 @@ export default { ...@@ -542,10 +539,7 @@ export default {
apiFinish() { apiFinish() {
this.tableLoading = false this.tableLoading = false
}, },
handleInfoCheck(row = {}) {
this.infoVerifyRow = row
this.infoVerifyVisible = true
},
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
...@@ -709,10 +703,7 @@ export default { ...@@ -709,10 +703,7 @@ export default {
flowSituation: '', flowSituation: '',
salesPersonId: '', salesPersonId: '',
signedDate: '', signedDate: '',
expectedDate: '', expectedDate: ''
isBind: '',
storeName: '',
merchantName: '',
} }
this.baseData.cityList = [] this.baseData.cityList = []
const cityIdx = this.showFormData.findIndex((item) => item.name == 'cityId') const cityIdx = this.showFormData.findIndex((item) => item.name == 'cityId')
...@@ -803,5 +794,9 @@ export default { ...@@ -803,5 +794,9 @@ export default {
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
<<<<<<< HEAD
} }
</style> </style>
=======
}</style>
>>>>>>> 51b882e75b75ed65e08ea4f83054db10c815864a
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<template #scene-tag="scope"> <template #scene-tag="scope">
<template v-if="scope.scope.tagNames && scope.scope.tagNames.length"> <template v-if="scope.scope.tagNames && scope.scope.tagNames.length">
<span v-for="item in scope.scope.tagNames" <span v-for="(item, index) in scope.scope.tagNames"
:key="item.tagId" :key="index"
class="scene-tag"> class="scene-tag">
{{ getSceneTagLabel(scope.scope) }} {{ item }}
</span> </span>
</template> </template>
<span v-else>-</span> <span v-else>-</span>
...@@ -79,15 +79,15 @@ export default { ...@@ -79,15 +79,15 @@ export default {
keyFn: this.keyDowmGetList, keyFn: this.keyDowmGetList,
}, { }, {
label: "标签", label: "标签",
name: "merchantType", name: "tagIds",
type: "select", type: "select",
multiple: true, multiple: true,
collapseTags: true, collapseTags: true,
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: "confId", optionId: "id",
optionLabel: "confLabel", optionLabel: "name",
optionsName: "merchantStoreServiceList", optionsName: "sceneTagList",
}], }],
getListApi: getList, getListApi: getList,
// 表格参数 // 表格参数
...@@ -143,22 +143,17 @@ export default { ...@@ -143,22 +143,17 @@ export default {
close: "d2admin/page/close", close: "d2admin/page/close",
}), }),
async loadSceneTagOptions() { async loadSceneTagOptions() {
const idx = this.showFormData.findIndex(i => i.name === "merchantType");
if (idx < 0) {
return;
}
try { try {
const res = await getSceneTags({}); const res = await getSceneTags({});
const list = res?.data?.list || res?.data || res?.result || []; const list = res || [];
const optionList = (Array.isArray(list) ? list : []) const optionList = (Array.isArray(list) ? list : [])
.map(it => ({ .map(it => ({
confId: it?.confId ?? it?.tagId ?? it?.id, id: it?.id,
confLabel: it?.confLabel ?? it?.tagName ?? it?.name ?? it?.label, name: it?.name,
})) }))
.filter(it => it.confId !== undefined && it.confLabel); .filter(it => it.id !== undefined && it.name);
this.$set(this.showFormData[idx], "optionList", optionList); this.showFormData[1].optionList = optionList;
} catch (e) { } catch (e) {
this.$set(this.showFormData[idx], "optionList", []);
} }
}, },
beforeSearchFn() { beforeSearchFn() {
...@@ -219,8 +214,7 @@ export default { ...@@ -219,8 +214,7 @@ export default {
} }
}, },
getSceneTagLabel(row) { getSceneTagLabel(row) {
const idx = Number(row?.procurementType) - 1; return row || "-";
return this.procureModeList?.[idx]?.confName || "-";
}, },
}, },
}; };
...@@ -266,6 +260,7 @@ export default { ...@@ -266,6 +260,7 @@ export default {
font-size: 14px; font-size: 14px;
padding: 1px 6px; padding: 1px 6px;
display: inline-block; display: inline-block;
margin-right: 1px;
} }
.taskStatus { .taskStatus {
......
...@@ -1010,7 +1010,8 @@ ...@@ -1010,7 +1010,8 @@
" "
:owning-merchant-distribution-rules="goodsTypeGroupRules.owningMerchantDistributionRules" :owning-merchant-distribution-rules="goodsTypeGroupRules.owningMerchantDistributionRules"
:table-select-options="tableSelectOptions" :table-select-options="tableSelectOptions"
:classification-obj-select="tableClassificationObjSelect" /> :classification-obj-select="tableClassificationObjSelect"
@distribution-rules-change="onDistributionRulesChange" />
<TipsDialog v-if="tipsDialogVisible" <TipsDialog v-if="tipsDialogVisible"
:account-valid-merchants="accountValidMerchants" :account-valid-merchants="accountValidMerchants"
:visible.sync="tipsDialogVisible" /> :visible.sync="tipsDialogVisible" />
...@@ -1624,6 +1625,13 @@ export default { ...@@ -1624,6 +1625,13 @@ export default {
}, },
methods: { methods: {
/** 费用归属/实际分账仅存在于 TableAccount 本地 form,不落 classificationObj;需单独上报以置父页 classificationUserTouched */
onDistributionRulesChange() {
this.emitClassificationChange(
CLASSIFICATION_EMIT.CLASSIFICATION_TOUCHED,
this.paneIndex,
);
},
emitClassificationChange(type, payload) { emitClassificationChange(type, payload) {
this.$emit("classification-change", { type, payload }); this.$emit("classification-change", { type, payload });
}, },
......
...@@ -328,12 +328,14 @@ export default { ...@@ -328,12 +328,14 @@ export default {
// this.handleConfirm() // this.handleConfirm()
// console.log('validField', validField) // console.log('validField', validField)
this.$refs.divisionRuleRef.clearValidate(validField) this.$refs.divisionRuleRef.clearValidate(validField)
this.$emit('distribution-rules-change')
}, },
handleClearValid2(e, validField) { handleClearValid2(e, validField) {
this.$forceUpdate() this.$forceUpdate()
// this.handleConfirm() // this.handleConfirm()
// console.log('validField', validField) // console.log('validField', validField)
this.$refs.divisionRuleRef2.clearValidate(validField) this.$refs.divisionRuleRef2.clearValidate(validField)
this.$emit('distribution-rules-change')
}, },
/** validate 通过后兜底:每行须能解析出 merchantId(与快路径 distributionRulesLookComplete 一致) */ /** validate 通过后兜底:每行须能解析出 merchantId(与快路径 distributionRulesLookComplete 一致) */
distributionRowsHaveMerchantId(rows) { distributionRowsHaveMerchantId(rows) {
......
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import { import {
filterUpgradeGoodsByMerchantCode, filterUpgradeGoodsByMerchantCode,
trimCommodityCode,
trimMerchantGoodsCode trimMerchantGoodsCode
} from "../../merchantStep/utils/groundingUpgradeList" } from "../../merchantStep/utils/groundingUpgradeList"
...@@ -35,7 +36,7 @@ export function normalizeRuleGoodsTypesForCategory(item, upgradeArr, packageArr) ...@@ -35,7 +36,7 @@ export function normalizeRuleGoodsTypesForCategory(item, upgradeArr, packageArr)
upgradeArr.push({ upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId, upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName, upgradeGoodsName: val.upgradeGoodsName,
commodityCode: code, commodityCode: trimCommodityCode(val),
merchantGoodsCode: code merchantGoodsCode: code
}) })
}) })
......
...@@ -553,7 +553,11 @@ export default { ...@@ -553,7 +553,11 @@ export default {
if (arr[0]?.categoryType == 2) { if (arr[0]?.categoryType == 2) {
const length = arr.length - 1 const length = arr.length - 1
text = arr.reduce((str, item, index) => { text = arr.reduce((str, item, index) => {
<<<<<<< HEAD
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${index == length ? "" : "、"}` str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${index == length ? "" : "、"}`
=======
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode})${index == length ? "" : "、"}`
>>>>>>> 51b882e75b75ed65e08ea4f83054db10c815864a
return str return str
}, '') }, '')
return text return text
......
...@@ -584,7 +584,11 @@ export default { ...@@ -584,7 +584,11 @@ export default {
if (arr[0]?.categoryType == 2) { if (arr[0]?.categoryType == 2) {
const length = arr.length - 1 const length = arr.length - 1
text = arr.reduce((str, item, index) => { text = arr.reduce((str, item, index) => {
<<<<<<< HEAD
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${ str += `${item.upgradeGoodsName}(${item.merchantGoodsCode ?? ""})${
=======
str += `${item.upgradeGoodsName}(${item.merchantGoodsCode})${
>>>>>>> 51b882e75b75ed65e08ea4f83054db10c815864a
index == length ? "" : "、" index == length ? "" : "、"
}` }`
return str return str
......
/** /**
* merchantGoodsInfo.rule.selectList 返回的扁平 list(upgradeGoodsId / goodsShowName / merchantGoodsCode) * merchantGoodsInfo.rule.selectList 返回的扁平 list(可与 merchantGoodsCode 独立的 commodityCode)
* → 分账「具体商品」下拉统一结构 * → 分账「具体商品」下拉统一结构
* @param {Array<{upgradeGoodsId?: *, goodsShowName?: *, merchantGoodsCode?: *}>|undefined} list * @param {Array<{upgradeGoodsId?: *, goodsShowName?: *, merchantGoodsCode?: *, commodityCode?: *}>|undefined} list
* @returns {Array<{upgradeGoodsId: *, upgradeGoodsName: string, commodityCode: string, merchantGoodsCode: string}>} * @returns {Array<{upgradeGoodsId: *, upgradeGoodsName: string, commodityCode: string, merchantGoodsCode: string}>}
*/ */
export function mapProductSearchListToUpgradeGoodsOptions(list) { export function mapProductSearchListToUpgradeGoodsOptions(list) {
...@@ -15,13 +15,26 @@ export function mapProductSearchListToUpgradeGoodsOptions(list) { ...@@ -15,13 +15,26 @@ export function mapProductSearchListToUpgradeGoodsOptions(list) {
rawCode != null && String(rawCode).trim() !== "" rawCode != null && String(rawCode).trim() !== ""
? String(rawCode).trim() ? String(rawCode).trim()
: "" : ""
const commodityCode = merchantGoodsCode const commodityCode = trimCommodityCode(row)
return { upgradeGoodsId, upgradeGoodsName, commodityCode, merchantGoodsCode } return { upgradeGoodsId, upgradeGoodsName, commodityCode, merchantGoodsCode }
}) })
.filter((row) => row.merchantGoodsCode !== "") .filter((row) => row.merchantGoodsCode !== "")
} }
/** /**
* 仅读取 row.commodityCode(trim),与 merchantGoodsCode 分离,不用商户码回填。
* @param {object|undefined} row
* @returns {string} trim 后非空则返回,否则 ""
*/
export function trimCommodityCode(row) {
if (!row || typeof row !== "object") return ""
if (row.commodityCode == null) return ""
const t = String(row.commodityCode).trim()
if (t === "" || t === "null" || t === "undefined") return ""
return t
}
/**
* @param {object|undefined} row * @param {object|undefined} row
* @returns {string} trim 后非空则返回,否则 "" * @returns {string} trim 后非空则返回,否则 ""
*/ */
...@@ -76,7 +89,7 @@ export function flatMapUpgradeGoodsFromGoodsListPage(list) { ...@@ -76,7 +89,7 @@ export function flatMapUpgradeGoodsFromGoodsListPage(list) {
arr.push({ arr.push({
upgradeGoodsId: id, upgradeGoodsId: id,
upgradeGoodsName, upgradeGoodsName,
commodityCode: code, commodityCode: trimCommodityCode(el),
merchantGoodsCode: code merchantGoodsCode: code
}) })
}) })
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import { import {
filterUpgradeGoodsByMerchantCode, filterUpgradeGoodsByMerchantCode,
trimCommodityCode,
trimMerchantGoodsCode trimMerchantGoodsCode
} from "./groundingUpgradeList" } from "./groundingUpgradeList"
...@@ -33,7 +34,7 @@ export function applyGoodsTypeGroupRelationBranches( ...@@ -33,7 +34,7 @@ export function applyGoodsTypeGroupRelationBranches(
upgradeArr.push({ upgradeArr.push({
upgradeGoodsId: val.upgradeGoodsId, upgradeGoodsId: val.upgradeGoodsId,
upgradeGoodsName: val.upgradeGoodsName, upgradeGoodsName: val.upgradeGoodsName,
commodityCode: code, commodityCode: trimCommodityCode(val),
merchantGoodsCode: code merchantGoodsCode: code
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!