瀏覽代碼

ETA小需求11 智能PPT、英文PPT、装置检修选择用户的地方改为选择全部系统用户

hbchen 10 月之前
父節點
當前提交
19c426ec13

+ 9 - 4
src/views/ppt_manage/newVersion/components/catalog/chooseShareUserDia.vue

@@ -26,8 +26,10 @@
         :show-all-levels="false"
         filterable
         :props="{
+          value:'ItemId',
+          label:'ItemName',
+          children:'Children',
           expandTrigger: 'hover',
-          children: 'ResearcherList',
           emitPath: false,
           multiple: true
         }"
@@ -54,7 +56,7 @@
 </template>
 
 <script>
-import { roadshowInterence,pptInterface } from '@/api/api.js';
+import { roadshowInterence,pptInterface,dataAuthInterface } from '@/api/api.js';
 import {pptEnInterface} from '@/api/modules/pptEnApi.js';
 export default {
   props: {
@@ -89,9 +91,12 @@ export default {
 
     /* 获取研究员列表 */
     async getResearcherList() {
-      const res = await roadshowInterence.getResearcherList();
+      // const res = await roadshowInterence.getResearcherList();
+      // 换成全部系统用户
+      const res = await dataAuthInterface.userSearch();
       if (res.Ret !== 200) return
-      this.researcherList = this.formatResearcherList(res.Data);
+      // this.researcherList = this.formatResearcherList(res.Data);
+      this.researcherList = res.Data || []
     },
 
     // 对获取到的研究员列表做处理

+ 32 - 14
src/views/supply_manage/components/varietySetDia.vue

@@ -33,7 +33,9 @@
             :show-all-levels="false"
             filterable
             :props="{
-              children: 'ResearcherList',
+              value:'ItemId',
+              label:'ItemName',
+              children:'Children',
               emitPath: false,
               multiple: true
             }"
@@ -63,7 +65,8 @@
 </template>
 
 <script>
-import {roadshowInterence} from '@/api/modules/roadshowApi.js';
+// import {roadshowInterence} from '@/api/modules/roadshowApi.js';
+import { dataAuthInterface } from '@/api/api.js';
 import * as supplyApi from '@/api/modules/supplyApi.js';
 export default {
   props: {
@@ -89,7 +92,8 @@ export default {
 
     'formData.users': {
       handler(nval) {
-        this.chooseUsers = this.researcherList.length && nval.map(_ => this.getUserName(_)).filter(_ => _);
+        // this.chooseUsers = this.researcherList.length && nval.map(_ => this.getUserName(_)).filter(_ => _);
+        this.chooseUsers = this.researcherList.length && this.getUserName()
       }
     }
   },
@@ -138,15 +142,21 @@ export default {
     },
 
     getUserName(id) {
-      let name = '';
-      this.researcherList.forEach(item => {
-        item.ResearcherList && item.ResearcherList.forEach(item2 => {
-            if(item2.AdminId === id) {
-              name = item2.RealName || '';
-            }
-        })
+      let checkedNodes=this.$refs.cascader.getCheckedNodes() || []
+      return checkedNodes.map(item =>{
+        return item.label
       })
-      return name
+
+      // let name = '';
+      // this.researcherList.forEach(item => {
+      //   console.log(item);
+      //   item.ResearcherList && item.ResearcherList.forEach(item2 => {
+      //       if(item2.ItemId === id) {
+      //         name = item2.ItemName || '';
+      //       }
+      //   })
+      // })
+      // return name
     },
 
     // 选择的研究员发生改变
@@ -158,12 +168,20 @@ export default {
 
     /* 获取研究员列表 */
     async getResearcherList() {
-      const res = await roadshowInterence.getResearcherList();
+      // const res = await roadshowInterence.getResearcherList();
+      // 换成全部系统用户
+      const res = await dataAuthInterface.userSearch();
       if (res.Ret !== 200) return
       
-      this.researcherList = this.formatResearcherList(res.Data);
+      // this.researcherList = this.formatResearcherList(res.Data);
+      this.researcherList = res.Data || []
 
-      if(this.form.VarietyId) this.chooseUsers = this.researcherList.length && this.formData.users.map(_ => this.getUserName(_)).filter(_ => _);
+      // if(this.form.VarietyId) this.chooseUsers = this.researcherList.length && this.formData.users.map(_ => this.getUserName(_)).filter(_ => _);
+      if(this.form.VarietyId){
+        this.$nextTick(()=>{
+          this.chooseUsers = this.researcherList.length && this.getUserName()
+        })
+      }
     },
 
     // 对获取到的研究员列表做处理