commodity-push.vue
16.8 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
<!--医院对账单 - 列表-->
<template>
<div class="container resource close-left-menu">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a href="javascript:;" class="fbtn fb-upload ml-10" @click='pushs(true)'>批量推送</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">
<!-- <label for="cn1" class="label">结算单号</label> -->
<div class="control">
<input type="text" v-model="search.goodsname" title='商品名称' placeholder="商品名称" maxlength="50" ></div>
</div>
<div class="form-group form-label">
<label for="c18" class="label">商品大类</label>
<div class="control">
<select-ui :list="goodscateList" :selected.sync="search.goodscate" empty-text="请选择商品大类" id='c18' class='inp4'>
</select-ui>
</div>
</div>
</div>
<div class="group-row">
<div class="form-group form-label">
<!-- <label for="cn1" class="label">结算单号</label> -->
<div class="control">
<input type="text" v-model="search.producer" title='生产厂商' placeholder="生产厂商" maxlength="50" >
</div>
</div>
<div class="form-group form-label">
<label for="cc6" class="label">医院</label>
<div class="control">
<select v-model="search.medguid" class="inp2" @change="selectVal">
<option value="">请选择医院</option>
<option v-for="item in hosList" :value="item.value"> {{item.label}}</option>
</select>
</div>
</div>
</div>
<div class="group-row">
<div class="form-group">
<label class="label w70">生产来源</label>
<div class="control control-filtering control-filtering-green half" id="selState">
<a id="all_state" class="option" :class="{'active all':search.importedflag==''}"
@click="search.importedflag=''">全部</a>
<a id="y_state" class="option" :class="{'active all':search.importedflag=='2'}"
@click="search.importedflag='2'">进口</a>
<a id="s_state" class="option" :class="{'active all':search.importedflag=='1'}"
@click="search.importedflag='1'">国产</a>
</div>
</div>
</div>
<div class="group-row">
<button v-on:click="getData(true)" class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle fr">查 询</button>
</div>
</div>
<!-- <p class="f-size14">
当前有<span class="f_blue">{{inVoiceList.length}}</span>
张入库单, 已选择<span class="f_blue">{{checkArrList.length}}</span>入库单,合计金额为<span class="f_blue">{{sumList | numDigit 2 | numFmt}}</span>元</p> -->
<table class="itable itable-td-long-text">
<thead >
<tr>
<th class="w40" >
<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="w150">商品信息</th>
<th class="w100">通用名称</th>
<!-- <th class="w50">单据状态</th> -->
<th class="w60">商品大类</th>
<th class="w80">产地</th>
<th class="w150">指定医院</th>
<th class="w80">操作</th>
</tr>
</thead>
<tbody class="txt_v">
<tr>
<td colspan="11" v-if="mxList.length==0">
暂无符合条件的记录
</td>
</tr>
<tr v-for="po in mxList" v-if="mxList.length!=0">
<td class="v-top pt10">
<div class="checkbox-control">
<input type="checkbox" :id="po.suppliergoodsguid + '/'+ po.medguid" v-model="checkArr" :value="po.suppliergoodsguid+'/'+po.medguid">
<label class="checkbox" :for="po.suppliergoodsguid + '/'+ po.medguid">{{ $index + 1 }}</label>
</div>
</td>
<td class=" pr10 v-top">
{{po.goodscode}}<br>
<span class="p-tit-green">{{po.goodsname}}</span><br>
{{po.goodsspec}}<br>
{{po.producer}}<br>
{{po.registkey}}
</td>
<td class=" pr10 v-top">{{po.chemicalname}}</td>
<td class="v-top">{{po.goodscate | GOODSCATE}}</td>
<td class="v-top ">{{po.productionaddress}} </td>
<td class="v-top ">{{po.medname}}</td>
<td class="v-top ">
<div class="from-button">
<a href="javascript:;" class="green-button p-lr-10"
v-on:click="goDetail(po.suppliergoodsguid)">明细<i>|</i></a>
<a href="javascript:;" class="green-button p-lr-10"
v-on:click="push(po,true)">推送</a>
</div>
</td>
</tr>
</tbody>
</table>
<div class="pagination m-20-0">
<pagination
@page-change="getData(false)"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages">
</pagination>
</div>
<!--新加提示信息-->
<div class="modal " v-show="divbgShow">
<div class="container resource">
<div class="audit-detail"
style="width:300px; margin:300px auto; min-height: 170px; border:0; padding: 10px 0 0px; border-radius: 2px;">
<div class="sdiv-9-9b t-center text-color-gray f-size16" style="margin-left: 0; margin-right: 0; padding-bottom: 10px;">
指定业务员
</div>
<div class="t-center text-color-gray f-size14 mt-10">
<select v-model="getSupstaffGuid" class="w200" @change="selectname(getSupstaffGuid)">
<option value="">请选择业务员</option>
<option v-for="option in getSupstaffList" v-bind:value="option.value">
{{option.label}}
</option>
</select>
</div>
<a v-on:click="closeDialog()" class="btn button-green mt-15" style="margin-left: 115px;">确定</a>
</div>
</div>
</div>
<!--新加提示信息 end-->
<!--新加提示信息-->
<div class="modal " v-show="divbgShow1">
<div class="container resource">
<div class="audit-detail"
style="width:300px; margin:300px auto; min-height: 170px; border:0; padding: 10px 0 0px; border-radius: 2px;">
<div class="sdiv-9-9b t-center text-color-gray f-size16" style="margin-left: 0; margin-right: 0; padding-bottom: 10px;">
指定业务员
</div>
<div class="t-center text-color-gray f-size14 mt-10">
<select v-model="getSupstaffGuid" class="w200" @change="selectname(getSupstaffGuid)">
<option value=""> --请选择业务员--</option>
<option v-for="option in getSupstaffList" v-bind:value="option.value">
{{option.label}}
</option>
</select>
</div>
<a v-on:click="closeDialogs()" class="btn button-green mt-15" style="margin-left: 115px;">确定</a>
</div>
</div>
</div>
<!--新加提示信息 end-->
</div>
</div>
</template>
<script >
module.exports = {
data: function () {
return {
// 明细数据
mxList: [],
hosList: '',
// 查询条件
search: {
pageSize: 50,
page: 1,
totalPages: 0,
//total: 0,
goodsname: '',
goodscate: '',
producer: '',
importedflag: '',
medguid: '',
},
goodscateList: [{
value: '01',
label: '医疗器械'
}, {
value: '02',
label: '药品'
}, {
value: '03',
label: '后勤物资'
}, {
value: '04',
label: '消毒用品'
}, {
value: '05',
label: '洗涤用品'
}, {
value: '06',
label: '中药材'
}, {
value: '07',
label: '设施设备'
}, {
value: '09',
label: '营养制剂'
}, {
value: '08',
label: '其它'
}],
selectAllList: false,
checkArr:[],
divbgShow:false,
divbgShow1:false,
getSupstaffList:[],
getSupstaffGuid:'',
getSupstaffName:'',
goodsList:'',
goodsLists:[],
};
},
methods: {
// 获得供应关系中的医院
getMedList: function () {
var self = this;
Ajax.post('/supplierGood/getSupForMeds')
.then(function (response) {
var data = response.data;
if (data.errorCode == 0) {
self.hosList = _.map(data.data, function (item) {
return {
label: item.medname,
value: item.medguid
};
});
} else {
layer.msg('数据获取异常!');
}
})
},
getSupstaff: function () {
var self = this;
Ajax.post('/supplierGood/getSupstaff')
.then(function (response) {
var data = response.data;
if (data.errorCode == 0) {
self.getSupstaffList = _.map(data.data, function (item) {
return {
label: item.realname,
value: item.guid
};
});
} else {
layer.msg('数据获取异常!');
}
})
},
selectAllsum: function(flag) {
var self = this;
self.checkArr = [];
if(!flag) {
self.mxList.forEach(function(item, i) {
var data = item.suppliergoodsguid + '/' + item.medguid;
self.checkArr.push(data);
});
console.log(self.checkArr);
} else {
self.$set('checkArr', []);
self.mxList.forEach(function(item, i) {
});
}
},
push: function(list,flag) {
var self = this;
self.getSupstaffGuid = '';
self.getSupstaffName = '';
self.goodsList = '';
if(flag == true){
self.divbgShow = true;
self.goodsList = list;
}
},
pushs: function(flag) {
var self = this;
self.getSupstaffGuid = '';
self.getSupstaffName = '';
self.goodsList = '';
if(flag == true){
self.divbgShow1 = true;
}
},
//选择业务员
selectname: function (getSupstaffGuid) {
var self = this;
for (var i = 0; i < self.getSupstaffList.length; i++) {
if(getSupstaffGuid == self.getSupstaffList[i].value){
self.getSupstaffName = self.getSupstaffList[i].label;
}
}
},
getData: function (flag) {
var self = this;
if(flag){
self.search.page = 1;
}
self.checkArr = [];
self.selectAllList = [];
Ajax.post('/supplierGood/getAcceptSupplierGoods', {'page':self.search.page,'pageSize':self.search.pageSize,'goodsname':self.search.goodsname,'goodscate':self.search.goodscate,'producer':self.search.producer,'importedflag':self.search.importedflag,'medguid':self.search.medguid})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode == 0){
self.$set('mxList',data.list);
self.search.pageno = data.pageno;
self.search.totalPages = data.totalPages;
self.search.total = data.total;
}else {
self.MessageBox({
title: '警告',
message: data.message,
type: 'alert'
}, function(action) {});
}
})
},
// 关闭信息提示弹出框
closeDialog: function () {
var self = this;
self.goodsLists = [];
self.divbgShow = false;
var item = {
'staffguid':self.getSupstaffGuid,
'staffname':self.getSupstaffName,
'medguid':self.goodsList.medguid,
'suppliergoodsguid':self.goodsList.suppliergoodsguid
}
self.goodsLists.push(item);
Ajax.post('/supplierGood/addMedAcceptSupgoods', {'list': self.goodsLists}).
then(function(response) {
var data = response.data.data;
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) {
});
}
})
},
// 关闭信息提示弹出框
closeDialogs: function () {
var self = this;
self.divbgShow1 = false;
if(self.goodsLists.length == 0) {
self.MessageBox({
title: '提示',
message: '请选择数据!',
type: 'alert'
}, function(action) {});
return;
}
for (var i = 0; i < self.goodsLists.length; i++) {
self.goodsLists[i].staffguid = self.getSupstaffGuid;
self.goodsLists[i].staffname = self.getSupstaffName;
}
Ajax.post('/supplierGood/addMedAcceptSupgoods', {'list': self.goodsLists}).
then(function(response) {
var data = response.data.data;
if (response.data.errorCode == 0) {
self.MessageBox({
title: '提示',
message: '推送成功',
type: 'alert'
}, function (action) {
self.goodsLists = [];
self.getData();
});
} else {
self.MessageBox({
title: '提示',
message: response.data.message,
type: 'alert'
}, function (action) {
});
}
})
},
// 跳转到明细页面
goDetail:function(guid){
var self = this;
var type = 'cg';
self.$route.router.go('/productListDataDetail/'+guid);
},
},
watch: {
'checkArr': function(val) {
var self = this;
var arr, oList;
self.goodsLists = [];
for(let i = 0; i < val.length; i++) {
arr = val[i].split('/');
oList = {
'suppliergoodsguid': arr[0],
'medguid': arr[1],
}
self.goodsLists.push(oList);
}
if(self.goodsLists.length == 0){
self.selectAllList = false;
}
},
'search.importedflag':function(){
var self = this;
self.getData(true);
},
},
route: {
activate: function () {
this.getData(true);
this.getMedList();
this.getSupstaff();
},
}
};
</script>