ezhizao_zx преди 4 месеца
родител
ревизия
6776bd44d0
променени са 3 файла, в които са добавени 69 реда и са изтрити 12 реда
  1. 56 1
      src/views/business/consult/index.vue
  2. 11 11
      src/views/business/daywork/sortForm.vue
  3. 2 0
      src/views/business/dayworkUpdate/sortForm.vue

+ 56 - 1
src/views/business/consult/index.vue

@@ -216,6 +216,61 @@ function getLoginPower() {
     })
   }
 }
+// 根据当前登录人员判断查询结果和权限
+function getLoginPermission() {
+  technicianController.value = false
+  qualityController.value = false
+  getResultList()
+  if (useUserStore().user.userId == 1) {
+    queryParams.value.consultDepartment = ""
+    technicianController.value = true
+    qualityController.value = true
+    editable.value = true
+    getList()
+  } else {
+    // 判断是否有查看全部的权限
+    getListByUserId({ userId: useUserStore().user.userId }).then(res => {
+      let roleNames = res.data.map(item => item.roleKey)
+      technicianController.value = false
+      qualityController.value = false
+      console.log(roleNames)
+      let index = roleNames.findIndex(item => item == 'technicanResponser')
+      if (auth.hasPermi('business:consult:searchAll')) {
+        // 是否有一个只能查看全部的权限
+        technicianController.value = true
+        qualityController.value = true
+        editable.value = false
+        queryParams.value.consultDepartment = "-1"
+      } else {
+        if (index >= 0 && res.data[index].perms.findIndex(item => item == 'business:consult:list') > -1) {
+          queryParams.value.flag = true
+        } else {
+          queryParams.value.flag = false
+        }
+      }
+      // 判断是否有技术权限
+      // 判断是否有品管权限
+      if (roleNames.includes('technician')) {
+        editable.value = true
+        technicianController.value = true
+        queryParams.value.consultDepartment = "0"
+      }
+      if (roleNames.includes('quality_control_officer')) {
+        editable.value = true
+        qualityController.value = true
+        queryParams.value.consultDepartment = "1"
+      }
+      if (roleNames.includes("technician") && roleNames.includes("quality_control_officer")) {
+        editable.value = true
+        queryParams.value.consultDepartment = "-1"
+      }
+      // 查询
+      getList()
+    })
+
+  }
+
+}
 function handleChangeStatus(data) {
   console.log(data)
   if (data.consultResultId != 0) {
@@ -302,6 +357,6 @@ const handleSetStatus = (type, data) => {
 };
 
 onMounted(() => {
-  getLoginPower();
+  getLoginPermission();
 });
 </script>

+ 11 - 11
src/views/business/daywork/sortForm.vue

@@ -478,17 +478,17 @@ const handleSave = () => {
 
           return;
         }
-        if (reasonList.indexOf(form.value.groupRejectList[i].sortStandard) >= 0) {
-          flag = false;
-          proxy.$modal.msgError(
-            "第" +
-            (i + 1) +
-            "行分选检查标准与" +
-            (reasonList.indexOf(form.value.groupRejectList[i].sortStandard) + 1) +
-            "行相同"
-          );
-          return;
-        }
+        // if (reasonList.indexOf(form.value.groupRejectList[i].sortStandard) >= 0) {
+        //   flag = false;
+        //   proxy.$modal.msgError(
+        //     "第" +
+        //     (i + 1) +
+        //     "行分选检查标准与" +
+        //     (reasonList.indexOf(form.value.groupRejectList[i].sortStandard) + 1) +
+        //     "行相同"
+        //   );
+        //   return;
+        // }
         reasonList.push(form.value.groupRejectList[i].sortStandard);
       }
       if (rejectAmount.value > form.value.prodNum) {

+ 2 - 0
src/views/business/dayworkUpdate/sortForm.vue

@@ -453,6 +453,7 @@ const handleSave = () => {
 
           return;
         }
+        /*
         if (reasonList.indexOf(form.value.groupRejectList[i].sortStandard) >= 0) {
           flag = false;
           proxy.$modal.msgError(
@@ -464,6 +465,7 @@ const handleSave = () => {
           );
           return;
         }
+        */
         reasonList.push(form.value.groupRejectList[i].sortStandard);
       }
       if (rejectAmount.value > form.value.prodNum) {