stock-taking-create.vue
13.4 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
<template>
<div>
<div class="container resource close-left-menu">
<div class="pop-banner clearfix">
<div class="operate-btns">
</div>
<h3 class="current-module">制定盘点单</h3>
</div>
<div class="purchase-add-plan">
<div class="fpart pd-form">
<div class="fheader">
<h4 class="fh-shop">盘点单 <span class="f-size14">(请选择库房查询商品)</span> </h4>
<a href="javascript:;" class="btn button-green icon save fr" @click='addTrmedpdstock(1)'>保存</a>
<!-- <a class="btn button-green">明细</a> -->
</div>
<div class="group-row group-row-3">
<div class="form-group form-label">
<label for="cn1" class="label ">盘点单号</label>
<div class="control">
<input type="text" id="cn1" v-model="trmedplan.billno" readonly="readonly" class="inp4">
</div>
</div>
<div class="form-group form-label">
<label for="cn2" class="label ">录入员</label>
<div class="control">
<input type="text" id="cn2" v-model="trmedplan.operatername" readonly="readonly" class="inp5">
</div>
</div>
<div class="form-group form-label">
<label for="cn3" class="label">执行状态</label>
<div class="control">
<input type="text" id="cn3" :value="trmedplan.billstate | refundState" readonly="readonly" class="inp4">
</div>
</div>
</div>
<div class="group-row group-row-3">
<div class="form-group form-required form-label">
<label for="cn4" class="label">盘点日期</label>
<div>
<input type="text" id="cn4" :value="trmedplan.refunddate | getYMD" readonly="readonly" class="inp4">
</div>
</div>
<div class="form-group form-label">
<div class="control form-label">
</div>
</div>
<div class="form-group form-required form-label">
<select v-model="trmedplan.depotname" @change="getData()">
<option value="" style='display:none;' selected>请选择 库存</option>
<option :value="ite.hdeptname" v-for="ite in getDeptList">{{ite.hdeptname}}</option>
</select>
<!--<select v-model="trmedplan.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 form-label">
<label for="cn13" class="label">备注</label>
<div class="control">
<textarea id="cn13" v-model="trmedplan.memo" class="inp2" rows="1"></textarea>
</div>
</div>
</div>
<table class="itable itable-thead-13px itable-td-long-text">
<thead id="t_header">
<tr>
<th class="w50">序号</th>
<th class="w150"> 商品 </th>
<th class="w80">单价</th>
<th class="w80">单位</th>
<th class="w80">库存数量</th>
<th class="w100">金额(元)</th>
<th class="w100">批号效期</th>
<th class="w120">批次号</th>
<th class="w100">操作</th>
</tr>
</thead>
<tbody>
<tr v-if="queryStockList==null || queryStockList.length==0">
<td colspan="11">暂无符合条件的记录</td>
</tr>
<tr v-for='item in queryStockList' track-by="$index">
<td>
<div>{{$index+1}}</div>
</td>
<td class="t-left pr10 v-top">{{item.goodscode}}<br><span class="text-color-blue">{{item.goodsname}}</span><br>{{item.goodsspec}}<br>{{item.producer}}<br>{{item.registkey}}</td>
<td class="t-right v-top">{{item.price | numDigit 2 | numFmt}} </td>
<td>{{item.unitstyle}}</td>
<td>{{item.number}}</td>
<td class="t-right v-top pr10">{{item.price * item.number | numDigit 2 | numFmt}} </td>
<td class="t-left v-top">{{item.lot}}<br>
<span class="text-color-yellow" v-if="sh[$index]">{{item.expiredate|getYMD}}</span>
<span v-else>{{item.expiredate|getYMD}}</span>
</td>
<td class="t-left v-top">{{item.stockbatchno}}</td>
<td class="v-top">
<a href="javascript:;" class="btn button-red" @click='remove($index)'>删除</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal" v-if='modelFlag'>
<div class="container resource">
<div class="audit-detail" style="margin:200px auto;">
<span class="close-win" @click='close'></span>
<div class="fheader no-bottom" style="margin-left:100px;">
<h4 class="fh-book no-icon">盘点单[{{trmedplan.billno}}]已保存成功!</h4>
</div>
<div class="pd-form">
<a href="javascript:void(0);" class="button-green btn" style='margin:30px 0 0 200px;' @click='goOn'>继续制定盘点单</a>
</div>
</div>
</div>
</div>
</div>
<!--新加提示信息 end-->
<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>
</template>
<script>
module.exports = {
data: function() {
return {
getDeptList: '',
getDepartmentList: '',
modelFlag: false,
trmedplan: {
guid: '',
meddeptguid: '',
meddeptname: '',
medstoreguid: '',
depotname: '',
memo: '',
trmeddeptapply: {}
},
search: {
page: 1,
totalPages: 1,
pageSize: 50,
pageNo: 0,
depotguid: '',
},
queryStockList: '',
medname: '',
// 查询的商品列表
goodsList: [],
goodList: [],
state: false,
requestS:false,
sh:[],
};
},
methods: {
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) {});
}
})
},
close: function() {
var self = this;
self.modelFlag = false;
self.$router.go({
'path': '/stockTaking'
});
},
remove: function(index) {
var self = this;
self.queryStockList.splice(index, 1);
},
addTrmedpdstock: function(mark) {
var self = this;
self.getDeptList.forEach(function(item) {
if(item.hdeptname == self.trmedplan.depotname) {
self.trmedplan.depotguid = item.guid;
}
})
if(!self.trmedplan.depotname) {
self.MessageBox({
title: '提示',
message: '请选择库房',
type: 'alert'
})
return;
}
if(self.queryStockList.length == 0) {
self.MessageBox({
title: '提示',
message: '没有选择商品',
type: 'alert'
})
return;
}
var param = {
'depotguid': self.trmedplan.medstoreguid,
'memo': self.trmedplan.memo,
'bjmark': mark,
'list': self.queryStockList
}
self.requestS =true;
Ajax.post('/procurment/addTrmedpdstock', param)
.then(function(response) {
var res = response.data.data;
self.requestS =false;
if(response.data.errorCode == 0) {
self.trmedplan.billno = res;
self.modelFlag = true;
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
})
}
})
},
goOn: function() {
var self = this;
self.$set('queryStockList', [])
var tm = {
meddeptguid: '',
meddeptname: '',
medstoreguid: '',
depotname: '',
memo: '',
}
self.$set('trmedplan', tm);
self.modelFlag = false;
},
getData: function() {
var self = this;
self.getDeptList.forEach(function(item) {
if(item.hdeptname == self.trmedplan.depotname) {
self.trmedplan.medstoreguid = item.guid;
}
})
self.search.depotguid = self.trmedplan.medstoreguid;
Ajax.post('/procurment/pdqueryStockList', self.search).
then(function(response) {
var res = response.data.data;
if(response.data.errorCode == 0) {
self.$set('queryStockList', res);
self.sh = [];
for(var a=0;a<res.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 = res[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);
}
}
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function(action) {});
}
})
}
},
//
route: {
activate: function() {
this.goOn();
this.init();
}
},
watch: {
// 'trmedplan.depotname': function() {
//
// this.getData();
//
// }
}
};
</script>