ソースを参照

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

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 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 89
   import { ref, reactive, computed } from 'vue'
90 90
   import { onLoad } from '@dcloudio/uni-app'
91 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 93
   import { defaultColor } from '@/static/js/theme.js'
94 94
   import { useSetTitle } from '@/share/useSetTitle.js'
95 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 555
     let postData = {
556 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 571
     postData.incident.handleDescription = dataInfo.handleDescription;
560 572
     postData.incident.handleCategory = {id: dataInfo.handleCategory};
561 573
     postData.incident.closecode = {id: dataInfo.closecode};
@@ -566,12 +578,38 @@
566 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 597
     let postData = {
572 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 613
     if(dataInfo.userId){
576 614
       // 派人
577 615
       postData.incident.assignee = dataInfo.userId;