Browse Source

处理中处理

seimin 1 year ago
parent
commit
b6db396a38

+ 9 - 2
http/api.js

@@ -1,4 +1,4 @@
1
-import { get, post } from "@/http/http.js"
1
+import { get, post, path } from "@/http/http.js"
2 2
 
3 3
 /**
4 4
  * 微信登录
@@ -145,4 +145,11 @@ export function api_addSummaryDoc(data){
145 145
  */
146 146
 export function api_workHourManagement(data){
147 147
   return post("/bpm/data/fetchDataList/workHourManagement", data);
148
-}
148
+}
149
+
150
+/**
151
+ * 上传附件
152
+ */
153
+export function api_uploadAttachment(type, id){
154
+  return `${path}/common/common/uploadAttachment/${type}/${id}`
155
+}

+ 1 - 4
http/http.js

@@ -1,7 +1,4 @@
1
-// #ifdef H5
2
-let path = `${location.origin}/service`
3
-// #endif
4
-
1
+export const path = `${location.origin}/service`
5 2
 // get方法
6 3
 export function get(url, data = {}) {
7 4
   url = path + url;

+ 36 - 0
pages.json

@@ -82,6 +82,42 @@
82 82
         },
83 83
         "enablePullDownRefresh": true
84 84
       }
85
+    },
86
+    {
87
+      "path": "pages/categoryOne/categoryOne",
88
+      "style": {
89
+        "h5": {
90
+          "titleNView": false
91
+        },
92
+        "enablePullDownRefresh": true
93
+      }
94
+    },
95
+    {
96
+      "path": "pages/categoryTwo/categoryTwo",
97
+      "style": {
98
+        "h5": {
99
+          "titleNView": false
100
+        },
101
+        "enablePullDownRefresh": true
102
+      }
103
+    },
104
+    {
105
+      "path": "pages/categoryThree/categoryThree",
106
+      "style": {
107
+        "h5": {
108
+          "titleNView": false
109
+        },
110
+        "enablePullDownRefresh": true
111
+      }
112
+    },
113
+    {
114
+      "path": "pages/synergeticAdd/synergeticAdd",
115
+      "style": {
116
+        "h5": {
117
+          "titleNView": false
118
+        },
119
+        "enablePullDownRefresh": true
120
+      }
85 121
     }
86 122
   ],
