浏览代码

其他临床服务建单

seimin 3 年之前
父节点
当前提交
5d00fccc2d

+ 7 - 1
components/seiminPicker/seiminPicker.vue

@@ -8,7 +8,7 @@
8
       <picker-view indicator-style="height: 90rpx;" class="picker-view" :value="pickerValue" @change="changePicker">
8
       <picker-view indicator-style="height: 90rpx;" class="picker-view" :value="pickerValue" @change="changePicker">
9
         <picker-view-column>
9
         <picker-view-column>
10
           <view class="picker-item" :style="{fontSize:itemFontSize}" v-for="(item, index) in pickerList" :key="index">
10
           <view class="picker-item" :style="{fontSize:itemFontSize}" v-for="(item, index) in pickerList" :key="index">
11
-            {{item.label}}
11
+            {{(deptDisplay == 2&&item.labelAlias)?item.labelAlias:item.label}}
12
           </view>
12
           </view>
13
         </picker-view-column>
13
         </picker-view-column>
14
       </picker-view>
14
       </picker-view>
@@ -20,8 +20,14 @@
20
 </template>
20
 </template>
21
 
21
 
22
 <script>
22
 <script>
23
+  import {
24
+    mapState
25
+  } from "vuex";
23
   export default {
26
   export default {
24
     name: 'seiminPicker',
27
     name: 'seiminPicker',
28
+    computed: {
29
+      ...mapState(["deptDisplay"]),
30
+    },
25
     props: {
31
     props: {
26
       title: { //标题文字
32
       title: { //标题文字
27
         type: String,
33
         type: String,

+ 2 - 1
pages/index/index.vue

@@ -649,7 +649,8 @@ export default {
649
           color: #fff;
649
           color: #fff;
650
           text-align: center;
650
           text-align: center;
651
 
651
 
652
-          @include flex(center, center) .quick_other_container_item_text {
652
+          @include flex(center, center);
653
+          .quick_other_container_item_text {
653
             @include clamp(2);
654
             @include clamp(2);
654
           }
655
           }
655
 
656
 

+ 394 - 329
pages/quickCreateOrder/quickCreateOrder.vue

@@ -2,9 +2,7 @@
2
   <view class="quickCreateOrder">
2
   <view class="quickCreateOrder">
3
     <view class="qco_msg" v-html="dataObj.msg"></view>
3
     <view class="qco_msg" v-html="dataObj.msg"></view>
4
     <!-- 起点科室,终点科室 -->
4
     <!-- 起点科室,终点科室 -->
5
-    <block
6
-      v-if="qucikCreateOrderType === 'other' && (dataObj.start || dataObj.end)"
7
-    >
5
+    <block v-if="qucikCreateOrderType === 'other' && (dataObj.start || dataObj.end)">
8
       <!-- 返回值的departmentStrategy是201 则是默认发起科室 -->
6
       <!-- 返回值的departmentStrategy是201 则是默认发起科室 -->
9
       <!-- 返回值的departmentStrategy是202 则是固定科室范围 -->
7
       <!-- 返回值的departmentStrategy是202 则是固定科室范围 -->
10
       <!-- 返回值的departmentStrategy是203 则是固定科室 -->
8
       <!-- 返回值的departmentStrategy是203 则是固定科室 -->
@@ -12,105 +10,58 @@
12
       <!-- 返回值的departmentStrategy是205 则是固定科室类型 -->
10
       <!-- 返回值的departmentStrategy是205 则是固定科室类型 -->
13
       <!-- 100013 (护士端一键建单展示策略)取起点科室,和msg值展示 -->
11
       <!-- 100013 (护士端一键建单展示策略)取起点科室,和msg值展示 -->
14
       <!-- <block v-if="dataObj.status == 100013"> -->
12
       <!-- <block v-if="dataObj.status == 100013"> -->
15
-      <view class="select_block">
16
-        <text
17
-          class="select_label"
18
-          :class="{
19
-            disableColor:
20
-              dataObj.start.start.departmentStrategy == 201 ||
21
-              dataObj.start.start.departmentStrategy == 203,
22
-          }"
23
-          >起点科室</text
24
-        >
25
-        <view
26
-          class="select_placeholder"
27
-          v-if="
28
-            dataObj.start.start.departmentStrategy == 201 ||
29
-            dataObj.start.start.departmentStrategy == 203
30
-          "
31
-        >
32
-          {{
33
-            deptDisplay == 1
34
-              ? dataObj.start.start.list[0].dept
35
-              : dataObj.start.start.list[0].deptalias
36
-          }}
13
+      <view class="select_block" @click="selectDept('start')">
14
+        <!-- 默认科室和固定科室 -->
15
+        <text class="select_label"
16
+          :class="{disableColor:dataObj.start.start.departmentStrategy == 201 || dataObj.start.start.departmentStrategy == 203}">起点科室</text>
17
+        <view class="select_placeholder"
18
+          v-if="dataObj.start.start.departmentStrategy == 201 || dataObj.start.start.departmentStrategy == 203">
19
+          {{deptDisplay == 1? startDept.dept: startDept.deptalias}}
20
+        </view>
21
+        <!-- 固定科室范围,固定科室类型,自主选择 -->
22
+        <view class="select_placeholder" v-else>
23
+          <text>{{startDept.id?(deptDisplay == 1? startDept.dept: startDept.deptalias):'请选择起点科室'}}</text>
24
+          <text class="pda pda-xiangyou"></text>
37
         </view>
25
         </view>
38
-        <view class="select_placeholder" v-else
39
-          >请选择起点科室<text class="pda pda-xiangyou"></text
40
-        ></view>
41
       </view>
26
       </view>
42
-      <view class="select_block">
43
-        <text
44
-          class="select_label"
45
-          :class="{
46
-            disableColor:
47
-              dataObj.end.end.departmentStrategy == 201 ||
48
-              dataObj.end.end.departmentStrategy == 203,
49
-          }"
50
-          >终点科室</text
51
-        >
52
-        <view
53
-          class="select_placeholder"
54
-          v-if="
55
-            dataObj.end.end.departmentStrategy == 201 ||
56
-            dataObj.end.end.departmentStrategy == 203
57
-          "
58
-        >
59
-          {{
60
-            deptDisplay == 1
61
-              ? dataObj.end.end.list[0].dept
62
-              : dataObj.end.end.list[0].deptalias
63
-          }}
27
+      <view class="select_block" @click="selectDept('end')">
28
+        <!-- 默认科室和固定科室 -->
29
+        <text class="select_label"
30
+          :class="{disableColor:dataObj.end.end.departmentStrategy == 201 || dataObj.end.end.departmentStrategy == 203}">终点科室</text>
31
+        <view class="select_placeholder"
32
+          v-if="dataObj.end.end.departmentStrategy == 201 || dataObj.end.end.departmentStrategy == 203">
33
+          {{deptDisplay == 1? endDept.dept: endDept.deptalias}}
34
+        </view>
35
+        <!-- 固定科室范围,固定科室类型,自主选择 -->
36
+        <view class="select_placeholder" v-else>
37
+          <text>{{endDept.id?(deptDisplay == 1? endDept.dept: endDept.deptalias):'请选择终点科室'}}</text>
38
+          <text class="pda pda-xiangyou"></text>
64
         </view>
39
         </view>
65
-        <view class="select_placeholder" v-else
66
-          >请选择终点科室<text class="pda pda-xiangyou"></text
67
-        ></view>
68
       </view>
40
       </view>
69
       <!-- </block> -->
41
       <!-- </block> -->
70
     </block>
42
     </block>
71
     <!-- 备注 -->
43
     <!-- 备注 -->
72
     <view class="remarks" v-if="dataObj.remarksSwitch == 1">
44
     <view class="remarks" v-if="dataObj.remarksSwitch == 1">
73
-      <textarea
74
-        :focus="remarksFocus"
75
-        class="remarks_textarea"
76
-        auto-height
77
-        :maxlength="100"
78
-        placeholder-style="color:#999"
79
-        :placeholder="
45
+      <textarea :focus="remarksFocus" class="remarks_textarea" auto-height :maxlength="100"
46
+        placeholder-style="color:#999" :placeholder="
80
           dataObj.remarksPrompts || '请填写工单备注,不超过100个字符'
47
           dataObj.remarksPrompts || '请填写工单备注,不超过100个字符'
81
-        "
82
-        v-model="workOrderRemark"
83
-      />
48
+        " v-model="workOrderRemark" />
84
     </view>
49
     </view>
85
     <!-- 快捷输入,历史输入 -->
50
     <!-- 快捷输入,历史输入 -->
86
-    <view
87
-      class="quickAndHistory"
88
-      v-if="dataObj.remarksSwitch == 1 && dataObj.customRemarks.length"
89
-    >
51
+    <view class="quickAndHistory" v-if="dataObj.remarksSwitch == 1 && dataObj.customRemarks.length">
90
       <view class="quickAndHistory_header"> 快捷输入 </view>
52
       <view class="quickAndHistory_header"> 快捷输入 </view>
91
       <view class="quickAndHistory_container">
53
       <view class="quickAndHistory_container">
92
-        <view
93
-          class="quickAndHistory_item"
94
-          @click="addRemarks(customRemark)"
95
-          v-for="(customRemark, i) in dataObj.customRemarks"
96
-          :key="i"
97
-        >
54
+        <view class="quickAndHistory_item" @click="addRemarks(customRemark)"
55
+          v-for="(customRemark, i) in dataObj.customRemarks" :key="i">
98
           {{ customRemark }}
56
           {{ customRemark }}
99
         </view>
57
         </view>
100
       </view>
58
       </view>
101
     </view>
59
     </view>
102
-    <view
103
-      class="quickAndHistory"
104
-      v-if="dataObj.remarksSwitch == 1 && historyCustomRemarks.length"
105
-    >
60
+    <view class="quickAndHistory" v-if="dataObj.remarksSwitch == 1 && historyCustomRemarks.length">
106
       <view class="quickAndHistory_header"> 历史输入 </view>
61
       <view class="quickAndHistory_header"> 历史输入 </view>
107
       <view class="quickAndHistory_container">
62
       <view class="quickAndHistory_container">
108
-        <view
109
-          class="quickAndHistory_item"
110
-          @click="addRemarks(historyCustomRemark)"
111
-          v-for="(historyCustomRemark, i) in historyCustomRemarks"
112
-          :key="i"
113
-        >
63
+        <view class="quickAndHistory_item" @click="addRemarks(historyCustomRemark)"
64
+          v-for="(historyCustomRemark, i) in historyCustomRemarks" :key="i">
114
           {{ historyCustomRemark }}
65
           {{ historyCustomRemark }}
115
         </view>
66
         </view>
116
       </view>
67
       </view>
@@ -118,190 +69,247 @@
118
     <!-- 底部 -->
69
     <!-- 底部 -->
119
     <seiminFooterBtn :btns="btns"></seiminFooterBtn>
70
     <seiminFooterBtn :btns="btns"></seiminFooterBtn>
120
     <seiminModel ref="seiminModel"></seiminModel>
71
     <seiminModel ref="seiminModel"></seiminModel>
72
+    <seiminPicker ref="sPicker" :title="pickerTitle" titleColor="#808080" titleFontSize="28rpx" confirmColor="#333"
73
+      confirmFontSize="38rpx" confirmFontWeight="500" itemFontSize="28rpx" @onClose="closePicker"
74
+      @onConfirm="confirmPicker" :pickerList="deptList">
75
+    </seiminPicker>
121
   </view>
76
   </view>
122
 </template>
77
 </template>
123
 
78
 
124
 <script>
79
 <script>
125
-import { mapState } from "vuex";
126
-import {
127
-  reqBuildTrip,
128
-  reqRecentRemarks,
129
-  reqBuildOrder,
130
-} from "../../request/api.js";
131
-import { SOURCEID } from "../../utils/enum.sourceid.js";
132
-export default {
133
-  data() {
134
-    return {
135
-      // 工单备注是否获取焦点
136
-      remarksFocus: true,
137
-      // 工单备注
138
-      workOrderRemark: "",
139
-      // 获取到的数据集合对象(历史输入除外)
140
-      dataObj: {},
141
-      // 历史输入
142
-      historyCustomRemarks: [],
143
-      //底部按钮
144
-      btns: [
145
-        {
146
-          name: "回到首页",
147
-          type: "default",
148
-          click: () => {
149
-            uni.navigateTo({
150
-              url: "/pages/index/index",
151
-            });
80
+  import {
81
+    mapState,
82
+    mapMutations
83
+  } from "vuex";
84
+  import {
85
+    reqBuildTrip,
86
+    reqRecentRemarks,
87
+    reqBuildOrder,
88
+  } from "../../request/api.js";
89
+  import {
90
+    SOURCEID
91
+  } from "../../utils/enum.sourceid.js";
92
+  export default {
93
+    data() {
94
+      return {
95
+        // 传递过来的参数
96
+        queryParams: {},
97
+        // 选择的起点科室
98
+        startDept: {},
99
+        // 选择的终点科室
100
+        endDept: {},
101
+        // 固定科室范围的科室列表
102
+        deptList: [],
103
+        //选择起点科室(start)或终点科室(end)
104
+        selectdDeptType: '',
105
+        //选择院区picker的title
106
+        pickerTitle: '',
107
+        // 工单备注是否获取焦点
108
+        remarksFocus: true,
109
+        // 工单备注
110
+        workOrderRemark: "",
111
+        // 获取到的数据集合对象(历史输入除外)
112
+        dataObj: {},
113
+        // 历史输入
114
+        historyCustomRemarks: [],
115
+        //底部按钮
116
+        btns: [{
117
+            name: "回到首页",
118
+            type: "default",
119
+            click: () => {
120
+              uni.navigateTo({
121
+                url: "/pages/index/index",
122
+              });
123
+            },
152
           },
124
           },
153
-        },
154
-        {
155
-          name: "确认",
156
-          type: "primary",
157
-          click: () => {
158
-            this.submitData();
125
+          {
126
+            name: "确认",
127
+            type: "primary",
128
+            click: () => {
129
+              this.submitData();
130
+            },
159
           },
131
           },
160
-        },
161
-      ],
162
-    };
163
-  },
164
-  computed: {
165
-    ...mapState([
166
-      "qucikCreateOrderType",
167
-      "qucikCreateOrderTypeId",
168
-      "deptDisplay",
169
-    ]),
170
-  },
171
-  methods: {
172
-    // 添加备注
173
-    addRemarks(customRemark) {
174
-      this.remarksFocus = false;
175
-      this.$nextTick(() => {
176
-        this.remarksFocus = true;
177
-      });
178
-      this.workOrderRemark += customRemark;
179
-    },
180
-    //获取所有数据
181
-    getData(qucikCreateOrderType, qucikCreateOrderTypeId) {
182
-      uni.showLoading({
183
-        title: "加载中",
184
-      });
185
-      let postData1 = {};
186
-      let postData2 = {
187
-        taskTypeId: qucikCreateOrderTypeId,
188
-        deptId: this.loginInfo.user.dept.id,
132
+        ],
189
       };
133
       };
190
-      if (qucikCreateOrderType === "specimen") {
191
-        //标本快捷建单
192
-        postData1 = {
134
+    },
135
+    computed: {
136
+      ...mapState('user', ['loginInfo']),
137
+      ...mapState([
138
+        "qucikCreateOrderType",
139
+        "qucikCreateOrderTypeId",
140
+        "deptDisplay",
141
+        'searchDeptParams',
142
+        'searchDeptResultList'
143
+      ]),
144
+    },
145
+    methods: {
146
+      ...mapMutations(['changeSearchDeptParams', 'changeSearchDeptResultList']),
147
+      // 添加备注
148
+      addRemarks(customRemark) {
149
+        this.remarksFocus = false;
150
+        this.$nextTick(() => {
151
+          this.remarksFocus = true;
152
+        });
153
+        this.workOrderRemark += customRemark;
154
+      },
155
+      //获取所有数据
156
+      getData(qucikCreateOrderType, qucikCreateOrderTypeId) {
157
+        uni.showLoading({
158
+          title: "加载中",
159
+        });
160
+        let postData1 = {};
161
+        let postData2 = {
193
           taskTypeId: qucikCreateOrderTypeId,
162
           taskTypeId: qucikCreateOrderTypeId,
194
           deptId: this.loginInfo.user.dept.id,
163
           deptId: this.loginInfo.user.dept.id,
195
         };
164
         };
196
-      } else if (qucikCreateOrderType === "other") {
197
-        //其他临床服务快捷建单
198
-        postData1 = {
199
-          taskTypeId: qucikCreateOrderTypeId,
200
-        };
201
-      }
202
-      Promise.all([reqBuildTrip(postData1), reqRecentRemarks(postData2)]).then(
203
-        (values) => {
204
-          uni.hideLoading();
205
-          this.getBuildTrip(values[0]);
206
-          this.getRecentRemarks(values[1]);
165
+        if (qucikCreateOrderType === "specimen") {
166
+          //标本快捷建单
167
+          postData1 = {
168
+            taskTypeId: qucikCreateOrderTypeId,
169
+            deptId: this.loginInfo.user.dept.id,
170
+          };
171
+        } else if (qucikCreateOrderType === "other") {
172
+          //其他临床服务快捷建单
173
+          postData1 = {
174
+            taskTypeId: qucikCreateOrderTypeId,
175
+          };
207
         }
176
         }
208
-      );
209
-    },
210
-    // 获取数据(除历史输入)
211
-    getBuildTrip(res) {
212
-      if (
213
-        res.status == 200 ||
214
-        res.status == 100012 ||
215
-        res.status == 100013 ||
216
-        res.status == 100014 ||
217
-        res.status == 100015
218
-      ) {
219
-        // 处理返回的数据
220
-        if (res.customRemarks) {
221
-          res.customRemarks = res.customRemarks.split("$");
222
-        } else {
223
-          res.customRemarks = [];
177
+        Promise.all([reqBuildTrip(postData1), reqRecentRemarks(postData2)]).then(
178
+          (values) => {
179
+            uni.hideLoading();
180
+            this.getBuildTrip(values[0]);
181
+            this.getRecentRemarks(values[1]);
182
+          }
183
+        );
184
+      },
185
+      // 获取数据(除历史输入)
186
+      getBuildTrip(res) {
187
+        if (
188
+          res.status == 200 ||
189
+          res.status == 100012 ||
190
+          res.status == 100013 ||
191
+          res.status == 100014 ||
192
+          res.status == 100015
193
+        ) {
194
+          // 处理返回的数据
195
+          if (res.customRemarks) {
196
+            res.customRemarks = res.customRemarks.split("$");
197
+          } else {
198
+            res.customRemarks = [];
199
+          }
200
+          // 处理msg
201
+          if (res.msg.includes("<b>")) {
202
+            res.msg = res.msg.replace(/<b>/g, '<text class="green">');
203
+            res.msg = res.msg.replace(/<\/b>/g, "</text>");
204
+          }
205
+          if (res.start || res.end) {
206
+            //其他服务建单
207
+            if (
208
+              res.start.start.departmentStrategy == 201 ||
209
+              res.start.start.departmentStrategy == 203) {
210
+              this.startDept = res.start.start.list[0];
211
+            }
212
+            if (
213
+              res.end.end.departmentStrategy == 201 ||
214
+              res.end.end.departmentStrategy == 203) {
215
+              this.endDept = res.end.end.list[0];
216
+            }
217
+
218
+            if (
219
+              res.start.start.departmentStrategy == 204 ||
220
+              res.start.start.departmentStrategy == 205 ||
221
+              res.end.end.departmentStrategy == 204 ||
222
+              res.end.end.departmentStrategy == 205
223
+            ) {
224
+              if (this.queryParams.isShow) {
225
+                this.startDept = this.searchDeptResultList.start || {};
226
+                this.endDept = this.searchDeptResultList.end || {};
227
+              } else {
228
+                this.changeSearchDeptResultList({});
229
+              }
230
+            }
231
+          }
232
+          this.dataObj = res;
224
         }
233
         }
225
-        // 处理msg
226
-        if (res.msg.includes("<b>")) {
227
-          res.msg = res.msg.replace(/<b>/g, '<text class="green">');
228
-          res.msg = res.msg.replace(/<\/b>/g, "</text>");
234
+      },
235
+      // 获取历史输入
236
+      getRecentRemarks(res) {
237
+        if (res.state == 200) {
238
+          this.historyCustomRemarks = res.data || [];
229
         }
239
         }
230
-        this.dataObj = res;
231
-      }
232
-    },
233
-    // 获取历史输入
234
-    getRecentRemarks(res) {
235
-      if (res.state == 200) {
236
-        this.historyCustomRemarks = res.data || [];
237
-      }
238
-    },
239
-    // 提交数据,建单
240
-    submitData() {
241
-      let postData = {};
242
-      uni.showLoading({
243
-        title: "加载中",
244
-        mask: true,
245
-      });
246
-      if (this.qucikCreateOrderType === "specimen") {
247
-        //标本建单
248
-        postData = {
249
-          urgent: 0,
250
-          workOrder: {
251
-            sourceId: SOURCEID["护士端"],
252
-            workOrderRemark: this.workOrderRemark,
253
-            taskType: {
254
-              id: this.qucikCreateOrderTypeId,
255
-            },
256
-            createDept: this.loginInfo.user.dept.id,
257
-            startDept: {
258
-              id: this.loginInfo.user.dept.id,
240
+      },
241
+      // 提交数据,建单
242
+      submitData() {
243
+        let postData = {};
244
+        uni.showLoading({
245
+          title: "加载中",
246
+          mask: true,
247
+        });
248
+        if (this.qucikCreateOrderType === "specimen") {
249
+          //标本建单
250
+          postData = {
251
+            urgent: 0,
252
+            workOrder: {
253
+              sourceId: SOURCEID["护士端"],
254
+              workOrderRemark: this.workOrderRemark,
255
+              taskType: {
256
+                id: this.qucikCreateOrderTypeId,
257
+              },
258
+              createDept: this.loginInfo.user.dept.id,
259
+              startDept: {
260
+                id: this.loginInfo.user.dept.id,
261
+              },
259
             },
262
             },
260
-          },
261
-        };
262
-      } else if (this.qucikCreateOrderType === "other") {
263
-        let startDept = {}; //起点科室
264
-        let endDepts = []; //终点科室
265
-        // 其他服务建单
266
-        // 起点科室---- start
267
-        if (this.dataObj.start.start.departmentStrategy == 201) {
268
-          startDept = {
269
-            id: this.dataObj.start.start.list[0].id,
270
           };
263
           };
271
-        }
272
-        // 起点科室---- end
273
-        // 终点科室---- start
274
-        if (this.dataObj.start.start.departmentStrategy == 201) {
275
-          endDepts = [
276
-            {
277
-              id: this.dataObj.end.end.list[0].id,
264
+        } else if (this.qucikCreateOrderType === "other") {
265
+          // 其他服务建单
266
+          let startDept = {
267
+            id: this.startDept.id,
268
+          };; //起点科室
269
+          let endDepts = [{
270
+            id: this.endDept.id,
271
+          }]; //终点科室
272
+          // 验证起点科室和终点科室必填
273
+          if (!startDept.id) {
274
+            this.$refs.seiminModel.showChangeDept({
275
+              skin: "toast",
276
+              icon: "error",
277
+              content: "请选择起点科室",
278
+            });
279
+            uni.hideLoading();
280
+            return;
281
+          }
282
+          if (!endDepts[0].id) {
283
+            this.$refs.seiminModel.showChangeDept({
284
+              skin: "toast",
285
+              icon: "error",
286
+              content: "请选择终点科室",
287
+            });
288
+            uni.hideLoading();
289
+            return;
290
+          }
291
+          //请求参数
292
+          postData = {
293
+            workOrder: {
294
+              sourceId: SOURCEID["护士端"],
295
+              workOrderRemark: this.workOrderRemark,
296
+              taskType: {
297
+                id: this.qucikCreateOrderTypeId,
298
+              },
299
+              createDept: this.loginInfo.user.dept.id,
300
+              startDept,
301
+              endDepts,
278
             },
302
             },
279
-          ];
303
+          };
280
         }
304
         }
281
-        // 终点科室---- end
282
-        //请求参数
283
-        postData = {
284
-          workOrder: {
285
-            sourceId: SOURCEID["护士端"],
286
-            workOrderRemark: this.workOrderRemark,
287
-            taskType: {
288
-              id: this.qucikCreateOrderTypeId,
289
-            },
290
-            createDept: this.loginInfo.user.dept.id,
291
-            startDept,
292
-            endDepts,
293
-          },
294
-        };
295
-      }
296
 
305
 
297
-      reqBuildOrder(postData).then((res) => {
298
-        uni.hideLoading();
299
-        if (res.status == 200) {
300
-          this.$refs.seiminModel.showChangeDept({
301
-            skin: "toast",
302
-            content: "创建成功",
303
-            btns: [
304
-              {
306
+        reqBuildOrder(postData).then((res) => {
307
+          uni.hideLoading();
308
+          if (res.status == 200) {
309
+            this.$refs.seiminModel.showChangeDept({
310
+              skin: "toast",
311
+              content: "创建成功",
312
+              btns: [{
305
                 name: "知道了",
313
                 name: "知道了",
306
                 textColor: "#49B856",
314
                 textColor: "#49B856",
307
                 flex: 1,
315
                 flex: 1,
@@ -310,109 +318,166 @@ export default {
310
                     url: "/pages/index/index",
318
                     url: "/pages/index/index",
311
                   });
319
                   });
312
                 },
320
                 },
313
-              },
314
-            ],
315
-          });
316
-        } else {
317
-          this.$refs.seiminModel.showChangeDept({
318
-            skin: "toast",
319
-            icon: "error",
320
-            content: res.msg || "操作失败",
321
+              }, ],
322
+            });
323
+          } else {
324
+            this.$refs.seiminModel.showChangeDept({
325
+              skin: "toast",
326
+              icon: "error",
327
+              content: res.msg || "操作失败",
328
+            });
329
+          }
330
+        });
331
+      },
332
+      //关闭
333
+      closePicker() {
334
+        this.$refs.sPicker._close();
335
+      },
336
+      //打开
337
+      openPicker() {
338
+        this.$refs.sPicker._open();
339
+      },
340
+      //确定:接收子组件传来的参数
341
+      confirmPicker(checkedObj) {
342
+        this[this.selectdDeptType + 'Dept'] = {
343
+          id: checkedObj.value,
344
+          dept: checkedObj.label,
345
+          deptalias: checkedObj.labelAlias
346
+        };
347
+      },
348
+      // 选择起点科室
349
+      selectDept(type) {
350
+        this.selectdDeptType = type; //存储类型
351
+        if (
352
+          this.dataObj.start.start.departmentStrategy == 201 ||
353
+          this.dataObj.start.start.departmentStrategy == 203 ||
354
+          this.dataObj.end.end.departmentStrategy == 201 ||
355
+          this.dataObj.end.end.departmentStrategy == 203) {
356
+          //默认科室和固定科室不能选科室
357
+          return;
358
+        }
359
+        if (this.dataObj[type][type].departmentStrategy == 202) {
360
+          // 固定科室范围
361
+          this.pickerTitle = type === 'start' ? '请选择起点科室' : '请选择终点科室';
362
+          this.deptList = this.dataObj[type][type].list.map(v => ({
363
+            value: v.id,
364
+            label: v.dept,
365
+            labelAlias: v.deptalias
366
+          }))
367
+          console.log(this.deptList, this.pickerTitle)
368
+          this.openPicker();
369
+        } else if (this.dataObj[type][type].departmentStrategy == 204 || this.dataObj[type][type].departmentStrategy ==
370
+          205) {
371
+          // 固定科室类型,自主选择
372
+          let params = {
373
+            backUrl: "/pages/quickCreateOrder/quickCreateOrder?isShow=true", //返回的url
374
+            type: `selectDept_${type}_qucikCreateOrder`, //快捷建单选择起点科室
375
+            ids: this.dataObj[type].deptIds || '',
376
+            departmentStrategy: this.dataObj[type][type].departmentStrategy, //固定科室类型,自主选择
377
+          };
378
+          if (this.dataObj[type][type].departmentStrategy == 205) {
379
+            //固定科室类型
380
+            params.deptType = this.dataObj[type][type][type + 'TypeId']; //科室类型
381
+          }
382
+          this.changeSearchDeptParams(params);
383
+          uni.navigateTo({
384
+            url: "/pages/searchDept/searchDept",
321
           });
385
           });
322
         }
386
         }
323
-      });
387
+      }
324
     },
388
     },
325
-  },
326
-  onLoad() {
327
-    console.log(this.qucikCreateOrderType, this.qucikCreateOrderTypeId);
328
-    this.getData(this.qucikCreateOrderType, this.qucikCreateOrderTypeId);
329
-  },
330
-};
389
+    onLoad(queryParams) {
390
+      this.queryParams = queryParams;
391
+      console.log(queryParams);
392
+      console.log(this.qucikCreateOrderType, this.qucikCreateOrderTypeId);
393
+      this.getData(this.qucikCreateOrderType, this.qucikCreateOrderTypeId);
394
+    },
395
+  };
331
 </script>
