Browse Source

增加版本号-患者建单选择科室

seimin 3 years ago
parent
commit
20dfcb357f
4 changed files with 129 additions and 44 deletions
  1. 1 0
      main.js
  2. 13 13
      pages/patientList/patientList.vue
  3. 113 31
      pages/quickCreateOrder/quickCreateOrder.vue
  4. 2 0
      store/modules/other.js

+ 1 - 0
main.js

@@ -12,6 +12,7 @@ import {
12
 Vue.prototype.$request = request
12
 Vue.prototype.$request = request
13
 
13
 
14
 Vue.config.productionTip = false
14
 Vue.config.productionTip = false
15
+console.info('v2.4.1')
15
 
16
 
16
 App.mpType = 'app'
17
 App.mpType = 'app'
17
 
18
 

+ 13 - 13
pages/patientList/patientList.vue

@@ -100,14 +100,9 @@
100
         })
100
         })
101
         reqBuildTrip(postData).then(res => {
101
         reqBuildTrip(postData).then(res => {
102
           uni.hideLoading();
102
           uni.hideLoading();
103
-          if (res.status == 200) {
104
-            this.checkedShowMsg = res.data;
105
-            this.changeQucikCreateOrderType({
106
-              type: "patient",
107
-              taskTypeId: checkedObj.value,
108
-              patientBuildTrip: res,
109
-            });
110
-          } else if (res.status == 100015) {
103
+          let taskType = this.taskTypeList.find(v => v.value == checkedObj.value);
104
+          let patientTaskTypeName = taskType ? taskType.label : '';
105
+          if (res.status == 100015) {
111
             this.checkedShowMsg = res.data;
106
             this.checkedShowMsg = res.data;
112
             //需要选择起点科室和目标科室
107
             //需要选择起点科室和目标科室
113
             uni.navigateTo({
108
             uni.navigateTo({
@@ -116,6 +111,7 @@
116
             this.changeQucikCreateOrderType({
111
             this.changeQucikCreateOrderType({
117
               type: "patient",
112
               type: "patient",
118
               taskTypeId: checkedObj.value,
113
               taskTypeId: checkedObj.value,
114
+              patientTaskTypeName,
119
               patientBuildTrip: res,
115
               patientBuildTrip: res,
120
             });
116
             });
121
           } else if (res.status == 100013) {
117
           } else if (res.status == 100013) {
@@ -127,6 +123,7 @@
127
             this.changeQucikCreateOrderType({
123
             this.changeQucikCreateOrderType({
128
               type: "patient",
124
               type: "patient",
129
               taskTypeId: checkedObj.value,
125
               taskTypeId: checkedObj.value,
126
+              patientTaskTypeName,
130
               patientBuildTrip: res,
127
               patientBuildTrip: res,
131
             });
128
             });
132
           } else if (res.status == 100014) {
129
           } else if (res.status == 100014) {
@@ -138,15 +135,18 @@
138
             this.changeQucikCreateOrderType({
135
             this.changeQucikCreateOrderType({
139
               type: "patient",
136
               type: "patient",
140
               taskTypeId: checkedObj.value,
137
               taskTypeId: checkedObj.value,
138
+              patientTaskTypeName,
141
               patientBuildTrip: res,
139
               patientBuildTrip: res,
142
             });
140
             });
143
           } else {
141
           } else {
144
-            this.$refs.seiminModel.show({
145
-              skin: "toast",
146
-              icon: "error",
147
-              content: res.msg || "获取数据失败",
142
+            //无需选择科室
143
+            this.checkedShowMsg = res.data;
144
+            this.changeQucikCreateOrderType({
145
+              type: "patient",
146
+              taskTypeId: checkedObj.value,
147
+              patientTaskTypeName,
148
+              patientBuildTrip: res,
148
             });
149
             });
149
-            throw new Error(res.msg || "获取数据失败");
150
           }
150
           }
151
         })
151
         })
152
       },
152
       },

+ 113 - 31
pages/quickCreateOrder/quickCreateOrder.vue

@@ -11,8 +11,8 @@
11
       <!-- 返回值的departmentStrategy是204 则是自主填写 -->
11
       <!-- 返回值的departmentStrategy是204 则是自主填写 -->
12
       <!-- 返回值的departmentStrategy是205 则是固定科室类型 -->
12
       <!-- 返回值的departmentStrategy是205 则是固定科室类型 -->
13
       <!-- 100013 (护士端一键建单展示策略)取起点科室,和msg值展示 -->
13
       <!-- 100013 (护士端一键建单展示策略)取起点科室,和msg值展示 -->
14
-      <!-- <block v-if="dataObj.status == 100013"> -->
15
-      <view class="select_block" @click="selectDept('start')">
14
+      <view class="select_block" @click="selectDept('start')"
15
+        v-if="qucikCreateOrderType !== 'patient'||(qucikCreateOrderType === 'patient'&&!(dataObj.start.start.departmentStrategy == 201 || dataObj.start.start.departmentStrategy == 203))">
16
         <!-- 默认科室和固定科室 -->
16
         <!-- 默认科室和固定科室 -->
17
         <text class="select_label"
17
         <text class="select_label"
18
           :class="{disableColor:dataObj.start.start.departmentStrategy == 201 || dataObj.start.start.departmentStrategy == 203}">起点科室</text>
18
           :class="{disableColor:dataObj.start.start.departmentStrategy == 201 || dataObj.start.start.departmentStrategy == 203}">起点科室</text>
@@ -26,7 +26,8 @@
26
           <text class="pda pda-xiangyou"></text>
26
           <text class="pda pda-xiangyou"></text>
27
         </view>
27
         </view>
28
       </view>
28
       </view>
29
-      <view class="select_block" @click="selectDept('end')">
29
+      <view class="select_block" @click="selectDept('end')"
30
+        v-if="qucikCreateOrderType !== 'patient'||(qucikCreateOrderType === 'patient'&&!(dataObj.end.end.departmentStrategy == 201 || dataObj.end.end.departmentStrategy == 203))">
30
         <!-- 默认科室和固定科室 -->
31
         <!-- 默认科室和固定科室 -->
31
         <text class="select_label"
32
         <text class="select_label"
32
           :class="{disableColor:dataObj.end.end.departmentStrategy == 201 || dataObj.end.end.departmentStrategy == 203}">终点科室</text>
33
           :class="{disableColor:dataObj.end.end.departmentStrategy == 201 || dataObj.end.end.departmentStrategy == 203}">终点科室</text>
@@ -40,7 +41,6 @@
40
           <text class="pda pda-xiangyou"></text>
41
           <text class="pda pda-xiangyou"></text>
41
         </view>
42
         </view>
42
       </view>
43
       </view>
43
-      <!-- </block> -->
44
     </block>
44
     </block>
45
     <!-- 备注 -->
45
     <!-- 备注 -->
46
     <view class="remarks" v-if="dataObj.remarksSwitch == 1">
46
     <view class="remarks" v-if="dataObj.remarksSwitch == 1">
@@ -79,6 +79,7 @@
79
 </template>
79
 </template>
80
 
80
 
81
 <script>
81
 <script>
82
+  import cloneDeep from 'lodash/cloneDeep';
82
   import {
83
   import {
83
     mapState,
84
     mapState,
84
     mapMutations
85
     mapMutations
@@ -95,7 +96,7 @@
95
     data() {
96
     data() {
96
       return {
97
       return {
97
         //患者建单信息展示
98
         //患者建单信息展示
98
-        patientMsg: '您选择类型为<b class="green">转科</b>,需要填写科室,选择完成后点击下一步',
99
+        patientMsg: '',
99
         // 传递过来的参数
100
         // 传递过来的参数
100
         queryParams: {},
101
         queryParams: {},
101
         // 选择的起点科室
102
         // 选择的起点科室
@@ -117,23 +118,7 @@
117
         // 历史输入
118
         // 历史输入
118
         historyCustomRemarks: [],
119
         historyCustomRemarks: [],
119
         //底部按钮
120
         //底部按钮
120
-        btns: [{
121
-            name: "回到首页",
122
-            type: "default",
123
-            click: () => {
124
-              uni.navigateTo({
125
-                url: "/pages/index/index",
126
-              });
127
-            },
128
-          },
129
-          {
130
-            name: "确认",
131
-            type: "primary",
132
-            click: () => {
133
-              this.submitData();
134
-            },
135
-          },
136
-        ],
121
+        btns: [],
137
       };
122
       };
138
     },
123
     },
139
     computed: {
124
     computed: {
@@ -144,8 +129,54 @@
144
         "deptDisplay",
129
         "deptDisplay",
145
         'searchDeptParams',
130
         'searchDeptParams',
146
         'searchDeptResultList',
131
         'searchDeptResultList',
147
-        'patientBuildTrip'
132
+        'patientBuildTrip',
133
+        'patientTaskTypeName'
148
       ]),
134
       ]),
135
+      isWriteDept() {
136
+        return {
137
+          startDept: this.startDept,
138
+          endDept: this.endDept
139
+        }
140
+      }
141
+    },
142
+    watch: {
143
+      isWriteDept(newVal) {
144
+        console.log(newVal);
145
+        if (this.qucikCreateOrderType !== 'patient') {
146
+          return;
147
+        }
148
+        if (newVal.startDept.id && newVal.endDept.id) {
149
+          this.btns = [{
150
+              name: "返回列表",
151
+              type: "default",
152
+              click: () => {
153
+                uni.navigateTo({
154
+                  url:'/pages/patientList/patientList'
155
+                })
156
+              },
157
+            },
158
+            {
159
+              name: "下一步",
160
+              type: "primary",
161
+              click: () => {
162
+                uni.navigateTo({
163
+                  url: "/pages/index/index",
164
+                });
165
+              },
166
+            },
167
+          ];
168
+        } else {
169
+          this.btns = [{
170
+            name: "返回列表",
171
+            type: "default",
172
+            click: () => {
173
+              uni.navigateTo({
174
+                url:'/pages/patientList/patientList'
175
+              })
176
+            },
177
+          }, ];
178
+        }
179
+      }
149
     },
180
     },
