|
@@ -11,16 +11,17 @@
|
11
|
11
|
</div>
|
12
|
12
|
<div style="display:flex;justify-content: space-between;">
|
13
|
13
|
<div class="callingArea">
|
14
|
|
- <waiting-called v-if="patientStateVal == 0" :waitingCalled='waitingCalled' ></waiting-called>
|
15
|
|
- <called v-if="patientStateVal == 1" :called="called"></called>
|
|
14
|
+ <waiting-called v-if="patientStateVal == 0" :waitingCalled='waitingCalledAm' ></waiting-called>
|
|
15
|
+ <waiting-called v-if="patientStateVal == 1" :waitingCalled='waitingCalledPm' ></waiting-called>
|
|
16
|
+ <called v-if="patientStateVal == 2" :called="called"></called>
|
16
|
17
|
</div>
|
17
|
|
- <div class="nowCalling" v-if="patientStateVal == 0">
|
|
18
|
+ <div class="nowCalling" v-if="patientStateVal == 0 || patientStateVal == 1">
|
18
|
19
|
<p class="nowCallingTitle">当前叫号</p>
|
19
|
20
|
<p class="nowCallingName">{{ fisrtQueueInfo ? fisrtQueueInfo.patient_name : '' }}</p>
|
20
|
21
|
<p class="nowCallingTime">签到时间:{{ fisrtQueueInfo ? fisrtQueueInfo.create_time : '' }}</p>
|
21
|
22
|
<el-button type="primary" @click="call(fisrtQueueInfo && fisrtQueueInfo.patient_id ? fisrtQueueInfo.patient_id : '')" style="margin-left:0;margin: 30px 0 20px 0;"> 叫号 </el-button>
|
22
|
23
|
<!-- <el-button style="margin: 0px 0 20px 0;" @click="pass(fisrtQueueInfo.patient_id)"> 过号 </el-button> -->
|
23
|
|
- <el-button style="margin:0 auto;" @click="next(fisrtQueueInfo && fisrtQueueInfo.patient_id ? fisrtQueueInfo.patient_id : '')">下一位</el-button>
|
|
24
|
+ <el-button style="margin:0 auto;" @click="next(fisrtQueueInfo && fisrtQueueInfo.patient_id ? fisrtQueueInfo.patient_id : '',fisrtQueueInfo && fisrtQueueInfo.schedule_type ? fisrtQueueInfo.schedule_type : '')">下一位</el-button>
|
24
|
25
|
</div>
|
25
|
26
|
</div>
|
26
|
27
|
</div>
|
|
@@ -40,8 +41,9 @@ export default {
|
40
|
41
|
data(){
|
41
|
42
|
return{
|
42
|
43
|
patient_state:[
|
43
|
|
- {value: 0,label: '待叫号'},
|
44
|
|
- {value: 1,label: '已叫号'},
|
|
44
|
+ {value: 0,label: '上午待叫号'},
|
|
45
|
+ {value: 1,label: '下午待叫号'},
|
|
46
|
+ {value: 2,label: '已叫号'},
|
45
|
47
|
],
|
46
|
48
|
patientStateVal: 0,
|
47
|
49
|
waitingCalled:[],
|
|
@@ -49,6 +51,10 @@ export default {
|
49
|
51
|
fisrtQueueInfo:{},
|
50
|
52
|
timer:null,
|
51
|
53
|
|
|
54
|
+ waitingCalledAm:[],
|
|
55
|
+ waitingCalledPm:[],
|
|
56
|
+ newFisrtQueueInfo:{}
|
|
57
|
+
|
52
|
58
|
}
|
53
|
59
|
},
|
54
|
60
|
computed: {
|
|
@@ -116,53 +122,107 @@ export default {
|
116
|
122
|
let res = JSON.parse(e.data);
|
117
|
123
|
// let res = re.data;
|
118
|
124
|
console.log('res3333333333',res)
|
119
|
|
- if(res.channel == 'queue/join'){
|
120
|
|
- if(res.data.fisrtQueueInfo != null){
|
121
|
|
- if(res.data.fisrtQueueInfo.create_time){
|
122
|
|
- res.data.fisrtQueueInfo.create_time = moment(parseInt(res.data.fisrtQueueInfo.create_time) * 1000).format('HH:mm')
|
|
125
|
+ if(res.data.type == 3){
|
|
126
|
+ if(res.channel == 'queue/join'){
|
|
127
|
+ let fisrtQueueInfo = []
|
|
128
|
+ this.newFisrtQueueInfo = res.data.fisrtQueueInfo
|
|
129
|
+ if(res.data.fisrtQueueInfo != null){
|
|
130
|
+ if(this.patientStateVal == 0){
|
|
131
|
+ fisrtQueueInfo = res.data.fisrtQueueInfo.morning
|
|
132
|
+ if(fisrtQueueInfo.create_time){
|
|
133
|
+ fisrtQueueInfo.create_time = moment(parseInt(fisrtQueueInfo.create_time) * 1000).format('HH:mm')
|
|
134
|
+ }
|
|
135
|
+ }else if(this.patientStateVal == 1){
|
|
136
|
+ fisrtQueueInfo = res.data.fisrtQueueInfo.afternoon
|
|
137
|
+ if(fisrtQueueInfo.create_time){
|
|
138
|
+ fisrtQueueInfo.create_time = moment(parseInt(fisrtQueueInfo.create_time) * 1000).format('HH:mm')
|
|
139
|
+ }
|
|
140
|
+ }
|
123
|
141
|
}
|
124
|
|
-
|
|
142
|
+ this.fisrtQueueInfo = fisrtQueueInfo
|
|
143
|
+ let arr = res.data.patientQueueList.data
|
|
144
|
+ // let waitingCalledArr = []
|
|
145
|
+ let waitingCalledAm = []
|
|
146
|
+ let waitingCalledPm = []
|
|
147
|
+ let calledArr = []
|
|
148
|
+ arr.map(item => {
|
|
149
|
+ if(item.status == 1){
|
|
150
|
+ item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
|
151
|
+ // waitingCalledArr.push(item)
|
|
152
|
+ if(item.schedule_type == 1){
|
|
153
|
+ waitingCalledAm.push(item)
|
|
154
|
+ }else if(item.schedule_type == 2){
|
|
155
|
+ waitingCalledPm.push(item)
|
|
156
|
+ }
|
|
157
|
+ }else if(item.status == 2){
|
|
158
|
+ item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
|
159
|
+ calledArr.push(item)
|
|
160
|
+ }
|
|
161
|
+ })
|
|
162
|
+ console.log('waitingCalledArr待叫号',waitingCalledArr)
|
|
163
|
+ console.log('waitingCalledArr以较好',calledArr)
|
|
164
|
+ // this.waitingCalled = waitingCalledArr
|
|
165
|
+ this.waitingCalledAm = waitingCalledArr
|
|
166
|
+ this.waitingCalledPm = waitingCalledArr
|
|
167
|
+ this.called = calledArr
|
|
168
|
+ }else if(res.channel == 'allQueueList'){
|
|
169
|
+ let arr = res.data.queue_list.data
|
|
170
|
+ let waitingCalledArr = []
|
|
171
|
+ let calledArr = []
|
|
172
|
+ arr.map(item => {
|
|
173
|
+ if(item.status == 1){
|
|
174
|
+ item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
|
175
|
+ waitingCalledArr.push(item)
|
|
176
|
+ }else if(item.status == 2){
|
|
177
|
+ item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
|
178
|
+ calledArr.push(item)
|
|
179
|
+ }
|
|
180
|
+ })
|
|
181
|
+ this.waitingCalled = waitingCalledArr
|
|
182
|
+ this.called = calledArr
|
|
183
|
+ }else if(res.channel == 'patientCallInfo'){
|
|
184
|
+ res.data.patientInfo.create_time = moment(parseInt(res.data.patientInfo.create_time) * 1000).format('HH:mm')
|
|
185
|
+ this.fisrtQueueInfo = res.data.patientInfo
|
125
|
186
|
}
|
126
|
|
- this.fisrtQueueInfo = res.data.fisrtQueueInfo
|
127
|
|
- let arr = res.data.patientQueueList.data
|
128
|
|
- let waitingCalledArr = []
|
129
|
|
- let calledArr = []
|
130
|
|
- arr.map(item => {
|
131
|
|
- if(item.status == 1){
|
132
|
|
- item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
133
|
|
- waitingCalledArr.push(item)
|
134
|
|
- }else if(item.status == 2){
|
135
|
|
- item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
136
|
|
- calledArr.push(item)
|
137
|
|
- }
|
138
|
|
- })
|
139
|
|
- console.log('waitingCalledArr待叫号',waitingCalledArr)
|
140
|
|
- console.log('waitingCalledArr以较好',calledArr)
|
141
|
|
- this.waitingCalled = waitingCalledArr
|
142
|
|
- this.called = calledArr
|
143
|
|
- }else if(res.channel == 'allQueueList'){
|
144
|
|
- let arr = res.data.queue_list.data
|
145
|
|
- let waitingCalledArr = []
|
146
|
|
- let calledArr = []
|
147
|
|
- arr.map(item => {
|
148
|
|
- if(item.status == 1){
|
149
|
|
- item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
150
|
|
- waitingCalledArr.push(item)
|
151
|
|
- }else if(item.status == 2){
|
152
|
|
- item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
|
153
|
|
- calledArr.push(item)
|
154
|
|
- }
|
155
|
|
- })
|
156
|
|
- this.waitingCalled = waitingCalledArr
|
157
|
|
- this.called = calledArr
|
158
|
|
- }else if(res.channel == 'patientCallInfo'){
|
159
|
|
- res.data.patientInfo.create_time = moment(parseInt(res.data.patientInfo.create_time) * 1000).format('HH:mm')
|
160
|
|
- this.fisrtQueueInfo = res.data.patientInfo
|
161
|
187
|
}
|
162
|
188
|
}
|
163
|
189
|
},
|
164
|
190
|
handleStateChange: function(index) {
|
165
|
191
|
this.patientStateVal = index
|
|
192
|
+ // if(index == 0){
|
|
193
|
+ // let arr = this.waitingCalledAm
|
|
194
|
+ // let newArr = []
|
|
195
|
+ // arr.map(item => {
|
|
196
|
+ // if(item.schedule_type == 1){
|
|
197
|
+ // newArr.push(item)
|
|
198
|
+ // }
|
|
199
|
+ // })
|
|
200
|
+ // this.waitingCalledAm = newArr
|
|
201
|
+ // }else if(index == 1){
|
|
202
|
+ // let arr = this.waitingCalledPm
|
|
203
|
+ // let newArr = []
|
|
204
|
+ // arr.map(item => {
|
|
205
|
+ // if(item.schedule_type == 2){
|
|
206
|
+ // newArr.push(item)
|
|
207
|
+ // }
|
|
208
|
+ // })
|
|
209
|
+ // this.waitingCalledPm = newArr
|
|
210
|
+ // }
|
|
211
|
+ let fisrtQueueInfo = []
|
|
212
|
+ if(this.newFisrtQueueInfo != null){
|
|
213
|
+ if(this.patientStateVal == 0){
|
|
214
|
+ fisrtQueueInfo = this.newFisrtQueueInfo.morning
|
|
215
|
+ if(fisrtQueueInfo.create_time){
|
|
216
|
+ fisrtQueueInfo.create_time = moment(parseInt(fisrtQueueInfo.create_time) * 1000).format('HH:mm')
|
|
217
|
+ }
|
|
218
|
+ }else if(this.patientStateVal == 1){
|
|
219
|
+ fisrtQueueInfo = this.newFisrtQueueInfo.afternoon
|
|
220
|
+ if(fisrtQueueInfo.create_time){
|
|
221
|
+ fisrtQueueInfo.create_time = moment(parseInt(fisrtQueueInfo.create_time) * 1000).format('HH:mm')
|
|
222
|
+ }
|
|
223
|
+ }
|
|
224
|
+ }
|
|
225
|
+ this.fisrtQueueInfo = fisrtQueueInfo
|
166
|
226
|
},
|
167
|
227
|
call(patient_id){
|
168
|
228
|
if(patient_id == undefined || patient_id == ""){
|
|
@@ -185,7 +245,7 @@ export default {
|
185
|
245
|
}
|
186
|
246
|
})
|
187
|
247
|
},
|
188
|
|
- next(patient_id){
|
|
248
|
+ next(patient_id,schedule_type){
|
189
|
249
|
if(patient_id == undefined || patient_id == ""){
|
190
|
250
|
this.$message.error('已经是最后一位了');
|
191
|
251
|
return
|
|
@@ -193,7 +253,7 @@ export default {
|
193
|
253
|
console.log('patient_id',patient_id)
|
194
|
254
|
let org_id = parseInt(sessionStorage.getItem("org_id"));
|
195
|
255
|
let admin_user_id = parseInt(sessionStorage.getItem("admin_user_id"));
|
196
|
|
- axios.get('/api/index/nextcall?org_id=' + org_id + '&patient_id=' + patient_id + '&admin_user_id=' + admin_user_id).then(res => {
|
|
256
|
+ axios.get('/api/index/nextcall?org_id=' + org_id + '&patient_id=' + patient_id + '&admin_user_id=' + admin_user_id + '&schedule_type=' + schedule_type).then(res => {
|
197
|
257
|
console.log(res)
|
198
|
258
|
// let patientArr = res.data.queue_list.data
|
199
|
259
|
// this.patientArr = patientArr
|