396
 </script>
332
 
397
 
333
 <style lang="scss" scoped>
398
 <style lang="scss" scoped>
334
-.quickCreateOrder {
335
-  margin-bottom: 100rpx;
399
+  .quickCreateOrder {
400
+    margin-bottom: 100rpx;
336
 
401
 
337
-  .qco_msg {
338
-    min-height: 144rpx;
339
-    padding: 32rpx 160rpx;
340
-    color: #999;
341
-    line-height: 40rpx;
342
-    font-size: 28rpx;
343
-    text-align: center;
344
-  }
402
+    .qco_msg {
403
+      min-height: 144rpx;
404
+      padding: 32rpx 160rpx;
405
+      color: #999;
406
+      line-height: 40rpx;
407
+      font-size: 28rpx;
408
+      text-align: center;
409
+    }
345
 
410
 
346
-  // 起点科室,终点科室
347
-  .select_block {
348
-    padding: 0 30rpx;
349
-    height: 88rpx;
350
-    font-size: 34rpx;
351
-    border-top: 1px solid #e5e5e5;
352
-    background-color: #fff;
353
-    @include flex(space-between, center);
411
+    // 起点科室,终点科室
412
+    .select_block {
413
+      padding: 0 30rpx;
414
+      height: 88rpx;
415
+      font-size: 34rpx;
416
+      border-top: 1px solid #e5e5e5;
417
+      background-color: #fff;
418
+      @include flex(space-between, center);
354
 
419
 
355
-    .select_label {
356
-      color: #000;
420
+      .select_label {
421
+        color: #000;
357
 
422
 
358
-      &.disableColor {
359
-        color: #999;
423
+        &.disableColor {
424
+          color: #999;
425
+        }
360
       }
426
       }
361
-    }
362
 
427
 
363
-    .select_placeholder {
364
-      color: #888;
365
-      @include flex(flex-start, center);
428
+      .select_placeholder {
429
+        color: #888;
430
+        @include flex(flex-start, center);
366
 
431
 
367
-      .pda-xiangyou {
368
-        font-size: 24rpx;
369
-        margin-left: 30rpx;
432
+        .pda-xiangyou {
433
+          font-size: 24rpx;
434
+          margin-left: 30rpx;
435
+        }
370
       }
436
       }
371
     }
437
     }
372
-  }
373
 
438
 
374
-  // 备注
375
-  .remarks {
376
-    min-height: 150rpx;
377
-    background-color: #fff;
378
-    border-top: 1px solid #e5e5e5;
379
-    border-bottom: 1px solid #e5e5e5;
380
-    padding: 22rpx 25rpx;
439
+    // 备注
440
+    .remarks {
441
+      min-height: 150rpx;
442
+      background-color: #fff;
443
+      border-top: 1px solid #e5e5e5;
444
+      border-bottom: 1px solid #e5e5e5;
445
+      padding: 22rpx 25rpx;
381
 
446
 
382
-    .remarks_textarea {
383
-      width: 100%;
384
-      min-height: 100rpx;
447
+      .remarks_textarea {
448
+        width: 100%;
449
+        min-height: 100rpx;
450
+      }
385
     }
451
     }
386
-  }
387
 
452
 
388
-  // 快捷输入,历史输入
389
-  .quickAndHistory {
390
-    padding: 43rpx 25rpx 0;
453
+    // 快捷输入,历史输入
454
+    .quickAndHistory {
455
+      padding: 43rpx 25rpx 0;
391
 
456
 
392
-    .quickAndHistory_header {
393
-      font-weight: bold;
394
-      font-size: 34rpx;
395
-      padding-bottom: 24rpx;
396
-      color: #333;
397
-    }
457
+      .quickAndHistory_header {
458
+        font-weight: bold;
459
+        font-size: 34rpx;
460
+        padding-bottom: 24rpx;
461
+        color: #333;
462
+      }
398
 
463
 
399
-    .quickAndHistory_container {
400
-      @include flex;
401
-      flex-wrap: wrap;
464
+      .quickAndHistory_container {
465
+        @include flex;
466
+        flex-wrap: wrap;
402
 
467
 
403
-      .quickAndHistory_item {
404
-        height: 66rpx;
405
-        font-size: 28rpx;
406
-        border-radius: 33rpx;
407
-        background-color: #fff;
408
-        line-height: 66rpx;
409
-        padding: 0 24rpx;
410
-        color: #666;
411
-        margin-bottom: 11rpx;
412
-        margin-right: 24rpx;
413
-        @include clamp;
468
+        .quickAndHistory_item {
469
+          height: 66rpx;
470
+          font-size: 28rpx;
471
+          border-radius: 33rpx;
472
+          background-color: #fff;
473
+          line-height: 66rpx;
474
+          padding: 0 24rpx;
475
+          color: #666;
476
+          margin-bottom: 11rpx;
477
+          margin-right: 24rpx;
478
+          @include clamp;
479
+        }
414
       }
480
       }
415
     }
481
     }
416
   }
482
   }
417
-}
418
 </style>
