seimin 3 years ago
parent
commit
925f4baa38

+ 29 - 21
components/seiminModel/seiminModel.vue

@@ -2,7 +2,7 @@
2
  * @Author: 廖明明
2
  * @Author: 廖明明
3
  * @Date: 2022-04-01 17:11:19
3
  * @Date: 2022-04-01 17:11:19
4
  * @LastEditors: 廖明明
4
  * @LastEditors: 廖明明
5
- * @LastEditTime: 2022-04-02 17:03:14
5
+ * @LastEditTime: 2022-04-21 12:27:12
6
  * @Description: 自定义弹窗组件
6
  * @Description: 自定义弹窗组件
7
 -->
7
 -->
8
 <template>
8
 <template>
@@ -11,7 +11,9 @@
11
       <!-- 标题 -->
11
       <!-- 标题 -->
12
       <view class="seiminModel_header">
12
       <view class="seiminModel_header">
13
         <text>{{ opts.title }}</text>
13
         <text>{{ opts.title }}</text>
14
-        <text class="seiminModel_countDown" v-if="nurseDeptSwitchTip < 0 || (nurseDeptSwitchTip > 0 && closeTime > 0)">
14
+        <text class="seiminModel_countDown" v-if="
15
+            nurseDeptSwitchTip < 0 || (nurseDeptSwitchTip > 0 && closeTime > 0)
16
+          ">
15
           <text v-if="nurseDeptSwitchTip < 0">关闭</text>倒计时<text>{{ closeTime }}s</text>
17
           <text v-if="nurseDeptSwitchTip < 0">关闭</text>倒计时<text>{{ closeTime }}s</text>
16
         </text>
18
         </text>
17
       </view>
19
       </view>
@@ -19,9 +21,7 @@
19
       <view class="seiminModel_content qrcode" v-if="opts.skin === 'qrcode'">
21
       <view class="seiminModel_content qrcode" v-if="opts.skin === 'qrcode'">
20
         <image class="w100" :src="nurseCodeImg" mode="widthFix"></image>
22
         <image class="w100" :src="nurseCodeImg" mode="widthFix"></image>
21
         <view class="qrcode_operate">
23
         <view class="qrcode_operate">
22
-          <view class="refreshQRCode" @click="showNurseCode">
23
-            刷新
24
-          </view>
24
+          <view class="refreshQRCode" @click="showNurseCode"> 刷新 </view>
25
           <view>{{ refreshQRCodeTime }}s</view>
25
           <view>{{ refreshQRCodeTime }}s</view>
26
         </view>
26
         </view>
27
       </view>
27
       </view>
@@ -36,7 +36,9 @@
36
         <view class="seiminModel_txt" v-html="opts.content"></view>
36
         <view class="seiminModel_txt" v-html="opts.content"></view>
37
       </view>
37
       </view>
38
       <!-- 底部 -->
38
       <!-- 底部 -->
39
-      <view class="seiminModel_footer" v-if="nurseDeptSwitchTip <= 0 || (nurseDeptSwitchTip > 0 && closeTime === 0)">
39
+      <view class="seiminModel_footer" v-if="
40
+          nurseDeptSwitchTip <= 0 || (nurseDeptSwitchTip > 0 && closeTime === 0)
41
+        ">
40
         <view class="seiminModel_footer__btn" v-for="(btn, i) in opts.btns" :style="{
42
         <view class="seiminModel_footer__btn" v-for="(btn, i) in opts.btns" :style="{
41
             flex: btn.flex,
43
             flex: btn.flex,
42
             color: btn.textColor,
44
             color: btn.textColor,
@@ -49,10 +51,10 @@
49
 <script>
51
 <script>
