appoint_list.js 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. define(["jquery", "easy-admin"], function ($, ea) {
  2. var init = {
  3. table_elem: '#currentTable',
  4. table_render_id: 'currentTableRenderId',
  5. index_url: 'box.AppointList/index',
  6. add_url: 'coupon.couponarea/add',
  7. edit_url: 'coupon.couponarea/edit',
  8. delete_url: 'coupon.couponarea/delete',
  9. opentime_url:'coupon.couponarea/addtime',
  10. export_url: 'mall.cate/export',
  11. modify_url: 'coupon.couponarea/modify',
  12. };
  13. var Controller = {
  14. index: function () {
  15. ea.table.render({
  16. init: init,
  17. toolbar:['refresh',
  18. [
  19. // {
  20. // text: '添加',
  21. // url: init.add_url,
  22. // method: 'open',
  23. // auth: 'add',
  24. // class: 'layui-btn layui-btn-normal layui-btn-sm',
  25. // icon: 'fa fa-plus '
  26. // },
  27. // {
  28. // text: '导入',
  29. // url: init.putin_url,
  30. // method: 'import',
  31. // auth: 'putin',
  32. // class: 'layui-btn layui-btn-success layui-btn-sm',
  33. // icon: 'fa fa-plus ',
  34. // }
  35. ]
  36. ],
  37. cols: [[
  38. {type: "checkbox"},
  39. {field: 'id', width: 80, title: 'ID'},
  40. {field: 'box_id', minWidth: 80, title: '盒子id'},
  41. {field: 'qi_count', minWidth: 80, title: '第几期'},
  42. {field: 'lun_count', minWidth: 80, title: '第几轮'},
  43. {field: 'user.nickname', minWidth: 180, title: '用户昵称'},
  44. {field: 'user.mobile', minWidth: 120, title: '手机号'},
  45. {field: 'num', minWidth: 80, title: '数量'},
  46. // {field: 'add_scale', minWidth: 80, title: '增长比例',templet: function (d) {
  47. // return '<span class="layui-badge layui-bg-blue">' + d.add_scale+'%</span>';
  48. //
  49. // }},
  50. {field: 'status', minWidth: 150, title: '状态', search: 'select', selectList: {'1': '预约成功', '2': '已匹配', '3':'已拆开'}},
  51. // {field: 'box_type', minWidth: 150, title: '拆出来的类型', search: 'select', selectList: {'0': '预约成功', '2': '普通', '3':'稀有', '4':'史诗', '5':'传说'}},
  52. {field: 'create_time', minWidth: 200, title: '创建时间'},
  53. {field: 'box_img', width: 120, title: '图片封面', templet: function (d) {
  54. return '<span><img src="' + d.box_img + '" style="width: 60px;height: 60px;border-radius: 60px;"></span>';
  55. }},
  56. {field: 'box_title', minWidth: 50, title: '福袋名字'}
  57. // {width: 250, title: '操作', templet: ea.table.tool,
  58. // operat: ['edit',
  59. // [{
  60. // text: '配置时间',
  61. // url: init.opentime_url,
  62. // method: 'open',
  63. // auth: 'addtime',
  64. // refresh:false,
  65. // class: 'layui-btn layui-btn-normal layui-btn-xs',
  66. // }]
  67. // ]},
  68. ]],
  69. });
  70. ea.listen();
  71. },
  72. add: function () {
  73. ea.listen();
  74. },
  75. edit: function () {
  76. ea.listen();
  77. },
  78. addtime: function () {
  79. ea.listen();
  80. }
  81. };
  82. return Controller;
  83. });