150
     methods: {
181
     methods: {
151
       ...mapMutations('other', ['changeSearchDeptParams', 'changeSearchDeptResultList']),
182
       ...mapMutations('other', ['changeSearchDeptParams', 'changeSearchDeptResultList']),
@@ -194,6 +225,7 @@
194
       },
225
       },
195
       // 获取数据(除历史输入)
226
       // 获取数据(除历史输入)
196
       getBuildTrip(res) {
227
       getBuildTrip(res) {
228
+        res = cloneDeep(res);
197
         if (
229
         if (
198
           res.status == 200 ||
230
           res.status == 200 ||
199
           res.status == 100012 ||
231
           res.status == 100012 ||
@@ -213,13 +245,28 @@
213
             res.msg = res.msg.replace(/<b>/g, '<text class="green">');
245
             res.msg = res.msg.replace(/<b>/g, '<text class="green">');
214
             res.msg = res.msg.replace(/<\/b>/g, "</text>");
246
             res.msg = res.msg.replace(/<\/b>/g, "</text>");
215
           }
247
           }
216
-          if (res.start || res.end) {
248
+          if (res.start) {
217
             //其他服务建单
249
             //其他服务建单
218
             if (
250
             if (
219
               res.start.start.departmentStrategy == 201 ||
251
               res.start.start.departmentStrategy == 201 ||
220
               res.start.start.departmentStrategy == 203) {
252
               res.start.start.departmentStrategy == 203) {
221
               this.startDept = res.start.start.list[0];
253
               this.startDept = res.start.start.list[0];
222
             }
254
             }
255
+
256
+            if (
257
+              res.start.start.departmentStrategy == 202 ||
258
+              res.start.start.departmentStrategy == 204 ||
259
+              res.start.start.departmentStrategy == 205
260
+            ) {
261
+              if (this.queryParams.isShow) {
262
+                this.startDept = this.searchDeptResultList.start || {};
263
+              } else {
264
+                this.changeSearchDeptResultList({});
265
+              }
266
+            }
267
+          }
268
+          if (res.end) {
269
+            //其他服务建单
223
             if (
270
             if (
224
               res.end.end.departmentStrategy == 201 ||
271
               res.end.end.departmentStrategy == 201 ||
225
               res.end.end.departmentStrategy == 203) {
272
               res.end.end.departmentStrategy == 203) {
@@ -227,13 +274,11 @@
227
             }
274
             }
228
 
275
 
229
             if (
276
             if (
230
-              res.start.start.departmentStrategy == 204 ||
231
-              res.start.start.departmentStrategy == 205 ||
277
+              res.end.end.departmentStrategy == 202 ||
232
               res.end.end.departmentStrategy == 204 ||
278
               res.end.end.departmentStrategy == 204 ||
233
               res.end.end.departmentStrategy == 205
279
               res.end.end.departmentStrategy == 205
234
             ) {
280
             ) {
235
               if (this.queryParams.isShow) {
281
               if (this.queryParams.isShow) {
236
-                this.startDept = this.searchDeptResultList.start || {};
237
                 this.endDept = this.searchDeptResultList.end || {};
282
                 this.endDept = this.searchDeptResultList.end || {};
238
               } else {
283
               } else {
239
                 this.changeSearchDeptResultList({});
284
                 this.changeSearchDeptResultList({});
@@ -370,6 +415,14 @@
370
           dept: checkedObj.label,
415
           dept: checkedObj.label,
371
           deptalias: checkedObj.labelAlias
416
           deptalias: checkedObj.labelAlias
372
         };
417
         };
418
+        // 防止后选择不回显
419
+        let searchDeptResultList = this.searchDeptResultList;
420
+        searchDeptResultList[this.selectdDeptType] = {
421
+          id: checkedObj.value,
422
+          dept: checkedObj.label,
423
+          deptalias: checkedObj.labelAlias
424
+        }
425
+        this.changeSearchDeptResultList(searchDeptResultList);
373
       },
426
       },
374
       // 选择起点科室
427
       // 选择起点科室
375
       selectDept(type) {
428
       selectDept(type) {
@@ -383,8 +436,8 @@
383
         }
436
         }
384
         if (
437
         if (
385
           (this.dataObj.end.end.departmentStrategy == 201 ||
438
           (this.dataObj.end.end.departmentStrategy == 201 ||
386
-            this.dataObj.end.end.departmentStrategy == 203 &&
387
-            type === 'end')) {
439
+            this.dataObj.end.end.departmentStrategy == 203) &&
440
+          type === 'end') {
388
           //默认科室和固定科室不能选科室
441
           //默认科室和固定科室不能选科室
389
           return;
442
           return;
390
         }
443
         }
@@ -419,9 +472,38 @@
419
       }
472
       }
420
     },
473
     },
