|
@@ -217,9 +217,11 @@ export default {
|
|
|
column.subRequirements.forEach((subr) => {
|
|
|
const key = `${column.name}_${subr.name}`;
|
|
|
const totalVal = calcSum(
|
|
|
- this.dataList.map((item) => item[key].value || 0)
|
|
|
+ this.dataList.map((item) =>
|
|
|
+ item[key].value ? Math.floor(item[key].value * 100) : 0
|
|
|
+ )
|
|
|
);
|
|
|
- if (totalVal < 1) warningColumnIndexs.push(subr.columnIndex);
|
|
|
+ if (totalVal < 100) warningColumnIndexs.push(subr.columnIndex);
|
|
|
});
|
|
|
});
|
|
|
this.warningColumnIndexs = warningColumnIndexs;
|
|
@@ -241,15 +243,17 @@ export default {
|
|
|
async unitChange(row, key, columnIndex) {
|
|
|
const [fieldName, nodeName] = key.split("_");
|
|
|
const totalVal = calcSum(
|
|
|
- this.dataList.map((item) => item[key].value || 0)
|
|
|
+ this.dataList.map((item) =>
|
|
|
+ item[key].value ? Math.floor(item[key].value * 100) : 0
|
|
|
+ )
|
|
|
);
|
|
|
- if (totalVal < 1) {
|
|
|
+ if (totalVal < 100) {
|
|
|
this.updateWarningColumnIndexs(columnIndex, "add");
|
|
|
} else {
|
|
|
this.updateWarningColumnIndexs(columnIndex, "remove");
|
|
|
}
|
|
|
|
|
|
- if (totalVal > 1) {
|
|
|
+ if (totalVal > 100) {
|
|
|
const columnName =
|
|
|
nodeName === "null" ? fieldName : `${fieldName}:${nodeName}`;
|
|
|
this.$message.error(`${columnName}列总和大于1,当前修改值将不会保存!`);
|