50
   import {
52
   import {
51
     mapState
53
     mapState
52
-  } from 'vuex';
54
+  } from "vuex";
53
   import {
55
   import {
54
     reqDeptCodes
56
     reqDeptCodes
55
-  } from '../../request/api.js';
57
+  } from "../../request/api.js";
56
   export default {
58
   export default {
57
     name: "seiminModel",
59
     name: "seiminModel",
58
     data() {
60
     data() {
@@ -62,7 +64,7 @@
62
         // 动态二维码定时器
64
         // 动态二维码定时器
63
         timer: null,
65
         timer: null,
64
         // 动态二维码qrcode
66
         // 动态二维码qrcode
65
-        nurseCodeImg: '',
67
+        nurseCodeImg: "",
66
         // 动态二维码刷新间隔时长
68
         // 动态二维码刷新间隔时长
67
         refreshQRCodeTime: 30,
69
         refreshQRCodeTime: 30,
68
         // 护士科室切换提示自动关闭设置(时长,单位秒)
70
         // 护士科室切换提示自动关闭设置(时长,单位秒)
@@ -72,8 +74,8 @@
72
       };
74
       };
73
     },
75
     },
74
     computed: {
76
     computed: {
75
-      ...mapState(['nurseDeptSwitchTip']),
76
-      ...mapState('user', ['loginInfo']),
77
+      ...mapState(["nurseDeptSwitchTip"]),
78
+      ...mapState("user", ["loginInfo"]),
77
     },
79
     },
78
     methods: {
80
     methods: {
79
       // 显示弹窗
81
       // 显示弹窗
@@ -83,19 +85,19 @@
83
           skin: "default", //弹窗风格(default|toast|qrcode|)
85
           skin: "default", //弹窗风格(default|toast|qrcode|)
84
           isVisible: false, //是否显示弹窗
86
           isVisible: false, //是否显示弹窗
85
           title: "提示", //标题
87
           title: "提示", //标题
86
-          icon:'success',//图标(success|error|)
88
+          icon: "success", //图标(success|error|)
87
           content: "", //内容
89
           content: "", //内容
88
           btns: [{
90
           btns: [{
89
               name: "取消",
91
               name: "取消",
90
               textColor: "#666",
92
               textColor: "#666",
91
               flex: 1,
93
               flex: 1,
92
-              click: this.close
94
+              click: this.close,
93
             },
95
             },
94
             {
96
             {
95
               name: "确定",
97
               name: "确定",
96
               textColor: "#666",
98
               textColor: "#666",
97
               flex: 1,
99
               flex: 1,
98
-              click: this.close
100
+              click: this.close,
99
             },
101
             },
100
           ], //弹窗按钮
102
           ], //弹窗按钮
101
         };
103
         };
@@ -115,7 +117,7 @@
115
           let btns = [];
117
           let btns = [];
116
           args.btns.forEach((v, i) => {
118
           args.btns.forEach((v, i) => {
117
             btns.push(Object.assign({}, defaultOptions.btns[i], v));
119
             btns.push(Object.assign({}, defaultOptions.btns[i], v));
118
-          })
120
+          });
119
           args.btns = btns;
121
           args.btns = btns;
120
         }
122
         }
121
         // 合并配置
123
         // 合并配置
@@ -123,14 +125,14 @@
123
           isVisible: true,
125
           isVisible: true,
124
         });
126
         });
125
         // 如果是动态二维码,则需要发起请求
127
         // 如果是动态二维码,则需要发起请求
126
-        if (this.opts.skin === 'qrcode') {
128
+        if (this.opts.skin === "qrcode") {
127
           this.showNurseCode();
129
           this.showNurseCode();
128
         }
130
         }
129
       },
131
       },
130
       // 关闭弹窗
132
       // 关闭弹窗
131
       close() {
133
       close() {
132
         this.opts.isVisible = false;
134
         this.opts.isVisible = false;
133
-        if (this.opts.skin === 'qrcode') {
135
+        if (this.opts.skin === "qrcode") {
134
           clearInterval(this.timer);
136
           clearInterval(this.timer);
135
           this.timer = null;
137
           this.timer = null;
136
         }
138
         }
@@ -138,7 +140,7 @@
138
       // 科室动态二维码方法
140
       // 科室动态二维码方法
139
       showNurseCode() {
141
       showNurseCode() {
140
         let deptId = this.loginInfo.user && this.loginInfo.user.dept.id;
142
         let deptId = this.loginInfo.user && this.loginInfo.user.dept.id;
141
-        reqDeptCodes([deptId]).then(res => {
143
+        reqDeptCodes([deptId]).then((res) => {
142
           if (res.status == 200) {
144
           if (res.status == 200) {
143
             this.nurseCodeImg = res["data"][0].base64;
145
             this.nurseCodeImg = res["data"][0].base64;
144
             this.refreshQRCodeTime = res["data"][0].refreshQRCodeTime;
146
             this.refreshQRCodeTime = res["data"][0].refreshQRCodeTime;
@@ -150,8 +152,14 @@
150
                 this.showNurseCode();
152
                 this.showNurseCode();
151
               }
153
               }
152
             }, 1000);
154
             }, 1000);
155
+          } else {
156
+            clearInterval(this.timer);
157
+            uni.showToast({
158
+              icon: 'none',
159
+              title: '获取数据失败'
160
+            })
153
           }
161
           }
154
-        })
162
+        });
155
       },
