修改bug
This commit is contained in:
parent
17d374a3f0
commit
5829bd1890
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -313,9 +313,27 @@ export default {
|
||||||
}, `客户统计数据_${new Date().getTime()}.xlsx`)
|
}, `客户统计数据_${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}');
|
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(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue