Commit c1248381 by wangzhihui

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 8885ce19 d553c61e
Showing 30 changed files with 504 additions and 194 deletions
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<!-- 单选 --> <!-- 单选 -->
<!-- 太阳膜类产品 上架部位 --> <!-- 太阳膜类产品 上架部位 -->
<div v-if=" <div v-if="
item.type === 'radio' item.type === 'radio-select'
&& formData.goodsType == 1 && formData.goodsType == 1
&& !item.index && !item.index
"> ">
...@@ -26,13 +26,23 @@ ...@@ -26,13 +26,23 @@
:label-width="item.label ? '180px' : '0px'" :label-width="item.label ? '180px' : '0px'"
:prop="item.name" :prop="item.name"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"> :style="{ 'margin-bottom': !item.type ? '0px' : '22px' }">
<el-radio-group v-model="formData[item.name]"> <el-select v-model="formData[item.name]"
filterable
:placeholder="`请选择${item.label}`"
:style="{ width: item.width || formItemWidth }"
@change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.radioGroupList"
:key="subItem.confId"
:label="subItem.confName"
:value="subItem.confId" />
</el-select>
<!-- <el-radio-group v-model="formData[item.name]">
<el-radio v-for="(subItem, subIndex) in item.radioGroupList" <el-radio v-for="(subItem, subIndex) in item.radioGroupList"
:key="subIndex" :key="subIndex"
:label="subItem.confId"> :label="subItem.confId">
{{ subItem.confName }} {{ subItem.confName }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group> -->
</el-form-item> </el-form-item>
</div> </div>
<!-- 售后众筹显示升级/产品供货模式 --> <!-- 售后众筹显示升级/产品供货模式 -->
......
...@@ -88,8 +88,9 @@ export const packageGoodsForm = [{ ...@@ -88,8 +88,9 @@ export const packageGoodsForm = [{
}, { }, {
name: "position", name: "position",
label: "上架部位", label: "上架部位",
type: "radio", type: "radio-select",
radioGroupList: [], radioGroupList: [],
width: "432px"
}, { }, {
name: "goodsAlias", name: "goodsAlias",
label: "商品别名", label: "商品别名",
......
...@@ -115,8 +115,9 @@ export default { ...@@ -115,8 +115,9 @@ export default {
}, { }, {
name: "position", name: "position",
label: "上架部位", label: "上架部位",
type: "radio", type: "radio-select",
radioGroupList: [], radioGroupList: [],
width: "432px"
}, { }, {
name: "goodsAlias", name: "goodsAlias",
label: "商品别名", label: "商品别名",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{{ i.title }} {{ i.title }}
</p> </p>
<!-- 商品信息块 --> <!-- 商品信息块 -->
<div v-if="idx == 1" class="flex_item"> <div v-if="idx == 2" class="flex_item">
<div v-for="(ele, eleIndex) in formData.groundingGoodsList" <div v-for="(ele, eleIndex) in formData.groundingGoodsList"
:key="eleIndex" :key="eleIndex"
class="groundingGoods-item"> class="groundingGoods-item">
...@@ -294,7 +294,7 @@ export default { ...@@ -294,7 +294,7 @@ export default {
const itemData = formData?.groundingGoodsList[index]; const itemData = formData?.groundingGoodsList[index];
// 1 太阳膜 2 (1.3场景商品) // 1 太阳膜 2 (1.3场景商品)
const shopType = itemData?.goodsType == 1 ? "1" : itemData?.sceneType == 3 ? "2" : ""; const shopType = itemData?.goodsType == 1 ? "1" : itemData?.sceneType == 3 ? "2" : "";
const shopForm = deepClone(formList[1].formBlock[index]); const shopForm = deepClone(formList[2].formBlock[index]);
// 太阳膜保留上架部位字段 positionStr // 太阳膜保留上架部位字段 positionStr
const spliceForm = shopType == "1" const spliceForm = shopType == "1"
? ["giftCost", "recoveryCost", "virtualAccountCost", "djCost", "thirdPartyCost"] ? ["giftCost", "recoveryCost", "virtualAccountCost", "djCost", "thirdPartyCost"]
...@@ -314,7 +314,7 @@ export default { ...@@ -314,7 +314,7 @@ export default {
spliceForm.includes("virtualAccountCost") && spliceForm.splice(spliceForm.indexOf("virtualAccountCost"), 1); spliceForm.includes("virtualAccountCost") && spliceForm.splice(spliceForm.indexOf("virtualAccountCost"), 1);
} }
const newForm = shopForm.filter(v => !spliceForm?.includes(v.name)); const newForm = shopForm.filter(v => !spliceForm?.includes(v.name));
this.$set(this.formList[1].formBlock, index, newForm); this.$set(this.formList[2].formBlock, index, newForm);
this.$nextTick(() => { this.$nextTick(() => {
this.show = true; this.show = true;
}); });
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
class="groundingGoods-item"> class="groundingGoods-item">
<div v-for="(item, index) in i.formBlock[eleIndex]" :key="index"> <div v-for="(item, index) in i.formBlock[eleIndex]" :key="index">
<!-- 上架部位 --> <!-- 上架部位 -->
<div v-if="item.type === 'radio' && ele.goodsType == 1 && !item.index"> <div v-if="item.type === 'radio-select' && ele.goodsType == 1 && !item.index">
<el-form-item :id="`groundingGoodsList[${eleIndex}][${item.name}]`" <el-form-item :id="`groundingGoodsList[${eleIndex}][${item.name}]`"
class="dis-in-block" class="dis-in-block"
:label="item.label ? `${item.label}:` : ''" :label="item.label ? `${item.label}:` : ''"
...@@ -32,14 +32,24 @@ ...@@ -32,14 +32,24 @@
:prop="`groundingGoodsList[${eleIndex}][${item.name}]`" :prop="`groundingGoodsList[${eleIndex}][${item.name}]`"
:rules="rules[item.name]" :rules="rules[item.name]"
:style="{ 'margin-bottom': !item.type ? '0px' : '22px' }"> :style="{ 'margin-bottom': !item.type ? '0px' : '22px' }">
<el-radio-group v-model="ele[item.name]"> <el-select v-model="ele[item.name]"
filterable
:placeholder="`请选择${item.label}`"
:style="{ width: item.width || formItemWidth }"
@change="selectAddAttr($event, item)">
<el-option v-for="subItem in positionTypeList"
:key="subItem.position"
:label="subItem.confName"
:value="subItem.position" />
</el-select>
<!-- <el-radio-group v-model="ele[item.name]">
<el-radio v-for="(subItem, subIndex) in positionTypeList" <el-radio v-for="(subItem, subIndex) in positionTypeList"
:key="subIndex" :key="subIndex"
:label="subItem.position"> :label="subItem.position">
{{ {{
subItem.confName }} subItem.confName }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group> -->
</el-form-item> </el-form-item>
</div> </div>
<div v-if="item.type === 'radio' && item.index && (ele.goodsType == 1 || (formData.baseSceneCode && this.filterBaseSceneCodeBySceneType(3).includes(formData.baseSceneCode)))"> <div v-if="item.type === 'radio' && item.index && (ele.goodsType == 1 || (formData.baseSceneCode && this.filterBaseSceneCodeBySceneType(3).includes(formData.baseSceneCode)))">
......
...@@ -89,9 +89,6 @@ export default { ...@@ -89,9 +89,6 @@ export default {
label: '财务规则校验' label: '财务规则校验'
}] }]
}, { }, {
title: '商品信息',
formBlock: []
}, {
title: '门店信息', title: '门店信息',
formBlock: [{ formBlock: [{
name: 'baseSceneName', name: 'baseSceneName',
...@@ -106,6 +103,9 @@ export default { ...@@ -106,6 +103,9 @@ export default {
type: 'upload' type: 'upload'
}] }]
}, { }, {
title: '商品信息',
formBlock: []
}, {
title: '操作信息', title: '操作信息',
formBlock: [{ formBlock: [{
type: 'checkView', type: 'checkView',
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo || {} const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo || {}
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName] const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-') const result = types.filter(type => type).join('-')
this.editForm[1].formBlock.push(packageGoodsDetail) this.editForm[2].formBlock.push(packageGoodsDetail)
// 太阳膜类回显部位 // 太阳膜类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
// 实时计算运营成本 // 实时计算运营成本
......
...@@ -63,8 +63,10 @@ export default { ...@@ -63,8 +63,10 @@ export default {
this.editState = VIEW_MODE.EDIT; this.editState = VIEW_MODE.EDIT;
}, },
async saveEdit() { async saveEdit({ useValidate = true } = {}) {
await this.validate(); if (useValidate) {
await this.validate();
}
if (this.editState !== VIEW_MODE.EDIT) if (this.editState !== VIEW_MODE.EDIT)
return; return;
this.editState = VIEW_MODE.SAVING; this.editState = VIEW_MODE.SAVING;
...@@ -127,7 +129,6 @@ export default { ...@@ -127,7 +129,6 @@ export default {
}, },
mounted() { mounted() {
console.log("this", this);
this._register(); this._register();
}, },
......
...@@ -51,11 +51,11 @@ ...@@ -51,11 +51,11 @@
}) })
}" }"
:field-name="{ :field-name="{
value: 'upgradeGoodsId', value: 'merchantGoodsCode',
label: 'upgradeGoodsName', label: 'upgradeGoodsName',
}" }"
placeholder="请选择商品" placeholder="请选择商品"
value-key="upgradeGoodsId"> value-key="merchantGoodsCode">
</RemoteSelect> </RemoteSelect>
<RemoteSelect v-if="form.categoryType === 3" <RemoteSelect v-if="form.categoryType === 3"
ref="packageGoods" ref="packageGoods"
...@@ -380,9 +380,10 @@ export default { ...@@ -380,9 +380,10 @@ export default {
categoryType: 2, categoryType: 2,
businessCode: this.businessCode, businessCode: this.businessCode,
}); });
this.options.selectedUpgradeGoods = selectedGoods.map(item => item.upgradeGoodsId); this.options.selectedUpgradeGoods = selectedGoods.map(item => item.merchantGoodsCode);
} }
console.log("selectedUpgradeGoods", this.options.selectedUpgradeGoods);
const result = await fetchUpgradeGoodsListHook({ const result = await fetchUpgradeGoodsListHook({
pageQuery, pageQuery,
selectedUpgradeGoods: this.options.selectedUpgradeGoods, selectedUpgradeGoods: this.options.selectedUpgradeGoods,
...@@ -390,7 +391,7 @@ export default { ...@@ -390,7 +391,7 @@ export default {
}); });
if (isImmediate) { if (isImmediate) {
result.list.push(...this.form.goodsTypeGroupRelationList); result.list.push(...this.form.goodsTypeGroupRelationList);
result.list = uniqBy(result.list, "upgradeGoodsId"); result.list = uniqBy(result.list, "merchantGoodsCode");
} }
return result; return result;
}, },
......
...@@ -53,11 +53,11 @@ ...@@ -53,11 +53,11 @@
}) })
}" }"
:field-name="{ :field-name="{
value: 'upgradeGoodsId', value: 'merchantGoodsCode',
label: 'upgradeGoodsName', label: 'upgradeGoodsName',
}" }"
placeholder="请选择商品" placeholder="请选择商品"
value-key="upgradeGoodsId"> value-key="merchantGoodsCode">
</RemoteSelect> </RemoteSelect>
<RemoteSelect v-if="form.categoryType === 3" <RemoteSelect v-if="form.categoryType === 3"
ref="packageGoods" ref="packageGoods"
...@@ -277,7 +277,7 @@ export default { ...@@ -277,7 +277,7 @@ export default {
categoryType: 2, categoryType: 2,
businessCode: this.businessCode, businessCode: this.businessCode,
}); });
this.options.selectedUpgradeGoods = selectedGoods.map(item => item.upgradeGoodsId); this.options.selectedUpgradeGoods = selectedGoods.map(item => item.merchantGoodsCode);
} }
const result = await fetchUpgradeGoodsListHook({ const result = await fetchUpgradeGoodsListHook({
...@@ -287,7 +287,7 @@ export default { ...@@ -287,7 +287,7 @@ export default {
}); });
if (isImmediate) { if (isImmediate) {
result.list.push(...this.form.goodsTypeGroupRelationList); result.list.push(...this.form.goodsTypeGroupRelationList);
result.list = uniqBy(result.list, "upgradeGoodsId"); result.list = uniqBy(result.list, "merchantGoodsCode");
} }
return result; return result;
}, },
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<el-button style="width:160px" <el-button style="width:160px"
type="primary" type="primary"
size="small" size="small"
@click="saveEdit"> @click="saveEdit()">
保存 保存
</el-button> </el-button>
</div> </div>
......
<template> <template>
<div class="detail-wrapper"> <div class="detail-wrapper">
<Descriptions :data="packageData" :schema="packagesSchema" /> <Descriptions :data="packages" :schema="packagesSchema" />
<el-divider class="divider"></el-divider> <el-divider class="divider"></el-divider>
<div v-for="productData in productList" <div v-for="(productData, index) in productList"
:key="productData.id" :key="productData.id"
class="product-detail-wrapper"> class="product-detail-wrapper">
<Product :product="productData" <Product :product="productData"
...@@ -12,8 +12,10 @@ ...@@ -12,8 +12,10 @@
:show-sales-proportion-percent="false" :show-sales-proportion-percent="false"
:show-settlement-type="false" :show-settlement-type="false"
:show-gift-cost="false" :show-gift-cost="false"
:merchant-id-list="merchantIdList"
:show-penetration-rate="false" :show-penetration-rate="false"
use-parent-mode /> use-parent-mode
@update:upgradeGoods="handleUpdateProduct($event, index)" />
<el-divider class="divider"></el-divider> <el-divider class="divider"></el-divider>
</div> </div>
</div> </div>
...@@ -32,6 +34,10 @@ export default { ...@@ -32,6 +34,10 @@ export default {
Product, Product,
}, },
props: { props: {
merchantIdList: {
type: Array,
default: () => [],
},
packages: { packages: {
type: Object, type: Object,
default: () => ({ }), default: () => ({ }),
...@@ -44,31 +50,40 @@ export default { ...@@ -44,31 +50,40 @@ export default {
data() { data() {
return { return {
VIEW_MODE, VIEW_MODE,
packageData: {},
packagesSchema: [], packagesSchema: [],
}; };
}, },
computed: { computed: {
productList() { productList() {
return this.packageData.detailList.map(item => ({ return this.packages.detailList.map(item => ({
upgradeGoodsId: item.upgradeGoodsId, upgradeGoodsId: item.upgradeGoodsId,
upgradeCommodityCode: item.upgradeCommodityCode,
detailList: [item], detailList: [item],
})); }));
}, },
}, },
watch: {
packages: {
handler(val) {
this.$set(this, "packageData", cloneDeep(val));
},
immediate: true,
deep: true,
},
},
async mounted() { async mounted() {
this.packagesSchema = await getPackagesDetailDescriptionSchema(); this.packagesSchema = await getPackagesDetailDescriptionSchema();
}, },
methods: { methods: {
handleUpdateProduct(upgradeGoods, productListIndex) {
const packages = cloneDeep(this.packages);
const current = packages.detailList?.[productListIndex];
if (!current) {
return;
}
if (!upgradeGoods.positionList) {
upgradeGoods.positionList = [];
}
packages.detailList[productListIndex] = {
...current,
upgradeGoods,
upgradeCommodityCode: upgradeGoods.commodityCode,
upgradeGoodsId: upgradeGoods.id,
upgradeGoodsName: upgradeGoods.upgradeGoodsName,
};
this.$emit("update:packages", packages);
},
}, },
}; };
</script> </script>
......
...@@ -142,8 +142,8 @@ ...@@ -142,8 +142,8 @@
<el-divider class="divider" /> <el-divider class="divider" />
<div v-if="productList && productList.length"> <div v-if="productList && productList.length">
<div v-for="(goodsForm, index) in productList" <div v-for="(goodsForm, index) in productList"
:key="goodsForm.id"> :key="goodsForm.upgradeCommodityCode">
<Product :ref="`productForm${goodsForm.upgradeGoodsId}`" <Product :ref="goodsForm.upgradeCommodityCode"
:product.sync="goodsForm" :product.sync="goodsForm"
:edit-state="VIEW_MODE.EDIT" :edit-state="VIEW_MODE.EDIT"
:disabled-ids="packageSelectedGoodsIds" :disabled-ids="packageSelectedGoodsIds"
...@@ -151,6 +151,7 @@ ...@@ -151,6 +151,7 @@
:show-gift-cost="false" :show-gift-cost="false"
:show-sales-proportion-percent="false" :show-sales-proportion-percent="false"
:show-settlement-type="false" :show-settlement-type="false"
:merchant-id-list="merchantIdList"
use-remove-btn use-remove-btn
@update:upgradeGoods="handleUpdateProduct($event, index)" @update:upgradeGoods="handleUpdateProduct($event, index)"
@remove="handleRemoveProduct(goodsForm.id, index)" /> @remove="handleRemoveProduct(goodsForm.id, index)" />
...@@ -177,6 +178,10 @@ export default { ...@@ -177,6 +178,10 @@ export default {
Product, Product,
}, },
props: { props: {
merchantIdList: {
type: Array,
required: true,
},
baseSceneCode: { baseSceneCode: {
type: String, type: String,
required: true, required: true,
...@@ -217,6 +222,7 @@ export default { ...@@ -217,6 +222,7 @@ export default {
productList() { productList() {
return this.packageForm.detailList.map(item => ({ return this.packageForm.detailList.map(item => ({
upgradeGoodsId: item.upgradeGoodsId, upgradeGoodsId: item.upgradeGoodsId,
upgradeCommodityCode: item.upgradeCommodityCode,
detailList: [item], detailList: [item],
})); }));
}, },
...@@ -259,7 +265,6 @@ export default { ...@@ -259,7 +265,6 @@ export default {
isSolarFilm, isSolarFilm,
handleUpdateProduct(upgradeGoods, productListIndex) { handleUpdateProduct(upgradeGoods, productListIndex) {
console.log("upgradeGoods", upgradeGoods);
if (this.packageForm.detailList[productListIndex]) { if (this.packageForm.detailList[productListIndex]) {
if (!upgradeGoods.positionList) { if (!upgradeGoods.positionList) {
upgradeGoods.positionList = []; upgradeGoods.positionList = [];
...@@ -330,15 +335,11 @@ export default { ...@@ -330,15 +335,11 @@ export default {
}); });
throw new Error("套餐的商品不能为空"); throw new Error("套餐的商品不能为空");
} }
await this.$nextTick();
for (const goods of this.packageForm.detailList) { for (const goods of this.productList) {
const refs = this.$refs[`productForm${goods.upgradeGoodsId}`]; const refs = this.$refs[goods.upgradeCommodityCode];
const ref = Array.isArray(refs) ? refs[0] : refs; const ref = Array.isArray(refs) ? refs[0] : refs;
console.log("ref", ref); console.log("ref", ref);
if (!refs || !isFunction(ref?.validate)) {
console.log("不存在或者不是函数?", ref, ref.validate);
continue;
}
await ref.validate(); await ref.validate();
} }
return { return {
......
<template> <template>
<div class="content"> <div class="content">
<div class="tabs-wrapper"> <div class="tabs-wrapper">
<Detail v-show="editState === VIEW_MODE.VIEW" <Detail v-if="editState === VIEW_MODE.VIEW"
v-bind="$attrs" v-bind="$attrs"
:edit-state="editState" :edit-state="editState"
v-on="$listeners" /> v-on="$listeners" />
<Modify v-show="editState === VIEW_MODE.EDIT" <Modify v-if="editState === VIEW_MODE.EDIT || editState === VIEW_MODE.SAVING"
ref="modifyRef" ref="modifyRef"
v-bind="$attrs" v-bind="$attrs"
:edit-state="editState" :edit-state="editState"
...@@ -45,6 +45,7 @@ export default { ...@@ -45,6 +45,7 @@ export default {
// 尚未初始化 // 尚未初始化
return; return;
} }
console.log("combo index validate");
return await modifyRef.validate(); return await modifyRef.validate();
}, },
}, },
......
...@@ -20,6 +20,10 @@ export default { ...@@ -20,6 +20,10 @@ export default {
Descriptions, Descriptions,
}, },
props: { props: {
merchantIdList: {
type: Array,
required: true,
},
product: { product: {
type: Object, type: Object,
required: true, required: true,
......
...@@ -35,8 +35,7 @@ ...@@ -35,8 +35,7 @@
:rules="[{ required: true, message: '请选择上架部位', trigger: 'change' }]"> :rules="[{ required: true, message: '请选择上架部位', trigger: 'change' }]">
<el-radio-group v-model="product.detailList[0].position"> <el-radio-group v-model="product.detailList[0].position">
<template v-for="item in options.position"> <template v-for="item in options.position">
<el-radio v-if="showPositionItem(item.position)" <el-radio :key="item.position"
:key="item.position"
:label="item.position"> :label="item.position">
{{ item.confName }} {{ item.confName }}
</el-radio> </el-radio>
...@@ -205,6 +204,7 @@ ...@@ -205,6 +204,7 @@
<SelectGoodsDialog v-if="dialog.selectGoods.show" <SelectGoodsDialog v-if="dialog.selectGoods.show"
:show.sync="dialog.selectGoods.show" :show.sync="dialog.selectGoods.show"
:base-scene-code="baseSceneCode" :base-scene-code="baseSceneCode"
:merchant-id-list="merchantIdList"
:expand-ids="disabledIds" :expand-ids="disabledIds"
:active-id="product.detailList[0].upgradeCommodityCode" :active-id="product.detailList[0].upgradeCommodityCode"
@confirm="handleSelectGoodsConfirm" /> @confirm="handleSelectGoodsConfirm" />
...@@ -236,7 +236,10 @@ export default { ...@@ -236,7 +236,10 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
merchantIdList: {
type: Array,
required: true,
},
// 当套餐加载这个组件的时候 不需要结算方式 // 当套餐加载这个组件的时候 不需要结算方式
showSettlementType: { showSettlementType: {
type: Boolean, type: Boolean,
...@@ -312,7 +315,6 @@ export default { ...@@ -312,7 +315,6 @@ export default {
this.$emit("remove"); this.$emit("remove");
}, },
async initOptions() { async initOptions() {
console.log("product init", BaseData.positionTypeList);
this.options.position = await this.get(BaseData.positionTypeList); this.options.position = await this.get(BaseData.positionTypeList);
}, },
...@@ -327,7 +329,6 @@ export default { ...@@ -327,7 +329,6 @@ export default {
handleSelectGoodsConfirm(upgradeGoods) { handleSelectGoodsConfirm(upgradeGoods) {
// 库存-sku001 // 库存-sku001
console.log("upgradeGoods", upgradeGoods);
upgradeGoods.djCost = upgradeGoods.djCost ?? 0; upgradeGoods.djCost = upgradeGoods.djCost ?? 0;
upgradeGoods.positionList = []; upgradeGoods.positionList = [];
if (upgradeGoods.position) { if (upgradeGoods.position) {
......
<template> <template>
<div class=""> <div class="">
<Detail v-show="editState === VIEW_MODE.VIEW" <Detail v-if="editState === VIEW_MODE.VIEW"
v-bind="$attrs" v-bind="$attrs"
:merchant-id-list="merchantIdList"
:product="product"
v-on="$listeners" /> v-on="$listeners" />
<Modify v-show="editState === VIEW_MODE.EDIT" <Modify v-if="editState === VIEW_MODE.EDIT || editState === VIEW_MODE.SAVING"
v-bind="$attrs" v-bind="$attrs"
ref="modifyRef" ref="modifyRef"
:merchant-id-list="merchantIdList"
:product="product"
v-on="$listeners" /> v-on="$listeners" />
</div> </div>
</template> </template>
<script> <script>
import { getOperationCost } from "@/api/grounding";
import { VIEW_MODE } from "@/views/goods/shelfProduct/constant/index"; import { VIEW_MODE } from "@/views/goods/shelfProduct/constant/index";
import Detail from "./components/detail/index.vue"; import Detail from "./components/detail/index.vue";
import Modify from "./components/modify/index.vue"; import Modify from "./components/modify/index.vue";
...@@ -22,6 +27,14 @@ export default { ...@@ -22,6 +27,14 @@ export default {
}, },
inheritAttrs: false, inheritAttrs: false,
props: { props: {
merchantIdList: {
type: Array,
required: true,
},
product: {
type: Object,
default: () => ({}),
},
editState: { editState: {
type: String, type: String,
required: true, required: true,
...@@ -33,12 +46,37 @@ export default { ...@@ -33,12 +46,37 @@ export default {
}; };
}, },
computed: { computed: {
}, },
watch: { watch: {
}, },
async mounted() {
await this.init();
},
methods: { methods: {
async init() {
console.log("123");
const _operationCost = this.product?.detailList?.[0]?.upgradeGoods?.operationCost;
if (_operationCost) {
return;
}
const commodityCode = this.product?.detailList?.[0]?.upgradeGoods?.commodityCode;
if (!commodityCode) {
return;
}
const { operationCost } = await getOperationCost({
commodityCode,
merchantIdList: this.merchantIdList,
});
// 创建新对象
const upgradeGoods = structuredClone(this.product.detailList[0].upgradeGoods);
this.$emit("update:upgradeGoods", {
...upgradeGoods,
operationCost,
});
},
// product.detailList[0].upgradeGoods.commodityCode
async validate() { async validate() {
console.log("进得来?");
const modifyRef = this.$refs.modifyRef; const modifyRef = this.$refs.modifyRef;
if (!modifyRef) { if (!modifyRef) {
// 尚未初始化 // 尚未初始化
......
<template> <template>
<VenusDialog v-model="showDialog" <VenusDialog v-model="showDialog"
title="选择商品" title="选择产品"
width="70%" width="70%"
height="700px"
draggable draggable
destroy-on-close destroy-on-close
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -65,12 +66,29 @@ ...@@ -65,12 +66,29 @@
</el-button> </el-button>
</div> </div>
<d2-table ref="tableRef" <d2-table ref="tableRef"
class="table-wrapper"
:before-search-fn="beforeSearchFn" :before-search-fn="beforeSearchFn"
:get-list-api="table.api" :get-list-api="table.api"
:has-num="false" :has-num="false"
:search-form="table.form" :search-form="table.form"
:table-params="table.props" :table-params="table.props"
@setTableFinishFun="setTableFinishFun"> @setTableFinishFun="setTableFinishFun">
<template #upgradeGoodsAreaList="{ scope }">
<el-tooltip v-if="Array.isArray(scope.upgradeGoodsAreaList) && scope.upgradeGoodsAreaList.length" placement="top">
<template #content>
<div class="car-type-list">
<div v-for="(item, index) in scope.upgradeGoodsAreaList" :key="index">
{{ item.provinceName === '全国' ? '全国' : `${item.provinceName}-${item.cityName}` }}
</div>
</div>
</template>
<div class="text-hide" v-text="getUpgradeGoodsAreaList(scope.upgradeGoodsAreaList)">
</div>
</el-tooltip>
<div v-else>
-
</div>
</template>
<template #single-button="scope"> <template #single-button="scope">
<el-radio v-model="selectedId" <el-radio v-model="selectedId"
:disabled="getExpandIds.includes(scope.scope.commodityCode)" :disabled="getExpandIds.includes(scope.scope.commodityCode)"
...@@ -111,6 +129,8 @@ ...@@ -111,6 +129,8 @@
<script> <script>
import { getAllCategory } from "@api/product"; import { getAllCategory } from "@api/product";
import { getUpgradeProductList } from "@api/productManage"; import { getUpgradeProductList } from "@api/productManage";
import { isArray } from "lodash-es";
import { getOperationCost } from "@/api/grounding";
import VenusDialog from "@/components/venusDialog/index.vue"; import VenusDialog from "@/components/venusDialog/index.vue";
import { setAllOptions } from "@/libs/select"; import { setAllOptions } from "@/libs/select";
import { baseConfig } from "@/main"; import { baseConfig } from "@/main";
...@@ -138,6 +158,11 @@ export default { ...@@ -138,6 +158,11 @@ export default {
type: Array, type: Array,
default: () => ([]), default: () => ([]),
}, },
// 服务商列表
merchantIdList: {
type: Array,
default: () => ([]),
},
// 业务场景 // 业务场景
baseSceneCode: { baseSceneCode: {
type: String, type: String,
...@@ -211,6 +236,22 @@ export default { ...@@ -211,6 +236,22 @@ export default {
}, },
methods: { methods: {
formatCar, formatCar,
getUpgradeGoodsAreaList(areaList) {
if (!isArray(areaList)) {
return "-";
}
if (areaList.length === 0) {
return "-";
}
const _areaList = areaList.map((item) => {
if (item.provinceName === "全国") {
return item.provinceName;
}
return `${item.provinceName}-${item.cityName}`;
});
return _areaList.join(",");
},
handleSelectedRow(row) { handleSelectedRow(row) {
this.$set(this, "selectedRow", row); this.$set(this, "selectedRow", row);
this.selectedId = row.commodityCode; this.selectedId = row.commodityCode;
...@@ -254,12 +295,20 @@ export default { ...@@ -254,12 +295,20 @@ export default {
// 会员权益 goodsTypeList // 会员权益 goodsTypeList
const searchKey = isQualityUpgrade(this.baseSceneCode) ? "excludeGoodsTypeList" : "goodsTypeList"; const searchKey = isQualityUpgrade(this.baseSceneCode) ? "excludeGoodsTypeList" : "goodsTypeList";
this.table.form[searchKey] = filterParams; this.table.form[searchKey] = filterParams;
this.table.form.merchantIds = this.merchantIdList;
}, },
handleSelectGoodsConfirm() { async handleSelectGoodsConfirm() {
if (!this.selectedId) { if (!this.selectedId) {
return this.$message.warning("请选择商品"); return this.$message.warning("请选择商品");
} }
this.$emit("confirm", this.selectedRow); const { operationCost } = await getOperationCost({
commodityCode: this.selectedRow.commodityCode,
merchantIdList: this.merchantIdList,
});
this.$emit("confirm", {
...this.selectedRow,
operationCost,
});
}, },
handleReset() { handleReset() {
this.table.form = { this.table.form = {
...@@ -291,4 +340,9 @@ export default { ...@@ -291,4 +340,9 @@ export default {
padding: 0; padding: 0;
} }
} }
.table-wrapper {
::v-deep .el-table .cell {
padding: 6px 8px;
}
}
</style> </style>
...@@ -74,18 +74,19 @@ ...@@ -74,18 +74,19 @@
<el-button style="width:160px" <el-button style="width:160px"
type="primary" type="primary"
size="small" size="small"
@click="saveEdit()"> @click="saveEdit({ useValidate: false })">
保存 保存
</el-button> </el-button>
</div> </div>
</div> </div>
<div class="tabs-wrapper"> <div v-if="hasMerchantIdList" class="tabs-wrapper">
<Product v-if="productDetail.productType === 1" <Product v-if="productDetail.productType === 1"
ref="productRefs" ref="productRefs"
:key="tabsActive" :key="tabsActive"
:edit-state="editState" :edit-state="editState"
:merchant-id-list="merchantIdList"
:base-scene-code="baseSceneCode" :base-scene-code="baseSceneCode"
:product="productDetail || { detailList: [] }" :product="productDetail || { detailList: [] }"
@update:upgradeGoods="handleProductUpdateUpgradeGoods" /> @update:upgradeGoods="handleProductUpdateUpgradeGoods" />
...@@ -93,10 +94,12 @@ ...@@ -93,10 +94,12 @@
ref="packageRefs" ref="packageRefs"
:key="tabsActive" :key="tabsActive"
:prefix="$data._prefix" :prefix="$data._prefix"
:merchant-id-list="merchantIdList"
:edit-state="editState" :edit-state="editState"
:base-scene-code="baseSceneCode" :base-scene-code="baseSceneCode"
:shelf-type="shelfType" :shelf-type="shelfType"
:packages="productDetail || { detailList: [] }" /> :packages="productDetail || { detailList: [] }"
@update:packages="handleComboUpdatePackages" />
</div> </div>
</template> </template>
...@@ -115,6 +118,7 @@ import { ...@@ -115,6 +118,7 @@ import {
delProductPackagesApi, delProductPackagesApi,
getProductPackagesDetailApi, getProductPackagesDetailApi,
getProductPackagesListApi, getProductPackagesListApi,
getShelfProductBaseInfoApi,
postProductPackagesApi, postProductPackagesApi,
} from "@/views/goods/shelfProduct/api/index.js"; } from "@/views/goods/shelfProduct/api/index.js";
import { VIEW_MODE } from "@/views/goods/shelfProduct/constant/index.js"; import { VIEW_MODE } from "@/views/goods/shelfProduct/constant/index.js";
...@@ -163,6 +167,9 @@ export default { ...@@ -163,6 +167,9 @@ export default {
list: [], list: [],
}, },
productDetail: { }, productDetail: { },
// 这是来自整个订单的, 跟detail无关,不能放detail里
merchantIdList: [],
hasMerchantIdList: false,
}; };
}, },
computed: { computed: {
...@@ -175,8 +182,7 @@ export default { ...@@ -175,8 +182,7 @@ export default {
}, },
}, },
}, },
mounted() { async mounted() {
}, },
methods: { methods: {
isEmpty, isEmpty,
...@@ -280,29 +286,30 @@ export default { ...@@ -280,29 +286,30 @@ export default {
return; return;
} }
const newRow = list[0]; const newRow = list[0];
if (isCreate) { if (isCreate) {
// 新增
this.tabs.list.unshift(newRow);
const index = this.tabs.list.findIndex(item => item.id === this.tabsActive);
this.tabs.list.splice(index, 1);
this.tabs.active = newRow.id;
// id 由临时 nanoid- 改为正式id 所以要多做一些步骤
// tabs list 先 push 接口返回的 存储好的id
} else {
console.log("new row", newRow);
// 有值 为 修改 // 有值 为 修改
const index = this.tabs.list.findIndex(item => item.id === req.id); const index = this.tabs.list.findIndex(item => item.id === req.id);
if (index === -1) { if (index === -1) {
return; return;
} }
this.$set(this.tabs.list, index, newRow); this.$set(this.tabs.list, index, newRow);
} else {
// 空值 为 新增
// id 由临时 nanoid- 改为正式id 所以要多做一些步骤
// tabs list 先 push 接口返回的 存储好的id
this.tabs.list.unshift(newRow);
// 删掉新增时 临时存的
const index = this.tabs.list.findIndex(item => item.id === this.tabsActive);
this.tabs.list.splice(index, 1);
this.tabs.active = newRow.id;
// 通过现有 nanoid 找到对应index 删掉
// 设置 active值
} }
this.$refs.remoteSelectRef.forceUpdate(); this.$refs.remoteSelectRef.forceUpdate();
// // 根据id 修改 productName // // 根据id 修改 productName
// await this.$refs.remoteSelectRef.getApi(false); // await this.$refs.remoteSelectRef.getApi(false);
this.$set(this, "productDetail", newDetail);
this.productDetail = newDetail; this.productDetail = newDetail;
if (useMessage) { if (useMessage) {
this.$message({ this.$message({
...@@ -380,6 +387,12 @@ export default { ...@@ -380,6 +387,12 @@ export default {
// 获取头部的select选择项 // 获取头部的select选择项
async getTitleOptions({ pageQuery, isImmediate }) { async getTitleOptions({ pageQuery, isImmediate }) {
if (!this.hasMerchantIdList) {
const { merchantIdList } = await getShelfProductBaseInfoApi({ businessCode: this.businessCode });
this.merchantIdList = merchantIdList || [];
await this.$nextTick();
}
const { list, pages } = await getProductPackagesListApi({ const { list, pages } = await getProductPackagesListApi({
businessCode: this.businessCode, businessCode: this.businessCode,
productName: pageQuery.searchValue, productName: pageQuery.searchValue,
...@@ -394,6 +407,7 @@ export default { ...@@ -394,6 +407,7 @@ export default {
} }
} }
pageQuery.pages = pages; pageQuery.pages = pages;
this.hasMerchantIdList = true;
return { return {
list: list.map(item => ({ list: list.map(item => ({
...item, ...item,
...@@ -414,6 +428,9 @@ export default { ...@@ -414,6 +428,9 @@ export default {
}); });
this.$set(this.productDetail, "upgradeGoodsId", upgradeGoods.id); this.$set(this.productDetail, "upgradeGoodsId", upgradeGoods.id);
}, },
handleComboUpdatePackages(packages) {
this.$set(this, "productDetail", packages);
},
// 新增按钮 // 新增按钮
async handleAppendProductPackages(command) { async handleAppendProductPackages(command) {
......
import { get } from "lodash-es"; import { get, isArray } from "lodash-es";
import { nanoid } from "nanoid"; import { nanoid } from "nanoid";
import { BaseData, settlementTypeOpt } from "@/common/constants"; import { BaseData, settlementTypeOpt } from "@/common/constants";
import { isZeroOrNumber } from "@/libs/number"; import { isZeroOrNumber } from "@/libs/number";
...@@ -226,7 +226,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -226,7 +226,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
positionOption = await store.dispatch("d2admin/base/get", BaseData.positionTypeList); positionOption = await store.dispatch("d2admin/base/get", BaseData.positionTypeList);
} }
return [ return [
{ name: "detailList.0.upgradeGoods.upgradeGoodsName", label: "商品名称", col: 8 }, { name: "detailList.0.upgradeGoods.upgradeGoodsName", label: "产品名称", col: 8 },
{ {
name: "detailList.0.upgradeGoods.specificationData", name: "detailList.0.upgradeGoods.specificationData",
label: "规格", label: "规格",
...@@ -240,7 +240,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -240,7 +240,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
}, },
{ {
name: "detailList.0.upgradeGoods.type", name: "detailList.0.upgradeGoods.type",
label: "商品编码", label: "产品编码",
col: 8, col: 8,
render(h, { data, schemaItem }) { render(h, { data, schemaItem }) {
const value = get(data, schemaItem.name); const value = get(data, schemaItem.name);
...@@ -252,7 +252,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -252,7 +252,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
}, },
{ {
name: "detailList.0.upgradeGoods.thirdPartyCode", name: "detailList.0.upgradeGoods.thirdPartyCode",
label: "第三方编码", label: "供应商编码",
col: 8, col: 8,
render(h, { data, schemaItem }) { render(h, { data, schemaItem }) {
const value = get(data, schemaItem.name); const value = get(data, schemaItem.name);
...@@ -262,18 +262,18 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -262,18 +262,18 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
); );
}, },
}, },
{ // {
name: "detailList.0.upgradeGoods.purchasePrice", // name: "detailList.0.upgradeGoods.purchasePrice",
label: "采购价/卷", // label: "采购价/卷",
col: 8, // col: 8,
render(h, { data, schemaItem }) { // render(h, { data, schemaItem }) {
const value = isZeroOrNumber(get(data, schemaItem.name)); // const value = isZeroOrNumber(get(data, schemaItem.name));
return h( // return h(
"span", // "span",
value === "-" ? value : `${value}元`, // value === "-" ? value : `${value}元`,
); // );
}, // },
}, // },
{ {
name: "detailList.0.upgradeGoods.upgradePrice", name: "detailList.0.upgradeGoods.upgradePrice",
label: "参考售价/件", label: "参考售价/件",
...@@ -339,7 +339,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -339,7 +339,7 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
); );
}, },
}, },
{ name: "detailList.0.upgradeGoods.commodityCode", label: "商品ID", col: 8 }, { name: "detailList.0.upgradeGoods.commodityCode", label: "产品ID", col: 8 },
{ {
name: "detailList.0.upgradeGoods.djCost", name: "detailList.0.upgradeGoods.djCost",
label: "嘀加成本/件", label: "嘀加成本/件",
...@@ -352,13 +352,12 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -352,13 +352,12 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
); );
}, },
isHide: ({ formModel }) => { isHide: ({ formModel }) => {
return false; const goodsInfo = formModel?.goodsInfo || formModel.upgradeGoods?.goodsInfo;
// const goodsInfo = formModel?.goodsInfo || formModel.upgradeGoods?.goodsInfo; const supplierCode = formModel?.supplierCode || formModel?.upgradeGoods?.supplierCode || goodsInfo?.supplierCode;
// const supplierCode = formModel?.supplierCode || formModel?.upgradeGoods?.supplierCode || goodsInfo?.supplierCode; const hasEquityScene = baseConfig.equitySceneType.includes(formModel.goodsType);
// const hasEquityScene = baseConfig.equitySceneType.includes(formModel.goodsType); const hasExtendPosition = baseConfig.extendedPosiType.includes(formModel.goodsType);
// const hasExtendPosition = baseConfig.extendedPosiType.includes(formModel.goodsType); const hasSupplierCode = baseConfig.supplierCode.includes(supplierCode);
// const hasSupplierCode = baseConfig.supplierCode.includes(supplierCode); return !((hasEquityScene || hasExtendPosition) && !hasSupplierCode);
// return !((hasEquityScene || hasExtendPosition) && !hasSupplierCode);
}, },
}, },
{ {
...@@ -381,9 +380,9 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -381,9 +380,9 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
const names = positions.map(item => item.confName); const names = positions.map(item => item.confName);
return result(names?.join("/")); return result(names?.join("/"));
}, },
// isHide: ({ formModel }) => { isHide: ({ formModel }) => {
// return formModel.goodsType !== 1; return formModel?.detailList?.[0]?.goodsType !== 1;
// }, },
}, },
{ {
name: "detailList.0.upgradeGoods.upgradeGoodsServiceItemsList", name: "detailList.0.upgradeGoods.upgradeGoodsServiceItemsList",
...@@ -409,14 +408,6 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -409,14 +408,6 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
value, value,
); );
}, },
// isHide: ({ formModel }) => {
// const upgradeGoods = get(formModel, "detailList.0.upgradeGoods");
// const hasEquityScene = baseConfig.equitySceneType.includes(upgradeGoods?.goodsType);
// const hasSupplierCode = baseConfig.supplierCode.includes(upgradeGoods?.goodsInfo.supplierCode);
// // 这里是hide 所以要反一下
// return !(hasEquityScene && !hasSupplierCode);
// },
}, },
{ {
name: "detailList.0.upgradeGoods.entityCardFlag", name: "detailList.0.upgradeGoods.entityCardFlag",
...@@ -429,13 +420,6 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -429,13 +420,6 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
value === "Y" ? "是" : "否", value === "Y" ? "是" : "否",
); );
}, },
// isHide: ({ formModel }) => {
// const upgradeGoods = get(formModel, "detailList.0.upgradeGoods");
// const hasEquityScene = baseConfig.equitySceneType.includes(upgradeGoods?.goodsType);
// // 这里是hide 所以要反一下
// return !(hasEquityScene);
// },
}, },
{ {
name: "detailList.0.upgradeGoods.warrantyPeriod", name: "detailList.0.upgradeGoods.warrantyPeriod",
...@@ -448,12 +432,18 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() { ...@@ -448,12 +432,18 @@ export async function getProductDetailUpgradeGoodsDescriptionSchema() {
value === "-" ? value : `${value}年`, value === "-" ? value : `${value}年`,
); );
}, },
// isHide: ({ formModel }) => { },
// const upgradeGoods = get(formModel, "detailList.0.upgradeGoods"); {
// const hasMembraneType = baseConfig.membraneTypeList.includes(upgradeGoods?.goodsType); name: "detailList.0.upgradeGoods.operationCost",
// // 这里是hide 所以要反一下 label: "运营成本/元",
// return !(hasMembraneType); col: 8,
// }, render(h, { data, schemaItem }) {
const value = isZeroOrNumber(get(data, schemaItem.name));
return h(
"span",
value === "-" ? value : `${value}元`,
);
},
}, },
]; ];
} }
...@@ -567,7 +557,7 @@ export const selectGoodsTableSchema = { ...@@ -567,7 +557,7 @@ export const selectGoodsTableSchema = {
width: "60", width: "60",
}, },
{ {
label: "商品名称", label: "产品名称",
prop: "upgradeGoodsName", prop: "upgradeGoodsName",
width: 150, width: 150,
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -575,7 +565,7 @@ export const selectGoodsTableSchema = { ...@@ -575,7 +565,7 @@ export const selectGoodsTableSchema = {
}, },
}, },
{ {
label: "商品ID", label: "产品ID",
prop: "commodityCode", prop: "commodityCode",
width: 180, width: 180,
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -590,14 +580,14 @@ export const selectGoodsTableSchema = { ...@@ -590,14 +580,14 @@ export const selectGoodsTableSchema = {
}, },
}, },
{ {
label: "商品编码", label: "产品编码",
prop: "type", prop: "type",
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.type || "-"; return cellValue.type || "-";
}, },
}, },
{ {
label: "第三方编码", label: "供应商编码",
prop: "thirdPartyCode", prop: "thirdPartyCode",
width: 100, width: 100,
formatter: (cellValue) => { formatter: (cellValue) => {
...@@ -605,13 +595,43 @@ export const selectGoodsTableSchema = { ...@@ -605,13 +595,43 @@ export const selectGoodsTableSchema = {
}, },
}, },
{ {
label: "运营成本/元",
prop: "operationCost",
width: 100,
formatter: (row) => {
const value = isZeroOrNumber(row.operationCost);
return value === "-" ? value : `${value}元`;
},
},
{
label: "适用区域",
prop: "upgradeGoodsAreaList",
width: 180,
addHtml: "upgradeGoodsAreaList",
// formatter: (row) => {
// if (!isArray(row.upgradeGoodsAreaList)) {
// return "-";
// }
// if (row.upgradeGoodsAreaList.length === 0) {
// return "-";
// }
// const areaList = row.upgradeGoodsAreaList.map((item) => {
// if (item.provinceName === "全国") {
// return item.provinceName;
// }
// return `${item.provinceName}-${item.cityName}`;
// });
// return areaList.join("/");
// },
},
{
label: "适用车型", label: "适用车型",
prop: "", prop: "",
addHtml: "carName", addHtml: "carName",
width: 200, width: 200,
// formatter: (cellValue) => { formatter: (cellValue) => {
// return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join('/') : '-' return cellValue?.carTypeConfigList?.length ? cellValue.carTypeConfigList.map(item => item.seriesName).join("/") : "-";
// } },
}, },
{ {
label: "所属系列", label: "所属系列",
...@@ -644,7 +664,7 @@ export const selectGoodsTableSchema = { ...@@ -644,7 +664,7 @@ export const selectGoodsTableSchema = {
export function getSelectGoodsTableFilterSchema(keyDownGetList) { export function getSelectGoodsTableFilterSchema(keyDownGetList) {
return [ return [
{ {
label: "商品名称", label: "产品名称",
name: "upgradeGoodsName", name: "upgradeGoodsName",
type: "input", type: "input",
maxlength: 50, maxlength: 50,
...@@ -652,7 +672,7 @@ export function getSelectGoodsTableFilterSchema(keyDownGetList) { ...@@ -652,7 +672,7 @@ export function getSelectGoodsTableFilterSchema(keyDownGetList) {
keyFn: keyDownGetList, keyFn: keyDownGetList,
}, },
{ {
label: "商品ID", label: "产品ID",
name: "commodityCode", name: "commodityCode",
addHtml: "commodityCode", addHtml: "commodityCode",
}, },
...@@ -665,12 +685,12 @@ export function getSelectGoodsTableFilterSchema(keyDownGetList) { ...@@ -665,12 +685,12 @@ export function getSelectGoodsTableFilterSchema(keyDownGetList) {
keyFn: keyDownGetList, keyFn: keyDownGetList,
}, },
{ {
label: "商品编码", label: "产品编码",
name: "type", name: "type",
addHtml: "type", addHtml: "type",
}, },
{ {
label: "第三方编码", label: "供应商编码",
name: "thirdPartyCode", name: "thirdPartyCode",
addHtml: "thirdPartyCode", addHtml: "thirdPartyCode",
}, },
......
...@@ -27,9 +27,9 @@ export async function fetchUpgradeGoodsListHook({ businessCode, selectedUpgradeG ...@@ -27,9 +27,9 @@ export async function fetchUpgradeGoodsListHook({ businessCode, selectedUpgradeG
return { return {
list: list.map(item => ({ list: list.map(item => ({
upgradeGoodsId: item.upgradeGoodsId, upgradeGoodsId: item.upgradeGoodsId,
upgradeGoodsName: item.upgradeGoodsName, upgradeGoodsName: item.goodsAlias || item.upgradeGoodsName,
merchantGoodsCode: item.merchantGoodsCode, merchantGoodsCode: item.merchantGoodsCode,
disabled: selectedUpgradeGoods.includes(item.upgradeGoodsId), disabled: selectedUpgradeGoods.includes(item.merchantGoodsCode),
upgradeCommodityCode: item.upgradeCommodityCode, upgradeCommodityCode: item.upgradeCommodityCode,
})), })),
query: pageQuery, query: pageQuery,
...@@ -51,7 +51,7 @@ export async function fetchPackagesGoodsListHook({ businessCode, selectedPackage ...@@ -51,7 +51,7 @@ export async function fetchPackagesGoodsListHook({ businessCode, selectedPackage
list: res.list.map(item => ({ list: res.list.map(item => ({
packageCode: item.packageCode, packageCode: item.packageCode,
disabled: selectedPackageGoods.includes(item.packageCode), disabled: selectedPackageGoods.includes(item.packageCode),
packageName: item.productName, packageName: item.packageAlias || item.productName,
})), })),
query: pageQuery, query: pageQuery,
}; };
......
...@@ -110,7 +110,6 @@ import { readFileAsDataURL } from "@/libs/file"; ...@@ -110,7 +110,6 @@ import { readFileAsDataURL } from "@/libs/file";
import { startPolling } from "@/libs/interval"; import { startPolling } from "@/libs/interval";
import { syncTime } from "@/libs/sleep"; import { syncTime } from "@/libs/sleep";
import { import {
getShelfProductBaseInfoApi,
getShelfProductBaseInfoByUUIDApi, getShelfProductBaseInfoByUUIDApi,
getShelfProductUpdateStep, getShelfProductUpdateStep,
postPollFileParseStatusApi, postPollFileParseStatusApi,
......
...@@ -71,21 +71,13 @@ ...@@ -71,21 +71,13 @@
<span class="suborder-mcode">物料编码{{ so.materialCode }}</span> <span class="suborder-mcode">物料编码{{ so.materialCode }}</span>
</div> </div>
<div class="suborder-list__right"> <div class="suborder-list__right">
<el-tag <span
v-if="so.tag1" :class="['suborder-pill', 'suborder-pill--' + (so.statusTone || 'grey')]"
size="small" >{{ so.tag1 }}</span>
:type="so.tag1Type"
class="suborder-tag"
effect="light"
>{{ so.tag1 }}</el-tag>
<span class="suborder-divider" /> <span class="suborder-divider" />
<el-tag <span
v-if="so.tag2" :class="['suborder-pill', 'suborder-pill--' + (so.innerTone || 'grey')]"
size="small" >{{ so.tag2 }}</span>
:type="so.tag2Type"
class="suborder-tag"
effect="light"
>{{ so.tag2 }}</el-tag>
</div> </div>
</li> </li>
</ul> </ul>
...@@ -303,11 +295,12 @@ export default { ...@@ -303,11 +295,12 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
background: #f5f7fa; background: #f8f9fc;
padding: 10px 14px; padding: 10px 14px;
margin-bottom: 6px; margin-bottom: 6px;
font-size: 14px; font-size: 14px;
color: #303133; color: #303133;
border-radius: 4px;
} }
.strip-list__amount { .strip-list__amount {
...@@ -324,12 +317,13 @@ export default { ...@@ -324,12 +317,13 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
background: #f5f7fa; background: #f8f9fc;
padding: 10px 14px; padding: 10px 14px;
margin-bottom: 6px; margin-bottom: 6px;
font-size: 14px; font-size: 14px;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: 8px;
border-radius: 4px;
} }
.suborder-list__left { .suborder-list__left {
...@@ -360,10 +354,43 @@ export default { ...@@ -360,10 +354,43 @@ export default {
height: 14px; height: 14px;
background: #dcdfe6; background: #dcdfe6;
margin: 0 6px; margin: 0 6px;
flex-shrink: 0;
} }
.suborder-tag { .suborder-pill {
display: inline-block;
padding: 2px 8px;
font-size: 12px;
line-height: 1.5;
border-radius: 4px; border-radius: 4px;
border: 1px solid transparent;
box-sizing: border-box;
white-space: nowrap;
}
/* 与列表色点及 Element success/warning/danger light 一致 */
.suborder-pill--green {
color: #67c23a;
border-color: #b3e19d;
background: #f0f9eb;
}
.suborder-pill--orange {
color: #e6a23c;
border-color: #f3d19e;
background: #fdf6ec;
}
.suborder-pill--red {
color: #f56c6c;
border-color: #fab6b6;
background: #fef0f0;
}
.suborder-pill--grey {
color: #909399;
border-color: #dcdfe6;
background: #f4f4f5;
} }
.photo-row { .photo-row {
......
...@@ -65,6 +65,35 @@ function formatTechnicianText(row) { ...@@ -65,6 +65,35 @@ function formatTechnicianText(row) {
return parts.length ? parts.join('\n') : '-' return parts.length ? parts.join('\n') : '-'
} }
/**
* 单条服务明细的实际出库展示(与列表「实际出库数量(米/件)」列同一规则)
* @param {Object} d - serviceItemsDetailList 项
* @returns {string}
*/
export function formatServiceDetailOutboundLine(d) {
if (!d || d.useNum == null || d.useNum === '') return '-'
const num = Number(d.useNum)
const formatted = Number.isFinite(num) ? num.toFixed(2) : String(d.useNum).trim()
return `${formatted}米/件`
}
/** 施工状态 0-待施工(橙) 1-已施工(绿) 2-客户返工(红),与列表 statusDotClass 一致 */
export function constructionStatusPillTone(s) {
const n = s == null || s === '' ? null : Number(s)
if (n === 1) return 'green'
if (n === 2) return 'red'
if (n === 0) return 'orange'
return 'grey'
}
/** 施工标记 0–2 橙、3 已完工绿,与列表 tagDotClass 一致 */
export function constructionInnerPillTone(s) {
const n = s == null || s === '' ? null : Number(s)
if (n === 3) return 'green'
if (n === 0 || n === 1 || n === 2) return 'orange'
return 'grey'
}
/** 服务项目行与实际出库行同源、同序(与有名称的服务明细一一对应) */ /** 服务项目行与实际出库行同源、同序(与有名称的服务明细一一对应) */
function serviceItemsAndOutboundLinesForTable(row) { function serviceItemsAndOutboundLinesForTable(row) {
const serviceLines = [] const serviceLines = []
...@@ -74,13 +103,7 @@ function serviceItemsAndOutboundLinesForTable(row) { ...@@ -74,13 +103,7 @@ function serviceItemsAndOutboundLinesForTable(row) {
const n = d.serviceItemsName const n = d.serviceItemsName
if (n == null || String(n).trim() === '') return if (n == null || String(n).trim() === '') return
serviceLines.push({ name: String(n).trim() }) serviceLines.push({ name: String(n).trim() })
if (d.useNum != null && d.useNum !== '') { actualOutLines.push(formatServiceDetailOutboundLine(d))
const num = Number(d.useNum)
const formatted = Number.isFinite(num) ? num.toFixed(2) : String(d.useNum).trim()
actualOutLines.push(`${formatted}米/件`)
} else {
actualOutLines.push('-')
}
}) })
if (!serviceLines.length) { if (!serviceLines.length) {
return { serviceLines: [{ name: '-' }], actualOutLines: ['-'] } return { serviceLines: [{ name: '-' }], actualOutLines: ['-'] }
...@@ -158,26 +181,34 @@ export function mapApiRowToDetailForm(row) { ...@@ -158,26 +181,34 @@ export function mapApiRowToDetailForm(row) {
const serviceItems = [] const serviceItems = []
;(row.serviceItemsDetailList || []).forEach((d) => { ;(row.serviceItemsDetailList || []).forEach((d) => {
if (!d) return if (!d) return
const qty const n = d.serviceItemsName
= d.useNum != null && d.materialStandard != null if (n == null || String(n).trim() === '') return
? `${d.useNum} / 标准${d.materialStandard}` serviceItems.push({
: (d.useNum != null ? String(d.useNum) : '-') name: String(n).trim(),
const name = d.serviceItemsName != null && String(d.serviceItemsName).trim() !== '' qty: formatServiceDetailOutboundLine(d)
? String(d.serviceItemsName).trim() : '-' })
serviceItems.push({ name, qty })
}) })
const subOrders = (row.subOrderList || []) const subOrders = (row.subOrderList || [])
.filter((s) => s) .filter((s) => s)
.map((s) => ({ .map((s) => {
productName: s.upgradeGoodsName || '-', // 与列表列一致:接口常把施工状态挂在施工单上,子项无字段时回退订单级 constructionStatus
materialCode: s.materialCode || '-', const statusVal = toIntOrNull(s.constructionStatus ?? row.constructionStatus)
tag1: CONSTRUCTION_STATUS_TEXT[s.constructionStatus] != null const innerVal = toIntOrNull(s.constructionInnerStatus ?? row.constructionInnerStatus)
? CONSTRUCTION_STATUS_TEXT[s.constructionStatus] : '-', const tag1 = statusVal != null && CONSTRUCTION_STATUS_TEXT[statusVal] != null
tag1Type: s.constructionStatus === 1 ? 'success' : s.constructionStatus === 2 ? 'danger' : 'warning', ? CONSTRUCTION_STATUS_TEXT[statusVal]
tag2: INNER_STATUS_TEXT[row.constructionInnerStatus] != null : (statusVal != null ? String(statusVal) : '-')
? INNER_STATUS_TEXT[row.constructionInnerStatus] : '-', const tag2 = innerVal != null && INNER_STATUS_TEXT[innerVal] != null
tag2Type: row.constructionInnerStatus === 3 ? 'success' : 'warning' ? INNER_STATUS_TEXT[innerVal]
})) : (innerVal != null ? String(innerVal) : '-')
return {
productName: s.upgradeGoodsName || '-',
materialCode: s.materialCode || '-',
tag1,
tag2,
statusTone: constructionStatusPillTone(statusVal),
innerTone: constructionInnerPillTone(innerVal)
}
})
return { return {
constructionCode: row.constructionCode, constructionCode: row.constructionCode,
mainOrderCode: row.orderCode, mainOrderCode: row.orderCode,
...@@ -194,9 +225,9 @@ export function mapApiRowToDetailForm(row) { ...@@ -194,9 +225,9 @@ export function mapApiRowToDetailForm(row) {
productName: '-', productName: '-',
materialCode: '-', materialCode: '-',
tag1: '-', tag1: '-',
tag1Type: 'info',
tag2: '-', tag2: '-',
tag2Type: 'info' statusTone: 'grey',
innerTone: 'grey'
} }
], ],
dispatchTime: formatListDateTime(row.dispatchTime || row.createdDate), dispatchTime: formatListDateTime(row.dispatchTime || row.createdDate),
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
v-model="componentData[i.key]" v-model="componentData[i.key]"
:disabled="i.disabled" :disabled="i.disabled"
:maxlength="i.maxlength || -1" :maxlength="i.maxlength || -1"
:placeholder="`请输入${i.label}`" :placeholder="`${i.disabled?'':'请输入'}${i.label}`"
/> />
</template> </template>
<template v-else-if="i.type == 'select' && i.multiple"> <template v-else-if="i.type == 'select' && i.multiple">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
class="select" class="select"
multiple multiple
collapse-tags collapse-tags
:placeholder="`请选择${i.label}`" :placeholder="`${i.disabled?'':'请选择'}${i.label}`"
@change="onOtherServiceProvidersChange" @change="onOtherServiceProvidersChange"
:filterable="i.filterable" :filterable="i.filterable"
> >
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<el-select <el-select
v-model="componentData[i.key]" v-model="componentData[i.key]"
class="select" class="select"
:placeholder="`请选择${i.label}`" :placeholder="`${i.disabled?'':'请选择'}${i.label}`"
:filterable="i.filterable" :filterable="i.filterable"
:disabled="i.disabledFun ? i.disabledFun(componentData) : false" :disabled="i.disabledFun ? i.disabledFun(componentData) : false"
@change="selectionChange($event, i)" @change="selectionChange($event, i)"
......
...@@ -197,7 +197,6 @@ export default { ...@@ -197,7 +197,6 @@ export default {
updateTrafficProviderInformation (data) { updateTrafficProviderInformation (data) {
let { trafficPartyId } = this, let { trafficPartyId } = this,
index = this.infoForm.trafficPartyDetails.findIndex(item => item.trafficPartyId == trafficPartyId) index = this.infoForm.trafficPartyDetails.findIndex(item => item.trafficPartyId == trafficPartyId)
console.log(data.areaOpIdList)
data.areaOpId = data.areaOpIdList.join('/') data.areaOpId = data.areaOpIdList.join('/')
data.onlineOpId = data.onlineOpIdList.join('/') data.onlineOpId = data.onlineOpIdList.join('/')
data.regionSupervisorId = data.regionSupervisorIdList.join('/') data.regionSupervisorId = data.regionSupervisorIdList.join('/')
...@@ -245,7 +244,6 @@ export default { ...@@ -245,7 +244,6 @@ export default {
trafficProviderInformationRef.formRef.validate((valid) => { trafficProviderInformationRef.formRef.validate((valid) => {
if (valid) { if (valid) {
let componentData = deepClone(trafficProviderInformationRef.componentData) let componentData = deepClone(trafficProviderInformationRef.componentData)
console.log(componentData.areaOpIdList)
componentData.areaOpId = componentData.areaOpIdList.join(',') componentData.areaOpId = componentData.areaOpIdList.join(',')
componentData.onlineOpId = componentData.onlineOpIdList.join(',') componentData.onlineOpId = componentData.onlineOpIdList.join(',')
componentData.regionSupervisorId = componentData.regionSupervisorIdList.join(',') componentData.regionSupervisorId = componentData.regionSupervisorIdList.join(',')
......
...@@ -349,6 +349,12 @@ export default { ...@@ -349,6 +349,12 @@ export default {
businessCode, businessCode,
submitFlag: 1 submitFlag: 1
} }
delete trafficPartyDetails.areaOpIdList
delete trafficPartyDetails.onlineOpIdList
delete trafficPartyDetails.regionSupervisorIdList
delete trafficPartyDetails.areaOpName
delete trafficPartyDetails.onlineOpName
delete trafficPartyDetails.regionSupervisorName
trafficPartyDetails.productDetails = productDetails trafficPartyDetails.productDetails = productDetails
parmas.trafficPartyDetails = [trafficPartyDetails] parmas.trafficPartyDetails = [trafficPartyDetails]
console.log(parmas) console.log(parmas)
......
...@@ -169,6 +169,12 @@ import classificationCpt from "./components/classificationCpt.vue" ...@@ -169,6 +169,12 @@ import classificationCpt from "./components/classificationCpt.vue"
import merchantTestDialog from "./components/merchantTestDialog" import merchantTestDialog from "./components/merchantTestDialog"
import { computeCalculateModeConflicts } from "./utils/calculateModeConflict" import { computeCalculateModeConflicts } from "./utils/calculateModeConflict"
import { resolveBaseSceneCodeFromRouter } from "@/common/sceneBaseSceneCode" import { resolveBaseSceneCodeFromRouter } from "@/common/sceneBaseSceneCode"
import { getBaseSceneCodeList } from "@api/productManage"
import {
normalizeBaseSceneListResponse,
pickSceneLookupCode,
getSceneDisplayNameFromList
} from "../merchantGroundingEdit/merchantDetailMap"
import { import {
getAllGoodsListPage as getAllGoodsList, getAllGoodsListPage as getAllGoodsList,
merchantPackageGoodsInfoPage merchantPackageGoodsInfoPage
...@@ -216,6 +222,8 @@ export default { ...@@ -216,6 +222,8 @@ export default {
rulesTestParams: {}, rulesTestParams: {},
goodsTypeGroupRelations: [], goodsTypeGroupRelations: [],
classificationObj: {}, classificationObj: {},
/** 业务场景名称:按 baseSceneCode 与 getBaseSceneCodeList 解析 */
baseSceneList: [],
sceneList: Object.freeze(sceneList), sceneList: Object.freeze(sceneList),
editableTabsValue: "1", editableTabsValue: "1",
currentIndex: 1, currentIndex: 1,
...@@ -366,10 +374,21 @@ export default { ...@@ -366,10 +374,21 @@ export default {
sceneLabel() { sceneLabel() {
const name = this.routerInfo.baseSceneName const name = this.routerInfo.baseSceneName
if (name != null && String(name).trim() !== "") return String(name).trim() if (name != null && String(name).trim() !== "") return String(name).trim()
let code = pickSceneLookupCode(this.routerInfo)
if (code === "") {
const sc = this.routerInfo.scene
if (sc != null && sc !== "") {
code = String(resolveBaseSceneCodeFromRouter(this.routerInfo))
}
}
if (code !== "") {
const fromList = getSceneDisplayNameFromList(code, this.baseSceneList)
if (fromList !== "") return fromList
}
const scene = this.routerInfo.scene const scene = this.routerInfo.scene
if (scene == null || scene === "") return "—" if (scene == null || scene === "") return "—"
const label = this.sceneList[scene] const legacy = this.sceneList[scene]
return label != null && label !== "" ? label : "—" return legacy != null && legacy !== "" ? legacy : "—"
}, },
/** /**
* 路由参数缺少或 merchantName 为空时避免模板展示 undefined(与 sceneLabel 兜底一致) * 路由参数缺少或 merchantName 为空时避免模板展示 undefined(与 sceneLabel 兜底一致)
...@@ -469,6 +488,7 @@ export default { ...@@ -469,6 +488,7 @@ export default {
} }
}, },
mounted() { mounted() {
void this.fetchBaseSceneListForLabel()
this.initFinancialObj() // 先默认初始化平台方和流量方 this.initFinancialObj() // 先默认初始化平台方和流量方
this.initDjzhySubMerchant() // 初始化嘀加智慧云子商户 this.initDjzhySubMerchant() // 初始化嘀加智慧云子商户
// this.getFinancialObj() // this.getFinancialObj()
...@@ -492,6 +512,15 @@ export default { ...@@ -492,6 +512,15 @@ export default {
}) })
}, },
methods: { methods: {
async fetchBaseSceneListForLabel() {
try {
const res = await getBaseSceneCodeList({})
this.baseSceneList = normalizeBaseSceneListResponse(res)
} catch (e) {
console.warn("[FinancialRules] fetchBaseSceneListForLabel", e)
this.baseSceneList = []
}
},
/** /**
* 安全获取 classificationCpt 子组件实例(单实例 ref="classificationActive")。 * 安全获取 classificationCpt 子组件实例(单实例 ref="classificationActive")。
* 非当前激活 tab 无挂载实例,返回 undefined(与原先 v-for 虚拟 Tab 语义一致)。 * 非当前激活 tab 无挂载实例,返回 undefined(与原先 v-for 虚拟 Tab 语义一致)。
......
...@@ -51,6 +51,22 @@ export function resolveSceneName(code, baseSceneList = []) { ...@@ -51,6 +51,22 @@ export function resolveSceneName(code, baseSceneList = []) {
return codeStr; return codeStr;
} }
/**
* 仅当场景列表中存在对应 baseSceneCode(及相关别名字段)时返回展示名;未命中返回空串。
* 供头部「业务场景」等按 baseSceneCode 回显,避免无列表数据时把纯数字编码当作名称展示。
*/
export function getSceneDisplayNameFromList(code, baseSceneList = []) {
if (code == null || code === "") return "";
const codeStr = String(code).trim();
if (!codeStr) return "";
const hit = baseSceneList.find((row) =>
sceneRowMatchCodes(row).includes(codeStr)
);
if (!hit) return "";
const n = hit.name ?? hit.sceneName ?? hit.label ?? hit.confLabel;
return n != null && String(n).trim() !== "" ? String(n).trim() : "";
}
export function storeProfitPerCar(mi) { export function storeProfitPerCar(mi) {
const d = mi?.deliveryCount; const d = mi?.deliveryCount;
const r = mi?.estimatedRevenue ?? mi?.revenue; const r = mi?.estimatedRevenue ?? mi?.revenue;
......
...@@ -108,6 +108,12 @@ import { getGoodsCategoryConfiguration } from "@/api/sys.base.js" ...@@ -108,6 +108,12 @@ import { getGoodsCategoryConfiguration } from "@/api/sys.base.js"
import classificationCpt from "./components/classificationCpt.vue" import classificationCpt from "./components/classificationCpt.vue"
import verificationCodeDialog from "../financialRules/components/verificationCodeDialog" import verificationCodeDialog from "../financialRules/components/verificationCodeDialog"
import { resolveBaseSceneCodeFromRouter } from "@/common/sceneBaseSceneCode" import { resolveBaseSceneCodeFromRouter } from "@/common/sceneBaseSceneCode"
import { getBaseSceneCodeList } from "@api/productManage"
import {
normalizeBaseSceneListResponse,
pickSceneLookupCode,
getSceneDisplayNameFromList
} from "../merchantGroundingEdit/merchantDetailMap"
import { import {
getAllGoodsListPage as getAllGoodsList, getAllGoodsListPage as getAllGoodsList,
merchantPackageGoodsInfoPage merchantPackageGoodsInfoPage
...@@ -167,6 +173,8 @@ export default { ...@@ -167,6 +173,8 @@ export default {
return { return {
effectStartDateDate: "", effectStartDateDate: "",
effectStartDate: false, // 规则时间 true 表示可以立即生效 是否立即生效 effectStartDate: false, // 规则时间 true 表示可以立即生效 是否立即生效
/** 业务场景展示:按 baseSceneCode + getBaseSceneCodeList */
baseSceneList: [],
sceneList, sceneList,
verificationCodeVisible: false, verificationCodeVisible: false,
smsCode: "", smsCode: "",
...@@ -246,10 +254,21 @@ export default { ...@@ -246,10 +254,21 @@ export default {
) )
return i === -1 ? 0 : i return i === -1 ? 0 : i
}, },
/** A1:避免模板每次渲染调用方法;scene 缺失时安全展示 */ /** A1:避免模板每次渲染调用方法;按 baseSceneCode 与场景列表回显,缺失时兜底 scene 枚举 */
sceneLabel() { sceneLabel() {
const name = this.merchantRow?.baseSceneName const name = this.merchantRow?.baseSceneName
if (name != null && String(name).trim() !== "") return String(name).trim() if (name != null && String(name).trim() !== "") return String(name).trim()
let code = pickSceneLookupCode(this.merchantRow)
if (code === "") {
const sc = this.merchantRow?.scene
if (sc != null && sc !== "") {
code = String(resolveBaseSceneCodeFromRouter(this.merchantRow))
}
}
if (code !== "") {
const fromList = getSceneDisplayNameFromList(code, this.baseSceneList)
if (fromList !== "") return fromList
}
const key = this.merchantRow?.scene const key = this.merchantRow?.scene
if (key == null || key === "") return "-" if (key == null || key === "") return "-"
const label = this.sceneList[key] const label = this.sceneList[key]
...@@ -292,6 +311,7 @@ export default { ...@@ -292,6 +311,7 @@ export default {
}, },
created() { created() {
this.getRowItem() this.getRowItem()
void this.fetchBaseSceneListForLabel()
// A4:异步方法,不 await,与 mounted 数据加载并行;内部已 try/catch 三路费用接口 // A4:异步方法,不 await,与 mounted 数据加载并行;内部已 try/catch 三路费用接口
void this.getQueryFeeCategoryByType() void this.getQueryFeeCategoryByType()
}, },
...@@ -336,6 +356,15 @@ export default { ...@@ -336,6 +356,15 @@ export default {
} }
}, },
methods: { methods: {
async fetchBaseSceneListForLabel() {
try {
const res = await getBaseSceneCodeList({})
this.baseSceneList = normalizeBaseSceneListResponse(res)
} catch (e) {
console.warn("[MerchantCheck] fetchBaseSceneListForLabel", e)
this.baseSceneList = []
}
},
/** /**
* 安全获取 classificationCpt 子组件实例(单实例 ref="classificationActive")。 * 安全获取 classificationCpt 子组件实例(单实例 ref="classificationActive")。
* 非当前激活 tab 无挂载实例,返回 undefined(与原先虚拟 Tab 语义一致)。 * 非当前激活 tab 无挂载实例,返回 undefined(与原先虚拟 Tab 语义一致)。
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!