|
@@ -11,6 +11,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
del_url: 'cannelorder/del',
|
|
|
multi_url: 'cannelorder/multi',
|
|
|
import_url: 'cannelorder/import',
|
|
|
+ confirm_amount_url: 'cannelorder/confirm_amount',
|
|
|
+ confirm_refund_url: 'cannelorder/confirm_refund',
|
|
|
table: 'user_cancel_order',
|
|
|
}
|
|
|
});
|
|
@@ -93,7 +95,52 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
title: __('Operate'),
|
|
|
table: table,
|
|
|
events: Table.api.events.operate,
|
|
|
- formatter: Table.api.formatter.operate
|
|
|
+ formatter: Table.api.formatter.operate,
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ name: 'confirm_amount',
|
|
|
+ title: __('确认清点金额'),
|
|
|
+ classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
+ icon: 'fa fa-leaf',
|
|
|
+ url: 'cannelorder/confirm_amount',
|
|
|
+ visible: function (row) {
|
|
|
+ //重点在这
|
|
|
+ //返回true时按钮显示,返回false隐藏
|
|
|
+ if (row.status == 2) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'confirm_refund',
|
|
|
+ classname: 'btn btn-xs btn-primary btn-ajax',
|
|
|
+ icon: 'fa fa-magic',
|
|
|
+ confirm: '确认已退款?',
|
|
|
+ url: 'cannelorder/confirm_refund',
|
|
|
+ success: function (data, ret) {
|
|
|
+ //Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data));
|
|
|
+ //如果需要阻止成功提示,则必须使用return false;
|
|
|
+ Layer.alert(ret.msg);
|
|
|
+ table.bootstrapTable('refresh', {});
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ error: function (data, ret) {
|
|
|
+ console.log(data, ret);
|
|
|
+ Layer.alert(ret.msg);
|
|
|
+ table.bootstrapTable('refresh', {});
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ visible: function (row) {
|
|
|
+ //重点在这
|
|
|
+ //返回true时按钮显示,返回false隐藏
|
|
|
+ if (row.status == 3) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
}
|
|
|
]
|
|
|
]
|
|
@@ -217,6 +264,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
edit: function () {
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
+ confirm_amount: function () {
|
|
|
+ Controller.api.bindevent();
|
|
|
+ },
|
|
|
+ confirm_refund: function () {
|
|
|
+ Controller.api.bindevent();
|
|
|
+ },
|
|
|
api: {
|
|
|
bindevent: function () {
|
|
|
Form.api.bindevent($("form[role=form]"));
|