| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'product/orders/index' + location.search+'&ids='+Config.ids,
- table: 'product_order',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- fixedColumns: false,
- columns: [
- [
- {checkbox: true},
- {field: 'user_id', title: __('用户Id'), operate: 'LIKE'},
- {field: 'users.address', title: __('用户地址'), operate: 'LIKE'},
- {field: 'total_num', title: __('持有数量'), operate: false},
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- //total_num
- },
-
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- setTimeout(getTotalNum, 500);
- return Controller;
- });
- function getTotalNum(){
- $.post("product/orders/getTotalNum",{'product_id':Config.ids},
- function (data) {
- $("#total_num").text(data.totalNum);
- })
- }
|