Commit 0b3225e3 by 张立顺

feat 功能联调

1 parent a8d33194
......@@ -398,9 +398,9 @@ export function getMerchantRelationDetailApi(data) {
return request(data, "post");
}
/** 商户上架编辑页详情(merchantId + baseSceneCode) */
/** 商户上架编辑页详情(merchantId + baseSceneCode)→ scenemerchantref */
export function queryMerchantDetail(data) {
data.method = `${path}servicemerchantref.queryMerchantDetail`;
data.method = `${path}scenemerchantref.queryMerchantDetail`;
return request(data, RequestMethods.POST);
}
......
<!-- eslint-disable vue/multi-word-component-names -->
<template>
<d2-container>
<merchant-grounding-edit />
</d2-container>
<d2-container>
<merchant-grounding-edit />
</d2-container>
</template>
<script>
import MerchantGroundingEdit from "./merchantGroundingEdit/MerchantGroundingEdit.vue";
export default {
name: "MerchantGrounding",
components: { MerchantGroundingEdit },
beforeRouteEnter(to, from, next) {
to.meta.title = "商户上架编辑";
next();
},
name: "MerchantGrounding",
components: { MerchantGroundingEdit },
beforeRouteEnter(to, from, next) {
to.meta.title = "商户上架编辑";
next();
},
};
</script>
......@@ -94,14 +94,8 @@ export default {
};
},
computed: {
productRows() {
return (this.productDetails || []).map(p => ({
...p,
revenue: p.estimatedRevenue != null ? p.estimatedRevenue : (p.revenue || 0),
}));
},
djGrossProfit() {
const { componentData, productRows } = this;
const { componentData, productDetails } = this;
const { personnelCost, rentCost, depreciationCost, otherCost } = componentData;
let sum = 0;
let revenue = 0;
......@@ -113,7 +107,7 @@ export default {
let resourceFee = 0;
let productCost = 0;
let recyclingFilm = 0;
productRows.forEach((item) => {
(productDetails || []).forEach((item) => {
revenue = NP.plus(revenue, item.revenue || 0);
trafficFee = NP.plus(trafficFee, item.trafficFee || 0);
marketFee1 = NP.plus(marketFee1, item.marketFee1 || 0);
......@@ -145,7 +139,7 @@ export default {
},
djGpr() {
let revenue = 0;
this.productRows.forEach((item) => {
(this.productDetails || []).forEach((item) => {
revenue = NP.plus(revenue, item.revenue || 0);
});
if (revenue === 0) return "0.00%";
......
<template>
<div class="mg-sales-category">
<div class="sales-toolbar">
<div class="sales-category-toolbar-row">
<span class="sales-category-label">销售品类</span>
<el-select v-model="productKey" class="product-select" filterable placeholder="请选择销售品类">
<el-option
v-for="(item, idx) in products"
......@@ -10,7 +11,7 @@
/>
</el-select>
</div>
<div v-if="currentProduct">
<div v-if="currentProduct" class="sales-detail">
<div v-for="(block, bIndex) in blocks" :key="bIndex" class="block">
<div class="sub-title">{{ block.title }}</div>
<div class="block-content">
......@@ -61,20 +62,20 @@ export default {
},
},
methods: {
/** 与 StepTwo 下拉 value 一致:productType + '+' + productCategory */
productValueKey(item) {
return `${item.productType || ""}+${item.productCategory || ""}`;
if (!item) return "";
return String(item.productType ?? "") + "+" + String(item.productCategory ?? "");
},
/** 与 StepTwo el-option label 一致:productType + '+' + productCategory */
optionLabel(item) {
const t = item.productType || "-";
const c = item.productCategory || "-";
return `${t} + ${c}`;
if (!item) return "";
return String(item.productType ?? "") + "+" + String(item.productCategory ?? "");
},
/** 与 SalesCategory.vue 展示一致:仅 null / undefined 显示为 - */
formatField(row, field) {
if (field.key === "feeSettlementMode") {
return row[field.key] != null && row[field.key] !== "" ? row[field.key] : "-";
}
const v = row[field.key];
if (v === null || v === undefined || v === "") return "-";
if (v == null) return "-";
return field.unit ? `${v}${field.unit}` : `${v}`;
},
},
......@@ -83,14 +84,38 @@ export default {
<style scoped lang="scss">
.mg-sales-category {
padding: 20px;
background: #fff;
}
.sales-toolbar {
margin-bottom: 16px;
/* 设计稿:一行内 粗体标签 + 下拉,上下细分割线 */
.sales-category-toolbar-row {
display: flex;
align-items: center;
gap: 24px;
min-height: 48px;
padding: 8px 20px;
box-sizing: border-box;
border-top: 1px solid #ebeef5;
border-bottom: 1px solid #ebeef5;
background: #fff;
}
.sales-category-label {
flex-shrink: 0;
font-size: 14px;
font-weight: 600;
color: #333333;
}
.product-select {
width: 360px;
max-width: 100%;
}
.sales-detail {
padding: 20px;
}
.sub-title {
height: 32px;
background: #f5f7fa;
......
/** 销售品类只读区块配置(字段与 ProductDetailDTO 对齐) */
/** 销售品类只读区块:字段 key / label / unit 与 StepTwo SalesCategory(constant.js / SALES_CATEGORY_LIST)一致 */
export const MG_SALES_CATEGORY_LIST = [
{
title: "销售范围",
......@@ -19,9 +19,9 @@ export const MG_SALES_CATEGORY_LIST = [
{
title: "预估经营数据",
list: [
{ label: "转化率", key: "estimatedConversion", unit: "%" },
{ label: "升级客单价", key: "estimatedUpgradePrice" },
{ label: "产值", key: "estimatedRevenue" },
{ label: "转化率", key: "estimatedConversionRate", unit: "%" },
{ label: "升级客单价", key: "upgradePrice" },
{ label: "产值", key: "revenue" },
],
},
{
......@@ -39,7 +39,7 @@ export const MG_SALES_CATEGORY_LIST = [
title: "预估运营成本",
list: [
{ label: "产品成本", key: "productCost" },
{ label: "原厂膜回收", key: "recyclingFilm" },
{ label: "原厂回收膜", key: "recyclingFilm" },
],
},
];
......@@ -35,7 +35,7 @@
<auth-button v-if="isRelationEnabled(scope.scope)" slot="auth-button" :data="scope.scope"
:show-btn-ids="['90603017']" />
<!-- 财务 -->
<template v-if="isRelationEnabled(scope.scope) && scope.scope.scene != 7">
<template v-if="isRelationEnabled(scope.scope) && !isUsedCarCollectionBaseScene(scope.scope)">
<auth-button slot="auth-button" :data="scope.scope" :show-btn-ids="['9060301']" />
<!-- 对账 -->
<auth-button slot="auth-button" :data="scope.scope" :show-btn-ids="['9060308']" />
......@@ -700,6 +700,10 @@ export default {
const c = row.baseSceneCode;
return c != null && c !== "" ? c : "";
},
/** 二手车收车场景 baseSceneCode=120101,不展示财务/对账 */
isUsedCarCollectionBaseScene(row) {
return String(this.resolveRowBaseSceneCode(row)) === "120101";
},
rowHasScene(row) {
return !this.filterEmpty(row.scene)
|| (row.baseSceneCode != null && row.baseSceneCode !== "");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!