Bläddra i källkod

消毒供应起点科室多动作签到

seimin 1 år sedan
förälder
incheckning
7be8d32230

+ 60 - 15
pages/otherCompleteOrder/otherCompleteOrder.vue

@@ -2,9 +2,11 @@
2 2
   <view class="HomeItem">
3 3
     <view class="goWorkAll">
4 4
       <view class="goWorkSelect combination" v-if="actionConfirmSwitch">
5
-        <view class="goWorkSelect-head">您需要完成以下动作,才可完成工单。如完成请勾选对应项!</view>
5
+        <view class="goWorkSelect-head" v-if="actionConfirmType == 1">您需要完成以下所有动作,才可完成工单。如完成请勾选对应项!</view>
6
+        <view class="goWorkSelect-head" v-if="actionConfirmType == 2">您需要完成以下至少一个动作,才可完成工单。如完成请勾选对应项!</view>
7
+        <view class="goWorkSelect-head" v-if="actionConfirmType == 3">您需要完成以下一个动作,才可完成工单。如完成请勾选对应项!</view>
6 8
         <view class="goWorkSelect-list scroll">
7
-          <checkbox-group @change="checkboxChange">
9
+          <checkbox-group @change="checkboxChange" v-if="actionConfirmType == 1 || actionConfirmType == 2">
8 10
             <label class="goWorkSelect-item relative" v-for="action in actions" :key="action.value">
9 11
               <view>
10 12
                 <checkbox :value="action.value" :checked="action.checked" />
@@ -12,6 +14,14 @@
12 14
               <view>{{action.name}}</view>
13 15
             </label>
14 16
           </checkbox-group>
17
+          <radio-group @change="checkboxChange" v-if="actionConfirmType == 3">
18
+            <label class="goWorkSelect-item relative" v-for="action in actions" :key="action.value">
19
+              <view>
20
+                <radio :value="action.value" :checked="action.checked" />
21
+              </view>
22
+              <view>{{action.name}}</view>
23
+            </label>
24
+          </radio-group>
15 25
         </view>
16 26
       </view>
17 27
       <view class="goWorkSelect history" v-if="actionPhotoSwitch">
@@ -23,7 +33,7 @@
23 33
       </view>
24 34
     </view>
25 35
     <view class="foot_btn_spe">
26
-      <view class="btn1" @click="photographToOther(order, 'end')">完成工单</view>
36
+      <view class="btn1" @click="photographToOther(order)">完成工单</view>
27 37
       <view class="btn3" @click="goBack">返回</view>
28 38
     </view>
29 39
     <!-- 填写交接人账号弹窗 -->
@@ -50,6 +60,7 @@
50 60
     },
