order-dispose.vue
21.3 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
<!--订单受理:列表-->
<script>
module.exports = {
data: function() {
return {
sysdate: '',
sysdate2: '',
sysdate3: '',
sysdate4: '',
billno: '', // 采购订单编号
// 业务数据
ywdata: {
ywtag: '', // 操作的类型:单一处理,批量处理
ywguid: '', // 业务guid
ywchecked: '', // 选中哪一个
predeliverdate: '', // 时间
ywdate: '' // 选择的时间
},
trpoList: [], // 批量处理的对象数组
// 明细数据
medList: [],
// 订单总数量
totalNum: 0,
// 查询条件
search: {
billstate: this.ctns.pobillstatep02,
page: 50
},
// 数据传输
postdata: {},
};
},
methods: {
initData: function() {
var now = new Date();
this.sysdate = this.formDate(now);
now.setDate(now.getDate() + 1);
this.sysdate2 = this.formDate(now);
now.setDate(now.getDate() + 1);
this.sysdate3 = this.formDate(now);
},
exportTrmedplan: function(billno) {
var self = this;
self.search.billno = billno;
Ajax.get('/trpo/exportTrPoSl', this.search)
.then(function(response) {
var data = response.data;
window.open(data);
})
},
// 获取数据
getData: function() {
var self = this;
self.totalNum = 0;
Ajax.get('/trpo/listMed', this.search)
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.$set('medList', data);
// 循环加载明细
for(var index = 0; index < self.medList.length; index++) {
// 查看医院的采购订单
self.getTrsupplierByMed(index);
}
} else {
}
})
},
// 医院的采购订单
getTrsupplierByMed: function(index) {
var self = this;
var medObj = self.medList[index];
var medguid = medObj.guid;
if(medObj.search == null) {
// 设置每组的查询条件
medObj.search = {
search_EQ_billstate: this.ctns.pobillstatep02,
search_EQ_medguid: medguid,
pageSize: 50,
page: 1,
totalPages: 0,
};
}
Ajax.get('/trpo/listTrsupplier', medObj.search)
.then(function(response) {
var data = response.data;
if(data.errorCode == 0) {
self.$set('medList[' + index + '].supplierpos', data.data.list);
medObj.search.pageno = data.data.pageno;
medObj.search.totalPages = data.data.totalPages;
medObj.search.total = data.data.total;
self.$set('medList[' + index + '].search', medObj.search);
// 总计数量
// self.$set('totalNum',data.data.total);
self.calNum();
} else {
return;
}
});
},
// 跳转到订单受理详情页面
goTRDetail: function(billno) {
var self = this;
self.$route.router.go('/trpo/orderDispose2/' + billno);
},
// 确定处理
doState: function(tag) {
var self = this;
// self.ywdata.planenddate = self.ywdata.planenddate;
// 批量处理:按医院批量受理采购订单
if("duoge" == tag) {
self.MessageBox({
title: '提示',
message: "您确认受理该医院所有采购订单吗?",
type: 'success',
showCancelButton: true
}, function(action) {
if(action == 'confirm') {
self.postdata.list = self.trpoList;
Ajax.post('/trpo/dostateByhospital/', self.postdata)
.then(function(response) {
var data = response.data.data;
// 重新刷新页面
self.MessageBox({
title: '提示',
message: data.split("@")[1],
type: 'alert'
}, function(action) {
// 首先关闭弹出框
self.closeDialog('duoge');
self.getData();
self.calNum();
});
})
return;
}
});
} else { // 处理单个
self.MessageBox({
title: '提示',
message: "您确认受理该采购订单吗?",
type: 'success',
showCancelButton: true
}, function(action) {
if(action == 'confirm') {
Ajax.post('/trpo/dostateByGuid', self.ywdata)
.then(function(response) {
var data = response.data.data;
// 重新刷新页面
self.MessageBox({
title: '提示',
message: data.split("@")[1],
type: 'alert'
}, function(action) {
var billno = self.billno;
self.$route.router.go('/trpo/orderDispose3/' + billno);
});
})
return;
}
});
}
},
// 展示单个订单受理的页面
showDialog: function(guid, billno, ywtag) {
var self = this;
// 设置当前的弹出框的一些属性
self.$set('ywdata.ywtag', ywtag);
self.$set('ywdata.ywguid', guid);
self.$set('ywdata.ywchecked', 1);
self.$set('ywdata.ywdate', self.sysdate);
self.$set('ywdata.planenddate', '')
self.$set('billno', billno); // 用于单一处理的时候
$("#" + ywtag).attr("class", "modal");
// 如果是批量处理
if(ywtag == 'duoge') {
Ajax.get('/trpo/listAllTrsupplierByMed/' + self.ywdata.ywguid)
.then(function(response) {
var data = response.data;
if(data.errorCode == 0) {
self.$set('trpoList', data.data);
// 批量处理的时候,需要默认配送时间为当天
for(var indexJ = 0; indexJ < self.trpoList.length; indexJ++) {
// 默认当天
self.$set('trpoList[' + indexJ + '].ywchecked', '1');
self.$set('trpoList[' + indexJ + '].ywdate', self.sysdate);
}
} else {
layer.msg('获取数据异常!');
}
})
}
},
// 关闭单个订单
closeDialog: function(dialogId) {
this.ywguid = "";
$("#" + dialogId).attr("class", "modal hide");
},
// 计算总的明细数目
calNum: function() {
var self = this,sum = 0,flag = true;
self.totalNum = 0;
for(var index = 0; index < self.medList.length; index++) {
var item = this.medList[index];
//存在没有值的情况
if(!(item && item.search && item.search.total)){
flag = false;
}
}
for(var index = 0; index < self.medList.length; index++) {
if(flag){
sum += this.medList[index].search.total;
}
}
self.$set('totalNum', sum);
},
// 初始化时间
formDate: function(day) {
var Year = 0;
var Month = 0;
var Day = 0;
var CurrentDate = "";
//初始化时间
Year = day.getFullYear(); //ie火狐下都可以
Month = day.getMonth() + 1;
Day = day.getDate();
CurrentDate += Year + "-";
if(Month >= 10) {
CurrentDate += Month + "-";
} else {
CurrentDate += "0" + Month + "-";
}
if(Day >= 10) {
CurrentDate += Day;
} else {
CurrentDate += "0" + Day;
}
return CurrentDate;
}
},
route: {
activate: function() {
this.initData();
this.getData();
}
},
watch: {
// 判断选择的日期
'ywdata.ywchecked': function(val) {
var self = this;
if('duoge' == self.ywdata.ywtag) {
// 批量处理的时候,需要默认配送时间为当天
for(var indexJ = 0; indexJ < self.trpoList.length; indexJ++) {
// 默认当天
self.$set('trpoList[' + indexJ + '].ywchecked', self.ywdata.ywchecked);
}
} else {
// 需要处理全选
if(self.ywdata.ywchecked == 4) {
// self.ywdata.planenddate = self.ywdata.planenddate;
} else if(self.ywdata.ywchecked == 1) { // 今天
self.ywdata.predeliverdate = self.sysdate;
} else if(self.ywdata.ywchecked == 2) { // 明天
self.ywdata.predeliverdate = self.sysdate2;
} else if(self.ywdata.ywchecked == 3) { // 后天
self.ywdata.predeliverdate = self.sysdate3;
}
}
},
// 计划配送日期:
'ywdata.ywdate': function(val) {
var self = this;
if('duoge' == self.ywdata.ywtag) {
// 批量处理的时候,需要默认配送时间为当天
for(var indexJ = 0; indexJ < self.trpoList.length; indexJ++) {
// 默认当天
self.$set('trpoList[' + indexJ + '].ywchecked', self.ywdata.ywchecked);
self.$set('trpoList[' + indexJ + '].predeliverdate', val);
}
}
}
}
};
</script>
<style scoped>
.status-process .sp-head>.sp-col{
height: 100%;
}
</style>
<template>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix">
<div class="operate-btns"></div>
<h3 class="current-module">订单受理</h3>
</div>
<!--start-->
<div class="operation-list clearfix">
<div class="search-result mt-0">
<div class="statistics">
您共有 <em class='fW'>{{medList.length}}</em> 家医院有 <em class='fW'>{{totalNum}}</em> 张订单还待受理
</div>
</div>
<div>
<!--滚动-->
<div class="ctable ct-parent mb-20" v-for="med in medList">
<div class="ct-row table-no-border active">
<div class="operation-list-top clearfix">
<div class="unit-img fl">
<!--
<img src="">
-->
<imagebox v-bind:imgarr="med.pictcontent | original">
<span class="pic-max blue-search">
<img v-bind:src="med.pictcontent | thumbnail">
</span>
</imagebox>
<h3>{{med.name}}
<span class="tips-count">
有
<em>{{med.search.total}}</em>
张订单待受理
</span>
</h3>
</div>
<div class="fr mr-10">
<a v-on:click="showDialog(med.guid,'','duoge')"
v-if="'/supplier/trpo:doState' | myqx"
class="btn button-green">全部受理</a>
</div>
</div>
<!--分页控件-->
<div class="row-launch bgc-gray-f5 pd0 mt-20">
<table class="itable itable-td-long-text itable-thead-13px">
<thead>
<tr>
<th class="w50">序号</th>
<th class="w80">采购订单</th>
<th class="w70">是否优先</th>
<th class="w100">要求到货日期</th>
<th class="w110">医院</th>
<th class="w70">单据类型</th>
<th class="w70">操作人</th>
<th class="w60">品规数</th>
<th class="w60">备注</th>
<th class="w120">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="trpo in med.supplierpos" >
<td>{{$index+1}}</td>
<td class="t-left pr10">{{trpo.billno}}</td>
<td>{{trpo.firstflag | firstflag}}</td>
<td>{{trpo.planenddate | getYMD}}</td>
<td class="t-left pr10">{{med.name}}</td>
<td>{{trpo.billtype | billtype}}</td>
<td>{{trpo.operatername}}</td>
<td>{{trpo.countsum}}</td>
<td>{{trpo.memo}}</td>
<td>
<!-- <a v-on:click="showDialog(trpo.guid,trpo.billno,'dange')"
v-if="'/supplier/trpo:doState' | myqx"
class="btn-d btn-d-activate">受理</a>
<a v-on:click="goTRDetail(trpo.billno)" class="btn-d btn-d-activate">明细</a> -->
<div class="from-button">
<a v-on:click="showDialog(trpo.guid,trpo.billno,'dange')"
v-if="'/supplier/trpo:doState' | myqx" class="green-button p-lr-10 f-size14">受理<i>|</i></a>
<a v-on:click="goTRDetail(trpo.billno)" class="green-button p-lr-10 f-size14">明细</a>
</div>
</td>
</tr>
</tbody>
</table>
<div class="pagination page-line">
<pagination v-if="medList[$index].supplierpos!=null && medList[$index].supplierpos.length!=0"
@page-change="getTrsupplierByMed($index)"
:page-no.sync="medList[$index].search.page"
:total-pages.sync="medList[$index].search.totalPages">
</pagination>
</div>
</div>
</div>
</div>
</div>
</div>
<!--star 9-9 受理弹出-->
<!--批量受理的时候弹出框-->
<div id="duoge" class="modal hide ">
<div class="container resource">
<div class="audit-detail"
style="width:700px; margin: 100px auto;">
<span class="close-win" v-on:click="closeDialog('duoge')"></span>
<div class="sdiv-9-9b">
<a class="btn button-green" href="javascript:;">全部订单受理</a>
</div>
<div class="status-process wbe-0 clearfix pd20" style="padding-top:0px;">
<p style="color:#606f7a;font-size:14px;">
请选择送货日期</p>
<div class="sp-head" style="height:70px;">
<span class="sp-col sp-col4 w100 " style='line-height:20px;'>
全部订单<br/>
</span>
<span class="sp-col w130">
<span class="control radio-control ">
<input type="radio" id="radio1" name="radio"
value="1" v-model="ywdata.ywchecked">
<label class="radio mr-0" for="radio1" style="line-height:20px;">
<span>{{sysdate}} <br> (今天送货) </span>
</label>
</span>
</span>
<span class="sp-col w130" >
<span class="control radio-control ">
<input type="radio" id="radio02" name="radio"
value="2" v-model="ywdata.ywchecked">
<label class="radio mr-0" for="radio02" style="line-height:20px;">
<span>{{sysdate2}} <br> (明天送货) </span>
</label>
</span>
</span>
<span class="sp-col w130" >
<span class="control radio-control ">
<input type="radio" id="radio03" name="radio"
value="3" v-model="ywdata.ywchecked">
<label class="radio mr-0" for="radio03" style="line-height:20px;">
<span>{{sysdate3}} <br> (后天送货) </span>
</label>
</span>
</span>
<span class="sp-col w130" style='vertical-align:middle;'>
<span class="control radio-control ">
<input type="radio" id="radio04" name="radio"
value="4" v-model="ywdata.ywchecked">
<label class="radio mr-0" for="radio04" style="line-height:20px;">
其他日期
</label><br>
</span>
<datepicker v-if="ywdata.ywchecked=='4'" :target.sync="ywdata.predeliverdate | getYMD" ></datepicker>
<datepicker v-if="ywdata.ywchecked!='4'" ></datepicker>
</span>
</div>
<div class="sp-head sp-headb2" v-for="dtrpo in trpoList">
<span class="sp-col sp-col4 w100" style='line-height:20px;'>
{{dtrpo.billno}}
</span>
<span class="sp-col w130" >
<span class="control radio-control ">
<input type="radio" id="radio1_{{$index}}" name="radio1_{{$index}}"
value="1" v-model="dtrpo.ywchecked">
<label class="radio mr-0" for="radio1_{{$index}}" style="line-height:20px;">
<span>{{sysdate}} <br> (今天送货)</span>
</label>
</span>
</span>
<span class="sp-col w130" >
<span class="control radio-control ">
<input type="radio" id="radio2_{{$index}}" name="radio2_{{$index}}"
value="2" v-model="dtrpo.ywchecked">
<label class="radio mr-0" for="radio2_{{$index}}" style="line-height:20px;">
<span>{{sysdate2}} <br> (明天送货) </span>
</label>
</span>
</span>
<span class="sp-col w130" >
<span class="control radio-control ">
<input type="radio" id="radio3_{{$index}}" name="radio3_{{$index}}"
value="3" v-model="dtrpo.ywchecked">
<label class="radio mr-0" for="radio3_{{$index}}" style="line-height:20px;">
<span>{{sysdate3}} <br> (后天送货) </span>
</label>
</span>
</span>
<span class="sp-col w130" style='vertical-align:top; '>
<span class="control radio-control ">
<input type="radio" id="radio4_{{$index}}" name="radio4_{{$index}}"
value="4" v-model="dtrpo.ywchecked">
<label class="radio mr-0" for="radio4_{{$index}}" style="line-height:20px;"> 其他日期 </label>
<br>
</span>
<div class="form-group form-label">
<datepicker v-if="ywdata.ywchecked=='4'" :target.sync="dtrpo.predeliverdate | getYMD" ></datepicker>
<datepicker v-if="ywdata.ywchecked!='4'" :target.sync="" ></datepicker>
</div>
</span>
</div>
<div class="sdiv9-9" >
<button v-on:click="doState('duoge')" class="btn button-green">确定</button>
<button v-on:click="closeDialog('duoge')" class="btn button-red">关闭</button>
</div>
</div>
</div>
</div>
</div>
<!--star 9-9 受理弹出-->
<!--star 9-9 受理弹出-->
<!--单个订单受理弹出框-->
<div id="dange" class="modal hide">
<div class="container resource">
<div class="audit-detail"
style="width:540px; margin:100px auto;">
<span class="close-win" v-on:click="closeDialog('dange')"></span>
<div class="sdiv-9-9b"
style="">
<a class="btn button-green" href="javascript:;">单个订单受理</a>
</div>
<div class="status-process wbe-0 clearfix pd20" style="padding-top:0px;">
<p style="color:#606f7a;font-size:14px;">
请选择送货日期</p>
<div class="sp-head sp-headb" >
<span class="sp-col w300" >
<span class="control radio-control ">
<input type="radio" id="radio_d_01" name="radio_d"
value="1" v-model="ywdata.ywchecked">
<label class="radio mr-0" for="radio_d_01" style="line-height:20px;">
<span>{{sysdate}} (今天送货) </span>
</label>
</span>
</span>
</div>
<div class="sp-head sp-headb" >
<span class="sp-col w300" >
<span class="control radio-control ">
<input type="radio" id="radio_d_02" name="radio_d"
value="2" v-model="ywdata.ywchecked">
<label class="radio mr-0" for="radio_d_02" style="line-height:20px;">
<span>{{sysdate2}} (明天送货) </span>
</label>
</span>
</span>
</div>
<div class="sp-head sp-headb" >
<span class="sp-col w300" >
<span class="control radio-control ">
<input type="radio" id="radio_d_03" name="radio_d"
value="3" v-model="ywdata.ywchecked">
<label class="radio mr-0" for="radio_d_03" style="line-height:20px;">
<span>{{sysdate3}} (后天送货) </span>
</label>
</span>
</span>
</div>
<div class="sp-head sp-headb" style="height: auto;">
<span class="sp-col w300" >
<span class="control radio-control ">
<input type="radio" id="radio_d_04" name="radio_d"
value="4" v-model="ywdata.ywchecked">
<label class="radio mr-0 fl" for="radio_d_04" style="line-height:20px;">其他日期</label>
<div class="form-group form-label w180 fl pl10">
<datepicker v-if="ywdata.ywchecked=='4'" :target.sync="ywdata.planenddate | getYMD" ></datepicker>
<datepicker v-if="ywdata.ywchecked!='4'" ></datepicker>
</div>
</span>
</span>
</span>
</div>
<div class="sdiv9-9">
<button v-on:click="doState('dange')" class="btn button-green">确定</button>
<button v-on:click="closeDialog('dange')" class="btn button-red">关闭</button>
</div>
</div>
</div>
</div>
</div>
<!--star 9-9 受理弹出-->
</div>
</template>