response-list-release.vue
12.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
<!--出库单汇总-->
<script>
module.exports = {
data: function () {
return {
fileType: 'file',
tagType: 'a',
med: 'response',
fileLabel: '选择文件',
// 导入之后信息提示
backMessage: {
showDialog: 'N',
mList: [], // 提示信息
},
// 明细数据
mxList: [],
hosList:[],
// 日期控件
readonlyFlag:false,
detailList:[],
subFlage:false,
shower2:false,
avatar: '',
};
},
methods: {
// 下载模板
downModel: function () {
var self = this;
window.open('/responseListReleaseImport.xlsx');
},
// 批量导入医疗机构商品
getBackTips: function (data) {
var self = this;
console.log(data);
if (data.resList.length != 0) {
// 返回信息
self.$set('backMessage.showDialog', 'Y');
self.$set('backMessage.mList', data.resList);
}
self.getData();
},
// 关闭信息提示弹出框
closeDialog: function () {
this.$set('backMessage.showDialog', 'N');
this.$set('backMessage.mList', []);
},
// 获取数据
getData:function(){
var self = this;
var self = this;
self.$set('mxList',[]);
Ajax.post('/supplier/getmfdemandpublist')
.then(function (response){
var data = response.data.data;
self.$set('mxList',data.mfdemandpublishs);
for (var i = 0; i < self.mxList.length; i++) {
self.mxList[i].uploadsimg = [];
}
})
},
// 删除数据
del:function(guid){
var self = this;
if(self.mxList.length == 0){
layer.msg('请导入数据!');
return;
}
var item = [];
if(guid == null){
for (var j = 0; j < self.mxList.length; j++) {
item.push(self.mxList[j].guid);
}
}else{
item.push(guid);
}
Ajax.post('/supplier/delMfdemandpublish',{'guids':item})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode == 0){
layer.msg('删除成功!');
self.getData();
}
})
},
// 发布数据
commitmfdemandpublist:function(guid){
var self = this;
if(self.mxList.length == 0){
layer.msg('请导入数据!');
return;
}
for (var i = 0; i < self.mxList.length; i++) {
var a = i + 1;
if(self.mxList[i].pictcontent == null){
layer.msg('请上传第'+ a +'的盖章附件!');
return;
}
}
var item = [];
if(guid == null){
for (var j = 0; j < self.mxList.length; j++) {
item.push(self.mxList[j].guid);
}
}else{
item.push(guid);
}
Ajax.post('/supplier/commitmfdemandpublist',{'guids':item})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode == 0){
self.getData();
layer.msg('发布成功!');
}
})
},
slidedown:function(index,guid,rowno){
var self = this;
$('#warp2' + index).find(".row-launch").slideDown(400, function () {
$('#warp2' + index).siblings().find(".row-launch").slideUp(400);
$('#warp2' + index).siblings().find(".isFocus").removeClass("focus");
$('#warp2' + index).find(".isFocus").addClass("focus active");
})
},
slideup:function(index){
$('#warp2' + index).find(".row-launch").slideUp(400, function () {
$('#warp2' + index).removeClass('active');
$('#warp2' + index).find(".isFocus").removeClass("focus");
})
},
//修改图片
setHeadImg:function(guid,uploadsimg){
console.log(guid,this.avatar);
var self = this;
Ajax.post('/supplier/addPictcontent',{'guid':guid,'pictcontent':uploadsimg})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode == 0){
self.getData();
}
})
},
},
route: {
activate: function () {
this.getData();
}
},
watch:{
},
};
</script>
<template>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix ">
<div class="operate-btns">
<a v-on:click="downModel" class="fbtn fb-download" style="margin-left: -10px;">下载模板</a>
<upload-excel :class="['fbtn fb-upload']" :tag="tagType" :type="fileType" :label="fileLabel"
:exceltype="med" v-on:file-change="getBackTips" v-if="mxList.length == 0"></upload-excel>
<a @click="del(null)" class="fbtn fb-remove">清空重新导入</a>
<a @click="commitmfdemandpublist(null)" class="fbtn fb-submit">发布</a>
</div>
<h3 class="current-module">医院物资需求发布</h3>
</div>
<div class="ctable ct-parent mt-20">
<div class="ct-head">
<span class="ct-col w60">序号</span>
<span class="ct-col w150">医院名称</span>
<span class="ct-col w120">发布时间</span>
<span class="ct-col w220">联系方式</span>
<span class="ct-col w120">品种数</span>
<span class="ct-col w120">盖章附件</span>
<span class="ct-col w200">操作</span>
</div>
<div class="t-center" v-if="mxList.length == 0" style="font-size: 16px;">请导入数据!</div>
<div class="ct-row mt-0 pt10" id="warp2{{$index}}" v-for="(one,cus) in mxList" track-by="$index">
<div class="row-line" v-else>
<span class="ct-col w60">{{$index+1}}</span>
<span class="ct-col w150 t-left pr10">{{cus.medname}}</span>
<span class="ct-col w120 pr10">{{cus.pubtime | getYMD}}</span>
<span class="ct-col w220 t-left pr10">
{{cus.contacts}} / {{cus.contactsdept}}
<br>
{{cus.tel}}
<br>
{{cus.address}}
<br>
</span>
<!-- <span class="ct-col w120 t-left pr10">{{cus.goodsname}}<br>{{cus.goodstype | goodscateresponse}}<br>{{cus.goodsspec}}<br>{{cus.executivestandard}}</span> -->
<!-- <span class="ct-col w80">{{cus.qty == 999999.99?'不限':cus.qty}}</span> -->
<span class="ct-col w120 activate isFocus">
<a href="javascript:;" @click="slidedown($index,cus.guid,cus.rowno)" class="txt_underline status-switch text-color-blue">{{cus.detailrecordsum}}</a>
</span>
<span class="ct-col w120 v-top t-center">
<imagebox v-bind:imgarr="cus.pictcontent | original" v-if="cus.pictcontent !=null">
<span class="cert-box big-imgs">
<img src="{{cus.pictcontent | thumbnail}}" width="100%" height="100%">
</span>
</imagebox>
<label v-else>暂无盖章附件</label>
</span>
<span class="ct-col w200">
<upload :model.sync="cus.uploadsimg" v-on:file-change="setHeadImg(cus.guid,cus.uploadsimg)">
<a class="btn-d btn-d-activate" title="重新上传">重新上传</a>
</upload>
<a class="btn-d btn-d-activate" @click="commitmfdemandpublist(cus.guid)">发布</a>
<a class="btn-d btn-d-activate" @click="del(cus.guid)">删除</a>
</span>
</div>
<div class="row-launch" style="display: none;">
<table class="itable mb-15">
<thead>
<tr>
<th class="w50">序号</th>
<th class="w120">物资名称</th>
<th class="w100">类别</th>
<th class="w100">数量</th>
<th class="w120">规格</th>
<th class="w120">执行标准</th>
<th class="w120">备注说明</th>
</tr>
</thead>
<tbody>
<tr v-if="shower2">
<td colspan="12">数据正在加载中...</td>
</tr>
<tr v-if="cus.mfdemandpublishdetails==null || cus.mfdemandpublishdetails.length==0&&!shower2">
<td colspan="12">暂无符合条件的记录</td>
</tr>
<tr v-for="(index,variation) in cus.mfdemandpublishdetails" v-if="!shower2">
<td >{{ $index + 1 }}</td>
<td>{{variation.goodsname}}</td>
<td>{{variation.goodstype | goodscateresponse}}</td>
<td>{{variation.qty == 999999.99?'不限':variation.qty}}</td>
<td>{{variation.goodsspec}}</td>
<td>{{variation.executivestandard}}</td>
<td>{{variation.note}}</td>
</tr>
</tbody>
</table>
<div class="zip" style="bottom: 0px;" @click="slideup($index)"></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; margin-left: 250px;">
<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" style="margin-left: 0px;">
<span class="control radio-control ">
<span>{{m}}</span>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>