修改bug
This commit is contained in:
parent
17d374a3f0
commit
5829bd1890
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,8 +314,26 @@ export default {
|
|||
},
|
||||
/** 处理成本更新 */
|
||||
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(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue