新建
This commit is contained in:
133
public/assets/js/backend/junka_reject.js
Normal file
133
public/assets/js/backend/junka_reject.js
Normal file
@@ -0,0 +1,133 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'junka_reject/index' + location.search,
|
||||
add_url: 'junka_reject/add',
|
||||
edit_url: 'junka_reject/edit',
|
||||
del_url: 'junka_reject/del',
|
||||
multi_url: 'junka_reject/multi',
|
||||
import_url: 'junka_reject/import',
|
||||
table: 'junka_reject',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'store_id', title: __('Store_id')},
|
||||
{field: 'purchcard_log_id', title: __('Purchcard_log_id')},
|
||||
{field: 'notes', title: __('Notes'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'status', title: __('Status'), searchList: {
|
||||
0:__('未审核'),
|
||||
1:__('通过'),
|
||||
2:__('拒绝'),
|
||||
}, formatter: Table.api.formatter.status
|
||||
},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
examine: function () {
|
||||
Controller.api.bindevent();
|
||||
// 审核通过
|
||||
$(document).on('click', '#pass_reject', function () {
|
||||
var id = $(this).data('id');
|
||||
Layer.confirm('确认审核通过吗?已付款项将原路返回', {
|
||||
title:'操作提示',
|
||||
icon:0,
|
||||
btn:['确认', '取消']
|
||||
}, function () {
|
||||
loadindex = layer.load(2);
|
||||
$.ajax({
|
||||
'type': 'POST',
|
||||
'url': 'junka_reject/refundedit',
|
||||
data:{
|
||||
id:id,
|
||||
type:1,
|
||||
},
|
||||
success:function (res) {
|
||||
Layer.close(loadindex);
|
||||
if(res.code == 1) {
|
||||
Layer.msg(res.msg, {
|
||||
icon:1,
|
||||
time:1000,
|
||||
},function () {
|
||||
Layer.closeAll();
|
||||
parent.Layer.closeAll();
|
||||
parent.$(".btn-refresh").trigger("click");
|
||||
});
|
||||
}else {
|
||||
Layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 审核驳回
|
||||
$(document).on('click', '#no_reject', function () {
|
||||
var id = $(this).data('id');
|
||||
Layer.prompt({
|
||||
formType:0,
|
||||
title:'请输入驳回理由',
|
||||
btn:['确认', '取消'],
|
||||
},function (value) {
|
||||
loadindex = layer.load(2);
|
||||
$.ajax({
|
||||
'type': 'POST',
|
||||
'url': 'junka_reject/refundedit',
|
||||
data:{
|
||||
id:id,
|
||||
type:2,
|
||||
reject:value
|
||||
},
|
||||
success:function (res) {
|
||||
Layer.close(loadindex);
|
||||
if(res.code == 1) {
|
||||
Layer.msg(res.msg, {
|
||||
icon:1,
|
||||
time:1000,
|
||||
},function () {
|
||||
Layer.closeAll();
|
||||
parent.Layer.closeAll();
|
||||
parent.$(".btn-refresh").trigger("click");
|
||||
});
|
||||
}else {
|
||||
Layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
Reference in New Issue
Block a user