|
@@ -1,42 +1,33 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div>
|
|
3
|
+
|
3
|
4
|
<div class="Dialog" v-show="!selecting">
|
4
|
5
|
<div class="DialogTit">
|
5
|
6
|
<span @click="close()" class="iconfont"></span>
|
6
|
7
|
<h1 class="name">透析上机</h1>
|
7
|
|
- <span
|
8
|
|
- class="success"
|
9
|
|
- v-if="
|
10
|
|
- this.record.id == 0 ||
|
11
|
|
- this.$store.getters.user.user.id != this.creator
|
12
|
|
- "
|
13
|
|
- ></span>
|
14
|
|
- <span
|
15
|
|
- class="success"
|
16
|
|
- @click="modify()"
|
17
|
|
- v-if="
|
18
|
|
- isPremission || this.$store.getters.user.user.id == this.creator
|
19
|
|
- "
|
20
|
|
- >修改</span
|
21
|
|
- >
|
|
8
|
+ <span class="success" v-if="this.record.id == 0 || this.$store.getters.user.user.id != this.creator"></span>
|
|
9
|
+ <span class="success" @click="modify()" v-if="isPremission|| this.$store.getters.user.user.id == this.creator">修改</span>
|
22
|
10
|
</div>
|
23
|
11
|
|
24
|
|
- <div class="DialogContent">
|
|
12
|
+ <div class="DialogContent ">
|
|
13
|
+ <div class="item" @click="select_type">
|
|
14
|
+ <h2 class="name">班次</h2>
|
|
15
|
+ <div class="content">
|
|
16
|
+ <span class="text" style="width: 100px">{{getSchedualType(this.schedual_type)}}</span>
|
|
17
|
+ <span class="iconfont"></span>
|
|
18
|
+ </div>
|
|
19
|
+ </div>
|
25
|
20
|
<div class="item" @click="select_bed">
|
26
|
21
|
<h2 class="name">上机床位</h2>
|
27
|
22
|
<div class="content">
|
28
|
|
- <span class="text" style="width: 100px">{{
|
29
|
|
- device_number_map[bed_id].number + "床"
|
30
|
|
- }}</span>
|
|
23
|
+ <span class="text" style="width: 100px">{{ device_number_map[bed_id].number }}</span>
|
31
|
24
|
<span class="iconfont"></span>
|
32
|
25
|
</div>
|
33
|
26
|
</div>
|
34
|
27
|
<div class="item" @click="select_nurse">
|
35
|
28
|
<h2 class="name">上机护士</h2>
|
36
|
29
|
<div class="content">
|
37
|
|
- <span class="text" style="width: 100px">{{
|
38
|
|
- admin_map[nurse_id].name
|
39
|
|
- }}</span>
|
|
30
|
+ <span class="text" style="width: 100px">{{ admin_map[nurse_id].name }}</span>
|
40
|
31
|
<span class="iconfont"></span>
|
41
|
32
|
</div>
|
42
|
33
|
</div>
|
|
@@ -44,12 +35,7 @@
|
44
|
35
|
<div class="item" @click="select_puncture_nurse">
|
45
|
36
|
<h2 class="name">穿刺者</h2>
|
46
|
37
|
<div class="content">
|
47
|
|
- <span
|
48
|
|
- class="text"
|
49
|
|
- style="width: 100px"
|
50
|
|
- v-if="admin_map[puncture_nurse_id]"
|
51
|
|
- >{{ admin_map[puncture_nurse_id].name }}</span
|
52
|
|
- >
|
|
38
|
+ <span class="text" style="width: 100px" v-if="admin_map[puncture_nurse_id]">{{ admin_map[puncture_nurse_id].name}}</span>
|
53
|
39
|
<span class="iconfont"></span>
|
54
|
40
|
</div>
|
55
|
41
|
</div>
|
|
@@ -57,34 +43,24 @@
|
57
|
43
|
<div class="item" v-if="template_id == 6">
|
58
|
44
|
<label class="name" for="xll">引血(ml/min)</label>
|
59
|
45
|
<div class="content">
|
60
|
|
- <input
|
61
|
|
- type="tel"
|
62
|
|
- @focus="inputFocus"
|
63
|
|
- id="xll"
|
64
|
|
- v-model="blood_drawing"
|
65
|
|
- />
|
|
46
|
+ <input type="tel" @focus="inputFocus" id="xll" v-model="blood_drawing"/>
|
66
|
47
|
</div>
|
67
|
48
|
</div>
|
68
|
49
|
|
69
|
50
|
<div class="item">
|
70
|
51
|
<h2 class="name">上机时间</h2>
|
71
|
52
|
<div class="content">
|
72
|
|
- <span
|
73
|
|
- class="text"
|
74
|
|
- style="width: 100px"
|
75
|
|
- @click="selectStartTimeAction"
|
76
|
|
- >{{ start_time_str }}</span
|
77
|
|
- >
|
|
53
|
+ <span class="text" style="width: 100px" @click="selectStartTimeAction">{{ start_time_str }}</span>
|
78
|
54
|
<span class="iconfont"></span>
|
79
|
55
|
</div>
|
80
|
56
|
</div>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
81
|
61
|
<div class="perform">
|
82
|
|
- <button @click="commitInfo" v-if="record == null || record.id == ''">
|
83
|
|
- 执行上机
|
84
|
|
- </button>
|
85
|
|
- <button :disabled="true" style="background-color:lightgray;" v-else>
|
86
|
|
- 已上机
|
87
|
|
- </button>
|
|
62
|
+ <button @click="commitInfo" v-if="(record == null || record.id == '')">执行上机</button>
|
|
63
|
+ <button :disabled="true" style="background-color:lightgray;" v-else>已上机</button>
|
88
|
64
|
</div>
|
89
|
65
|
</div>
|
90
|
66
|
</div>
|
|
@@ -99,390 +75,446 @@
|
99
|
75
|
</div>
|
100
|
76
|
</template>
|
101
|
77
|
|
|
78
|
+
|
102
|
79
|
<script>
|
103
|
|
-import { startDialysis, PostModifyStartDialysis } from "@/api/dialysis";
|
104
|
|
-import { Toast } from "vant";
|
105
|
|
-import { parseTime } from "@/utils";
|
106
|
|
-
|
107
|
|
-import TwoMenu from "./TwoMenu";
|
108
|
|
-
|
109
|
|
-export default {
|
110
|
|
- name: "ComputerDialog",
|
111
|
|
- components: {
|
112
|
|
- TwoMenu
|
113
|
|
- },
|
114
|
|
- data() {
|
115
|
|
- return {
|
116
|
|
- start_time: new Date(),
|
117
|
|
- selecting: false,
|
118
|
|
- start_time_str: "",
|
119
|
|
- bed_id: 0,
|
120
|
|
- nurse_id: 0,
|
121
|
|
- puncture_nurse_id: 0,
|
122
|
|
- isPremission: false,
|
123
|
|
- zone_beds: [], // 该排班的区里的床位
|
124
|
|
- creator: 0,
|
125
|
|
- template_id: 0,
|
126
|
|
- blood_drawing: 100
|
127
|
|
- };
|
128
|
|
- },
|
129
|
|
- props: {
|
130
|
|
- schedule: {
|
131
|
|
- type: Object
|
132
|
|
- },
|
133
|
|
- patient_prop: {
|
134
|
|
- type: Object
|
135
|
|
- },
|
136
|
|
- record: {
|
137
|
|
- type: Object
|
138
|
|
- },
|
139
|
|
- admins: {
|
140
|
|
- type: Array
|
141
|
|
- },
|
142
|
|
- device_numbers: {
|
143
|
|
- type: Array
|
144
|
|
- },
|
145
|
|
- admin_map: {
|
146
|
|
- type: Object
|
|
80
|
+ import {startDialysis,PostModifyStartDialysis,GetSchedualNumber} from '@/api/dialysis'
|
|
81
|
+ import {Toast} from 'vant'
|
|
82
|
+ import {parseTime} from '@/utils'
|
|
83
|
+
|
|
84
|
+ import TwoMenu from './TwoMenu'
|
|
85
|
+
|
|
86
|
+ export default {
|
|
87
|
+ name: 'ComputerDialog',
|
|
88
|
+ components: {
|
|
89
|
+ TwoMenu
|
147
|
90
|
},
|
148
|
|
- device_number_map: {
|
149
|
|
- type: Object
|
|
91
|
+ data () {
|
|
92
|
+ return {
|
|
93
|
+ start_time: new Date(),
|
|
94
|
+ selecting: false,
|
|
95
|
+ start_time_str: '',
|
|
96
|
+ bed_id: 0,
|
|
97
|
+ nurse_id: 0,
|
|
98
|
+ puncture_nurse_id: 0,
|
|
99
|
+ isPremission: false,
|
|
100
|
+ zone_beds: [], // 该排班的区里的床位
|
|
101
|
+ creator: 0,
|
|
102
|
+ template_id: 0,
|
|
103
|
+ blood_drawing:100,
|
|
104
|
+ schedual_type:0,
|
|
105
|
+ schedules_type: [
|
|
106
|
+ {id: 1, name:"上午"},
|
|
107
|
+ {id: 2, name:"下午"},
|
|
108
|
+ {id: 3, name:"晚上"},
|
|
109
|
+ ], // 该排班的区里的床位
|
|
110
|
+ }
|
150
|
111
|
},
|
151
|
|
- special_premission: {
|
152
|
|
- type: Array
|
153
|
|
- }
|
154
|
|
- },
|
155
|
|
- mounted() {
|
156
|
|
- if (this.record.id == 0) {
|
157
|
|
- this.start_time_str =
|
158
|
|
- parseTime(this.start_time, "{y}-{m}-{d} {h}:{i}") + ":00";
|
159
|
|
- } else {
|
160
|
|
- if (this.record.start_time == 0) {
|
161
|
|
- this.start_time_str =
|
162
|
|
- parseTime(this.start_time, "{y}-{m}-{d} {h}:{i}") + ":00";
|
|
112
|
+ props: {
|
|
113
|
+ schedule: {
|
|
114
|
+ type: Object,
|
|
115
|
+ },
|
|
116
|
+ patient_prop: {
|
|
117
|
+ type: Object,
|
|
118
|
+ },
|
|
119
|
+ record: {
|
|
120
|
+ type: Object,
|
|
121
|
+ },
|
|
122
|
+ admins: {
|
|
123
|
+ type: Array,
|
|
124
|
+ },
|
|
125
|
+ device_numbers: {
|
|
126
|
+ type: Array,
|
|
127
|
+ },
|
|
128
|
+ admin_map: {
|
|
129
|
+ type: Object,
|
|
130
|
+ },
|
|
131
|
+ device_number_map: {
|
|
132
|
+ type: Object,
|
|
133
|
+ },
|
|
134
|
+ special_premission: {
|
|
135
|
+ type: Array,
|
|
136
|
+ },
|
|
137
|
+ }, mounted () {
|
|
138
|
+
|
|
139
|
+ if (this.record.id == 0) {
|
|
140
|
+ this.start_time_str = parseTime(this.start_time, '{y}-{m}-{d} {h}:{i}') + ':00'
|
163
|
141
|
} else {
|
164
|
|
- this.start_time_str =
|
165
|
|
- parseTime(this.record.start_time, "{y}-{m}-{d} {h}:{i}") + ":00";
|
166
|
|
- }
|
167
|
|
- }
|
168
|
|
- },
|
169
|
|
- created() {
|
170
|
|
- this.template_id = this.$store.getters.user.template_info.template_id;
|
171
|
|
- var date = this.$route.query && this.$route.query.date;
|
172
|
|
- date *= 1000;
|
173
|
|
- var newDate = new Date(date);
|
174
|
|
- var y = newDate.getFullYear();
|
175
|
|
- var m = newDate.getMonth() + 1;
|
176
|
|
- var d = newDate.getDate();
|
177
|
|
- if (isNaN(y) || isNaN(m) || isNaN(d)) {
|
178
|
|
- newDate = new Date();
|
179
|
|
- y = newDate.getFullYear();
|
180
|
|
- m = newDate.getMonth() + 1;
|
181
|
|
- d = newDate.getDate();
|
182
|
|
- }
|
183
|
|
- this.record_date =
|
184
|
|
- y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
|
185
|
|
-
|
186
|
|
- this.bed_id =
|
187
|
|
- this.record == null || this.record.id == ""
|
188
|
|
- ? this.schedule.bed_id
|
189
|
|
- : this.record.bed_id;
|
190
|
|
- this.nurse_id =
|
191
|
|
- this.record == null || this.record.id == ""
|
192
|
|
- ? this.$store.getters.user.user.id
|
193
|
|
- : this.record.start_nurse;
|
194
|
|
- this.puncture_nurse_id =
|
195
|
|
- this.record == null || this.record.id == ""
|
196
|
|
- ? this.$store.getters.user.user.id
|
197
|
|
- : this.record.puncture_nurse;
|
198
|
|
-
|
199
|
|
- if (this.puncture_nurse_id == 0) {
|
200
|
|
- this.puncture_nurse_id = this.$store.getters.user.user.id;
|
201
|
|
- }
|
|
142
|
+ if (this.record.start_time == 0) {
|
|
143
|
+ this.start_time_str = parseTime(this.start_time, '{y}-{m}-{d} {h}:{i}') + ':00'
|
202
|
144
|
|
203
|
|
- // var beds = []
|
204
|
|
- // for (let index = 0; index < this.device_numbers.length; index++) {
|
205
|
|
- // const device_number = this.device_numbers[index]
|
206
|
|
- // if (device_number.zone_id == this.schedule.partition_id) {
|
207
|
|
- // beds.push(device_number)
|
208
|
|
- // }
|
209
|
|
- // }
|
210
|
|
- // this.zone_beds = beds
|
211
|
|
-
|
212
|
|
- for (let index = 0; index < this.device_numbers.length; index++) {
|
213
|
|
- const device_number = this.device_numbers[index];
|
214
|
|
- this.device_numbers[index]["number"] =
|
215
|
|
- device_number["zone_name"] + "-" + device_number["number"];
|
216
|
|
- }
|
217
|
|
- this.zone_beds = this.device_numbers;
|
218
|
|
-
|
219
|
|
- if (this.record.id > 0) {
|
220
|
|
- for (let i = 0; i < this.special_premission.length; i++) {
|
221
|
|
- if (
|
222
|
|
- this.$store.getters.user.user.id ==
|
223
|
|
- this.special_premission[i].admin_user_id
|
224
|
|
- ) {
|
225
|
|
- this.isPremission = true;
|
|
145
|
+ } else {
|
|
146
|
+ this.start_time_str = parseTime(this.record.start_time, '{y}-{m}-{d} {h}:{i}') + ':00'
|
226
|
147
|
}
|
227
|
148
|
}
|
228
|
|
- }
|
|
149
|
+ },
|
|
150
|
+ created () {
|
|
151
|
+ let now = new Date()
|
|
152
|
+ let hour = now.getHours()
|
229
|
153
|
|
230
|
|
- if (this.record.id > 0) {
|
231
|
|
- if (this.record.creator == 0) {
|
232
|
|
- this.creator = this.record.start_nurse;
|
233
|
|
- } else {
|
234
|
|
- this.creator = this.record.creator;
|
|
154
|
+ if (hour >= 6 && hour < 12){
|
|
155
|
+ this.schedual_type = 1
|
|
156
|
+
|
|
157
|
+ }else if(hour >= 12 && hour < 18){
|
|
158
|
+
|
|
159
|
+ this.schedual_type = 2
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+ }else if(hour >= 18){
|
|
163
|
+ this.schedual_type = 3
|
235
|
164
|
}
|
236
|
|
- }
|
237
|
|
- },
|
238
|
|
- methods: {
|
239
|
|
- inputFocus: function(event) {
|
240
|
|
- var input = event.target;
|
241
|
|
- setTimeout(function() {
|
242
|
|
- input.scrollIntoView();
|
243
|
|
- }, 0);
|
244
|
|
-
|
245
|
|
- if (input.setSelectionRange) {
|
246
|
|
- setTimeout(function() {
|
247
|
|
- input.setSelectionRange(0, input.value.length);
|
248
|
|
- }, 0);
|
249
|
|
- } else if (input.createTextRange) {
|
250
|
|
- var rng = input.createTextRange();
|
251
|
|
- rng.move("character", input.value.length);
|
252
|
|
- rng.select();
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+ this.GetSchedualNumber()
|
|
168
|
+
|
|
169
|
+ this.template_id = this.$store.getters.user.template_info.template_id;
|
|
170
|
+ var date = this.$route.query && this.$route.query.date
|
|
171
|
+ date *= 1000
|
|
172
|
+ var newDate = new Date(date)
|
|
173
|
+ var y = newDate.getFullYear()
|
|
174
|
+ var m = newDate.getMonth() + 1
|
|
175
|
+ var d = newDate.getDate()
|
|
176
|
+ if (isNaN(y) || isNaN(m) || isNaN(d)) {
|
|
177
|
+ newDate = new Date()
|
|
178
|
+ y = newDate.getFullYear()
|
|
179
|
+ m = newDate.getMonth() + 1
|
|
180
|
+ d = newDate.getDate()
|
253
|
181
|
}
|
254
|
|
- },
|
255
|
|
- modify() {
|
256
|
|
- let ParamsQuery = {};
|
257
|
|
- ParamsQuery["id"] = this.record.id;
|
258
|
|
- ParamsQuery["nurse"] = this.nurse_id;
|
259
|
|
- ParamsQuery["bed"] = this.bed_id;
|
260
|
|
- ParamsQuery["start_time"] = this.start_time_str;
|
261
|
|
- ParamsQuery["puncture_nurse"] = this.puncture_nurse_id;
|
262
|
|
- PostModifyStartDialysis(ParamsQuery).then(response => {
|
263
|
|
- if (response.data.state == 0) {
|
264
|
|
- Toast.fail(response.data.msg);
|
265
|
|
- return false;
|
266
|
|
- } else {
|
267
|
|
- Toast.success("修改成功");
|
268
|
|
- this.$emit("did_start", response.data.data.dialysis_order);
|
269
|
|
- var record = this.record;
|
270
|
|
- for (const key in response.data.data.dialysis_order) {
|
271
|
|
- this.$set(record, key, response.data.data.dialysis_order[key]);
|
|
182
|
+ this.record_date = y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d)
|
|
183
|
+
|
|
184
|
+ this.bed_id = (this.record == null || this.record.id == '') ? this.schedule.bed_id : this.record.bed_id
|
|
185
|
+ this.nurse_id = (this.record == null || this.record.id == '') ? this.$store.getters.user.user.id : this.record.start_nurse
|
|
186
|
+ this.puncture_nurse_id = (this.record == null || this.record.id == '') ? this.$store.getters.user.user.id : this.record.puncture_nurse
|
|
187
|
+
|
|
188
|
+ if (this.puncture_nurse_id == 0) {
|
|
189
|
+ this.puncture_nurse_id = this.$store.getters.user.user.id
|
|
190
|
+ }
|
|
191
|
+
|
|
192
|
+ // var beds = []
|
|
193
|
+ // for (let index = 0; index < this.device_numbers.length; index++) {
|
|
194
|
+ // const device_number = this.device_numbers[index]
|
|
195
|
+ // if (device_number.zone_id == this.schedule.partition_id) {
|
|
196
|
+ // beds.push(device_number)
|
|
197
|
+ // }
|
|
198
|
+ // }
|
|
199
|
+ // this.zone_beds = beds
|
|
200
|
+
|
|
201
|
+ for (let index = 0; index < this.device_numbers.length; index++) {
|
|
202
|
+ const device_number = this.device_numbers[index]
|
|
203
|
+ this.device_numbers[index]['number'] = device_number['zone_name']+'-'+device_number['number']
|
|
204
|
+ }
|
|
205
|
+ this.zone_beds = this.device_numbers
|
|
206
|
+
|
|
207
|
+ if (this.record.id > 0) {
|
|
208
|
+ for (let i = 0; i < this.special_premission.length; i++) {
|
|
209
|
+ if (this.$store.getters.user.user.id == this.special_premission[i].admin_user_id) {
|
|
210
|
+ this.isPremission = true
|
272
|
211
|
}
|
273
|
212
|
}
|
274
|
|
- });
|
275
|
|
- },
|
276
|
|
- didSelectStartTime: function(time) {
|
277
|
|
- this.start_time_str = parseTime(time, "{y}-{m}-{d} {h}:{i}") + ":00";
|
278
|
|
- },
|
279
|
|
- selectStartTimeAction: function() {
|
280
|
|
- if (this.record.id != 0) {
|
281
|
|
- var creator = 0;
|
282
|
|
- if (this.record.creator == 0) {
|
283
|
|
- creator = this.record.start_nurse;
|
284
|
|
- } else {
|
285
|
|
- creator = this.record.creator;
|
286
|
|
- }
|
|
213
|
+ }
|
287
|
214
|
|
288
|
|
- if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
289
|
|
- this.$refs.start_time_picker.open();
|
|
215
|
+ if (this.record.id > 0) {
|
|
216
|
+ if (this.record.creator == 0) {
|
|
217
|
+ this.creator = this.record.start_nurse
|
290
|
218
|
} else {
|
291
|
|
- return;
|
|
219
|
+ this.creator = this.record.creator
|
292
|
220
|
}
|
293
|
221
|
}
|
294
|
|
- this.$refs.start_time_picker.open();
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
295
|
225
|
},
|
296
|
|
- commitInfo: function() {
|
297
|
|
- Toast.loading({ forbidClick: true, duration: 0 });
|
298
|
|
- let ParamsQuery = {};
|
299
|
|
- ParamsQuery["patient_id"] = this.patient_prop.id;
|
300
|
|
- ParamsQuery["record_date"] = this.record_date;
|
301
|
|
- ParamsQuery["nurse"] = this.nurse_id;
|
302
|
|
- ParamsQuery["bed"] = this.bed_id;
|
303
|
|
- ParamsQuery["start_time"] = this.start_time_str;
|
304
|
|
- ParamsQuery["puncture_nurse"] = this.puncture_nurse_id;
|
305
|
|
- ParamsQuery["blood_drawing"] = this.blood_drawing;
|
306
|
|
-
|
307
|
|
- startDialysis(ParamsQuery).then(response => {
|
308
|
|
- if (response.data.state == 0) {
|
309
|
|
- Toast.fail(response.data.msg);
|
310
|
|
- return false;
|
311
|
|
- } else {
|
312
|
|
- Toast.success("上机成功");
|
313
|
|
- var monitor = response.data.data.monitor;
|
314
|
|
- this.$emit("did_add_monitor", monitor);
|
315
|
|
- this.$emit("did_start", response.data.data.dialysis_order);
|
316
|
|
- var record = this.record;
|
317
|
|
- for (const key in response.data.data.dialysis_order) {
|
318
|
|
- this.$set(record, key, response.data.data.dialysis_order[key]);
|
319
|
|
- // this.record[key] = response.data.data.dialysis_order[key]
|
|
226
|
+ methods: {
|
|
227
|
+ getSchedualType:function(type){
|
|
228
|
+ for (let i = 0; i < this.schedules_type.length; i++){
|
|
229
|
+ if(this.schedules_type[i].id == type){
|
|
230
|
+ return this.schedules_type[i].name
|
320
|
231
|
}
|
321
|
232
|
}
|
322
|
|
- });
|
323
|
|
- },
|
324
|
|
- close: function() {
|
325
|
|
- this.$emit("close");
|
326
|
|
- },
|
327
|
|
- select_bed: function() {
|
328
|
|
- if (this.record.id != 0) {
|
329
|
|
- var creator = 0;
|
330
|
|
- if (this.record.creator == 0) {
|
331
|
|
- creator = this.record.start_nurse;
|
332
|
|
- } else {
|
333
|
|
- creator = this.record.creator;
|
|
233
|
+ },
|
|
234
|
+ select_type:function(){
|
|
235
|
+ if (this.record.id != 0) {
|
|
236
|
+ var creator = 0
|
|
237
|
+ if (this.record.creator == 0) {
|
|
238
|
+ creator = this.record.start_nurse
|
|
239
|
+ } else {
|
|
240
|
+ creator = this.record.creator
|
|
241
|
+ }
|
|
242
|
+
|
|
243
|
+ if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
|
244
|
+ this.selecting = true
|
|
245
|
+ var t = this
|
|
246
|
+ this.$refs.selector.showSingleSelect(this.schedules_type, this.schedual_type, '选择班次', 'name', 'id', function (select_id) {
|
|
247
|
+ t.schedual_type = select_id
|
|
248
|
+
|
|
249
|
+ let ParamsQuery = {}
|
|
250
|
+ ParamsQuery['schedual_type'] = select_id
|
|
251
|
+ GetSchedualNumber(ParamsQuery).then(response => {
|
|
252
|
+ if (response.data.state == 0) {
|
|
253
|
+ Toast.fail(response.data.msg)
|
|
254
|
+ return false
|
|
255
|
+ } else {
|
|
256
|
+ t.device_numbers = response.data.data.number
|
|
257
|
+ for (let index = 0; index < t.device_numbers.length; index++) {
|
|
258
|
+ const device_number = t.device_numbers[index]
|
|
259
|
+ t.device_numbers[index]['number'] = device_number['zone_name']+'-'+device_number['number']
|
|
260
|
+ }
|
|
261
|
+ t.zone_beds = t.device_numbers
|
|
262
|
+ t.bed_id = t.zone_beds[0].id
|
|
263
|
+ }
|
|
264
|
+ })
|
|
265
|
+ }, function () {
|
|
266
|
+ t.selecting = false
|
|
267
|
+ })
|
|
268
|
+ } else {
|
|
269
|
+ return
|
|
270
|
+ }
|
334
|
271
|
}
|
|
272
|
+ this.selecting = true
|
|
273
|
+ var t = this
|
|
274
|
+ this.$refs.selector.showSingleSelect(this.schedules_type, this.schedual_type, '选择班次', 'name', 'id', function (select_id) {
|
|
275
|
+ t.schedual_type = select_id
|
|
276
|
+ let ParamsQuery = {}
|
|
277
|
+ ParamsQuery['schedual_type'] = select_id
|
|
278
|
+ GetSchedualNumber(ParamsQuery).then(response => {
|
|
279
|
+ if (response.data.state == 0) {
|
|
280
|
+ Toast.fail(response.data.msg)
|
|
281
|
+ return false
|
|
282
|
+ } else {
|
|
283
|
+ t.zone_beds = []
|
|
284
|
+ t.device_numbers = response.data.data.number
|
|
285
|
+ for (let index = 0; index < t.device_numbers.length; index++) {
|
|
286
|
+ const device_number = t.device_numbers[index]
|
|
287
|
+ t.device_numbers[index]['number'] = device_number['zone_name']+'-'+device_number['number']
|
|
288
|
+ }
|
|
289
|
+ t.zone_beds = t.device_numbers
|
|
290
|
+ t.bed_id = t.zone_beds[0].id
|
|
291
|
+
|
335
|
292
|
|
336
|
|
- if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
337
|
|
- this.selecting = true;
|
338
|
|
- var t = this;
|
339
|
|
- this.$refs.selector.showSingleSelect(
|
340
|
|
- this.zone_beds,
|
341
|
|
- this.bed_id,
|
342
|
|
- "选择床位号",
|
343
|
|
- "number",
|
344
|
|
- "id",
|
345
|
|
- function(select_id) {
|
346
|
|
- t.bed_id = select_id;
|
347
|
|
- },
|
348
|
|
- function() {
|
349
|
|
- t.selecting = false;
|
350
|
293
|
}
|
351
|
|
- );
|
352
|
|
- } else {
|
353
|
|
- return;
|
354
|
|
- }
|
355
|
|
- }
|
|
294
|
+ })
|
|
295
|
+ }, function () {
|
|
296
|
+ t.selecting = false
|
|
297
|
+ })
|
356
|
298
|
|
357
|
|
- this.selecting = true;
|
358
|
|
- var t = this;
|
359
|
|
- this.$refs.selector.showSingleSelect(
|
360
|
|
- this.zone_beds,
|
361
|
|
- this.bed_id,
|
362
|
|
- "选择床位号",
|
363
|
|
- "number",
|
364
|
|
- "id",
|
365
|
|
- function(select_id) {
|
366
|
|
- t.bed_id = select_id;
|
367
|
|
- },
|
368
|
|
- function() {
|
369
|
|
- t.selecting = false;
|
370
|
|
- }
|
371
|
|
- );
|
372
|
|
- },
|
373
|
|
- select_nurse: function() {
|
374
|
|
- if (this.record.id != 0) {
|
375
|
|
- var creator = 0;
|
376
|
|
- if (this.record.creator == 0) {
|
377
|
|
- creator = this.record.start_nurse;
|
378
|
|
- } else {
|
379
|
|
- creator = this.record.creator;
|
380
|
|
- }
|
381
|
|
- if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
382
|
|
- this.selecting = true;
|
383
|
|
- var t = this;
|
384
|
|
- this.$refs.selector.showSingleSelect(
|
385
|
|
- this.admins,
|
386
|
|
- this.nurse_id,
|
387
|
|
- "选择上机护士",
|
388
|
|
- "name",
|
389
|
|
- "id",
|
390
|
|
- function(select_id) {
|
391
|
|
- t.nurse_id = select_id;
|
392
|
|
- },
|
393
|
|
- function() {
|
394
|
|
- t.selecting = false;
|
|
299
|
+ },
|
|
300
|
+ GetSchedualNumber:function(){
|
|
301
|
+ let ParamsQuery = {}
|
|
302
|
+ ParamsQuery['schedual_type'] = this.schedual_type
|
|
303
|
+ GetSchedualNumber(ParamsQuery).then(response => {
|
|
304
|
+ if (response.data.state == 0) {
|
|
305
|
+ Toast.fail(response.data.msg)
|
|
306
|
+ return false
|
|
307
|
+ } else {
|
|
308
|
+ this.device_numbers = response.data.data.number
|
|
309
|
+ for (let index = 0; index < this.device_numbers.length; index++) {
|
|
310
|
+ const device_number = this.device_numbers[index]
|
|
311
|
+ this.device_numbers[index]['number'] = device_number['zone_name']+'-'+device_number['number']
|
395
|
312
|
}
|
396
|
|
- );
|
397
|
|
- } else {
|
398
|
|
- return;
|
399
|
|
- }
|
400
|
|
- }
|
401
|
|
- this.selecting = true;
|
402
|
|
- var t = this;
|
403
|
|
- this.$refs.selector.showSingleSelect(
|
404
|
|
- this.admins,
|
405
|
|
- this.nurse_id,
|
406
|
|
- "选择上机护士",
|
407
|
|
- "name",
|
408
|
|
- "id",
|
409
|
|
- function(select_id) {
|
410
|
|
- t.nurse_id = select_id;
|
411
|
|
- },
|
412
|
|
- function() {
|
413
|
|
- t.selecting = false;
|
|
313
|
+ this.zone_beds = this.device_numbers
|
|
314
|
+ }
|
|
315
|
+ })
|
|
316
|
+ },
|
|
317
|
+
|
|
318
|
+ inputFocus: function (event) {
|
|
319
|
+ var input = event.target
|
|
320
|
+ setTimeout(function () {
|
|
321
|
+ input.scrollIntoView()
|
|
322
|
+ }, 0)
|
|
323
|
+
|
|
324
|
+ if (input.setSelectionRange) {
|
|
325
|
+ setTimeout(function () {
|
|
326
|
+ input.setSelectionRange(0, input.value.length)
|
|
327
|
+ }, 0)
|
|
328
|
+ } else if (input.createTextRange) {
|
|
329
|
+ var rng = input.createTextRange()
|
|
330
|
+ rng.move('character', input.value.length)
|
|
331
|
+ rng.select()
|
414
|
332
|
}
|
415
|
|
- );
|
416
|
|
- },
|
417
|
|
- select_puncture_nurse: function() {
|
418
|
|
- if (this.record.id != 0) {
|
419
|
|
- var creator = 0;
|
420
|
|
- if (this.record.creator == 0) {
|
421
|
|
- creator = this.record.start_nurse;
|
422
|
|
- } else {
|
423
|
|
- creator = this.record.creator;
|
|
333
|
+ },
|
|
334
|
+ modify(){
|
|
335
|
+ let ParamsQuery = {}
|
|
336
|
+ ParamsQuery['schedual_type'] = this.schedual_type
|
|
337
|
+ ParamsQuery['id'] = this.record.id
|
|
338
|
+ ParamsQuery['nurse'] = this.nurse_id
|
|
339
|
+ ParamsQuery['bed'] = this.bed_id
|
|
340
|
+ ParamsQuery['start_time'] = this.start_time_str
|
|
341
|
+ ParamsQuery['puncture_nurse'] = this.puncture_nurse_id
|
|
342
|
+ PostModifyStartDialysis(ParamsQuery).then(response => {
|
|
343
|
+ if (response.data.state == 0) {
|
|
344
|
+ Toast.fail(response.data.msg)
|
|
345
|
+ return false
|
|
346
|
+ } else {
|
|
347
|
+ Toast.success('修改成功')
|
|
348
|
+ this.$emit('did_start', response.data.data.dialysis_order)
|
|
349
|
+ var record = this.record
|
|
350
|
+ for (const key in response.data.data.dialysis_order) {
|
|
351
|
+ this.$set(record, key, response.data.data.dialysis_order[key])
|
|
352
|
+ }
|
|
353
|
+ }
|
|
354
|
+ })
|
|
355
|
+ },
|
|
356
|
+ didSelectStartTime: function (time) {
|
|
357
|
+ this.start_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}') + ':00'
|
|
358
|
+ },
|
|
359
|
+ selectStartTimeAction: function () {
|
|
360
|
+ if (this.record.id != 0) {
|
|
361
|
+ var creator = 0
|
|
362
|
+ if (this.record.creator == 0) {
|
|
363
|
+ creator = this.record.start_nurse
|
|
364
|
+ } else {
|
|
365
|
+ creator = this.record.creator
|
|
366
|
+ }
|
|
367
|
+
|
|
368
|
+ if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
|
369
|
+ this.$refs.start_time_picker.open()
|
|
370
|
+ } else {
|
|
371
|
+ return
|
|
372
|
+ }
|
424
|
373
|
}
|
425
|
|
- if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
426
|
|
- this.selecting = true;
|
427
|
|
- var t = this;
|
428
|
|
- this.$refs.selector.showSingleSelect(
|
429
|
|
- this.admins,
|
430
|
|
- this.puncture_nurse_id,
|
431
|
|
- "选择穿刺护士",
|
432
|
|
- "name",
|
433
|
|
- "id",
|
434
|
|
- function(select_id) {
|
435
|
|
- t.puncture_nurse_id = select_id;
|
436
|
|
- },
|
437
|
|
- function() {
|
438
|
|
- t.selecting = false;
|
|
374
|
+ this.$refs.start_time_picker.open()
|
|
375
|
+ },
|
|
376
|
+ commitInfo: function () {
|
|
377
|
+ Toast.loading({forbidClick: true, duration: 0})
|
|
378
|
+ let ParamsQuery = {}
|
|
379
|
+ ParamsQuery['schedual_type'] = this.schedual_type
|
|
380
|
+ ParamsQuery['patient_id'] = this.patient_prop.id
|
|
381
|
+ ParamsQuery['record_date'] = this.record_date
|
|
382
|
+ ParamsQuery['nurse'] = this.nurse_id
|
|
383
|
+ ParamsQuery['bed'] = this.bed_id
|
|
384
|
+ ParamsQuery['start_time'] = this.start_time_str
|
|
385
|
+ ParamsQuery['puncture_nurse'] = this.puncture_nurse_id
|
|
386
|
+ ParamsQuery['blood_drawing'] = this.blood_drawing
|
|
387
|
+
|
|
388
|
+ startDialysis(ParamsQuery).then(response => {
|
|
389
|
+ if (response.data.state == 0) {
|
|
390
|
+ Toast.fail(response.data.msg)
|
|
391
|
+ return false
|
|
392
|
+ } else {
|
|
393
|
+ Toast.success('上机成功')
|
|
394
|
+ var monitor = response.data.data.monitor
|
|
395
|
+ this.$emit('did_add_monitor', monitor)
|
|
396
|
+ this.$emit('did_start', response.data.data.dialysis_order)
|
|
397
|
+ var record = this.record
|
|
398
|
+ for (const key in response.data.data.dialysis_order) {
|
|
399
|
+ this.$set(record, key, response.data.data.dialysis_order[key])
|
|
400
|
+ // this.record[key] = response.data.data.dialysis_order[key]
|
439
|
401
|
}
|
440
|
|
- );
|
441
|
|
- } else {
|
442
|
|
- return;
|
|
402
|
+ }
|
|
403
|
+ })
|
|
404
|
+ },
|
|
405
|
+ close: function () {
|
|
406
|
+ this.$emit('close')
|
|
407
|
+ },
|
|
408
|
+ select_bed: function () {
|
|
409
|
+ if (this.record.id != 0) {
|
|
410
|
+ var creator = 0
|
|
411
|
+ if (this.record.creator == 0) {
|
|
412
|
+ creator = this.record.start_nurse
|
|
413
|
+ } else {
|
|
414
|
+ creator = this.record.creator
|
|
415
|
+ }
|
|
416
|
+
|
|
417
|
+ if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
|
418
|
+ this.selecting = true
|
|
419
|
+ var t = this
|
|
420
|
+ this.$refs.selector.showSingleSelect(this.zone_beds, this.bed_id, '选择床位号', 'number', 'id', function (select_id) {
|
|
421
|
+ t.bed_id = select_id
|
|
422
|
+ }, function () {
|
|
423
|
+ t.selecting = false
|
|
424
|
+ })
|
|
425
|
+ } else {
|
|
426
|
+ return
|
|
427
|
+ }
|
443
|
428
|
}
|
444
|
|
- }
|
445
|
|
- this.selecting = true;
|
446
|
|
- var t = this;
|
447
|
|
- this.$refs.selector.showSingleSelect(
|
448
|
|
- this.admins,
|
449
|
|
- this.puncture_nurse_id,
|
450
|
|
- "选择穿刺护士",
|
451
|
|
- "name",
|
452
|
|
- "id",
|
453
|
|
- function(select_id) {
|
454
|
|
- t.puncture_nurse_id = select_id;
|
455
|
|
- },
|
456
|
|
- function() {
|
457
|
|
- t.selecting = false;
|
|
429
|
+
|
|
430
|
+ this.selecting = true
|
|
431
|
+ var t = this
|
|
432
|
+ this.$refs.selector.showSingleSelect(this.zone_beds, this.bed_id, '选择床位号', 'number', 'id', function (select_id) {
|
|
433
|
+ t.bed_id = select_id
|
|
434
|
+ }, function () {
|
|
435
|
+ t.selecting = false
|
|
436
|
+ })
|
|
437
|
+ },
|
|
438
|
+ select_nurse: function () {
|
|
439
|
+ if (this.record.id != 0) {
|
|
440
|
+ var creator = 0
|
|
441
|
+ if (this.record.creator == 0) {
|
|
442
|
+ creator = this.record.start_nurse
|
|
443
|
+ } else {
|
|
444
|
+ creator = this.record.creator
|
|
445
|
+ }
|
|
446
|
+ if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
|
447
|
+ this.selecting = true
|
|
448
|
+ var t = this
|
|
449
|
+ this.$refs.selector.showSingleSelect(this.admins, this.nurse_id, '选择上机护士', 'name', 'id', function (select_id) {
|
|
450
|
+ t.nurse_id = select_id
|
|
451
|
+ }, function () {
|
|
452
|
+ t.selecting = false
|
|
453
|
+ })
|
|
454
|
+ } else {
|
|
455
|
+ return
|
|
456
|
+ }
|
458
|
457
|
}
|
459
|
|
- );
|
460
|
|
- },
|
461
|
|
- open: function() {
|
462
|
|
- this.selecting = false;
|
463
|
|
- this.$refs.selector.hide();
|
464
|
|
- }
|
465
|
|
- },
|
466
|
|
- watch: {
|
467
|
|
- "record.id": function(val) {
|
468
|
|
- if (val > 0) {
|
469
|
|
- for (let i = 0; i < this.special_premission.length; i++) {
|
470
|
|
- if (
|
471
|
|
- this.$store.getters.user.user.id ==
|
472
|
|
- this.special_premission[i].admin_user_id
|
473
|
|
- ) {
|
474
|
|
- this.isPremission = true;
|
|
458
|
+ this.selecting = true
|
|
459
|
+ var t = this
|
|
460
|
+ this.$refs.selector.showSingleSelect(this.admins, this.nurse_id, '选择上机护士', 'name', 'id', function (select_id) {
|
|
461
|
+ t.nurse_id = select_id
|
|
462
|
+ }, function () {
|
|
463
|
+ t.selecting = false
|
|
464
|
+ })
|
|
465
|
+ }, select_puncture_nurse: function () {
|
|
466
|
+ if (this.record.id != 0) {
|
|
467
|
+ var creator = 0
|
|
468
|
+ if (this.record.creator == 0) {
|
|
469
|
+ creator = this.record.start_nurse
|
|
470
|
+ } else {
|
|
471
|
+ creator = this.record.creator
|
|
472
|
+ }
|
|
473
|
+ if (this.$store.getters.user.user.id == creator || this.isPremission) {
|
|
474
|
+ this.selecting = true
|
|
475
|
+ var t = this
|
|
476
|
+ this.$refs.selector.showSingleSelect(this.admins, this.puncture_nurse_id, '选择穿刺护士', 'name', 'id', function (select_id) {
|
|
477
|
+ t.puncture_nurse_id = select_id
|
|
478
|
+ }, function () {
|
|
479
|
+ t.selecting = false
|
|
480
|
+ })
|
|
481
|
+ } else {
|
|
482
|
+ return
|
475
|
483
|
}
|
476
|
484
|
}
|
477
|
|
- if (this.record.creator == 0) {
|
478
|
|
- this.creator = this.record.start_nurse;
|
479
|
|
- } else {
|
480
|
|
- this.creator = this.record.creator;
|
|
485
|
+ this.selecting = true
|
|
486
|
+ var t = this
|
|
487
|
+ this.$refs.selector.showSingleSelect(this.admins, this.puncture_nurse_id, '选择穿刺护士', 'name', 'id', function (select_id) {
|
|
488
|
+ t.puncture_nurse_id = select_id
|
|
489
|
+ }, function () {
|
|
490
|
+ t.selecting = false
|
|
491
|
+ })
|
|
492
|
+ },
|
|
493
|
+ open: function () {
|
|
494
|
+ this.selecting = false
|
|
495
|
+ this.$refs.selector.hide()
|
|
496
|
+ }
|
|
497
|
+ }, watch: {
|
|
498
|
+ 'record.id': function (val) {
|
|
499
|
+ if (val > 0) {
|
|
500
|
+ for (let i = 0; i < this.special_premission.length; i++) {
|
|
501
|
+ if (this.$store.getters.user.user.id == this.special_premission[i].admin_user_id) {
|
|
502
|
+ this.isPremission = true
|
|
503
|
+ }
|
|
504
|
+ }
|
|
505
|
+ if (this.record.creator == 0) {
|
|
506
|
+ this.creator = this.record.start_nurse
|
|
507
|
+ } else {
|
|
508
|
+ this.creator = this.record.creator
|
|
509
|
+ }
|
|
510
|
+
|
|
511
|
+
|
481
|
512
|
}
|
482
|
513
|
}
|
|
514
|
+
|
483
|
515
|
}
|
|
516
|
+
|
484
|
517
|
}
|
485
|
|
-};
|
486
|
518
|
</script>
|
487
|
519
|
|
488
|
520
|
<style style="stylesheet/scss" lang="scss" scoped>
|