cost-use-registration-details.vue
26.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
<!--医院对账单 - 列表-->
<template>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a class="fbtn fb-save" v-if="state =='N'" @click="saveTrmedHvwvs()">保存</a>
<a class="fbtn fb-submit" v-if="state =='N'" @click="subMittrmedHvwvs()">提交</a>
<a class="fbtn fb-return" v-if="state =='N'" @click="deltrmedhvurs()">撤销</a>
</div>
<h3 class="current-module">高值使用登记</h3>
</div>
<div class="order-orderlist-view clearfix">
<div class="fheader">
<h4 class='fh-notes'>高值使用登记</h4>
</div>
<div class="w660 mb-30" style="margin:0 auto;">
<div class="group-row" v-if="state =='N'">
<div class="form-group form-label w660">
<label for="cc0" class="label bar-code-img"></label>
<div class="control">
<input class="h-70 w660 border-blue pl80 f-size24" type="text" id="cc0" v-model="barcode" placeholder="请扫描条码" @keydown="keyCodeList($event)">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc1" class="label h-44 f-size18 lh-44">医院</label>
<div class="control">
<select v-model="medguid" id='cc1' class="inp2 h-44 f-size18" @change="getdepname(medguid)">
<option value="">请选择</option>
<option v-for='item in getMedList' :value="item.guid">{{item.name}}</option>
</select>
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc2" class="label h-44 f-size18 lh-44">医院</label>
<div class="control">
<input type="text" id="cc2" class="h-44 f-size18 inp2" v-model="medname" readonly="state =='Y'">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc3" class="label h-44 f-size18 lh-44">科室</label>
<div class="control">
<select v-model="deptguid" id='cc3' class="inp2 h-44 f-size18" @change="getrealname(deptguid)">
<option value="">请选择</option>
<option v-for='item in getdepartmentList' :value="item.guid">{{item.hdeptname}}</option>
</select>
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc4" class="label h-44 f-size18 lh-44">科室</label>
<div class="control">
<input type="text" id="cc4" class="h-44 f-size18 inp2" v-model="deptname" readonly="state =='Y'">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc5" class="label h-44 f-size18 lh-44">手术日期</label>
<div class="control control-date h-44" style="overflow: inherit;">
<div>
<datepicker :target.sync="surgerydate | getYMD" :readonly="readonlyFlag" styleobj="width:100% !important;border-radius:8px !important; height:42px; line-height:44px; font-size:18px; padding-left:90px;"></datepicker>
</div>
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc6" class="label h-44 f-size18 lh-44">手术日期</label>
<div class="control">
<input type="text" id="cc6" class="h-44 f-size18 inp4" v-model="surgerydate | getYMD" readonly="state =='Y'">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc7" class="label h-44 f-size18 lh-44">手术编号</label>
<div class="control">
<input type="text" id="cc7" class="h-44 f-size18 inp4" v-model="surgerybillno">
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc8" class="label h-44 f-size18 lh-44">手术编号</label>
<div class="control">
<input type="text" id="cc8" class="h-44 f-size18 inp4" v-model="surgerybillno" readonly="readonly">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc9" class="label h-44 f-size18 lh-44">医生姓名</label>
<div class="control">
<input type="text" id="cc9" class="h-44 f-size18 inp4" v-model="doctorname" >
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc10" class="label h-44 f-size18 lh-44">医生姓名</label>
<div class="control">
<input type="text" id="cc10" class="h-44 f-size18 inp4" v-model="doctorname" readonly="readonly">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc11" class="label h-44 f-size18 lh-44">住院号</label>
<div class="control">
<input type="text" id="cc11" class="h-44 f-size18 inp3" v-model="inhospitalnumber">
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc12" class="label h-44 f-size18 lh-44">住院号</label>
<div class="control">
<input type="text" id="cc12" class="h-44 f-size18 inp3" v-model="inhospitalnumber" readonly="readonly">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc13" class="label h-44 f-size18 lh-44">病床号</label>
<div class="control">
<input type="text" id="cc13" class="h-44 f-size18 inp3" v-model="bednumber">
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc14" class="label h-44 f-size18 lh-44">病床号</label>
<div class="control">
<input type="text" id="cc14" class="h-44 f-size18 inp3" v-model="bednumber" readonly="readonly">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc15" class="label h-44 f-size18 lh-44">患者姓名</label>
<div class="control">
<input type="text" id="cc15" class="h-44 f-size18 inp4" v-model="patientname">
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc16" class="label h-44 f-size18 lh-44">患者姓名</label>
<div class="control">
<input type="text" id="cc16" class="h-44 f-size18 inp4" v-model="patientname" readonly="readonly">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label">
<label for="cc17" class="label h-44 f-size18 lh-44">单据编号</label>
<div class="control">
<input type="text" id="cc17" class="h-44 f-size18 inp4" v-model="billno" readonly="readonly">
</div>
</div>
</div>
<div class="group-row mt-20">
<div class="form-group form-label" v-if="state =='N'">
<label for="cc18" class="label h-44 f-size18 lh-44">备注</label>
<div class="control">
<input type="text" id="cc18" class="h-44 f-size18 inp2" v-model="memo">
</div>
</div>
<div class="form-group form-label" v-else>
<label for="cc19" class="label h-44 f-size18 lh-44">备注</label>
<div class="control">
<input type="text" id="cc19" class="h-44 f-size18 inp2" v-model="memo" readonly="readonly">
</div>
</div>
</div>
</div>
</div>
<table class="itable itable-td-long-text mb-30" v-if="state =='N'">
<thead id="t_header">
<tr>
<th class="w40">序号</th>
<th class="w80"> 商品编号</th>
<th class="w150">商品名称</th>
<th class="w80">规格</th>
<th class="w60">单位</th>
<th class="w120">生产厂商</th>
<th class="w120">注册证号/批准文号</th>
<th class="w80">批号</th>
<th class="w100">条码</th>
<th class="w80" v-if="state =='N'">操作</th>
</tr>
</thead>
<tbody >
<tr v-if="getTrmedHvstockList.length==0">
<td colspan="10" >
暂无符合条件的记录
</td>
</tr>
<tr v-else v-for='item in getTrmedHvstockList'>
<td class="v-top">{{$index+1}}</td>
<td class="t-left pr10 v-top">{{item.goodscode}}</td>
<td class="t-left pr10 v-top">{{item.goodsname}}</td>
<td class="t-left pr10 v-top">{{item.goodsspec}}</td>
<td class="v-top">{{item.unit}}</td>
<td class="t-left pr10 v-top">{{item.producer}}</td>
<td class="t-left pr10 v-top">{{item.register}}</td>
<td class="t-left v-top">{{item.lot}}<br>{{item.productiondate | getYMD}}<br>{{item.expiredate | getYMD}}</td>
<td class="t-left pr10 v-top">{{item.barcode}}</td>
<td class="v-top" v-if="state =='N'"><a href="javascript:;" class="btn button-red" v-on:click="delList($index)">删 除</a></td>
</tr>
</tbody>
</table>
<table class="itable itable-td-long-text mb-30" v-else>
<thead id="t_header">
<tr>
<th class="w40">序号</th>
<th class="w150">商品信息</th>
<th class="w60">单位</th>
<th class="w100">要货时间</th>
<th class="w100">送货时间</th>
<th class="w100">入库时间</th>
<th class="w80">批号</th>
<th class="w140">条码</th>
<th class="w80" v-if="state =='N'">操作</th>
</tr>
</thead>
<tbody >
<tr v-if="getTrmedHvstockList.length==0">
<td colspan="10" >
暂无符合条件的记录
</td>
</tr>
<tr v-else v-for='item in getTrmedHvstockList'>
<td class="v-top">{{$index+1}}</td>
<td class="t-left pr10 v-top">
{{item.goodscode}}
<br>
{{item.goodsname}}
<br>
{{item.goodsspec}}
<br>
{{item.producer}}
<br>
{{item.register}}
</td>
<td class="v-top">{{item.unit}}</td>
<td>{{item.planbegindate | getYMD}}
<br>
{{item.planbegindate | getHMS}}
</td>
<td>
{{item.dodate | getYMD}}
<br>
{{item.dodate | getHMS}}
</td>
<td>
{{item.mvdate | getYMD}}
<br>
{{item.mvdate | getHMS}}
</td>
<td class="t-left v-top">{{item.lot}}<br>{{item.productiondate | getYMD}}<br>{{item.expiredate | getYMD}}</td>
<td class="t-left pr10 v-top">{{item.barcode}}</td>
<td class="v-top" v-if="state =='N'"><a href="javascript:;" class="btn button-red" v-on:click="delList($index)">删 除</a></td>
</tr>
</tbody>
</table>
</div>
<div class="modal" v-if='modelFlag'>
<div class="container resource">
<div class="audit-detail" style="margin:200px auto;width:1003px;">
<span class="close-win" v-on:click="close()"></span>
<div class="sdiv-9-9b no-border pb0">
<form class="search-bar" active="###">
<input type="text" style="width: 370px;" placeholder="输入商品名称查询" v-model="goodsname">
<div class="search-btn">
<input type="button" @click="getDataGoods()">
</div>
</form>
</div>
<div style="padding-top:0px; max-height: 350px; overflow-y: auto; padding-bottom:10px;">
<table class="itable itable-thead-13px itable-td-long-text">
<thead>
<tr>
<th class="w50">序号</th>
<th class="w80"> 商品编号</th>
<th class="w150">商品名称</th>
<th class="w80">规格</th>
<th class="w60">单位</th>
<th class="w120">生产厂商</th>
<th class="w120">注册证号/批准文号</th>
<th class="w80">批号</th>
<th class="w100">条码</th>
<th class="w80">操作</th>
</tr>
</thead>
<tbody>
<tr v-for='item in zsmsList' track-by="$index">
<td class=" v-top">
<div>{{$index+1 | getIndex}}</div>
</td>
<td class="t-left pr10 v-top">{{item.goodscode}}</td>
<td class="t-left pr10 v-top">{{item.goodsname}}</td>
<td class="t-left pr10 v-top">{{item.goodsspec}}</td>
<td class="v-top">{{item.unit}}</td>
<td class="t-left pr10 v-top">{{item.producer}}</td>
<td class="t-left pr10 v-top">{{item.register}}</td>
<td class="t-left v-top">{{item.lot}}<br>{{item.productiondate | getYMD}}<br>{{item.expiredate | getYMD}}</td>
<td class="t-left pr10 v-top">{{item.barcode}}</td>
<td class=" v-top">
<a href="javascript:;" class="btn button-green" @click="addCode($index,item.guid)">添加</a>
</td>
</tr>
</tbody>
</table>
</div>
<a href="javascript:;" class="btn button-green mt-20" style='margin-left:430px;' v-on:click="close()">确 认</a>
</div>
</div>
</div>
</template>
<script >
module.exports = {
data: function () {
return {
getTrmedHvstockList:[],
getdepartmentList:[],
// 查询条件
surgerydate: '',
deptguid:'',
deptname:'',
surgerybillno:'',
inhospitalnumber: '',
bednumber: '',
patientname:'',
barcode:'',
memo:'',
billno:'',
doctorname:'',
guid:'',
state:'',
goodsname:'',
medname:'',
modelFlag:false,
zsmsList:[],
};
},
watch: {
'search.goodstate': function(val) {
this.getData();
}
},
methods: {
// 获取当前时间和之前一个月时间
Date:function(){
var self = this;
var nowdate = new Date();
// 开始日期
nowdate.setMonth(nowdate.getMonth());
var yn = nowdate.getFullYear();
var mn = nowdate.getMonth()+1;
mn=mn<10?'0'+mn:mn;
var dn= nowdate.getDate();
dn=dn<10?'0'+dn:dn;
self.surgerydate = yn+'-'+mn+'-'+dn;
},
keyCodeList: function (ev) {
if(ev.keyCode==13){
this.getData();
}
},
getData: function () {
var self = this;
if(self.medguid == '' || self.medguid == null){
layer.msg('请选择医院!')
return;
}
Ajax.post('/cost/gettrmedhvstock',{'barcode':self.barcode,'medguid':self.medguid})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
for (var i = 0; i < self.getTrmedHvstockList.length; i++) {
if(self.getTrmedHvstockList[i].guid == data[0].guid){
layer.msg('商品已存在!')
return;
}
}
self.getTrmedHvstockList.push(data[0]);
} else {
layer.msg(response.data.message)
}
})
},
gettrmedhvurdetails: function () {
var self = this;
Ajax.post('/cost/gettrmedhvurdetails',{'guid':self.$route.params.guid})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
if(data.trmedhvur.state=='N'){
self.$set('getTrmedHvstockList',data.trmedhvstocks);
}else{
self.$set('getTrmedHvstockList',data.maps);
}
self.deptguid = data.trmedhvur.deptguid;
self.deptname = data.trmedhvur.deptname;
self.surgerybillno = data.trmedhvur.surgerybillno;
self.inhospitalnumber = data.trmedhvur.inhospitalnumber;
self.bednumber = data.trmedhvur.bednumber;
self.patientname = data.trmedhvur.patientname;
self.billno = data.trmedhvur.billno;
self.memo = data.trmedhvur.memo;
self.doctorname = data.trmedhvur.doctorname;
self.surgerydate = data.trmedhvur.surgerydate;
self.state = data.trmedhvur.state;
self.medguid = data.trmedhvur.medguid;
self.medname = data.trmedhvur.medname;
self.guid = self.$route.params.guid;
self.getdepname(self.medguid);
} else {
layer.msg(response.data.message)
}
})
},
getDataGoods: function () {
var self = this;
Ajax.post('/cost/gettrmedhvstock',{'barcode':self.barcode,'goodsname':self.goodsname})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$set('zsmsList',data);
} else {
layer.msg(response.data.message);
}
})
},
addCode: function(index,guid) {
var self = this;
for (var i = 0; i < self.zsmsList.length; i++) {
if(self.zsmsList[i].guid == guid){
for (var j = 0; j < self.getTrmedHvstockList.length; j++) {
if(self.getTrmedHvstockList[j].guid == guid){
layer.msg('商品已存在!')
return;
}
}
self.getTrmedHvstockList.push(self.zsmsList[i]);
}
}
self.zsmsList.splice(index, 1);
if(self.zsmsList.length == 0){
self.close();
}
},
delList: function(index) {
var self = this;
self.getTrmedHvstockList.splice(index, 1);
},
getdepartmentLists: function () {
var self = this;
Ajax.post('/cost/getdepartmentlist',{})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$set('getdepartmentList',data);
}
})
},
deltrmedhvurs: function () {
var self = this;
Ajax.post('/cost/deltrmedhvur',{'guid':self.guid})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$route.router.go('/cost/costUseRegistrationList');
}
})
},
getmedlist: function () {
var self = this;
Ajax.post('/cost/getmedlist',{})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$set('getMedList',data);
}
})
},
getdepname: function (guid) {
var self = this;
self.getdepartmentLists(guid);
},
getdepartmentLists: function (guid) {
var self = this;
Ajax.post('/cost/getdepartmentlist',{'medguid':guid})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$set('getdepartmentList',data);
}
})
},
getrealname: function (guid) {
var self = this;
for (var i = 0; i < self.getdepartmentList.length; i++) {
if(guid == self.getdepartmentList[i].guid){
self.deptname = self.getdepartmentList[i].hdeptname;
}
}
},
// 保存
saveTrmedHvwvs: function () {
var self = this;
if(self.medguid == '' || self.medguid == null){
layer.msg('请选择医院!')
return;
}
if(self.deptguid == '' || self.deptguid == null){
layer.msg('请选择科室!')
return;
}
if(self.surgerydate == '' || self.surgerydate == null){
layer.msg('请选择手术日期!')
return;
}
if(self.surgerybillno == '' || self.surgerybillno == null){
layer.msg('请填写手术编号!')
return;
}
if(self.doctorname == '' || self.doctorname == null){
layer.msg('请填写医生姓名!')
return;
}
if(self.inhospitalnumber == '' || self.inhospitalnumber == null){
layer.msg('请填写住院号!')
return;
}
if(self.bednumber == '' || self.bednumber == null){
layer.msg('请填写病床号!')
return;
}
if(self.patientname == '' || self.patientname == null){
layer.msg('请填写患者姓名!')
return;
}
Ajax.post('/cost/savetrmedhvur',{'surgerydate':self.surgerydate,'guid':self.guid,'medguid':self.medguid,'doctorname':self.doctorname,'deptguid':self.deptguid,'deptname':self.deptname,'surgerybillno':self.surgerybillno,'inhospitalnumber':self.inhospitalnumber,'bednumber':self.bednumber,'patientname':self.patientname,'billno':self.billno,'memo':self.memo,'list':self.getTrmedHvstockList})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
layer.msg('保存成功!')
self.billno = data.billno;
self.guid = data.guid;
self.deptguid = data.deptguid;
self.surgerybillno = data.surgerybillno;
self.inhospitalnumber = data.inhospitalnumber;
self.bednumber = data.bednumber;
self.patientname = data.patientname;
self.memo = data.memo;
self.doctorname = data.doctorname;
self.surgerydate = data.surgerydate;
}else {
layer.msg(response.data.message)
}
})
},
// 提交
subMittrmedHvwvs: function () {
var self = this;
if(self.medguid == '' || self.medguid == null){
layer.msg('请选择医院!')
return;
}
if(self.deptguid == '' || self.deptguid == null){
layer.msg('请选择科室!')
return;
}
if(self.surgerydate == '' || self.surgerydate == null){
layer.msg('请选择手术日期!')
return;
}
if(self.surgerybillno == '' || self.surgerybillno == null){
layer.msg('请填写手术编号!')
return;
}
if(self.doctorname == '' || self.doctorname == null){
layer.msg('请填写医生姓名!')
return;
}
if(self.inhospitalnumber == '' || self.inhospitalnumber == null){
layer.msg('请填写住院号!')
return;
}
if(self.bednumber == '' || self.bednumber == null){
layer.msg('请填写病床号!')
return;
}
if(self.patientname == '' || self.patientname == null){
layer.msg('请填写患者姓名!')
return;
}
Ajax.post('/cost/submittrmedhvur',{'surgerydate':self.surgerydate,'guid':self.guid,'medguid':self.medguid,'doctorname':self.doctorname,'deptguid':self.deptguid,'deptname':self.deptname,'surgerybillno':self.surgerybillno,'inhospitalnumber':self.inhospitalnumber,'bednumber':self.bednumber,'patientname':self.patientname,'billno':self.billno,'memo':self.memo,'list':self.getTrmedHvstockList})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.MessageBox({
title: '提示',
message: '提交成功!',
type: 'alert'
}, function (action) {
self.$route.router.go('/cost/costUseRegistrationList');
});
}else {
layer.msg(response.data.message)
}
})
},
},
route: {
activate: function () {
this.Date();
this.gettrmedhvurdetails();
// this.getdepartmentLists();
this.getmedlist();
}
},
ready:function(){
var self=this;
$("#cc0").focus();
}
};
</script>