consume_putin.js 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. $(".btn-add").data("area", ["740px", "360px"]);
  5. // 初始化表格参数配置
  6. Table.api.init({
  7. extend: {
  8. index_url: 'consume_putin/index' + location.search,
  9. add_url: 'consume_putin/add',
  10. // edit_url: 'durg_putin/edit',
  11. // del_url: 'durg_putin/del',
  12. multi_url: 'consume_putin/multi',
  13. import_url: 'consume_putin/import',
  14. table: 'consume_putin',
  15. }
  16. });
  17. var table = $("#table");
  18. // 初始化表格
  19. table.bootstrapTable({
  20. url: $.fn.bootstrapTable.defaults.extend.index_url,
  21. pk: 'id',
  22. sortName: 'id',
  23. columns: [
  24. [
  25. {checkbox: true},
  26. {field: 'order_number', title: __('序号')},
  27. //{field: 'number', title: __('入库编号')},
  28. {field: 'durg_archives_id_text', title: __('Durg_archives_id')},
  29. {field: 'unit_id_text', title: __('单位'), operate: 'LIKE'},
  30. {field: 'store_house_text', title: __('库房'), operate: 'LIKE'},
  31. {field: 'durg_brand', title: __('品牌'), operate: 'LIKE'},
  32. {field: 'manufacturer', title: __('生产厂商'), operate: 'LIKE'},
  33. {field: 'specifications', title: __('规格'), operate: 'LIKE'},
  34. {field: 'put_in', title: __('Put_in')},
  35. {field: 'place', title: __('Place'), operate: 'LIKE'},
  36. {field: 'source', title: __('Source'), operate: 'LIKE'},
  37. //{field: 'remarks', title: __('Remarks'), operate: 'LIKE'},
  38. {field: 'overduedate', title: __('Overduedate'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  39. {field: 'admin_id_text', title: __('Admin_id')},
  40. {field: 'put_time', title: __('Put_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  41. ]
  42. ]
  43. });
  44. // 为表格绑定事件
  45. Table.api.bindevent(table);
  46. table.on('post-body.bs.table', function () {
  47. $(".btn-editone").data("area", ["750px", "360px"]);
  48. })
  49. },
  50. add: function () {
  51. Controller.api.bindevent();
  52. $("#c-durg_archives_id").data("eSelect", function(){
  53. $.get('consume_putout/huoq',{id:$("#c-durg_archives_id").val()},function(res){
  54. $('#durg_brand').val(res.data.durg_brand);
  55. $('#manufacturer').val(res.data.manufacturer);
  56. $('#specifications').val(res.data.specifications);
  57. $('#product_introduction').val(res.data.product_introduction);
  58. $('#unit_id').val(res.data.unit_id);
  59. $('#store_house').val(res.data.store_house);
  60. //console.log($("#c-durg_archives_id").val());
  61. });
  62. //后续操作
  63. });
  64. },
  65. // edit: function () {
  66. // Controller.api.bindevent();
  67. // },
  68. api: {
  69. bindevent: function () {
  70. Form.api.bindevent($("form[role=form]"));
  71. }
  72. }
  73. };
  74. return Controller;
  75. });