163
       },
156
       // 切换科室弹窗
164
       // 切换科室弹窗
157
       showChangeDept(options = {}) {
165
       showChangeDept(options = {}) {
@@ -173,8 +181,8 @@
173
             clearInterval(this.timerCloseTime);
181
             clearInterval(this.timerCloseTime);
174
           }
182
           }
175
         }, 1000);
183
         }, 1000);
176
-      }
177
-    }
184
+      },
185
+    },
178
   };
186
   };
179
 </script>
187
 </script>
180
 
188
 

+ 2 - 1
pages.json

@@ -30,7 +30,8 @@
30
       "path": "pages/orderList/orderList",
30
       "path": "pages/orderList/orderList",
31
       "style": {
31
       "style": {
32
         "navigationBarTitleText": "工单列表",
32
         "navigationBarTitleText": "工单列表",
33
-        "navigationBarBackgroundColor": "#2C2D31"
33
+        "navigationBarBackgroundColor": "#2C2D31",
34
+        "enablePullDownRefresh": true
34
       }
35
       }
35
     }
36
     }
36
   ],
37
   ],

File diff suppressed because it is too large
+ 628 - 557
pages/index/index.vue


+ 5 - 3
pages/login/login.vue

@@ -111,10 +111,12 @@
111
             });
111
             });
112
             this.changeSeiminModel(true);
112
             this.changeSeiminModel(true);
113
           } else {
113
           } else {
114
-            uni.showToast({
115
-              icon: "none",
116
-              title: res.remarks || "登录失败",
114
+            this.$refs.seiminModel.showChangeDept({
115
+              skin: "toast",
116
+              icon: "error",
117
+              content: res.remarks || "登录失败",
117
             });
118
             });
119
+            throw new Error(res.remarks || '登录失败');
118
           }
120
           }
119
         });
121
         });
120
       },
122
       },

+ 265 - 3
pages/orderList/orderList.vue

@@ -3,32 +3,294 @@
3
     <!-- 头部筛选 -->
3
     <!-- 头部筛选 -->
4
     <view class="orderList_header">
4
     <view class="orderList_header">
5
       <view class="orderList_header_item">
5
       <view class="orderList_header_item">
6
-        
6
+        <text class="orderList_header_itemText">全部</text>
7
+        <text class="pda pda-xiala"></text>
7
       </view>
8
       </view>
8
       <view class="orderList_header_item">
9
       <view class="orderList_header_item">
9
-        
10
+        <text class="orderList_header_itemText">全部</text>
11
+        <text class="pda pda-xiala"></text>
12
+      </view>
13
+    </view>
14
+    <!-- 列表 -->
15
+    <view class="orderList_list">
16
+      <view class="orderList_listItem" v-for="newOrder in newOrderList" :key="newOrder.id">
17
+        <view class="orderList_listItem_header">
18
+          <view class="orderList_listItem_header_title">
19
+            <view class="associationType_icon"> 标 </view>
20
+            半程陪检-张三
21
+          </view>
22
+          <text class="orderList_listItem_header_more">待接单</text>
23
+        </view>
24
+        <view class="orderList_listItem_item">
25
+          <view class="orderList_listItem_item_content">
26
+            <text class="orderList_listItem_item_name">李四-6322285</text>
27
+            <text class="orderList_listItem_item_time">10:20</text>
28
+          </view>
29
+          <view class="orderList_listItem_item_btns">
30
+            <button type="primary" class="btn">撤销</button>
31
+            <button type="primary" class="btn">加急</button>
32
+          </view>
33
+        </view>
10
       </view>
