Browse Source

护士端相关开关接口调用

seimin 3 years ago
parent
commit
55be1b2721
5 changed files with 214 additions and 51 deletions
  1. 43 3
      components/seiminModel/seiminModel.vue
  2. 133 36
      pages/index/index.vue
  3. 9 9
      request/api.js
  4. 26 2
      store/index.js
  5. 3 1
      store/modules/user.js

+ 43 - 3
components/seiminModel/seiminModel.vue

@@ -8,7 +8,13 @@
8
 <template>
8
 <template>
9
   <view class="seiminModel seiminModel_mask" v-if="opts.isVisible">
9
   <view class="seiminModel seiminModel_mask" v-if="opts.isVisible">
10
     <view class="seiminModel_container animate__animated animate__fadeIn animate__faster">
10
     <view class="seiminModel_container animate__animated animate__fadeIn animate__faster">
11
-      <view class="seiminModel_header">{{ opts.title }}</view>
11
+      <!-- 标题 -->
12
+      <view class="seiminModel_header">
13
+        <text>{{ opts.title }}</text>
14
+        <text class="seiminModel_countDown" v-if="nurseDeptSwitchTip < 0 || (nurseDeptSwitchTip > 0 && closeTime > 0)">
15
+          <text v-if="nurseDeptSwitchTip < 0">关闭</text>倒计时<text>{{ closeTime }}s</text>
16
+        </text>
17
+      </view>
12
       <!-- 动态二维码 -->
18
       <!-- 动态二维码 -->
13
       <view class="seiminModel_content qrcode" v-if="opts.skin === 'qrcode'">
19
       <view class="seiminModel_content qrcode" v-if="opts.skin === 'qrcode'">
14
         <image class="w100" :src="nurseCodeImg" mode="widthFix"></image>
20
         <image class="w100" :src="nurseCodeImg" mode="widthFix"></image>
@@ -21,7 +27,8 @@
21
       </view>
27
       </view>
22
       <!-- 正常弹窗 -->
28
       <!-- 正常弹窗 -->
23
       <view class="seiminModel_content" v-html="opts.content" v-else></view>
29
       <view class="seiminModel_content" v-html="opts.content" v-else></view>
24
-      <view class="seiminModel_footer">
30
+      <!-- 底部 -->
31
+      <view class="seiminModel_footer" v-if="nurseDeptSwitchTip <= 0 || (nurseDeptSwitchTip > 0 && closeTime === 0)">
25
         <view class="seiminModel_footer__btn" v-for="(btn, i) in opts.btns" :style="{
32
         <view class="seiminModel_footer__btn" v-for="(btn, i) in opts.btns" :style="{
26
             flex: btn.flex,
33
             flex: btn.flex,
27
             color: btn.textColor,
34
             color: btn.textColor,
@@ -50,9 +57,14 @@
50
         nurseCodeImg: '',
57
         nurseCodeImg: '',
51
         // 动态二维码刷新间隔时长
58
         // 动态二维码刷新间隔时长
52
         refreshQRCodeTime: 30,
59
         refreshQRCodeTime: 30,
60
+        // 护士科室切换提示自动关闭设置(时长,单位秒)
61
+        closeTime: 0,
62
+        // 护士科室切换提示自动关闭设置(定时器,单位秒)
63
+        timerCloseTime: null,
53
       };
64
       };
54
     },
65
     },
55
     computed: {
66
     computed: {
67
+      ...mapState(['nurseDeptSwitchTip']),
56
       ...mapState('user', ['loginInfo']),
68
       ...mapState('user', ['loginInfo']),
57
     },
69
     },
58
     methods: {
70
     methods: {
@@ -132,7 +144,28 @@
132
           }
144
           }
133
         })
145
         })
134
       },
146
       },