87 123
   "globalStyle": {

+ 161 - 0
pages/categoryOne/categoryOne.vue

@@ -0,0 +1,161 @@
1
+<template>
2
+  <view class="categoryOne">
3
+    <view class="head">
4
+      请选择故障类型
5
+    </view>
6
+    <view class="body" v-if="dataInfo.list.length">
7
+      <view class="body_item ellipsis" v-for="data in dataInfo.list" :key="data.id" @click="toCategoryTwo(data)">
8
+        {{data.category}}
9
+      </view>
10
+    </view>
11
+    <view class="zanwu" v-else>
12
+      <text class="newicon newicon-zanwu"></text>
13
+    </view>
14
+    <view class="foot_common_btns">
15
+      <button @click="goBack" type="default" class="primaryButton btn">返回</button>
16
+    </view>
17
+  </view>
18
+</template>
19
+
20
+<script setup>
21
+  import { ref, reactive} from 'vue'
22
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
23
+  import { api_incidentcategory } from "@/http/api.js"
24
+  import { defaultColor } from '@/static/js/theme.js'
25
+  import { useSetTitle } from '@/share/useSetTitle.js'
26
+  import { useLoginUserStore } from '@/stores/loginUser'
27
+  import { useGoBack } from '@/share/useGoBack.js'
28
+  
29
+  useSetTitle();
30
+  const loginUserStore = useLoginUserStore();
31
+  const { goBack }  = useGoBack();
32
+  
33
+  // 主题颜色
34
+  const primaryColor = ref(defaultColor)
35
+  
36
+  // 数据
37
+  const dataInfo = reactive({
38
+    list: [],//工单列表
39
+    idx: 0,//页码
40
+    hasMore: true,//是否有更多数据
41
+    incidentId: undefined,//事件ID
42
+  })
43
+  
44
+  // 跳转二级故障现象列表
45
+  function toCategoryTwo(data){
46
+    uni.navigateTo({
47
+      url: `/pages/categoryTwo/categoryTwo?incidentId=${dataInfo.incidentId}&parentId=${data.id}&parentName=${data.category}`
48
+    })
49
+  }
50
+  
51
+  // 获取列表信息
52
+  function getList(idx){
53
+    uni.showLoading({
54
+      title: "加载中",
55
+      mask: true,
56
+    });
57
+    
58
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
59
+    if(dataInfo.idx === 0){
60
+      dataInfo.list = [];
61
+    }
62
+
63
+    let postData = {
64
+      idx: dataInfo.idx,
65
+      sum: 20,
66
+      incidentcategory: {
67
+        selectType: 'one',
68
+      }
69
+    }
70
+    
71
+    // 当前所属院区或责任科室
72
+    if(loginUserStore.loginUser.user.duty){
73
+      postData.incidentcategory.duty = loginUserStore.loginUser.user.duty.id;
74
+    }else if(loginUserStore.loginUser.user.branch){
75
+      postData.incidentcategory.branch = loginUserStore.loginUser.user.branch.id;
76
+    }
77
+    
78
+    api_incidentcategory(postData).then(res => {
79
+      uni.hideLoading();
80
+      uni.stopPullDownRefresh();
81
+      if(res.status == 200){
82
+        let list = res.list || [];
83
+        if(list.length){
84
+          dataInfo.hasMore = true;
85
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
86
+        }else{
87
+          dataInfo.hasMore = false;
88
+        }
89
+      }else{
90
+        uni.showToast({
91
+          icon: 'none',
92
+          title: res.msg || '请求数据失败!'
93
+        });
94
+      }
95
+    })
96
+  }
97
+  
98
+  onLoad((option) => {
99
+    dataInfo.incidentId = option.incidentId;
100
+    getList(0);
101
+  })
102
+  
103
+  onPullDownRefresh(() => {
104
+    getList(0)
105
+  })
106
+  
107
+  onReachBottom(() => {
108
+    dataInfo.idx += 1;
109
+    if (dataInfo.hasMore) {
110
+      getList(); // 当触底时加载更多数据
111
+    }
112
+  })
113
+</script>
114
+
115
+<style lang="scss" scoped>
116
+.categoryOne{
117
+  display: flex;
118
+  flex-direction: column;
119
+  justify-content: space-between;
120
+  .head{
121
+    height: 88rpx;
122
+    display: flex;
123
+    align-items: center;
124
+    padding: 0 24rpx;
125
+    position: fixed;
126
+    z-index: 99;
127
+    width: 100%;
128
+    box-sizing: border-box;
129
+    background: #fff;
130
+    font-size: 26rpx;
131
+    color: $uni-primary;
132
+  }
133
+  .body{
134
+    border-top: 1rpx solid #DEDEDE;
135
+    margin-bottom: 140rpx;
136
+    margin-top: 88rpx;
137
+    font-size: 26rpx;
138
+    .body_item{
139
+      border-bottom: 1rpx solid #DEDEDE;
140
+      padding: 24rpx;
141
+    }
142
+  }
143
+  .zanwu{
144
+    margin-bottom: 140rpx;
145
+    margin-top: 88rpx;
146
+    display: flex;
147
+    justify-content: center;
148
+    .newicon-zanwu{
149
+      font-size: 256rpx;
150
+      color: #D6D6D6;
151
+      margin-top: 140rpx;
152
+    }
153
+  }
154
+  .foot_common_btns{
155
+    position: fixed;
156
+    left: 0;
157
+    bottom: 0;
158
+    background-color: #fff;
159
+  }
160
+}
161
+</style>

+ 202 - 0
pages/categoryThree/categoryThree.vue

@@ -0,0 +1,202 @@
1
+<template>
2
+  <view class="categoryThree">
3
+    <view class="head">
4
+      <view class="one">{{dataInfo.grandParentName}}<uni-icons class="right" type="right" :size="16" :color="primaryColor"></uni-icons>{{dataInfo.parentName}}<uni-icons class="right" type="right" :size="16" :color="primaryColor"></uni-icons></view>
5
+      <text class="two ellipsis">{{dataInfo.categoryThreeObj.category}}</text>
6
+    </view>
7
+    <view class="body" v-if="dataInfo.list.length">
8
+      <uni-data-checkbox v-model="dataInfo.categoryThree" :localdata="dataInfo.list" mode="list" wrap icon="right" :map="{text:'category',value:'id'}" @change="selectItem"></uni-data-checkbox>
9
+    </view>
10
+    <view class="zanwu" v-else>
11
+      <text class="newicon newicon-zanwu"></text>
12
+    </view>
13
+    <view class="foot_common_btns">
14
+      <button @click="goBack" type="default" class="primaryButton btn">上一级</button>
15
+      <button @click="confirm" type="default" class="primaryButton btn">确认</button>
16
+    </view>
17
+  </view>
18
+</template>
19
+
20
+<script setup>
21
+  import { ref, reactive} from 'vue'
22
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
23
+  import { api_incidentcategory } from "@/http/api.js"
24
+  import { defaultColor } from '@/static/js/theme.js'
25
+  import { useSetTitle } from '@/share/useSetTitle.js'
26
+  import { useLoginUserStore } from '@/stores/loginUser'
27
+  import { useHandlerStore } from '@/stores/handler'
28
+  import { useGoBack } from '@/share/useGoBack.js'
29
+  
30
+  useSetTitle();
31
+  const loginUserStore = useLoginUserStore();
32
+  const handlerStore = useHandlerStore();
33
+  const { goBack }  = useGoBack();
34
+  
35
+  // 主题颜色
36
+  const primaryColor = ref(defaultColor)
37
+  
38
+  // 数据
39
+  const dataInfo = reactive({
40
+    list: [],//工单列表
41
+    idx: 0,//页码
42
+    hasMore: true,//是否有更多数据
43
+    incidentId: undefined,//事件ID
44
+    paramData: {},//传参
45
+    grandParentName: undefined,//二级故障现象名称
46
+    parentId: undefined,//三级故障现象id
47
+    parentName: '',//三级故障现象名称
48
+    categoryThree: undefined,//三级故障现象-回显
49
+    categoryThreeObj: {},//三级故障现象列表-已选择
50
+  })
51
+  
52
+  // 选择
53
+  function selectItem(e){
54
+    dataInfo.categoryThreeObj = e.detail.data;
55
+  }
56
+  
57
+  // 确认
58
+  function confirm(){
59
+    if(!dataInfo.categoryThree){
60
+      uni.showToast({
61
+      	icon: 'none',
62
+        title: '请选择三级故障现象'
63
+      });
64
+      return;
65
+    }
66
+    dataInfo.paramData.category = dataInfo.categoryThreeObj;
67
+    handlerStore.setHandlerData(dataInfo.paramData);
68
+    uni.redirectTo({
69
+      url: `/pages/handler/handler?incidentId=${dataInfo.incidentId}`,
70
+    })
71
+  }
72
+  
73
+  // 获取传递的数据
74
+  function getParamData(){
75
+    dataInfo.paramData = handlerStore.handler.data || {};
76
+    dataInfo.categoryThree = dataInfo.paramData.category ? dataInfo.paramData.category.id : undefined;
77
+    dataInfo.categoryThreeObj =  dataInfo.paramData.category || {};
78
+    getList(0);
79
+  }
80
+  
81
+  // 获取列表信息
82
+  function getList(idx){
83
+    uni.showLoading({
84
+      title: "加载中",
85
+      mask: true,
86
+    });
87
+    
88
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
89
+    if(dataInfo.idx === 0){
90
+      dataInfo.list = [];
91
+    }
92
+
93
+    let postData = {
94
+      idx: dataInfo.idx,
95
+      sum: 20,
96
+      incidentcategory: {
97
+        parent: {
98
+          id: dataInfo.parentId,
99
+        },
100
+      }
101
+    }
102
+    
103
+    // 当前所属院区或责任科室
104
+    if(loginUserStore.loginUser.user.duty){
105
+      postData.incidentcategory.duty = loginUserStore.loginUser.user.duty.id;
106
+    }else if(loginUserStore.loginUser.user.branch){
107
+      postData.incidentcategory.branch = loginUserStore.loginUser.user.branch.id;
108
+    }
109
+    
110
+    api_incidentcategory(postData).then(res => {
111
+      uni.hideLoading();
112
+      uni.stopPullDownRefresh();
113
+      if(res.status == 200){
114
+        let list = res.list || [];
115
+        if(list.length){
116
+          dataInfo.hasMore = true;
117
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
118
+        }else{
119
+          dataInfo.hasMore = false;
120
+        }
121
+      }else{
122
+        uni.showToast({
123
+          icon: 'none',
124
+          title: res.msg || '请求数据失败!'
125
+        });
126
+      }
127
+    })
128
+  }
129
+  
130
+  onLoad((option) => {
131
+    dataInfo.incidentId = option.incidentId;
132
+    dataInfo.grandParentName = option.grandParentName;
133
+    dataInfo.parentId = option.parentId;
134
+    dataInfo.parentName = option.parentName;
135
+    getParamData();
136
+  })
137
+  
138
+  onPullDownRefresh(() => {
139
+    getList(0)
140
+  })
141
+  
142
+  onReachBottom(() => {
143
+    dataInfo.idx += 1;
144
+    if (dataInfo.hasMore) {
145
+      getList(); // 当触底时加载更多数据
146
+    }
147
+  })
148
+</script>
149
+
150
+<style lang="scss" scoped>
151
+.categoryThree{
152
+  display: flex;
153
+  flex-direction: column;
154
+  justify-content: space-between;
155
+  .head{
156
+    height: 88rpx;
157
+    display: flex;
158
+    align-items: center;
159
+    padding: 0 24rpx;
160
+    position: fixed;
161
+    z-index: 99;
162
+    width: 100%;
163
+    box-sizing: border-box;
164
+    background: #fff;
165
+    font-size: 26rpx;
166
+    color: $uni-primary;
167
+    .right{
168
+      margin-top: 2rpx;
169
+    }
170
+    .two{
171
+      flex: 1;
172
+    }
173
+  }
174
+  .body{
175
+    border-top: 1rpx solid #DEDEDE;
176
+    margin-bottom: 140rpx;
177
+    margin-top: 88rpx;
178
+    font-size: 26rpx;
179
+    .body_item{
180
+      border-bottom: 1rpx solid #DEDEDE;
181
+      padding: 24rpx;
182
+    }
183
+  }
184
+  .zanwu{
185
+    margin-bottom: 140rpx;
186
+    margin-top: 88rpx;
187
+    display: flex;
188
+    justify-content: center;
189
+    .newicon-zanwu{
190
+      font-size: 256rpx;
191
+      color: #D6D6D6;
192
+      margin-top: 140rpx;
193
+    }
194
+  }
195
+  .foot_common_btns{
196
+    position: fixed;
197
+    left: 0;
198
+    bottom: 0;
199
+    background-color: #fff;
200
+  }
201
+}
202
+</style>

+ 167 - 0
pages/categoryTwo/categoryTwo.vue

@@ -0,0 +1,167 @@
1
+<template>
2
+  <view class="categoryTwo">
3
+    <view class="head">
4
+      {{dataInfo.parentName}}
5
+    </view>
6
+    <view class="body" v-if="dataInfo.list.length">
7
+      <view class="body_item ellipsis" v-for="data in dataInfo.list" :key="data.id" @click="toCategoryThree(data)">
8
+        {{data.category}}
9
+      </view>
10
+    </view>
11
+    <view class="zanwu" v-else>
12
+      <text class="newicon newicon-zanwu"></text>
13
+    </view>
14
+    <view class="foot_common_btns">
15
+      <button @click="goBack" type="default" class="primaryButton btn">上一级</button>
16
+    </view>
17
+  </view>
18
+</template>
19
+
20
+<script setup>
21
+  import { ref, reactive} from 'vue'
22
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
23
+  import { api_incidentcategory } from "@/http/api.js"
24
+  import { defaultColor } from '@/static/js/theme.js'
25
+  import { useSetTitle } from '@/share/useSetTitle.js'
26
+  import { useLoginUserStore } from '@/stores/loginUser'
27
+  import { useGoBack } from '@/share/useGoBack.js'
28
+  
29
+  useSetTitle();
30
+  const loginUserStore = useLoginUserStore();
31
+  const { goBack }  = useGoBack();
32
+  
33
+  // 主题颜色
34
+  const primaryColor = ref(defaultColor)
35
+  
36
+  // 数据
37
+  const dataInfo = reactive({
38
+    list: [],//工单列表
39
+    idx: 0,//页码
40
+    hasMore: true,//是否有更多数据
41
+    incidentId: undefined,//事件ID
42
+    parentId: undefined,//父级故障现象ID
43
+    parentName: undefined,//父级故障现象名称
44
+  })
45
+  
46
+  // 跳转三级故障现象列表
47
+  function toCategoryThree(data){
48
+    uni.navigateTo({
49
+      url: `/pages/categoryThree/categoryThree?incidentId=${dataInfo.incidentId}&grandParentName=${dataInfo.parentName}&parentId=${data.id}&parentName=${data.category}`
50
+    })
51
+  }
52
+  
53
+  // 获取列表信息
54
+  function getList(idx){
55
+    uni.showLoading({
56
+      title: "加载中",
57
+      mask: true,
58
+    });
59
+    
60
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
61
+    if(dataInfo.idx === 0){
62
+      dataInfo.list = [];
63
+    }
64
+
65
+    let postData = {
66
+      idx: dataInfo.idx,
67
+      sum: 20,
68
+      incidentcategory: {
69
+        parent: {
70
+          id: dataInfo.parentId,
71
+        },
72
+      }
73
+    }
74
+    
75
+    // 当前所属院区或责任科室
76
+    if(loginUserStore.loginUser.user.duty){
77
+      postData.incidentcategory.duty = loginUserStore.loginUser.user.duty.id;
78
+    }else if(loginUserStore.loginUser.user.branch){
79
+      postData.incidentcategory.branch = loginUserStore.loginUser.user.branch.id;
80
+    }
81
+    
82
+    api_incidentcategory(postData).then(res => {
83
+      uni.hideLoading();
84
+      uni.stopPullDownRefresh();
85
+      if(res.status == 200){
86
+        let list = res.list || [];
87
+        if(list.length){
88
+          dataInfo.hasMore = true;
89
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
90
+        }else{
91
+          dataInfo.hasMore = false;
92
+        }
93
+      }else{
94
+        uni.showToast({
95
+          icon: 'none',
96
+          title: res.msg || '请求数据失败!'
97
+        });
98
+      }
99
+    })
100
+  }
101
+  
102
+  onLoad((option) => {
103
+    dataInfo.incidentId = option.incidentId;
104
+    dataInfo.parentId = option.parentId;
105
+    dataInfo.parentName = option.parentName;
106
+    getList(0);
107
+  })
108
+  
109
+  onPullDownRefresh(() => {
110
+    getList(0)
111
+  })
112
+  
113
+  onReachBottom(() => {
114
+    dataInfo.idx += 1;
115
+    if (dataInfo.hasMore) {
116
+      getList(); // 当触底时加载更多数据
117
+    }
118
+  })
119
+</script>
120
+
121
+<style lang="scss" scoped>
122
+.categoryTwo{
123
+  display: flex;
124
+  flex-direction: column;
125
+  justify-content: space-between;
126
+  .head{
127
+    height: 88rpx;
128
+    display: flex;
129
+    align-items: center;
130
+    padding: 0 24rpx;
131
+    position: fixed;
132
+    z-index: 99;
133
+    width: 100%;
134
+    box-sizing: border-box;
135
+    background: #fff;
136
+    font-size: 26rpx;
137
+    color: $uni-primary;
138
+  }
139
+  .body{
140
+    border-top: 1rpx solid #DEDEDE;
141
+    margin-bottom: 140rpx;
142
+    margin-top: 88rpx;
143
+    font-size: 26rpx;
144
+    .body_item{
145
+      border-bottom: 1rpx solid #DEDEDE;
146
+      padding: 24rpx;
147
+    }
148
+  }
149
+  .zanwu{
150
+    margin-bottom: 140rpx;
151
+    margin-top: 88rpx;
152
+    display: flex;
153
+    justify-content: center;
154
+    .newicon-zanwu{
155
+      font-size: 256rpx;
156
+      color: #D6D6D6;
157
+      margin-top: 140rpx;
158
+    }
159
+  }
160
+  .foot_common_btns{
161
+    position: fixed;
162
+    left: 0;
163
+    bottom: 0;
164
+    background-color: #fff;
165
+  }
166
+}
167
+</style>

+ 19 - 19
pages/changeUser/changeUser.vue

@@ -10,7 +10,7 @@
10 10
       <template v-if="dataInfo.tabActiveValue === 'redeploy'">
11 11
         <view class="form_item">
12 12
           <view class="title select"><text class="required newicon newicon-bitian"></text>工作组:</view>
13
-          <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmmit && !dataInfo.groupId}"></uni-data-select>
13
+          <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}"></uni-data-select>
14 14
         </view>
