|
@@ -0,0 +1,273 @@
|
|
|
+//@ sourceURL=mzsrmx.js
|
|
|
+$(function () {
|
|
|
+ init_daterangepicker();
|
|
|
+ //daterangepicker(getAllOperator);
|
|
|
+ initMzsrmxTable();
|
|
|
+ //重置查询参数
|
|
|
+ $('#btn_clean').click(function () {
|
|
|
+ cleanParams();
|
|
|
+ });
|
|
|
+ //初始化页面上面的按钮事件
|
|
|
+ $("#btn_query").click(function (t) {
|
|
|
+ initMzsrmxTable();
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".selectpicker").selectpicker({
|
|
|
+ dropuAuto: false
|
|
|
+ });
|
|
|
+
|
|
|
+ //初始化页面上面的按钮事件
|
|
|
+ $("#btn_excel").click(function (t) {
|
|
|
+ exportExcel();
|
|
|
+ });
|
|
|
+ initSelect();
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 初始化下拉选
|
|
|
+ */
|
|
|
+function initSelect() {
|
|
|
+ $(".selectpicker").selectpicker({
|
|
|
+ dropuAuto: false
|
|
|
+ });
|
|
|
+ initDeptSelect();
|
|
|
+ initDoctorSelect();
|
|
|
+ var type = '<option value="0">结算</option><option value="1">收费</option>';
|
|
|
+ $('#timeParam').html(type);
|
|
|
+ $('#timeParam').selectpicker('refresh');
|
|
|
+ $("#timeParam").selectpicker('val', 0);//默认选中
|
|
|
+ $("#timeParam").selectpicker('refresh');
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 父类码下拉选
|
|
|
+ */
|
|
|
+function initBillItemSelect() {
|
|
|
+ //科室列表
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getAllBillItems',
|
|
|
+ dataType: "json",
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
+ success: function (data) {
|
|
|
+ if (data == '401' || data == 401) {
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var html = '';
|
|
|
+ $.each(data.data, function (commentIndex, comment) {
|
|
|
+ html += '<option value="' + comment.code + '">' + comment.name + '</option>';
|
|
|
+ });
|
|
|
+ $('#parentCode').html(html);
|
|
|
+ $('#parentCode').selectpicker('refresh');
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 核算码下拉选
|
|
|
+ */
|
|
|
+function initHsmNameSelect() {
|
|
|
+ //科室列表
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getAllHsmName',
|
|
|
+ dataType: "json",
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
+ success: function (data) {
|
|
|
+ if (data == '401' || data == 401) {
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var html = '';
|
|
|
+ $.each(data.data, function (commentIndex, comment) {
|
|
|
+ html += '<option value="' + comment + '">' + comment + '</option>';
|
|
|
+ });
|
|
|
+ $('#hsm').html(html);
|
|
|
+ $('#hsm').selectpicker('refresh');
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 挂号列表中的科室列表
|
|
|
+ */
|
|
|
+function initDeptSelect() {
|
|
|
+ //科室列表
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/allMzUnitCode',
|
|
|
+ dataType: "json",
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
+ success: function (data) {
|
|
|
+ if (data == '401' || data == 401) {
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var html = '';
|
|
|
+ $.each(data.data, function (commentIndex, comment) {
|
|
|
+ html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
|
|
|
+ });
|
|
|
+ $('#jzSqDept').empty();
|
|
|
+ $('#jzSqDept').html(html);
|
|
|
+ $('#jzSqDept').selectpicker('refresh');
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 挂号列表中的医生列表初始化
|
|
|
+ */
|
|
|
+function initDoctorSelect() {
|
|
|
+ //医生列表
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/listEmployeeByDepts?depts=' + $('#jzSqDept').val(),
|
|
|
+ dataType: "json",
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
+ success: function (res) {
|
|
|
+ if (res == '401' || res == 401) {
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var html = '';
|
|
|
+ $.each(res.data, function (commentIndex, comment) {
|
|
|
+ html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
|
|
|
+ });
|
|
|
+ $('#jzSqDoctor').empty();
|
|
|
+ $('#jzSqDoctor').html(html);
|
|
|
+ $('#jzSqDoctor').selectpicker('destroy').selectpicker('refresh');
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 门诊号别统计
|
|
|
+ */
|
|
|
+function initMzsrmxTable() {
|
|
|
+ var rePortRangeArr = getRePortRangeArr();
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '/thmz/getMzhbCount',
|
|
|
+ contentType: "application/json;charset=UTF-8",
|
|
|
+ dataType: "json",
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
+ data: JSON.stringify({"beginDate": rePortRangeArr[0], "endDate": rePortRangeArr[1], "caseType": $('#timeParam').val(), "jzSqDept": $("#jzSqDept").val(), "jzSqDoctor": $("#jzSqDoctor").val(),"hisData": $('#hisData').is(':checked') ? 0 : 1}),
|
|
|
+ success: function (res) {
|
|
|
+ if (res == '401' || res == 401) {
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(res.code==0){
|
|
|
+ if(res.depetList!=null && res.depetList.length>0 && res.chargeTypeList!=null && res.chargeTypeList.length>0){
|
|
|
+ var html ="<thead><tr><th rowspan='2'>科室</th>";
|
|
|
+ var secondRow='<tr>';
|
|
|
+ for (var i=0;i<res.chargeTypeList.length;i++){
|
|
|
+ html+="<th colspan='2'>"+res.chargeTypeList[i].charge_type_name+"</th>";
|
|
|
+ secondRow+="<th>号数</th><th>金额</th>"
|
|
|
+ }
|
|
|
+ html+="<th colspan='2'>合计</th></tr>"
|
|
|
+ secondRow+="<th>号数</th><th>金额</th></tr></thead>"
|
|
|
+ html+=secondRow;
|
|
|
+ html+="<tbody>";
|
|
|
+ for (var i=0;i<res.depetList.length;i++){
|
|
|
+ html+="<tr><td>"+res.depetList[i].dept_name+"</td>";
|
|
|
+ for (var j=0;j<res.chargeTypeList.length;j++){
|
|
|
+ var id_after = res.chargeTypeList[j].charge_type+"_"+res.depetList[i].unit_code;
|
|
|
+ var hsid= "hs_"+id_after;
|
|
|
+ var jeid= "je_"+id_after;
|
|
|
+ html+="<td id='"+hsid+"'></td><td id='"+jeid+"'></td>";
|
|
|
+ }
|
|
|
+ var hjhsid= "hs_hj_"+res.depetList[i].unit_code;
|
|
|
+ var hjjeid= "je_hj_"+res.depetList[i].unit_code;
|
|
|
+ html+="<td id='"+hjhsid+"'></td><td id='"+hjjeid+"'></td>";
|
|
|
+ html+="</tr>";
|
|
|
+ }
|
|
|
+ html+="</tbody>";
|
|
|
+ $("#tb_table").html(html);
|
|
|
+
|
|
|
+ for(var i=0;i<res.data.length;i++){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 构建列表查询参数
|
|
|
+ * @param params
|
|
|
+ * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
|
|
|
+ */
|
|
|
+function queryParams(params) {
|
|
|
+ var rePortRangeArr = getRePortRangeArr();
|
|
|
+ var temp = {
|
|
|
+ beginDate: rePortRangeArr[0],
|
|
|
+ endDate: rePortRangeArr[1],
|
|
|
+ commonParams: $('#commonParams').val(),
|
|
|
+ caseType: $('#timeParam').val(),
|
|
|
+ jzSqDept:$("#jzSqDept").val(),
|
|
|
+ jzSqDoctor:$("#jzSqDoctor").val(),
|
|
|
+ execDept:$("#execDept").val(),
|
|
|
+ hsm:$("#hsm").val(),
|
|
|
+ parentCode:$("#parentCode").val(),
|
|
|
+ xmm:$("#xmm").val()
|
|
|
+ };
|
|
|
+
|
|
|
+ return temp;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取时间选择器的时间数组
|
|
|
+ * @returns {string[]}
|
|
|
+ */
|
|
|
+function getRePortRangeArr() {
|
|
|
+ var rePortRange = $('#reportrange span').html();
|
|
|
+ var rePortRangeArr = rePortRange.split(" - ");
|
|
|
+ rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
|
|
|
+ rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
|
|
|
+ return rePortRangeArr;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 清空查询条件
|
|
|
+ */
|
|
|
+function cleanParams() {
|
|
|
+ $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
+ $("#commonParams").val(null);
|
|
|
+ $("#timeParam").selectpicker('val', 0);//默认选中
|
|
|
+ $("#timeParam").selectpicker('refresh');
|
|
|
+ $("#jzSqDept").selectpicker('val', null);//默认选中
|
|
|
+ $("#jzSqDept").selectpicker('refresh');
|
|
|
+ $("#jzSqDoctor").selectpicker('val', null);//默认选中
|
|
|
+ $("#jzSqDoctor").selectpicker('refresh');
|
|
|
+ $("#execDept").selectpicker('val', null);//默认选中
|
|
|
+ $("#execDept").selectpicker('refresh');
|
|
|
+ $("#parentCode").selectpicker('val', null);//默认选中
|
|
|
+ $("#parentCode").selectpicker('refresh');
|
|
|
+ $("#hsm").selectpicker('val', null);//默认选中
|
|
|
+ $("#hsm").selectpicker('refresh');
|
|
|
+ $("#xmm").val(null);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 导出excel
|
|
|
+ */
|
|
|
+function exportExcel() {
|
|
|
+ var rePortRangeArr = getRePortRangeArr();
|
|
|
+ window.location.href = "/thmz/excelThmzmxsr?beginDate=" + rePortRangeArr[0] + "&endDate=" + rePortRangeArr[1]+"&commonParams="+$('#commonParams').val()
|
|
|
+ +"&caseType="+$('#timeParam').val()+"&jzSqDept="+$("#jzSqDept").val()+"&jzSqDoctor="+$("#jzSqDoctor").val()+"&execDept="+$("#execDept").val()+"&hsm="
|
|
|
+ +$("#hsm").val()+"&parentCode="+$("#parentCode").val()+"&xmm="+$("#xmm").val();
|
|
|
+}
|