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