15 15
         <view class="form_item">
16 16
           <view class="title radio"><text class="required newicon newicon-bitian"></text>是否转派到人:</view>
@@ -18,7 +18,7 @@
18 18
         </view>
19 19
         <view class="form_item" v-if="dataInfo.isAssignUser === 1">
20 20
           <view class="title select"><text class="required newicon newicon-bitian"></text>转派对象:</view>
21
-          <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择转派对象" :class="{formRed: isSubmmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select>
21
+          <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择转派对象" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select>
22 22
         </view>
23 23
       </template>
24 24
       
@@ -26,15 +26,15 @@
26 26
       <template v-if="dataInfo.tabActiveValue === 'assign'">
27 27
         <view class="form_item">
28 28
           <view class="title select"><text class="required newicon newicon-bitian"></text>院区:</view>
29
-          <uni-data-select class="value" v-model="dataInfo.branchId" :localdata="dataInfo.branchList" :clear="false" placeholder="请选择院区" @change="changeBranch" :class="{formRed: isSubmmit && !dataInfo.branchId}"></uni-data-select>
29
+          <uni-data-select class="value" v-model="dataInfo.branchId" :localdata="dataInfo.branchList" :clear="false" placeholder="请选择院区" @change="changeBranch" :class="{formRed: isSubmit && !dataInfo.branchId}"></uni-data-select>
30 30
         </view>
31 31
         <view class="form_item">
32 32
           <view class="title select"><text class="required newicon newicon-bitian"></text>责任科室:</view>
33
-          <uni-data-select class="value" v-model="dataInfo.dutyId" :localdata="dataInfo.dutyList" :clear="false" placeholder="请选择责任科室" @change="changeDuty" :class="{formRed: isSubmmit && !dataInfo.dutyId}"></uni-data-select>
33
+          <uni-data-select class="value" v-model="dataInfo.dutyId" :localdata="dataInfo.dutyList" :clear="false" placeholder="请选择责任科室" @change="changeDuty" :class="{formRed: isSubmit && !dataInfo.dutyId}"></uni-data-select>
34 34
         </view>
35 35
         <view class="form_item">
36 36
           <view class="title select"><text class="required newicon newicon-bitian"></text>工作组:</view>
37
-          <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmmit && !dataInfo.groupId}"></uni-data-select>
37
+          <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}"></uni-data-select>
38 38
         </view>
39 39
         <view class="form_item">
40 40
           <view class="title radio"><text class="required newicon newicon-bitian"></text>是否指派到人:</view>
@@ -42,7 +42,7 @@
42 42
         </view>
43 43
         <view class="form_item" v-if="dataInfo.isAssignUser === 1">
44 44
           <view class="title select"><text class="required newicon newicon-bitian"></text>指派对象:</view>
45
-          <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择指派对象" :class="{formRed: isSubmmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select>
45
+          <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择指派对象" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select>
46 46
         </view>
47 47
       </template>
48 48
       
@@ -50,14 +50,14 @@
50 50
       <template v-if="dataInfo.tabActiveValue === 'reassign'">
51 51
         <view class="form_item column">
52 52
           <view class="title"><text class="required newicon newicon-bitian"></text>退回原因:</view>
53
-          <uni-easyinput class="value" type="textarea" v-model="dataInfo.reassignRemark" placeholder="请输入退回原因" :class="{formRed: isSubmmit && !dataInfo.reassignRemark.trim()}" />
53
+          <uni-easyinput class="value" type="textarea" v-model="dataInfo.reassignRemark" placeholder="请输入退回原因" :class="{formRed: isSubmit && !dataInfo.reassignRemark.trim()}" />
54 54
           <view class="tips">注:退回后,由调度台重新指派。</view>
55 55
         </view>
56 56
       </template>
57 57
     </scroll-view>
58 58
     <view class="foot_common_btns">
59 59
       <button @click="goBack" type="default" class="cancelButton btn">返回</button>
60
-      <button @click="submmit" type="default" class="primaryButton btn">提交</button>
60
+      <button @click="submit" type="default" class="primaryButton btn">提交</button>
61 61
     </view>
62 62
   </view>
63 63
 </template>
@@ -108,7 +108,7 @@
108 108
   })
109 109
   
110 110
   // 是否提交
111
-  const isSubmmit = ref(false)
111
+  const isSubmit = ref(false)
112 112
   
113 113
   // 重置
114 114
   function reset(){
@@ -144,7 +144,7 @@
144 144
       return;
145 145
     }
146 146
     dataInfo.tabActiveValue = tabValue;
147
-    isSubmmit.value = false;
147
+    isSubmit.value = false;
148 148
     reset();
149 149
     initForm()
150 150
   }
@@ -393,20 +393,20 @@
393 393
   }
394 394
   
395 395
   // 提交
