123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'selectpage'], function ($, undefined, Backend, Table, Form, SelectPage) {
- let examStatusList = {
- 1: '登记',
- 2: '开始检查',
- 3: '检查完毕',
- 4: '申请',
- 5: '驳回',
- 6: '接收',
- 7: '初步报告',
- 8: '审核报告',
- 9: '确认报告',
- };
- let filmTypeList = {0: '未定义', 1: '传统胶片', 2: '数字影像'};
- let Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'exams/exams/index' + location.search,
- add_url: '',
- edit_url: '',
- del_url: '',
- multi_url: '',
- table: 'exams',
- }
- });
- let table = $("#table");
- var common_filter = {};
- var common_op = {};
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'createdAt',
- showToggle: false,
- showColumns: false,
- showExport: true,
- pageList: [10, 15, 25, 50],
- queryParams: function (params) {
- //这里可以追加搜索条件
- let filter = JSON.parse(params.filter);
- let op = JSON.parse(params.op);
- params.filter = JSON.stringify(filter);
- params.op = JSON.stringify(op);
- common_filter = params.filter;
- common_op = params.op;
- return params;
- },
- columns: [
- [
- {field: 'institution_id', title: __('机构名称'), visible: false},
- {field: 'institution_name', title: __('机构名称'), align: 'left', searchable: false},
- {field: 'name', title: __('name')},
- {field: 'phone', title: __('Phone')},
- {field: 'card_num', title: __('身份证')},
- // {field: 'patient_num', title: __('Patient_num')},
- // {field: 'accession_num', title: __('Accession_num')},
- {field: 'exam_datetime', title: __('Exam_datetime'),defaultValue:Controller.api.formatter.get_today(0)},
- {
- field: 'studytime',
- title: __('检查日期'),
- searchable: false
- },{
- field: 'report_datetime',
- title: __('报告时间'),
- searchable: false
- },{
- field: 'report_doctor_name',
- title: __('报告医生'),
- searchable: false
- },{
- field: 'review_datetime',
- title: __('审核时间'),
- searchable: false
- },{
- field: 'review_doctor_name',
- title: __('审核医生'),
- searchable: false
- },
- {field: 'exam_class', title: __('Exam_class'), searchList: $.getJSON('dict/device/classSelectList')},
- {
- field: 'exam_status',
- title: __('检查状态'),
- formatter: Controller.api.formatter.exam_status,
- searchList: examStatusList,
- },
- {field: 'createdAt', title: __('Createdat'), operate:'RANGE', addclass:'datetimerange'},
- {
- field: 'status',
- title: __('状态'),
- formatter: Table.api.formatter.status,
- searchList: {1: '正常', 0: '禁用'},
- custom: {1: 'success', 0: 'danger'}
- },
- {
- field: 'operate',
- export:false,
- title: __('Operate'),
- table: table,
- buttons: [
- {
- name : 'btn_topup',
- title : __('查看影像'),
- text : '查看影像',
- extend : 'data-toggle="tooltip"',
- classname: 'btn btn-xs btn-warning btn-film'
- },
- {
- name : 'btn_topup',
- title : __('查看报告'),
- text : '查看报告',
- extend : 'data-toggle="tooltip"',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'manage/exams/lookReport',
- },
- {
- name : 'btn_topup',
- title : __('技术质控'),
- text : '技术质控',
- extend : 'data-toggle="tooltip" data-area=\'["60%","90%"]\'',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'manage/exams/film/type/1',
- },
- {
- name : 'btn_topup',
- title : __('AI报告质控'),
- text : 'AI报告质控',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : function (row){return 'manage/exams/aiReport?exam='+row.id}
- },
- {
- name : 'btn_topup',
- title : __('查看技术质控结果'),
- text : '查看技术质控结果',
- extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'manage/exams/lookresult/type/1',
- },
- {
- name : 'btn_topup',
- title : __('查看AI技术质控结果'),
- text : '查看AI技术质控结果',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'manage/exams/lookairesult',
- },
- {
- name : 'btn_topup',
- title : __('报告质控'),
- text : '报告质控',
- extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'manage/exams/film/type/2',
- },
- {
- name : 'btn_topup',
- title : __('查看报告质控结果'),
- text : '查看报告质控结果',
- extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'manage/exams/lookresult/type/2',
- },
- {
- name : 'btn_topup',
- title : __('查看历史质控结果'),
- text : '查看历史质控结果',
- extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : function (row){return 'manage/records/index?exam='+row.id}
- },
- {
- name : 'btn_topup',
- title : __('智能分析'),
- text : '智能分析',
- extend : 'data-toggle="tooltip" data-area=\'["60%","98%"]\'',
- classname: 'btn btn-xs btn-warning btn-dialog',
- url : 'manage/exams/analysis',
- },
- ],
- events: Controller.api.events.operate,
- formatter: Table.api.formatter.operate,
- }
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- initInstitutionSearchList('institution_id');
- $('.btn-positive').click(function () {
- window.location.href = 'exams/expExcel?filter='+common_filter+'&op='+common_op;
- });
- $('.btn-exams-download').click(function () {
- window.location.href = 'exams/exportExcel';
- });
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- report:function (){
- Controller.api.bindevent();
- },
- film:function (){
- Controller.api.bindevent();
- },
- api: {
- events:{
- operate:{
- 'click .btn-film': function (e, value, row, index) {
- console.log(row);
- 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");
- }
- }
- },
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- },
- formatter: {
- exam_status: function (value) {
- return examStatusList[value];
- },
- get_today: function (AddDayCount) {
- const dd = new Date();
- dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
- let y = dd.getFullYear() + '';
- let m = dd.getMonth()+1;//获取当前月份的日期
- let d = dd.getDate();
- //判断月
- if (m < 10) {
- m = "0" + m + '';
- }
- //判断日
- if (d < 10) {
- d = "0" + d + '';
- }
- return y + m + d;
- },
- film_type: function (value) {
- return filmTypeList[value];
- }
- }
- }
- };
- // 选择机构下拉列表
- let initInstitutionSearchList = function (id) {
- $.ajax({
- url: 'institution/institution/institutionSelectList',
- type: 'post',
- dataType: 'json',
- success: function success(res) {
- let data = res.rows;
- $('#'+id).selectPage({
- data : data,
- orderBy: 'index'
- });
- }
- });
- };
- return Controller;
- });
|