requisition.vue
23.9 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
<template>
<div class="container resource close-left-menu">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a @click="print()" class="fbtn fb-Print2 ml-10 mr-10">打印分配单</a>
</div>
<h3 class="current-module">申领单出库汇总</h3>
</div>
<div class="pd-form fast-search-form">
<div class="group-row">
<div class="form-group">
<div class="control"><input type="text" maxlength="17" v-rule v-model="search.billno" placeholder='单据编号' title='单据编号'></div>
</div>
<!-- <div class="form-group">
<div class="control">
<select v-model="search.depotname">
<option value="" selected="" class="text-color-blue">请选择 出库库房</option>
<option :value="ite.hdeptname" v-for="ite in depotList">{{ite.hdeptcode}} - {{ite.hdeptname}}</option>
</select>
</div>
</div> -->
<div class="form-group form-label">
<div class="control control-hint" >
<input type="text" id="cn1" maxlength="10" v-rule v-model="search.deptname" @click='onStateGoods' title='申领科室' placeholder="申领科室" v-on:blur="blur">
<ul class="hint-list" v-show="stategoods" v-on:mouseover="over=1" v-on:mouseout="over=0" style="overflow-y: auto;max-height: 400px;">
<li v-for="ite in depList" @click="selectSupplier(ite)"><span>{{ ite.meddeptname }}</span></li>
<li v-if="depList.length == 0"><span>暂无数据!</span></li>
</ul>
</div>
</div>
</div>
<div class="group-row">
<div class="form-group form-label">
<div class="control control-date" style="height:34px;overflow: inherit;">
<div style="width:44%;float:left;">
<datepicker :target.sync="search.begindate" :readonly="readonlyFlag" placeholder="申领开始日期" title='申领开始日期' styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;"></datepicker>
</div>
<div class="text-and">至</div>
<div style="width:48%;float:left;">
<datepicker :target.sync="search.enddate" :readonly="readonlyFlag" title='申领结束日期' placeholder="申领结束日期" styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;"></datepicker>
</div>
</div>
</div>
<div class="form-group">
<div class="control"><input type="text" v-model="search.goodsinfo" placeholder='商品名称、编号、厂商、注册证号、助记码' title='商品名称、编号、厂商、注册证号、助记码'></div>
</div>
</div>
<div class="group-row">
<div class="form-group" style='width:560px;'>
<label class="label">单据状态</label>
<div class="control control-filtering control-filtering-green fl w450">
<a class="option" href="javascript:;" :class="{'all active':search.billstate==''}" v-on:click="search.billstate=''">全部</a>
<a class="option" href="javascript:;" :class="{'all active':search.billstate=='A05'}" v-on:click="search.billstate='A05'">已分配</a>
<a class="option" href="javascript:;" :class="{'all active':search.billstate=='A02'}" v-on:click="search.billstate='A02'">待分配</a>
<a class="option" href="javascript:;" :class="{'all active':search.billstate=='A04'}" v-on:click="search.billstate='A04'">分配中</a>
</div>
</div>
</div>
<div class="group-row t-right">
<button class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle" @click="getDates">查 询</button>
</div>
</div>
<div class="ctable ct-parent mt-20">
<div class="ct-head">
<span class="ct-col w80">序号</span>
<span class="ct-col w150">单据编号</span>
<span class="ct-col w100">出库库房</span>
<span class="ct-col w100">申领科室</span>
<span class="ct-col w60">品规数</span>
<span class="ct-col w100">申领日期</span>
<span class="ct-col w100">申领人</span>
<span class="ct-col w100">单据状态</span>
<span class="ct-col w100">备注</span>
<span class="ct-col w100">操作</span>
</div>
<!-- -->
<div class="ct-row mt-0" id="warp{{$index}}" v-for="cus in inVoiceList">
<div class="row-line">
<span class="ct-col w80 pt5">
<div class="control radio-control" v-if="cus.billstate=='A05'">
<input type="radio" id="radio1{{$index+1}}" name="radio1" v-model="checkHospitalGood" value="{{cus.billno}}" style="opacity: 0;" v-on:click="getSupDoods(cus.billno,cus.guid,cus.applydate)">
<label class="radio mr-0" for="radio1{{$index+1}}"> {{ $index + 1 }}</label>
</div>
<div class="control radio-control" v-else>
<input type="radio" id="radio1{{$index+1}}" name="radio1" v-model="checkHospitalGood" value="{{cus.billno}}" style="opacity: 0;">
<label class="radio1 mr-0"> {{ $index + 1 }}</label>
</div>
</span>
<span class="ct-col w150">{{cus.billno}}</span>
<span class="ct-col w100">{{cus.depotname}}</span>
<span class="ct-col w100 ">
{{cus.meddeptname}}
</span>
<span class="ct-col w60 activate isFocus"><a href="javascript:void(0);" @click="slidedown($index,cus.guid)" class="status-switch text-color-blue"> {{cus.detailrecordsum}} </a> </span>
<span class="ct-col w100 "> {{cus.applydate | getYMD}} </span>
<span class="ct-col w100 "> {{cus.operatername}} </span>
<span class="ct-col w100"> {{cus.billstate | applyStates}} </span>
<span class="ct-col w100 t-left"> {{cus.memo}} </span>
<span class="ct-col w100 ">
<a v-if="cus.billstate !='A05'" v-link="{path:'/distributionInventory'+'/'+cus.guid}" class="btn button-green">分配</a>
<a v-else class="btn button-green readonly-gray btn-d btn-d-activate pd0-20">分配</a>
</span>
</div>
<div class="row-launch" style="display: none;">
<table class="itable mb-30">
<thead>
<tr>
<th class="w40">序号</th>
<th class="w120">商品名称</th>
<th class="w80">规格</th>
<th class="w40">单位</th>
<th class="w60">最小单位</th>
<th class="w80">申领数量</th>
<th class="w80">库存数量</th>
</tr>
</thead>
<tbody>
<tr v-if="inVoiceList[$index].mxList==null || inVoiceList[$index].mxList==0">
<td colspan="12">暂无符合条件的记录</td>
</tr>
<tr v-for="variation in cus.mxList">
<td class="">
{{$index+1}}
</td>
<td class="t-left pr10">{{variation.goodsname}} </td>
<td class="t-left pr10">{{variation.goodsspec}} </td>
<td class="t-center pr10">{{variation.unit}} </td>
<td class="t-center pr10">{{variation.unit}} </td>
<td class="t-center">{{variation.applyqty}} </td>
<td class="t-center">
{{variation.stocknumber}}
<lable v-show="variation.flag =='Y'" class="table-detail-icon icon-green fr" style="background:red;">缺</lable>
</td>
</tr>
</tbody>
</table>
<div class="pagination" style="margin: 20px 0">
<pagination @page-change="getApplyDetailList($index,cus.guid)" :class="['m-20-0']" :page-no.sync="cus.search.pageNo" :total-pages.sync="cus.search.totalPages"></pagination>
</div>
<div class="zip" @click="slideup($index)"></div>
</div>
</div>
<div class="mt-20" style="text-align: center" v-if="inVoiceList.length==0">
未查询到相关数据!
</div>
<div class="pagination" style="margin: 20px 0">
<pagination @page-change="getDate" :class="['m-20-0']" :page-no.sync="search.page" :total-pages.sync="search.totalPages"></pagination>
</div>
</div>
<!--star 9-9 提示缺货信息列表-->
<div class="modal " :class="backMessage.showDialog=='Y'?'':'hide'" >
<div class="container resource">
<div class="audit-detail ml-0 w1003">
<span class="close-win" v-on:click="closeDialog()"></span>
<div class="sdiv-9-9b no-border pb0">
<p class="t-center">您有如下尚有未分配完成的明细,请填写原因并打印!</p>
</div>
<div class="status-process wbe-0 clearfix pd20">
<p style="color:#606f7a;font-size:14px;">
</p>
<div class="sp-head sp-headb mb-0" >
<div class="ctable ct-parentr mt-10" style="padding-top:0px; max-height: 350px; overflow-y: auto;">
<div class="ct-head">
<span class="ct-col w50">序号</span>
<span class="ct-col w200 t-center">单据单号</span>
<span class="ct-col w200 t-center">商品名称</span>
<span class="ct-col w100 t-center">规格</span>
<span class="ct-col w100 t-center">申领数</span>
<span class="ct-col w100 t-center">分配数</span>
<span class="ct-col w150 t-center">请选择原因</span>
</div>
<div class="ct-row" v-for="mx in backMessage.mList">
<div class="row-line">
<span class="ct-col w50 v-top">
{{$index+1 | getIndex}}
</span>
<span class="ct-col w200 t-left v-top">
<div class="p-lr-10 break fl w160">
{{mx.billno}}
</div>
</span>
<span class="ct-col w200 t-left v-top">
<span class="table-detail-text">
{{mx.goodsname}}
</span>
</span>
<span class="ct-col w100 t-center v-top">
<span class="table-detail-text">
{{mx.goodsspec}}
</span>
</span>
<!--缺货数-->
<span class="ct-col w100 t-center">
<span class="table-detail-text">
{{mx.applyqty}}
</span>
</span>
<span class="ct-col w100 t-center">
<span class="table-detail-text">
{{mx.assignedqty}}
</span>
</span>
<!-- 缺货原因 -->
<span class="ct-col w150 t-center pt0">
<select v-model="mx.memo">
<option value="库存不足" selected="" class="text-color-blue">库存不足</option>
<option value="临时取消" class="text-color-blue">临时取消</option>
<option value="其他" class="text-color-blue">其他</option>
</select>
</span>
</div>
</div>
</div>
<div class="w240" style="margin:0 auto;">
<button class="btn button-green fl mt-15" v-on:click="updateReason()">打 印</button>
<button class="btn button-green fr mt-15" v-on:click="closeDialog()">返回分配</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!--star 9-9 受理弹出-->
</template>
<script>
module.exports = {
data: function() {
return {
search: {
billno: '',
meddeptguid: '',
deptname:'',
goodsinfo: '',
begindate: '',
enddate: '',
billstate: '',
pageSize: 50,
page: 1,
totalPages: 0,
total: 0,
pageNo:0
},
search1: {
mvbillno: '',
pageSize: 5,
page: 1,
totalPages: 0,
total: 0,
pageNo:0
},
billno:'',
guid:'',
applydate:'',
inVoiceList: '',
depotList:'',
chGoodsList:[],
selectAllList:false,
backMessage:{
showDialog:'N',
mList:[],// 提示信息
},
memoList:[],
depList:'',
stategoods:false,
over:0,
};
},
methods: {
blur:function(){
if(this.over==false){
this.stategoods=false;
}
},
onStateGoods:function(){
var self = this;
self.getDeptList();
self.stategoods =true;
},
// 导出查询的数据结果出来
selectSupplier:function(data){
var self = this;
self.search.meddeptguid = data.meddeptguid;
self.search.deptname = data.meddeptname;
self.stategoods =false;
},
getDeptList: function () {
var self = this;
Ajax.post('/billType/getDeptList',{'deptname':self.search.deptname})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$set('depList',data);
}
})
},
//右侧商品列表
getSupDoods: function(billno,guid,applydate) {
var self = this;
self.billno = billno;
self.guid = guid;
self.applydate = applydate;
},
getDates: function() {
var self = this;
self.search.page =1;
self.getDate();
},
getDate: function() {
var self = this;
Ajax.post('/procurment/getApplyList', self.search)
.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;
console.log(self.inVoiceList);
} else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
// getDepotList: function() {
// var self = this;
// Ajax.post('/procurment/getDepotList', {})
// .then(function(response) {
// var data = response.data.data;
// if(response.data.errorCode == 0) {
// self.$set('depotList', data);
// } else {
// self.MessageBox({
// title: '警告',
// message: response.data.message,
// type: 'alert'
// }, function(action) {});
// }
// })
// },
print: function() {
var self = this;
self.printCheck();
},
printCheck: function() {
var self = this;
if(self.billno == null || self.billno ==''){
self.MessageBox({
title: '提示信息',
message: '请选择已分配的申领单!',
type: 'alert'
}, function(action) {});
return;
}
Ajax.post('/procurment/printCheck', {'billno':self.billno,'guid':self.guid})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
if(data.length == 0){
self.printTag();
}else{
self.$set('backMessage.showDialog','Y');
self.$set('backMessage.mList',data);
}
} else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
printTag: function() {
var self = this;
Ajax.post('/procurment/printTag', {'billno':self.billno,'applydate':self.applydate})
.then(function(response) {
var data = response.data.data;
window.open(data);
})
},
updateReason: function() {
var self = this;
for (var i =0; i < self.backMessage.mList.length; i++) {
var itme = {
slguid:self.backMessage.mList[i].slguid,
goodsguid:self.backMessage.mList[i].goodsguid,
memo:self.backMessage.mList[i].memo
}
self.memoList.push(itme);
}
Ajax.post('/procurment/updateReason', {'memoList':self.memoList})
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.closeDialog();
self.printTag();
} else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
// 关闭信息提示弹出框
closeDialog:function(){
var self = this;
this.$set('backMessage.showDialog','N');
this.$set('backMessage.mList',[]);
},
// 品规格数目(手风琴效果)
getApplyDetailList: function(index,guid) {
var self = this;
var dpoObj = self.inVoiceList[index];
if(dpoObj.search==null){
// 设置每组的查询条件
dpoObj.search = {
pageSize:5,
page: 1,
pageNo: 1,
totalPages: 0,
guid:guid
};
}
dpoObj.search.page = dpoObj.search.pageNo;
// self.search1.mvbillno = billno;
Ajax.post('/procurment/getApplyDetailLists', dpoObj.search)
.then(function(response) {
var data = response.data.data;
self.$set('inVoiceList[' + index + '].mxList', data.list);
dpoObj.search.pageNo = data.pageNo;
dpoObj.search.totalPages = data.totalPages;
dpoObj.search.total = data.total;
self.$set('inVoiceList['+index+'].search',dpoObj.search);
});
},
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) {
this.getApplyDetailList(index,guid);
$('#warp' + index).addClass("active");
$('#warp' + index).find(".row-launch").slideDown(400, function() {
$('#warp' + index).find(".isFocus").addClass("focus active");
})
},
},
watch:{
'search.billstate':function(){
var self = this;
self.getDate();
},
'search.deptname':function(){
var self = this;
self.getDeptList();
if(self.search.deptname == null || self.search.deptname == ''){
self.search.meddeptguid = '';
}
},
},
route: {
activate: function() {
// 结束日趋
var nowdate = new Date();
var y = nowdate.getFullYear();
var m = nowdate.getMonth()+1;
m=m<10?'0'+m:m;
var d = nowdate.getDate();
d=d<10?'0'+d:d;
this.search.enddate = y+'-'+m+'-'+d;
// 开始日期
nowdate.setMonth(nowdate.getMonth()-1);
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;
this.search.begindate = yn+'-'+mn+'-'+dn;
this.getDate();
// this.getDepotList();
this.getDeptList();
}
}
};
</script>