Bläddra i källkod

患者送回添加勾选框

maotao 1 månad sedan
förälder
incheckning
9407a380ce

+ 35 - 2
pages/newSendBack/sendBackOrder/sendBackOrder.vue

@@ -6,9 +6,11 @@
6
 
6
 
7
     <view class="Scanning_cont">
7
     <view class="Scanning_cont">
8
       <scroll-view scroll-y class="scrollContent">
8
       <scroll-view scroll-y class="scrollContent">
9
+				<checkbox-group @change="checkboxChange">
9
         <view class="column" v-for="(item, index) in orderList" :key="item.id">
10
         <view class="column" v-for="(item, index) in orderList" :key="item.id">
10
           <view class="top">
11
           <view class="top">
11
             <text class="">
12
             <text class="">
13
+							<checkbox :value="item.id" :checked="item.checked"/>
12
               <text class="orders green">{{index + 1}}</text>
14
               <text class="orders green">{{index + 1}}</text>
13
               <text class="gdcode">{{item.gdcode}}</text>
15
               <text class="gdcode">{{item.gdcode}}</text>
14
             </text>
16
             </text>
@@ -22,6 +24,7 @@
22
             <view class="name">{{item.patient.patientName}}({{item.patient.residenceNo}})</view>
24
             <view class="name">{{item.patient.patientName}}({{item.patient.residenceNo}})</view>
23
           </view>
25
           </view>
24
         </view>
26
         </view>
27
+				</checkbox-group>
25
       </scroll-view>
28
       </scroll-view>
26
     </view>
29
     </view>
27
 
30
 
@@ -49,11 +52,33 @@
49
       };
52
       };
50
     },
53
     },