396
-  function submmit(){
397
-    isSubmmit.value = true;
396
+  function submit(){
397
+    isSubmit.value = true;
398 398
     
399 399
     if(dataInfo.tabActiveValue === 'redeploy'){
400
-      submmitRedeploy();
400
+      submitRedeploy();
401 401
     }else if(dataInfo.tabActiveValue === 'assign'){
402
-      submmitAssign();
402
+      submitAssign();
403 403
     }else if(dataInfo.tabActiveValue === 'reassign'){
404
-      submmitReassign();
404
+      submitReassign();
405 405
     }
406 406
   }
407 407
   
408 408
   // 转派提交
409
-  function submmitRedeploy(){
409
+  function submitRedeploy(){
410 410
     if(!dataInfo.groupId){
411 411
       uni.showToast({
412 412
       	icon: 'none',
@@ -463,7 +463,7 @@
463 463
   }
464 464
   
465 465
   // 指派提交
466
-  function submmitAssign(){
466
+  function submitAssign(){
467 467
     if(!dataInfo.branchId){
468 468
       uni.showToast({
469 469
       	icon: 'none',
@@ -536,7 +536,7 @@
536 536
   }
537 537
   
538 538
   // 退回提交
539
-  function submmitReassign(){
539
+  function submitReassign(){
540 540
     if(!dataInfo.reassignRemark.trim()){
541 541
       uni.showToast({
542 542
       	icon: 'none',
@@ -620,7 +620,7 @@
620 620
       display: flex;
621 621
       align-items: center;
622 622
       padding-top: 24rpx;
623
-      height: 86rpx;
623
+      min-height: 86rpx;
624 624
       &.column{
625 625
         height: auto;
626 626
         flex-direction: column;

+ 1 - 1
pages/consumableList/consumableList.vue

@@ -94,7 +94,7 @@
94 94
           mask: true,
95 95
         });
96 96
         setTimeout(() => {
97
-          uni.reLaunch({
97
+          uni.redirectTo({
98 98
             url: `/pages/handler/handler?incidentId=${dataInfo.incidentId}`,
99 99
           })
100 100
         }, 1500)

+ 344 - 401
pages/handler/handler.vue

@@ -5,7 +5,7 @@
5 5
         {{tab.name}}<text v-if="tab.num !== ''">({{tab.num}})</text>
6 6
       </view>
7 7
     </view>
8
-    <scroll-view scroll-y class="body">
8
+    <scroll-view scroll-y class="body" :class="{ page_padding: !(dataInfo.tabActiveValue === 'doing' && isInSummaryOrder), bg: (dataInfo.tabActiveValue === 'doing' && isInSummaryOrder) }">
9 9
       <!-- 汇总单 -->
10 10
       <template v-if="dataInfo.tabActiveValue === 'doing' && isInSummaryOrder">
11 11
         <!-- 耗材 -->
@@ -73,26 +73,44 @@
73 73
       </template>
74 74
       
75 75
       <!-- 故障处理 -->
76
-      <template v-if="dataInfo.tabActiveValue === 'doing' && !isInSummaryOrder">故障处理
77
-        <view class="form_item">
78
-          <view class="title select"><text class="required newicon newicon-bitian"></text>院区:</view>
79
-          <uni-data-select class="value" v-model="dataInfo.branchId" :localdata="dataInfo.branchList" :clear="false" placeholder="请选择院区" @change="changeBranch" :class="{formRed: isSubmmit && !dataInfo.branchId}"></uni-data-select>
76
+      <template v-if="dataInfo.tabActiveValue === 'doing' && !isInSummaryOrder">
77
+        <view class="form_item column" v-if="dataInfo.category.hasSimple != 1">
78
+          <view class="title"><text class="required newicon newicon-bitian"></text>解决方案:</view>
79
+          <uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
80 80
         </view>
81
-        <view class="form_item">
82
-          <view class="title select"><text class="required newicon newicon-bitian"></text>责任科室:</view>
83
-          <uni-data-select class="value" v-model="dataInfo.dutyId" :localdata="dataInfo.dutyList" :clear="false" placeholder="请选择责任科室" @change="changeDuty" :class="{formRed: isSubmmit && !dataInfo.dutyId}"></uni-data-select>
81
+        <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
82
+          <view class="title"><text class="required newicon newicon-bitian"></text>故障现象:</view>
83
+          <view class="value category" @click="selectCategory">
84
+            <text class="categoryName ellipsis-multiline">{{dataInfo.category.mutiCategory}}</text>
85
+            <text class="newicon newicon-weibiaoti2010104"></text>
86
+          </view>
84 87
         </view>
85 88
         <view class="form_item">
86
-          <view class="title select"><text class="required newicon newicon-bitian"></text>工作组:</view>
87
-          <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmmit && !dataInfo.groupId}"></uni-data-select>
89
+          <view class="title select"><text class="required newicon newicon-bitian"></text>处理方式:</view>
90
+          <uni-data-select class="value" v-model="dataInfo.handleCategory" :localdata="dataInfo.handleCategoryList" :clear="false" placeholder="请选择处理方式" :class="{formRed: isSubmit && !dataInfo.handleCategory}"></uni-data-select>
91
+        </view>
92
+        <view class="form_item" v-if="dataInfo.category.hasSimple != 1">
93
+          <view class="title select"><text class="required newicon newicon-bitian"></text>关闭代码:</view>
94
+          <uni-data-select class="value" v-model="dataInfo.closecode" :localdata="dataInfo.closecodeList" :clear="false" placeholder="请选择关闭代码" :class="{formRed: isSubmit && !dataInfo.closecode}"></uni-data-select>
88 95
         </view>
89 96
         <view class="form_item">
90
-          <view class="title radio"><text class="required newicon newicon-bitian"></text>是否指派到人:</view>
91
-          <uni-data-checkbox class="value" v-model="dataInfo.isAssignUser" :localdata="dataInfo.isAssignUserList" @change="changeIsAssignUser" />
97
+          <view class="title"><text class="required newicon newicon-bitian transparent"></text>协同人员:</view>
98
+          <text class="synergeticNames ellipsis">{{dataInfo.synergetic.map(v => v.name).join(',')}}</text>
99
+          <button type="primary" plain size="mini" class="primaryPlainButton synergeticAdd" @click="synergeticAdd">+立即添加</button>
92 100
         </view>
93
-        <view class="form_item" v-if="dataInfo.isAssignUser === 1">
94
-          <view class="title select"><text class="required newicon newicon-bitian"></text>指派对象:</view>
95
-          <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择指派对象" :class="{formRed: isSubmmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select>
101
+        <view class="form_item_column">
102
+          <view class="form_item">
103
+            <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
104
+            <view class="value">
105
+              <uni-file-picker ref="handlerImgRef" v-model="dataInfo.handlerImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
106
+            </view>
107
+          </view>
108
+          <view class="form_item">
109
+            <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>处理图片:</view>
110
+            <view class="value">
111
+              <text class="imgTips ellipsis">(支持JPG/PNG格式图片,单张大小10M以内)</text>
112
+            </view>
113
+          </view>
96 114
         </view>
97 115
       </template>
98 116
       
@@ -100,21 +118,21 @@
100 118
       <template v-if="dataInfo.tabActiveValue === 'overtime'">
101 119
         <view class="form_item">
102 120
           <view class="title select"><text class="required newicon newicon-bitian"></text>延期原因:</view>
103
-          <uni-data-select class="value" v-model="dataInfo.repairTypeId" :localdata="dataInfo.repairTypeList" :clear="false" placeholder="请选择延期原因" :class="{formRed: isSubmmit && !dataInfo.repairTypeId}"></uni-data-select>
121
+          <uni-data-select class="value" v-model="dataInfo.repairTypeId" :localdata="dataInfo.repairTypeList" :clear="false" placeholder="请选择延期原因" :class="{formRed: isSubmit && !dataInfo.repairTypeId}"></uni-data-select>
104 122
         </view>
105 123
         <view class="form_item column">
106 124
           <view class="title"><text class="required newicon newicon-bitian"></text>延期说明:</view>
107
-          <uni-easyinput class="value" type="textarea" v-model="dataInfo.deferralRemark" placeholder="请输入延期说明" :class="{formRed: isSubmmit && !dataInfo.deferralRemark.trim()}" />
125
+          <uni-easyinput class="value" type="textarea" v-model="dataInfo.deferralRemark" placeholder="请输入延期说明" :class="{formRed: isSubmit && !dataInfo.deferralRemark.trim()}" />
108 126
         </view>
109 127
         <view class="form_item">
110 128
           <view class="title select"><text class="required newicon newicon-bitian"></text>延期天数:</view>
111
-          <uni-data-select class="value" v-model="dataInfo.deferralDayId" :localdata="dataInfo.deferralDayList" :clear="false" placeholder="请选择延期天数" :class="{formRed: isSubmmit && !dataInfo.deferralDayId}"></uni-data-select>
129
+          <uni-data-select class="value" v-model="dataInfo.deferralDayId" :localdata="dataInfo.deferralDayList" :clear="false" placeholder="请选择延期天数" :class="{formRed: isSubmit && !dataInfo.deferralDayId}"></uni-data-select>
112 130
         </view>
113 131
       </template>
114 132
     </scroll-view>
115 133
     <view class="foot_common_btns">
116 134
       <button @click="goBack" type="default" class="cancelButton btn">返回</button>
117
-      <button @click="submmit" type="default" class="primaryButton btn">{{dataInfo.tabActiveValue === 'doing' && isInSummaryOrder ? '下一步' : '提交'}}</button>
135
+      <button @click="submit" type="default" class="primaryButton btn">{{dataInfo.tabActiveValue === 'doing' && isInSummaryOrder ? '下一步' : '提交'}}</button>
118 136
     </view>
119 137
     <NumberModal v-if="dataInfo.isNumber" @cancelEmit="cancelNumber" @confirmEmit="conformNumber" @removeEmit="removeNumber" :selectData="dataInfo.selectData" :selectType="dataInfo.selectType" :evtNumber="dataInfo.evtNumber" showRemove></NumberModal>
120 138
   </view>
@@ -125,26 +143,25 @@
125 143
   import NumberModal from '@/components/NumberModal.vue';
126 144
   import { onLoad } from '@dcloudio/uni-app'
127 145
   import { generateNumberArray } from '@/utils/index.js'
128
-  import { api_group, api_incidentDetail, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_getDictionary, api_querySummaryDoc, api_addSummaryDoc } from "@/http/api.js"
146
+  import { api_group, api_incidentDetail, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_getDictionary, api_querySummaryDoc, api_addSummaryDoc, api_uploadAttachment } from "@/http/api.js"
129 147
   import { defaultColor } from '@/static/js/theme.js'
130 148
   import { useSetTitle } from '@/share/useSetTitle.js'
131 149
   import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
150
+  import { useUploadFile } from '@/share/useUploadFile.js'
132 151
   import { useGoBack } from '@/share/useGoBack.js'
133 152
   import { useLoginUserStore } from '@/stores/loginUser'
153
+  import { useHandlerStore } from '@/stores/handler'
134 154
   
135 155
   useSetTitle();
136 156
   const loginUserStore = useLoginUserStore();
157
+  const handlerStore = useHandlerStore();
137 158
   const { makePhoneCall }  = useMakePhoneCall();
159
+  const { uploadFile }  = useUploadFile();
138 160
   const { goBack }  = useGoBack();
139 161
   
140 162
   // 主题颜色
141 163
   const primaryColor = ref(defaultColor)
142 164
   
143
-  // 是否进入汇总单
144
-  const isInSummaryOrder = computed(() => () => {
145
-    return dataInfo.tabActiveValue === 'doing' && dataInfo.incidentData.duty && dataInfo.incidentData.duty.addSummary == 1 && (dataInfo.incidentData.handlerUser.id == loginUserStore.loginUser.user.id);
146
-  })
147
-  
148 165
   // 数据
149 166
   const dataInfo = reactive({
150 167
     tabs: [
@@ -154,24 +171,10 @@
154 171
     tabActiveValue: 0,//当前选择的tab
155 172
     incidentId: undefined,//事件ID
156 173
     incidentData: {},//事件对象
157
-    groupList: [], //工作组列表
158
-    groupId: undefined, //工作组ID
159
-    userList: [], //用户列表
160
-    userId: undefined, //用户ID
161
-    branchList: [], //院区列表
162
-    branchId: undefined, //院区ID
163
-    dutyList: [], //责任科室列表
164
-    dutyId: undefined, //责任科室ID
165
-    repairTypeList: [], //维修原因列表
166
-    repairTypeId: undefined, //维修原因ID
174
+    repairTypeList: [], //延期原因列表
175
+    repairTypeId: undefined, //延期原因ID
167 176
     deferralDayList: [], //延期天数列表
168 177
     deferralDayId: undefined, //延期天数ID
169
-    isAssignUser: 1, //工作组是否转派到人
170
-    isAssignUserList: [
171
-      { text: '是', value: 1 },
172
-      { text: '否', value: 0 },
173
-    ], //工作组是否转派到人选项
174
-    reassignRemark: '',//退回原因
175 178
     deferralRemark: '',//延期说明
176 179
     summaryObj: {
177 180
       consumableList: [],//耗材列表
@@ -182,10 +185,98 @@
182 185
     evtNumber: 1,//弹窗返回的数量
183 186
     selectData: {},//选择的对象
184 187
     selectType: {},//选择的对象类型
188
+    handleDescription: '',//解决方案
189
+    handleCategory: undefined,//处理方式
190
+    handleCategoryList: [],//处理方式列表
191
+    closecode: undefined,//关闭代码
192
+    closecodeList: [],//关闭代码列表
193
+    handlerImgList: [],//处理图片列表
194
+    category: {},//故障现象
195
+    synergetic: [],//协同人员
185 196
   })
186 197
   
187 198
   // 是否提交
188
-  const isSubmmit = ref(false)
199
+  const isSubmit = ref(false)
200
+  
201
+  // 处理图片
202
+  const handlerImgRef = ref(null)
203
+  
204
+  // 是否进入汇总单
205
+  const isInSummaryOrder = computed(() => {
206
+    return dataInfo.tabActiveValue === 'doing' && dataInfo.incidentData.duty && dataInfo.incidentData.duty.addSummary == 1 && (dataInfo.incidentData.handlingPersonnelUser.id == loginUserStore.loginUser.user.id);
207
+  })
208
+  
209
+  // 上传处理图片成功
210
+  function handlerImgSuccess(e){
211
+    dataInfo.handlerImgList.forEach(v => {
212
+      v.url = v.path;
213
+    })
214
+    console.log(dataInfo.handlerImgList);
215
+    let handlerOrder$ = handlerOrder();
216
+    let requestList = [handlerOrder$];
217
+    dataInfo.handlerImgList.forEach(v => {
218
+      let handlerOrderImg$ = handlerOrderImg(v);
219
+      requestList.push(handlerOrderImg$);
220
+    })
221
+    
222
+    Promise.all(requestList).then(resList => {
223
+      uni.hideLoading();
224
+      console.log(resList);
225
+      if(resList[0].state == 200){
226
+        uni.showToast({
227
+        	icon: 'none',
228
+          title: '处理成功',
229
+          mask: true,
230
+        });
231
+        setTimeout(() => {
232
+          uni.reLaunch({
233
+            url: '/pages/incidentList/incidentList',
234
+          })
235
+        }, 1500)
236
+      }else{
237
+        uni.showToast({
238
+          icon: 'none',
239
+          title: resList[0].msg || '请求数据失败!'
240
+        });
241
+      }
242
+    })
243
+  }
244
+  
245
+  // 上传处理图片失败
246
+  function handlerImgFail(e){
247
+    dataInfo.handlerImgList.forEach(v => {
248
+      v.url = v.path;
249
+    })
250
+    console.log(dataInfo.handlerImgList);
251
+  }
252
+  
253
+  // 选择上传图片
254
+  function handlerImgSelect(e){
255
+    dataInfo.handlerImgList = dataInfo.handlerImgList.concat(e.tempFiles);
256
+    console.log(dataInfo.handlerImgList);
257
+  }
258
+  
259
+  // 删除上传图片
260
+  function handlerImgDelete(e){
261
+    dataInfo.handlerImgList = dataInfo.handlerImgList.filter(v => e.tempFile.uuid != v.uuid);
262
+    console.log(dataInfo.handlerImgList);
263
+  }
264
+  
265
+  // 添加协同人员
266
+  function synergeticAdd(){
267
+    handlerStore.setHandlerData(dataInfo);
268
+    uni.navigateTo({
269
+      url: `/pages/synergeticAdd/synergeticAdd?incidentId=${dataInfo.incidentId}`
270
+    })
271
+  }
272
+  
273
+  // 选择故障现象
274
+  function selectCategory(){
275
+    handlerStore.setHandlerData(dataInfo);
276
+    uni.navigateTo({
277
+      url: `/pages/categoryOne/categoryOne?incidentId=${dataInfo.incidentId}`
278
+    })
279
+  }
189 280
   
190 281
   // 点击修改数量
191 282
   function numberClick(data, type){
@@ -307,28 +398,37 @@
307 398
   
308 399
   // 重置
309 400
   function reset(){
310
-    dataInfo.branchId = undefined;
311
-    dataInfo.branchList = [];
312
-    
313
-    dataInfo.dutyId = undefined;
314
-    dataInfo.dutyList = [];
315
-    
316
-    dataInfo.groupId = undefined;
317
-    dataInfo.groupList = [];
318
-    
319
-    dataInfo.userId = undefined;
320
-    dataInfo.userList = [];
321
-    
322
-    dataInfo.isAssignUser = 1;
323
-    
324
-    dataInfo.reassignRemark = '';
325
-    dataInfo.deferralRemark = '';
401
+    dataInfo.repairTypeList = []; //延期原因列表
402
+    dataInfo.repairTypeId = undefined; //延期原因ID
403
+    dataInfo.deferralDayList = []; //延期天数列表
404
+    dataInfo.deferralDayId = undefined; //延期天数ID
405
+    dataInfo.deferralRemark = '';//延期说明
406
+    dataInfo.summaryObj = {
407
+      consumableList: [],//耗材列表
408
+      workHourManagementList: [],//工时列表
409
+    };//汇总单信息
410
+    dataInfo.summaryId = undefined;//汇总单Id
411
+    dataInfo.isNumber = false;//修改数量弹窗
412
+    dataInfo.evtNumber = 1;//弹窗返回的数量
413
+    dataInfo.selectData = {};//选择的对象
414
+    dataInfo.selectType = {};//选择的对象类型
415
+    dataInfo.handleDescription = '';//解决方案
416
+    dataInfo.handleCategory = undefined;//处理方式
417
+    dataInfo.handleCategoryList = [];//处理方式列表
418
+    dataInfo.closecode = undefined;//关闭代码
419
+    dataInfo.closecodeList = [];//关闭代码列表
420
+    dataInfo.handlerImgList = [];//处理图片列表
421
+    dataInfo.category = {};//故障现象
422
+    dataInfo.synergetic = [];//协同人员
326 423
   }
327 424
   
328 425
   // 初始化表单
329 426
   function initForm(){
330
-    if(dataInfo.tabActiveValue === 'doing'){
427
+    if(dataInfo.tabActiveValue === 'doing' && isInSummaryOrder.value){
331 428
       getSummaryList();
429
+    }else if(dataInfo.tabActiveValue === 'doing' && !isInSummaryOrder.value){
430
+      getHandleCategorys();
431
+      getClosecodes();
332 432
     }else if(dataInfo.tabActiveValue === 'overtime'){
333 433
       getRepairTypes();
334 434
       getDeferralDays();
@@ -341,13 +441,13 @@
341 441
       return;
342 442
     }
343 443
     dataInfo.tabActiveValue = tabValue;
344
-    isSubmmit.value = false;
444
+    isSubmit.value = false;
345 445
     reset();
346
-    initForm()
446
+    initForm();
347 447
   }
348 448
   
349 449
   // 获取事件详情
350
-  function getIncidentDetail(){
450
+  function getIncidentDetail(isSummaryNext = false){
351 451
     uni.showLoading({
352 452
       title: "加载中",
353 453
       mask: true,
@@ -357,19 +457,37 @@
357 457
       uni.hideLoading();
358 458
       if(res.status == 200){
359 459
         dataInfo.incidentData = res.data || {};
360
-        let chuli = false;//故障处理权限
361
-        for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
362
-            if (loginUserStore.loginUser.menu[i].link == "shijianliebiao_chuli") {
363
-              chuli = true
364
-            }
365
-        }
366 460
         
367
-        // 故障处理
368
-        if(dataInfo.incidentData.state.value == 'handler' && dataInfo.incidentData.handlingPersonnelUser && dataInfo.incidentData.handlingPersonnelUser.id == loginUserStore.loginUser.user.id && chuli){
369
-          dataInfo.tabs.splice(0, 0, {id: 5, name: '故障处理', value: 'doing', num: ''});
461
+        if(isSummaryNext){
462
+          // 汇总单-下一步
463
+          dataInfo.incidentData.duty.addSummary = 0;
370 464
         }
371 465
         
372
-        dataInfo.tabActiveValue = dataInfo.tabs[0].value;
466
+        // 跳转页面选择了选项并且工单ID一致
467
+        if(handlerStore.handler.data && handlerStore.handler.data.incidentId == dataInfo.incidentId){
468
+          Object.assign(dataInfo, handlerStore.handler.data);
469
+          console.log(dataInfo)
470
+          handlerStore.clearHandlerData();
471
+        }else{
472
+          // 初始化回显
473
+          dataInfo.category = dataInfo.incidentData.category || {};
474
+          dataInfo.synergetic = dataInfo.incidentData.synergetic || [];
475
+          
476
+          let chuli = false;//故障处理权限
477
+          for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
478
+              if (loginUserStore.loginUser.menu[i].link == "shijianliebiao_chuli") {
479
+                chuli = true
480
+              }
481
+          }
482
+          
483
+          // 故障处理
484
+          if(dataInfo.incidentData.state.value == 'handler' && dataInfo.incidentData.handlingPersonnelUser && dataInfo.incidentData.handlingPersonnelUser.id == loginUserStore.loginUser.user.id && chuli){
485
+            let flag = dataInfo.tabs.some(v => v.value === 'doing');
486
+            !flag && dataInfo.tabs.splice(0, 0, {id: 5, name: '故障处理', value: 'doing', num: ''});
487
+          }
488
+          
489
+          dataInfo.tabActiveValue = dataInfo.tabs[0].value;
490
+        }
373 491
         
374 492
         initForm()
375 493
       }else{
@@ -401,6 +519,56 @@
401 519
     })
402 520
   }
403 521
   
522
+  // 获取处理方式列表
523
+  function getHandleCategorys(){
524
+    uni.showLoading({
525
+      title: "加载中",
526
+      mask: true,
527
+    });
528
+    let postData = {
529
+      "key": 'incident_handleCategory',
530
+      "type": "list",
531
+    };
532
+    api_getDictionary(postData).then(res => {
533
+      uni.hideLoading();
534
+      res = res || [];
535
+      dataInfo.handleCategoryList = res.map(v => ({
536
+        text: v.name,
537
+        value: v.id,
538
+        key: v.value,
539
+      }));
540
+      if(!dataInfo.handleCategory){
541
+        let handleCategory = dataInfo.handleCategoryList.find(v => v.key == 'SUPPORT');
542
+        dataInfo.handleCategory = handleCategory ? handleCategory.value : undefined;
543
+      }
544
+    })
545
+  }
546
+  
547
+  // 获取关闭代码列表
548
+  function getClosecodes(){
549
+    uni.showLoading({
550
+      title: "加载中",
551
+      mask: true,
552
+    });
553
+    let postData = {
554
+      "key": 'incident_closecode',
555
+      "type": "list",
556
+    };
557
+    api_getDictionary(postData).then(res => {
558
+      uni.hideLoading();
559
+      res = res || [];
560
+      dataInfo.closecodeList = res.map(v => ({
561
+        text: v.name,
562
+        value: v.id,
563
+        key: v.value,
564
+      }));
565
+      if(!dataInfo.closecode){
566
+        let closecode = dataInfo.closecodeList.find(v => v.key == '060');
567
+        dataInfo.closecode = closecode ? closecode.value : undefined;
568
+      }
569
+    })
570
+  }
571
+  
404 572
   // 获取延期天数列表
405 573
   function getDeferralDays(){
406 574
     dataInfo.deferralDayList = generateNumberArray(1, 15).map(v => ({
@@ -450,377 +618,112 @@
450 618
     })
451 619
   }
452 620
   
453
-  // 获取院区列表
454
-  function getBranchs(){
455
-    uni.showLoading({
456
-      title: "加载中",
457
-      mask: true,
458
-    });
459
-    let postData = {
460
-      "idx": 0,
461
-      "sum": 9999,
462
-    };
463
-    api_branch(postData).then(res => {
464
-      uni.hideLoading();
465
-      if(res.status == 200){
466
-        res.list = res.list || [];
467
-        dataInfo.branchList = res.list.map(v => ({
468
-          text: v.hosName,
469
-          value: v.id,
470
-        }));
471
-        
472
-        if(loginUserStore.loginUser.user.duty){
473
-          // 当前的所属责任科室
474
-          dataInfo.branchId = loginUserStore.loginUser.user.duty.branch;
475
-          changeBranch();
476
-          
477
-          dataInfo.dutyId = loginUserStore.loginUser.user.duty.id;
478
-          changeDuty();
479
-        }else if(loginUserStore.loginUser.user.branch){
480
-          // 当前的所属院区
481
-          dataInfo.branchId = loginUserStore.loginUser.user.branch.id;
482
-        }
483
-      }else{
484
-        uni.showToast({
485
-          icon: 'none',
486
-          title: res.msg || '请求数据失败!'
487
-        });
488
-      }
489
-    })
490
-  }
491
-  
492
-  // 获取责任科室列表
493
-  function getDutys(){
494
-    uni.showLoading({
495
-      title: "加载中",
496
-      mask: true,
497
-    });
498
-    let postData = {
499
-      "idx": 0,
500
-      "sum": 9999,
501
-      "dutyDepartment": {
502
-        "branch": dataInfo.branchId,
503
-      }
504
-    };
505
-    api_dutyDepartment(postData).then(res => {
506
-      uni.hideLoading();
507
-      if(res.status == 200){
508
-        res.list = res.list || [];
509
-        dataInfo.dutyList = res.list.map(v => ({
510
-          text: v.dept,
511
-          value: v.id,
512
-        }));
513
-      }else{
514
-        uni.showToast({
515
-          icon: 'none',
516
-          title: res.msg || '请求数据失败!'
517
-        });
518
-      }
519
-    })
520
-  }
521
-  
522
-  // 获取工作组列表
523
-  function getGroups(){
524
-    uni.showLoading({
525
-      title: "加载中",
526
-      mask: true,
527
-    });
528
-    
529
-    let duty = undefined;
530
-    if(dataInfo.tabActiveValue === 'redeploy'){
531
-      duty = dataInfo.incidentData.duty;
532
-    }else if(dataInfo.tabActiveValue === 'assign'){
533
-      duty = { id: dataInfo.dutyId };
534
-    }
535
-    
536
-    let postData = {
537
-      "idx": 0,
538
-      "sum": 9999,
539
-      "group": {
540
-          "duty": duty,
541
-          "selectType": "nouser"
542
-      }
543
-    };
544
-    api_group(postData).then(res => {
545
-      uni.hideLoading();
546
-      if(res.status == 200){
547
-        res.list = res.list || [];
548
-        dataInfo.groupList = res.list.map(v => ({
549
-          text: v.groupName,
550
-          value: v.id,
551
-        }));
552
-      }else{
553
-        uni.showToast({
554
-          icon: 'none',
555
-          title: res.msg || '请求数据失败!'
556
-        });
557
-      }
558
-    })
559
-  }
560
-  
561
-  // 获取用户列表
562
-  function getUsers(){
563
-    uni.showLoading({
564
-      title: "加载中",
565
-      mask: true,
566
-    });
567
-    let postData = {
568
-      "idx": 0,
569
-      "sum": 9999,
570
-      "user": {
571
-          "groupdata":{
572
-            "id": dataInfo.groupId,
573
-          },
574
-          "roledata": {
575
-              "rolecode": "first-line support"
576
-          },
577
-          "roledata2": {
578
-              "rolecode": "second-line support"
579
-          },
580
-          "selectType": "1",
581
-          "selectDetails": 1,
582
-          "simple": true,
583
-          "engineer": 1
584
-      }
585
-    };
586
-    api_user(postData).then(res => {
587
-      uni.hideLoading();
588
-      if(res.status == 200){
589
-        res.list = res.list || [];
590
-        dataInfo.userList = res.list.map(v => ({
591
-          text: v.name,
592
-          value: v.id,
593
-        }));
594
-      }else{
595
-        uni.showToast({
596
-          icon: 'none',
597
-          title: res.msg || '请求数据失败!'
598
-        });
599
-      }
600
-    })
601
-  }
602
-  
603
-  // 选择院区
604
-  function changeBranch(){
605
-    dataInfo.dutyId = undefined;
606
-    dataInfo.dutyList = [];
607
-    
608
-    dataInfo.groupId = undefined;
609
-    dataInfo.groupList = [];
610
-    
611
-    dataInfo.userId = undefined;
612
-    dataInfo.userList = [];
613
-    getDutys();
614
-  }
615
-  
616
-  // 选择责任科室
617
-  function changeDuty(){
618
-    dataInfo.groupId = undefined;
619
-    dataInfo.groupList = [];
620
-    
621
-    dataInfo.userId = undefined;
622
-    dataInfo.userList = [];
623
-    getGroups();
624
-  }
625
-  
626
-  // 选择工作组
627
-  function changeGroup(){
628
-    dataInfo.userId = undefined;
629
-    dataInfo.userList = [];
630
-    getUsers();
631
-  }
632
-  
633
-  // 选择是否转派到人
634
-  function changeIsAssignUser(){
635
-    dataInfo.userId = undefined;
636
-  }
637
-  
638 621
   // 提交
639
-  function submmit(){
640
-    isSubmmit.value = true;
641
-    if(dataInfo.tabActiveValue === 'doing' && isInSummaryOrder){
642
-      
643
-    }else if(dataInfo.tabActiveValue === 'doing' && isInSummaryOrder){
644
-      
622
+  function submit(){
623
+    isSubmit.value = true;
624
+    if(dataInfo.tabActiveValue === 'doing' && isInSummaryOrder.value){
625
+      isSubmit.value = false;
626
+      getIncidentDetail(true);
627
+    }else if(dataInfo.tabActiveValue === 'doing' && !isInSummaryOrder.value){
628
+      submitHandler();
645 629
     }else if(dataInfo.tabActiveValue === 'overtime'){
646
-      submmitOvertime();
630
+      submitOvertime();
647 631
     }
648 632
   }
649 633
   
650
-  // 转派提交
651
-  function submmitRedeploy(){
652
-    if(!dataInfo.groupId){
653
-      uni.showToast({
654
-      	icon: 'none',
655
-        title: '请选择工作组'
656
-      });
657
-      return;
658
-    }
659
-    
660
-    if(dataInfo.isAssignUser == 1 && !dataInfo.userId){
661
-      uni.showToast({
662
-      	icon: 'none',
663
-        title: '请选择指派对象'
664
-      });
665
-      return;
666
-    }
667
-    
668
-    uni.showLoading({
669
-      title: "加载中",
670
-      mask: true,
671
-    });
672
-    
634
+  // 处理提交事件
635
+  function handlerOrder(){
673 636
     let postData = {
674 637
       incident: dataInfo.incidentData,
675 638
     }
676 639
     
677
-    if(dataInfo.userId){
678
-      // 派人
679
-      postData.incident.assignee = dataInfo.userId;
680
-    } else {
681
-      // 派组
682
-      postData.incident.candidateGroups = dataInfo.groupId;
683
-    }
640
+    postData.incident.handleDescription = dataInfo.handleDescription;
641
+    postData.incident.handlCategory = {id: dataInfo.handlCategory};
642
+    postData.incident.closecode = {id: dataInfo.closecode};
643
+    postData.incident.category = dataInfo.category;
644
+    postData.incident.synergetic = dataInfo.synergetic;
684 645
     
685
-    api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
686
-      uni.hideLoading();
687
-      if(res.state == 200){
688
-        uni.showToast({
689
-        	icon: 'none',
690
-          title: '转派成功',
691
-          mask: true,
692
-        });
693
-        setTimeout(() => {
694
-          uni.reLaunch({
695
-            url: '/pages/incidentList/incidentList',
696
-          })
697
-        }, 1500)
698
-      }else{
699
-        uni.showToast({
700
-          icon: 'none',
701
-          title: res.msg || '请求数据失败!'
702
-        });
703
-      }
704
-    })
646
+    return api_incidentTask(dataInfo.tabActiveValue, postData);
705 647
   }
706 648
   
707
-  // 指派提交
708
-  function submmitAssign(){
709
-    if(!dataInfo.branchId){
649
+  // 处理图片
650
+  function handlerOrderImg(imgObj){
651
+    return uploadFile(imgObj, 'incident', dataInfo.incidentId)
652
+  }
653
+  
654
+  // 处理提交
655
+  function submitHandler(){
656
+    console.log(dataInfo);
657
+    if(!dataInfo.handleDescription.trim() && dataInfo.category.hasSimple != 1){
710 658
       uni.showToast({
711 659
       	icon: 'none',
712
-        title: '请选择院区'
660
+        title: '请填写解决方案'
713 661
       });
714 662
       return;
715 663
     }
716 664
     
717
-    if(!dataInfo.dutyId){
665
+    if(!dataInfo.category.id && dataInfo.category.hasSimple != 1){
718 666
       uni.showToast({
719 667
       	icon: 'none',
720
-        title: '请选择责任科室'
668
+        title: '请选择故障现象'
721 669
       });
722 670
       return;
723 671
     }
724 672
     
725
-    if(!dataInfo.groupId){
673
+    if(!dataInfo.handleCategory){
726 674
       uni.showToast({
727 675
       	icon: 'none',
728
-        title: '请选择工作组'
676
+        title: '请选择处理方式'
729 677
       });
730 678
       return;
731 679
     }
732 680
     
733
-    if(dataInfo.isAssignUser == 1 && !dataInfo.userId){
681
+    if(!dataInfo.closecode && dataInfo.category.hasSimple != 1){
734 682
       uni.showToast({
735 683
       	icon: 'none',
736
-        title: '请选择指派对象'
684
+        title: '请选择关闭代码'
737 685
       });
738 686
       return;
739 687
     }
688
+    console.log(dataInfo.handlerImgList)
740 689
     
741 690
     uni.showLoading({
742 691
       title: "加载中",
743 692
       mask: true,
744 693
     });
745
-    
746
-    let postData = {
747
-      incident: dataInfo.incidentData,
748
-    }
749
-    
750
-    if(dataInfo.userId){
751
-      // 派人
752
-      postData.incident.assignee = dataInfo.userId;
753
-    } else {
754
-      // 派组
755
-      postData.incident.candidateGroups = dataInfo.groupId;
694
+    if(dataInfo.handlerImgList.length){
695
+      // 有图片
696
+      handlerImgRef.value.upload();
697
+    }else{
698
+      // 没有图片
699
+      let handlerOrder$ = handlerOrder();
700
+      let requestList = [handlerOrder$];
701
+      Promise.all(requestList).then(resList => {
702
+        uni.hideLoading();
703
+        console.log(resList);
704
+        if(resList[0].state == 200){
705
+          uni.showToast({
706
+          	icon: 'none',
707
+            title: '处理成功',
708
+            mask: true,
709
+          });
710
+          setTimeout(() => {
711
+            uni.reLaunch({
712
+              url: '/pages/incidentList/incidentList',
713
+            })
714
+          }, 1500)
715
+        }else{
716
+          uni.showToast({
717
+            icon: 'none',
718
+            title: resList[0].msg || '请求数据失败!'
719
+          });
720
+        }
721
+      })
756 722
     }
757
-    
758
-    api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
759
-      uni.hideLoading();
760
-      if(res.state == 200){
761
-        uni.showToast({
762
-        	icon: 'none',
763
-          title: '指派成功',
764
-          mask: true,
765
-        });
766
-        setTimeout(() => {
767
-          uni.reLaunch({
768
-            url: '/pages/incidentList/incidentList',
769
-          })
770
-        }, 1500)
771
-      }else{
772
-        uni.showToast({
773
-          icon: 'none',
774
-          title: res.msg || '请求数据失败!'
775
-        });
776
-      }
777
-    })
778 723
   }
779 724
   
780
-  // 退回提交
781
-  function submmitReassign(){
782
-    if(!dataInfo.reassignRemark.trim()){
783
-      uni.showToast({
784
-      	icon: 'none',
785
-        title: '请填写退回原因'
786
-      });
787
-      return;
788
-    }
789
-    
790
-    uni.showLoading({
791
-      title: "加载中",
792
-      mask: true,
793
-    });
794
-    
795
-    let postData = {
796
-      incident: dataInfo.incidentData,
797
-    }
798
-    
799
-    postData.incident.reassignRemark = dataInfo.reassignRemark;
800
-    
801
-    api_incidentTask(dataInfo.tabActiveValue, postData).then(res => {
802
-      uni.hideLoading();
803
-      if(res.state == 200){
804
-        uni.showToast({
805
-        	icon: 'none',
806
-          title: '退回成功',
807
-          mask: true,
808
-        });
809
-        setTimeout(() => {
810
-          uni.reLaunch({
811
-            url: '/pages/incidentList/incidentList',
812
-          })
813
-        }, 1500)
814
-      }else{
815
-        uni.showToast({
816
-          icon: 'none',
817
-          title: res.msg || '请求数据失败!'
818
-        });
819
-      }
820
-    })
821
-  }
822 725
   // 延期处理提交
823
-  function submmitOvertime(){
726
+  function submitOvertime(){
824 727
     if(!dataInfo.repairTypeId){
825 728
       uni.showToast({
826 729
       	icon: 'none',
@@ -894,7 +797,6 @@
894 797
   display: flex;
895 798
   flex-direction: column;
896 799
   justify-content: space-between;
897
-  background-color: #F7F7F7;
898 800
   .head{
899 801
     height: 88rpx;
900 802
     display: flex;
@@ -920,6 +822,9 @@
920 822
     box-sizing: border-box;
921 823
     flex: 1;
922 824
     min-height: 0;
825
+    &.bg{
826
+      background-color: #F7F7F7;
827
+    }
923 828
     .summaryItem{
924 829
       &:first-of-type{
925 830
         .summaryItem_head{
@@ -995,11 +900,19 @@
995 900
         }
996 901
       }
997 902
     }
903
+    .form_item_column{
904
+      padding-top: 24rpx;
905
+      min-height: 86rpx;
906
+      .form_item{
907
+        padding-top: 0;
908
+        min-height: auto;
909
+      }
910
+    }
998 911
     .form_item{
999 912
       display: flex;
1000 913
       align-items: center;
1001 914
       padding-top: 24rpx;
1002
-      height: 86rpx;
915
+      min-height: 86rpx;
1003 916
       &.column{
1004 917
         height: auto;
1005 918
         flex-direction: column;
@@ -1026,10 +939,40 @@
1026 939
         display: flex;
1027 940
         align-items: center;
1028 941
         margin-right: 12rpx;
942
+        flex-shrink: 0;
1029 943
         &.select{
1030 944
           width: calc(5em + 20rpx);
1031 945
         }
1032 946
       }
947
+      .value{
948
+        width: 100%;
949
+        &.category{
950
+          width: 100%;
951
+          display: flex;
952
+          justify-content: space-between;
953
+          align-items: center;
954
+          .categoryName{
955
+            font-size: 26rpx;
956
+            color: #555;
957
+            flex: 1;
958
+          }
959
+          .newicon-weibiaoti2010104{
960
+            color: $uni-primary;
961
+            margin-left: 24rpx;
962
+          }
963
+        }
964
+        .imgTips{
965
+          color: #909399;
966
+          font-size: 22rpx;
967
+        }
968
+      }
969
+      .synergeticNames{
970
+        font-size: 26rpx;
971
+        margin-right: 24rpx;
972
+      }
973
+      .synergeticAdd{
974
+        flex-shrink: 0;
975
+      }
1033 976
     }
1034 977
   }
1035 978
 }

+ 0 - 1
pages/incidentList/incidentList.vue

@@ -197,7 +197,6 @@
197 197
         uni.showToast({
198 198
         	icon: 'none',
199 199
           title: '接单成功',
200
-          mask: true,
201 200
         });
202 201
       }else{
203 202
         uni.showToast({

+ 3 - 3
pages/initBind/initBind.vue

@@ -8,7 +8,7 @@
8 8
         <view class="info_form_item">
9 9
           <label for="account" class="label"><text class="required newicon newicon-bitian"></text>工号:</label>
10 10
           <uni-easyinput class="flex1" v-model="postData.account" placeholder="请输入工号" focus
11
-            :styles="{borderColor: !postData.account.trim() && isSubmmit ? '#f00' : ''}" :primaryColor="primaryColor" />
11
+            :styles="{borderColor: !postData.account.trim() && isSubmit ? '#f00' : ''}" :primaryColor="primaryColor" />
12 12
         </view>
13 13
       </view>
14 14
     </view>
@@ -43,13 +43,13 @@
43 43
   const primaryColor = ref(defaultColor)
44 44
 
45 45
   // 是否提交
46
-  const isSubmmit = ref(false)
46
+  const isSubmit = ref(false)
47 47
 
48 48
   /**
49 49
    * 绑定
50 50
    */
51 51
   function bind() {
52
-    isSubmmit.value = true;
52
+    isSubmit.value = true;
53 53
     if(!postData.account.trim()){
54 54
       uni.showToast({
55 55
       	icon: 'none',

+ 205 - 0
pages/synergeticAdd/synergeticAdd.vue

@@ -0,0 +1,205 @@
1
+<template>
2
+  <view class="synergeticAdd">
3
+    <view class="body" v-if="dataInfo.list.length">
4
+      <uni-data-checkbox v-model="dataInfo.userList" multiple :localdata="dataInfo.list" mode="list" wrap icon="right" :map="{text:'name',value:'id'}" @change="selectItem"></uni-data-checkbox>
5
+    </view>
6
+    <view class="zanwu" v-else>
7
+      <text class="newicon newicon-zanwu"></text>
8
+    </view>
9
+    <view class="foot_common_btns">
10
+      <button @click="goBack" type="default" class="primaryButton btn">返回</button>
11
+      <button @click="confirm" type="default" class="primaryButton btn">确认</button>
12
+    </view>
13
+  </view>
14
+</template>
15
+
16
+<script setup>
17
+  import { ref, reactive} from 'vue'
18
+  import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
19
+  import { api_incidentDetail } from '@/http/api.js'
20
+  import { api_user } from "@/http/api.js"
21
+  import { defaultColor } from '@/static/js/theme.js'
22
+  import { useSetTitle } from '@/share/useSetTitle.js'
23
+  import { useLoginUserStore } from '@/stores/loginUser'
24
+  import { useHandlerStore } from '@/stores/handler'
25
+  import { useGoBack } from '@/share/useGoBack.js'
26
+  
27
+  useSetTitle();
28
+  const loginUserStore = useLoginUserStore();
29
+  const handlerStore = useHandlerStore();
30
+  const { goBack }  = useGoBack();
31
+  
32
+  // 主题颜色
33
+  const primaryColor = ref(defaultColor)
34
+  
35
+  // 数据
36
+  const dataInfo = reactive({
37
+    list: [],//工单列表
38
+    idx: 0,//页码
39
+    hasMore: true,//是否有更多数据
40
+    incidentId: undefined,//事件ID
41
+    incidentData: {},//事件对象
42
+    paramData: {},//传参
43
+    userList: [],//协同人列表-回显
44
+    userSelectedList: [],//协同人列表-已选择
45
+  })
46
+  
47
+  // 选择
48
+  function selectItem(e){
49
+    dataInfo.userSelectedList = e.detail.data;
50
+  }
51
+  
52
+  // 确认
53
+  function confirm(){
54
+    if(dataInfo.userSelectedList.length === 0){
55
+      uni.showToast({
56
+      	icon: 'none',
57
+        title: '请选择协同人员'
58
+      });
59
+      return;
60
+    }
61
+    dataInfo.paramData.synergetic = dataInfo.userSelectedList;
62
+    handlerStore.setHandlerData(dataInfo.paramData);
63
+    uni.redirectTo({
64
+      url: `/pages/handler/handler?incidentId=${dataInfo.incidentId}`,
65
+    })
66
+  }
67
+  
68
+  // 获取列表信息
69
+  function getList(idx){
70
+    uni.showLoading({
71
+      title: "加载中",
72
+      mask: true,
73
+    });
74
+    
75
+    dataInfo.idx = idx === undefined ? dataInfo.idx : idx;
76
+    if(dataInfo.idx === 0){
77
+      dataInfo.list = [];
78
+    }
79
+
80
+    let postData = {
81
+      idx: dataInfo.idx,
82
+      sum: 20,
83
+      user: {
84
+        currentDuty: dataInfo.incidentData.duty.id,
85
+        roleData: {
86
+          "rolecode": "first-line support"
87
+        }
88
+      }
89
+    }
90
+    
91
+    api_user(postData).then(res => {
92
+      uni.hideLoading();
93
+      uni.stopPullDownRefresh();
94
+      if(res.status == 200){
95
+        let list = res.list || [];
96
+        if(list.length){
97
+          dataInfo.hasMore = true;
98
+          dataInfo.list = dataInfo.idx === 0 ? list : dataInfo.list.concat(list);
99
+        }else{
100
+          dataInfo.hasMore = false;
101
+        }
102
+      }else{
103
+        uni.showToast({
104
+          icon: 'none',
105
+          title: res.msg || '请求数据失败!'
106
+        });
107
+      }
108
+    })
109
+  }
110
+  
111
+  // 获取传递的数据
112
+  function getParamData(){
113
+    dataInfo.paramData = handlerStore.handler.data || {};
114
+    dataInfo.userSelectedList = dataInfo.paramData.synergetic || [];
115
+    dataInfo.userList = dataInfo.userSelectedList.map(v => v.id);
116
+    getIncidentDetail();
117
+  }
118
+  
119
+  // 获取事件详情
120
+  function getIncidentDetail(){
121
+    uni.showLoading({
122
+      title: "加载中",
123
+      mask: true,
124
+    });
125
+    api_incidentDetail(dataInfo.incidentId).then(res => {
126
+      uni.hideLoading();
127
+      if(res.status == 200){
128
+        dataInfo.incidentData = res.data || {};
129
+        getList(0);
130
+      }else{
131
+        uni.showToast({
132
+          icon: 'none',
133
+          title: res.msg || '请求数据失败!'
134
+        });
135
+      }
136
+    })
137
+  }
138
+  
139
+  onLoad((option) => {
140
+    dataInfo.incidentId = option.incidentId;
141
+    getParamData();
142
+  })
143
+  
144
+  onPullDownRefresh(() => {
145
+    getList(0)
146
+  })
147
+  
148
+  onReachBottom(() => {
149
+    dataInfo.idx += 1;
150
+    if (dataInfo.hasMore) {
151
+      getList(); // 当触底时加载更多数据
152
+    }
153
+  })
154
+</script>
155
+
156
+<style lang="scss" scoped>
157
+.synergeticAdd{
158
+  display: flex;
159
+  flex-direction: column;
160
+  justify-content: space-between;
161
+  .head{
162
+    height: 88rpx;
163
+    display: flex;
164
+    align-items: center;
165
+    padding: 0 24rpx;
166
+    position: fixed;
167
+    z-index: 99;
168
+    width: 100%;
169
+    box-sizing: border-box;
170
+    background: #fff;
171
+    font-size: 26rpx;
172
+    color: $uni-primary;
173
+    .right{
174
+      margin-top: 2rpx;
175
+    }
176
+    .two{
177
+      flex: 1;
178
+    }
179
+  }
180
+  .body{
181
+    margin-bottom: 140rpx;
182
+    font-size: 26rpx;
183
+    .body_item{
184
+      border-bottom: 1rpx solid #DEDEDE;
185
+      padding: 24rpx;
186
+    }
187
+  }
188
+  .zanwu{
189
+    margin-bottom: 140rpx;
190
+    display: flex;
191
+    justify-content: center;
192
+    .newicon-zanwu{
193
+      font-size: 256rpx;
194
+      color: #D6D6D6;
195
+      margin-top: 140rpx;
196
+    }
197
+  }
198
+  .foot_common_btns{
199
+    position: fixed;
200
+    left: 0;
201
+    bottom: 0;
202
+    background-color: #fff;
203
+  }
204
+}
205
+</style>

+ 1 - 2
pages/workHourManagementTwo/workHourManagementTwo.vue

@@ -73,7 +73,6 @@
73 73
   // 选择
74 74
   function selectItem(e){
75 75
     let workHourManagementSelectedList = dataInfo.workHourManagementSelectedList.filter(v => v.parent.id != dataInfo.parentId);
76
-    let equelParentList = dataInfo.workHourManagementSelectedList.filter(v => v.parent.id == dataInfo.parentId);
77 76
     dataInfo.workHourManagementSelectedList = workHourManagementSelectedList.concat(e.detail.data);
78 77
   }
79 78
   
@@ -104,7 +103,7 @@
104 103
           mask: true,
105 104
         });
106 105
         setTimeout(() => {
107
-          uni.reLaunch({
106
+          uni.redirectTo({
108 107
             url: `/pages/handler/handler?incidentId=${dataInfo.incidentId}`,
109 108
           })
110 109
         }, 1500)

+ 45 - 0
share/useUploadFile.js

@@ -0,0 +1,45 @@
1
+import { api_uploadAttachment } from "@/http/api.js"
2
+export function useUploadFile() {
3
+  /**
4
+   * 压缩
5
+   */
6
+  const toBlob = (canvas, imgObj) => {
7
+    return new Promise((resolve,reject) => {
8
+      canvas.toBlob((fileSrc) => {
9
+        resolve(fileSrc)
10
+      }, `${imgObj.fileType}/${imgObj.extname}`, 0.3)
11
+    })
12
+  }
13
+  /**
14
+   * 上传图片
15
+   */
16
+  const uploadFile = async (imgObj, type, incidentId) => {
17
+    const res = await uni.getImageInfo({src: imgObj.url});
18
+    console.log('压缩前', res)
19
+    let canvasWidth = res.width //图片原始长宽
20
+    let canvasHeight = res.height
21
+    let img = new Image()
22
+    img.src = res.path
23
+    let canvas = document.createElement('canvas');
24
+    let ctx = canvas.getContext('2d')
25
+    canvas.width = canvasWidth
26
+    canvas.height = canvasHeight
27
+    ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight)
28
+    
29
+    const fileSrc = await toBlob(canvas, imgObj)
30
+    let tp = window.URL.createObjectURL(fileSrc)
31
+    console.log('压缩后', tp);
32
+    return uni.uploadFile({
33
+      url: api_uploadAttachment(type, incidentId),
34
+      filePath: tp,
35
+      name: 'file',
36
+      formData: {
37
+        'filename': imgObj.name
38
+      }
39
+    });
40
+  }
41
+
42
+  return {
43
+    uploadFile
44
+  };
45
+}

+ 12 - 0
static/scss/common.scss

@@ -37,6 +37,13 @@ uni-toast,
37 37
   border-color: $uni-primary!important;
38 38
 }
39 39
 
40
+// 按钮样式-镂空-绿色
41
+.primaryPlainButton{
42
+  color: $uni-primary!important;
43
+  border-color: $uni-primary!important;
44
+  margin: 0!important;
45
+}
46
+
40 47
 // 按钮样式-灰色
41 48
 .cancelButton{
42 49
   color: #fff!important;
@@ -115,6 +122,7 @@ uni-toast,
115 122
   -webkit-line-clamp: 2; /* 定义显示的行数 */
116 123
   overflow: hidden;
117 124
   text-overflow: ellipsis;
125
+  word-break: break-all;
118 126
 }
119 127
 
120 128
 // 透明
@@ -155,3 +163,7 @@ uni-toast,
155 163
   margin-right: 24rpx!important;
156 164
   flex: 1!important;
157 165
 }
166
+.uni-data-checklist .checklist-group .checklist-box.is--list{
167
+  border-top: none!important;
168
+  border-bottom: 1rpx solid #DEDEDE!important;
169
+}

+ 30 - 0
stores/handler.js

@@ -0,0 +1,30 @@
1
+import { defineStore } from "pinia"
2
+import { reactive } from 'vue'
3
+
4
+export const useHandlerStore = defineStore(
5
+  "handler",
6
+  () => {
7
+    const handler = reactive({
8
+      data: null,
9
+    });
10
+
11
+    // 保存事件信息
12
+    function setHandlerData(data) {
13
+      handler.data = data;
14
+    }
15
+    
16
+    // 清空事件信息
17
+    function clearHandlerData() {
18
+      handler.data = null;
19
+    }
20
+
21
+    return {
22
+      handler,
23
+      setHandlerData,
24
+      clearHandlerData,
25
+    };
26
+  },
27
+  {
28
+    unistorage: true, // 开启后对 state 的数据读写都将持久化
29
+  },
30
+);