135
-    },
147
+      // 切换科室弹窗
148
+      showChangeDept(options = {}) {
149
+        this.show(options);
150
+        // (1)	当用户设置为正数时,用户必须查看此窗体指定秒数。
151
+        // (2)	当用户设置为负数时,用户可点击知道了也可倒计时自动关闭。
152
+        // (3)	如果用户填写0则为无自动关闭和强制查看时间。
153
+        if (this.nurseDeptSwitchTip === 0) {
154
+          return;
155
+        }
156
+        this.closeTime = Math.abs(this.nurseDeptSwitchTip);
157
+        clearInterval(this.timerCloseTime);
158
+        this.timerCloseTime = setInterval(() => {
159
+          this.closeTime = Math.max(--this.closeTime, 0);
160
+          if (this.closeTime === 0) {
161
+            if (this.nurseDeptSwitchTip < 0) {
162
+              this.close();
163
+            }
164
+            clearInterval(this.timerCloseTime);
165
+          }
166
+        }, 1000);
167
+      }
168
+    }
136
   };
169
   };
137
 </script>
170
 </script>
138
 
171
 
@@ -164,7 +197,14 @@
164
 
197
 
165
         .seiminModel_header {
198
         .seiminModel_header {
166
           height: 100rpx;
199
           height: 100rpx;
200
+          position: relative;
167
           @include flex(center, center);
201
           @include flex(center, center);
202
+          .seiminModel_countDown{
203
+            position: absolute;
204
+            right: 26rpx;
205
+            font-size: 28rpx;
206
+            color: $defaultColor;
207
+          }
168
         }
208
         }
169
 
209
 
170
         .seiminModel_content {
210
         .seiminModel_content {

+ 133 - 36
pages/index/index.vue

@@ -14,6 +14,9 @@
14
           <text class="pda pda-saoma"></text>
14
           <text class="pda pda-saoma"></text>
15
         </view>
15
         </view>
16
       </view>
16
       </view>
17
+      <!-- 通告栏 -->
18
+      <uni-notice-bar :speed="50" scrollable single showIcon :text="updateTipsForNurses" background-color="#fff" color="#666">
19
+      </uni-notice-bar>
17
       <!-- 一键收标本 -->
20
       <!-- 一键收标本 -->
18
       <view class="collect_specimens">
21
       <view class="collect_specimens">
19
         <view class="collect_icon">
22
         <view class="collect_icon">
@@ -27,7 +30,7 @@
27
             普标数量<text class="collect_num">{{ordinaryNum | specimenNum}}</text>
30
             普标数量<text class="collect_num">{{ordinaryNum | specimenNum}}</text>
28
           </view>
31
           </view>
29
         </view>
32
         </view>
30
-        <button class="collect_btn" type="default" @click="collectSpecimens">一键收标本</button>
33
+        <button class="collect_btn" type="default" @click="collectSpecimens">{{specimenButton}}</button>
31
       </view>
34
       </view>
32
       <!-- 最新工单 -->
35
       <!-- 最新工单 -->
33
       <view class="newOrders">
36
       <view class="newOrders">
@@ -70,8 +73,8 @@
70
   } from 'vuex';
73
   } from 'vuex';
71
   import {
74
   import {
72
     reqSpecimenWorkOrderMsg,
75
     reqSpecimenWorkOrderMsg,
73
-    reqWorkOrders,
74
-    reqDeptTaskType
76
+    reqDeptTaskType,
77
+    reqFetchDataList
75
   } from '../../request/api.js';
78
   } from '../../request/api.js';
76
   import {
79
   import {
77
     GDSTATE
80
     GDSTATE
@@ -90,40 +93,47 @@
90
       };
93
       };
91
     },
94
     },
92
     computed: {
95
     computed: {
93
-      ...mapState('user', ['loginInfo']),
94
-      ...mapState(['isShowSeiminModel']),
96
+      ...mapState('user', ['loginInfo', 'loginInfoUserDeptId']),
97
+      ...mapState(['isShowSeiminModel', 'deptDisplay', 'specimenButton', 'updateTipsForNurses']),
95
     },
98
     },
