Commit cb011310 by 张立顺

fix bug

1 parent 4bde7b64
Showing 17 changed files with 31 additions and 106 deletions
......@@ -146,7 +146,7 @@ import { qyMerchantPageList } from '@/api/salesManagement.js'
import {
normalizeStaffIdListFromMi,
parseOtherServiceProvidersFromMi,
} from '@/views/systemConfig/merchant/merchantGroundingEdit/merchantDetailMap'
} from '@/views/systemConfig/merchant/merchantGroundingEdit/utils/merchantDetailMap'
import { baseConfig } from "@/main";
export default {
......
......@@ -176,7 +176,7 @@ import {
normalizeBaseSceneListResponse,
pickSceneLookupCode,
getSceneDisplayNameFromList
} from "../merchantGroundingEdit/merchantDetailMap"
} from "../merchantGroundingEdit/utils/merchantDetailMap"
import {
getAllGoodsListPage as getAllGoodsList,
merchantPackageGoodsInfoPage
......
......@@ -16,8 +16,7 @@
</div>
<div class="section">
<div class="section-title">经营信息</div>
<mg-business-section ref="businessRef" :data="businessForm" :product-details="productDetails"
:is-view-mode="true" />
<mg-business-section ref="businessRef" :data="businessForm" :product-details="productDetails" />
</div>
<div class="section section-sales-category">
<div class="section-title section-title-sales-category">
......@@ -54,12 +53,12 @@
import { deepClone } from "@/common/util";
import { merchantOnShelf, queryMerchantDetail } from "@api/merchant";
import { getBaseSceneCodeList } from "@api/productManage";
import MerchantGroundingTrafficProviderInformation from "./MerchantGroundingTrafficProviderInformation.vue";
import MerchantGroundingSalesCategory from "./salesCategoryMerchantGrounding/MerchantGroundingSalesCategory.vue";
import { SALES_CATEGORY_RULES } from "./salesCategoryMerchantGrounding/merchantGroundingSalesCategoryConstants";
import MgBusinessSection from "./MgBusinessSection.vue";
import { buildTrafficProviderData, buildBusinessForm, normalizeBaseSceneListResponse } from "./merchantDetailMap";
import { buildMerchantOnShelfOpenPayload } from "./merchantOnShelfOpenPayload";
import MerchantGroundingTrafficProviderInformation from "./components/MerchantGroundingTrafficProviderInformation.vue";
import MerchantGroundingSalesCategory from "./components/salesCategory/MerchantGroundingSalesCategory.vue";
import { SALES_CATEGORY_RULES } from "./components/salesCategory/merchantGroundingSalesCategoryConstants";
import MgBusinessSection from "./components/MgBusinessSection.vue";
import { buildTrafficProviderData, buildBusinessForm, normalizeBaseSceneListResponse } from "./utils/merchantDetailMap";
import { buildMerchantOnShelfOpenPayload } from "./utils/merchantOnShelfOpenPayload";
export default {
name: "MerchantGroundingEdit",
......
......@@ -16,7 +16,6 @@
<mg-business-section
:data="businessForm"
:product-details="productDetails"
:is-view-mode="true"
/>
</div>
<div class="section section-sales-category">
......@@ -26,9 +25,9 @@
</template>
<script>
import MerchantGroundingTrafficProviderInformation from "./MerchantGroundingTrafficProviderInformation.vue";
import MgBusinessSection from "./MgBusinessSection.vue";
import MgSalesCategorySection from "./MgSalesCategorySection.vue";
import MerchantGroundingTrafficProviderInformation from "./components/MerchantGroundingTrafficProviderInformation.vue";
import MgBusinessSection from "./components/MgBusinessSection.vue";
import MgSalesCategorySection from "./components/MgSalesCategorySection.vue";
export default {
name: "MerchantRelationGroundingReadonly",
......
......@@ -150,7 +150,7 @@ import { qyMerchantPageList } from '@/api/salesManagement.js'
import {
normalizeStaffIdListFromMi,
parseOtherServiceProvidersFromMi,
} from './merchantDetailMap'
} from '../utils/merchantDetailMap'
import { baseConfig } from "@/main";
export default {
......
......@@ -5,7 +5,6 @@
label-width="155px"
:model="componentData"
size="small"
:rules="rules"
>
<div class="business-information-content">
<template v-for="(i, index) in fixedInfo">
......@@ -22,21 +21,11 @@
:key="`biz-${index}`"
class="business-information-item"
:label="i.label + ':'"
:prop="isViewMode ? '' : i.key"
>
<template v-if="isViewMode">
<template v-if="componentData[i.key] != null && componentData[i.key] !== ''">
{{ componentData[i.key] }}<template v-if="i.unit">{{ i.unit }}</template>
</template>
<template v-else>-</template>
</template>
<template v-else>
<el-input
v-model="componentData[i.key]"
:maxlength="i.maxlength || -1"
@input="filterInputVal(i, $event, 'componentData')"
/>
<template v-if="componentData[i.key] != null && componentData[i.key] !== ''">
{{ componentData[i.key] }}<template v-if="i.unit">{{ i.unit }}</template>
</template>
<template v-else>-</template>
</el-form-item>
</template>
</div>
......@@ -47,11 +36,9 @@
<script>
import { deepClone } from "@/common/util";
import NP from "number-precision";
import mgInputMixin from "./mgInputMixin";
export default {
name: "MgBusinessSection",
mixins: [mgInputMixin],
props: {
data: {
type: Object,
......@@ -61,10 +48,6 @@ export default {
type: Array,
default: () => [],
},
isViewMode: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -74,23 +57,14 @@ export default {
{ label: "嘀加毛利率", key: "djGpr", type: "text" },
],
businessInformation: [
{ label: "预估交付数/月", key: "deliveryCount", filterRule: "integerRange", min: 0, max: 999999, maxlength: 6 },
{ label: "预估触客率", key: "customerTouchRate", unit: "%", filterRule: "decimalRange", min: 0, max: 100, precision: 2 },
{ label: "人员成本", key: "personnelCost", filterRule: "decimalRange", min: 0, max: 999999, precision: 2 },
{ label: "房租", key: "rentCost", filterRule: "decimalRange", min: 0, max: 999999, precision: 2 },
{ label: "折旧与摊销", key: "depreciationCost", filterRule: "decimalRange", min: 0, max: 999999, precision: 2 },
{ label: "其他(水电、耗材等)", key: "otherCost", filterRule: "decimalRange", min: 0, max: 999999, precision: 2 },
{ label: "门店单台利润额", key: "storeProfitPerCar", filterRule: "decimalRange", min: 0, max: 999999, precision: 2 },
{ label: "预估交付数/月", key: "deliveryCount" },
{ label: "预估触客率", key: "customerTouchRate", unit: "%" },
{ label: "人员成本", key: "personnelCost" },
{ label: "房租", key: "rentCost" },
{ label: "折旧与摊销", key: "depreciationCost" },
{ label: "其他(水电、耗材等)", key: "otherCost" },
{ label: "门店单台利润额", key: "storeProfitPerCar" },
],
rules: {
deliveryCount: [{ required: true, message: "请输入预估交付数/月", trigger: "blur" }],
customerTouchRate: [{ required: true, message: "请输入预估触客率", trigger: "blur" }],
personnelCost: [{ required: true, message: "请输入人员成本", trigger: "blur" }],
rentCost: [{ required: true, message: "请输入房租", trigger: "blur" }],
depreciationCost: [{ required: true, message: "请输入折旧与摊销", trigger: "blur" }],
otherCost: [{ required: true, message: "请输入其他(水电、耗材等)", trigger: "blur" }],
storeProfitPerCar: [{ required: true, message: "请输入门店单台利润额", trigger: "blur" }],
},
};
},
computed: {
......@@ -166,12 +140,7 @@ export default {
return { ...this.componentData };
},
validate() {
if (this.isViewMode) {
return Promise.resolve(true);
}
return new Promise((resolve) => {
this.$refs.formRef.validate(valid => resolve(valid));
});
return Promise.resolve(true);
},
},
};
......
......@@ -26,7 +26,7 @@
</template>
<script>
import { MG_SALES_CATEGORY_LIST } from "./mgSalesConstants";
import { MG_SALES_CATEGORY_LIST } from "./salesCategory/mgSalesConstants";
/** 接口历史字段 → 与新 key 等价,便于只读展示回退 */
const MG_FIELD_LEGACY_READ = {
......
export default {
methods: {
filterInputVal(i, val, keyName) {
if (!i.filterRule) return;
if (i.filterRule === "integerRange") {
let filtered = (val || "").replace(/\D/g, "");
const numValue = Number.parseInt(filtered, 10);
if (!Number.isNaN(numValue) && numValue > i.max) {
filtered = String(i.max);
}
this.$set(this[keyName], i.key, filtered);
} else if (i.filterRule === "decimalRange") {
let filtered = (val || "").replace(/[^\d.]/g, "");
const parts = filtered.split(".");
if (parts.length > 2) {
filtered = parts[0] + "." + parts.slice(1).join("");
}
if (parts.length === 2 && parts[1].length > i.precision) {
filtered = parts[0] + "." + parts[1].substring(0, i.precision);
}
const numValue = Number.parseFloat(filtered);
if (!Number.isNaN(numValue)) {
if (numValue < i.min) {
filtered = String(i.min);
} else if (numValue > i.max) {
filtered = String(i.max);
}
}
this.$set(this[keyName], i.key, filtered);
}
},
},
};
import NP from "number-precision";
export function joinIds(mi, listKey, strKey) {
const list = mi[listKey];
const str = mi[strKey];
if (str != null && str !== "") return String(str);
if (Array.isArray(list) && list.length) return list.join(",");
return "";
}
/** 详情/历史接口人员 ID、姓名字段大小写不一致时的兜底读取 */
function pickStr(mi, ...keys) {
if (!mi || typeof mi !== "object") return "";
......
......@@ -2,7 +2,7 @@ import NP from "number-precision";
import { resolveSceneTypeFromBaseSceneFilterList } from "./merchantDetailMap";
/** 与 MgBusinessSection 中嘀加毛利/毛利率/产值合计一致 */
export function computeDjMetrics(componentData, productDetails) {
function computeDjMetrics(componentData, productDetails) {
const pd = productDetails || [];
const { personnelCost, rentCost, depreciationCost, otherCost } = componentData || {};
let revenue = 0;
......
......@@ -223,7 +223,7 @@ import warrantyCardDialog from "./components/warrantyCardDialog";
import financialRulesDetail from "./financialRulesDetail";
// import _ from "lodash"
import viewDetail from "./viewDetail";
import { normalizeBaseSceneListResponse } from "./merchantGroundingEdit/merchantDetailMap";
import { normalizeBaseSceneListResponse } from "./merchantGroundingEdit/utils/merchantDetailMap";
export default {
name: "MerchantManage",
......@@ -1173,7 +1173,7 @@ export default {
// 禁用
handleDisable(row) {
this.$confirm(
"禁用将重置财务规则与对账规则,关联关系仍保留在列表中且状态为禁用。是否确认禁用?",
"禁用后商户关系不可用,是否确定禁用?",
"提示",
{
confirmButtonText: "确定",
......
......@@ -113,7 +113,7 @@ import {
normalizeBaseSceneListResponse,
pickSceneLookupCode,
getSceneDisplayNameFromList
} from "../merchantGroundingEdit/merchantDetailMap"
} from "../merchantGroundingEdit/utils/merchantDetailMap"
// 具体商品/套餐分页列表:grounding 内 getAllGoodsListPage、merchantPackageGoodsInfoPage 已 skipGlobalLoading,避免整屏转圈
import {
getAllGoodsListPage as getAllGoodsList,
......
......@@ -45,7 +45,7 @@
import ledgerAccount from './components/ledgerAccount.vue'
import reconciliation from './components/reconciliation.vue'
import MerchantRelationGroundingReadonly from '../merchantGroundingEdit/MerchantRelationGroundingReadonly.vue'
import { buildTrafficProviderData, buildBusinessForm, normalizeBaseSceneListResponse } from '../merchantGroundingEdit/merchantDetailMap'
import { buildTrafficProviderData, buildBusinessForm, normalizeBaseSceneListResponse } from '../merchantGroundingEdit/utils/merchantDetailMap'
import {
getDistributeRuleApi,
getEffectRuleApi,
......
......@@ -99,7 +99,7 @@ import { getHistoryRecord } from "@api/publicAccount"
import ledgerAccount from "./components/ledgerAccount.vue"
import reconciliation from "./components/reconciliation.vue"
import MerchantRelationGroundingReadonly from '../merchantGroundingEdit/MerchantRelationGroundingReadonly.vue'
import { buildTrafficProviderData, buildBusinessForm, normalizeBaseSceneListResponse, pickSceneLookupCode } from '../merchantGroundingEdit/merchantDetailMap'
import { buildTrafficProviderData, buildBusinessForm, normalizeBaseSceneListResponse, pickSceneLookupCode } from '../merchantGroundingEdit/utils/merchantDetailMap'
import {
getLedgerHistoryRecordApi,
getReconciliationHistoryRecordApi,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!