picking-confirm.vue
19.2 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
<template>
<div>
<div class="container resource close-left-menu">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a @click="updTrmeddeptdoList" class="fbtn fb-submit ml-10 mr-10">批量出库确认</a>
<a href="javascript:;" class="fbtn fb-Print2 ml-10 mr-10" @click='printCkd'>批量打印单据</a>
<a href="javascript:;" class="fbtn fb-Print2 ml-10 mr-10" @click='needlePrintCkd'>针式打印</a>
<a href="javascript:;" class="fbtn fb-upload" @click='listApplyDetaiExport'>导出</a>
</div>
<h3 class="current-module">拣货确认</h3>
</div>
<!--order-orderlist-view start-->
<div class="order-orderlist-view clearfix">
<div class="pd-form form-label4em mb-40 fast-search-form">
<div class="group-row">
<div class="form-group">
<div class="control">
<input type="text" maxlength="17" v-rule v-model="search.slbillno" title='单据编号' placeholder="单据编号">
</div>
</div>
<div class="form-group">
<div class="control select-style">
<select v-model="search.depotname">
<option value="" style='display:none;' selected>请选择 出库库房 </option>
<option :value="ite.hdeptname" v-for="ite in getDeptList">{{ite.hdeptname}}</option>
</select>
</div>
</div>
</div>
<div class="group-row">
<div class="form-group">
<div class="control select-style">
<input type="text" maxlength="17" v-rule v-model='search.ckbillno' title='出库编号' placeholder="出库编号">
</div>
</div>
<!--<div class="form-group">
<div class="control select-style">
<select v-model="search.meddeptname">
<option value="" style='display:none;' selected>请选择 申领科室 </option>
<option :value="ite.hdeptname" v-for="ite in getDepartmentList">{{ite.hdeptname}}</option>
</select>
</div>
</div>-->
<div class="form-group">
<div class="control control-hint" >
<input type="text" id="cn1" maxlength="10" v-rule v-model="search.meddeptname" @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 getDepartmentList" @click="selectDepartment(ite)"><span>{{ite.hdeptname}}</span></li>
<li v-if="getDepartmentList.length == 0"><span>暂无数据!</span></li>
</ul>
</div>
</div>
</div>
<div class="group-row">
<div class="form-group">
<!-- <label for="cn1" class="label">退货日期</label> -->
<div class="control control-date" style="height:34px;overflow: inherit;">
<div style="width: 44%;float: left">
<datepicker :target.sync='search.begindate' :readonly="readonlyFlag" title='退货开始日期' placeholder="拣货开始日期" styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;"></datepicker>
</div>
<span class="text-and" style="width: 45px">至</span>
<div style="width: 46%;float: right;">
<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>
<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=='YC1'}" v-on:click="search.billstate='YC1'">已分配</a>
<a class="option" href="javascript:;" :class="{'all active':search.billstate=='YC2'}" v-on:click="search.billstate='YC2'">已出库</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="getData">查 询</button>
</div>
</div>
<table class="itable itable-td-long-text">
<thead>
<tr>
<th class="w70">
<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>
</th>
<th class="w130">单据编号</th>
<th class="w130">出库库房</th>
<th class="w100">申领科室</th>
<th class="w80">品规数</th>
<th class="w100">申领日期</th>
<th class="w80">申领人</th>
<th class="w80">单据状态</th>
<th class="w100">金额(元)</th>
<th class="w100">备注</th>
<th class="w100">操作</th>
</tr>
</thead>
<tbody class="txt_v">
<tr v-if="getDeptApplyList==null || getDeptApplyList.length==0">
<td colspan="11">暂无符合条件的记录</td>
</tr>
<tr v-for="item in getDeptApplyList" v-else>
<td class="w30">
<div class="checkbox-control">
<input type="checkbox" :id="item.guid" v-model="checkArr" :value="item.guid+'/'+item.ckbillno+'/'+item.slbillno+'/'+item.slguid+'/'+item.billstate">
<label class="checkbox" :for="item.guid">{{ $index + 1 }}</label>
</div>
</td>
<td>{{item.slbillno}}</td>
<td>{{item.medstorename}}</td>
<td>{{item.meddeptname}}</td>
<td>{{item.detailrecordsum}}</td>
<td>{{item.applydate|getYMD}}</td>
<td>{{item.operatername}}</td>
<td>{{item.billstate|ckstate}}</td>
<td class="t-right">{{item.amount | numDigit 2 | numFmt}}</td>
<td>{{item.memo}}</td>
<td>
<a class="btn button-green" v-link="{path : 'pickingConfirmDetail/'+item.guid+'/'+item.ckbillno}">明细</a>
</td>
</tr>
</tbody>
</table>
<pagination @page-change="getData" :class="['m-20-0']" :page-no.sync="search.page" :total-pages.sync="search.totalPages">
</pagination>
</div>
<!--order-orderlist-view end-->
</div>
<!--新加提示信息 start -->
<div class="roll-bg" v-show='requestS'>
<div class="w60" style="margin:0 auto;">
<img src="/images/roll.gif">
</div>
<div class="container resource t-center text-color-red">
正在处理中,请勿关闭!
</div>
</div>
<!--新加提示信息 end-->
</div>
</template>
<script>
module.exports = {
data: function() {
return {
requestS:false,
search: {
page: 1,
totalPages: 1,
pageSize: 50,
pageNo: 0,
slbillno: '',
ckbillno: '',
depotname: '',
meddeptname: '',
begindate: this.GetDate().begindate,
enddate: this.GetDate().enddate,
billstate: '',
},
getDeptList: '', // 库房list
getDepartmentList: '', // 科室list
stategoods:false,
over:0,
getDeptApplyList: '',
checkArr: [], //导出
checkArrList: '',
selectAllList: false,
objP: [],
};
},
methods: {
blur:function(){
if(this.over==false){
this.stategoods=false;
}
},
onStateGoods:function(){
var self = this;
self.getDepartmentLists(true);
self.stategoods =true;
},
// 选择科室
selectDepartment:function(data){
var self = this;
self.search.meddeptname = data.hdeptname;
self.stategoods =false;
},
getDepartmentLists: function (flag) {
var self = this;
var params = {'hdeptname':self.search.meddeptname};
if(flag){
params = {'hdeptname':''};
}
Ajax.post('/procurment/getDepartmentList',params).
then(function(response) {
var res = response.data.data;
if(response.data.errorCode == 0) {
self.$set('getDepartmentList', res);
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
init: function() {
var self = this;
Ajax.post('/procurment/getDeptListOut').
then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.$set('getDeptList', data);
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
getData: function() {
var self = this;
self.checkArr = [];
self.selectAllList = [];
Ajax.post('/procurment/getDeptApplyList', self.search).
then(function(response) {
var res = response.data.data;
if(response.data.errorCode == 0) {
self.$set('getDeptApplyList', res.list);
self.search.pageNo = res.pageNo;
self.search.totalPages = res.totalPages;
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
listApplyDetaiExport: function() {
var self = this;
if(self.checkArrList.length == 0) {
self.MessageBox({
title: '提示',
message: '请勾选要出库的单据',
type: 'alert'
}, function(action) {});
return;
}
self.objP = [];
for(var i = 0; i < self.getDeptApplyList.length; i++) {
var oList = {
'guid': self.getDeptApplyList[i].guid,
'ckbillno': self.getDeptApplyList[i].ckbillno,
'slbillno': self.getDeptApplyList[i].slbillno,
'slguid': self.getDeptApplyList[i].slguid,
'billstate': self.getDeptApplyList[i].billstate
}
self.objP.push(oList)
}
//Ajax.post('/procurment/listApplyDetaiExport',{list:self.objP}).
Ajax.post('/procurment/listApplyDetaiExport',{list:self.checkArrList}).
then(function(response) {
window.open(response.data);
})
},
updTrmeddeptdoList: function() {
var self = this;
if(self.checkArrList.length == 0) {
self.MessageBox({
title: '提示',
message: '请勾选要出库的单据',
type: 'alert'
}, function(action) {});
return;
}
self.requestS = true;
Ajax.post('/procurment/updTrmeddeptdoList', {
list: self.checkArrList
}).
then(function(response) {
var res = response.data.data;
self.requestS = false;
if(response.data.errorCode == 0) {
self.MessageBox({
title: '提示',
message: '操作成功',
type: 'alert'
}, function(action) {});
self.getData();
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
printCkd: function() {
var self = this;
if(self.checkArrList.length == 0) {
self.MessageBox({
title: '提示',
message: '请勾选需要打印的单据',
type: 'alert'
}, function(action) {});
return;
}
Ajax.post('/procurment/printCkd', {
list: self.checkArrList
}).then(function(response) {
var res = response.data.data;
if(response.data.errorCode == 0) {
res.forEach(function(item, i) {
window.open(item);
});
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
needlePrintCkd: function() {
var self = this;
if(self.checkArrList.length == 0) {
self.MessageBox({
title: '提示',
message: '请勾选需要打印的单据',
type: 'alert'
}, function(action) {});
return;
}
Ajax.post('/procurment/printCkdZS', {
list: self.checkArrList
}).then(function(response) {
var res = response.data.data;
if(response.data.errorCode == 0) {
res.forEach(function(item, i) {
window.open(item);
});
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
},
selectAllsum: function(flag) {
var self = this;
self.checkArr = [];
if(!flag) {
self.getDeptApplyList.forEach(function(item, i) {
var data = item.guid + '/' + item.ckbillno + '/' + item.slbillno + '/' + item.slguid + '/' + item.billstate;
self.checkArr.push(data);
});
} else {
self.$set('checkArr', []);
self.getDeptApplyList.forEach(function(item, i) {
});
}
},
},
watch: {
'checkArr': function(val) {
var self = this;
var arr, oList;
self.checkArrList = [];
for(let i = 0; i < val.length; i++) {
arr = val[i].split('/');
oList = {
'guid': arr[0],
'ckbillno': arr[1],
'slbillno': arr[2],
'slguid': arr[3],
'billstate': arr[4]
}
self.checkArrList.push(oList)
}
if(self.checkArrList.length == 0){
self.selectAllList = false;
}
},
'search.billstate': function(val) {
this.getData();
},
'search.meddeptname':function(){
var self = this;
self.getDepartmentLists();
},
},
route: {
activate: function() {
this.init();
this.getData();
}
}
};
</script>