|
@@ -11,6 +11,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'selectpage', 'bootst
|
|
|
edit_url: 'protector/edit',
|
|
|
follow_url: 'protector/follow',
|
|
|
del_url: 'protector/del',
|
|
|
+ sign_url: 'protector/sign',
|
|
|
multi_url: 'protector/multi',
|
|
|
table: 'protector',
|
|
|
}
|
|
@@ -79,6 +80,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'selectpage', 'bootst
|
|
|
follow: function () {
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
+ sign: function () {
|
|
|
+ Controller.api.bindevent();
|
|
|
+ },
|
|
|
api: {
|
|
|
bindevent: function () {
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
@@ -146,23 +150,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'selectpage', 'bootst
|
|
|
},
|
|
|
// 签单
|
|
|
'click .btn-sign': function(e, value, row) {
|
|
|
- Layer.confirm('您确定签单吗?',function (index) {
|
|
|
- var id = row.id;
|
|
|
- $.ajax({
|
|
|
- url: 'protector/sign',
|
|
|
- type: 'post',
|
|
|
- data: { id:id },
|
|
|
- dataType: 'json',
|
|
|
- success: function success(res) {
|
|
|
- Layer.close(index);
|
|
|
- if(res.code == 1){
|
|
|
- Toastr.success(res.msg);
|
|
|
- $('.btn-refresh').click();
|
|
|
- } else {
|
|
|
- Toastr.error(res.msg);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ e.stopPropagation();
|
|
|
+ e.preventDefault();
|
|
|
+ var options = $(this).closest('table').bootstrapTable('getOptions');
|
|
|
+ var open = Fast.api.open(options.extend.sign_url + (options.extend.sign_url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk], __('Sign'), {
|
|
|
+ title: '签单',
|
|
|
+ maxmin: false
|
|
|
});
|
|
|
},
|
|
|
// 再次保护
|