51 61
     data() {
52 62
       return {
63
+        currentIndex: undefined,
53 64
         // 填写交接人账号弹窗model
54 65
         hosModels: {
55 66
           disjunctor: false,
@@ -62,6 +73,8 @@
62 73
         actionPhotoSwitch: false,
63 74
         // 确认动作开关
64 75
         actionConfirmSwitch: false,
76
+        // 确认动作模式开关
77
+        actionConfirmType: false,
65 78
         // 参数
66 79
         options: {},
67 80
         //动作列表
@@ -75,7 +88,7 @@
75 88
       isOpenTransportationProcessRemarks(data, accountObj, funName){
76 89
         const tasktype = data.taskType;
77 90
         console.log(tasktype, data);
78
-        if(tasktype.associationType.value === 'other' && tasktype.carryingCourses[1].logSwitch && data.gdState.value == 5){
91
+        if(tasktype.associationType.value === 'other' && tasktype.carryingCourses[this.currentIndex].logSwitch && data.gdState.value == 5){
79 92
           uni.navigateTo({
80 93
             url: `../../pages/transportationProcessRemarks/transportationProcessRemarks?data=${data ? encodeURIComponent(JSON.stringify(data)) : ''}&accountObj=${accountObj ? encodeURIComponent(JSON.stringify(accountObj)) : ''}&currentCode=${this.currentCode}&funName=${funName}&actions=${this.actions ? encodeURIComponent(JSON.stringify(this.actions)) : ''}&imageValue=${this.imageValue ? encodeURIComponent(JSON.stringify(this.imageValue)) : ''}`
81 94
           })
@@ -147,16 +160,31 @@
147 160
         }
148 161
       },
149 162
       // 拍照-其他
150
-      photographToOther(data, type) {
163
+      photographToOther(data) {
151 164
         this.currentData = data;
152 165
         let actions = this.actions.filter(v => v.checked);
153 166
         let imageValue = this.imageValue;
154 167
         console.log(actions);
155 168
         console.log(imageValue);
156
-        if(this.actionConfirmSwitch && this.actions.length !== actions.length){
169
+        if(
170
+        this.actionConfirmSwitch && 
171
+        (
172
+        (this.actionConfirmType == 1 && this.actions.length !== actions.length) || 
173
+        (this.actionConfirmType == 2 && !actions.length) || 
174
+        (this.actionConfirmType == 3 && !actions.length)
175
+        )
176
+        ){
177
+          let title = '';
178
+          if(this.actionConfirmType == 1){
179
+            title = '您需要完成以下所有动作,才可完成工单!';
180
+          }else if(this.actionConfirmType == 2){
181
+            title = '您需要完成以下至少一个动作,才可完成工单!';
182
+          }else if(this.actionConfirmType == 3){
183
+            title = '您需要完成以下一个动作,才可完成工单!';
184
+          }
157 185
           uni.showToast({
158 186
             icon: "none",
159
-          	title: '您需要完成以下动作,才可完成功工单!',
187
+          	title,
160 188
           	duration: 2000
161 189
           });
162 190
           return;
@@ -164,7 +192,7 @@
164 192
         if(this.actionPhotoSwitch && !imageValue.length){
165 193
           uni.showToast({
166 194
             icon: "none",
167
-          	title: '您需要完成拍照,才可完成工单!',
195
+          	title: '您需要完成拍照,才可完成工单!',
168 196
           	duration: 2000
169 197
           });
170 198
           return;
@@ -174,9 +202,15 @@
174 202
           mask: true,
175 203
         });
176 204
         // 其他临床服务
205
+        let content;
206
+        if(this.currentIndex == 0){
207
+          content = data.startDept.qrcode;
208
+        }else if(this.currentIndex == 1){
209
+          content = data.endDepts[0].qrcode;
210
+        }
177 211
         //检验二维码的有效性
178 212
         post("/dept/scanning", {
179
-          content: type === 'start' ? data.startDept.qrcode : data.endDepts[0].qrcode,
213
+          content,
180 214
           taskTypeId: data.taskType.id,
181 215
           gdState: data.gdState.id,
182 216
         }).then((result) => {
@@ -220,9 +254,14 @@
220 254
       },
221 255
       // 选择动作
222 256
       checkboxChange: function (e) {
223
-        var items = this.actions,
224
-          values = e.detail.value;
225
-        for (var i = 0, lenI = items.length; i < lenI; ++i) {
257
+        let items = this.actions;
258
+        let values = [];
259
+        if(this.actionConfirmType == 1 || this.actionConfirmType == 2){
260
+          values = e.detail.value || [];
261
+        }else if(this.actionConfirmType == 3){
262
+          values = [e.detail.value];
263
+        }
264
+        for (let i = 0, lenI = items.length; i < lenI; ++i) {
226 265
           const item = items[i]
227 266
           if(values.includes(item.value)){
228 267
             this.$set(item,'checked',true)
@@ -248,20 +287,26 @@
248 287
       if(options.order){
249 288
         options.order = JSON.parse(options.order);
250 289
         this.order = options.order;
290
+        if(this.order.gdState.value == 4){
291
+          this.currentIndex = 0;
292
+        }else if(this.order.gdState.value == 5){
293
+          this.currentIndex = 1;
294
+        }
251 295
       }
252 296
       if(options.orderId){
253 297
         this.orderId = options.orderId;
254 298
       }
255 299
       if(options.taskType){
256 300
         options.taskType = JSON.parse(options.taskType);
257
-        this.actionConfirmSwitch = options.taskType.carryingCourses[1].actionConfirmSwitch;
258
-        let actions = options.taskType.carryingCourses[1].actionRemarks || "";
301
+        this.actionConfirmSwitch = options.taskType.carryingCourses[this.currentIndex].actionConfirmSwitch;
302
+        let actions = options.taskType.carryingCourses[this.currentIndex].actionRemarks || "";
259 303
         this.actions = actions.split('$').map((v, i) => ({
260 304
           value: i,
261 305
           name: v,
262 306
         }));
263 307
         
264
-        this.actionPhotoSwitch = options.taskType.carryingCourses[1].actionPhotoSwitch;
308
+        this.actionPhotoSwitch = options.taskType.carryingCourses[this.currentIndex].actionPhotoSwitch;
309
+        this.actionConfirmType = options.taskType.carryingCourses[this.currentIndex].actionConfirmType;
265 310
       }
266 311
     },
267 312
   };

+ 3 - 1
pages/receipt_infopage/receipt_infopage.vue

@@ -350,10 +350,12 @@
350 350
           infoDATA.taskType.associationType.value != 'specimen' &&
351 351
           infoDATA.taskType.associationType.value != 'specimenPlan' &&
352 352
           infoDATA.taskType.associationType.value != 'ordinary' &&
353
-          !(infoDATA.taskType.associationType.value == 'other' && infoDATA.gdState.value == 5 && infoDATA.taskType.carryingCourses[1].actionsSwitch)
353
+          !(infoDATA.taskType.associationType.value == 'other' && (infoDATA.gdState.value == 4 && infoDATA.taskType.carryingCourses[0].actionsSwitch || infoDATA.gdState.value == 5 && infoDATA.taskType.carryingCourses[1].actionsSwitch))
354 354
         " hover-class="seimin-btn-hover">
355 355
           <smallScreen :sData="infoDATA" :sType="1">扫码</smallScreen>
356 356
         </view>
357
+        <!-- 其他临床服务-完成工单-待到达 -->
358
+        <view v-if="infoDATA.taskType.associationType.value == 'other' && infoDATA.gdState.value == 4 && infoDATA.taskType.carryingCourses[0].actionsSwitch" class="btn2 page_item_btn" @click="otherCompleteOrder(infoDATA)" hover-class="seimin-btn-hover">完成工单</view>
357 359
         <!-- 其他临床服务-完成工单-待送达 -->
358 360
         <view v-if="infoDATA.taskType.associationType.value == 'other' && infoDATA.gdState.value == 5 && infoDATA.taskType.carryingCourses[1].actionsSwitch" class="btn2 page_item_btn" @click="otherCompleteOrder(infoDATA)" hover-class="seimin-btn-hover">完成工单</view>
359 361
         <!-- 其他临床服务-拍照 -->

+ 3 - 1
pages/receiptpage/receiptpage.vue

@@ -264,9 +264,11 @@
264 264
                 item.taskType.associationType.value != 'specimenPlan' &&
265 265
                 item.taskType.associationType.value != 'ordinary'
266 266
               ">
267
-              <view v-if="!(item.taskType.associationType.value == 'other' && item.gdState.value == 5 && item.taskType.carryingCourses[1].actionsSwitch)" class="page_item_btn" hover-class="seimin-btn-hover">
267
+              <view v-if="!(item.taskType.associationType.value == 'other' && (item.gdState.value == 4 && item.taskType.carryingCourses[0].actionsSwitch || item.gdState.value == 5 && item.taskType.carryingCourses[1].actionsSwitch))" class="page_item_btn" hover-class="seimin-btn-hover">
268 268
                 <smallScreen :sData="item" :sType="1">扫码</smallScreen>
269 269
               </view>
270
+              <!-- 其他临床服务-完成工单-待到达 -->
271
+              <view v-if="item.taskType.associationType.value == 'other' && item.gdState.value == 4 && item.taskType.carryingCourses[0].actionsSwitch" class="page_item_btn" @click="otherCompleteOrder(item)" hover-class="seimin-btn-hover">完成工单</view>
270 272
               <!-- 其他临床服务-完成工单-待送达 -->
271 273
               <view v-if="item.taskType.associationType.value == 'other' && item.gdState.value == 5 && item.taskType.carryingCourses[1].actionsSwitch" class="page_item_btn" @click="otherCompleteOrder(item)" hover-class="seimin-btn-hover">完成工单</view>
272 274
               <!-- 其他临床服务-拍照 -->

+ 20 - 6
tools/commonFun.js

@@ -15,10 +15,15 @@ export function nextDeptOrder_ss(_this, data, accountObj) {
15 15
     let actions = _this.actions.filter(v => v.checked);
16 16
     let actionRemarks = actions.map(v => v.name).toString();
17 17
     if(actionRemarks){
18
-      post("/workerOrder/addOtherRemarks", {
18
+      let postData = {
19 19
         orderId: data.id,
20
-        actionRemarks: actionRemarks,
21
-      }).then((result1) => {
20
+      };
21
+      if(data.gdState.value == 4){
22
+        postData.actionStartRemarks = actionRemarks;
23
+      }else if(data.gdState.value == 5){
24
+        postData.actionRemarks = actionRemarks;
25
+      }
26
+      post("/workerOrder/addOtherRemarks", postData).then((result1) => {
22 27
         if(result1.state == 200){
23 28
           postWorkerOrder(_this, data, accountObj);
24 29
         }else{
@@ -45,10 +50,19 @@ export function uploadToOther(_this, data, accountObj){
45 50
   });
46 51
   _this.imageValue = _this.imageValue || [];
47 52
   let imageValue = _this.imageValue;
53
+  let gdOperate;
54
+  let uploadType;
55
+  if(data.gdState.value == 4){
56
+    gdOperate = 27;
57
+    uploadType = 'orderStartPhoto';
58
+  }else if(data.gdState.value == 5){
59
+    gdOperate = 22;
60
+    uploadType = 'orderEndPhoto';
61
+  }
48 62
   // 完成工单
49 63
   post('/workerOrder/findRecordInfoByOrderId', {
50 64
     orderId: data.id,
51
-    gdOperate: 22,
65
+    gdOperate,
52 66
   }).then(result => {
53 67
     if (result.state == 200) {
54 68
       let n = 0;
@@ -72,7 +86,7 @@ export function uploadToOther(_this, data, accountObj){
72 86
             n++;
73 87
             uni.uploadFile({
74 88
               url: pathUrl +
75
-                "/common/common/uploadAttachment/orderEndPhoto/" +
89
+                "/common/common/uploadAttachment/"+ uploadType +"/" +
76 90
                 data.id +
77 91
                 "/" + result.recordId,
78 92
               filePath: tp,
@@ -116,7 +130,7 @@ export function uploadToOther(_this, data, accountObj){
116 130
             n++;
117 131
             uni.uploadFile({
118 132
               url: pathUrl +
119
-                "/common/common/uploadAttachment/orderEndPhoto/" +
133
+                "/common/common/uploadAttachment/"+ uploadType +"/" +
120 134
                 data.id +
121 135
                 "/" + result.recordId,
122 136
               filePath: tp,