Commit 0b3225e3 by 张立顺

feat 功能联调

1 parent a8d33194
...@@ -398,9 +398,9 @@ export function getMerchantRelationDetailApi(data) { ...@@ -398,9 +398,9 @@ export function getMerchantRelationDetailApi(data) {
return request(data, "post"); return request(data, "post");
} }
/** 商户上架编辑页详情(merchantId + baseSceneCode) */ /** 商户上架编辑页详情(merchantId + baseSceneCode)→ scenemerchantref */
export function queryMerchantDetail(data) { export function queryMerchantDetail(data) {
data.method = `${path}servicemerchantref.queryMerchantDetail`; data.method = `${path}scenemerchantref.queryMerchantDetail`;
return request(data, RequestMethods.POST); return request(data, RequestMethods.POST);
} }
......
...@@ -94,14 +94,8 @@ export default { ...@@ -94,14 +94,8 @@ export default {
}; };
}, },
computed: { computed: {
productRows() {
return (this.productDetails || []).map(p => ({
...p,
revenue: p.estimatedRevenue != null ? p.estimatedRevenue : (p.revenue || 0),
}));
},
djGrossProfit() { djGrossProfit() {
const { componentData, productRows } = this; const { componentData, productDetails } = this;
const { personnelCost, rentCost, depreciationCost, otherCost } = componentData; const { personnelCost, rentCost, depreciationCost, otherCost } = componentData;
let sum = 0; let sum = 0;
let revenue = 0; let revenue = 0;
...@@ -113,7 +107,7 @@ export default { ...@@ -113,7 +107,7 @@ export default {
let resourceFee = 0; let resourceFee = 0;
let productCost = 0; let productCost = 0;
let recyclingFilm = 0; let recyclingFilm = 0;
productRows.forEach((item) => { (productDetails || []).forEach((item) => {
revenue = NP.plus(revenue, item.revenue || 0); revenue = NP.plus(revenue, item.revenue || 0);
trafficFee = NP.plus(trafficFee, item.trafficFee || 0); trafficFee = NP.plus(trafficFee, item.trafficFee || 0);
marketFee1 = NP.plus(marketFee1, item.marketFee1 || 0); marketFee1 = NP.plus(marketFee1, item.marketFee1 || 0);
...@@ -145,7 +139,7 @@ export default { ...@@ -145,7 +139,7 @@ export default {
}, },
djGpr() { djGpr() {
let revenue = 0; let revenue = 0;
this.productRows.forEach((item) => { (this.productDetails || []).forEach((item) => {
revenue = NP.plus(revenue, item.revenue || 0); revenue = NP.plus(revenue, item.revenue || 0);
}); });
if (revenue === 0) return "0.00%"; if (revenue === 0) return "0.00%";
......
<template> <template>
<div class="mg-sales-category"> <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-select v-model="productKey" class="product-select" filterable placeholder="请选择销售品类">
<el-option <el-option
v-for="(item, idx) in products" v-for="(item, idx) in products"
...@@ -10,7 +11,7 @@ ...@@ -10,7 +11,7 @@
/> />
</el-select> </el-select>
</div> </div>
<div v-if="currentProduct"> <div v-if="currentProduct" class="sales-detail">
<div v-for="(block, bIndex) in blocks" :key="bIndex" class="block"> <div v-for="(block, bIndex) in blocks" :key="bIndex" class="block">
<div class="sub-title">{{ block.title }}</div> <div class="sub-title">{{ block.title }}</div>
<div class="block-content"> <div class="block-content">
...@@ -61,20 +62,20 @@ export default { ...@@ -61,20 +62,20 @@ export default {
}, },
}, },
methods: { methods: {
/** 与 StepTwo 下拉 value 一致:productType + '+' + productCategory */
productValueKey(item) { 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) { optionLabel(item) {
const t = item.productType || "-"; if (!item) return "";
const c = item.productCategory || "-"; return String(item.productType ?? "") + "+" + String(item.productCategory ?? "");
return `${t} + ${c}`;
}, },
/** 与 SalesCategory.vue 展示一致:仅 null / undefined 显示为 - */
formatField(row, field) { formatField(row, field) {
if (field.key === "feeSettlementMode") {
return row[field.key] != null && row[field.key] !== "" ? row[field.key] : "-";
}
const v = 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}`; return field.unit ? `${v}${field.unit}` : `${v}`;
}, },
}, },
...@@ -83,14 +84,38 @@ export default { ...@@ -83,14 +84,38 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.mg-sales-category { .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 { .product-select {
width: 360px; width: 360px;
max-width: 100%;
}
.sales-detail {
padding: 20px;
} }
.sub-title { .sub-title {
height: 32px; height: 32px;
background: #f5f7fa; background: #f5f7fa;
......
/** 销售品类只读区块配置(字段与 ProductDetailDTO 对齐) */ /** 销售品类只读区块:字段 key / label / unit 与 StepTwo SalesCategory(constant.js / SALES_CATEGORY_LIST)一致 */
export const MG_SALES_CATEGORY_LIST = [ export const MG_SALES_CATEGORY_LIST = [
{ {
title: "销售范围", title: "销售范围",
...@@ -19,9 +19,9 @@ export const MG_SALES_CATEGORY_LIST = [ ...@@ -19,9 +19,9 @@ export const MG_SALES_CATEGORY_LIST = [
{ {
title: "预估经营数据", title: "预估经营数据",
list: [ list: [
{ label: "转化率", key: "estimatedConversion", unit: "%" }, { label: "转化率", key: "estimatedConversionRate", unit: "%" },
{ label: "升级客单价", key: "estimatedUpgradePrice" }, { label: "升级客单价", key: "upgradePrice" },
{ label: "产值", key: "estimatedRevenue" }, { label: "产值", key: "revenue" },
], ],
}, },
{ {
...@@ -39,7 +39,7 @@ export const MG_SALES_CATEGORY_LIST = [ ...@@ -39,7 +39,7 @@ export const MG_SALES_CATEGORY_LIST = [
title: "预估运营成本", title: "预估运营成本",
list: [ list: [
{ label: "产品成本", key: "productCost" }, { label: "产品成本", key: "productCost" },
{ label: "原厂膜回收", key: "recyclingFilm" }, { label: "原厂回收膜", key: "recyclingFilm" },
], ],
}, },
]; ];
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<auth-button v-if="isRelationEnabled(scope.scope)" slot="auth-button" :data="scope.scope" <auth-button v-if="isRelationEnabled(scope.scope)" slot="auth-button" :data="scope.scope"
:show-btn-ids="['90603017']" /> :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="['9060301']" />
<!-- 对账 --> <!-- 对账 -->
<auth-button slot="auth-button" :data="scope.scope" :show-btn-ids="['9060308']" /> <auth-button slot="auth-button" :data="scope.scope" :show-btn-ids="['9060308']" />
...@@ -700,6 +700,10 @@ export default { ...@@ -700,6 +700,10 @@ export default {
const c = row.baseSceneCode; const c = row.baseSceneCode;
return c != null && c !== "" ? c : ""; return c != null && c !== "" ? c : "";
}, },
/** 二手车收车场景 baseSceneCode=120101,不展示财务/对账 */
isUsedCarCollectionBaseScene(row) {
return String(this.resolveRowBaseSceneCode(row)) === "120101";
},
rowHasScene(row) { rowHasScene(row) {
return !this.filterEmpty(row.scene) return !this.filterEmpty(row.scene)
|| (row.baseSceneCode != null && row.baseSceneCode !== ""); || (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!