zhuliu 7 月之前
父节点
当前提交
f1955d242f
共有 1 个文件被更改,包括 61 次插入1 次删除
  1. 61 1
      src/views/report/components/dialog/addAndEditReport.vue

+ 61 - 1
src/views/report/components/dialog/addAndEditReport.vue

@@ -161,6 +161,16 @@
           </el-col>
         </el-row>
         <el-row>
+          <el-col :span="24">
+            <el-form-item label="处理人:">
+              <div class="manage">
+                <el-button size="small" @click="showHeadDialog()">选择</el-button>
+                <div v-html="getNames(form.adminPersons)"></div>
+              </div>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="12">
             <template>
               <div>
@@ -319,6 +329,9 @@
     <addFlowPath ref="addFlowPath" @save="getFlowPath"></addFlowPath>
 
     <addEvent ref="addEvent"  @isSuccess="handleSuccess"></addEvent>
+
+    <!-- 选择处理人弹窗 -->
+    <choosePerson ref="choosePerson" @getPersonIds="getPersonIds"></choosePerson>
   </div>
 </template>
 
@@ -328,12 +341,14 @@ import addMatter from '../matter/addMatters.vue'
 import ClientTable from '@/views/client'
 import addFlowPath from '@/views/report/InvalidResponse/components/dialog/editFlowPath.vue'
 import addEvent from '@/views/event/components/dialog/addEvent.vue'; 
+import choosePerson from '@/views/components/dialog/person.vue'
 export default {
   components: {
     addMatter,
     ClientTable,
     addFlowPath,
-    addEvent
+    addEvent,
+    choosePerson
   },
   props: {},
   data() {
@@ -511,6 +526,32 @@ export default {
     this.initTask()
   },
   methods: {
+    // 打开处理人 人员弹窗
+    showHeadDialog() {
+      this.$refs.choosePerson.open(this.form.adminIds, this.form.adminPersons)
+    },
+    //获取处理人员信息
+    getPersonIds({ personIds, persons }) {
+      if (personIds.length > 0) {
+        // adminPersons存储返回的人员id数组
+        this.$set(this.form, 'adminPersons', persons)
+        this.$set(this.form, 'adminIds', personIds)
+      } else {
+        this.$set(this.form, 'adminPersons', [])
+        this.$set(this.form, 'adminIds', [])
+      }
+      this.$forceUpdate()
+    },
+    // 处理处理人数据
+    getNames(row) {
+      if (!row) {
+        return ''
+      }
+      var arr = row.map(item => {
+        return item.name
+      })
+      return arr.join('、')
+    },
     initTask() {
           this.webSocket.onmessage = (e) => {
             if(e.data.indexOf('{') == -1){
@@ -727,6 +768,9 @@ export default {
       this.eventList.data = []
       this.eventList.name = ''
       this.$set(this.form,'signProjectIds',this.form.signPatentNo || this.form.signProjectId)
+
+      this.form.adminPersons = []
+      this.form.adminIds = []
       if (this.form.id) {
         
         if (this.form.eventIds && this.form.eventIds.length>0) {
@@ -749,6 +793,19 @@ export default {
         }else{
           this.getEventList()
         }
+
+        // 处理人
+        if (this.form.involvedPersons && this.form.involvedPersons.length) {
+          this.form.involvedPersons.forEach(item => {
+            let a = {
+              id: item.personId,
+              name: item.personName
+            }
+            this.form.adminPersons.push(a)
+            this.form.adminIds.push(a.id)
+          })
+        }
+
       } else {
         this.$set(this.form, 'matterIds', form.matterId)
         this.form.scenarioIds = form.scenarioId
@@ -1112,6 +1169,9 @@ export default {
             }
             
           }
+          if (this.form.adminIds && this.form.adminIds.length > 0) {
+            this.form.involvedPersonIds = this.form.adminIds
+          }
           this.$set(this.form,'signPatentNo',this.form.signPatentNo.trim())
           let formData = this.form
           if (!this.form.id) {//新增报告