init
Showing
1 changed file
with
52 additions
and
4 deletions
| ... | @@ -160,13 +160,61 @@ | ... | @@ -160,13 +160,61 @@ |
| 160 | layer_show('重置密码', '<?=site_url('perm/reset');?>'); | 160 | layer_show('重置密码', '<?=site_url('perm/reset');?>'); |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | function on_off(id) { | 163 | function freeze(id) { |
| 164 | layer.confirm('您确定要冻结/解冻这个员工账号吗?', { | 164 | layer.confirm('您确定要冻结这个员工账号吗?', { |
| 165 | btn: ['确认','取消'], | 165 | btn: ['确认','取消'], |
| 166 | title: '冻结/解冻', | 166 | title: '冻结', |
| 167 | icon: 3 | 167 | icon: 3 |
| 168 | }, function(){ | 168 | }, function(){ |
| 169 | layer.msg('冻结/解冻成功'); | 169 | $.ajax({ |
| 170 | type: 'put', | ||
| 171 | url: apiBaseUrl + 'system/user/freeze/' + id, | ||
| 172 | cache: false, | ||
| 173 | dataType: 'json', | ||
| 174 | data: JSON.stringify(data), | ||
| 175 | contentType: "application/json; charset=UTF-8", | ||
| 176 | success: function (data) { | ||
| 177 | if (data.msg) { | ||
| 178 | layer.alert(data.msg); | ||
| 179 | } else if (data.code != 0) { | ||
| 180 | layer.alert('操作失败'); | ||
| 181 | } else { | ||
| 182 | layer.msg('冻结成功'); | ||
| 183 | } | ||
| 184 | }, | ||
| 185 | error: function () { | ||
| 186 | layer.alert("请求失败") | ||
| 187 | } | ||
| 188 | }) | ||
| 189 | }); | ||
| 190 | } | ||
| 191 | |||
| 192 | function unfreeze(id) { | ||
| 193 | layer.confirm('您确定要解冻这个员工账号吗?', { | ||
| 194 | btn: ['确认','取消'], | ||
| 195 | title: '解冻', | ||
| 196 | icon: 3 | ||
| 197 | }, function(){ | ||
| 198 | $.ajax({ | ||
| 199 | type: 'put', | ||
| 200 | url: apiBaseUrl + 'manage/financial/confirm/' + id + '?realRepaymentDate=' + Date.now(), | ||
| 201 | cache: false, | ||
| 202 | dataType: 'json', | ||
| 203 | data: JSON.stringify(data), | ||
| 204 | contentType: "application/json; charset=UTF-8", | ||
| 205 | success: function (data) { | ||
| 206 | if (data.msg) { | ||
| 207 | layer.alert(data.msg); | ||
| 208 | } else if (data.code != 0) { | ||
| 209 | layer.alert('操作失败'); | ||
| 210 | } else { | ||
| 211 | layer.msg('解冻成功'); | ||
| 212 | } | ||
| 213 | }, | ||
| 214 | error: function () { | ||
| 215 | layer.alert("请求失败") | ||
| 216 | } | ||
| 217 | }) | ||
| 170 | }); | 218 | }); |
| 171 | } | 219 | } |
| 172 | 220 | ... | ... |
-
Please register or sign in to post a comment