sup-users.vue
9.34 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
<!--出库登录:列表-->
<template>
<div>
<div class="container resource close-left-menu">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a v-on:click="downModel" class="fbtn fb-download">导出模板</a>
<upload-excel :class="['fbtn fb-upload']"
:tag="tagType"
:type="fileType"
:label="fileLabel"
:exceltype="supaccountImpl"
v-on:file-change="getBackTips"
style='vertical-align: top;'></upload-excel>
<a href="javascript:void(0)" class="fbtn fb-save" @click='save'>保存</a>
</div>
<h3 class="current-module">供应商账户</h3>
</div>
<!--start-->
<div class="operation-list clearfix">
<div class="search-result mt-0">
<div class="statistics">
您共有 <em>{{mfsuppliers.length}}</em>
家供应商,有 <em>{{mfSupplierStaffSum}}</em>
个供应商账户
</div>
</div>
<div>
<!--滚动-->
<!-- v-for="med in medList" -->
<div class="ctable ct-parent mb-40" >
<div class="ct-row table-no-border active" v-for='item in mfsuppliers'>
<div class="operation-list-top clearfix">
<div class="unit-img fl">
<h3>{{item.chinesename}}</h3>
</div>
</div>
<div class="row-launch mb-20">
<table class="itable itable-td-long-text itable-thead-13px">
<thead>
<tr>
<th class="w200">联系人</th>
<th class="w200">联系电话</th>
<th class="w300">详细地址</th>
</tr>
</thead>
<tbody>
<tr class="txt_v" :bind='ind=$index'>
<td>{{item.contacts}}</td>
<td>{{item.contacttel}}</td>
<td>{{item.address}}</td>
</tr>
</tbody>
</table>
</div>
<div class="row-launch">
<table class="itable itable-td-long-text itable-thead-13px">
<thead>
<tr>
<th class="w50">序号</th>
<th class="w80">是否是管理员</th>
<th class="w60">姓名</th>
<th class="w70">性别</th>
<th class="w100">登录账户</th>
<th class="w80">密码</th>
<th class="w80">手机号</th>
<th class="w160">操作</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="20" v-if="item.mfsupplierstaffs==null || item.mfsupplierstaffs.length==0">
暂无符合条件的记录
</td>
</tr>
<tr class="txt_v" v-for='item2 in item.mfsupplierstaffs'>
<td>{{$index+1}}</td>
<td>{{item2.roletype=='1'?'是':'否'}}</td>
<td>{{item2.realname}}</td>
<td>{{item2.sex==1?'男':'女'}}</td>
<td>{{item2.logonuser}}</td>
<td>{{item2.pwd}}</td>
<td>{{item2.mobiletel1}}</td>
<td>
<a class="btn button-red p-lr-10" @click='remove(item2.supplierstaffguid,item,ind,item2,$index)'>删除</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<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 button-green mar-none" 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">
<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>
<!-- <div class="modal" :class="backMessage.modal=='Y'?'':'hide'">
<div class="container resource">
<div class="audit-detail mt-50" style="width:200px;margin:0 auto;">
<span class="close-win" v-on:click="closeDialog()"></span>
<div class="sdiv-9-9b">
<a class="btn button-green mar-none" 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">
<span class="sp-col w300" >
<span class="control radio-control ">
<span>{{m}}</span>
</span>
</span>
</div>
</div>
<div class="sdiv9-9" style='margin:0px 20px;'>
<button v-on:click="closeDialog()" class="btn button-red mar-none mr-10">关闭</button>
</div>
</div>
</div>
</div> -->
</template>
<script>
module.exports = {
data: function () {
return {
fileType:'file',
tagType:'a',
fileLabel:'批量导入账户',
supaccountImpl:'supaccountImpl',
// 明细数据
medList: [],
// 订单总数量
totalNum:0,
billno:'',
mfsuppliers:[],
backMessage:{
showDialog:'N'
},
mfSupplierStaffSum:0
};
},
methods: {
// 清空临时表数据
getData:function(){
var self = this;
self.totalNum = 0;
self.$set('mfsuppliers',[]);
self.mfSupplierStaffSum = 0;
Ajax.post('/manageaccount/delmfsuppliertempAll')
.then(function (response){
var data = response.data.data;
})
},
// 下载模版
downModel:function(){
var self = this;
window.open ('https://obs.cn-north-1.myhwclouds.com/csylcloud-file/templet/SupAccountImpl.xls');
},
// 导入账户
getBackTips: function (data) {
var self = this;
if(data.mfsuppliers.length>=0){
self.mfsuppliers = data.mfsuppliers;
}
if(data.resList.length!=0){
// 返回信息
self.$set('backMessage.showDialog','Y');
self.$set('backMessage.mList',data.resList);
self.$set('mfSupplierStaffSum',data.mfSupplierStaffSum);
return ;
}
},
closeDialog:function(){
this.$set('backMessage.showDialog','N');
this.$set('backMessage.mList',[]);
window.location.reload();
// this.$set('backMessage.modal','N');
},
remove:function(guid,item,index,item2,index2){
var self = this;
self.MessageBox({
title:'提示',
message:'是否删除',
type:'alert',
showCancelButton: true
},function(action){
if(action=='confirm'){
Ajax.post('/manageaccount/delMfsuppliertemp',{'medstaffguid':guid,'mfSupplierStaffSum':self.mfSupplierStaffSum})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
layer.msg('删除成功');
for(var a=0;a<item.mfsupplierstaffs.length;a++){
if(item.mfsupplierstaffs[a].supplierstaffguid==guid){
self.mfsuppliers[index].mfsupplierstaffs.splice( index2,1)
self.$set('mfsuppliers',self.mfsuppliers);
self.$set('mfSupplierStaffSum',response.data.data);
break;
}
}
}else{
layer.msg('删除失败');
}
})
}
})
},
save:function(){
var self = this;
Ajax.post('/manageaccount/insertmfsupplie')
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
layer.msg('保存成功');
}else{
layer.msg(response.data.message);
}
})
}
},
route: {
activate: function () {
this.getData();
}
},
};
</script>