create-settle.vue
36.5 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
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
<template>
<section style="min-height: 806px;" class="container resource">
<div class="pop-banner clearfix w1003">
<h3 class="current-module">生成结算对账单</h3>
</div>
<!--purchase-return-goods start-->
<div class="purchase-return-goods" v-if="one">
<div class="step-tips step-3 clearfix">
<div class="step-item active"><span>1</span>选择入库单</div>
<div class="step-item"><span>2</span>生成结算单</div>
<div class="step-item"><span>3</span>提交结算单</div>
</div>
<div class="prg-type overflow-hidden">
<!-- start-->
<div class="basic-message-root fl w280 bgc-none supplylist supply-select">
<div class="data-root pd0 top">
<form class="search-bar mb-10" active="###" v-if="show">
<input type="text" class="w210" placeholder="输入关键字" v-model="suppliername">
<div class="search-btn fl cur-poin" @click="getData">
</div>
</form>
<div class="root-node-news h-34 lh-34 w280">
<b class="fl pl10 t-center">供应商</b>
</div>
<div class="root-node-list" id="sortable" style='height: 580px;'>
<template v-for="(indexI,sup) in supplyRelationList">
<div class="list-node h-55 lh-55" :class="{ 'active': activeI == indexI }" @click="getMed(indexI,sup.supplierguid,sup.suppliername)">
<div class="fl t-left ellipsis-sty pl10"><a style="cursor: default;" title="{{ sup.suppliername }}">{{ sup.suppliername }} </a></div>
</div>
</template>
</div>
</div>
</div>
<section class="fr bl-blue pl20 w700">
<!-- 查询 -->
<div class="basic-message-search">
<div class="pd-form fast-search-form mb-0">
<div class="group-row">
<div class="form-group form-label" v-if="timesh">
<label for="cnb1" class="label">结算周期</label>
<div class="control">
<monthpicker :target.sync="search.planperiod" id='cnn1' inpclass='inp4' readonly="readonly" disabled="disabled"></monthpicker>
</div>
</div>
<div class="form-group form-label" v-if="!timesh">
<label for="cnn1" class="label">结算周期</label>
<div class="control">
<monthpicker :target.sync="search.planperiod" id='cnn1' inpclass='inp4' @click.prevent="monthReckon(search.planperiod)"></monthpicker>
</div>
</div>
</div>
<section class="group-row">
<div class="form-group" style="width: 100%!important;">
<div class="control control-date" style="width: 100%; height:34px;overflow: inherit;" v-if="timesh">
<div style="width:44%;float:left;">
<datepicker :target.sync="search.dateStart | getYMD" :readonly="readonlyFlag" :placeholder="'开始日期'" styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;" disabled="disabled"></datepicker>
</div>
<span class="text-and">—</span>
<div style="width:48%;float:left;">
<datepicker :target.sync="search.dateEnd | getYMD" :readonly="readonlyFlag" :placeholder="'结束日期'" styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;" disabled="disabled"></datepicker>
</div>
</div>
<div class="control control-date" style="width: 100%; height:34px;overflow: inherit;" v-else>
<div style="width:44%;float:left;">
<datepicker :target.sync="search.dateStart | getYMD" :readonly="readonlyFlag" :placeholder="'开始日期'" styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;" disabled="disabled"></datepicker>
</div>
<span class="text-and">—</span>
<div style="width:48%;float:left;">
<datepicker :target.sync="search.dateEnd | getYMD" :readonly="readonlyFlag" :placeholder="'结束日期'" styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;" disabled="disabled"></datepicker>
</div>
</div>
</div>
</section>
<section class="group-row">
<div class="form-group w310">
<div class="control mar-none w310">
<input type="text" value="" id="cn1" v-rule placeholder="入库单号" class="w310" v-model="wvbillno" maxlength="20">
</div>
</div>
<div class="form-group w310">
<div class="mar-none w310">
<input type="text" value="" id="cn1" v-rule placeholder="商品信息" class="w310" v-model="goodname" maxlength="50">
</div>
</div>
</section>
<section class="group-row" v-if="LowerLevelMeds.showLowerLevelMeds == 'Y'">
<div class="form-group">
<div class="control select-style">
<select v-model="guid">
<option value="" selected>请选择医院</option>
<option :value="ite.guid" v-for="ite in LowerLevelMeds.LowerLevelMeds">{{ite.name}}</option>
</select>
</div>
</div>
</section>
<section class="group-row">
<div class="form-group fl w650">
<label class="label w80">发票状态</label>
<div class="control control-filtering control-filtering-green fl w280">
<a class="option" :class="{'all active':settleState==1}" href="javascript:void(0)" @click="settleState=1">全部</a>
<a class="option" :class="{'all active':settleState==2}" href="javascript:void(0)" @click="settleState=2">未开发票</a>
<a class="option" :class="{'all active':settleState==3}" href="javascript:void(0)" @click="settleState=3">已开发票</a>
</div>
<p class="fs-12 text-color-yellow lh-34 fl mr-30">(注:只有已开发票才能生成结算对账单)</p>
</div>
</section>
<section class="group-row">
<div class="form-group ">
<label class="label w80 fl">单据类型</label>
<div class="control control-filtering control-filtering-green fl w310">
<a class="option" :class="{'all active':billtype==''}" href="javascript:void(0)" @click="billtype=''">全部</a>
<a class="option" :class="{'all active':billtype=='04'}" href="javascript:void(0)" @click="billtype='04'">药品</a>
<a class="option" :class="{'all active':billtype=='01'}" href="javascript:void(0)" @click="billtype='01'">器械</a>
</div>
</div>
<button class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle fr" @click="query">查 询</button>
</section>
</div>
<p class="f-size18 mt-10">
<span class="text-color-blue">{{supname}}</span></p>
<p class="f-size14">
当前有<span class="f_blue">{{inVoiceList.length}}</span>
张入库单, 已选择<span class="f_blue">{{checkArrList.length}}</span>入库单,合计金额为<span class="f_blue">{{sumList | numDigit 2 | numFmt}}</span>元</p>
<!-- 结算单表格 -->
<div class="tab-section">
<div class="ctable ct-parent">
<div class="ct-head">
<span class="ct-col w80">
<div class="checkbox-control">
<input type="checkbox" :id="1" @click="selectAllsum(selectAllList)" v-model="selectAllList" :value="1">
<label class="checkbox" style="line-height: 19px;" :for="1">序号</label>
</div>
</span>
<span class="ct-col w110">医疗机构</span>
<span class="ct-col w80">入库日期 <span v-show="key=='goodscode'">{{order==1?'↑':'↓'}}</span>
</span>
<span class="ct-col w40"></span>
<span class="ct-col w90">入库单</span>
<span class="ct-col w90">供应商出库单</span>
<span class="ct-col w80">单据明细数</span>
<span class="ct-col w100">单据总金额(元)</span>
</div>
<div class="ct-row" id="warp{{$index}}" v-for='item in inVoiceList' track-by="$index">
<div class="row-line">
<span class="ct-col w80 cert-select cert-mini pt5">
<div class="checkbox-control">
<input type="checkbox" :id="item.guid +'/'+ item.rpiguid" v-model="checkArr" :value="item.guid +'/'+ item.rpiguid">
<label class="checkbox" :for="item.guid +'/'+ item.rpiguid">{{ $index + 1 }}</label>
</div>
</span>
<span class="ct-col w110 break-it t-left pr10">
{{item.medname}}
</span>
<span class="ct-col w80 break-it t-center pr10">
{{item.mvdate | getYMD}}
</span>
<span class="ct-col w40 break-it pr10">
<span v-if="item.rpiflag =='Y'" class="table-detail-icon icon-green fl ml-5" style="background: red; margin-top: 3px;">退</span>
</span>
<span class="ct-col w90 break-it pr10 t-left">
<span class="valid-date">
{{item.billno}}
</span>
</span>
<span class="ct-col w90 break-it t-left pr10">
<span class="com-name w200">{{item.supplierdobillno ==null?'- - -':item.supplierdobillno}}</span>
</span>
<span class="ct-col w80 isFocus" v-if="item.rpiflag =='Y'" @click="slidedown($index,item.rpiguid,item.rpiflag)"><a href="javascript:void(0);" class="txt_underline status-switch text-color-blue">{{item.countsum}}</a></span>
<span class="ct-col w80 isFocus" v-else @click="slidedown($index,item.guid,item.rpiflag)"><a href="javascript:void(0);" class="txt_underline status-switch text-color-blue">{{item.countsum}}</a></span>
<span class="ct-col w100 focus t-right" id="isFocus10">
{{item.detailsum | numDigit 2 | numFmt}}
</span>
</div>
<div class="row-launch" style='display:none;'>
<table class="itable">
<thead>
<tr>
<th class="w50">序号</th>
<th class="w150">商品信息</th>
<th class="w100">批号</th>
<th class="w100">入库金额(元)</th>
<th class="w120">发票号</th>
</tr>
</thead>
<tbody>
<tr v-if="inVoiceList[$index].mxList==null || inVoiceList[$index].mxList==0">
<td colspan="5">暂无符合条件的记录</td>
</tr>
<tr v-for='mx in item.mxList'>
<td>
{{$index+1}}
</td>
<td class="t-left pr10">
{{mx.purchaser_goodscode}}
<br><span class="text-color-blue">{{mx.purchaser_goodsname}}</span>
<br> {{mx.purchaser_goodsspec}}
<br>{{mx.registkey}}
<br>{{mx.manufacturer}}
</td>
<td class="t-left pr10">
{{mx.lot}}
<br> {{mx.productiondate| getYMD}}
<br> {{mx.expiredate | getYMD}}
</td>
<td class="t-right pr10">
{{mx.amount | numDigit 2 | numFmt}}
</td>
<td>{{mx.invoiceno}}</td>
</tr>
</tbody>
</table>
<div class="pagination hide" style="margin: 20px 0">
<pagination @page-change="gettrmedhvurs($index,cus.guid)" :class="['m-20-0']"
:page-no.sync="inVoiceList[$index].search.page"
:total-pages.sync="inVoiceList[$index].search.totalPages"></pagination>
</div>
<div class="zip" @click='slideup($index)'></div>
</div>
</div>
</div>
</div>
<div class="mt-20" style="text-align: center" v-if="inVoiceList.length==0">
未查询到相关数据!
</div>
<!--翻页-->
<!-- <pagination
@page-change="query"
:class="['m-20-0']"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages">
</pagination> -->
</div>
<!--purchase-return-goods end-->
</section>
</div>
<div class="step-btn">
<a href="javascript:;" @click='theNextSaveSettle'>下一步,生成结算单>></a>
</div>
</div>
<div class="purchase-return-goods" v-if="two">
<div class="step-tips step-3 clearfix">
<div class="step-item">
<span>1</span>选择入库单</div>
<div class="step-item active">
<span>2</span>生成结算单</div>
<div class="step-item">
<span>3</span>提交结算单</div>
</div>
<div class="purchase-month-plan">
<div class="fpart pd-form">
<div class="fheader no-bottom">
<h4 class="no-l-icon"> <span style='font-size:14px; color:#373737;'>结算对象:</span>{{supname}}</h4>
<a class="btn button-green icon submit fr" @click='submitSettle'>提交</a>
</div>
<div class="group-row">
<div class="form-group form-label">
<label for="cnn1" class="label">结算周期</label>
<div class="control">
<monthpickerdis :target.sync="search.planperiod1" :dates="date" id='cnn1' inpclass='inp4' @click.prevent="monthReckon1(search.planperiod1)"></monthpickerdis>
</div>
</div>
<div class="form-group form-label">
<div class="control control-date" style="height:34px;overflow: inherit;margin-left:0px;">
<div style="float:left;width:45%;">
<datepicker :target.sync="dateStart | getYMD" :readonly="readonlyFlag" :placeholder="'结束日期'" styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;" disabled="disabled"></datepicker>
</div>
<span class="text-and" style="width: 47px">—</span>
<div style="float:left;width:45%;">
<datepicker :target.sync="dateEnd | getYMD" :readonly="readonlyFlag" :placeholder="'结束日期'" styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;" disabled="disabled"></datepicker>
</div>
</div>
</div>
</div>
<div class="form-label">
<label for="content" class="label">备注</label>
<div class="control ">
<textarea rows="2" class="inp2" id="content" style='box-sizing: border-box;min-height:50px; padding-top: 4px;' v-model='remark'></textarea>
</div>
</div>
</div>
</div>
<div class="statistics" style='margin-top: 25px;margin-bottom:0px;'>
共<em>{{commodity.length}}</em>张入库单,<em>{{listNum}}</em>条明细,金额合计<em>{{listMon | numDigit 2 | numFmt}}</em>元
</div>
<div class="tab-section">
<div class="ctable ct-parent">
<div class="ct-head" id="t_header">
<span class="ct-col w90">序号</span>
<span class="ct-col w110">入库日期</span>
<span class="ct-col w40"></span>
<span class="ct-col w150">入库单</span>
<span class="ct-col w150">供应商出库单</span>
<span class="ct-col w150">单据明细数</span>
<span class="ct-col w150">单据总金额(元)</span>
<span class="ct-col w150">操作</span>
</div>
<div class="ct-row" id="ct-r0" v-for='item in commodity'>
<div class="row-line">
<span class="ct-col w90 cert-select cert-mini">
{{$index+1}}
</span>
<span class="ct-col w110 break-it t-center">
{{item.rkDate | getYMD}} <br> {{item.mvdate | getHMS}}
<!-- 2017-03-05 -->
</span>
<span class="ct-col w50 break-it t-center">
<span v-if="item.rpiflag =='Y'" class="table-detail-icon icon-green fl ml-5" style="background: red; margin-top: 3px;">退</span>
</span>
<span class="ct-col w150 break-it t-center">
<span class="valid-date break">
{{item.billNo}}
<!-- KYS0000512487 -->
</span>
</span>
<span class="ct-col w150 break-it t-center">
<span class="com-name break">
{{item.ckBillno ==null?'- - -':item.ckBillno}}
</span>
</span>
<span class="ct-col w150 text-color-blue" @click.stop='slidedown1($index);' style="text-decoration: underline;">
{{item.detailSum}}
<!-- 8 -->
</span>
<span class="ct-col w150 t-right" id="isFocus10">
{{item.count | numDigit 2 | numFmt}}
<!-- 6,8541元 -->
</span>
<span class="ct-col w150">
<a href="javascript:;" class="btn button-red" @click='deleteSettleWvs(item.rkguid)'>删除</a>
</span>
</div>
<div class="row-launch" id="row{{$index}}" style='display:none;'>
<h3>明细</h3>
<table class="itable">
<thead>
<tr>
<th class="w40">序号</th>
<th class="w200">商品信息</th>
<th class="w150">批号</th>
<th class="w150">入库金额(元)</th>
<th class="w150">发票号</th>
<th class="w100">操作</th>
</tr>
</thead>
<tbody>
<tr v-for='item2 in item.detailList'>
<td>{{$index+1}}</td>
<td class="t-left pr10">
{{item2.purchaserGoodscode}}
<br><span class="p-tit-green">{{item2.purchaseGoodsname}}</span>
<br>{{item2.purchaserGoodsspec}}
<br>{{item2.registkey}}
<br>{{item2.manufacturer}}
</td>
<td class="t-left pr10">
{{item2.lot}}
<br> {{item2.productiondate | getYMD}}
<br> {{item2.expiredate | getYMD}}
</td>
<td class="t-right pr10">
{{item2.purchaseSettleqty}} x {{item2.purchaserPrice}}
<br> {{item2.settleamount | numDigit 2 | numFmt}}
</td>
<td>{{item2.invoiceno}}</td>
<td>
<a href="javascript:;" class="btn button-red" @click='deleteSettleWvs(item2.guid,item2.rowno)'>删除</a>
</td>
</tr>
</tbody>
</table>
<div class="zip" @click='slideup1($index)'></div>
</div>
</div>
</div>
</div>
<div class="step-btn">
<a href="javascript:;" @click='returns'><<返回添加商品</a>
<a href="javascript:;" @click='submitSettle'>下一步,提交>></a>
</div>
</div>
<div class="purchase-month-plan" v-if="three">
<div class="step-tips step-3 clearfix">
<div class="step-item"><span>1</span>选择入库单</div>
<div class="step-item"><span>2</span>生成结算单</div>
<div class="step-item active"><span>3</span>提交结算单</div>
</div>
<div class="pmp-time-tit t-center">
医院结算单【{{finalJxNo}}】
提交成功!
</div>
<div class="stepok-tips t-center">
<p>
【{{finalJxNo}}】已发送给供应商【{{supname}}】
</p>
</div>
<div class="step-btn">
<a href="javascript:;" @click='Continue()'>继续制定</a>
<a href="javascript:;" @click='over()'>完 成</a>
</div>
</div>
</section>
</template>
<script>
module.exports = {
data: function() {
return {
supplyRelationList:[],
suppliername:'',
supname:'',
activeI:[],
inVoiceList: [],
search: {
dateStart: '',
dateEnd: '',
planperiod:'',
page: 1,
pageSize: 500,
totalPages: 1,
},
guid:'',
dateStart: '',
dateEnd:'',
settleState:3,
billtype:'',
totle: '',
settle: '',
supplierguid: '',
wvbillno: '',
goodname: '',
selectAllList: false,
checkArr:[],
checkArrList: '',
sumList:0,
one:true,
two:false,
three:false,
show:true,
commodity: {},
listNum:0,
listMon:0,
remark:'',
finalJxNo:'',
timesh:false,
date:'',
LowerLevelMeds:[],
noSubmit:false,//防止提交按钮重复点击
};
},
methods: {
selectAllsum: function(flag) {
var self = this;
self.checkArr = [];
if(!flag) {
self.inVoiceList.forEach(function(item, i) {
var data = item.guid + '/'+ item.rpiguid;
self.checkArr.push(data);
});
} else {
self.$set('checkArr', []);
self.inVoiceList.forEach(function(item, i) {
});
}
},
planPeriod: function() {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
month = (month < 10 ? "0" + month : month);
var mydate = (year.toString() + '年' + month.toString() + '月');
this.$set("search.planperiod", mydate);
this.monthReckon(mydate);
},
//月度计算器
monthReckon: function(planPeriod) {
var year = planPeriod.split("年");
var month = year[1].split("月");
//构造一个日期对象:
var day = new Date(year[0], month[0], 0);
//获取天数:
var daycount = day.getDate();
this.$set("search.dateStart", year[0] + "-" + month[0] + "-01");
this.$set("search.dateEnd", year[0] + "-" + month[0] + "-" + daycount);
},
//月度计算器
monthReckon1: function(planPeriod) {
var year = planPeriod.split("年");
var month = year[1].split("月");
//构造一个日期对象:
var day = new Date(year[0], month[0], 0);
//获取天数:
var daycount = day.getDate();
this.$set("dateStart", year[0] + "-" + month[0] + "-01");
this.$set("dateEnd", year[0] + "-" + month[0] + "-" + daycount);
},
//1 查询第二步是否有值
getWaitSettleWvsCount: function() {
var self = this;
Ajax.post('/hospitalTrsettle/getWaitSettleWvsCount',{})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
if(data > 0){
self.one =false;
self.two =true;
self.show =false;
self.getWaitSettleWvs();
}else{
self.one =true;
self.timesh = false;
self.two =false;
self.show =true;
self.getData();
self.checkArr = [];
self.selectAllList = [];
self.checkArrList = [];
}
}else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
});
},
//1 查询直供列表
getData: function() {
var self = this;
Ajax.post('/hospitalTrsettle/getSuppliers', {'suppliername': self.suppliername})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.$set('supplyRelationList',data) ;
self.getMed(0,data[0].supplierguid,data[0].suppliername);
}else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
getMed:function(indexI,supplierguid,suppliername){
var self =this;
self.activeI = indexI;
self.supplierguid = supplierguid;
self.supname = suppliername;
self.query();
},
//查询订单
query: function() {
var self = this;
var search = self.search;
self.inVoiceList={};
if(!self.supplierguid) {
self.MessageBox.alert('请选择供应商').then(function(action) {})
return;
}
if(!search.dateStart || !search.dateEnd) {
self.MessageBox.alert('请选择开始日期和结束日期').then(function(action) {})
return;
}
self.checkArr = [];
self.selectAllList = [];
self.checkArrList = [];
// 查询 结算单
Ajax.post('/hospitalTrsettle/getNotSettleRkInfo', {
'dateStart': search.dateStart,
'dateEnd': search.dateEnd,
'supplierguid': self.supplierguid,
'page': search.page,
'pageSize': search.pageSize,
'wvbillno': self.wvbillno,
'goodname': self.goodname,
'settleState':self.settleState,
'billtype':self.billtype,
'guid':self.guid,
})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.$set('inVoiceList',data.list);
self.search.pageNo = data.pageNo;
self.search.totalPages = data.totalPages;
self.search.total = data.total;
}else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
});
},
theNextSaveSettle: function() {
var self = this;
self.dateStart = self.search.dateStart;
self.dateEnd = self.search.dateEnd;
if(self.checkArrList.length == 0) {
self.MessageBox({
title: '提示',
message: '未选择数据!',
type: 'alert'
}, function(action) {
self.getWaitSettleWvsCount();
});
return;
}
Ajax.post('/hospitalTrsettle/theNextSaveSettle', {
'wvList': self.checkArrList,
'begindate': self.search.dateStart,
'enddate': self.search.dateEnd
}).
then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.checkArr = [];
self.selectAllList = [];
self.checkArrList = [];
self.one =false;
self.two =true;
self.getWaitSettleWvs();
} else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
slideup: function(index) {
$('#warp' + index).find(".row-launch").slideUp(400, function() {
$('#warp' + index).removeClass('active');
$('#warp' + index).find(".isFocus").removeClass("focus");
})
},
slidedown: function(index,guid,rpiflag) {
var clss = $("#warp" + index).attr("class");
if (clss.indexOf("active") != -1) {
this.slideup(index);
return;
}
this.gettrmedhvurs(index,guid,rpiflag);
$('#warp' + index).addClass("active");
$('#warp' + index).find(".row-launch").slideDown(400, function() {
$('#warp' + index).find(".isFocus").addClass("focus active");
})
},
// 品规格数目(手风琴效果)
gettrmedhvurs: function(index,guid,rpiflag) {
var self = this;
// var dpoObj = self.inVoiceList[index];
// if(dpoObj.search==null){
// // 设置每组的查询条件
// dpoObj.search = {
// pageSize:500,
// page: 1,
// pageNo: 1,
// totalPages: 0,
// guid:guid
// };
// }
// dpoObj.search.page = dpoObj.search.pageNo;
Ajax.post('/hospitalTrsettle/getNotSettleRkDetailInfo', {'guid':guid,'rpiflag':rpiflag})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.$set('inVoiceList[' + index + '].mxList', data);
// dpoObj.search.pageNo = data.pageNo;
// dpoObj.search.totalPages = data.totalPages;
// dpoObj.search.total = data.total;
// self.$set('inVoiceList['+index+'].search',dpoObj.search);
}else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
});
},
getWaitSettleWvs: function() {
var self = this;
var num = 0;
var mon = 0;
Ajax.post('/hospitalTrsettle/getWaitSettleWvs',{})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.$set('commodity',data);
self.date = data[0].detailList[0].begindate;
self.planPeriod1();
self.$set('supname',data[0].detailList[0].suppliername);
self.$set('supplierguid',data[0].detailList[0].supplierguid);
if(self.dateStart == '' || self.dateStart == null){
self.$set('dateStart',data[0].detailList[0].begindate);
}
if(self.dateEnd == '' || self.dateEnd == null){
self.$set('dateEnd',data[0].detailList[0].enddate);
}
for (var i = 0; i < self.commodity.length; i++) {
num += self.commodity[i].detailSum;
mon += self.commodity[i].count;
}
self.listNum= num;
self.listMon= mon;
if(self.commodity.length == 0){
self.one =true;
self.two =false;
}
}else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
});
},
planPeriod1: function() {
var date = new Date(this.date);
var year = date.getFullYear();
var month = date.getMonth() + 1;
month = (month < 10 ? "0" + month : month);
var mydate = (year.toString() + '年' + month.toString() + '月');
this.$set("search.planperiod1", mydate);
this.monthReckon1(mydate);
},
deleteSettleWvs: function(guid,rowno) {
var self = this;
Ajax.post('/hospitalTrsettle/deleteWaitSettleWvs',{'rkguid':guid,'rowno':rowno})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.MessageBox({
title: '提示',
message:'删除成功!',
type: 'alert'
}, function(action) {});
self.getWaitSettleWvsCount();
}else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
});
},
returns: function() {
var self = this;
self.checkArr = [];
self.selectAllList = [];
self.checkArrList = [];
self.supplyRelationList = [];
var itme ={
supplierguid:self.supplierguid,
suppliername:self.supname
}
self.search.dateStart = self.dateStart;
self.search.dateEnd = self.dateEnd;
self.supplyRelationList.push(itme);
// self.$set('supplyRelationList',itme);
self.getMed(0,self.supplierguid,self.suppliername);
self.query();
self.one =true;
self.two =false;
self.show= false;
self.timesh = true;
},
Continue: function() {
var self = this;
window.location.reload();
},
over: function() {
var self = this;
self.one =true;
self.three =false;
self.two =false;
self.$route.router.go('/settlementList');
},
submitSettle: function(guid,rowno) {
var self = this;
// if(self.remark == null || self.remark == ''){
// self.MessageBox({
// title: '提示',
// message: '请填写备注!',
// type: 'alert'
// }, function(action) {});
// return;
//
// layer.msg('请填写备注!')
//
// }
if(self.noSubmit){
return;
}
self.noSubmit = true;
Ajax.post('/hospitalTrsettle/submitSettle',{'remark':self.remark,'datestart':self.dateStart,'dateend':self.dateEnd})
.then(function(response) {
self.noSubmit = false;
var data = response.data.data;
if(response.data.errorCode == 0) {
self.finalJxNo = data;
self.three =true;
self.two =false;
self.remark = '';
}else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
});
},
slideup1:function(index){
$('#row' + index).slideUp(1000);
},
slidedown1:function(index){
var self=this;
$('#row' + index).slideDown(1000);
},
},
// 画面初始化
route: {
data: function() {
var self =this;
self.planPeriod();
self.checkArr = [];
self.selectAllList = [];
self.checkArrList = [];
this.getWaitSettleWvsCount();
this.suppliername='';
this.settleState=3;
this.one =true;
this.three =false;
this.two =false;
}
},
watch:{
'settleState':function(){
this.query();
this.settleStateFlag=false;
},
'billtype':function(){
this.query();
},
'guid':function(){
this.query();
},
'checkArr': function(val) {
var self = this;
console.log(val);
var arr, oList;
self.checkArrList = [];
for(let i = 0; i < val.length; i++) {
arr = val[i].split('/');
var item ={
guid:arr[0],
rpiguid:arr[1],
}
self.checkArrList.push(item);
}
if(self.checkArrList.length == 0){
self.selectAllList = false;
}
var sum =0;
for (var j = 0; j < self.inVoiceList.length; j++) {
for (var k = 0; k < self.checkArrList.length; k++) {
if(self.checkArrList[k].guid + self.checkArrList[k].rpiguid == self.inVoiceList[j].guid + self.inVoiceList[j].rpiguid){
sum += self.inVoiceList[j].detailsum;
}
}
}
self.sumList = sum;
}
}
};
</script>