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