|
@@ -85,7 +85,7 @@ import useDialog from "@/hooks/useDialog";
|
|
|
import { useMessage } from "@/hooks/useMessage";
|
|
|
import type { ListIitem } from "@/api/base/BaseDataModel";
|
|
|
import { useEleFormValidate } from "@/hooks/useEleFormValidate";
|
|
|
-import { isNonNegativeInteger, isNumber } from "@/utils/is";
|
|
|
+import { isArrayLength, isNonNegativeInteger, isNumber } from "@/utils/is";
|
|
|
import { api_DownloadFeeImport } from "@/api/customerfee/customerfeeset";
|
|
|
import { useApiDownTemplate } from "@/hooks/useApiDownTemplate";
|
|
|
import FormulaModle from "@/components/feeset/FormulaModle.vue";
|
|
@@ -224,7 +224,9 @@ const hanleSetZones = async () => {
|
|
|
);
|
|
|
});
|
|
|
if (notNumber.length > 0) {
|
|
|
- ElMessageBox.alert("当前报价内容非纯数字<br/>" + notNumber.join("<br/>"), {
|
|
|
+ const headerList = itemList[0].split('\t')
|
|
|
+ const resultMessage = getNonNumericIndexes(notNumber, headerList)
|
|
|
+ ElMessageBox.alert(resultMessage, "当前报价内容非纯数字", {
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
});
|
|
|
return false;
|
|
@@ -276,6 +278,37 @@ const hanleSetZones = async () => {
|
|
|
// }
|
|
|
};
|
|
|
|
|
|
+// 获取ElMessageBox.alert显示message
|
|
|
+const getNonNumericIndexes = (notNumber, headerList) => {
|
|
|
+ if (!isArrayLength(notNumber)) return '暂无数据!'
|
|
|
+ const list = notNumber.map(item =>
|
|
|
+ item.split('\t').map(value => parseFloat(value.trim()))
|
|
|
+ );
|
|
|
+ const nonNumericIndexes: Recordable[] = [];
|
|
|
+ list.forEach((array, rowIndex) => {
|
|
|
+ array.forEach((value, colIndex) => {
|
|
|
+ if (value === null || isNaN(value)) {
|
|
|
+ nonNumericIndexes.push({ headValue: array[0] || '为空!', rowIndex, colIndex });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 按 rowIndex 分组
|
|
|
+ const groupedByRow = nonNumericIndexes.reduce((acc, { headValue, rowIndex, colIndex }) => {
|
|
|
+ if (!acc[rowIndex]) {
|
|
|
+ acc[rowIndex] = [];
|
|
|
+ }
|
|
|
+ acc[rowIndex].push({ headValue, colIndex });
|
|
|
+ return acc;
|
|
|
+ }, {});
|
|
|
+
|
|
|
+ const message = Object.entries(groupedByRow).map(([rowIndex, items]) => {
|
|
|
+ const rowDetails = items.map(item => `${headerList[item.colIndex]}`).join('、');
|
|
|
+ return `公斤/区间名(${items[0].headValue}): <br/><div style="color: red;">${rowDetails}</div>`;
|
|
|
+ }).join('<br/>');
|
|
|
+ return message
|
|
|
+}
|
|
|
+
|
|
|
// 清空数据
|
|
|
const clear = () => {
|
|
|
resetForm(exportExpenseRef.value);
|