96
     methods: {
99
     methods: {
97
-      ...mapMutations(['changeSeiminModel', 'changeQucikCreateOrderType']),
100
+      ...mapMutations(['changeSeiminModel', 'changeQucikCreateOrderType', 'changeDeptDisplay',
101
+        'changeUpdateTipsForNurses', 'changeSpecimenButton', 'changeNurseDeptSwitchTip'
102
+      ]),
98
       // 获取页面数据
103
       // 获取页面数据
99
       init() {
104
       init() {
100
-        let deptId = this.loginInfo.user && this.loginInfo.user.dept.id;
101
         Promise.all([
105
         Promise.all([
102
-          reqSpecimenWorkOrderMsg({
103
-            deptId
104
-          }),
105
-          reqWorkOrders({
106
-            "workOrder": {
107
-              "createDept": deptId,
108
-              "platform": 2,
109
-              "searchDays": 2,
110
-            },
111
-            "idx": 0,
112
-            "sum": 5
113
-          }),
114
-          reqDeptTaskType({
115
-            deptId
116
-          })
106
+          this.querySpecimenNumRequest(), //查询急标和普标数量
107
+          this.queryWorkOrdersRequest(), //查询最新工单列表
108
+          this.queryDeptTaskTypeRequest(), //查询快捷工单(其他临床服务任务类型)
109
+          this.queryDeptDisplayRequest(), //护士端科室显示选择(名称还是别名)
110
+          this.queryUpdateTipsForNursesRequest(), //护士端更新提示
111
+          this.querySpecimenButtonRequest(), //标本按钮文字
112
+          this.queryNurseDeptSwitchTipRequest(), //护士科室切换提示自动关闭设置
117
         ]).then(values => {
113
         ]).then(values => {
118
           uni.hideLoading();
114
           uni.hideLoading();
119
           uni.stopPullDownRefresh();
115
           uni.stopPullDownRefresh();
120
-          this.querySpecimenNum(values[0]);
121
-          this.queryWorkOrders(values[1]);
122
-          this.queryDeptTaskType(values[2]);
116
+          this.querySpecimenNumResponse(values[0]);
117
+          this.queryWorkOrdersResponse(values[1]);
118
+          this.queryDeptTaskTypeResponse(values[2]);
119
+          this.queryDeptDisplayResponse(values[3]);
120
+          this.queryUpdateTipsForNursesResponse(values[4]);
121
+          this.querySpecimenButtonResponse(values[5]);
122
+          this.queryNurseDeptSwitchTipResponse(values[6]);
123
+          if (this.isShowSeiminModel) {
124
+            this.showDeptModel();
125
+            this.changeSeiminModel(false);
126
+          }
123
         });
127
         });
124
       },
128
       },
125
       // 查询急标和普标数量
129
       // 查询急标和普标数量
126
-      querySpecimenNum(res) {
130
+      querySpecimenNumRequest() {
131
+        return reqSpecimenWorkOrderMsg({
132
+          deptId: this.loginInfoUserDeptId
133
+        })
134
+      },
135
+      // 查询急标和普标数量
136
+      querySpecimenNumResponse(res) {
127
         if (res.status == 200) {
137
         if (res.status == 200) {
128
           if (res.specimenCount) {
138
           if (res.specimenCount) {
129
             this.urgentNum = res.specimenCount.urgent;
139
             this.urgentNum = res.specimenCount.urgent;
@@ -134,7 +144,19 @@
134
         }
144
         }
135
       },
145
       },
136
       // 查询最新工单列表
146
       // 查询最新工单列表
137
-      queryWorkOrders(res) {
147
+      queryWorkOrdersRequest() {
148
+        return reqFetchDataList('nurse', 'workOrder', {
149
+          "workOrder": {
150
+            "createDept": this.loginInfoUserDeptId,
151
+            "platform": 2,
152
+            "searchDays": 2,
153
+          },
154
+          "idx": 0,
155
+          "sum": 5
156
+        })
157
+      },
158
+      // 查询最新工单列表
159
+      queryWorkOrdersResponse(res) {
138
         if (res.status == 200) {
160
         if (res.status == 200) {
139
           this.newOrderList = res.list.map(v => {
161
           this.newOrderList = res.list.map(v => {
140
             if (v.gdState) {
162
             if (v.gdState) {
@@ -151,12 +173,82 @@
151
         }
173
         }
152
       },
174
       },
153
       // 查询快捷工单(其他临床服务任务类型)
175
       // 查询快捷工单(其他临床服务任务类型)
154
-      queryDeptTaskType(res) {
176
+      queryDeptTaskTypeRequest() {
177
+        return reqDeptTaskType({
178
+          deptId: this.loginInfoUserDeptId
179
+        })
180
+      },
181
+      // 查询快捷工单(其他临床服务任务类型)
182
+      queryDeptTaskTypeResponse(res) {
155
         if (res.status == 200) {
183
         if (res.status == 200) {
156
           this.quickOtherList = res.data.allTaskTypes.filter(v => v.associationType.value == ASSOCIATION_TYPES[
184
           this.quickOtherList = res.data.allTaskTypes.filter(v => v.associationType.value == ASSOCIATION_TYPES[
157
             '其他临床服务']);
185
             '其他临床服务']);
158
         }
186
         }
159
       },
187
       },
188
+      // 护士端科室显示选择(名称还是别名)
189
+      queryDeptDisplayRequest() {
190
+        return reqFetchDataList('simple/data', 'systemConfiguration', {
191
+          "idx": 0,
192
+          "sum": 1,
193
+          "systemConfiguration": {
194
+            "keyconfig": "deptDisplay"
195
+          }
196
+        })
197
+      },
198
+      // 护士端科室显示选择(名称还是别名)
199
+      queryDeptDisplayResponse(res) {
200
+        if (res.status == 200) {
201
+          this.changeDeptDisplay(res.list[0].valueconfig);
202
+        }
203
+      },
204
+      // 护士端更新提示
205
+      queryUpdateTipsForNursesRequest() {
206
+        return reqFetchDataList('simple/data', 'systemConfiguration', {
207
+          "idx": 0,
208
+          "sum": 1,
209
+          "systemConfiguration": {
210
+            "keyconfig": "updateTipsForNurses"
211
+          }
212
+        })
213
+      },
214
+      // 护士端更新提示
215
+      queryUpdateTipsForNursesResponse(res) {
216
+        if (res.status == 200) {
217
+          this.changeUpdateTipsForNurses(res.list[0].valueconfig);
218
+        }
219
+      },
220
+      // 标本按钮文字
221
+      querySpecimenButtonRequest() {
222
+        return reqFetchDataList('simple/data', 'systemConfiguration', {
223
+          "idx": 0,
224
+          "sum": 1,
225
+          "systemConfiguration": {
226
+            "keyconfig": "specimenButton"
227
+          }
228
+        })
229
+      },
230
+      // 标本按钮文字
231
+      querySpecimenButtonResponse(res) {
232
+        if (res.status == 200) {
233
+          this.changeSpecimenButton(res.list[0].valueconfig);
234
+        }
235
+      },
236
+      // 护士科室切换提示自动关闭设置
237
+      queryNurseDeptSwitchTipRequest() {
238
+        return reqFetchDataList('simple/data', 'systemConfiguration', {
239
+          "idx": 0,
240
+          "sum": 1,
241
+          "systemConfiguration": {
242
+            "keyconfig": "nurseDeptSwitchTip"
243
+          }
244
+        })
245
+      },
246
+      // 护士科室切换提示自动关闭设置
247
+      queryNurseDeptSwitchTipResponse(res) {
248
+        if (res.status == 200) {
249
+          this.changeNurseDeptSwitchTip(res.list[0].valueconfig);
250
+        }
251
+      },
160
       // 一键收取标本
252
       // 一键收取标本
161
       collectSpecimens() {
253
       collectSpecimens() {
162
         uni.navigateTo({
254
         uni.navigateTo({
@@ -169,8 +261,8 @@
169
         const {
261
         const {
170
           user //当前登录用户
262
           user //当前登录用户
171
         } = this.loginInfo;
263
         } = this.loginInfo;
172
-        const userDept = (user && user.dept) ? user.dept.dept : '';
173
-        this.$refs.seiminModel.show({
264
+        const userDept = (user && user.dept) ? (this.deptDisplay == 1 ? user.dept.dept : user.dept.deptalias) : '';
265
+        this.$refs.seiminModel.showChangeDept({
174
           content: `您当前所属科室为<text class="green">${userDept}</text>,如与您实际科室不符点击<text class="red">切换科室</text>。`,
266
           content: `您当前所属科室为<text class="green">${userDept}</text>,如与您实际科室不符点击<text class="red">切换科室</text>。`,
175
           btns: [{
267
           btns: [{
176
               name: "知道了",
268
               name: "知道了",
@@ -190,10 +282,6 @@
190
       },
282
       },
191
     },
283
     },
192
     mounted() {
284
     mounted() {
193
-      if (this.isShowSeiminModel) {
194
-        this.showDeptModel();
195
-        this.changeSeiminModel(false);
196
-      }
197
       uni.showLoading({
285
       uni.showLoading({
198
         title: '加载中',
286
         title: '加载中',
199
         mask: true
287
         mask: true
@@ -264,18 +352,26 @@
264
         }
352
         }
265
       }
353
       }
266
 
354
 
355
+      // 通告栏
356
+      .uni-noticebar {
357
+        height: 88rpx;
358
+        margin-top: 24rpx;
359
+        margin-bottom: 0;
360
+        border: 1px solid #E5E9ED;
361
+      }
362
+
267
       // 一键收标本
363
       // 一键收标本
268
       .collect_specimens {
364
       .collect_specimens {
269
         width: 702rpx;
365
         width: 702rpx;
270
         height: 176rpx;
366
         height: 176rpx;
271
         background-color: #fff;
367
         background-color: #fff;
272
-        margin-top: 24rpx;
368
+        margin-top: 8rpx;
273
         border-radius: 8rpx;
369
         border-radius: 8rpx;
274
         // box-shadow: 0 0 7rpx 0 rgba(73, 184, 86, 0.09);
370
         // box-shadow: 0 0 7rpx 0 rgba(73, 184, 86, 0.09);
275
         border: 1px solid #E5E9ED;
371
         border: 1px solid #E5E9ED;
276
         position: relative;
372
         position: relative;
277
         @include flex(center, center);
373
         @include flex(center, center);
278
-        @include semicircle(#fff);
374
+        @include semicircle(#f9fafb);
279
 
375
 
280
         .collect_icon {
376
         .collect_icon {
281
           width: 48rpx;
377
           width: 48rpx;
@@ -314,6 +410,7 @@
314
 
410
 
315
         .collect_btn {
411
         .collect_btn {
316
           margin: 0;
412
           margin: 0;
413
+          width: 224rpx;
317
           height: 88rpx;
414
           height: 88rpx;
318
           background: linear-gradient(90deg, #74C271 0%, #39B199 100%);
415
           background: linear-gradient(90deg, #74C271 0%, #39B199 100%);
319
           border-radius: 56rpx;
416
           border-radius: 56rpx;

+ 9 - 9
request/api.js

@@ -26,14 +26,6 @@ export const reqSpecimenWorkOrderMsg = (postData) =>
26
     method: 'POST'
26
     method: 'POST'
27
   });
27
   });
28
 
28
 
29
-// 首页最新工单列表
30
-export const reqWorkOrders = (postData) =>
31
-  request({
32
-    url: "/nurse/fetchDataList/workOrder",
33
-    data: postData,
34
-    method: 'POST'
35
-  });
36
-
37
 // 首页快捷工单(其他临床服务任务类型)
29
 // 首页快捷工单(其他临床服务任务类型)
38
 export const reqDeptTaskType = (postData) =>
30
 export const reqDeptTaskType = (postData) =>
39
   request({
31
   request({
@@ -41,7 +33,7 @@ export const reqDeptTaskType = (postData) =>
41
     data: postData,
33
     data: postData,
42
     method: 'POST'
34
     method: 'POST'
43
   });
35
   });
44
-  
36
+
45
 // 获取动态二维码
37
 // 获取动态二维码
46
 export const reqDeptCodes = (postData) =>
38
 export const reqDeptCodes = (postData) =>
47
   request({
39
   request({
@@ -49,3 +41,11 @@ export const reqDeptCodes = (postData) =>
49
     data: postData,
41
     data: postData,
50
     method: 'POST'
42
     method: 'POST'
51
   });
43
   });
44
+
45
+// fetchDataList查询(通用)
46
+export const reqFetchDataList = (type, target, postData) =>
47
+  request({
48
+    url: `/${type}/fetchDataList/${target}`,
49
+    data: postData,
50
+    method: 'POST'
51
+  });

+ 26 - 2
store/index.js

@@ -26,8 +26,16 @@ const myPlugin = (store) => {
26
 
26
 
27
 export default new Vuex.Store({
27
 export default new Vuex.Store({
28
   state: {
28
   state: {
29
-    isShowSeiminModel: false,//是否显示切换科室弹窗
30
-    qucikCreateOrderType: '',//快捷建单类型
29
+    isShowSeiminModel: false, //是否显示切换科室弹窗
30
+    qucikCreateOrderType: '', //快捷建单类型
31
+    deptDisplay: 1, //护士端科室显示选择(名称还是别名)1是名称,2是别名
32
+    updateTipsForNurses: '', //护士端更新提示
33
+    specimenButton: '', //标本按钮文字
34
+    //护士科室切换提示自动关闭设置
35
+    // (1)	当用户设置为正数时,用户必须查看此窗体指定秒数。
36
+    // (2)	当用户设置为负数时,用户可点击知道了也可倒计时自动关闭。
37
+    // (3)	如果用户填写0则为无自动关闭和强制查看时间。
38
+    nurseDeptSwitchTip: 0,
31
   },
39
   },
32
   mutations: {
40
   mutations: {
33
     //是否显示切换科室弹窗
41
     //是否显示切换科室弹窗
@@ -38,6 +46,22 @@ export default new Vuex.Store({
38
     changeQucikCreateOrderType(state, args) {
46
     changeQucikCreateOrderType(state, args) {
39
       state.qucikCreateOrderType = args;
47
       state.qucikCreateOrderType = args;
40
     },
48
     },
49
+    //护士端科室显示选择(名称还是别名)1是名称,2是别名
50
+    changeDeptDisplay(state, args) {
51
+      state.deptDisplay = args;
52
+    },
53
+    //护士端更新提示
54
+    changeUpdateTipsForNurses(state, args) {
55
+      state.updateTipsForNurses = args;
56
+    },
57
+    //标本按钮文字
58
+    changeSpecimenButton(state, args) {
59
+      state.specimenButton = args;
60
+    },
61
+    //护士科室切换提示自动关闭设置
62
+    changeNurseDeptSwitchTip(state, args) {
63
+      state.nurseDeptSwitchTip = args;
64
+    },
41
   },
65
   },
42
   modules: {
66
   modules: {
43
     user,
67
     user,

+ 3 - 1
store/modules/user.js

@@ -2,12 +2,14 @@ import {
2
   reqLogin
2
   reqLogin
3
 } from "@/request/api.js";
3
 } from "@/request/api.js";
4
 const state = {
4
 const state = {
5
-  loginInfo: {},
5
+  loginInfo: {}, //当前登录用户信息
6
+  loginInfoUserDeptId: undefined, //当前登录用户所属科室id
6
 };
7
 };
7
 const getters = {};
8
 const getters = {};
8
 const mutations = {
9
 const mutations = {
9
   vxLogin(state, args) {
10
   vxLogin(state, args) {
10
     state.loginInfo = args;
11
     state.loginInfo = args;
12
+    state.loginInfoUserDeptId = args.user.dept.id;
11
   },
13
   },
12
 };
14
 };
13
 const actions = {
15
 const actions = {