Browse Source

工单详情的工单信息

seimin 2 years ago
parent
commit
be61358530
4 changed files with 652 additions and 213 deletions
  1. 1 1
      filters/index.js
  2. 385 7
      pages/orderDetail/orderDetail.vue
  3. 25 205
      pages/orderList/orderList.vue
  4. 241 0
      utils/index.js

+ 1 - 1
filters/index.js

@@ -10,5 +10,5 @@ Vue.filter('specimenNum', function(value) {
10 10
 // 格式化日期
11 11
 // YYYY-MM-DD HH:mm:ss
12 12
 Vue.filter('formatDate', function(value, ruleText) {
13
-  return format(new Date(value), ruleText);
13
+  return value ? format(new Date(value), ruleText) : '';
14 14
 })

+ 385 - 7
pages/orderDetail/orderDetail.vue

@@ -2,16 +2,122 @@
2 2
   <view class="orderDetail">
3 3
     <!-- 头部 -->
4 4
     <view class="orderDetail_header">
5
-      <view class="orderDetail_header_item">
6
-        工单信息
5
+      <view class="orderDetail_header_item" v-for="tab in tabs" :key="tab.id" :class="{active:tab.id === selectedTab}"
6
+        @click="changeTab(tab.id)">
7
+        {{tab.name}}
7 8
       </view>
8
-      <view class="orderDetail_header_item">
9
-        流程信息
10
-      </view>
11
-      <view class="orderDetail_header_item">
12
-        业务信息
9
+    </view>
10
+    <!-- tab -->
11
+    <!-- 工单信息 -->
12
+    <view class="orderDetail_info">
13
+      <view class="orderDetail_infoItem" v-if="orderInfo.id">
14
+        <view class="orderDetail_infoItem_header">
15
+          <view class="orderDetail_infoItem_header_title">
16
+            <view class="icon"></view>
17
+            <view class="taskNameAndWorkerName">
18
+              <text class="taskName"
19
+                v-if="orderInfo.taskType">{{orderInfo.isHalfInspect === 1? "半程陪检": orderInfo.taskType.taskName}}</text>
20
+            </view>
21
+          </view>
22
+          <text class="orderDetail_infoItem_header_more">{{orderInfo.gdcode}}</text>
23
+        </view>
24
+        <view class="orderDetail_infoItem_item">
25
+          <view class="orderDetail_infoItem_item_content">
26
+            <text class="orderDetail_infoItem_item_name">状态</text>
27
+            <text class="orderDetail_infoItem_item_value" v-if="orderInfo.gdState">{{orderInfo.gdState.name}}</text>
28
+          </view>
29
+          <view class="orderDetail_infoItem_item_content">
30
+            <text class="orderDetail_infoItem_item_name">工单日期</text>
31
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.startTime || '暂无'}}</text>
32
+          </view>
33
+          <view class="orderDetail_infoItem_item_content">
34
+            <text class="orderDetail_infoItem_item_name">总耗时</text>
35
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.showTimeNum || '暂无'}}</text>
36
+          </view>
37
+          <view class="orderDetail_infoItem_item_content">
38
+            <text class="orderDetail_infoItem_item_name">申请科室</text>
39
+            <text
40
+              class="orderDetail_infoItem_item_value">{{orderInfo.createDeptDTO?(deptDisplay==2?orderInfo.createDeptDTO.deptalias:orderInfo.createDeptDTO.dept):'暂无'}}</text>
41
+          </view>
42
+          <view class="orderDetail_infoItem_item_content">
43
+            <text class="orderDetail_infoItem_item_name">起点科室</text>
44
+            <text
45
+              class="orderDetail_infoItem_item_value">{{orderInfo.startDept?(deptDisplay==2?orderInfo.startDept.deptalias:orderInfo.startDept.dept):'暂无'}}</text>
46
+          </view>
47
+          <view class="orderDetail_infoItem_item_content"
48
+            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者其他服务业务']">
49
+            <text class="orderDetail_infoItem_item_name">中间科室</text>
50
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.middleDept || '暂无'}}</text>
51
+          </view>
52
+          <view class="orderDetail_infoItem_item_content">
53
+            <text class="orderDetail_infoItem_item_name">目标科室</text>
54
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.endDepts}}</text>
55
+          </view>
56
+          <view class="orderDetail_infoItem_item_content">
57
+            <text class="orderDetail_infoItem_item_name">支助人员</text>
58
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.worker?orderInfo.worker.name:'暂无'}}</text>
59
+          </view>
60
+          <view class="orderDetail_infoItem_item_content">
61
+            <text class="orderDetail_infoItem_item_name">联系电话</text>
62
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.worker?orderInfo.worker.phone:'暂无'}}</text>
63
+          </view>
64
+          <view class="orderDetail_infoItem_item_content"
65
+            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者其他服务业务']">
66
+            <text class="orderDetail_infoItem_item_name">陪同情况</text>
67
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.isAccompany==1?'需要医护陪同':'无需医护陪同'}}</text>
68
+          </view>
69
+          <view class="orderDetail_infoItem_item_content"
70
+            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者其他服务业务']">
71
+            <text class="orderDetail_infoItem_item_name">预约时间</text>
72
+            <text
73
+              class="orderDetail_infoItem_item_value">{{orderInfo.yyjdTime?(orderInfo.yyjdTime|formatDate('MM-dd HH:mm')):'暂无'}}</text>
74
+          </view>
75
+          <view class="orderDetail_infoItem_item_content"
76
+            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']">
77
+            <text class="orderDetail_infoItem_item_name">是否半程陪检</text>
78
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.isHalfInspect===1?'是':'否'}}</text>
79
+          </view>
80
+          <view class="orderDetail_infoItem_item_content"
81
+            v-if="orderInfo.drugs && orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['药品配送业务']">
82
+            <text class="orderDetail_infoItem_item_name">药包编码</text>
83
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.drugs.packid || '暂无'}}</text>
84
+          </view>
85
+          <view class="orderDetail_infoItem_item_content"
86
+            v-if="orderInfo.staticDistri && orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['静配配送']">
87
+            <text class="orderDetail_infoItem_item_name">药包编码</text>
88
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.staticDistri.packid || '暂无'}}</text>
89
+          </view>
90
+          <view class="orderDetail_infoItem_item_content"
91
+            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['临时标本业务'] || orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['标本轮巡业务']">
92
+            <text class="orderDetail_infoItem_item_name">预计接收</text>
93
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.expectReceiveNum||'暂无'}}</text>
94
+          </view>
95
+          <view class="orderDetail_infoItem_item_content"
96
+            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['临时标本业务'] || orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['标本轮巡业务']">
97
+            <text class="orderDetail_infoItem_item_name">实际接收</text>
98
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.actualReceiveNum||'暂无'}}</text>
99
+          </view>
100
+          <view class="orderDetail_infoItem_item_content">
101
+            <text class="orderDetail_infoItem_item_name">是否加急</text>
102
+            <text class="orderDetail_infoItem_item_value" v-if="orderInfo.emergencyType">
103
+              {{(orderInfo.emergencyType.value == 2 || orderInfo.emergencyType.value == 3)?'是':'否'}}
104
+            </text>
105
+          </view>
106
+          <view class="orderDetail_infoItem_item_content"
107
+            v-if="orderInfo.workOrderRemark && (orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['临时标本业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['标本轮巡业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['其他临床服务'])">
108
+            <text class="orderDetail_infoItem_item_name">备注信息</text>
109
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.workOrderRemark||'暂无'}}</text>
110
+          </view>
111
+          <view class="orderDetail_infoItem_item_content" v-if="orderInfo.specialCloseReason">
112
+            <text class="orderDetail_infoItem_item_name">特殊情况关闭原因</text>
113
+            <text class="orderDetail_infoItem_item_value">{{orderInfo.specialCloseReason||'暂无'}}</text>
114
+          </view>
115
+        </view>
13 116
       </view>