421
     onLoad(queryParams) {
474
     onLoad(queryParams) {
475
+      this.patientMsg = `您选择类型为<b class="green">${this.patientTaskTypeName}</b>,需要填写科室,选择完成后点击下一步`;
422
       this.queryParams = queryParams;
476
       this.queryParams = queryParams;
423
-      console.log(queryParams);
424
-      console.log(this.qucikCreateOrderType, this.qucikCreateOrderTypeId);
477
+      if (this.qucikCreateOrderType === 'patient') {
478
+        //患者建单选科室
479
+        this.btns = [{
480
+          name: "返回列表",
481
+          type: "default",
482
+          click: () => {
483
+            uni.navigateTo({
484
+              url:'/pages/patientList/patientList'
485
+            })
486
+          },
487
+        }, ];
488
+      } else {
489
+        this.btns = [{
490
+            name: "回到首页",
491
+            type: "default",
492
+            click: () => {
493
+              uni.navigateTo({
494
+                url: "/pages/index/index",
495
+              });
496
+            },
497
+          },
498
+          {
499
+            name: "确认",
500
+            type: "primary",
501
+            click: () => {
502
+              this.submitData();
503
+            },
504
+          },
505
+        ]
506
+      }
425
       this.getData(this.qucikCreateOrderType, this.qucikCreateOrderTypeId);
507
       this.getData(this.qucikCreateOrderType, this.qucikCreateOrderTypeId);
426
     },
508
     },
