12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706 |
- //@ sourceURL=jc_jy_zd_item.js
- var chargeItemMap = null;
- var chargeItemObj = null;
- $(function () {
- $("#btn_add").click(function (t) {
- var sourceGroup = getIndex("source_group");
- if (sourceGroup == 0) {
- $("#editJcModal").modal();
- $("#classJcTitle").text("新增");
- clearJcInput();
- } else {
- $("#editJyModal").modal();
- $("#classJyTitle").text("新增");
- clearJyInput()
- }
- });
- $("#btn_save").click(function (t) {
- $("#messageModal").modal();
- $("#editJcModal").modal("hide");
- $("#messageContent").html("确认要保存当前检查项目吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveJcZdItem();
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#editJcModal").modal();
- });
- });
- $("#btn_jy_save").click(function (t) {
- $("#messageModal").modal();
- $("#editJyModal").modal("hide");
- $("#messageContent").html("确认要保存当前检验项目吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveJyZdItem();
- });
- $("#cancelButton").off("click").on("click", function (t) {
- $("#editJyModal").modal();
- });
- });
- $("#btn_saveJcCharge").click(function (t) {
- $("#messageModal").modal();
- $("#messageContent").html("确认要保存当前明细项目吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveJcCharge();
- });
- });
- $("#btn_saveJyCharge").click(function (t) {
- $("#messageModal").modal();
- $("#messageContent").html("确认要保存当前明细项目吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- saveJyCharge();
- });
- });
- initJcZdItemList();
- $("#btn_query").click(function (t) {
- var sourceGroup = getIndex("source_group");
- if (sourceGroup == 0) {
- initJcZdItemList()
- } else {
- initJyZdItemList();
- }
- });
- initSelect();
- initExecUnit();
- initBwCode();
- $('#btn_clean').click(function () {
- $("#jcClassParams").selectpicker('val', null);//默认选中
- $("#jcClassParams").selectpicker('refresh');
- $("#bwParams").selectpicker('val', null);//默认选中
- $("#bwParams").selectpicker('refresh');
- $("#jyClassParams").selectpicker('val', null);//默认选中
- $("#jyClassParams").selectpicker('refresh');
- $("#sampleCodeParams").selectpicker('val', null);//默认选中
- $("#sampleCodeParams").selectpicker('refresh');
- $("#vesselParams").selectpicker('val', null);//默认选中
- $("#vesselParams").selectpicker('refresh');
- $("#execUnitParams").selectpicker('val', null);//默认选中
- $("#execUnitParams").selectpicker('refresh');
- $("#nameParam").val(null);
- $("#delFlagParams").selectpicker('val', null);//默认选中
- $("#delFlagParams").selectpicker('refresh');
- });
- });
- /**
- * 号表类型切换事件
- * @param object
- */
- function sourceChange(object) {
- $("#source_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- var sourceGroup = getIndex("source_group");
- if (sourceGroup == 0) {
- $("#jcParams").removeClass("hide").addClass("in");
- $("#jyParams").removeClass("in").addClass("hide");
- initJcZdItemList();
- } else {
- $("#jyParams").removeClass("hide").addClass("in");
- $("#jcParams").removeClass("in").addClass("hide");
- initJyZdItemList();
- }
- $('#tb_table_mx').bootstrapTable("destroy");
- }
- /**
- * 获取按钮组选择的下标
- * @param id
- * @returns {number}
- */
- function getIndex(id) {
- var index = 0;
- var item = $("#" + id).find("button");
- for (var i = 0; i <= item.length; i++) {
- if ($(item[i]).hasClass("btn-primary")) {
- index = i;
- break;
- }
- }
- return index;
- }
- /**
- * 保存檢查项目
- */
- function saveJcZdItem() {
- var code = $("#code").val();
- var data = null;
- let min = $("#minAgeRestriction").val();
- let max = $("#maxAgeRestriction").val();
- let s;
- if(min){
- s = callJcJyAgeFormat(min)
- if(s === '-1'){
- return false;
- }
- }
- if(max){
- s = callJcJyAgeFormat(max)
- if(s === '-1'){
- return false;
- }
- }
- //修改檢查
- if (code != null) {
- data = JSON.stringify({
- code: code,
- name: $("#name").val(),
- classCode: $("#classCode").val(),
- execUnit: $("#execUnit").val(),
- bwCode: $("#bwCode").val(),
- delFlag: $("#delFlag").val(),
- zyFlag: $("#zyFlag").val(),
- mzFlag: $("#mzFlag").val(),
- execAddress:$("#execAddress").val(),
- genderRestriction:$("#genderRestriction").val(),
- minAgeRestriction:$("#minAgeRestriction").val(),
- maxAgeRestriction:$("#maxAgeRestriction").val(),
- timeLimit:$("#timeLimit").val()
- });
- } else {
- //新增檢查
- data = JSON.stringify({
- name: $("#name").val(),
- classCode: $("#classCode").val(),
- execUnit: $("#execUnit").val(),
- bwCode: $("#bwCode").val(),
- delFlag: $("#delFlag").val(),
- zyFlag: $("#zyFlag").val(),
- mzFlag: $("#mzFlag").val(),
- execAddress:$("#execAddress").val(),
- genderRestriction:$("#genderRestriction").val(),
- minAgeRestriction:$("#minAgeRestriction").val(),
- maxAgeRestriction:$("#maxAgeRestriction").val(),
- timeLimit:$("#timeLimit").val()
- });
- }
- $.ajax({
- type: "POST",
- url: '/thmz/saveJcZdItem',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: data,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#editJcModal").modal("hide");
- clearJcInput();
- $('#tb_table').bootstrapTable('refresh');
- successMesage(res);
- } else {
- $("#editJcModal").modal();
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 保存檢查项目明细
- */
- function saveJcCharge() {
- $.ajax({
- type: "POST",
- url: '/thmz/saveJcChargeItem',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: $("#jcItemCode").val(),
- chargeCode: $("#chargeItem").val(),
- amount: $("#amount").val(),
- zyFlag: $("#zyFlagJcCharge").val(),
- mzFlag: $("#mzFlagJcCharge").val()
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#editJcChargeItemModal").modal("hide");
- getJcItemChargesByItemCode($("#jcItemCode").val());
- clearJcChargeItemInput();
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 保存檢验项目明细
- */
- function saveJyCharge() {
- $.ajax({
- type: "POST",
- url: '/thmz/saveJyChargeItem',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: $("#jyItemCode").val(),
- chargeCode: $("#chargeItemJy").val(),
- amount: $("#amountJy").val(),
- zyFlag: $("#zyFlagJyCharge").val(),
- mzFlag: $("#mzFlagJyCharge").val()
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#editJyChargeItemModal").modal("hide");
- getJyItemChargesByItemCode($("#jyItemCode").val());
- clearJyChargeItemInput();
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 保存檢验项目
- */
- function saveJyZdItem() {
- var code = $("#codeJy").val();
- var data = null;
- let min = $("#minAgeRestrictionJy").val();
- let max = $("#maxAgeRestrictionJy").val();
- let s;
- if(min){
- s = callJcJyAgeFormat(min)
- if(s === '-1'){
- return false;
- }
- }
- if(max){
- s = callJcJyAgeFormat(max)
- if(s === '-1'){
- return false;
- }
- }
- //修改檢验
- if (code != null) {
- data = JSON.stringify({
- code: code,
- name: $("#nameJy").val(),
- classCode: $("#classCodeJy").val(),
- execUnit: $("#execUnitJy").val(),
- sampleCode: $("#sampleCode").val(),
- vessel: $("#vessel").val(),
- delFlag: $("#delFlagJy").val(),
- zyFlag: $("#zyFlagJy").val(),
- mzFlag: $("#mzFlagJy").val(),
- execAddress:$("#jyExecAddress").val(),
- genderRestriction:$("#genderRestrictionJy").val(),
- minAgeRestriction:$("#minAgeRestrictionJy").val(),
- maxAgeRestriction:$("#maxAgeRestrictionJy").val(),
- timeLimit:$("#timeLimitJy").val()
- });
- } else {
- //新增檢验
- data = JSON.stringify({
- name: $("#nameJy").val(),
- classCode: $("#classCodeJy").val(),
- execUnit: $("#execUnitJy").val(),
- sampleCode: $("#sampleCode").val(),
- vessel: $("#vessel").val(),
- delFlag: $("#delFlagJy").val(),
- zyFlag: $("#zyFlagJy").val(),
- mzFlag: $("#mzFlagJy").val(),
- execAddress:$("#jyExecAddress").val(),
- genderRestriction:$("#genderRestrictionJy").val(),
- minAgeRestriction:$("#minAgeRestrictionJy").val(),
- maxAgeRestriction:$("#maxAgeRestrictionJy").val(),
- timeLimit:$("#timeLimitJy").val(),
- });
- }
- $.ajax({
- type: "POST",
- url: '/thmz/saveJyZdItem',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: data,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#editJyModal").modal("hide");
- clearJyInput();
- $('#tb_table').bootstrapTable('refresh');
- successMesage(res);
- } else {
- $("#editJyModal").modal();
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空输入框
- */
- function clearJcInput() {
- $("#code").val(null);
- $("#name").val(null);
- $("#classCode").selectpicker('val', null);//默认不选中
- $("#classCode").selectpicker('refresh');
- $("#execUnit").selectpicker('val', null);//默认不选中
- $("#execUnit").selectpicker('refresh');
- $("#bwCode").selectpicker('val', null);//默认不选中
- $("#bwCode").selectpicker('refresh');
- $("#delFlag").selectpicker('val', 0);//默认不选中
- $("#delFlag").selectpicker('refresh');
- $("#zyFlag").selectpicker('val', 0);//默认不选中
- $("#zyFlag").selectpicker('refresh');
- $("#mzFlag").selectpicker('val', 0);//默认不选中
- $("#mzFlag").selectpicker('refresh');
- $("#execAddress").val(null);
- $("#genderRestriction").selectpicker('val', '');//默认不选中
- $("#genderRestriction").selectpicker('refresh');
- $("#minAgeRestriction").val(null);
- $("#maxAgeRestriction").val(null);
- $("#timeLimit").val(null);
- }
- /**
- * 清空输入框
- */
- function clearJcChargeItemInput() {
- $("#jcItemCode").val(null);
- $("#amount").val(null);
- $("#chargeAmount").val(null);
- $("#chargeItem").selectpicker('val', null);//默认不选中
- $("#chargeItem").selectpicker('refresh');
- $("#zyFlagJcCharge").selectpicker('val', 0);//默认不选中
- $("#zyFlagJcCharge").selectpicker('refresh');
- $("#mzFlagJcCharge").selectpicker('val', 0);//默认不选中
- $("#mzFlagJcCharge").selectpicker('refresh');
- }
- /**
- * 清空输入框
- */
- function clearJyChargeItemInput() {
- $("#jyItemCode").val(null);
- $("#amountJy").val(null);
- $("#chargeAmountJy").val(null);
- $("#chargeItemJy").selectpicker('val', null);//默认不选中
- $("#chargeItemJy").selectpicker('refresh');
- $("#zyFlagJyCharge").selectpicker('val', 0);//默认不选中
- $("#zyFlagJyCharge").selectpicker('refresh');
- $("#mzFlagJyCharge").selectpicker('val', 0);//默认不选中
- $("#mzFlagJyCharge").selectpicker('refresh');
- }
- /**
- * 清空输入框
- */
- function clearJyInput() {
- $("#codeJy").val(null);
- $("#nameJy").val(null);
- $("#classCodeJy").selectpicker('val', null);//默认不选中
- $("#classCodeJy").selectpicker('refresh');
- $("#execUnitJy").selectpicker('val', null);//默认不选中
- $("#execUnitJy").selectpicker('refresh');
- $("#sampleCode").selectpicker('val', null);//默认不选中
- $("#sampleCode").selectpicker('refresh');
- $("#vessel").selectpicker('val', null);//默认不选中
- $("#vessel").selectpicker('refresh');
- $("#delFlagJy").selectpicker('val', 0);//默认不选中
- $("#delFlagJy").selectpicker('refresh');
- $("#zyFlagJy").selectpicker('val', 0);//默认不选中
- $("#zyFlagJy").selectpicker('refresh');
- $("#mzFlagJy").selectpicker('val', 0);//默认不选中
- $("#mzFlagJy").selectpicker('refresh');
- $("#jyExecAddress").val(null);
- $("#genderRestrictionJy").selectpicker('val', '');//默认不选中
- $("#genderRestrictionJy").selectpicker('refresh');
- $("#minAgeRestrictionJy").val(null);
- $("#maxAgeRestrictionJy").val(null);
- $("#timeLimitJy").val(null);
- }
- /**
- * 查询检查项目列表
- */
- function initJcZdItemList() {
- $('#tb_table').bootstrapTable("destroy");
- $('#tb_table').bootstrapTable({
- url: '/thmz/listJcZdItem', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 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: '操作',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- var str;
- if (row.delFlag == 1) {
- str = '<button type="button" class="btn btn-success btn-sm" onclick="updateDeleteJcZdItem(\'' + row.code + '\',\'' + row.name + '\',\'' + row.delFlag + '\')">启用</button>';
- } else {
- str = '<button type="button" class="btn btn-warning btn-sm" onclick="updateDeleteJcZdItem(\'' + row.code + '\',\'' + row.name + '\',\'' + row.delFlag + '\')">停用</button>';
- }
- str += '<button type="button" class="btn btn-primary btn-sm" onclick="editJcZdItem(\'' + row.code + '\')">编辑</button>';
- str += '<button type="button" class="btn btn-default btn-sm" onclick="addChargeZdItem(\'' + row.code + '\')">添加细目</button>';
- return [str].join('');
- }
- },
- {
- field: 'name',
- title: '项目名称',
- align: "center",
- valign: 'middle'
- }, {
- field: 'classCode',
- title: '分类',
- align: "center",
- valign: 'middle',
- }, {
- field: 'execUnit',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- }, {
- field: 'bwCode',
- title: '部位',
- align: "center",
- valign: 'middle'
- }
- ],
- onClickRow: function (row) {
- getJcItemChargesByItemCode(row.code);
- },
- 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 != '') {
- errorMesage(res);
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 根据检查项目查询对应的明细列表
- * @param code
- */
- function getJcItemChargesByItemCode(code) {
- $('#tb_table_mx').bootstrapTable("destroy");
- $('#tb_table_mx').bootstrapTable({
- url: '/thmz/getJcItemChargesByItemCode?code=' + code, //请求后台的URL(*)
- method: 'get', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 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: '操作',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (row.code == null || row.code == "") {
- return "";
- }
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick="editJcChargeItem(\'' + row.code + '\',\'' + row.charge_code + '\')">编辑</button>';
- str += '<button type="button" class="btn btn-danger btn-sm" onclick="deleteJcChargeItem(\'' + row.code + '\',\'' + row.charge_code + '\')">删除</button>';
- return [str].join('');
- }
- },
- {
- field: 'code',
- title: '项目编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'charge_code',
- title: '收费编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'name',
- title: '收费项目名称',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'amount',
- title: '数量',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'charge_amount',
- title: '单价',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != null) {
- return Math.abs(value).toFixed(2);
- }
- }
- },
- {
- field: 'hnsyb_code',
- title: '省医保编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'national_code',
- title: '国家医保编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'national_name',
- title: '国家医保名称',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'zy_flag',
- title: '住院停用',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (row.code == null || row.code == "") {
- return "";
- }
- if (value == 1 || value == "1") {
- return "是";
- }
- return "否";
- }
- },
- {
- field: 'mz_flag',
- title: '门诊停用',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (row.code == null || row.code == "") {
- return "";
- }
- if (value == 1 || value == "1") {
- return "是";
- }
- return "否";
- }
- }
- ],
- 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 != '') {
- errorMesage(res);
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 查询检验列表
- */
- function initJyZdItemList() {
- $('#tb_table').bootstrapTable("destroy");
- $('#tb_table').bootstrapTable({
- url: '/thmz/listJyZdItem', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 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: '操作',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- var str;
- if (row.delFlag == 1) {
- str = '<button type="button" class="btn btn-success btn-sm" onclick="updateDeleteJyZdItem(\'' + row.code + '\',\'' + row.name + '\',\'' + row.delFlag + '\')">启用</button>';
- } else {
- str = '<button type="button" class="btn btn-warning btn-sm" onclick="updateDeleteJyZdItem(\'' + row.code + '\',\'' + row.name + '\',\'' + row.delFlag + '\')">停用</button>';
- }
- str += '<button type="button" class="btn btn-primary btn-sm" onclick="editJyZdItem(\'' + row.code + '\')">编辑</button>';
- str += '<button type="button" class="btn btn-default btn-sm" onclick="addChargeJyZdItem(\'' + row.code + '\')">添加细目</button>';
- return [str].join('');
- }
- },
- {
- field: 'name',
- title: '项目名称',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'classCode',
- title: '分类',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'sampleCode',
- title: '标本',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'vessel',
- title: '容器类型',
- align: "center",
- valign: 'middle'
- }, {
- field: 'execUnit',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- }
- ],
- onClickRow: function (row) {
- getJyItemChargesByItemCode(row.code);
- },
- 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 != '') {
- errorMesage(res);
- }
- 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 sourceGroup = getIndex("source_group");
- if (sourceGroup == 0) {
- var temp = {
- code: $('#nameParam').val(),
- execUnit: $('#execUnitParams').val(),
- classCode: $('#jcClassParams').val(),
- bwCode: $('#bwParams').val(),
- delFlag: $('#delFlagParams').val(),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- };
- } else {
- var temp = {
- code: $('#nameParam').val(),
- execUnit: $('#execUnitParams').val(),
- classCode: $('#jyClassParams').val(),
- sampleCode: $('#sampleCodeParams').val(),
- vessel: $('#vesselParams').val(),
- delFlag: $('#delFlagParams').val(),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- };
- }
- return temp;
- };
- /**
- * 根据检验项目查询对应的明细列表
- * @param code
- */
- function getJyItemChargesByItemCode(code) {
- $('#tb_table_mx').bootstrapTable("destroy");
- $('#tb_table_mx').bootstrapTable({
- url: '/thmz/getJyItemChargesByItemCode?code=' + code, //请求后台的URL(*)
- method: 'get', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 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: '操作',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (row.code == null || row.code == "") {
- return "";
- }
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick="editJyChargeItem(\'' + row.code + '\',\'' + row.charge_code + '\')">编辑</button>';
- str += '<button type="button" class="btn btn-warning btn-sm" onclick="deleteJyChargeItem(\'' + row.code + '\',\'' + row.charge_code + '\')">删除</button>';
- return [str].join('');
- }
- },
- {
- field: 'code',
- title: '项目编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'charge_code',
- title: '收费编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'name',
- title: '收费项目名称',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'amount',
- title: '数量',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'charge_amount',
- title: '单价',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != null) {
- return Math.abs(value).toFixed(2);
- }
- }
- },
- {
- field: 'hnsyb_code',
- title: '省医保编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'national_code',
- title: '国家医保编码',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'national_name',
- title: '国家医保名称',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'zy_flag',
- title: '住院停用',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (row.code == null || row.code == "") {
- return "";
- }
- if (value == 1 || value == "1") {
- return "是";
- }
- return "否";
- }
- },
- {
- field: 'mz_flag',
- title: '门诊停用',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (row.code == null || row.code == "") {
- return "";
- }
- if (value == 1 || value == "1") {
- return "是";
- }
- return "否";
- }
- }
- ],
- 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 != '') {
- errorMesage(res);
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 删除记录 (停用)
- * @param code
- */
- function updateDeleteJcZdItem(code, name, delFlag) {
- var message = null;
- if (delFlag == 1) {
- message = "您确认要启用【" + name + "】项目吗?";
- delFlag = 0;
- } else {
- message = "您确认要停用【" + name + "】项目吗?";
- delFlag = 1;
- }
- $("#messageModal").modal();
- $("#messageContent").html(message);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/saveJcZdItem',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: code,
- delFlag: delFlag,
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#tb_table').bootstrapTable('refresh');
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 删除记录 (停用) 检验
- * @param code
- */
- function updateDeleteJyZdItem(code, name, delFlag) {
- var message = null;
- if (delFlag == 1) {
- message = "您确认要启用【" + name + "】项目吗?";
- delFlag = 0;
- } else {
- message = "您确认要停用【" + name + "】项目吗?";
- delFlag = 1;
- }
- $("#messageModal").modal();
- $("#messageContent").html(message);
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/saveJyZdItem',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: code,
- delFlag: delFlag,
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#tb_table').bootstrapTable('refresh');
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 打开编辑检查窗口
- * @param code
- */
- function editJcZdItem(code) {
- $("#classJcTitle").text("修改");
- $.ajax({
- type: "GET",
- url: '/thmz/getJcZdItemByCode?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) {
- $("#code").val(res.data.code);
- $("#name").val(res.data.name);
- $("#classCode").selectpicker('val', res.data.classCode);//默认不选中
- $("#classCode").selectpicker('refresh');
- $("#execUnit").selectpicker('val', res.data.execUnit);//默认不选中
- $("#execUnit").selectpicker('refresh');
- $("#bwCode").selectpicker('val', res.data.bwCode);//默认不选中
- $("#bwCode").selectpicker('refresh');
- $("#delFlag").selectpicker('val', res.data.delFlag);//默认不选中
- $("#delFlag").selectpicker('refresh');
- $("#zyFlag").selectpicker('val', res.data.zyFlag);//默认不选中
- $("#zyFlag").selectpicker('refresh');
- $("#mzFlag").selectpicker('val', res.data.mzFlag);//默认不选中
- $("#mzFlag").selectpicker('refresh');
- $("#execAddress").val(res.data.execAddress);
- $("#genderRestriction").selectpicker('val', res.data.genderRestriction);//默认不选中
- $("#genderRestriction").selectpicker('refresh');
- $("#minAgeRestriction").val(res.data.minAgeRestriction);
- $("#maxAgeRestriction").val(res.data.maxAgeRestriction);
- $("#timeLimit").val(res.data.timeLimit);
- $("#editJcModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打开编辑检验窗口
- * @param code
- */
- function editJyZdItem(code) {
- $("#classJyTitle").text("修改");
- $.ajax({
- type: "GET",
- url: '/thmz/getJyZdItemByCode?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) {
- $("#codeJy").val(res.data.code);
- $("#nameJy").val(res.data.name);
- $("#classCodeJy").selectpicker('val', res.data.classCode);//默认不选中
- $("#classCodeJy").selectpicker('refresh');
- $("#execUnitJy").selectpicker('val', res.data.execUnit);//默认不选中
- $("#execUnitJy").selectpicker('refresh');
- $("#sampleCode").selectpicker('val', res.data.sampleCode);//默认不选中
- $("#sampleCode").selectpicker('refresh');
- $("#vessel").selectpicker('val', res.data.vessel);//默认不选中
- $("#vessel").selectpicker('refresh');
- $("#delFlagJy").selectpicker('val', res.data.delFlag);//默认不选中
- $("#delFlagJy").selectpicker('refresh');
- $("#zyFlagJy").selectpicker('val', res.data.zyFlag);//默认不选中
- $("#zyFlagJy").selectpicker('refresh');
- $("#mzFlagJy").selectpicker('val', res.data.mzFlag);//默认不选中
- $("#mzFlagJy").selectpicker('refresh');
- $("#jyExecAddress").val(res.data.execAddress);
- $("#genderRestrictionJy").selectpicker('val', res.data.genderRestriction);//默认不选中
- $("#genderRestrictionJy").selectpicker('refresh');
- $("#minAgeRestrictionJy").val(res.data.minAgeRestriction);
- $("#maxAgeRestrictionJy").val(res.data.maxAgeRestriction);
- $("#timeLimitJy").val(res.data.timeLimit);
- $("#editJyModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打开编辑检查收费明细弹窗
- * @param code
- * @param chargeCode
- */
- function editJcChargeItem(code, chargeCode) {
- $.ajax({
- type: "POST",
- url: '/thmz/getJcItemCharge',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: code,
- chargeCode: chargeCode
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#chargeJcTitle").text("编辑");
- $("#jcItemCode").val(res.data.code);
- $("#amount").val(res.data.amount);
- $("#chargeItem").selectpicker('val', res.data.chargeCode);//默认不选中
- $("#chargeItem").selectpicker('refresh');
- $("#zyFlagJcCharge").selectpicker('val', res.data.zyFlag);//默认不选中
- $("#zyFlagJcCharge").selectpicker('refresh');
- $("#mzFlagJcCharge").selectpicker('val', res.data.mzFlag);//默认不选中
- $("#mzFlagJcCharge").selectpicker('refresh');
- setChargeAmount();
- $("#editJcChargeItemModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 删除检查收费明细
- * @param code
- * @param chargeCode
- */
- function deleteJcChargeItem(code, chargeCode) {
- $("#messageModal").modal();
- $("#messageContent").html("确认删除当前检查项目的该条明细项目吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/removeJcItemCharge',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: code,
- chargeCode: chargeCode
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#tb_table_mx').bootstrapTable('refresh');
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 打开编辑检验收费明细弹窗
- * @param code
- * @param chargeCode
- */
- function editJyChargeItem(code, chargeCode) {
- $.ajax({
- type: "POST",
- url: '/thmz/getJyItemCharge',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: code,
- chargeCode: chargeCode
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#chargeJyTitle").text("编辑");
- $("#jyItemCode").val(res.data.code);
- $("#amountJy").val(res.data.amount);
- $("#chargeItemJy").selectpicker('val', res.data.chargeCode);//默认不选中
- $("#chargeItemJy").selectpicker('refresh');
- $("#zyFlagJyCharge").selectpicker('val', res.data.zyFlag);//默认不选中
- $("#zyFlagJyCharge").selectpicker('refresh');
- $("#mzFlagJyCharge").selectpicker('val', res.data.mzFlag);//默认不选中
- $("#mzFlagJyCharge").selectpicker('refresh');
- setChargeAmountJy();
- $("#editJyChargeItemModal").modal();
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 删除检验收费明细
- * @param code
- * @param chargeCode
- */
- function deleteJyChargeItem(code, chargeCode) {
- $("#messageModal").modal();
- $("#messageContent").html("确认删除当前检查项目的该条明细项目吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "POST",
- url: '/thmz/removeJyItemCharge',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify({
- code: code,
- chargeCode: chargeCode
- }),
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#tb_table_mx').bootstrapTable('refresh');
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- });
- }
- /**
- * 初始化科室下拉选
- */
- function initExecUnit() {
- //父科室列表
- $.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;
- }
- $('#execUnit').empty(); //清空resText里面的所有内容
- var html = '<option value="-1"></option>';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
- });
- $('#execUnit').html(html);
- $('#execUnit').selectpicker('refresh');
- $('#execUnitJy').empty();
- $('#execUnitJy').html(html);
- $('#execUnitJy').selectpicker('refresh');
- $('#execUnitParams').empty();
- $('#execUnitParams').html(html);
- $('#execUnitParams').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始化部位下拉选
- */
- function initBwCode() {
- $.ajax({
- type: "GET",
- url: '/thmz/getYshZdPartCode',
- 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 + '-' + comment.code + ')</option>';
- });
- $('#bwCode').empty(); //清空resText里面的所有内容
- $('#bwCode').html(html);
- $('#bwCode').selectpicker('refresh');
- $('#bwParams').empty(); //清空resText里面的所有内容
- $('#bwParams').html(html);
- $('#bwParams').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始化下拉选
- */
- function initSelect() {
- //启动Bootsrap-Select
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- var yesNo = '<option value="1">是</option><option value="0">否</option>';
- var optionSex = '<option value="">不限</option><option value="1">限男性</option><option value="2">限女性</option>';
- $('#genderRestriction').html(optionSex);
- $('#genderRestriction').selectpicker('refresh');
- $("#genderRestriction").selectpicker('val', '');
- $("#genderRestriction").selectpicker('refresh');
- $('#delFlag').html(yesNo);
- $('#delFlag').selectpicker('refresh');
- $("#delFlag").selectpicker('val', 0);
- $("#delFlag").selectpicker('refresh');
- $('#zyFlag').html(yesNo);
- $('#zyFlag').selectpicker('refresh');
- $("#zyFlag").selectpicker('val', 0);
- $("#delFlag").selectpicker('refresh');
- $('#mzFlag').html(yesNo);
- $('#mzFlag').selectpicker('refresh');
- $("#mzFlag").selectpicker('val', 0);
- $("#mzFlag").selectpicker('refresh');
- $('#zyFlagJcCharge').html(yesNo);
- $('#zyFlagJcCharge').selectpicker('refresh');
- $("#zyFlagJcCharge").selectpicker('val', 0);
- $("#zyFlagJcCharge").selectpicker('refresh');
- $('#mzFlagJcCharge').html(yesNo);
- $('#mzFlagJcCharge').selectpicker('refresh');
- $("#mzFlagJcCharge").selectpicker('val', 0);
- $("#mzFlagJcCharge").selectpicker('refresh');
- $('#genderRestrictionJy').html(optionSex);
- $('#genderRestrictionJy').selectpicker('refresh');
- $("#genderRestrictionJy").selectpicker('val', '');
- $("#genderRestrictionJy").selectpicker('refresh');
- $('#delFlagJy').html(yesNo);
- $('#delFlagJy').selectpicker('refresh');
- $("#delFlagJy").selectpicker('val', 0);
- $("#delFlagJy").selectpicker('refresh');
- $('#zyFlagJy').html(yesNo);
- $('#zyFlagJy').selectpicker('refresh');
- $("#zyFlagJy").selectpicker('val', 0);
- $("#zyFlagJy").selectpicker('refresh');
- $('#mzFlagJy').html(yesNo);
- $('#mzFlagJy').selectpicker('refresh');
- $("#mzFlagJy").selectpicker('val', 0);
- $("#mzFlagJy").selectpicker('refresh');
- $('#zyFlagJyCharge').html(yesNo);
- $('#zyFlagJyCharge').selectpicker('refresh');
- $("#zyFlagJyCharge").selectpicker('val', 0);
- $("#zyFlagJyCharge").selectpicker('refresh');
- $('#mzFlagJyCharge').html(yesNo);
- $('#mzFlagJyCharge').selectpicker('refresh');
- $("#mzFlagJyCharge").selectpicker('val', 0);
- $("#mzFlagJyCharge").selectpicker('refresh');
- $('#delFlagParams').html(yesNo);
- $('#delFlagParams').selectpicker('refresh');
- $.ajax({
- type: "GET",
- url: '/thmz/getAllJcZdClass',
- 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) {
- var pyCode=comment.pyCode;
- if(pyCode==null || pyCode=="null"){
- pyCode="";
- }
- if(comment.code!=null && comment.code!="null"){
- pyCode=pyCode+"-"+comment.code;
- }
- html += '<option value="' + comment.code + '">' + comment.name + '(' + pyCode + ')</option>';
- });
- $('#classCode').empty(); //清空resText里面的所有内容
- $('#classCode').html(html);
- $('#classCode').selectpicker('refresh');
- $('#jcClassParams').empty(); //清空resText里面的所有内容
- $('#jcClassParams').html(html);
- $('#jcClassParams').selectpicker('refresh');
- }
- });
- $.ajax({
- type: "post",
- url: '/thmz/listJyZdClass',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({}),
- 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 + '-' + comment.code + ')</option>';
- });
- $('#classCodeJy').empty(); //清空resText里面的所有内容
- $('#classCodeJy').html(html);
- $('#classCodeJy').selectpicker('refresh');
- $('#jyClassParams').empty(); //清空resText里面的所有内容
- $('#jyClassParams').html(html);
- $('#jyClassParams').selectpicker('refresh');
- }
- });
- /**
- * 初始化验物下拉选
- */
- $.ajax({
- type: "GET",
- url: '/thmz/getJyZdSample',
- 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.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#sampleCode').empty();
- $('#sampleCode').html(html);
- $('#sampleCode').selectpicker('refresh');
- $('#sampleCodeParams').empty();
- $('#sampleCodeParams').html(html);
- $('#sampleCodeParams').selectpicker('refresh');
- }
- });
- /**
- * 查询所有容器
- */
- $.ajax({
- type: "GET",
- url: '/thmz/getAllJyZdTube',
- 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.code + '">' + comment.name + '(' + comment.pyCode + ')' + '</option>';
- });
- $('#vessel').empty();
- $('#vessel').html(html);
- $('#vessel').selectpicker('refresh');
- $('#vesselParams').empty();
- $('#vesselParams').html(html);
- $('#vesselParams').selectpicker('refresh');
- }
- });
- initZdChargeSelect();
- }
- /**
- * 使用中的收费项目列表
- */
- function initZdChargeSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getAllZdCharge',
- 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 = '';
- // if (chargeItemObj == null) {
- // chargeItemObj = []
- // }
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.code + ')</option>';
- if (chargeItemMap == null) {
- chargeItemMap = new MyMap()
- }
- if (chargeItemObj == null) {
- chargeItemObj = new MyMap()
- }
- chargeItemMap.put(comment.code, comment.chargeAmount);
- let obj = {
- code: comment.code,
- hnsybCode: comment.hnsybCode,
- nationalCode: comment.nationalCode,
- nationalName: comment.nationalName
- }
- chargeItemObj.put(comment.code,obj)
- });
- $('#chargeItem').empty();
- $('#chargeItem').html(html);
- $('#chargeItem').selectpicker('refresh');
- $('#chargeItemJy').empty();
- $('#chargeItemJy').html(html);
- $('#chargeItemJy').selectpicker('refresh');
- }
- });
- }
- /**
- * 设置单价
- */
- function setChargeAmount() {
- var chargeAmount = chargeItemMap.get($('#chargeItem').val());
- var chargeObj = chargeItemObj.get($('#chargeItem').val());
- if (chargeAmount != null) {
- $("#chargeAmount").val(chargeAmount.toFixed(2));
- }
- if (chargeObj != null) {
- $("#hnsybCode").val(chargeObj.hnsybCode);
- $("#nationalCode").val(chargeObj.nationalCode);
- $("#nationalName").val(chargeObj.nationalName);
- }
- }
- /**
- * 设置单价
- */
- function setChargeAmountJy() {
- var chargeAmount = chargeItemMap.get($('#chargeItemJy').val());
- var chargeObj = chargeItemObj.get($('#chargeItemJy').val());
- if (chargeAmount != null) {
- $("#chargeAmountJy").val(chargeAmount.toFixed(2));
- }
- if (chargeObj != null) {
- $("#hnsybCodeJy").val(chargeObj.hnsybCode);
- $("#nationalCodeJy").val(chargeObj.nationalCode);
- $("#nationalNameJy").val(chargeObj.nationalName);
- }
- }
- /**
- * 增加检查项目的细目
- * @param code
- */
- function addChargeZdItem(code) {
- $("#editJcChargeItemModal").modal();
- $("#jcItemCode").val(code);
- $("#chargeJcTitle").text("新增");
- }
- /**
- * 增加检验项目的细目
- * @param code
- */
- function addChargeJyZdItem(code) {
- $("#editJyChargeItemModal").modal();
- $("#jyItemCode").val(code);
- $("#chargeJyTitle").text("新增");
- }
- function callJcJyAgeFormat(number){
- if (/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(number) === false) {
- let r = {
- message: '年龄填写不合法,请检查!'
- }
- errorMesage(r);
- return "-1";
- } else {
- return "0";
- }
- }
|