Browse Source

患者一键建单-暂存

seimin 2 years ago
parent
commit
bae1dc9b09

+ 1 - 3
pages/patientDetail/patientDetail.vue

@@ -187,9 +187,7 @@
187 187
           name: "一键建单",
188 188
           type: "default",
189 189
           click: () => {
190
-            uni.navigateTo({
191
-              url: "/pages/patientList/patientList",
192
-            });
190
+            // wocao
193 191
           },
194 192
         }],
195 193
       };

+ 113 - 1
pages/patientList/patientList.vue

@@ -31,13 +31,17 @@
31 31
           </view>
32 32
           <view class="orderList_listItem_item_btns">
33 33
             <button type="primary" class="btn" @click.stop="toDetail(patient.patientCode)">患者详情</button>
34
-            <button type="primary" class="btn" @click.stop="openRecallModal(patient.id)">一键建单</button>
34
+            <button type="primary" class="btn" @click.stop="buildOrder(patient)">一键建单</button>
35 35
           </view>
36 36
         </view>
37 37
       </view>
38 38
     </view>
39 39
     <seiminFooterNav></seiminFooterNav>
40 40
     <seiminModel ref="seiminModel"></seiminModel>
41
+    <seiminPicker ref="sPicker" :title="pickerTitle" titleColor="#808080" titleFontSize="28rpx" confirmColor="#333"
42
+      confirmFontSize="38rpx" confirmFontWeight="500" itemFontSize="28rpx" @onClose="closePicker"
43
+      @onConfirm="confirmPicker" :pickerList="taskTypeList">
44
+    </seiminPicker>
41 45
   </view>
42 46
 </template>
43 47
 
@@ -47,13 +51,20 @@
47 51
   } from 'lodash/function';
48 52
   import {
49 53
     reqFetchDataList,
54
+    reqDeptTSPTaskType,
55
+    reqBuildTrip,
50 56
   } from "../../request/api.js";
51 57
   import {
52 58
     mapState,
59
+    mapMutations,
53 60
   } from "vuex";
