exams.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'selectpage'], function ($, undefined, Backend, Table, Form, SelectPage) {
  2. let examStatusList = {
  3. 1: '登记',
  4. 2: '开始检查',
  5. 3: '检查完毕',
  6. 4: '申请',
  7. 5: '驳回',
  8. 6: '接收',
  9. 7: '初步报告',
  10. 8: '审核报告',
  11. 9: '确认报告',
  12. };
  13. let filmTypeList = {0: '未定义', 1: '传统胶片', 2: '数字影像'};
  14. let Controller = {
  15. index: function () {
  16. // 初始化表格参数配置
  17. Table.api.init({
  18. extend: {
  19. index_url: 'exams/exams/index' + location.search,
  20. add_url: '',
  21. edit_url: '',
  22. del_url: '',
  23. multi_url: '',
  24. table: 'exams',
  25. }
  26. });
  27. let table = $("#table");
  28. var common_filter = {};
  29. var common_op = {};
  30. // 初始化表格
  31. table.bootstrapTable({
  32. url: $.fn.bootstrapTable.defaults.extend.index_url,
  33. pk: 'id',
  34. sortName: 'createdAt',
  35. showToggle: false,
  36. showColumns: false,
  37. showExport: true,
  38. pageList: [10, 15, 25, 50],
  39. queryParams: function (params) {
  40. //这里可以追加搜索条件
  41. let filter = JSON.parse(params.filter);
  42. let op = JSON.parse(params.op);
  43. params.filter = JSON.stringify(filter);
  44. params.op = JSON.stringify(op);
  45. common_filter = params.filter;
  46. common_op = params.op;
  47. return params;
  48. },
  49. columns: [
  50. [
  51. {field: 'institution_id', title: __('机构名称'), visible: false},
  52. {field: 'institution_name', title: __('机构名称'), align: 'left', searchable: false},
  53. {field: 'name', title: __('name')},
  54. {field: 'phone', title: __('Phone')},
  55. {field: 'card_num', title: __('身份证')},
  56. // {field: 'patient_num', title: __('Patient_num')},
  57. // {field: 'accession_num', title: __('Accession_num')},
  58. {field: 'exam_datetime', title: __('Exam_datetime'),defaultValue:Controller.api.formatter.get_today(0)},
  59. {
  60. field: 'studytime',
  61. title: __('检查日期'),
  62. searchable: false
  63. },{
  64. field: 'report_datetime',
  65. title: __('报告时间'),
  66. searchable: false
  67. },{
  68. field: 'report_doctor_name',
  69. title: __('报告医生'),
  70. searchable: false
  71. },{
  72. field: 'review_datetime',
  73. title: __('审核时间'),
  74. searchable: false
  75. },{
  76. field: 'review_doctor_name',
  77. title: __('审核医生'),
  78. searchable: false
  79. },
  80. {field: 'exam_class', title: __('Exam_class'), searchList: $.getJSON('dict/device/classSelectList')},
  81. {
  82. field: 'exam_status',
  83. title: __('检查状态'),
  84. formatter: Controller.api.formatter.exam_status,
  85. searchList: examStatusList,
  86. },
  87. {field: 'createdAt', title: __('Createdat'), operate:'RANGE', addclass:'datetimerange'},
  88. {
  89. field: 'status',
  90. title: __('状态'),
  91. formatter: Table.api.formatter.status,
  92. searchList: {1: '正常', 0: '禁用'},
  93. custom: {1: 'success', 0: 'danger'}
  94. },
  95. {
  96. field: 'operate',
  97. export:false,
  98. title: __('Operate'),
  99. table: table,
  100. buttons: [
  101. {
  102. name : 'btn_topup',
  103. title : __('查看影像'),
  104. text : '查看影像',
  105. extend : 'data-toggle="tooltip"',
  106. classname: 'btn btn-xs btn-warning btn-film'
  107. },
  108. {
  109. name : 'btn_topup',
  110. title : __('查看报告'),
  111. text : '查看报告',
  112. extend : 'data-toggle="tooltip"',
  113. classname: 'btn btn-xs btn-warning btn-dialog',
  114. url : 'manage/exams/lookReport',
  115. },
  116. {
  117. name : 'btn_topup',
  118. title : __('技术质控'),
  119. text : '技术质控',
  120. extend : 'data-toggle="tooltip" data-area=\'["60%","90%"]\'',
  121. classname: 'btn btn-xs btn-warning btn-dialog',
  122. url : 'manage/exams/film/type/1',
  123. },
  124. {
  125. name : 'btn_topup',
  126. title : __('AI报告质控'),
  127. text : 'AI报告质控',
  128. classname: 'btn btn-xs btn-warning btn-dialog',
  129. url : function (row){return 'manage/exams/aiReport?exam='+row.id}
  130. },
  131. {
  132. name : 'btn_topup',
  133. title : __('查看技术质控结果'),
  134. text : '查看技术质控结果',
  135. extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
  136. classname: 'btn btn-xs btn-warning btn-dialog',
  137. url : 'manage/exams/lookresult/type/1',
  138. },
  139. {
  140. name : 'btn_topup',
  141. title : __('查看AI技术质控结果'),
  142. text : '查看AI技术质控结果',
  143. classname: 'btn btn-xs btn-warning btn-dialog',
  144. url : 'manage/exams/lookairesult',
  145. },
  146. {
  147. name : 'btn_topup',
  148. title : __('报告质控'),
  149. text : '报告质控',
  150. extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
  151. classname: 'btn btn-xs btn-warning btn-dialog',
  152. url : 'manage/exams/film/type/2',
  153. },
  154. {
  155. name : 'btn_topup',
  156. title : __('查看报告质控结果'),
  157. text : '查看报告质控结果',
  158. extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
  159. classname: 'btn btn-xs btn-warning btn-dialog',
  160. url : 'manage/exams/lookresult/type/2',
  161. },
  162. {
  163. name : 'btn_topup',
  164. title : __('查看历史质控结果'),
  165. text : '查看历史质控结果',
  166. extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
  167. classname: 'btn btn-xs btn-warning btn-dialog',
  168. url : function (row){return 'manage/records/index?exam='+row.id}
  169. },
  170. {
  171. name : 'btn_topup',
  172. title : __('智能分析'),
  173. text : '智能分析',
  174. extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
  175. classname: 'btn btn-xs btn-warning btn-dialog',
  176. url : 'manage/exams/analysis',
  177. },
  178. ],
  179. events: Controller.api.events.operate,
  180. formatter: Table.api.formatter.operate,
  181. }
  182. ]
  183. ]
  184. });
  185. // 为表格绑定事件
  186. Table.api.bindevent(table);
  187. initInstitutionSearchList('institution_id');
  188. $('.btn-positive').click(function () {
  189. window.location.href = 'exams/expExcel?filter='+common_filter+'&op='+common_op;
  190. });
  191. $('.btn-exams-download').click(function () {
  192. window.location.href = 'exams/exportExcel';
  193. });
  194. },
  195. add: function () {
  196. Controller.api.bindevent();
  197. },
  198. edit: function () {
  199. Controller.api.bindevent();
  200. },
  201. report:function (){
  202. Controller.api.bindevent();
  203. },
  204. film:function (){
  205. Controller.api.bindevent();
  206. },
  207. api: {
  208. events:{
  209. operate:{
  210. 'click .btn-film': function (e, value, row, index) {
  211. console.log(row);
  212. window.open("https://ppacsview.pacsonline.cn/#/pc?studyurl=https%3A%2F%2Fquery.pacsonline.cn%2Fquery%2F%3Faddress%3D&study_id="+row.study_id+"&version=V1.2.0.0");
  213. }
  214. }
  215. },
  216. bindevent: function () {
  217. Form.api.bindevent($("form[role=form]"));
  218. },
  219. formatter: {
  220. exam_status: function (value) {
  221. return examStatusList[value];
  222. },
  223. get_today: function (AddDayCount) {
  224. const dd = new Date();
  225. dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
  226. let y = dd.getFullYear() + '';
  227. let m = dd.getMonth()+1;//获取当前月份的日期
  228. let d = dd.getDate();
  229. //判断月
  230. if (m < 10) {
  231. m = "0" + m + '';
  232. }
  233. //判断日
  234. if (d < 10) {
  235. d = "0" + d + '';
  236. }
  237. return y + m + d;
  238. },
  239. film_type: function (value) {
  240. return filmTypeList[value];
  241. }
  242. }
  243. }
  244. };
  245. // 选择机构下拉列表
  246. let initInstitutionSearchList = function (id) {
  247. $.ajax({
  248. url: 'institution/institution/institutionSelectList',
  249. type: 'post',
  250. dataType: 'json',
  251. success: function success(res) {
  252. let data = res.rows;
  253. $('#'+id).selectPage({
  254. data : data,
  255. orderBy: 'index'
  256. });
  257. }
  258. });
  259. };
  260. return Controller;
  261. });