14 117
     </view>
118
+    <!-- 底部 -->
119
+    <seiminFooterBtn :btns="btns"></seiminFooterBtn>
120
+    <seiminModel ref="seiminModel"></seiminModel>
15 121
   </view>
16 122
 </template>
17 123
 
@@ -19,23 +125,180 @@
19 125
   import {
20 126
     reqFetchData,
21 127
   } from "../../request/api.js";
128
+  import {
129
+    mapState
130
+  } from "vuex";
131
+  import {
132
+    GDSTATE
133
+  } from "../../utils/enum.gdstate.js";
134
+  import {
135
+    ASSOCIATION_TYPES
136
+  } from "../../utils/enum.association_types.js";
137
+  import {
138
+    showAppraise,
139
+    openRecallModal,
140
+    openExecModal,
141
+    showJiaji,
142
+  } from "../../utils/index.js";
22 143
   export default {
23 144
     data() {
24 145
       return {
146
+        // 关联类型
147
+        ASSOCIATION_TYPES,
148
+        // 选项卡
149
+        tabs: [{
150
+            id: 1,
151
+            name: '工单信息'
152
+          },
153
+          {
154
+            id: 2,
155
+            name: '流程信息'
156
+          },
157
+          {
158
+            id: 3,
159
+            name: '业务信息'
160
+          },
161
+        ],
162
+        // 当前选中的tab
163
+        selectedTab: 1,
25 164
         // 工单详情信息
26 165
         orderInfo: {},
166
+        //底部按钮
167
+        btns: [],
27 168
       };
28 169
     },
170
+    computed: {
171
+      ...mapState('other', ["deptDisplay"]),
172
+    },
29 173
     methods: {
30 174
       init(queryParams) {
31 175
         this.getData(queryParams);
32 176
       },
177
+      // 切换tab
178
+      changeTab(id) {
179
+        this.selectedTab = id;
180
+      },
33 181
       //获取详情页数据
34 182
       getData(queryParams) {
183
+        uni.showLoading({
184
+          mask: true,
185
+          title: '加载中',
186
+        })
35 187
         reqFetchData('api', 'workOrder', queryParams.id).then(res => {
188
+          uni.hideLoading();
36 189
           if (res.status == 200) {
190
+            // 检查科室处理
191
+            if (res.data.middleDept) {
192
+              //有检查科室的话
193
+              res.data.middleDept = res.data.middleDept.map(v => {
194
+                return this.deptDisplay == 2 ? v.deptalias : v.dept;
195
+              }).toString();
196
+            }
197
+            // 终点科室处理
198
+            res.data.endDepts = res.data.endDepts.map(v => {
199
+              return this.deptDisplay == 2 ? v.deptalias : v.dept;
200
+            }).toString();
201
+            // 工单信息
37 202
             this.orderInfo = res.data;
203
+            //底部按钮处理
204
+            let btns = [{
205
+              name: "回到列表",
206
+              type: "default",
207
+              click: () => {
208
+                uni.navigateTo({
209
+                  url: "/pages/orderList/orderList",
210
+                });
211
+              },
212
+            }];
213
+            let newOrder = this.orderInfo;
214
+            if (newOrder.gdState.value == GDSTATE['待抢单'] ||
215
+              newOrder.gdState.value == GDSTATE['待接单'] ||
216
+              newOrder.gdState.value == GDSTATE['待到达'] ||
217
+              newOrder.gdState.value == GDSTATE['定时预约'] ||
218
+              newOrder.gdState.value == GDSTATE['待评价']) {
219
+
220
+              if (newOrder.gdState.value == GDSTATE['待评价']) {
221
+                //评价按钮
222
+                btns.push({
223
+                  name: "评价",
224
+                  type: "primary",
225
+                  click: () => {
226
+                    showAppraise.call(this, newOrder.id, () => {
227
+                      this.$refs.seiminModel.close();
228
+                      uni.navigateTo({
229
+                        url: "/pages/orderList/orderList",
230
+                      });
231
+                    });
232
+                  },
233
+                })
234
+              }
235
+
236
+              if (newOrder.gdState.value == GDSTATE['待抢单'] ||
237
+                newOrder.gdState.value == GDSTATE['待接单'] ||
238
+                newOrder.gdState.value == GDSTATE['待到达'] ||
239
+                newOrder.gdState.value == GDSTATE['定时预约']) {
240
+                //撤销按钮
241
+                btns.push({
242
+                  name: "撤销",
243
+                  type: "primary",
244
+                  click: () => {
245
+                    openRecallModal.call(this, newOrder.id, () => {
246
+                      this.$refs.seiminModel.close();
247
+                      uni.navigateTo({
248
+                        url: "/pages/orderList/orderList",
249
+                      });
250
+                    });
251
+                  },
252
+                })
253
+              }
254
+
255
+              if (newOrder.gdState.value == GDSTATE['定时预约']) {
256
+                //立即执行按钮
257
+                btns.push({
258
+                  name: "立即执行",
259
+                  type: "primary",
260
+                  click: () => {
261
+                    openExecModal.call(this, newOrder.id, () => {
262
+                      this.$refs.seiminModel.close();
263
+                      uni.navigateTo({
264
+                        url: "/pages/orderList/orderList",
265
+                      });
266
+                    });
267
+                  },
268
+                })
269
+              }
270
+
271
+              if ((newOrder.gdState.value == GDSTATE['待抢单'] ||
272
+                  newOrder.gdState.value == GDSTATE['待到达']) &&
273
+                newOrder.taskType.allowUrgent == 1 &&
274
+                !newOrder.urgentDetails) {
275
+                //加急按钮
276
+                btns.push({
277
+                  name: "加急",
278
+                  type: "primary",
279
+                  click: () => {
280
+                    showJiaji.call(this, newOrder.id, () => {
281
+                      this.$refs.seiminModel.close();
282
+                      uni.navigateTo({
283
+                        url: "/pages/orderList/orderList",
284
+                      });
285
+                    });
286
+                  },
287
+                })
288
+              }
289
+            }
290
+            // 按钮赋值
291
+            this.btns = btns;
38 292
           } else {
293
+            this.btns = [{
294
+              name: "回到列表",
295
+              type: "default",
296
+              click: () => {
297
+                uni.navigateTo({
298
+                  url: "/pages/orderList/orderList",
299
+                });
300
+              },
301
+            }, ];
39 302
             this.$refs.seiminModel.show({
40 303
               skin: 'toast',
41 304
               icon: 'error',
@@ -56,17 +319,132 @@
56 319
   .orderDetail {
57 320
     padding-bottom: 108rpx;
58 321
 
322
+    // 头部
59 323
     .orderDetail_header {
324
+      position: fixed;
325
+      z-index: 98;
326
+      width: 100%;
60 327
       height: 88rpx;
328
+      background-color: #fff;
329
+      color: #333;
61 330
       @include flex;
62 331
 
63 332
       .orderDetail_header_item {
64 333
         flex: 1;
334
+        font-size: 32rpx;
65 335
         @include border(right);
336
+        @include border(bottom);
66 337
         @include flex(center, center);
67 338
 
339
+        &:last-of-type {
340
+          border-right: none;
341
+        }
342
+
68 343
         &.active {
69 344
           color: $defaultColor;
345
+          border-bottom: 4rpx solid $defaultColor;
346
+        }
347
+      }
348
+    }
349
+
350
+    // tab
351
+    // 工单信息
352
+    .orderDetail_info {
353
+      padding: 108rpx 24rpx 0;
354
+
355
+      .orderDetail_infoItem {
356
+        width: 702rpx;
357
+        min-height: 320rpx;
358
+        background-color: #fff;
359
+        margin-top: 8rpx;
360
+        border-radius: 8rpx;
361
+        position: relative;
362
+        padding: 0 24rpx;
363
+        font-size: 32rpx;
364
+        @include border;
365
+        @include semicircle(#f9fafb, 82rpx);
366
+        @include flex(flex-start, stretch, column);
367
+
368
+        .ji,
369
+        .jiaji {
370
+          width: 60rpx;
371
+          position: absolute;
372
+          right: 0;
373
+          top: 0;
374
+        }
375
+
376
+        .orderDetail_infoItem_header {
377
+          height: 86rpx;
378
+          @include border($directive:bottom, $style:dashed);
379
+          @include flex(space-between, center);
380
+
381
+          .orderDetail_infoItem_header_title {
382
+            color: #333;
383
+            flex: 1;
384
+            @include flex(flex-start, center);
385
+
386
+            .icon {
387
+              width: 10rpx;
388
+              height: 46rpx;
389
+              border-radius: 2rpx;
390
+              background-color: #F0F6ED;
391
+              @include btn_background;
392
+            }
393
+
394
+            .taskNameAndWorkerName {
395
+              flex: 1;
396
+              @include flex;
397
+
398
+              .taskName {
399
+                max-width: 10em;
400
+                margin-left: 8rpx;
401
+                font-size: 38rpx;
402
+                font-weight: bold;
403
+                @include clamp;
404
+              }
405
+            }
406
+          }
407
+
408
+          .orderDetail_infoItem_header_more {
409
+            color: #333;
410
+            font-weight: bold;
411
+            font-size: 38rpx;
412
+            @include clamp;
413
+          }
414
+        }
415
+
416
+        .orderDetail_infoItem_item {
417
+          padding-top: 12rpx;
418
+          padding-bottom: 12rpx;
419
+          color: #333;
420
+          font-size: 30rpx;
421
+          flex: 1;
422
+          @include border(bottom);
423
+          @include flex(flex-start, stretch, column);
424
+
425
+          &:last-of-type {
426
+            border-bottom: none;
427
+          }
428
+
429
+          .orderDetail_infoItem_item_content {
430
+            margin-top: 20rpx;
431
+            @include flex(space-between, stretch);
432
+
433
+            .orderDetail_infoItem_item_name {
434
+              font-size: 34rpx;
435
+              color: #666;
436
+              max-width: 4em;
437
+            }
438
+
439
+            .orderDetail_infoItem_item_value {
440
+              font-size: 38rpx;
441
+              color: #333;
442
+              font-weight: bold;
443
+              max-width: 420rpx;
444
+              text-align: justify;
445
+              word-break: break-all;
446
+            }
447
+          }
70 448
         }
71 449
       }
72 450
     }

+ 25 - 205
pages/orderList/orderList.vue

@@ -62,21 +62,21 @@
62 62
           newOrder.gdState.value == GDSTATE['待评价']
63 63
           ">
64 64
             <button type="primary" class="btn" v-if="newOrder.gdState.value == GDSTATE['待评价']"
65
-              @click="showAppraise(newOrder.id)">评价</button>
65
+              @click.stop="showAppraise(newOrder.id)">评价</button>
66 66
             <button type="primary" class="btn" v-if="
67 67
             newOrder.gdState.value == GDSTATE['待抢单'] ||
68 68
             newOrder.gdState.value == GDSTATE['待接单'] ||
69 69
             newOrder.gdState.value == GDSTATE['待到达'] ||
70 70
             newOrder.gdState.value == GDSTATE['定时预约']
71
-            " @click="openRecallModal(newOrder.id)">撤销</button>
71
+            " @click.stop="openRecallModal(newOrder.id)">撤销</button>
72 72
             <button type="primary" class="btn" v-if="newOrder.gdState.value == GDSTATE['定时预约']"
73
-              @click="openExecModal(newOrder.id)">立即执行</button>
73
+              @click.stop="openExecModal(newOrder.id)">立即执行</button>
74 74
             <button type="primary" class="btn" v-if="
75 75
             (newOrder.gdState.value == GDSTATE['待抢单'] ||
76 76
             newOrder.gdState.value == GDSTATE['待到达']) &&
77 77
             newOrder.taskType.allowUrgent == 1 &&
78 78
             !newOrder.urgentDetails
79
-            " @click="showJiaji(newOrder.id)">加急</button>
79
+            " @click.stop="showJiaji(newOrder.id)">加急</button>
80 80
           </view>
81 81
         </view>
82 82
       </view>
@@ -97,10 +97,6 @@
97 97
   } from "vuex";
98 98
   import {
99 99
     reqFetchDataList,
100
-    reqDelWorkOrder,
101
-    reqUrge,
102
-    reqDirectStartOrder,
103
-    reqEvaluate,
104 100
   } from "../../request/api.js";
105 101
   import {
106 102
     GDSTATE
@@ -108,6 +104,12 @@
108 104
   import {
109 105
     WORKORDEREVALUATION
110 106
   } from "../../utils/enum.workorderEvaluation.js";
107
+  import {
108
+    showAppraise,
109
+    openRecallModal,
110
+    openExecModal,
111
+    showJiaji,
112
+  } from "../../utils/index.js";
111 113
   export default {
112 114
     name: 'orderList',
113 115
     data() {
@@ -159,213 +161,30 @@
159 161
       },
160 162
       //评价
161 163
       showAppraise(id) {
162
-        this.$refs.seiminModel.show({
163
-          skin: 'evaluate',
164
-          content: "工单已完成,请对本次服务做出评价!",
165
-          btns: [{
166
-              click: () => {
167
-                console.log('取消');
168
-                this.$refs.seiminModel.close();
169
-              }
170
-            },
171
-            {
172
-              click: () => {
173
-                console.log('确定');
174
-                let serviceEvaluationId;
175
-                this.$refs.seiminModel.close();
176
-                uni.showLoading({
177
-                  title: '加载中',
178
-                  mask: true,
179
-                })
180
-                //算出评级
181
-                switch (this.$refs.seiminModel.stars.indexOf('pda-haoping1')) {
182
-                  case -1:
183
-                    //五星
184
-                    serviceEvaluationId = WORKORDEREVALUATION['非常好评'];
185
-                    break;
186
-                  case 1:
187
-                    //一星
188
-                    serviceEvaluationId = WORKORDEREVALUATION['极差'];
189
-                    break;
190
-                  case 2:
191
-                    //二星
192
-                    serviceEvaluationId = WORKORDEREVALUATION['差'];
193
-                    break;
194
-                  case 3:
195
-                    //三星
196
-                    serviceEvaluationId = WORKORDEREVALUATION['一般'];
197
-                    break;
198
-                  case 4:
199
-                    //四星
200
-                    serviceEvaluationId = WORKORDEREVALUATION['好评'];
201
-                    break;
202
-                }
203
-                let postData = {
204
-                  serviceEvaluation: {
205
-                    id: serviceEvaluationId
206
-                  },
207
-                  remark: this.$refs.seiminModel.evaluateTextArea,
208
-                };
209
-                reqEvaluate(id, postData).then(res => {
210
-                  uni.hideLoading();
211
-                  if (res.status == 200) {
212
-                    this.$refs.seiminModel.show({
213
-                      skin: 'toast',
214
-                      icon: 'success',
215
-                      content: '评价成功',
216
-                    })
217
-                    this.init();
218
-                  } else {
219
-                    this.$refs.seiminModel.show({
220
-                      skin: 'toast',
221
-                      icon: 'error',
222
-                      content: '评价失败',
223
-                    })
224
-                  }
225
-                })
226
-              }
227
-            }
228
-          ]
164
+        showAppraise.call(this, id, () => {
165
+          this.$refs.seiminModel.close();
166
+          this.init();
229 167
         });
230 168
       },
231 169
       //撤销
232 170
       openRecallModal(id) {
233
-        this.$refs.seiminModel.show({
234
-          icon: "warn",
235
-          content: "您确认要撤销工单吗?撤销工单我们会通知服务台、支助人员不再执行此工单,请谨慎操作,如确认撤销请点击确认。",
236
-          btns: [{
237
-              click: () => {
238
-                console.log('取消');
239
-                this.$refs.seiminModel.close();
240
-              }
241
-            },
242
-            {
243
-              click: () => {
244
-                console.log('确定');
245
-                this.$refs.seiminModel.close();
246
-                uni.showLoading({
247
-                  title: '加载中',
248
-                  mask: true,
249
-                })
250
-                reqDelWorkOrder(id).then(res => {
251
-                  uni.hideLoading();
252
-                  if (res.status == 200) {
253
-                    this.$refs.seiminModel.show({
254
-                      skin: 'toast',
255
-                      icon: 'success',
256
-                      content: '撤销成功',
257
-                    })
258
-                    this.init();
259
-                  } else {
260
-                    this.$refs.seiminModel.show({
261
-                      skin: 'toast',
262
-                      icon: 'error',
263
-                      content: '撤销失败',
264
-                    })
265
-                  }
266
-                })
267
-              }
268
-            }
269
-          ]
171
+        openRecallModal.call(this, id, () => {
172
+          this.$refs.seiminModel.close();
173
+          this.init();
270 174
         });
271 175
       },
272 176
       //立即执行
273 177
       openExecModal(id) {
274
-        this.$refs.seiminModel.show({
275
-          icon: 'warn',
276
-          content: '您确认要立即执行该工单吗?',
277
-          btns: [{
278
-            click: () => {
279
-              console.log('取消');
280
-              this.$refs.seiminModel.close();
281
-            }
282
-          }, {
283
-            click: () => {
284
-              console.log('确认');
285
-              this.$refs.seiminModel.close();
286
-              uni.showLoading({
287
-                title: '加载中',
288
-                mask: true,
289
-              })
290
-              reqDirectStartOrder(id).then(res => {
291
-                uni.hideLoading();
292
-                if (res.status == 200) {
293
-                  this.$refs.seiminModel.show({
294
-                    skin: 'toast',
295
-                    icon: 'success',
296
-                    content: '您的加急申请已成功,调度人员会紧急处理!',
297
-                  })
298
-                  this.init();
299
-                } else {
300
-                  this.$refs.seiminModel.show({
301
-                    skin: 'toast',
302
-                    icon: 'error',
303
-                    content: '加急失败',
304
-                  })
305
-                }
306
-              })
307
-            }
308
-          }, ]
309
-        })
178
+        openExecModal.call(this, id, () => {
179
+          this.$refs.seiminModel.close();
180
+          this.init();
181
+        });
310 182
       },
311 183
       //加急
312 184
       showJiaji(id) {
313
-        this.$refs.seiminModel.urgentTextArea = '';
314
-        this.$refs.seiminModel.show({
315
-          title: '',
316
-          skin: 'urgent',
317
-          content: "请填写加急原因,填写后我们会根据您的诉求优先处理",
318
-          btns: [{
319
-              click: () => {
320
-                console.log('取消');
321
-                this.$refs.seiminModel.close();
322
-              }
323
-            },
324
-            {
325
-              click: () => {
326
-                console.log('确定', this.$refs.seiminModel.urgentTextArea);
327
-                const urgentTextArea = this.$refs.seiminModel.urgentTextArea;
328
-                if (urgentTextArea.trim() === '') {
329
-                  uni.showToast({
330
-                    icon: 'none',
331
-                    title: '请填写加急原因',
332
-                  })
333
-                  return;
334
-                }
335
-                this.$refs.seiminModel.close();
336
-                uni.showLoading({
337
-                  title: '加载中',
338
-                  mask: true,
339
-                })
340
-                let postData = {
341
-                  urgentDetails: {
342
-                    workerOrder: id,
343
-                    checkStatus: {
344
-                      id: this.checkStatus[1]
345
-                    },
346
-                    urgentReason: urgentTextArea,
347
-                  },
348
-                };
349
-                reqUrge(postData).then(res => {
350
-                  uni.hideLoading();
351
-                  if (res.status == 200) {
352
-                    this.$refs.seiminModel.show({
353
-                      skin: 'toast',
354
-                      icon: 'success',
355
-                      content: '加急成功',
356
-                    })
357
-                    this.init();
358
-                  } else {
359
-                    this.$refs.seiminModel.show({
360
-                      skin: 'toast',
361
-                      icon: 'error',
362
-                      content: '加急失败',
363
-                    })
364
-                  }
365
-                })
366
-              }
367
-            }
368
-          ]
185
+        showJiaji.call(this, id, () => {
186
+          this.$refs.seiminModel.close();
187
+          this.init();
369 188
         });
370 189
       },
371 190
       //关闭
@@ -633,7 +452,7 @@
633 452
 
634 453
         .orderList_listItem_header {
635 454
           height: 86rpx;
636
-          @include border(bottom);
455
+          @include border($directive:bottom, $style:dashed);
637 456
           @include flex(space-between, center);
638 457
 
639 458
           .orderList_listItem_header_title {
@@ -671,6 +490,7 @@
671 490
 
672 491
           .orderList_listItem_header_more {
673 492
             color: #666;
493
+            @include clamp;
674 494
           }
675 495
         }
676 496
 

+ 241 - 0
utils/index.js

@@ -4,6 +4,16 @@ import {
4 4
   pad,
5 5
   enc
6 6
 } from "crypto-js";
7
+import {
8
+  WORKORDEREVALUATION
9
+} from "./enum.workorderEvaluation.js";
10
+import {
11
+  reqDelWorkOrder,
12
+  reqUrge,
13
+  reqEvaluate,
14
+  reqDirectStartOrder,
15
+} from "../request/api.js";
16
+
7 17
 //aes加密
8 18
 export function encryptByEnAES(data = '') {
9 19
   let Key = "dsadmin";
@@ -38,3 +48,234 @@ export function getCurrentPagesSeimin(num = 0) {
38 48
   let curRoute = routes[routes.length - 1 - num].route // 获取当前页面路由,也就是最后一个打开的页面路由
39 49
   return curRoute;
40 50
 };
51
+
52
+//评价
53
+export function showAppraise(id, callBack) {
54
+  this.$refs.seiminModel.show({
55
+    skin: 'evaluate',
56
+    content: "工单已完成,请对本次服务做出评价!",
57
+    btns: [{
58
+        click: () => {
59
+          console.log('取消');
60
+          this.$refs.seiminModel.close();
61
+        }
62
+      },
63
+      {
64
+        click: () => {
65
+          console.log('确定');
66
+          let serviceEvaluationId;
67
+          this.$refs.seiminModel.close();
68
+          uni.showLoading({
69
+            title: '加载中',
70
+            mask: true,
71
+          })
72
+          //算出评级
73
+          switch (this.$refs.seiminModel.stars.indexOf('pda-haoping1')) {
74
+            case -1:
75
+              //五星
76
+              serviceEvaluationId = WORKORDEREVALUATION['非常好评'];
77
+              break;
78
+            case 1:
79
+              //一星
80
+              serviceEvaluationId = WORKORDEREVALUATION['极差'];
81
+              break;
82
+            case 2:
83
+              //二星
84
+              serviceEvaluationId = WORKORDEREVALUATION['差'];
85
+              break;
86
+            case 3:
87
+              //三星
88
+              serviceEvaluationId = WORKORDEREVALUATION['一般'];
89
+              break;
90
+            case 4:
91
+              //四星
92
+              serviceEvaluationId = WORKORDEREVALUATION['好评'];
93
+              break;
94
+          }
95
+          let postData = {
96
+            serviceEvaluation: {
97
+              id: serviceEvaluationId
98
+            },
99
+            remark: this.$refs.seiminModel.evaluateTextArea,
100
+          };
101
+          reqEvaluate(id, postData).then(res => {
102
+            uni.hideLoading();
103
+            if (res.status == 200) {
104
+              this.$refs.seiminModel.show({
105
+                skin: 'toast',
106
+                icon: 'success',
107
+                content: '评价成功',
108
+                btns: [{
109
+                  click: () => {
110
+                    callBack && callBack();
111
+                  }
112
+                }]
113
+              })
114
+            } else {
115
+              this.$refs.seiminModel.show({
116
+                skin: 'toast',
117
+                icon: 'error',
118
+                content: '评价失败',
119
+              })
120
+            }
121
+          })
122
+        }
123
+      }
124
+    ]
125
+  });
126
+};
127
+
128
+//撤销
129
+export function openRecallModal(id, callBack) {
130
+  this.$refs.seiminModel.show({
131
+    icon: "warn",
132
+    content: "您确认要撤销工单吗?撤销工单我们会通知服务台、支助人员不再执行此工单,请谨慎操作,如确认撤销请点击确认。",
133
+    btns: [{
134
+        click: () => {
135
+          console.log('取消');
136
+          this.$refs.seiminModel.close();
137
+        }
138
+      },
139
+      {
140
+        click: () => {
141
+          console.log('确定');
142
+          this.$refs.seiminModel.close();
143
+          uni.showLoading({
144
+            title: '加载中',
145
+            mask: true,
146
+          })
147
+          reqDelWorkOrder(id).then(res => {
148
+            uni.hideLoading();
149
+            if (res.status == 200) {
150
+              this.$refs.seiminModel.show({
151
+                skin: 'toast',
152
+                icon: 'success',
153
+                content: '撤销成功',
154
+                btns: [{
155
+                  click: () => {
156
+                    callBack && callBack();
157
+                  }
158
+                }]
159
+              })
160
+            } else {
161
+              this.$refs.seiminModel.show({
162
+                skin: 'toast',
163
+                icon: 'error',
164
+                content: '撤销失败',
165
+              })
166
+            }
167
+          })
168
+        }
169
+      }
170
+    ]
171
+  });
172
+};
173
+
174
+//立即执行
175
+export function openExecModal(id, callBack) {
176
+  this.$refs.seiminModel.show({
177
+    icon: 'warn',
178
+    content: '您确认要立即执行该工单吗?',
179
+    btns: [{
180
+      click: () => {
181
+        console.log('取消');
182
+        this.$refs.seiminModel.close();
183
+      }
184
+    }, {
185
+      click: () => {
186
+        console.log('确认');
187
+        this.$refs.seiminModel.close();
188
+        uni.showLoading({
189
+          title: '加载中',
190
+          mask: true,
191
+        })
192
+        reqDirectStartOrder(id).then(res => {
193
+          uni.hideLoading();
194
+          if (res.status == 200) {
195
+            this.$refs.seiminModel.show({
196
+              skin: 'toast',
197
+              icon: 'success',
198
+              content: '立即执行成功',
199
+              btns: [{
200
+                click: () => {
201
+                  callBack && callBack();
202
+                }
203
+              }]
204
+            })
205
+          } else {
206
+            this.$refs.seiminModel.show({
207
+              skin: 'toast',
208
+              icon: 'error',
209
+              content: '立即执行失败',
210
+            })
211
+          }
212
+        })
213
+      }
214
+    }, ]
215
+  })
216
+};
217
+
218
+//加急
219
+export function showJiaji(id, callBack) {
220
+  this.$refs.seiminModel.urgentTextArea = '';
221
+  this.$refs.seiminModel.show({
222
+    title: '',
223
+    skin: 'urgent',
224
+    content: "请填写加急原因,填写后我们会根据您的诉求优先处理",
225
+    btns: [{
226
+        click: () => {
227
+          console.log('取消');
228
+          this.$refs.seiminModel.close();
229
+        }
230
+      },
231
+      {
232
+        click: () => {
233
+          console.log('确定', this.$refs.seiminModel.urgentTextArea);
234
+          const urgentTextArea = this.$refs.seiminModel.urgentTextArea;
235
+          if (urgentTextArea.trim() === '') {
236
+            uni.showToast({
237
+              icon: 'none',
238
+              title: '请填写加急原因',
239
+            })
240
+            return;
241
+          }
242
+          this.$refs.seiminModel.close();
243
+          uni.showLoading({
244
+            title: '加载中',
245
+            mask: true,
246
+          })
247
+          let postData = {
248
+            urgentDetails: {
249
+              workerOrder: id,
250
+              checkStatus: {
251
+                id: this.checkStatus[1]
252
+              },
253
+              urgentReason: urgentTextArea,
254
+            },
255
+          };
256
+          reqUrge(postData).then(res => {
257
+            uni.hideLoading();
258
+            if (res.status == 200) {
259
+              this.$refs.seiminModel.show({
260
+                skin: 'toast',
261
+                icon: 'success',
262
+                content: '您的加急申请已成功,调度人员会紧急处理!',
263
+                btns: [{
264
+                  click: () => {
265
+                    callBack && callBack();
266
+                  }
267
+                }]
268
+              })
269
+            } else {
270
+              this.$refs.seiminModel.show({
271
+                skin: 'toast',
272
+                icon: 'error',
273
+                content: '加急失败',
274
+              })
275
+            }
276
+          })
277
+        }
278
+      }
279
+    ]
280
+  });
281
+};