483
 </style>

+ 48 - 12
pages/searchDept/searchDept.vue

@@ -62,7 +62,7 @@
62
     },
62
     },
63
     computed: {
63
     computed: {
64
       ...mapState("user", ["loginInfo"]),
64
       ...mapState("user", ["loginInfo"]),
65
-      ...mapState(["deptDisplay", "searchDeptParams", "searchDeptResult"]),
65
+      ...mapState(["deptDisplay", "searchDeptParams", "searchDeptResult", 'searchDeptResultList']),
66
     },
66
     },
67
     onUnload() {
67
     onUnload() {
68
       if (this.timer) {
68
       if (this.timer) {
@@ -74,7 +74,7 @@
74
       this.init();
74
       this.init();
75
     },
75
     },
76
     methods: {
76
     methods: {
77
-      ...mapMutations(["changeSearchDeptResult", 'changeSeiminModel']),
77
+      ...mapMutations(["changeSearchDeptResult", 'changeSeiminModel', 'changeSearchDeptResultList']),
78
       ...mapMutations("user", ["changeLoginInfo"]),
78
       ...mapMutations("user", ["changeLoginInfo"]),
79
       init() {
79
       init() {
80
         this.loadOldKeyword();
80
         this.loadOldKeyword();
@@ -117,27 +117,45 @@
117
           department: {},
117
           department: {},
118
         };
118
         };
119
         // 院区参数----start
119
         // 院区参数----start
120
-        console.log(this.searchDeptParams);
121
         if (this.searchDeptParams.type === "changeDept_index") {
120
         if (this.searchDeptParams.type === "changeDept_index") {
122
           //首页切换科室
121
           //首页切换科室
123
           postData.department.hospital = {
122
           postData.department.hospital = {
124
             id: this.searchDeptParams.hospital.value,
123
             id: this.searchDeptParams.hospital.value,
125
           };
124
           };
125
+          postData.department.keyWord = keyword;
126
+          postData.department.nurseSign = 1;
127
+        } else if (
128
+          this.searchDeptParams.type === "selectDept_start_qucikCreateOrder" ||
129
+          this.searchDeptParams.type === "selectDept_end_qucikCreateOrder") {
130
+          //快捷建单选择起点科室或选择终点科室
131
+          postData.department.hospital = {
132
+            id: this.loginInfo.user.currentHospital.id,
133
+          };
134
+          postData.department.searchType = 1;
135
+          postData.department.ids = this.searchDeptParams.ids;
136
+          postData.department.keyWord = keyword;
137
+          postData.department.nurseSign = 1;
138
+          if (this.searchDeptParams.departmentStrategy == 205) {
139
+            // 固定科室类型
140
+            postData.department.type = {
141
+              id: this.searchDeptParams.deptType
142
+            };
143
+          }
126
         } else {
144
         } else {
127
           postData.department.hospital = {
145
           postData.department.hospital = {
128
             id: this.loginInfo.user.currentHospital.id,
146
             id: this.loginInfo.user.currentHospital.id,
129
           };
147
           };
148
+          // 科室名称或科室别称开关----start
149
+          if (this.deptDisplay == 1) {
150
+            //科室名称
151
+            postData.department.dept = keyword;
152
+          } else if (this.deptDisplay == 2) {
153
+            //科室别称
154
+            postData.department.deptalias = keyword;
155
+          }
156
+          // 科室名称或科室别称开关----end
130
         }
157
         }
131
         // 院区参数----end
158
         // 院区参数----end
132
-        // 科室名称或科室别称开关----start
133
-        if (this.deptDisplay == 1) {
134
-          //科室名称
135
-          postData.department.dept = keyword;
136
-        } else if (this.deptDisplay == 2) {
137
-          //科室别称
138
-          postData.department.deptalias = keyword;
139
-        }
140
-        // 科室名称或科室别称开关----end
141
         uni.showLoading({
159
         uni.showLoading({
142
           title: "加载中",
160
           title: "加载中",
143
           mask: true,
161
           mask: true,
@@ -225,6 +243,18 @@
225
           if (this.searchDeptParams.type === "changeDept_index") {
243
           if (this.searchDeptParams.type === "changeDept_index") {
226
             //首页切换科室
244
             //首页切换科室
227
             this.changeDept_index_handler();
245
             this.changeDept_index_handler();
246
+          } else if (
247
+            this.searchDeptParams.type === "selectDept_start_qucikCreateOrder") {
248
+            //快捷建单选择起点科室
249
+            this.searchDeptResultList.start = arr[0];
250
+            this.changeSearchDeptResultList(this.searchDeptResultList);
251
+            this.selectDept_startOrEnd_qucikCreateOrder();
252
+          } else if (
253
+            this.searchDeptParams.type === "selectDept_end_qucikCreateOrder") {
254
+            //快捷建单选择终点科室
255
+            this.searchDeptResultList.end = arr[0];
256
+            this.changeSearchDeptResultList(this.searchDeptResultList);
257
+            this.selectDept_startOrEnd_qucikCreateOrder();
228
           }
258
           }
229
         }
259
         }
230
       },
260
       },
@@ -341,6 +371,12 @@
341
           }
371
           }
342
         });
