修改bug

This commit is contained in:
MerCry 2026-02-08 16:37:39 +08:00
parent 17d374a3f0
commit 5829bd1890
2 changed files with 28 additions and 8 deletions

View File

@ -92,7 +92,9 @@ public class DepartmentStatisticsDataController extends BaseController {
if(totalIns.equals(BigDecimal.ZERO)) {
map.put("penetrationRate",null);
} else {
map.put("penetrationRate",totalOrders.multiply(new BigDecimal(100)).divide(totalIns).setScale(2, RoundingMode.HALF_UP));
map.put("penetrationRate",totalOrders.multiply(new BigDecimal(100))
.divide(totalIns,2, RoundingMode.HALF_UP)
.setScale(2, RoundingMode.HALF_UP));
}
return success(map);
}

View File

@ -313,9 +313,27 @@ export default {
}, `客户统计数据_${new Date().getTime()}.xlsx`)
},
/** 处理成本更新 */
handleUpdateCost(date,cost,attr) {
handleUpdateCost(date, cost, attr) {
// cost
if (cost === '' || cost === null || cost === undefined) {
this.$modal.msgWarning("请输入成本金额");
return;
}
const numCost = Number(cost);
if (isNaN(numCost)) {
this.$modal.msgWarning("成本金额必须为数字");
return;
}
// :
if (numCost < 0) {
this.$modal.msgWarning("成本金额不能为负数");
return;
}
const formattedDate = this.parseTime(date, '{y}-{m}-{d}');
updateCustomerStatistics(formattedDate,cost,attr).then(response => {
updateCustomerStatistics(formattedDate, numCost, attr).then(response => {
this.$modal.msgSuccess("修改成功");
this.getList();
}).catch(() => {