supply-list-revise.vue
10.1 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
<template>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a @click="exportsuppliergoodsPO" class="fbtn fb-export-goods ml-10 mr-10">导出商品</a>
<a @click="downModel" class="fbtn fb-export-modifyTem ml-20">导出修改模板</a>
<upload-excel :class="['fbtn fb-setting']" :tag="tagType" :type="fileType" :label="fileLabel" :exceltype="updGoodsImp" v-on:file-change="getBackTips"></upload-excel>
</div>
<h3 class="current-module">商品清单</h3>
</div>
<!--supply-productlist start-->
<div class="supply-productlist clearfix">
<div class="pd-form fast-search-form" style="padding:10px;">
<div class="group-row">
<div class="form-group">
<div class="control">
<input type="text" id="cn1" maxlength="50" v-rule v-model="search.search_LIKE_searchtxt" placeholder="商品编码、名称、厂商、注册证号" title="商品编码、名称、厂商、注册证号">
</div>
</div>
<div class="form-group">
<label for="cn1" class="label" style="width:60px;">业务状态</label>
<div class="control control-filtering control-filtering-green" style="width:390px;">
<a class="{{ stateAll }}" href="javascript:void(0);" @click="bizState('3')">全部</a>
<a class="{{ stateYes }}" href="javascript:void(0);" @click="bizState('1')">有效</a>
<a class="{{ stateNo }}" href="javascript:void(0);" @click="bizState('0')">失效</a>
<a class="{{ stateNY }}" href="javascript:void(0);" @click="bizState('2')">停用</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>
<div class="search-result">
<div class="statistics">您当前共有<em class="b">{{total}}</em>个商品</div>
</div>
<table class="itable itable-thead-13px itable-td-long-text">
<thead id='t_header'>
<tr>
<th class="w50">
<div class="checkbox-control fl">
<input type="checkbox" :id="1" @click="selectAllsum(selectAllList)" v-model="selectAllList" :value="1">
<label class="checkbox mr-0 ml-5" style="line-height: 19px;" :for="1"></label>
</div>
序号
</th>
<th class="w70">商品编号</th>
<th class="w140">商品名称</th>
<th class="w100">招标平台编码</th>
<th class="w140">生产厂商</th>
<th class="w130">注册证号</th>
<!--<th class="w50">生产来源</th>-->
<!--<th class="w70">产地</th>-->
<th class="w50">业务状态</th>
<th class="w70">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="hospitalProduct in hospitalProductList">
<td>
<div class="checkbox-control">
<input type="checkbox" :id="hospitalProduct.guid+$index" v-model="checkArr" :value="hospitalProduct.guid">
<label class="checkbox" :for="hospitalProduct.guid+$index">{{$index + 1 | getIndex}}</label>
</div>
</td>
<td class="t-left pr10">{{hospitalProduct.goodscode}}</td>
<td class="t-left pr10">{{hospitalProduct.goodsname}}<br>{{hospitalProduct.unitstyle}}
<br>{{hospitalProduct.minunitqty}}{{hospitalProduct.minunitstyle}}</td>
<td class="t-left pr10">{{hospitalProduct.tenderplatformcode}}</td>
<td class="t-left pr10">{{hospitalProduct.producer}}</td>
<td>{{hospitalProduct.registkey}}</td>
<!--<td>{{hospitalProduct.importedflag | IMPORTEDFLAG}}</td>-->
<!--<td>{{hospitalProduct.productionaddress}}</td>-->
<td v-bind:class="{'' : hospitalProduct.bizstate == ctns.bizstatey}" v-if="hospitalProduct.bizstate == ctns.bizstatey">{{hospitalProduct.bizstate | BIZSTATE}}</td>
<td v-bind:class="{'text-color-red' : hospitalProduct.bizstate != ctns.bizstatey}" v-if="hospitalProduct.bizstate != ctns.bizstatey">{{hospitalProduct.bizstate | BIZSTATE}}</td>
<td class="pt5">
<a class="btn button-green mar-none" v-link="{path: '/supplyProductview/' + hospitalProduct.guid}">明细</a>
</td>
</tr>
</tbody>
</table>
<pagination @page-change="getData(false)" :class="['m-20-0']" :page-no.sync="search.page" :total-pages.sync="search.totalPages"></pagination>
</div>
<div class="modal" :class="backMessage.modal=='Y'?'':'hide'">
<div class="resource" style='margin: 0 auto;width: 1003px;'>
<div class="audit-detail mt-50" style="width:540px;margin:0 auto;">
<span class="close-win" v-on:click="close()"></span>
<div class="sdiv-9-9b">
<a class="btn-d btn-d-activate btn-d-lg" href="javascript:;">信息提示</a>
</div>
<div class="status-process wbe-0 clearfix pd20 mr-10" style="padding-top:0px;height: 200px;overflow: auto;">
<div class="sp-head sp-headb" v-for="m in backMessage.list" track-by='$index'>
<span class="sp-col" style='width:400px;margin-left:50px;'>
<span class="control radio-control ">
<span>{{m}}</span>
</span>
</span>
</div>
</div>
<div class="sdiv9-9" style='margin:0 20px;'>
<button v-on:click="close()" class="btn-d btn-d-activate btn-d-lg">关闭</button>
</div>
</div>
</div>
</div>
<!--star 9-9 弹出导入提示信息-->
<div class="modal " :class="backMessage.showDialog=='Y'?'':'hide'">
<div class="container resource">
<div class="audit-detail" style="width:540px;">
<span class="close-win" v-on:click="closeDialog()"></span>
<div class="sdiv-9-9b">
<a class="btn-d btn-d-activate btn-d-lg" href="javascript:;">导入信息提示</a>
</div>
<div class="status-process wbe-0 clearfix pd20" style="padding-top:0px;">
<div class="sp-head sp-headb" v-for="m in backMessage.mList" track-by="$index">
<span class="sp-col w300">
<span class="control radio-control ">
<span>{{m}}</span>
</span>
</span>
</div>
</div>
<div class="sdiv9-9">
<button v-on:click="closeDialog()" class="btn button-red mar-none">关闭</button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
module.exports = {
data: function() {
return {
fileType: 'file',
tagType: 'a',
updGoodsImp: 'updGoodsImp',
fileLabel: '批量修改商品 ( 请使用模板 ) ',
hospitalProductList: [],
stateAll: 'all active',
stateNo: 'option',
stateYes: 'option',
stateNY: 'option',
search: {
pageSize: 50,
page: 1,
totalPages: 0,
search_LIKE_searchtxt: '',
search_EQ_bizState: '',
search_EQ_medguid: '',
},
medGuid: '',
total: 0,
backMessage: {
modal: 'N',
list: []
},
checkArr: [], //导出
checkArrList: '',
selectAllList: false,
backMessage: {
showDialog: 'N'
},
};
},
methods: {
bizState: function(flag) {
var self = this;
if(flag == 3) {
self.$set('stateAll', "all active option");
self.$set('stateNo', "option");
self.$set('stateYes', "option");
self.$set('stateNY', "option");
self.$set('search.search_EQ_bizState', '');
} else if(flag == 1) {
self.$set('stateAll', "option");
self.$set('stateNo', "option");
self.$set('stateYes', "all active option");
self.$set('stateNY', "option");
self.$set('search.search_EQ_bizState', "Y");
} else if(flag == 0) {
self.$set('stateAll', "option");
self.$set('stateNo', "all active option");
self.$set('stateYes', "option");
self.$set('stateNY', "option");
self.$set('search.search_EQ_bizState', "E");
} else if(flag == 2) {
self.$set('stateAll', "option");
self.$set('stateNY', "all active option");
self.$set('stateYes', "option");
self.$set('stateNo', "option");
self.$set('search.search_EQ_bizState', "S");
}
self.getData();
},
getData: function(isRefresh) {
var self = this;
if(isRefresh) {
this.search.page = 1;
}
Ajax.post('/supplyProduct/supplyProductList', this.search)
.then(function(response) {
var data = response.data.data;
if(response.data.errorCode == 0) {
self.$set('hospitalProductList', data.list);
self.search.totalPages = data.totalPages;
self.total = data.total;
self.medGuid = self.$store.state.user.curUser.medguid;
} else {
layer.msg(response.data.message);
}
})
},
close: function() {
this.$set('backMessage.modal', 'N');
},
// 导出商品清单 zxx
exportsuppliergoodsPO: function() {
var self = this;
if(!self.checkArrList){
layer.msg('请选择要导出的商品');
return;
}
Ajax.post('/hospital/exportMfMedgoodsList', {
list: self.checkArrList
})
.then(function(response) {
var data = response.data;
window.open(data);
})
},
selectAllsum: function(flag) {
var self = this;
if(!flag) {
self.$set('checkArr', []);
self.hospitalProductList.forEach(function(item, i) {
var data = item.guid;
self.checkArr.push(data);
});
} else {
self.$set('checkArr', []);
}
},
// 批量导入医疗机构商品
getBackTips: function(data) {
var self = this;
console.log(data)
if(data.iGoodsList.length >= 0) {
self.goodList = data.iGoodsList;
}
if(data.resList.length != 0) {
// 返回信息
self.$set('backMessage.showDialog', 'Y');
self.$set('backMessage.mList', data.resList);
return;
}
},
closeDialog: function() {
this.$set('backMessage.showDialog', 'N');
this.$set('backMessage.mList', []);
this.getData(true);
},
downModel: function() {
var self = this;
// 如果是医院端,后边传参数med
window.open('https://obs.myhwclouds.com/csylcloud-file/templet/HosGoodImp.xls');
},
},
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],
}
self.checkArrList.push(oList)
}
},
},
route: {
activate: function() {
this.getData(true);
}
}
};
</script>