Commit c09200d6 by 张立顺

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 b3279b25 fcb54e2d
......@@ -26,12 +26,6 @@
<el-radio label="2">
流量方
</el-radio>
<!-- <el-radio label="7">
服务商
</el-radio>
<el-radio label="6" v-if="yqCheckVisible">
园区店
</el-radio> -->
</el-radio-group>
</el-form-item>
<el-form-item label="对账商户:" prop="merchant">
......@@ -147,7 +141,6 @@ import { localTmplList } from "./constant/baseData";
export default {
name: "DownloadAccountDialog",
components: {},
props: {
accountVisible: {
type: Boolean,
......@@ -278,16 +271,6 @@ export default {
confId: false,
confLabel: "否",
}],
// payeeTypeList: [{
// confId: 'all',
// confLabel: '全部'
// }, {
// confId: '0',
// confLabel: '嘀加收款'
// }, {
// confId: '1',
// confLabel: '门店收款'
// }],
merchantList: [],
// 流量方对账单
trafficTemplateList: [],
......@@ -313,9 +296,7 @@ export default {
},
mounted() {
// console.log(this.scene)
this.$EventBus.$on("changeFieldIds", (obj) => {
console.log(obj, "obj---");
this.tmplSelectList = obj?.fieldIds || [];
this.infoForm.fieldsTxt = this.getFieldsTxt();
this.getMetaTmpl();
......@@ -413,7 +394,6 @@ export default {
},
getFieldsTxt() {
let fieldNames = "";
const tmplName = this.localTmplList.find(item => item.type == this.infoForm.tmplType)?.name || "trafficTmpl";
console.log(tmplName, "tmplName---");
let list = JSON.parse(localStorage.getItem(tmplName));
......
......@@ -4,12 +4,10 @@
<div slot="header"
class="header"
style="background: #e7eaec">
<!-- @tab-click="tabClick" -->
<el-tabs v-model="searchForm.sceneType">
<el-tab-pane :label="newSceneList['0']" name="0" />
<el-tab-pane :label="newSceneList['1']" name="1" />
</el-tabs>
<!-- <el-card class="finance_list_summary" :body-style="{ padding: 0 }" v-show="sunmmaryVisible"> -->
<!-- 汇总模块暂不显示 -->
<el-card v-show="false"
class="finance_list_summary"
......@@ -173,7 +171,6 @@
<span class="downloadBtn">
<auth-button :show-btn-ids="['9050104']" category="Button" />
</span>
<!-- <span style="position: absolute; right: 41px; top: 42px; z-index: 999;"> -->
<span class="downloadBtn">
<!-- <el-button type="primary"
size="mini"
......@@ -966,7 +963,6 @@ export default {
},
"searchForm.sceneType": {
handler(val) {
// console.log('searchForm.sceneType', val)
if (val == 0 || val == 4) {
/**
1.0场景(暂无业务支撑)
......@@ -1246,7 +1242,6 @@ export default {
...params,
};
// const apiName = this.userInfo.beSuper ? 'getList' : 'getYqList'
// console.log(params)
// api[apiName](params).then(res => {
this.tableData = [];
......@@ -1285,7 +1280,6 @@ export default {
item = this.numAddPrefix(item);
return item;
});
// console.log(this.tableData)
this.page.currentPage = res.pageNum;
this.page.pageSize = res.pageSize;
this.total = res.total;
......@@ -1407,9 +1401,11 @@ export default {
}
if (Array.isArray(this.searchForm.baseSceneCodeList) && this.searchForm.baseSceneCodeList.length) {
const selected = this.searchForm.baseSceneCodeList;
// “全部”= 不传;否则保持数组类型传给后端
// “全部”= 不传;否则按后端需要解构成 baseSceneCodeList[0]=xxx
if (!selected.includes("")) {
params.baseSceneCodeList = selected;
selected.forEach((code, index) => {
params[`baseSceneCodeList[${index}]`] = code;
});
}
}
if (this.searchForm.sceneType) {
......@@ -1421,7 +1417,6 @@ export default {
return params;
},
getTotal() {
console.log(this.getParams());
api.getListTotal(this.getParams()).then((res) => {
this.totalObj = res;
});
......@@ -1459,7 +1454,6 @@ export default {
// 自定义模版字段
handleCustTmpl(val) {
console.log(val, "val---");
this.tmplInfo.type = val.tmplType;
this.tmplInfo.tmplSelectList = val.tmplSelectList || [];
this.handleCustVisible();
......
......@@ -35,7 +35,7 @@
<template v-else>
<el-input
v-model="componentData[i.key]"
@input="filterInputVal(i,$event,'data')"
@input="filterInputVal(i,$event,'componentData')"
:maxlength="i.maxlength || -1"
></el-input>
</template>
......@@ -131,9 +131,30 @@ export default {
productDetails.forEach(item => {
revenue = NP.plus(revenue, item.revenue || 0)
})
if (revenue === 0) return '0.00%'
const gpr = NP.times(NP.divide(djGrossProfit, revenue), 100)
return NP.round(gpr, 2) + '%'
// 检查边界情况
if (revenue === 0 || !isFinite(revenue)) return '0.00%'
if (!isFinite(djGrossProfit)) return '0.00%'
try {
// 使用原生除法,然后手动控制精度
const division = djGrossProfit / revenue
// 检查结果是否有效
if (!isFinite(division)) return '0.00%'
// 转换为百分比并保留2位小数(四舍五入)
const percentage = division * 100
const roundedPercentage = Math.round(percentage * 100) / 100
// 最终检查
if (!isFinite(roundedPercentage)) return '0.00%'
return roundedPercentage.toFixed(2) + '%'
} catch (error) {
console.error('毛利率计算错误:', error)
return '0.00%'
}
}
},
data () {
......@@ -144,7 +165,7 @@ export default {
{ label: '嘀加毛利率', key: 'djGpr', type: 'text' },
],
businessInformation: [
{ label: '预估交付数/月', key: 'deliveryCount', filterRule: 'integerRange', min: 0, max: 999999, maxlength: 6 },
{ label: '预估交付数/月', key: 'deliveryCount', filterRule: 'integerRange', min: 0, max: 999999 },
{ 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 },
......
......@@ -246,7 +246,7 @@ export default {
if (!value || !i?.options?.length) return '-'
const option = i.options.find(item => item.value === value)
return option?.label || value || '-'
return option?.label || (i.viewKey && this.componentData[i.viewKey]) || value || '-'
},
getMultipleSelectText (i) {
const values = this.componentData[i.key]
......
......@@ -15,6 +15,11 @@ export default {
// 只保留数字
let filtered = (val || '').replace(/\D/g, '');
// 去除前导零(但保留单独的0)
if (filtered.length > 1) {
filtered = filtered.replace(/^0+/, '');
}
// 转换为数字进行范围检查
const numValue = parseInt(filtered, 10);
......@@ -32,10 +37,23 @@ export default {
if (parts.length > 2) {
filtered = parts[0] + '.' + parts.slice(1).join('');
}
// 重新分割,确保处理正确
const newParts = filtered.split('.');
// 去除整数部分的前导零(但保留单独的0或小数点前的0)
if (newParts[0].length > 1) {
newParts[0] = newParts[0].replace(/^0+/, '');
}
// 限制小数位数
if (parts.length === 2 && parts[1].length > i.precision) {
filtered = parts[0] + '.' + parts[1].substring(0, i.precision);
if (newParts.length === 2 && newParts[1].length > i.precision) {
newParts[1] = newParts[1].substring(0, i.precision);
}
// 重新组合
filtered = newParts.join('.');
// 转换为数字进行范围检查
const numValue = parseFloat(filtered);
// 如果超出最大值,限制为最大值
......@@ -46,7 +64,6 @@ export default {
filtered = String(i.max);
}
}
this.$set(this[keyName], i.key, filtered);
}
}
......
......@@ -54,7 +54,6 @@
</template>
<script>
// import { getList } from "@api/serviceManage";
import { disableScene, enableScene, getList, getSceneTags } from "@api/senseManage";
import { mapActions } from "vuex";
import { procureModeList } from "@/common/constants";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!