34
       </view>
11
     </view>
35
     </view>
12
     <seiminFooterNav></seiminFooterNav>
36
     <seiminFooterNav></seiminFooterNav>
37
+    <seiminModel ref="seiminModel"></seiminModel>
13
   </view>
38
   </view>
14
 </template>
39
 </template>
15
 
40
 
16
 <script>
41
 <script>
42
+  import {
43
+    mapState
44
+  } from "vuex";
45
+  import {
46
+    reqFetchDataList
47
+  } from "../../request/api.js";
48
+  import {
49
+    GDSTATE
50
+  } from "../../utils/enum.gdstate.js";
17
   export default {
51
   export default {
18
     name: 'orderList',
52
     name: 'orderList',
19
     data() {
53
     data() {
20
       return {
54
       return {
21
-
55
+        newOrderList: [], //工单列表
56
+        idx: 0, //页码
22
       };
57
       };
58
+    },
59
+    computed: {
60
+      ...mapState("user", ["loginInfo"]),
61
+    },
62
+    methods: {
63
+      // 获取页面数据
64
+      init() {
65
+        uni.showLoading({
66
+          title: "加载中",
67
+          mask: true,
68
+        });
69
+        Promise.all([
70
+          this.queryWorkOrdersRequest(), //查询最新工单列表
71
+        ]).then((values) => {
72
+          uni.hideLoading();
73
+          uni.stopPullDownRefresh();
74
+          this.queryWorkOrdersResponse(values[0]);
75
+        });
76
+      },
77
+      // 查询最新工单列表(上拉)
78
+      reachBottom() {
79
+        uni.showLoading({
80
+          title: "加载中",
81
+          mask: true,
82
+        });
83
+        Promise.all([
84
+          this.queryWorkOrdersRequest(true), //查询最新工单列表
85
+        ]).then((values) => {
86
+          uni.hideLoading();
87
+          uni.stopPullDownRefresh();
88
+          this.queryWorkOrdersResponse(values[0], true);
89
+        });
90
+      },
91
+      // 查询最新工单列表
92
+      queryWorkOrdersRequest(idxPlus = false) {
93
+        if (idxPlus) {
94
+          //累加
95
+          ++this.idx;
96
+        } else {
97
+          this.idx = 0;
98
+        }
99
+        return reqFetchDataList("nurse", "workOrder", {
100
+          workOrder: {
101
+            createDept: this.loginInfo.user.dept.id,
102
+            platform: 2,
103
+            searchDays: 2,
104
+          },
105
+          idx: this.idx,
106
+          sum: 10,
107
+        });
108
+      },
109
+      // 查询最新工单列表
110
+      queryWorkOrdersResponse(res, idxPlus = false) {
111
+        if (res.status == 200) {
112
+          res.list = res.list || [];
113
+          let newOrderList = res.list.map((v) => {
114
+            if (v.gdState) {
115
+              if (
116
+                v.gdState.value == GDSTATE["待接单"] ||
117
+                v.gdState.value == GDSTATE["待抢单"]
118
+              ) {
119
+                v.stateTextClass = "red";
120
+              } else if (
121
+                v.gdState.value == GDSTATE["待评价"] ||
122
+                v.gdState.value == GDSTATE["已完成"]
123
+              ) {
124
+                v.stateTextClass = "green";
125
+              } else {
126
+                v.stateTextClass = "yellow";
127
+              }
128
+            }
129
+            return v;
130
+          });
131
+          if (idxPlus) {
132
+            //累加
133
+            this.newOrderList.push(newOrderList)
134
+          } else {
135
+            this.newOrderList = newOrderList;
136
+          }
137
+        } else {
138
+          this.$refs.seiminModel.showChangeDept({
139
+            skin: "toast",
140
+            icon: "error",
141
+            content: res.msg || "获取数据失败",
142
+          });
143
+          throw new Error(res.msg || '获取数据失败');
144
+        }
145
+      },
146
+    },
147
+    mounted() {
148
+      this.init();
149
+    },
150
+    onPullDownRefresh() {
151
+      this.init();
152
+    },
153
+    onReachBottom() {
154
+      this.reachBottom();
23
     }
155
     }
24
   }
156
   }
