antiepidemic_putin.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. $(".btn-add").data("area", ["735px", "360px"]);
  5. // 初始化表格参数配置
  6. Table.api.init({
  7. extend: {
  8. index_url: 'antiepidemic_putin/index' + location.search,
  9. add_url: 'antiepidemic_putin/add',
  10. edit_url: 'antiepidemic_putin/edit',
  11. del_url: 'antiepidemic_putin/del',
  12. multi_url: 'antiepidemic_putin/multi',
  13. import_url: 'antiepidemic_putin/import',
  14. table: 'antiepidemic_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: 'durg_archives_id_text', title: __('Durg_archives_id')},
  28. {field: 'durg_brand', title: __('品牌')},
  29. {field: 'specifications', title: __('规格'), operate: 'LIKE'},
  30. {field: 'store_house_text', title: __('库房')},
  31. {field: 'unit_id_text', title: __('单位')},
  32. {field: 'put_in', title: __('Put_in')},
  33. {field: 'place', title: __('Place'), operate: 'LIKE'},
  34. {field: 'put_time', title: __('Put_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  35. {field: 'admin_id_text', title: __('Admin_id')},
  36. {field: 'createtime', title: __('Createtime'), operate: 'LIKE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  37. {field: 'updatetime', title: __('Updatetime'), operate: 'LIKE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime,visible:false},
  38. ]
  39. ]
  40. });
  41. // 为表格绑定事件
  42. Table.api.bindevent(table);
  43. },
  44. add: function () {
  45. Controller.api.bindevent();
  46. $("#c-durg_archives_id").data("eSelect", function(){
  47. $.get('antiepidemic_putin/huoq',{id:$("#c-durg_archives_id").val()},function(res){
  48. $('#durg_brand').val(res.data.durg_brand);
  49. $('#specifications').val(res.data.specifications);
  50. $('#store_house').val(res.data.store_house);
  51. $('#unit_id').val(res.data.unit_id);
  52. });
  53. //后续操作
  54. });
  55. },
  56. edit: function () {
  57. Controller.api.bindevent();
  58. },
  59. api: {
  60. bindevent: function () {
  61. Form.api.bindevent($("form[role=form]"));
  62. }
  63. }
  64. };
  65. return Controller;
  66. });