54 61
   export default {
55 62
     data() {
56 63
       return {
64
+        checkedShowMsg: {}, //当前选中的任务类型的buildtrip信息
65
+        selectedPatient: {}, //当前选中的患者
66
+        taskTypeList: [], //任务类型列表
67
+        pickerTitle: "", //一键建单picker的title
57 68
         debounceInp: null,
58 69
         keyword: "",
59 70
         patientList: [],
@@ -66,6 +77,107 @@
66 77
       ...mapState('other', ["deptDisplay"]),
67 78
     },
68 79
     methods: {
80
+      ...mapMutations('other', ['changeQucikCreateOrderType']),
81
+      //关闭
82
+      closePicker() {
83
+        this.$refs.sPicker._close();
84
+      },
85
+      //打开
86
+      openPicker() {
87
+        this.$refs.sPicker._open();
88
+      },
89
+      //确定:接收子组件传来的参数
90
+      confirmPicker(checkedObj) {
91
+        console.log(checkedObj);
92
+        // 2,获取buildTrip信息
93
+        let postData = {
94
+          "taskTypeId": checkedObj.value,
95
+          "patientCode": this.selectedPatient.patientCode
96
+        };
97
+        uni.showLoading({
98
+          mask: true,
99
+          title: '加载中'
100
+        })
101
+        reqBuildTrip(postData).then(res => {
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) {
111
+            this.checkedShowMsg = res.data;
112
+            //需要选择起点科室和目标科室
113
+            uni.navigateTo({
114
+              url: "/pages/quickCreateOrder/quickCreateOrder",
115
+            });
116
+            this.changeQucikCreateOrderType({
117
+              type: "patient",
118
+              taskTypeId: checkedObj.value,
119
+              patientBuildTrip: res,
120
+            });
121
+          } else if (res.status == 100013) {
122
+            this.checkedShowMsg = res.data;
123
+            //需要选择起点科室
124
+            uni.navigateTo({
125
+              url: "/pages/quickCreateOrder/quickCreateOrder",
126
+            });
127
+            this.changeQucikCreateOrderType({
128
+              type: "patient",
129
+              taskTypeId: checkedObj.value,
130
+              patientBuildTrip: res,
131
+            });
132
+          } else if (res.status == 100014) {
133
+            this.checkedShowMsg = res.data;
134
+            //需要选择目标科室
135
+            uni.navigateTo({
136
+              url: "/pages/quickCreateOrder/quickCreateOrder",
137
+            });
138
+            this.changeQucikCreateOrderType({
139
+              type: "patient",
140
+              taskTypeId: checkedObj.value,
141
+              patientBuildTrip: res,
142
+            });
143
+          } else {
144
+            this.$refs.seiminModel.show({
145
+              skin: "toast",
146
+              icon: "error",
147
+              content: res.msg || "获取数据失败",
148
+            });
149
+            throw new Error(res.msg || "获取数据失败");
150
+          }
151
+        })
152
+      },
153
+      // 一键建单
154
+      buildOrder(patient) {
155
+        this.selectedPatient = patient;
156
+        // 1,请求任务类型列表
157
+        uni.showLoading({
158
+          mask: true,
159
+          title: '加载中'
160
+        })
161
+        reqDeptTSPTaskType().then(res => {
162
+          uni.hideLoading();
163
+          if (res.status == 200) {
164
+            res.data = res.data || [];
165
+            this.taskTypeList = res.data.map((v) => ({
166
+              value: v.id,
167
+              label: v.taskName,
168
+            }));
169
+            this.pickerTitle = `您选择了<b class="green">${patient.patientName}</b>患者,请选择下方具体服务项`;
170
+            this.openPicker();
171
+          } else {
172
+            this.$refs.seiminModel.show({
173
+              skin: "toast",
174
+              icon: "error",
175
+              content: res.msg || "获取数据失败",
176
+            });
177
+            throw new Error(res.msg || "获取数据失败");
178
+          }
179
+        })
180
+      },
69 181
       // 跳转患者详情
70 182
       toDetail(patientCode) {
71 183
         uni.navigateTo({

+ 14 - 4
pages/quickCreateOrder/quickCreateOrder.vue

@@ -1,8 +1,10 @@
1 1
 <template>
2 2
   <view class="quickCreateOrder">
3
-    <view class="qco_msg" v-html="dataObj.msg"></view>
3
+    <view class="qco_msg" v-html="patientMsg" v-if="qucikCreateOrderType === 'patient'"></view>
4
+    <view class="qco_msg" v-html="dataObj.msg" v-else></view>
4 5
     <!-- 起点科室,终点科室 -->
5
-    <block v-if="qucikCreateOrderType === 'other' && (dataObj.start || dataObj.end)">
6
+    <block
7
+      v-if="(qucikCreateOrderType === 'other' || qucikCreateOrderType === 'patient') && (dataObj.start || dataObj.end)">
6 8
       <!-- 返回值的departmentStrategy是201 则是默认发起科室 -->
7 9
       <!-- 返回值的departmentStrategy是202 则是固定科室范围 -->
8 10
       <!-- 返回值的departmentStrategy是203 则是固定科室 -->
@@ -92,6 +94,8 @@
92 94
   export default {
93 95
     data() {
94 96
       return {
97
+        //患者建单信息展示
98
+        patientMsg: '您选择类型为<b class="green">转科</b>,需要填写科室,选择完成后点击下一步',
95 99
         // 传递过来的参数
96 100
         queryParams: {},
97 101
         // 选择的起点科室
@@ -139,7 +143,8 @@
139 143
         "qucikCreateOrderTypeId",
140 144
         "deptDisplay",
141 145
         'searchDeptParams',
142
-        'searchDeptResultList'
146
+        'searchDeptResultList',
147
+        'patientBuildTrip'
143 148
       ]),
144 149
     },
145 150
     methods: {
@@ -154,6 +159,11 @@
154 159
       },
155 160
       //获取所有数据
156 161
       getData(qucikCreateOrderType, qucikCreateOrderTypeId) {
162
+        if (qucikCreateOrderType === 'patient') {
163
+          //患者建单,则无需请求
164
+          this.getBuildTrip(this.patientBuildTrip);
165
+          return;
166
+        }
157 167
         uni.showLoading({
158 168
           title: "加载中",
159 169
         });
@@ -423,7 +433,7 @@
423 433
 
424 434
     .qco_msg {
425 435
       min-height: 144rpx;
426
-      padding: 32rpx 160rpx;
436
+      padding: 32rpx;
427 437
       color: #999;
428 438
       line-height: 40rpx;
429 439
       font-size: 28rpx;

+ 9 - 1
request/api.js

@@ -139,7 +139,15 @@ export const reqFetchWorkOrderLog = (id) =>
139 139
 // 患者详情,患者标本,患者检查
140 140
 export const reqGetPatientInspectInfo = (postData) =>
141 141
   request({
142
-    url: `/nurse/workOrder/getPatientInspectInfo`,
142
+    url: `/nurse/workOrder/getPatientInspectInfoByTime`,
143
+    data: postData,
144
+    method: 'POST'
145
+  });
146
+  
147
+// 患者一键建单请求任务类型
148
+export const reqDeptTSPTaskType = (postData) =>
149
+  request({
150
+    url: `/configuration/deptTSPTaskType`,
143 151
     data: postData,
144 152
     method: 'POST'
145 153
   });

+ 3 - 0
store/modules/other.js

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