25
 </script>
157
 </script>
26
 
158
 
27
 <style lang="scss" scoped>
159
 <style lang="scss" scoped>
28
   .orderList {
160
   .orderList {
161
+    padding-top: 88rpx;
162
+    padding-bottom: 108rpx;
163
+
164
+    // 头部筛选
29
     .orderList_header {
165
     .orderList_header {
30
       height: 88rpx;
166
       height: 88rpx;
167
+      background-color: #fff;
168
+      border-bottom: 1px solid #E5E9ED;
169
+      position: fixed;
170
+      top: 88rpx;
171
+      left: 0;
172
+      z-index: 99;
173
+      width: 100%;
31
       @include flex(center, center);
174
       @include flex(center, center);
175
+
176
+      .orderList_header_item {
177
+        flex: 1;
178
+        height: 100%;
179
+        padding: 0 50rpx;
180
+        border-right: 1px solid #E5E9ED;
181
+        @include flex(space-between, center);
182
+
183
+        &:last-of-type {
184
+          border-right: none;
185
+        }
186
+
187
+        .orderList_header_itemText {
188
+          color: #333;
189
+          font-size: 38rpx;
190
+        }
191
+
192
+        .pda-xiala {
193
+          color: #DDE1E5;
194
+        }
195
+      }
196
+    }
197
+
198
+    // 列表
199
+    .orderList_list {
200
+      padding: 0 24rpx;
201
+
202
+      .orderList_listItem {
203
+        width: 702rpx;
204
+        min-height: 320rpx;
205
+        background-color: #fff;
206
+        margin-top: 8rpx;
207
+        border-radius: 8rpx;
208
+        border: 2rpx solid #e5e9ed;
209
+        position: relative;
210
+        padding: 0 15rpx;
211
+        font-size: 32rpx;
212
+        @include semicircle(#f9fafb, 82rpx);
213
+        @include flex(flex-start, stretch, column);
214
+
215
+        .orderList_listItem_header {
216
+          height: 86rpx;
217
+          border-bottom: 1px dashed #e5e9ed;
218
+          @include flex(space-between, center);
219
+
220
+          .orderList_listItem_header_title {
221
+            color: #333;
222
+            @include flex(flex-start, center);
223
+
224
+            .associationType_icon {
225
+              width: 48rpx;
226
+              height: 48rpx;
227
+              border-radius: 50%;
228
+              background-color: rgba(57, 177, 153, 0.3);
229
+              border: 1px solid #39b199;
230
+              font-size: 24rpx;
231
+              color: #39b199;
232
+              margin-right: 8rpx;
233
+              @include flex(center, center);
234
+            }
235
+          }
236
+
237
+          .orderList_listItem_header_more {
238
+            color: #666;
239
+          }
240
+        }
241
+
242
+        .orderList_listItem_item {
243
+          height: 88rpx;
244
+          border-bottom: 1px solid #e5e9ed;
245
+          color: #333;
246
+          font-size: 30rpx;
247
+          flex: 1;
248
+          @include flex(flex-start, stretch, column);
249
+
250
+          &:last-of-type {
251
+            border-bottom: none;
252
+          }
253
+
254
+          .orderList_listItem_item_content {
255
+            min-height: 143rpx;
256
+            flex: 1;
257
+            @include flex(space-between, center);
258
+
259
+            .orderList_listItem_item_name {
260
+              font-size: 38rpx;
261
+              font-weight: bold;
262
+            }
263
+
264
+            .orderList_listItem_item_time {
265
+              color: #666;
266
+              font-size: 28rpx;
267
+            }
268
+          }
269
+
270
+          .orderList_listItem_item_btns {
271
+            position: relative;
272
+            left: -14rpx;
273
+            width: 698rpx;
274
+            height: 88rpx;
275
+            @include btn_background;
276
+            @include flex;
277
+
278
+            .btn {
279
+              flex: 1;
280
+              background-color: transparent;
281
+              border-right: 2rpx solid #fff;
282
+
283
+              &:last-of-type {
284
+                border-right: none;
285
+              }
286
+
287
+              &::after {
288
+                border: none;
289
+              }
290
+            }
291
+          }
292
+        }
293
+      }
32
     }
294
     }
33
   }
295
   }
34
 </style>
296
 </style>

+ 16 - 1
pages/quickCreateOrder/quickCreateOrder.vue

@@ -230,12 +230,26 @@
230
             }
