report.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. // 初始化表格参数配置
  5. Table.api.init({
  6. extend: {
  7. index_url: 'report/index' + location.search,
  8. add_url: 'report/add',
  9. }
  10. });
  11. var table = $("#table");
  12. // 初始化表格
  13. table.bootstrapTable({
  14. url: $.fn.bootstrapTable.defaults.extend.index_url,
  15. pk: 'id',
  16. sortName: 'id',
  17. columns: [
  18. [
  19. {field: 'order_number', title: '批次号',operate: 'LIKE'},
  20. {field: 'product_name', title: '产品名称'},
  21. {field: 'color', title: '专墨颜色'},
  22. {field: 'collarWeight', title: '领用重量(kg)'},
  23. {field: 'backWeight', title: '退回重量(kg)'},
  24. {field: 'consume', title: '消耗重量(kg)'},
  25. ]
  26. ],
  27. showToggle:false,
  28. showColumns:false,
  29. showExport:false,
  30. searchFormVisible:false,
  31. commonSearch:false,
  32. // search:false,
  33. });
  34. // 为表格绑定事件
  35. Table.api.bindevent(table);
  36. },
  37. bach: function(){
  38. // 初始化表格参数配置
  39. Table.api.init({
  40. extend: {
  41. index_url: 'report/bach' + location.search,
  42. }
  43. });
  44. var table = $("#table");
  45. // 初始化表格
  46. table.bootstrapTable({
  47. url: $.fn.bootstrapTable.defaults.extend.index_url,
  48. pk: 'id',
  49. sortName: 'id',
  50. columns: [
  51. [
  52. {field: 'id', title: '序号'},
  53. {field: 'bach_number', title: '批次号'},
  54. {field: 'order_number', title: '工单批次号'},
  55. {field: 'product_name', title: '产品名称'},
  56. {field: 'ink_status', title: '油墨类别'},
  57. {field: 'color', title: '颜色'},
  58. {field: 'weight', title: '重量(KG)'},
  59. {field: 'create', title: '入库时间'},
  60. ]
  61. ]
  62. });
  63. // 为表格绑定事件
  64. Table.api.bindevent(table);
  65. },
  66. mouth: function(){
  67. // 初始化表格参数配置
  68. Table.api.init({
  69. extend: {
  70. index_url: 'report/mouth' + location.search,
  71. }
  72. });
  73. var table = $("#table");
  74. // 初始化表格
  75. table.bootstrapTable({
  76. url: $.fn.bootstrapTable.defaults.extend.index_url,
  77. pk: 'id',
  78. sortName: 'id',
  79. columns: [
  80. [
  81. {field: 'id', title: '序号'},
  82. {field: 'order_number', title: '生产批次号', operate: 'LIKE'},
  83. {field: 'product_name', title: '产品名称'},
  84. {field: 'status', title: '状态'},
  85. {field: 'weight', title: '重量(KG)'},
  86. {field: 'ink_status', title: '油墨类别'},
  87. {field: 'color', title: '颜色'},
  88. {field: 'machine_number', title: '机台号'},
  89. {field: 'create', title: '时间'},
  90. ]
  91. ],
  92. });
  93. // 为表格绑定事件
  94. Table.api.bindevent(table);
  95. },
  96. matter: function(){
  97. // 初始化表格参数配置
  98. Table.api.init({
  99. extend: {
  100. index_url: 'report/matter' + location.search,
  101. ink_url: 'report/ink' + location.search,
  102. }
  103. });
  104. var ink = $("#ink");
  105. // 初始化表格
  106. ink.bootstrapTable({
  107. url: $.fn.bootstrapTable.defaults.extend.ink_url,
  108. pk: 'order_number',
  109. sortName: 'order_number',
  110. columns: [
  111. [
  112. {field: 'order_number', title: '生产批次号'},
  113. {field: 'ink_name', title: '油墨名称'},
  114. {field: 'out_weight', title: '领用油墨重量(kg)'},
  115. {field: 'back_weight', title:'退回油墨重量(kg)'},
  116. {field: 'weight', title:'消耗油墨重量(kg)'},
  117. ]
  118. ],
  119. showToggle:false,
  120. showColumns:false,
  121. showExport:false,
  122. searchFormVisible:false,
  123. commonSearch:false,
  124. // search:false,
  125. });
  126. var table = $("#table");
  127. // 初始化表格
  128. table.bootstrapTable({
  129. url: $.fn.bootstrapTable.defaults.extend.index_url,
  130. pk: 'id',
  131. sortName: 'id',
  132. columns: [
  133. [
  134. {field: 'id', title: '序号'},
  135. {field: 'order_number', title: '生产批次号'},
  136. {field: 'ink_name', title: '油墨名称'},
  137. {field: 'machine_number', title: '机台号'},
  138. {field: 'out_weight', title: '领用重量(KG)'},
  139. {field: 'back_weight', title: '退回重量(KG)'},
  140. {field: 'create', title: '时间'},
  141. ]
  142. ],
  143. showToggle:false,
  144. showColumns:false,
  145. showExport:false,
  146. searchFormVisible:false,
  147. commonSearch:false,
  148. });
  149. // 为表格绑定事件
  150. Table.api.bindevent(ink);
  151. Table.api.bindevent(table);
  152. },
  153. edit: function () {
  154. Controller.api.bindevent();
  155. },
  156. api: {
  157. bindevent: function () {
  158. Form.api.bindevent($("form[role=form]"));
  159. }
  160. }
  161. };
  162. return Controller;
  163. });