Explorar el Código

fix: 考核指标回显错误问题

haifeng.zhang hace 6 días
padre
commit
79c0230f05
Se han modificado 1 ficheros con 9 adiciones y 4 borrados
  1. 9 4
      src/views/evaluate/children/change/components/editMould.vue

+ 9 - 4
src/views/evaluate/children/change/components/editMould.vue

@@ -116,7 +116,7 @@ const open = (row: any, title: string, order: number) => {
       }
       // 找到当前项的 indLimitScore 是否已经存在于结果数组中
       let found = acc.find(
-        group => group[0].indLimitScore === current.indLimitScore
+        group => group[0].indLimitGroup === current.indLimitGroup
       );
       if (found) {
         // 如果找到了,添加当前项到对应的数组中
@@ -294,13 +294,16 @@ const handChangeIndex = (ind, val) => {
 const postUpdateApi = async () => {
   let codeList = [];
   let successList = [];
-
   for (const [index, item] of indexList.value.entries()) {
+    const newIndLimitGroup = `${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
     for (const item1 of item) {
       if (item1.id) {
         item1.indLimitScore = oldIndexList.indLimitScore[index];
         item1.indLimitScore = Number(item1.indLimitScore);
-        const { code } = await postUpdate(item1);
+        const { code } = await postUpdate({
+          ...item1,
+          indLimitGroup: item1.indLimitGroup || newIndLimitGroup
+        });
         codeList.push(item1.id);
         if (code === 200) {
           successList.push(code);
@@ -309,7 +312,9 @@ const postUpdateApi = async () => {
     }
   }
   for (let item of formLabelAlign.tableData) {
-    const { code } = await postUpdate(item);
+    const { code } = await postUpdate({
+      ...item
+    });
     if (code === 200) {
       successList.push(code);
     }