basicCard.vue
6.76 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
<template>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix">
<div class="operate-btns" v-if="modifyIcon">
<a class="fbtn fb-refresh" @click="getData">刷新</a>
<a class="fbtn fb-modify" @click="modify">修改</a>
</div>
<div class="read-btns ml-30" v-if="modifyIcon">
<a class="fbtn rb-remove">删除</a>
<a class="fbtn rb-save">保存</a>
</div>
<div class="operate-btns" v-else>
<a class="fbtn fb-refresh" @click="getData">刷新</a>
<a class="fbtn fb-modify" @click="modify">修改</a>
<a class="fbtn fb-remove" @click="remove">删除</a>
<a class="fbtn fb-save" @click="save">保存</a>
</div>
<h3 class="current-module">证照管理设置</h3>
</div>
<div class="basic-card-show">
<div class="hop-basic-con">
<div class="hop-basic-con-left">
<table class="itable itable-thead-13px" >
<thead>
<tr>
<th class="w60">序号</th>
<th class="w60">选择</th>
<th class="w130">证照类型 </th>
<th class="w150">证照名称 </th>
<th class="w100">到期提醒天数 </th>
</tr>
</thead>
<tbody v-for="item in SelectList" class="txt_v">
<tr>
<td>{{$index+1}}</td>
<td>
<div class="checkbox-control checkbox-alone" v-if="modifyIcon">
<input type="checkbox">
<label class="checkbox"></label>
</div>
<div class="checkbox-control checkbox-alone" v-else>
<input type="checkbox" :id="item.licensecode" v-model="item.checked">
<label class="checkbox" :for="item.licensecode"></label>
</div>
</td>
<td class="t-left pr10">
{{item.licensename}}
</td>
<td class="t-left">
{{item.licensename}}
</td>
<td class="td-yesorno td-code" v-if="modifyIcon">
<input type="number" readonly="readonly" v-model="item.expreminderdays">
</td>
<td class="td-yesorno td-code" v-else>
<input type="number" v-model="item.expreminderdays">
</td>
</tr>
</tbody>
</table>
</div>
<div class="hop-basic-con-right clearfix">
<div class="hop-basic-con-right2">
<h3 class="h-ti-h3-1">待选列表</h3>
<table class="itable basic-user-info data-inc-table data-ind-table basic-table">
<thead>
<tr>
<th class="w60">序号</th>
<th class="w120">证照类型</th>
<th class="w120">证照名称</th>
<th class="w120">操作</th>
</tr>
</thead>
<tbody class="txt_v">
<tr v-for='item in UnSelectList'>
<td>{{$index+1}}</td>
<td class="t-left pr10">{{item.licensename}}</td>
<td class="t-left">{{item.name}}</td>
<td>
<!-- <a class="btn-d btn-w60" :class='{"btn-d-activate":!item.isselect,"btn-disabled":item.isselect}'>
<span v-if="item.isselect">已添加</span>
<span @click="add(item.code)" v-else>添加</span>
</a> -->
<a class="btn button-gray w85" href="javascript:;" v-if="item.isselect">已添加</a>
<a class="btn button-green w85" href="javascript:;" @click="add(item.code)" v-else>添加</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
module.exports={
data: function(){
return {
modifyIcon:true,
SelectList:{},
UnSelectList:{},
}
},
methods: {
getData: function(){
var self = this;
// var url=self.ajaxUrl;
// var token=self.$store.state.user.token;
// $.ajax({
// url:url+'/hospital/licmanager/getUnSelectList'+token,
// data:'data'
// }};
self.$set('modifyIcon',true);
Ajax.post('/licmanager/getUnSelectList').then(function(response){
var res=response.data.data;
//待选列表
self.$set('UnSelectList',res);
});
Ajax.post('/licmanager/getSelectList').then(function(response){
var res=response.data.data;
//待选列表
self.$set('SelectList',res);
});
},
save: function () {
var self=this;
var data=JSON.stringify(self.SelectList);
Ajax.post('/licmanager/saveAll',data).then(function(response){
if(response.data.errorCode==0){
self.beg(response);
self.init();
layer.msg('保存成功!');
}
});
},
add:function(code){
var self=this;
Ajax.post('/licmanager/addSelect',{"code":code}).then(function(response){
self.beg(response);
});
},
remove:function(){
var arr=[];
var self=this;
for(var i=0;i<this.SelectList.length;i++){
if(self.SelectList[i].checked==1){
arr.push(self.SelectList[i]);
}
};
if(arr.length>0){
self.MessageBox({
title:'提示',
message:'是否删除',
type:'alert',
showCancelButton: true
},function(action){
arr=JSON.stringify(arr);
if (action=="confirm") {
Ajax.post('/licmanager/delSelect',arr).
then(function(response){
self.beg(response);
self.init();
})
}
})
}else{
layer.msg('删除至少需要一条数据');
}
},
beg:function(response){
var self=this;
var result=response.data;
if(result.errorCode==0){
self.getData();
}
},
modify:function(){
var self=this;
self.$set('modifyIcon',false);
},
init:function(){
var self=this;
self.modifyIcon=true;
}
},
route:{
activate : function(){
this.getData();
}
}
};
</script>