Commit f41802f1 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 70947d6c 4cea7c0d
...@@ -83,7 +83,8 @@ export const packageGoodsForm = [{ ...@@ -83,7 +83,8 @@ export const packageGoodsForm = [{
}, { }, {
label: "运营成本/元", label: "运营成本/元",
value: "operationCost", value: "operationCost",
type: 'price' type: 'price',
isPrice: true
}], }],
}, { }, {
name: "position", name: "position",
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
}(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (`${subItem.label}(元)/件`)) : subItem.label }}: }(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (`${subItem.label}(元)/件`)) : subItem.label }}:
</div> </div>
<div class="value"> <div class="value">
<EllipsisPopover :content="subItem.unit ? priceFilter(ele.upgradeGoods[subItem.value]) : ele.upgradeGoods[subItem.value] || ''"></EllipsisPopover> <EllipsisPopover :content="subItem.unit || subItem.type == 'price' ? priceFilter(ele.upgradeGoods[subItem.value]) : ele.upgradeGoods[subItem.value] || ''"></EllipsisPopover>
</div> </div>
</div> </div>
<!-- 权益/延保非第三方展示 --> <!-- 权益/延保非第三方展示 -->
......
...@@ -6,11 +6,17 @@ ...@@ -6,11 +6,17 @@
<div style="background: #f8f8f8; padding: 15px; margin-bottom: 20px; border-radius: 4px;"> <div style="background: #f8f8f8; padding: 15px; margin-bottom: 20px; border-radius: 4px;">
<h4 style="margin-top: 0; margin-bottom: 15px; font-size: 14px;">基本信息</h4> <h4 style="margin-top: 0; margin-bottom: 15px; font-size: 14px;">基本信息</h4>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12" style="display: flex; align-items: center;">
<span style="color: #666;">员工姓名:</span><span>{{ detail.staffName }}</span> <span style="color: #666; white-space: nowrap;">员工姓名:</span>
<span
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 200px;"
:title="detail.staffName">{{ detail.staffName }}</span>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" style="display: flex; align-items: center;">
<span style="color: #666;">手机号:</span><span>{{ detail.staffPhone }}</span> <span style="color: #666; white-space: nowrap;">手机号:</span>
<span
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 200px;"
:title="detail.staffPhone">{{ detail.staffPhone }}</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -78,7 +84,7 @@ export default { ...@@ -78,7 +84,7 @@ export default {
{ required: true, message: "请选择入职门店", trigger: ["blur", "change"] }, { required: true, message: "请选择入职门店", trigger: ["blur", "change"] },
], ],
sceneCodeList: [ sceneCodeList: [
{ type: "array", required: true, message: "请选择业务场景", trigger: ["blur", "change"] }, { type: "array", required: true, message: "请选择适配业务", trigger: ["blur", "change"] },
], ],
}, },
merchantList: [], merchantList: [],
......
...@@ -295,7 +295,7 @@ export default { ...@@ -295,7 +295,7 @@ export default {
return filterStr( return filterStr(
cellValue.createdSource, cellValue.createdSource,
this.baseData.createdSourceList, this.baseData.createdSourceList,
); ) || "-";
}, },
}, },
......
...@@ -143,7 +143,10 @@ import { ...@@ -143,7 +143,10 @@ import {
} from "@api/merchant"; } from "@api/merchant";
import { qyMerchantPageList } from '@/api/salesManagement.js' import { qyMerchantPageList } from '@/api/salesManagement.js'
import { parseOtherServiceProvidersFromMi } from '@/views/systemConfig/merchant/merchantGroundingEdit/merchantDetailMap' import {
normalizeStaffIdListFromMi,
parseOtherServiceProvidersFromMi,
} from '@/views/systemConfig/merchant/merchantGroundingEdit/merchantDetailMap'
export default { export default {
name: 'TrafficProviderInformation', name: 'TrafficProviderInformation',
...@@ -292,9 +295,22 @@ export default { ...@@ -292,9 +295,22 @@ export default {
normalizeTrafficFormFromProp (source) { normalizeTrafficFormFromProp (source) {
if (!source || typeof source !== 'object') return {} if (!source || typeof source !== 'object') return {}
const copy = deepClone(source) const copy = deepClone(source)
if (copy.areaOpId) copy.areaOpIdList = String(copy.areaOpId).split('/') // 人员信息:接口可能返回 areaopId / areaopName、onlineopName、regionsupervisorName 等,统一成表单使用的驼峰
if (copy.onlineOpId) copy.onlineOpIdList = String(copy.onlineOpId).split('/') if (copy.areaOpName == null || String(copy.areaOpName).trim() === '') {
if (copy.regionSupervisorId) copy.regionSupervisorIdList = String(copy.regionSupervisorId).split('/') const v = copy.areaopName
if (v != null && String(v).trim() !== '') copy.areaOpName = String(v).trim()
}
if (copy.onlineOpName == null || String(copy.onlineOpName).trim() === '') {
const v = copy.onlineopName
if (v != null && String(v).trim() !== '') copy.onlineOpName = String(v).trim()
}
if (copy.regionSupervisorName == null || String(copy.regionSupervisorName).trim() === '') {
const v = copy.regionsupervisorName
if (v != null && String(v).trim() !== '') copy.regionSupervisorName = String(v).trim()
}
copy.areaOpIdList = normalizeStaffIdListFromMi(copy, ['areaOpIdList', 'areaopIdList'], ['areaOpId', 'areaopId'])
copy.onlineOpIdList = normalizeStaffIdListFromMi(copy, ['onlineOpIdList', 'onlineopIdList'], ['onlineOpId', 'onlineopId'])
copy.regionSupervisorIdList = normalizeStaffIdListFromMi(copy, ['regionSupervisorIdList', 'regionsupervisorIdList'], ['regionSupervisorId', 'regionsupervisorId'])
if (!Array.isArray(copy.otherServiceProvidersIdList) || copy.otherServiceProvidersIdList.length === 0) { if (!Array.isArray(copy.otherServiceProvidersIdList) || copy.otherServiceProvidersIdList.length === 0) {
const osp = parseOtherServiceProvidersFromMi(copy) const osp = parseOtherServiceProvidersFromMi(copy)
copy.otherServiceProvidersIdList = osp.ids copy.otherServiceProvidersIdList = osp.ids
...@@ -381,8 +397,18 @@ export default { ...@@ -381,8 +397,18 @@ export default {
regionSupervisorIdList: 'regionSupervisorName', regionSupervisorIdList: 'regionSupervisorName',
} }
const nameKey = nameByListKey[i.key] const nameKey = nameByListKey[i.key]
if (this.isViewMode && nameKey) { // 只读展示时(editStatus 为 false)优先用接口下发的姓名字段;不要求 isViewMode(StepTwo 编辑页收起态同)
const raw = this.componentData[nameKey] if (nameKey) {
let raw = this.componentData[nameKey]
if ((raw == null || String(raw).trim() === '') && nameKey === 'areaOpName') {
raw = this.componentData.areaopName
}
if ((raw == null || String(raw).trim() === '') && nameKey === 'onlineOpName') {
raw = this.componentData.onlineopName
}
if ((raw == null || String(raw).trim() === '') && nameKey === 'regionSupervisorName') {
raw = this.componentData.regionsupervisorName
}
if (raw != null && String(raw).trim() !== '') return String(raw).trim() if (raw != null && String(raw).trim() !== '') return String(raw).trim()
} }
const values = this.componentData[i.key] const values = this.componentData[i.key]
...@@ -407,6 +433,8 @@ export default { ...@@ -407,6 +433,8 @@ export default {
const options = row?.options || [] const options = row?.options || []
const uuids = this.componentData[listKey] const uuids = this.componentData[listKey]
if (!Array.isArray(uuids) || uuids.length === 0) { if (!Array.isArray(uuids) || uuids.length === 0) {
// 只读/收起态:历史等接口可能仅有 *Name、areaOpId 等为 null,勿清空已回填的姓名
if (!this.editStatus) return
this.$set(this.componentData, nameKey, '') this.$set(this.componentData, nameKey, '')
return return
} }
...@@ -507,9 +535,10 @@ export default { ...@@ -507,9 +535,10 @@ export default {
}, },
async qyMerchantPageList () { async qyMerchantPageList () {
const { list } = await qyMerchantPageList({ currentPage: 1, pageSize: 100000 }) const { list } = await qyMerchantPageList({ currentPage: 1, pageSize: 100000 })
const exists = list.some((item) => item.merchantNo == -1); const raw = Array.isArray(list) ? list : []
if (!exists) list.unshift({ merchantNo: -1, merchantName: '嘀加智慧云' }) const djzh = { merchantNo: -1, merchantName: '嘀加智慧云' }
this.trafficProviderInformation.find(item => item.key == 'signingEntityId').options = list.map(item => { const merged = raw.some(i => Number(i.merchantNo) === -1) ? raw : raw.concat([djzh])
this.trafficProviderInformation.find(item => item.key == 'signingEntityId').options = merged.map(item => {
return { label: item.merchantName, value: Number(item.merchantNo) } return { label: item.merchantName, value: Number(item.merchantNo) }
}) })
}, },
......
...@@ -16,6 +16,20 @@ ...@@ -16,6 +16,20 @@
<div class="section-body"> <div class="section-body">
<glsx-combi-form class="show-form-container" ref="showFormRef" :label-width="labelWidth" :form-obj="detailInfo" <glsx-combi-form class="show-form-container" ref="showFormRef" :label-width="labelWidth" :form-obj="detailInfo"
:form-data="showFormData"> :form-data="showFormData">
<template slot="brandList" slot-scope="scope">
<div v-if="detailInfo.mainBrands">
<el-tooltip effect="dark" placement="top" v-if="detailInfo.mainBrands.length > 30">
<div slot="content" class="tooltip-content-max">
<div>{{ detailInfo.mainBrands }}</div>
</div>
<span class="one-line-ellipsis info-text">{{ formatMainBrands(detailInfo.mainBrands)
}}</span>
</el-tooltip>
<span v-else class="info-text">{{ detailInfo.mainBrands }}</span>
</div>
<div v-else>-</div>
</template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
...@@ -121,8 +135,18 @@ export default { ...@@ -121,8 +135,18 @@ export default {
label: '主营品牌', label: '主营品牌',
name: 'mainBrands', name: 'mainBrands',
type: 'showTxt', type: 'showTxt',
addHtml: "brandList",
style: editItemStyle, style: editItemStyle,
txtStyle: contentStyle txtStyle: {
...contentStyle,
// width: '500px',
display: '-webkit-box',
'-webkit-box-orient': 'vertical',
'-webkit-line-clamp': 2,
overflow: 'hidden',
'text-overflow': 'ellipsis',
'white-space': 'normal'
}
}, },
{ {
label: '关联商户', label: '关联商户',
...@@ -180,7 +204,6 @@ export default { ...@@ -180,7 +204,6 @@ export default {
this.loading = false this.loading = false
if (res) { if (res) {
this.detailInfo = res this.detailInfo = res
console.log(this.detailInfo)
} }
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
...@@ -193,6 +216,13 @@ export default { ...@@ -193,6 +216,13 @@ export default {
} }
}) })
}, },
formatMainBrands(brands) {
if (!brands) return ''
if (brands.length > 35) {
return brands.slice(0, 35) + '...'
}
return brands
}
} }
} }
</script> </script>
...@@ -301,4 +331,12 @@ export default { ...@@ -301,4 +331,12 @@ export default {
} }
} }
} }
.info-text {
width: 180px;
display: inline-block;
word-break: break-all;
white-space: pre-wrap;
color: #333;
}
</style> </style>
...@@ -85,7 +85,7 @@ export default { ...@@ -85,7 +85,7 @@ export default {
type: "textarea", type: "textarea",
showLimit: true, showLimit: true,
isClear: true, isClear: true,
maxlength: 50, maxlength: 100,
rows: 4, rows: 4,
isHide: true isHide: true
} }
...@@ -105,17 +105,17 @@ export default { ...@@ -105,17 +105,17 @@ export default {
}, trigger: 'change' }, trigger: 'change'
} }
], ],
confirmRemark: [ // confirmRemark: [
{ // {
required: true, validator: (rule, value, callback) => { // required: true, validator: (rule, value, callback) => {
if (this.addForm.confirmResult === 1 && this.addForm.confirmReason === '其他' && !value) { // if (this.addForm.confirmResult === 1 && this.addForm.confirmReason === '其他' && !value) {
callback(new Error('请输入关店原因')); // callback(new Error('请输入关店原因'));
} else { // } else {
callback(); // callback();
} // }
}, trigger: 'blur' // }, trigger: 'blur'
} // }
] // ]
} }
} }
}, },
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
if (this.addForm.confirmResult === 1) { if (this.addForm.confirmResult === 1) {
params.confirmReason = this.addForm.confirmReason params.confirmReason = this.addForm.confirmReason
if (this.addForm.confirmReason === '其他') { if (this.addForm.confirmReason === '其他' && this.addForm.confirmRemark !== '') {
params.confirmReason = '其他-' + this.addForm.confirmRemark params.confirmReason = '其他-' + this.addForm.confirmRemark
// params.confirmRemark = this.addForm.confirmRemark // params.confirmRemark = this.addForm.confirmRemark
} }
......
...@@ -25,6 +25,20 @@ ...@@ -25,6 +25,20 @@
<d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch" <d2-table ref="customerTable" :get-list-api="getListApi" :search-form="searchFormSearch"
:table-params="tableParams" :noLoading="noLoading" :before-search-fn="beforeSearchFn" :table-params="tableParams" :noLoading="noLoading" :before-search-fn="beforeSearchFn"
@apiFinish="apiFinish"> @apiFinish="apiFinish">
<template slot="brandList" slot-scope="scope">
<div v-if="scope.scope.mainBrands">
<el-tooltip effect="dark" placement="top" v-if="scope.scope.mainBrands.length > 30">
<div slot="content" class="tooltip-content-max">
<div>{{ scope.scope.mainBrands }}</div>
</div>
<span>{{ formatMainBrands(scope.scope.mainBrands) }}</span>
</el-tooltip>
<span v-else>{{ scope.scope.mainBrands }}</span>
</div>
<div v-else>-</div>
</template>
<div slot="auth-button" slot-scope="scope" width="400"> <div slot="auth-button" slot-scope="scope" width="400">
<!-- 关店确认 --> <!-- 关店确认 -->
<span v-if="scope.scope.status == 1" style="margin-right: 10px"> <span v-if="scope.scope.status == 1" style="margin-right: 10px">
...@@ -214,7 +228,7 @@ export default { ...@@ -214,7 +228,7 @@ export default {
tableColumns: [{ tableColumns: [{
label: '创建时间', label: '创建时间',
prop: 'createdDate', prop: 'createdDate',
width: '100px' width: '140px'
}, { }, {
label: '门店名称', label: '门店名称',
prop: 'shopMerchantName', prop: 'shopMerchantName',
...@@ -225,15 +239,15 @@ export default { ...@@ -225,15 +239,15 @@ export default {
}, { }, {
label: '签约时间', label: '签约时间',
prop: 'signedTime', prop: 'signedTime',
width: '128px' width: '140px'
}, { }, {
label: '展业时间', label: '展业时间',
prop: 'expectedOperationDate', prop: 'expectedOperationDate',
width: '128px' width: '140px'
}, { }, {
label: '关店时间', label: '关店时间',
prop: 'closeTime', prop: 'closeTime',
width: '128px' width: '140px'
}, { }, {
label: '关联商户', label: '关联商户',
prop: 'relatedMerchant', // 关联商户名称和商户号 prop: 'relatedMerchant', // 关联商户名称和商户号
...@@ -250,7 +264,8 @@ export default { ...@@ -250,7 +264,8 @@ export default {
prop: 'cooperationModeName' prop: 'cooperationModeName'
}, { }, {
label: '主营品牌', label: '主营品牌',
prop: 'mainBrands', // prop: 'mainBrands',
addHtml: 'brandList',
width: '150px', width: '150px',
}, { }, {
...@@ -430,6 +445,13 @@ export default { ...@@ -430,6 +445,13 @@ export default {
handleDetail(row) { handleDetail(row) {
this.recordInfo = deepClone(row) this.recordInfo = deepClone(row)
this.detailVisible = true this.detailVisible = true
},
formatMainBrands(brands) {
if (!brands) return ''
if (brands.length > 30) {
return brands.slice(0, 30) + '...'
}
return brands
} }
} }
} }
......
...@@ -8,6 +8,53 @@ export function joinIds(mi, listKey, strKey) { ...@@ -8,6 +8,53 @@ export function joinIds(mi, listKey, strKey) {
return ""; return "";
} }
/** 详情/历史接口人员 ID、姓名字段大小写不一致时的兜底读取 */
function pickStr(mi, ...keys) {
if (!mi || typeof mi !== "object") return "";
for (const k of keys) {
const v = mi[k];
if (v != null && String(v).trim() !== "") return String(v).trim();
}
return "";
}
function joinStaffIds(mi, listKey, ...idKeys) {
if (!mi || typeof mi !== "object") return "";
for (const idKey of idKeys) {
const str = mi[idKey];
if (str != null && str !== "") return String(str);
}
const list = mi[listKey];
if (Array.isArray(list) && list.length) return list.join(",");
return "";
}
/**
* 人员 uuid 列表:优先数组字段;否则从逗号或斜杠拼接的标量拆开(与 joinStaffIds / 上架保存 join('/') 一致)。
* listKeys / scalarKeys 可传多个别名(如 areaOpIdList / areaopIdList)。
*/
export function normalizeStaffIdListFromMi(mi, listKeys, scalarKeys) {
if (!mi || typeof mi !== "object") return [];
const lk = Array.isArray(listKeys) ? listKeys : [listKeys];
for (const key of lk) {
const rawList = mi[key];
if (Array.isArray(rawList) && rawList.length) {
return rawList.map((x) => String(x).trim()).filter(Boolean);
}
}
const sk = Array.isArray(scalarKeys) ? scalarKeys : [scalarKeys];
for (const idKey of sk) {
const str = mi[idKey];
if (str != null && String(str).trim() !== "") {
return String(str)
.split(/[,/]+/)
.map((s) => s.trim())
.filter(Boolean);
}
}
return [];
}
/** 场景列表接口可能返回 { list } 或裸数组,统一成数组 */ /** 场景列表接口可能返回 { list } 或裸数组,统一成数组 */
export function normalizeBaseSceneListResponse(res) { export function normalizeBaseSceneListResponse(res) {
if (Array.isArray(res)) return res; if (Array.isArray(res)) return res;
...@@ -88,11 +135,16 @@ export function getSceneDisplayNameFromList(code, baseSceneList = []) { ...@@ -88,11 +135,16 @@ export function getSceneDisplayNameFromList(code, baseSceneList = []) {
return n != null && String(n).trim() !== "" ? String(n).trim() : ""; return n != null && String(n).trim() !== "" ? String(n).trim() : "";
} }
/** 门店单台利润额:仅回显接口字段 storeProfitPerCar,不做推算 */
export function storeProfitPerCar(mi) { export function storeProfitPerCar(mi) {
const d = mi?.deliveryCount; if (!mi || typeof mi !== "object") return "";
const r = mi?.estimatedRevenue ?? mi?.revenue; const direct = mi.storeProfitPerCar;
if (!d || Number(d) <= 0 || r == null) return ""; if (direct == null || direct === "") return "";
return String(NP.round(NP.divide(Number(r), Number(d)), 2)); const n = Number(direct);
if (!Number.isNaN(n)) {
return String(NP.round(n, 2));
}
return String(direct).trim();
} }
/** /**
...@@ -147,6 +199,9 @@ export function parseOtherServiceProvidersFromMi(mi) { ...@@ -147,6 +199,9 @@ export function parseOtherServiceProvidersFromMi(mi) {
export function buildTrafficProviderData(mi, baseSceneList = []) { export function buildTrafficProviderData(mi, baseSceneList = []) {
const osp = parseOtherServiceProvidersFromMi(mi); const osp = parseOtherServiceProvidersFromMi(mi);
const nameFromMi = mi?.otherServiceProvidersName; const nameFromMi = mi?.otherServiceProvidersName;
const areaOpIdListNorm = normalizeStaffIdListFromMi(mi, ["areaOpIdList", "areaopIdList"], ["areaOpId", "areaopId"]);
const onlineOpIdListNorm = normalizeStaffIdListFromMi(mi, ["onlineOpIdList", "onlineopIdList"], ["onlineOpId", "onlineopId"]);
const regionSupervisorIdListNorm = normalizeStaffIdListFromMi(mi, ["regionSupervisorIdList", "regionsupervisorIdList"], ["regionSupervisorId", "regionsupervisorId"]);
return { return {
trafficPartyName: mi.trafficPartyName || "", trafficPartyName: mi.trafficPartyName || "",
parentName: mi.parentName || mi.parentMerchantName || "", parentName: mi.parentName || mi.parentMerchantName || "",
...@@ -162,12 +217,15 @@ export function buildTrafficProviderData(mi, baseSceneList = []) { ...@@ -162,12 +217,15 @@ export function buildTrafficProviderData(mi, baseSceneList = []) {
parentServiceMerchantName: mi.parentServiceMerchantName || "", parentServiceMerchantName: mi.parentServiceMerchantName || "",
yqMerchantId: mi.yqMerchantId != null ? Number(mi.yqMerchantId) : (mi.parkingStoreId != null ? Number(mi.parkingStoreId) : null), yqMerchantId: mi.yqMerchantId != null ? Number(mi.yqMerchantId) : (mi.parkingStoreId != null ? Number(mi.parkingStoreId) : null),
yqMerchantName: mi.yqMerchantName || mi.parkingStoreName || "", yqMerchantName: mi.yqMerchantName || mi.parkingStoreName || "",
areaOpId: joinIds(mi, "areaOpIdList", "areaOpId"), areaOpIdList: areaOpIdListNorm,
onlineOpId: joinIds(mi, "onlineOpIdList", "onlineOpId"), onlineOpIdList: onlineOpIdListNorm,
regionSupervisorId: joinIds(mi, "regionSupervisorIdList", "regionSupervisorId"), regionSupervisorIdList: regionSupervisorIdListNorm,
areaOpName: mi.areaOpName || "", areaOpId: areaOpIdListNorm.length ? areaOpIdListNorm.join(",") : joinStaffIds(mi, "areaOpIdList", "areaOpId", "areaopId"),
onlineOpName: mi.onlineOpName || "", onlineOpId: onlineOpIdListNorm.length ? onlineOpIdListNorm.join(",") : joinStaffIds(mi, "onlineOpIdList", "onlineOpId", "onlineopId"),
regionSupervisorName: mi.regionSupervisorName || "", regionSupervisorId: regionSupervisorIdListNorm.length ? regionSupervisorIdListNorm.join(",") : joinStaffIds(mi, "regionSupervisorIdList", "regionSupervisorId", "regionsupervisorId"),
areaOpName: pickStr(mi, "areaOpName", "areaopName"),
onlineOpName: pickStr(mi, "onlineOpName", "onlineopName"),
regionSupervisorName: pickStr(mi, "regionSupervisorName", "regionsupervisorName"),
otherServiceProvidersIdList: osp.ids, otherServiceProvidersIdList: osp.ids,
otherServiceProvidersName: otherServiceProvidersName:
nameFromMi != null && String(nameFromMi).trim() !== "" nameFromMi != null && String(nameFromMi).trim() !== ""
......
...@@ -108,6 +108,38 @@ import { ...@@ -108,6 +108,38 @@ import {
getReconciliationHistoryRecordDetailApi getReconciliationHistoryRecordDetailApi
} from "@api/merchant" } from "@api/merchant"
import { getBaseSceneCodeList } from "@api/productManage" import { getBaseSceneCodeList } from "@api/productManage"
/** TrafficProviderInformation「人员信息」与 buildTrafficProviderData 使用字段;历史仅从 merchantStoreInfoHistory 回填 */
const MERCHANT_STORE_INFO_HISTORY_PERSONNEL_KEYS = Object.freeze([
"areaOpId",
"areaOpIdList",
"areaOpName",
"onlineOpId",
"onlineOpIdList",
"onlineOpName",
"regionSupervisorId",
"regionSupervisorIdList",
"regionSupervisorName",
])
function personnelFieldDefault(key) {
if (String(key).endsWith("IdList")) return []
return ""
}
/** 避免列表根字段覆盖历史快照:有 merchantStoreInfoHistory 时人员相关仅取自该对象 */
function applyMerchantStoreInfoHistoryPersonnel(mi, history) {
if (mi == null || typeof mi !== "object") return mi
if (history == null || typeof history !== "object") return mi
const next = { ...mi }
for (const k of MERCHANT_STORE_INFO_HISTORY_PERSONNEL_KEYS) {
next[k] = Object.prototype.hasOwnProperty.call(history, k)
? history[k]
: personnelFieldDefault(k)
}
return next
}
export default { export default {
name: "MerchantCheckRecord", name: "MerchantCheckRecord",
props: { props: {
...@@ -334,6 +366,9 @@ export default { ...@@ -334,6 +366,9 @@ export default {
? { ...formItem, ...nestedRaw } ? { ...formItem, ...nestedRaw }
: { ...formItem } : { ...formItem }
let mi = mergedRow && typeof mergedRow === "object" ? mergedRow : {} let mi = mergedRow && typeof mergedRow === "object" ? mergedRow : {}
if (formItem.merchantStoreInfoHistory != null && typeof formItem.merchantStoreInfoHistory === "object") {
mi = applyMerchantStoreInfoHistoryPersonnel(mi, formItem.merchantStoreInfoHistory)
}
const routeBsc = this.resolveRowBaseSceneCode(this.merchantRow) const routeBsc = this.resolveRowBaseSceneCode(this.merchantRow)
if (pickSceneLookupCode(mi) === "" && routeBsc !== "") { if (pickSceneLookupCode(mi) === "" && routeBsc !== "") {
mi = { ...mi, baseSceneCode: routeBsc } mi = { ...mi, baseSceneCode: routeBsc }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!