<a href="javascript:void(0);" class="j-user-quit tpl-table-black-operation-del"
data-id="<?= $item['clerk_id'] ?>"> 离职
</a>
<script id="tpl-update-delivery" type="text/template">
<div class="am-padding-top-sm">
<form class="form-update-delivery am-form tpl-form-line-form" method="post"
action="<?= url('shop.clerk/quit') ?>?quit_id={{ $data.quit_id }} ">
<div class="am-form-group">
<label class="am-u-sm-3 am-form-label ">店员列表 </label>
<div class="am-u-sm-9 am-u-end am-padding-top-xs">
<select name="clerk_id" data-am-selected="{btnSize: 'sm', maxHeight: 240}" >
{{ each $data.data}}
<option value="{{ $value.clerk_id }}" >{{ $value.real_name }}</option>
{{ /each }}
</select>
<div>
<small>店员离职,分配其名下店员</small>
</div>
</div>
</div>
</form>
</div>
</script>
$('.j-user-quit').click(function() {
var data = $(this).data();
var url = "<?= url('shop.clerk/quit') ?>?clerk_id="+data['id'];
$.get(url, {}, function (result) {
if(result.code === 1){
var show_data = []
show_data['quit_id'] = data['id'];
show_data['data'] = result.data
$.showModal({
title: '店员离职',
content: template('tpl-update-delivery', show_data),
yes: function() {
// 表单提交
$('.form-update-delivery').ajaxSubmit({
type: "post",
dataType: "json",
success: function(result) {
result.code === 1 ? $.show_success(result.msg, result.url) :
$.show_error(result.msg);
}
});
return true;
}
});
}else{
$.show_error(result.msg)
}
});
});