230
             }
231
           }
231
           }
232
           this.dataObj = res;
232
           this.dataObj = res;
233
+        } else {
234
+          this.$refs.seiminModel.showChangeDept({
235
+            skin: "toast",
236
+            icon: "error",
237
+            content: res.msg || "获取数据失败",
238
+          });
239
+          throw new Error(res.msg || '获取数据失败');
233
         }
240
         }
234
       },
241
       },
235
       // 获取历史输入
242
       // 获取历史输入
236
       getRecentRemarks(res) {
243
       getRecentRemarks(res) {
237
         if (res.state == 200) {
244
         if (res.state == 200) {
238
           this.historyCustomRemarks = res.data || [];
245
           this.historyCustomRemarks = res.data || [];
246
+        } else {
247
+          this.$refs.seiminModel.showChangeDept({
248
+            skin: "toast",
249
+            icon: "error",
250
+            content: res.msg || "获取数据失败",
251
+          });
252
+          throw new Error(res.msg || '获取数据失败');
239
         }
253
         }
240
       },
254
       },
241
       // 提交数据,建单
255
       // 提交数据,建单
@@ -324,8 +338,9 @@
324
             this.$refs.seiminModel.showChangeDept({
338
             this.$refs.seiminModel.showChangeDept({
325
               skin: "toast",
339
               skin: "toast",
326
               icon: "error",
340
               icon: "error",
327
-              content: res.msg || "操作失败",
341
+              content: res.msg || "建单失败",
328
             });
342
             });
343
+            throw new Error(res.msg || '建单失败');
329
           }
344
           }
330
         });
345
         });
331
       },
346
       },

+ 11 - 1
pages/searchDept/searchDept.vue

@@ -161,6 +161,7 @@
161
           mask: true,
161
           mask: true,
162
         });
162
         });
163
         reqFetchDataList("data", "department", postData).then((res) => {
163
         reqFetchDataList("data", "department", postData).then((res) => {
164
+          uni.hideLoading();
164
           if (res.status == 200) {
165
           if (res.status == 200) {
165
             this.searchData.push({
166
             this.searchData.push({
166
               name: keyword,
167
               name: keyword,
@@ -177,7 +178,13 @@
177
               this.deptList,
178
               this.deptList,
178
               keyword
179
               keyword
179
             );
180
             );
180
-            uni.hideLoading();
181
+          } else {
182
+            this.$refs.seiminModel.showChangeDept({
183
+              skin: "toast",
184
+              icon: "error",
185
+              content: res.msg || "获取数据失败",
186
+            });
187
+            throw new Error(res.msg || '获取数据失败');
181
           }
188
           }
182
         });
189
         });
183
       },
190
       },
@@ -318,6 +325,7 @@
318
                   icon: "error",
325
                   icon: "error",
319
                   content: res.msg || "操作失败",
326
                   content: res.msg || "操作失败",
320
                 });
327
                 });
328
+                throw new Error(res.msg || '操作失败');
321
               }
329
               }
322
             });
330
             });
323
           }
331
           }
@@ -359,6 +367,7 @@
359
                   icon: "error",
367
                   icon: "error",
360
                   content: res.msg || "操作失败",
368
                   content: res.msg || "操作失败",
361
                 });
369
                 });
370
+                throw new Error(res.msg || '操作失败');
362
               }
371
               }
363
             });
372
             });
364
           } else {
373
           } else {
@@ -368,6 +377,7 @@
368
               icon: "error",
377
               icon: "error",
369
               content: res.msg || "操作失败",
378
               content: res.msg || "操作失败",
370
             });
379
             });
380
+            throw new Error(res.msg || '操作失败');
371
           }
381
           }
372
         });
382
         });
373
       },
383
       },