hospital-repertory.vue
11.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
<!--医院对账单 - 列表-->
<template>
<div class="container resource close-left-menu">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a class="fbtn fb-download" @click='download'>导出</a>
</div>
<h3 class="current-module">库存流水账</h3>
</div>
<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 form-label">
<div class="control">
<input type="text" maxlength="17" v-rule v-model="search.billno" title='单据单号' placeholder="单据单号 "></div>
</div>
<div class="form-group form-label">
<div class="control">
<input type="text" maxlength="50" v-rule v-model="search.goodsinfo" title='商品名称、编号、厂商、注册证号'
placeholder="商品名称、编号、厂商、注册证号"></div>
</div>
</div>
<div class="group-row">
<div class="form-group form-label">
<!-- <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.startdate" :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 form-label">
<div class="control">
<input type="text" maxlength="20" v-rule v-model="search.resourcename" title='往来单位' placeholder="往来单位"></div>
</div>
</div>
<div class="group-row">
<div class="form-group form-label">
<label for="cn3" class="label">类型</label>
<div class="control">
<select v-model="search.billstate" id='cn3' class="inp2">
<option value="">请选择</option>
<option value="1">入库</option>
<option value="2">出库</option>
<option value="3">盘盈</option>
<option value="4">盘亏</option>
<option value="5">科室退货</option>
<option value="6">医院退货</option>
</select>
</div>
</div>
<div class="form-group form-label">
<label for="cn4" class="label">商品大类</label>
<div class="control">
<select v-model="search.goodscate" id='cn4' class="inp4">
<option value="">请选择</option>
<option v-for='item in goodscateList' :value="item.value">{{item.label}}</option>
</select>
</div>
</div>
</div>
<div class="group-row t-right">
<button v-on:click="getData(false)" class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle">查 询</button>
</div>
</div>
<table class="itable itable-td-long-text">
<thead id="t_header">
<tr>
<th class="w40">序号</th>
<th class="w80">单据信息</th>
<th class="w50">单据类型</th>
<th class="w100">商品</th>
<th class="w70">单价(元)</th>
<th class="w50">数量</th>
<th class="w100">金额(元)</th>
<th class="w70">往来单位</th>
<th class="w70">经手人</th>
<th class="w70">商品大类</th>
<th class="w70">批号效期</th>
<th class="w70">批次号</th>
</tr>
</thead>
<tbody class="txt_v">
<tr v-if="list.length==0">
<td colspan="15" >
暂无符合条件的记录
</td>
</tr>
<tr v-else v-for='item in list'>
<td class="v-top">{{$index+1}}</td>
<td class="t-left pr10 v-top">{{item.billno}}<br>{{item.inputdate | getYMD}}</td>
<td class="v-top">{{item.type | repertoryType}}</td>
<td class="t-left pl10 pr10 v-top">{{item.goodscode}}<br>{{item.goodsname}} <br> {{item.goodsspec}} <br>{{item.producer}} <br>{{item.registkey}}</td>
<td class="t-right v-top">{{item.price | numDigit 2 | numFmt}} </td>
<td class="v-top t-right">{{item.qty}}{{item.unitstyle}}</td>
<td class="t-right v-top pr10">{{item.price * item.qty | numDigit 2 | numFmt}} </td>
<td class="t-left v-top">{{item.resourcename}}</td>
<td class="v-top">{{item.operatername}}</td>
<td class="v-top">{{item.goodscate | GOODSCATE}}</td>
<td class="v-top t-left">{{item.lot}}<br>{{item.productiondate | getYMD}}<br><span class="text-color-yellow" v-if="sh[$index]">{{item.expiredate|getYMD}}</span>
<span v-else>{{item.expiredate|getYMD}}</span></td>
<td class="pr5 v-top t-left">{{item.stockbatchno}}</td>
</tr>
</tbody>
</table>
<pagination
@page-change="getData(true)" :class="['m-20-0']"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages">
</pagination>
</div>
</div>
</template>
<script >
module.exports = {
data: function () {
return {
list:[],
// 明细数据
mxList: [],
// 查询条件
search: {
pageSize: 50,
page: 1,
totalPages: 0,
total: 0,
billno: '',
goodsinfo:'',
billstate:'',
startdate: '',
enddate: '',
resourcename:'',
goodscate:''
},
sh:[],
readonlyFlag:false,
goodscateList: [{
value: '01',
label: '医疗器械'
}, {
value: '02',
label: '药品'
}, {
value: '03',
label: '后勤物资'
}, {
value: '04',
label: '消毒用品'
}, {
value: '05',
label: '洗涤用品'
}, {
value: '06',
label: '中药材'
}, {
value: '07',
label: '设施设备'
}, {
value: '08',
label: '其它'
}],
};
},
methods: {
// 获取当前时间和之前一个月时间
Date:function(){
var self = this;
// 结束日趋
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;
self.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;
self.search.startdate = yn+'-'+mn+'-'+dn;
},
getData: function (falg) {
var self = this;
self.list=[];
if(!falg){
self.search.page=1;
}
Ajax.post('/billType/findStockLedger', self.search)
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$set('list',data.list);
self.search.totalPages = data.totalPages;
self.search.total = data.total;
self.sh = [];
for(var a=0;a<data.list.length;a++){
self.sh.push(false);
var date1 = new Date();
var date2 = new Date(date1);
date2.setMonth(date1.getMonth()+6);
var times = date2.getFullYear()+"-"+(date2.getMonth()+1)+"-"+date2.getDate();
var mxListss = data.list[a];
//有效期
var mxLists = mxListss.expiredate;
var da1 = mxLists.replace(/\-/gi,"/");
var da2 = times.replace(/\-/gi,"/");
var time1 = new Date(da1).getTime();
var time2 = new Date(da2).getTime();
if(time1 <= time2){
self.sh.splice(a,1,true);
}
}
}
})
},
// 导出
download:function(){
var self = this;
Ajax.post('/billType/exportStockLedger', self.search)
.then(function (response){
var res = response.data;
// if(response.data.errorCode==0){
window.open(res);
// }
})
//
}
},
route: {
activate: function () {
this.Date();
this.getData(false);
}
},
};
</script>