1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045 |
- //@ sourceURL=charge_detail.js
- //项目类型map
- var classCodeMap = null;
- //核算码map
- var auditCodeMap = null;
- //门诊发票码map
- var billItemMzMap = null;
- //住院发票码map
- var billItemZyMap = null;
- $(function () {
- initSelect();
- initZdChargeItemList();
- //重置查询参数
- $('#btn_clean').click(function () {
- $("#name").val(null);
- $("#classCode").selectpicker('val', null);//默认选中
- $("#classCode").selectpicker('refresh');
- $("#auditCode").selectpicker('val', null);//默认选中
- $("#auditCode").selectpicker('refresh');
- $("#billItemMz").selectpicker('val', null);//默认选中
- $("#billItemMz").selectpicker('refresh');
- $("#billItemZy").selectpicker('val', null);//默认选中
- $("#billItemZy").selectpicker('refresh');
- $("#delFlag").selectpicker('val', null);//默认选中
- $("#delFlag").selectpicker('refresh');
- // $("#clCode").val(null);
- initZdChargeItemList();
- });
- $('#btn_add').click(function () {
- $("#myModalLabel").text("新增收费项目");
- $("#percentag2Params").val(1);
- $("#chargeDetailModal").modal();
- });
- $("#effectiveTimeParams").change(function (e) {
- var effectiveTimeParams=$("#effectiveTimeParams").val();
- if (effectiveTimeParams.length == 8 && effectiveTimeParams.indexOf("-") <= 0) {
- effectiveTimeParams = effectiveTimeParams.substring(0, 4) + "-" + effectiveTimeParams.substring(4, 6) + "-" + effectiveTimeParams.substring(6);
- $("#effectiveTimeParams").val(effectiveTimeParams);
- }
- var dateFormat = /^(\d{4})-(\d{2})-(\d{2})$/;
- if (!dateFormat.test(effectiveTimeParams)) {
- new PNotify({
- title: '错误提示',
- text: '生效日期格式错误,格式为yyyy-mm-dd',
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- });
- //保存收费项目
- $('#save').click(function () {
- $.ajax({
- type: "POST",
- url: '/thmz/saveZdChargeItem',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({"classCode": $("#classCodeParams").val(),
- "name": $("#namePamras").val(),"chargeUnit": $("#chargeUnitParams").val(),
- "chargeAmount": $("#chargeAmountParams").val(),
- "percentag2": $("#percentag2Params").val(),
- "auditCode": $("#auditCodeParams").val(),"billItemMz": $("#billItemMzParams").val(),
- "billItemZy": $("#billItemZyParams").val(),"execUnit": $("#execUnitParams").val(),"bzCode": $("#bzCodeParams").val(),
- "discription": $("#discriptionParams").val(),"clCode": $("#clCodeParams").val(),"co": $("#coParams").val(),"xlCode": $("#xlCodeParams").val(),
- "code": $("#code").val(),"ybComment": $("#ybCommentParams").val(),"nationalCode": $("#nationalCodeParams").val(),"nationalName": $("#nationalNameParams").val(),"hnsybCode": $("#hnsybCodeParams").val(),
- "descriptions": $("#descriptionsParams").val(),"excludeContent": $("#excludeContentParams").val(),"connotation": $("#connotationParams").val(),
- "approvalNumber": $("#approvalNumberParams").val(),"groupNo":$("#groupNoParams").val(),"zdChargeBaClass":$("#zdChargeBaClassParams").val(),"focusMonitorFlag":$("#focusMonitorFlag").val()
- ,"genderRestriction":$("#genderRestriction").val(),"minAgeRestriction":$("#minAgeRestriction").val(),"maxAgeRestriction":$("#maxAgeRestriction").val()}),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#chargeDetailModal").modal("hide");
- clearInput();
- successMesage(res);
- $('#tb_table').bootstrapTable("refresh");
- } else {
- errorMesage(res);
- }
- }
- });
- });
- //保存收费项目延迟改价
- $('#save_price').click(function () {
- $.ajax({
- type: "POST",
- url: '/thmz/saveEffectivePrice',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- "effectivePrice": $("#chargeAmountPriceNeedUpdateParams").val(),
- "effectiveTime": $("#effectiveTimeParams").val(),
- "code": $("#code_price").val()
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#priceModal").modal("hide");
- clearPriceInput();
- $('#tb_table').bootstrapTable("refresh");
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- //保存收费项目延迟启用/停用
- $('#save_delayToEnableOrStop').click(function () {
- var delayToEnableOrStop= $("#delayToEnableOrStop").val();
- var name= $("#nameDelayToEnableOrStopParams").val();
- if (delayToEnableOrStop == 1 && !confirm("确认要停用项目【"+name+"】信息吗?")) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/updateZdChargeItemDelFlag?code=' + $("#code_delayToEnableOrStopParams").val() + "&delFlag=" + delayToEnableOrStop+"&effectiveDate="+$("#effectiveTimeDelayToEnableOrStopParams").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;
- }
- if (res.code == 0) {
- $("#delayToEnableOrStopModal").modal("hide");
- clearDelayToEnableOrStopInput();
- $('#tb_table').bootstrapTable("refresh");
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- });
- /**
- * 号别类别列表
- */
- function initZdChargeItemList() {
- $('#tb_table').bootstrapTable("destroy");
- $('#tb_table').bootstrapTable({
- url: '/thmz/listZdChargeItem', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "desc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [10, 15, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- title: '操作',
- field: 'op',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick="updateZdChargeItem(\'' + row.code + '\')">编辑</button>';
- str += '<button type="button" class="btn btn-primary btn-sm" onclick="updateZdChargeItemPrice(\'' + row.code + '\')">延时调价</button>';
- if(row.effectiveTime!=null){
- str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',1)">取消延时调价</button>';
- }
- if (row.delFlag == 0) {
- str += '<button type="button" class="btn btn-warning btn-sm" onclick="updateZdChargeItemDelFlag(\'' + row.code + '\',\'' + row.name + '\',1)">停用</button>';
- str += '<button type="button" class="btn btn-warning btn-sm" onclick="delayStopOrToEnable(\'' + row.code + '\',1)">延时停用</button>';
- if(row.effectiveDate!=null){
- str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',3)">取消延时停用</button>';
- }
- } else if (row.delFlag == 1) {
- str += '<button type="button" class="btn btn-success btn-sm" onclick="updateZdChargeItemDelFlag(\'' + row.code + '\',\'' + row.name + '\',0)">启用</button>';
- str += '<button type="button" class="btn btn-success btn-sm" onclick="delayStopOrToEnable(\'' + row.code + '\',0)">延时启用</button>';
- if(row.effectiveDate!=null){
- str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',2)">取消延时启用</button>';
- }
- }
- return [str].join('');
- }
- },
- {
- field: 'classCode',
- title: '项目类型',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return classCodeMap.get(value);
- }
- },
- // {
- // field: 'ybCode',
- // title: '医保扩展码',
- // align: "center",
- // valign: 'middle'
- // }, {
- // field: 'xnhCode',
- // title: '新农合项目编码',
- // align: "center",
- // valign: 'middle'
- // }, {
- // field: 'xnhName',
- // title: '新农合项目名称',
- // align: "center",
- // valign: 'middle'
- // },
- {
- field: 'code',
- title: '项目编码',
- align: "center",
- valign: 'middle',
- }, {
- field: 'name',
- title: '项目名称',
- align: "center",
- valign: 'middle'
- }, {
- field: 'descriptions',
- title: '规格',
- align: "center",
- valign: 'middle'
- }, {
- field: 'chargeUnit',
- title: '单位',
- align: "center",
- valign: 'middle'
- }, {
- field: 'chargeAmount',
- title: '收费金额',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != null && value != undefined && value!="") {
- return value.toFixed(2);
- }
- return "";
- }
- },
- // {
- // field: 'percentag1',
- // title: '第一折扣率',
- // align: "center",
- // valign: 'middle',
- // formatter: function (value, row, index) {
- // if (value != null && value != undefined && value!="") {
- // return value.toFixed(2);
- // }
- // return "";
- // }
- // },
- {
- field: 'percentag2',
- title: '第二折扣率',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != null && value != undefined && value!="") {
- return value.toFixed(2);
- }
- return "";
- }
- }
- // ,{
- // field: 'percentag3',
- // title: '第三折扣率',
- // align: "center",
- // valign: 'middle',
- // formatter: function (value, row, index) {
- // if (value != null && value != undefined && value!="") {
- // return value.toFixed(2);
- // }
- // return "";
- // }
- // },
- // {
- // field: 'percentag4',
- // title: '第四折扣率',
- // align: "center",
- // valign: 'middle',
- // formatter: function (value, row, index) {
- // if (value != null && value != undefined && value!="") {
- // return value.toFixed(2);
- // }
- // return "";
- // }
- // },
- // {
- // field: 'percentag5',
- // title: '第五折扣率',
- // align: "center",
- // valign: 'middle',
- // formatter: function (value, row, index) {
- // if (value != null && value != undefined && value!="") {
- // return value.toFixed(2);
- // }
- // }
- // }
- // , {
- // field: 'effectiveDate',
- // title: '生效日期',
- // align: "center",
- // valign: 'middle',
- // formatter: function (value, row, index) {
- // if (value == null || value == "") {
- // return "";
- // }
- // return format(value, "yyyy-MM-dd");
- // }
- // }
- , {
- field: 'auditCode',
- title: '核算码',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return auditCodeMap.get(value);
- }
- }
- , {
- field: 'billItemMz',
- title: '门诊发票码',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return billItemMzMap.get(value);
- }
- }, {
- field: 'billItemZy',
- title: '住院发票码',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return billItemZyMap.get(value);
- }
- }
- , {
- field: 'co',
- title: '是否加价',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == 0) {
- return "否";
- }
- if (value == 1) {
- return "是";
- }
- }
- }, {
- field: 'xlCode',
- title: '加价率',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != null && value != undefined && value!="") {
- return parseFloat(value).toFixed(2);
- }
- return "";
- }
- }, {
- field: 'zdChargeBaClass',
- title: '病案统计编码',
- align: "center",
- valign: 'middle'
- }
- , {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle'
- }
- , {
- field: 'bzCode',
- title: '标准编码',
- align: "center",
- valign: 'middle'
- }, {
- field: 'discription',
- title: '报销类型',
- align: "center",
- valign: 'middle'
- }
- , {
- field: 'addDate',
- title: '创建时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }, {
- field: 'nationalCode',
- title: '国家医保编码',
- align: "center",
- valign: 'middle'
- }, {
- field: 'nationalName',
- title: '医保通用名称',
- align: "center",
- valign: 'middle'
- }, {
- field: 'hnsybCode',
- title: '省医保编码',
- align: "center",
- valign: 'middle'
- },{
- field: 'ybComment',
- title: '生产厂家',
- align: "center",
- valign: 'middle'
- }, {
- field: 'clCode',
- title: '耗材院内编码',
- align: "center",
- valign: 'middle'
- }, {
- field: 'excludeContent',
- title: '除外内容',
- align: "center",
- valign: 'middle'
- }, {
- field: 'connotation',
- title: '项目内涵',
- align: "center",
- valign: 'middle'
- }, {
- field: 'approvalNumber',
- title: '注册证编号',
- align: "center",
- valign: 'middle'
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- if (ress.message != null && ress.message != '') {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 构建列表查询参数
- * @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 temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- zdChargeItem: {
- name: $("#name").val(),
- classCode: $("#classCode").val(),
- auditCode: $("#auditCode").val(),
- billItemMz: $("#billItemMz").val(),
- billItemZy: $("#billItemZy").val(),
- delFlag: $("#delFlag").val()
- // ,clCode: $("#clCode").val()
- }
- };
- return temp;
- }
- /**
- * 取消延迟改价/取消延时启用或停用
- * @param code 项目编码
- * @param name 项目名称
- * @param type 类型 1 取消延时调价 2 取消延时启用 3 取消延时停用
- */
- function cancelEffective(code,name,type) {
- if (type == 1 && !confirm("确认要取消项目【"+name+"】的延时改价吗?")) {
- return;
- }
- if (type == 2 && !confirm("确认要取消项目【"+name+"】的延时启用吗?")) {
- return;
- }
- if (type == 3 && !confirm("确认要取消项目【"+name+"】的延时停用吗?")) {
- type=2;
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/cancelEffective?code='+code+'&type='+type,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(data.code==0){
- successMesage(data);
- $('#tb_table').bootstrapTable("refresh");
- }else {
- errorMesage(data);
- }
- }
- });
- }
- /**
- * 初始化下拉选
- */
- function initSelect() {
- //启动Bootsrap-Select
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- var yesNo = '<option value="1">是</option><option value="0">否</option>';
- $('#delFlag').html(yesNo);
- $('#delFlag').selectpicker('refresh');
- $('#coParams').html(yesNo);
- $('#coParams').selectpicker('refresh');
- $('#coParams').selectpicker('val', 0);
- $('#coParams').selectpicker('refresh');
- var groupNoParams='<option value="00">项目</option><option value="91">医材</option>';
- $('#groupNoParams').html(groupNoParams);
- $('#groupNoParams').selectpicker('refresh');
- $('#groupNoParams').selectpicker('val', '00');
- $('#groupNoParams').selectpicker('refresh');
- //查询所有收费项目类型
- $.ajax({
- type: "GET",
- url: '/thmz/getAllZdChargeClass',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- 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>';
- if (classCodeMap == null) {
- classCodeMap = new MyMap()
- }
- classCodeMap.put(comment.code, comment.name);
- });
- $('#classCode').empty(); //清空resText里面的所有内容
- $('#classCode').html(html);
- $('#classCode').selectpicker('refresh');
- $('#classCodeParams').empty(); //清空resText里面的所有内容
- $('#classCodeParams').html(html);
- $('#classCodeParams').selectpicker('refresh');
- }
- });
- //查询所有住院字典 核算码
- $.ajax({
- type: "GET",
- url: '/thmz/getAllZyZdAuditItem',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- 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.code + '">' + comment.name + '</option>';
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- if (auditCodeMap == null) {
- auditCodeMap = new MyMap()
- }
- auditCodeMap.put(comment.code, comment.name);
- });
- $('#auditCode').empty(); //清空resText里面的所有内容
- $('#auditCode').html(html);
- $('#auditCode').selectpicker('refresh');
- $('#auditCodeParams').empty(); //清空resText里面的所有内容
- $('#auditCodeParams').html(html);
- $('#auditCodeParams').selectpicker('refresh');
- }
- });
- //住院发票码
- $.ajax({
- type: "GET",
- url: '/thmz/getZyBillItems',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- 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.code + '">' + comment.name + '</option>';
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- if (billItemZyMap == null) {
- billItemZyMap = new MyMap()
- }
- billItemZyMap.put(comment.code, comment.name);
- });
- $('#billItemZy').empty(); //清空resText里面的所有内容
- $('#billItemZy').html(html);
- $('#billItemZy').selectpicker('refresh');
- $('#billItemZyParams').empty(); //清空resText里面的所有内容
- $('#billItemZyParams').html(html);
- $('#billItemZyParams').selectpicker('refresh');
- }
- });
- //门诊发票码
- $.ajax({
- type: "GET",
- url: '/thmz/getAllBillItems',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- 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.code + '">' + comment.name + '</option>';
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- if (billItemMzMap == null) {
- billItemMzMap = new MyMap()
- }
- billItemMzMap.put(comment.code, comment.name);
- });
- $('#billItemMz').empty(); //清空resText里面的所有内容
- $('#billItemMz').html(html);
- $('#billItemMz').selectpicker('refresh');
- $('#billItemMzParams').empty(); //清空resText里面的所有内容
- $('#billItemMzParams').html(html);
- $('#billItemMzParams').selectpicker('refresh');
- }
- });
- initDeptSelect();
- initZdChargeBaClass();
- }
- /**
- * 停用或者启用收费项目
- * @param code
- */
- function updateZdChargeItemDelFlag(code, name,delFlag) {
- if (delFlag == 1 && !confirm("确认要停用项目【"+name+"】信息吗?")) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/updateZdChargeItemDelFlag?code=' + code + "&delFlag=" + delFlag+"&effectiveDate=null",
- 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;
- }
- if (res.code == 0) {
- successMesage(res);
- $('#tb_table').bootstrapTable("refresh");
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 修改收费项目
- * @param code
- */
- function updateZdChargeItem(code) {
- $("#myModalLabel").text("编辑收费项目");
- $.ajax({
- type: "GET",
- url: '/thmz/getZdChargeItemByCode?code=' + code,
- 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;
- }
- if (res.code == 0) {
- $('#classCodeParams').selectpicker('val', res.data.classCode);
- $('#classCodeParams').selectpicker('refresh');
- // $("#ybCodeParmas").val(res.data.ybCode);
- // $("#xnhCodeParams").val(res.data.xnhCode);
- // $("#xnhNameParams").val(res.data.xnhName);
- $("#namePamras").val(res.data.name);
- $("#chargeUnitParams").val(res.data.chargeUnit);
- $("#chargeAmountParams").val(res.data.chargeAmount);
- //$("#percentag1Params").val(res.data.percentag1);
- $("#percentag2Params").val(res.data.percentag2);
- // $("#percentag3Params").val(res.data.percentag3);
- // $("#percentag4Params").val(res.data.percentag4);
- // $("#percentag5Params").val(res.data.percentag5);
- $('#auditCodeParams').selectpicker('val', res.data.auditCode);
- $('#auditCodeParams').selectpicker('refresh');
- $('#billItemMzParams').selectpicker('val', res.data.billItemMz);
- $('#billItemMzParams').selectpicker('refresh');
- $('#billItemZyParams').selectpicker('val', res.data.billItemZy);
- $('#billItemZyParams').selectpicker('refresh');
- $('#execUnitParams').selectpicker('val', res.data.execUnit);
- $('#execUnitParams').selectpicker('refresh');
- $("#bzCodeParams").val(res.data.bzCode);
- $("#discriptionParams").val(res.data.discription);
- $("#ybCommentParams").val(res.data.ybComment);
- $("#clCodeParams").val(res.data.clCode);
- $("#nationalCodeParams").val(res.data.nationalCode);
- $("#nationalNameParams").val(res.data.nationalName);
- $("#hnsybCodeParams").val(res.data.hnsybCode);
- $("#descriptionsParams").val(res.data.descriptions);
- $("#excludeContentParams").val(res.data.excludeContent);
- $("#connotationParams").val(res.data.connotation);
- $("#approvalNumberParams").val(res.data.approvalNumber);
- $("#maxAgeRestriction").val(res.data.maxAgeRestriction);
- $("#minAgeRestriction").val(res.data.minAgeRestriction);
- $("#genderRestriction").val(res.data.genderRestriction);
- $('#genderRestriction').selectpicker('refresh');
- $('#coParams').selectpicker('val', res.data.co);
- if(res.data.co==null || res.data.co==""){
- $('#coParams').selectpicker('val', 0);
- }
- $('#coParams').selectpicker('refresh');
- $("#xlCodeParams").val(res.data.xlCode);
- if(res.data.co==1 && (res.data.xlCode==null || res.data.xlCode=="")){
- $("#xlCodeParams").val(0.5);
- }
- $('#groupNoParams').selectpicker('val', res.data.groupNo);
- $('#groupNoParams').selectpicker('refresh');
- $("#code").val(res.data.code);
- $('#zdChargeBaClassParams').selectpicker('val', res.data.zdChargeBaClass);
- $('#zdChargeBaClassParams').selectpicker('refresh');
- $("#focusMonitorFlag").val(!stringNotBlank(res.data.focusMonitorFlag) ? '0' : res.data.focusMonitorFlag );
- $('#focusMonitorFlag').selectpicker('refresh');
- $("#chargeDetailModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 收费项目延时启用/收费项目延时停用
- * @param code
- * @param delFlag 1 停用 0 启用
- */
- function delayStopOrToEnable(code,delFlag) {
- $.ajax({
- type: "GET",
- url: '/thmz/getZdChargeItemByCode?code=' + code,
- 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;
- }
- if (res.code == 0) {
- $("#delayToEnableOrStop").val(delFlag);
- if(delFlag==0){
- $("#delayToEnableOrStopTitle").html("延时启用收费项目");
- }else if(delFlag==1){
- $("#delayToEnableOrStopTitle").html("延时停用收费项目");
- }
- $("#nameDelayToEnableOrStopParams").val(res.data.name);
- $("#code_delayToEnableOrStopParams").val(res.data.code);
- if(res.data.effectiveDate!=null){
- $("#effectiveTimeDelayToEnableOrStopParams").val(format(res.data.effectiveDate, "yyyy-MM-dd"));
- }
- $("#delayToEnableOrStopModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 收费项目延时调价
- * @param code
- */
- function updateZdChargeItemPrice(code) {
- $.ajax({
- type: "GET",
- url: '/thmz/getZdChargeItemByCode?code=' + code,
- 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;
- }
- if (res.code == 0) {
- $("#namepPricePamras").val(res.data.name);
- $("#chargeAmountPriceParams").val(res.data.chargeAmount);
- $("#code_price").val(res.data.code);
- $("#chargeAmountPriceNeedUpdateParams").val(res.data.effectivePrice);
- if(res.data.effectiveTime!=null){
- $("#effectiveTimeParams").val(format(res.data.effectiveTime, "yyyy-MM-dd"));
- }
- $("#priceModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 挂号列表中的科室列表
- */
- function initDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allUnitCode',
- 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 = '<option value="-1"></option>';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#execUnitParams').empty();
- $('#execUnitParams').html(html);
- $('#execUnitParams').selectpicker('refresh');
- }
- });
- }
- /**
- * 病案统计编码
- */
- function initZdChargeBaClass() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getAllZdChargeBaClass',
- 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 = '<option value="-1"></option>';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name+'</option>';
- });
- $('#zdChargeBaClassParams').empty();
- $('#zdChargeBaClassParams').html(html);
- $('#zdChargeBaClassParams').selectpicker('refresh');
- }
- });
- }
- /**
- * 清空输入框
- */
- function clearInput() {
- $("#namePamras").val(null);
- $("#chargeUnitParams").val(null);
- $("#chargeAmountParams").val(null);
- $("#percentag2Params").val(1);
- // $('#classCodeParams').selectpicker('val', null);
- // $('#classCodeParams').selectpicker('refresh');
- // $('#auditCodeParams').selectpicker('val', null);
- // $('#auditCodeParams').selectpicker('refresh');
- // $('#billItemMzParams').selectpicker('val', null);
- // $('#billItemMzParams').selectpicker('refresh');
- // $('#billItemZyParams').selectpicker('val', null);
- // $('#billItemZyParams').selectpicker('refresh');
- // $('#execUnitParams').selectpicker('val', null);
- // $('#execUnitParams').selectpicker('refresh');
- $("#bzCodeParams").val(null);
- $("#discriptionParams").val(null);
- $("#ybCommentParams").val(null);
- $("#clCodeParams").val(null);
- $("#nationalCodeParams").val(null);
- $("#nationalNameParams").val(null);
- $("#descriptionsParams").val(null);
- $("#excludeContentParams").val(null);
- $("#connotationParams").val(null);
- $("#approvalNumberParams").val(null);
- $('#coParams').selectpicker('val', 0);
- $('#coParams').selectpicker('refresh');
- $('#focusMonitorFlag').selectpicker('val', '0');
- $('#focusMonitorFlag').selectpicker('refresh');
- $('#groupNoParams').selectpicker('val', '00');
- $('#groupNoParams').selectpicker('refresh');
- $("#xlCodeParams").val(null);
- $("#code").val(null);
- $('#zdChargeBaClassParams').selectpicker('val', null);
- $('#zdChargeBaClassParams').selectpicker('refresh');
- }
- /**
- * 清空输入框
- */
- function clearPriceInput() {
- $("#namepPricePamras").val(null);
- $("#chargeAmountPriceParams").val(null);
- $("#chargeAmountPriceNeedUpdateParams").val(null);
- $("#effectiveTimeParams").val(null);
- $("#code_price").val(null);
- }
- /**
- * 清空输入框
- */
- function clearDelayToEnableOrStopInput() {
- $("#nameDelayToEnableOrStopParams").val(null);
- $("#effectiveTimeDelayToEnableOrStopParams").val(null);
- $("#code_delayToEnableOrStopParams").val(null);
- $("#delayToEnableOrStop").val(null);
- }
- /**
- * 加价率改变事件
- */
- function setXlCodeParams() {
- var value = $('#coParams').val();
- if(value==1){
- if($("#xlCodeParams").val()==null || $("#xlCodeParams").val()==""){
- $("#xlCodeParams").val(0.5);
- }
- }else {
- $("#xlCodeParams").val(null);
- }
- }
|