Browse Source

fix: 修改考核模版批量删除

username 2 tuần trước cách đây
mục cha
commit
6a3fd5c93b
1 tập tin đã thay đổi với 18 bổ sung23 xóa
  1. 18 23
      src/views/evaluate/children/change/mould/manageObject.vue

+ 18 - 23
src/views/evaluate/children/change/mould/manageObject.vue

@@ -94,22 +94,12 @@ const getTemplateInfoListApi = async () => {
 // 删除
 const delParams = reactive({
   assessmentId: "",
-  objectAddVoList: [
-    {
-      assessmentObjectId: "",
-      assessmentObjectName: ""
-    }
-  ]
+  objectAddVoList: []
 });
 // 被考核对象
 const addPersonParams = reactive({
   assessmentId: "",
-  objectAddVoList: [
-    {
-      assessmentObjectId: "",
-      assessmentObjectName: ""
-    }
-  ]
+  objectAddVoList: []
 });
 const aaa = ref();
 const delAssessmentObjectApi = async () => {
@@ -125,7 +115,7 @@ const delAssessmentObjectApi = async () => {
     ).then(async () => {
       const { code, msg } = await delAssessmentObject(delParams);
       if (code === 200) {
-        getAssessmentQuotaDetailsApi();
+        getAssessmentObjectDetailsApi();
         ElMessage.success("删除成功");
       } else {
         ElMessage.error(msg);
@@ -139,21 +129,26 @@ const delAssessmentObjectApi = async () => {
 const changeSelection = val => {
   if (val) {
     valSelection.value = true;
+    delParams.objectAddVoList = [];
+    console.log(val, "获取的批量选中的数据");
     delParams.assessmentId = messageData.value.id;
     addPersonParams.assessmentId = messageData.value.id;
     let assessmentObjectId;
     let assessmentObjectName;
     val.forEach((item, index) => {
-      delParams.objectAddVoList.forEach((item1, index1) => {
-        if (index == index1) {
-          assessmentObjectId = item.id;
-          assessmentObjectName = item.realName;
-          delParams.objectAddVoList.push({
-            assessmentObjectId,
-            assessmentObjectName
-          });
-        }
-      });
+      console.log(item, "循环过滤的数据");
+      const obj = {
+        assessmentObjectId: item.assessmentObjectId,
+        assessmentObjectName: item.assessmentObjectName
+      };
+
+      // delParams.objectAddVoList.forEach((item1, index1) => {
+      //   if (index == index1) {
+      // assessmentObjectId = item.assessmentObjectId;
+      // assessmentObjectName = item.assessmentObjectName;
+      delParams.objectAddVoList.push(obj);
+      //   }
+      // });
     });
   }
 };