Browse Source

通知人回写

yuansh 2 years ago
parent
commit
dba1c153d2

+ 9 - 3
src/views/oa/modules/IncidentTicketModalDetail.vue

@@ -654,7 +654,8 @@
             list: '/oa/incidentTicket/queryIncidentTicketChildrenByMainId'
           },
           list:'/sys/user/list' 
-        }
+        },
+        beginUsers:[]
       }
     },
     created() {
@@ -667,8 +668,10 @@
   },
     methods: {
       addNotice(){   
+        // console.log(this.formState.Noticer);
+        // console.log(this.beginUsers.toString());
         // this.$refs.JSelectBizComponent.visible = true
-        this.$refs.JSelectBizComponent.showModal()
+        this.$refs.JSelectBizComponent.showModal(this.beginUsers)
       },
       feedbackNotice(){
         this.visibleFk =false
@@ -731,6 +734,7 @@
         })
       },
       sendNotice(ids){
+        console.log(ids);
         getAction('/oa/incidentTicket/noticeUser', {ids:ids,headId:this.formState.id,code:this.formState.accidentNumber,title:this.formState.accidentTheme}).then((res) => {
           if(res.success){
             this.$message.success(res.message)
@@ -796,14 +800,16 @@
         getAction('/oa/incidentTicketMsg/queryByMainId', {id:id}).then((res) => {
           if(res.success){
             var noticeList =[]
+            var beginUsersList =[]
             res.result.map(item=>{
               if(item.confirm != null && item.confirm != '' && item.confirm != '否'){
                 noticeList.push(item.userName+'('+item.confirm+')')
               }else{
                 noticeList.push(item.userName+'')
               }
-              
+              beginUsersList.push(item.userId)
             })
+            this.beginUsers = beginUsersList;
             this.formState.Noticer = noticeList.toString()
             this.formState.createTime = (res.result[0].createTime!==''&&res.result[0].createTime)? moment(res.result[0].createTime).format('YYYY-MM-DD HH:mm:ss'):''
             this.$forceUpdate()

+ 46 - 27
src/views/oa/modules/JSelectUserByDepModal.vue

@@ -103,6 +103,7 @@
         selectedRowKeys: [],
         selectUserRows: [],
         selectUserIds: [],
+        beginUsers: [],
         title: '根据部门选择用户',
         ipagination: {
           current: 1,
@@ -149,34 +150,51 @@
     },
     methods: {
         initUserNames() {
-        if (this.userIds) {
-          // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
-          let values = this.userIds.split(',') + ','
-          var param = {
-            // username: values,
-              pageNo: 1,
-            pageSize: values.length
-          }
-          param[this.customReturnField] = values;
-          console.log("回显用户参数",param)
-          getAction('/sys/user/listBy', {}).then((res) => {
-          // getUserList(param).then((res) => {
-            if (res.success) {
-              let selectedRowKeys = []
-              let realNames = []
-              res.result.records.forEach(user => {
-                realNames.push(user['realname'])
-                selectedRowKeys.push(user['id'])
+            if(this.beginUsers != null && this.beginUsers != []){
+              getAction('/sys/user/listBy', {beginUsers:this.beginUsers.toString()}).then((res) => {
+                if (res.success) {
+                  let selectedRowKeys = []
+                  let realNames = []
+                  res.result.records.forEach(user => {
+                    realNames.push(user['realname'])
+                    selectedRowKeys.push(user['id'])
+                  })
+                  this.selectedRowKeys = selectedRowKeys
+                  console.log("回显用户",selectedRowKeys)
+                  this.$emit('initComp', realNames.join(','))
+                }
               })
-              this.selectedRowKeys = selectedRowKeys
-              console.log("回显用户",selectedRowKeys)
-              this.$emit('initComp', realNames.join(','))
             }
-          })
-        } else {
-          // JSelectUserByDep组件bug issues/I16634
-          this.$emit('initComp', '')
-        }
+          
+          
+        // if (this.userIds) {
+        //   // 这里最后加一个 , 的原因是因为无论如何都要使用 in 查询,防止后台进行了模糊匹配,导致查询结果不准确
+        //   let values = this.userIds.split(',') + ','
+        //   var param = {
+        //     // username: values,
+        //       pageNo: 1,
+        //     pageSize: values.length
+        //   }
+        //   param[this.customReturnField] = values;
+        //   console.log("回显用户参数",param)
+        //   getAction('/sys/user/listBy', {}).then((res) => {
+        //   // getUserList(param).then((res) => {
+        //     if (res.success) {
+        //       let selectedRowKeys = []
+        //       let realNames = []
+        //       res.result.records.forEach(user => {
+        //         realNames.push(user['realname'])
+        //         selectedRowKeys.push(user['id'])
+        //       })
+        //       this.selectedRowKeys = selectedRowKeys
+        //       console.log("回显用户",selectedRowKeys)
+        //       this.$emit('initComp', realNames.join(','))
+        //     }
+        //   })
+        // } else {
+        //   // JSelectUserByDep组件bug issues/I16634
+        //   this.$emit('initComp', '')
+        // }
       },
       async loadData(arg) {
         if (arg === 1) {
@@ -210,7 +228,8 @@
           this.scrollTrigger = {};
         }
       },
-      showModal() {
+      showModal(user) {
+        this.beginUsers = user;
         this.visible = true;
         this.queryDepartTree();
         this.initUserNames()