修改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)) { if(totalIns.equals(BigDecimal.ZERO)) {
map.put("penetrationRate",null); map.put("penetrationRate",null);
} else { } 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); return success(map);
} }

View File

@ -314,8 +314,26 @@ export default {
}, },
/** 处理成本更新 */ /** 处理成本更新 */
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}'); const formattedDate = this.parseTime(date, '{y}-{m}-{d}');
updateCustomerStatistics(formattedDate,cost,attr).then(response => { updateCustomerStatistics(formattedDate, numCost, attr).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.getList(); this.getList();
}).catch(() => { }).catch(() => {