372
         });
343
       },
373
       },
374
+      // 快捷建单选择起点科室或选择终点科室
375
+      selectDept_startOrEnd_qucikCreateOrder() {
376
+        uni.navigateTo({
377
+          url: this.searchDeptParams.backUrl,
378
+        });
379
+      }
344
     },
380
     },
345
   };
381
   };
346
 </script>
382
 </script>

+ 6 - 0
store/index.js

@@ -39,6 +39,8 @@ export default new Vuex.Store({
39
     nurseDeptSwitchTip: 0,
39
     nurseDeptSwitchTip: 0,
40
     // 搜索到的科室-searchDept
40
     // 搜索到的科室-searchDept
41
     searchDeptResult: {},
41
     searchDeptResult: {},
42
+    // 搜索到的科室集合-searchDept-选起点科室并且需要选终点科室
43
+    searchDeptResultList: {},
42
     // 搜索科室需要传递的参数
44
     // 搜索科室需要传递的参数
43
     searchDeptParams: {},
45
     searchDeptParams: {},
44
   },
46
   },
@@ -72,6 +74,10 @@ export default new Vuex.Store({
72
     changeSearchDeptResult(state, args) {
74
     changeSearchDeptResult(state, args) {
73
       state.searchDeptResult = args;
75
       state.searchDeptResult = args;
74
     },
76
     },
77
+    //搜索到的科室集合-searchDept-选起点科室并且需要选终点科室
78
+    changeSearchDeptResultList(state, args) {
79
+      state.searchDeptResultList = args;
80
+    },
75
     //搜索科室需要传递的参数
81
     //搜索科室需要传递的参数
76
     changeSearchDeptParams(state, args) {
82
     changeSearchDeptParams(state, args) {
77
       state.searchDeptParams = args;
83
       state.searchDeptParams = args;