Browse Source

图像识别主管反馈新旧反馈问题修改

zhujindu 6 months ago
parent
commit
0773527483
2 changed files with 47 additions and 5 deletions
  1. 8 0
      src/api/index.js
  2. 39 5
      src/views/week/VisitSummaryAdd.vue

+ 8 - 0
src/api/index.js

@@ -978,3 +978,11 @@ export function getMaterialHistory(query) {
     params: query,
   });
 }
+// 根据当前用户获取下级所有销售部接口
+export function getDeptsByUser(query) {
+  return request({
+    url: '/mobile/summaryMobile/getDeptsByUser',
+    method: 'get',
+    params: query,
+  });
+}

+ 39 - 5
src/views/week/VisitSummaryAdd.vue

@@ -234,6 +234,7 @@ import {
   getSummaryDetailById,
   getDeptInfo,
   getSummaryMobileDeptInfo,
+  getDeptsByUser,
 } from '@/api/index';
 import zRadio from '@/components/zRadio2';
 import zCheckbox from '@/components/zCheckbox2';
@@ -460,11 +461,20 @@ export default {
               this.activaFlag
             ) {
               this.activaFlag = false;
-              this.getDeptInfo(
-                'dept',
-                collectionItemLists[q].answerType,
-                collectionItemLists[q].answerValue
-              );
+              if (collectionItemLists[q].answerType == 'xsb') {
+                this.getDeptsBy(collectionItemLists[q].answerValue);
+                this.getDeptInfo(
+                  'dept',
+                  collectionItemLists[q].answerType,
+                  collectionItemLists[q].answerValue
+                );
+              } else {
+                this.getDeptInfo(
+                  'dept',
+                  collectionItemLists[q].answerType,
+                  collectionItemLists[q].answerValue
+                );
+              }
             }
             // 单选
             if (
@@ -622,6 +632,30 @@ export default {
         }
       });
     },
+    getDeptsBy(answerValue) {
+      getDeptsByUser().then((res) => {
+        if (res.data && res.code == 200) {
+          let arr = [];
+          res.data.forEach((val) => {
+            arr.push({
+              ancestors: val.ancestors || '',
+              deptCode: val.deptCode || '',
+              deptId: val.deptId || '',
+              deptLevel: val.deptLevel || '',
+              deptName: val.deptName || '',
+              parentId: val.parentId || '',
+            });
+          });
+          this.deptList = arr;
+          if (answerValue) {
+            let findCompany = this.regionList.find((item) => item.deptCode == answerValue);
+            this.onSalesDepartmentConfirm(findCompany);
+          } else {
+            this.onSalesDepartmentConfirm(this.deptList[0]);
+          }
+        }
+      });
+    },
     dailyFn(row) {
       if (row.status != '0') {
         if (row.status == -1) {