427
   };
509
   };

+ 2 - 0
store/modules/other.js

@@ -6,6 +6,7 @@ const stateReset = {
6
   qucikCreateOrderTypeId: "", //快捷建单类型id
6
   qucikCreateOrderTypeId: "", //快捷建单类型id
7
   patientBuildTrip: {}, //患者建单的buildTrip
7
   patientBuildTrip: {}, //患者建单的buildTrip
8
   patientBuildData: {}, //患者建单的请求参数数据
8
   patientBuildData: {}, //患者建单的请求参数数据
9
+  patientTaskTypeName: '', //患者建单的任务类型名称
9
   deptDisplay: 1, //护士端科室显示选择(名称还是别名)1是名称,2是别名
10
   deptDisplay: 1, //护士端科室显示选择(名称还是别名)1是名称,2是别名
10
   updateTipsForNurses: "", //护士端更新提示
11
   updateTipsForNurses: "", //护士端更新提示
11
   specimenButton: "", //标本按钮文字
12
   specimenButton: "", //标本按钮文字
@@ -37,6 +38,7 @@ const mutations = {
37
     state.qucikCreateOrderType = args.type;
38
     state.qucikCreateOrderType = args.type;
38
     state.qucikCreateOrderTypeId = args.taskTypeId;
39
     state.qucikCreateOrderTypeId = args.taskTypeId;
39
     state.patientBuildTrip = args.patientBuildTrip;
40
     state.patientBuildTrip = args.patientBuildTrip;
41
+    state.patientTaskTypeName = args.patientTaskTypeName;
40
   },
42
   },
41
   //护士端科室显示选择(名称还是别名)1是名称,2是别名
43
   //护士端科室显示选择(名称还是别名)1是名称,2是别名
42
   changeDeptDisplay(state, args) {
44
   changeDeptDisplay(state, args) {