remote.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'selectpage'], function ($, undefined, Backend, Table, Form, Selectpage) {
  2. require(['layui'], function(undefined){
  3. layui.use('element', function(){
  4. var element = layui.element;
  5. console.log(element);
  6. });
  7. });
  8. var Controller = {
  9. index: function () {
  10. // 初始化表格参数配置
  11. Table.api.init({
  12. extend: {
  13. index_url: 'remote/remote/index' + location.search,
  14. table: 'remote_application',
  15. }
  16. });
  17. var table = $("#table");
  18. // 初始化表格
  19. table.bootstrapTable({
  20. url: $.fn.bootstrapTable.defaults.extend.index_url,
  21. pk: 'id',
  22. sortName: 'req_date_time',
  23. showToggle: false,
  24. showColumns: false,
  25. showExport: false,
  26. pageList: [10, 15, 25, 50],
  27. columns: [
  28. [
  29. {field: 'name', title: __('Name'), operate: 'LIKE %...%'},
  30. {field: 'sex', title: __('Sex'), searchable: false},
  31. {field: 'age', title: __('Age'), operate: 'BETWEEN'},
  32. {field: 'req_doctor_name', title: __('Req_doctor_name')},
  33. {field: 'local_institution_id', title: __('Local_institution_name'), visible: false},
  34. {field: 'local_institution_name', title: __('Local_institution_name'), searchable: false},
  35. {field: 'remote_doctor_name', title: __('Remote_doctor_name')},
  36. {field: 'remote_institution_id', title: __('Remote_institution_name'), visible: false},
  37. {field: 'remote_institution_name', title: __('Remote_institution_name'), searchable: false},
  38. {field: 'report_status', title: __('Report_status'),
  39. align: 'left',
  40. width: '10%',
  41. formatter: Table.api.formatter.normal,
  42. custom: {2:'info',3:'info',4:'info',5:'danger',6:'info',7:'info',8:'info',9:'info',10:'info',11:'danger', },
  43. searchList: {
  44. 2 : '获取完善病例资料',
  45. 3 : '完善病例资料保存继续',
  46. 4 : '选择医院发起申请',
  47. 5 : '驳回申请',
  48. 6 : '接收申请',
  49. 7 : '书写报告',
  50. 8 : '审核报告',
  51. 9 : '最终完成报告',
  52. 10 : '确认报告',
  53. 11 : '撤回报告',
  54. 12 : '撤回',
  55. },},
  56. {field: 'req_date_time', title: __('Req_date_time'), operate:'RANGE', addclass:'datetimerange', sortable: true},
  57. {
  58. field: 'operate',
  59. title: __('Operate'),
  60. table: table,
  61. events: Table.api.events.operate,
  62. formatter: Table.api.formatter.operate,
  63. buttons: [
  64. {
  65. name: 'detail',
  66. title: __('查看进度'),
  67. classname: 'btn btn-xs btn-primary btn-dialog',
  68. icon: 'fa fa-list',
  69. url: 'remote/remote/schedule',
  70. extend: 'data-area = \'["90%", "500px"]\'',
  71. callback: function (data) {
  72. Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
  73. }
  74. }
  75. ],
  76. }
  77. ]
  78. ]
  79. });
  80. $.ajax({
  81. url: 'institution/institution/institutionSelectList',
  82. type: 'post',
  83. dataType: 'json',
  84. success: function success(res) {
  85. let data = res.rows;
  86. $('#local_institution_id').selectPage({
  87. data : data,
  88. orderBy: 'index'
  89. });
  90. $('#remote_institution_id').selectPage({
  91. data : data,
  92. orderBy: 'index'
  93. });
  94. }
  95. });
  96. // 为表格绑定事件
  97. Table.api.bindevent(table);
  98. },
  99. api: {
  100. bindevent: function () {
  101. Form.api.bindevent($("form[role=form]"));
  102. }
  103. }
  104. };
  105. return Controller;
  106. });