51
     methods: {
54
     methods: {
55
+			checkboxChange (e) {
56
+				var items = this.orderList,
57
+					values = e.detail.value;
58
+				for (var i = 0, lenI = items.length; i < lenI; ++i) {
59
+					const item = items[i]
60
+					if(values.includes(item.id)){
61
+						this.$set(item,'checked',true)
62
+					}else{
63
+						this.$set(item,'checked',false)
64
+					}
65
+				}
66
+				console.log(8888,this.orderList)
67
+			},
52
       goBack(){
68
       goBack(){
53
         uni.navigateBack();
69
         uni.navigateBack();
54
       },
70
       },
55
       // 一键签到
71
       // 一键签到
56
       orderSignAll(){
72
       orderSignAll(){
73
+				let isList = this.orderList.filter(i=>i.checked)
74
+				if(isList.length==0){
75
+					uni.showToast({
76
+					  icon: 'error',
77
+					  title: '请勾选工单',
78
+					  duration: 2000,
79
+					});
80
+					return
81
+				}
57
         uni.showModal({
82
         uni.showModal({
58
           title: "提示",
83
           title: "提示",
59
           content: "您确定一键签到吗?",
84
           content: "您确定一键签到吗?",
@@ -66,9 +91,9 @@
66
               })
91
               })
67
               let postData = {
92
               let postData = {
68
                 "deptCode": this.queryObj.code,
93
                 "deptCode": this.queryObj.code,
69
-                "ids": this.orderList.map(v => v.id),
94
+                "ids": isList.map(v => v.id),
70
               };
95
               };
71
-              console.log(this.orderList);
96
+              console.log(isList);
72
               post("/workerOrder/handleInsAndTrans", postData).then((res) => {
97
               post("/workerOrder/handleInsAndTrans", postData).then((res) => {
73
                 console.log(res)
98
                 console.log(res)
74
                 uni.hideLoading();
99
                 uni.hideLoading();
@@ -111,6 +136,9 @@
111
           console.log(res)
136
           console.log(res)
112
           uni.hideLoading();
137
           uni.hideLoading();
113
           if (res.status == 200) {
138
           if (res.status == 200) {
139
+						for(let i of res.data){
140
+							i.checked = true
141
+						}
114
             this.orderList = res.data || [];
142
             this.orderList = res.data || [];
115
           } else {
143
           } else {
116
             uni.showToast({
144
             uni.showToast({
@@ -180,6 +208,11 @@
180
           }
208
           }
181
         }
209
         }
182
         .top{
210
         .top{
211
+					/deep/ .uni-checkbox-input.uni-checkbox-input-checked{
212
+						 color: #fff !important;
213
+						 background: #49b856 !important;
214
+						 border-color: #49b856 !important;
215
+					}
183
           .orders{
216
           .orders{
184
             font-size: 28rpx;
217
             font-size: 28rpx;
185
             font-weight: bold;
218
             font-weight: bold;

+ 15 - 43
pages/newSendBack/sendBackPatient/sendBackPatient.vue

@@ -6,10 +6,8 @@
6
 
6
 
7
     <view class="Scanning_cont">
7
     <view class="Scanning_cont">
8
       <scroll-view scroll-y class="scrollContent">
8
       <scroll-view scroll-y class="scrollContent">
9
-				<checkbox-group @change="checkboxChange">
10
         <view class="column" v-for="(item, index) in patientList" :key="item.id">
9
         <view class="column" v-for="(item, index) in patientList" :key="item.id">
11
 						<view class="top">
10
 						<view class="top">
12
-							<checkbox :value="item.id" :checked="item.checked"/>
13
 							<text class="orders green">{{index + 1}}</text>
11
 							<text class="orders green">{{index + 1}}</text>
14
 						  <view class="name">姓名:</view>
12
 						  <view class="name">姓名:</view>
15
 						  <view class="value">{{item.patientName}}</view>
13
 						  <view class="value">{{item.patientName}}</view>
@@ -19,7 +17,6 @@
19
 						  <view class="value">{{item.residenceNo}}</view>
17
 						  <view class="value">{{item.residenceNo}}</view>
20
 						</view>
18
 						</view>
21
         </view>
19
         </view>
22
-				</checkbox-group>
23
       </scroll-view>
20
       </scroll-view>
24
     </view>
21
     </view>
25
 
22
 
@@ -63,33 +60,11 @@
63
       this.SMFlag = true;
60
       this.SMFlag = true;
64
     },
61
     },
65
     methods: {
62
     methods: {
66
-			checkboxChange (e) {
67
-				var items = this.patientList,
68
-					values = e.detail.value;
69
-				for (var i = 0, lenI = items.length; i < lenI; ++i) {
70
-					const item = items[i]
71
-					if(values.includes(item.id)){
72
-						this.$set(item,'checked',true)
73
-					}else{
74
-						this.$set(item,'checked',false)
75
-					}
76
-				}
77
-				console.log(8888,this.patientList)
78
-			},
79
 			// 送回病房-扫描科室
63
 			// 送回病房-扫描科室
80
 			scanDept() {
64
 			scanDept() {
81
 			  if (!this.SMFlag) {
65
 			  if (!this.SMFlag) {
82
 			    return;
66
 			    return;
83
 			  }
67
 			  }
84
-				let isList = this.patientList.filter(i=>i.checked)
85
-				if(isList.length==0){
86
-					uni.showToast({
87
-					  icon: 'error',
88
-					  title: '请勾选患者',
89
-					  duration: 2000,
90
-					});
91
-					return
92
-				}
93
 			  this.SMFlag = false;
68
 			  this.SMFlag = false;
94
 			  let code = "";
69
 			  let code = "";
95
 			  SM().then((ress1) => {
70
 			  SM().then((ress1) => {
@@ -203,22 +178,20 @@
203
                 "workOrder": [],
178
                 "workOrder": [],
204
               };
179
               };
205
               this.patientList.forEach(v => {
180
               this.patientList.forEach(v => {
206
-								if(v.checked){
181
+								postData.workOrder.push({
207
-									postData.workOrder.push({
182
+									sourceId: 4,
208
-									  sourceId: 4,
183
+									"hosId": this.hosId,
209
-									  "hosId": this.hosId,
184
+									"startDept": {
210
-									  "startDept": {
185
+										"id": this.currentStartDept.id
211
-									    "id": this.currentStartDept.id
186
+									},
212
-									  },
187
+									"createDept": this.currentStartDept.id,
213
-									  "createDept": this.currentStartDept.id,
188
+									"patient": {
214
-									  "patient": {
189
+										"patientCode": v.patientCode
215
-									    "patientCode": v.patientCode
190
+									},
216
-									  },
191
+									"worker": {
217
-									  "worker": {
192
+										"id": userId
218
-									    "id": userId
193
+									},
219
-									  },
194
+								})
220
-									})
221
-								}
222
               })
195
               })
223
               post("/workerOrder/returnSickRoom", postData).then((res) => {
196
               post("/workerOrder/returnSickRoom", postData).then((res) => {
224
                 console.log(res)
197
                 console.log(res)
@@ -298,7 +271,6 @@
298
         post("/patient/patientByCode ", { code: ress1 }).then((ress) => {
271
         post("/patient/patientByCode ", { code: ress1 }).then((ress) => {
299
           uni.hideLoading();
272
           uni.hideLoading();
300
           if (ress.status == 200) {
273
           if (ress.status == 200) {
301
-						ress.data.checked = true
302
             let flag = this.patientList.find(v => v.id == ress.data.id);
274
             let flag = this.patientList.find(v => v.id == ress.data.id);
303
             if(flag){
275
             if(flag){
304
               uni.showToast({
276
               uni.showToast({
@@ -324,7 +296,7 @@
324
     onLoad(options) {
296
     onLoad(options) {
325
       console.log(options, "options");
297
       console.log(options, "options");
326
       this.queryObj = options;
298
       this.queryObj = options;
327
-      this.patientList = [{id: options.patientId, patientName: options.patientName, residenceNo: options.patientResidenceNo, patientCode: options.patientCode, checked:true}]
299
+      this.patientList = [{id: options.patientId, patientName: options.patientName, residenceNo: options.patientResidenceNo, patientCode: options.patientCode}]
328
       // #ifdef APP-PLUS
300
       // #ifdef APP-PLUS
329
       webHandle("no", "app");
301
       webHandle("no", "app");
330
       // #endif
302
       // #endif