소스 검색

新建事件增加事件单号和报修主体字段

seimin 11 달 전
부모
커밋
7e9643e127
2개의 변경된 파일55개의 추가작업 그리고 3개의 파일을 삭제
  1. 14 0
      http/api.js
  2. 41 3
      pages/assign/assign.vue

+ 14 - 0
http/api.js

@@ -182,3 +182,17 @@ export function api_place(data){
182
   return post("/user/data/fetchDataList/place", data);
182
   return post("/user/data/fetchDataList/place", data);
183
 }
183
 }
184
 
184
 
185
+/**
186
+ * 获取系统配置
187
+ */
188
+export function api_systemConfiguration(data){
189
+  return post("/sysinfo/data/fetchDataList/systemConfiguration", data);
190
+}
191
+
192
+/**
193
+ * 获取事件单号
194
+ */
195
+export function api_sj(){
196
+  return get("/bpm/bpm/restful/sj");
197
+}
198
+

+ 41 - 3
pages/assign/assign.vue

@@ -89,7 +89,7 @@
89
   import { ref, reactive, computed } from 'vue'
89
   import { ref, reactive, computed } from 'vue'
90
   import { onLoad } from '@dcloudio/uni-app'
90
   import { onLoad } from '@dcloudio/uni-app'
91
   import { generateNumberArray } from '@/utils/index.js'
91
   import { generateNumberArray } from '@/utils/index.js'
92
-  import { api_group, api_incidentDetail, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_getDictionary, api_querySummaryDoc, api_addSummaryDoc } from "@/http/api.js"
92
+  import { api_group, api_incidentDetail, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_getDictionary, api_querySummaryDoc, api_addSummaryDoc, api_systemConfiguration, api_sj } from "@/http/api.js"
93
   import { defaultColor } from '@/static/js/theme.js'
93
   import { defaultColor } from '@/static/js/theme.js'
94
   import { useSetTitle } from '@/share/useSetTitle.js'
94
   import { useSetTitle } from '@/share/useSetTitle.js'
95
   import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
95
   import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
@@ -551,11 +551,23 @@
551
   }
551
   }
552
   
552
   
553
   // 处理提交事件
553
   // 处理提交事件
554
-  function handlerOrder(){
554
+  async function handlerOrder(){
555
     let postData = {
555
     let postData = {
556
       incident: dataInfo.incidentData,
556
       incident: dataInfo.incidentData,
557
     }
557
     }
558
     
558
     
559
+    let result = await beforeBuild();
560
+    if(result[0].status == 200 && result[1].status == 200){
561
+      postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
562
+      postData.incident.incidentsign = result[1].data || undefined;
563
+    }else{
564
+      uni.showToast({
565
+        icon: 'none',
566
+        title: '请求数据失败!'
567
+      });
568
+      return;
569
+    }
570
+    
559
     postData.incident.handleDescription = dataInfo.handleDescription;
571
     postData.incident.handleDescription = dataInfo.handleDescription;
560
     postData.incident.handleCategory = {id: dataInfo.handleCategory};
572
     postData.incident.handleCategory = {id: dataInfo.handleCategory};
561
     postData.incident.closecode = {id: dataInfo.closecode};
573
     postData.incident.closecode = {id: dataInfo.closecode};
@@ -566,12 +578,38 @@
566
     return api_incidentTask('accept', postData);
578
     return api_incidentTask('accept', postData);
567
   }
579
   }
568
   
580
   
581
+  // 建单前的接口
582
+  function beforeBuild(){
583
+    let repairMain$ = api_systemConfiguration({
584
+        "idx": 0,
585
+        "sum": 1,
586
+        "systemConfiguration": {
587
+          "keyconfig": "repairMain"
588
+        }
589
+    })
590
+    
591
+    let sj$ = api_sj();
592
+    return Promise.all([repairMain$, sj$])
593
+  }
594
+  
569
   // 派单提交事件
595
   // 派单提交事件
570
-  function assignOrder(){
596
+  async function assignOrder(){
571
     let postData = {
597
     let postData = {
572
       incident: dataInfo.incidentData,
598
       incident: dataInfo.incidentData,
573
     }
599
     }
574
     
600
     
601
+    let result = await beforeBuild();
602
+    if(result[0].status == 200 && result[1].status == 200){
603
+      postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
604
+      postData.incident.incidentsign = result[1].data || undefined;
605
+    }else{
606
+      uni.showToast({
607
+        icon: 'none',
608
+        title: '请求数据失败!'
609
+      });
610
+      return;
611
+    }
612
+    
575
     if(dataInfo.userId){
613
     if(dataInfo.userId){
576
       // 派人
614
       // 派人
577
       postData.incident.assignee = dataInfo.userId;
615
       postData.incident.assignee = dataInfo.userId;