1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501 |
- //@ sourceURL=toll_administration.js
- var LODOP; //声明为全局变量
- //默认打印机下标
- var printIndex = -1;
- //选中的要退的费用收费编码
- var chargeItemCodes = null;
- //门诊结算单地址
- var mzjsdHost = null;
- var readPatientId ='';
- var readTimes = null
- var fpVsesionNo = 0;
- var hospitalName ='沭阳铭和医院'
- $(function () {
- $("#dzfpDownModal1").modal();
- // prn1PrintAndQRCode("1522962-4",12,"4691714",1);
- getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
- hospitalName = res.data
- })
- //默认光标在卡号输入框
- $("#cardNo").focus();
- init_daterangepicker();
- initFpVersion();
- initSelect();
- // initConsumeChequeType();
- initFeeTable();
- //卡号输入改变事件
- cardNoChange();
- //重置查询参数
- $('#btn_clean').click(function () {
- cleanParams();
- });
- //初始化页面上面的按钮事件
- //查询
- $('#btn_query').click(function () {
- initFeeTable();
- });
- // //财务工具包
- // $('#btn_tools').click(function () {
- // $("#toolsModal").modal();
- // });
- /**
- * 增加收款方式按钮事件
- */
- $("#addPayType").on("click", function () {
- addPayType(null);
- });
- //初始门诊收银方式下拉选
- initChequeType("payType");
- //初始门诊收银方式下拉选
- initChequeType("payTypeEditPayMode");
- setTimeout(function () {
- getLodop();
- }, 800);
- /**
- * 核酸检测跳转过来的直接刷新待收费列表
- */
- if (patientIdFullForNucleicAcid != null && patientIdFullForNucleicAcid != "") {
- $("#cardNo").val(patientIdFullForNucleicAcid);
- $("#patientId").val(patientIdFullForNucleicAcid);
- initFeeTable();
- }
- /**
- * 医保电子凭证读卡
- */
- $("#siReadCard").on("click", function (t) {
- // siReadCard("qrcode_01101");
- siReadCard("jiangsu_qrcode_01101");
- });
- /**
- * 医保刷脸
- */
- $("#siReadCardFace").on("click", function (t) {
- // siReadCard("face_01101");
- siReadCard("jiangsu_face_01101");
- });
- //获取门诊医保结算单打印服务地址
- $.ajax({
- type: "GET",
- url: '/thmz/getMzjsdHost',
- 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;
- }
- mzjsdHost = res.data;
- }
- });
- /**
- * 刷卡/扫码
- */
- $("#consume").on("click", function (t) {
- consume();
- });
- });
- function getCurrentTime() {
- const now = new Date();
- const year = now.getFullYear().toString();
- const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始
- const day = String(now.getDate()).padStart(2, '0');
- const hours = String(now.getHours()).padStart(2, '0');
- const minutes = String(now.getMinutes()).padStart(2, '0');
- const seconds = String(now.getSeconds()).padStart(2, '0');
- return `${year}${month}${day}${hours}${minutes}${seconds}`;
- };
- function getEBill(serialNo) {
- $.ajax({
- type: "POST",
- url: 'http://130.150.161.72:9206/thyy/api/public/ebill/invoicequery',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "timestamp":this.getCurrentTime(),
- "busseqno":serialNo,
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- // console.log('getEBill',res);
- if(res.code == 1 && res.data.invoice_url){
- successMesageSimaple("电子发票查询成功!")
- }
- }
- })
- };
- function downloadEBill(serialNo) {
- $.ajax({
- type: "POST",
- url: 'http://130.150.161.72:9206/thyy/api/public/ebill/invoicedownload',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "timestamp":this.getCurrentTime(),
- "busseqno": serialNo,
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if(res.code == 1 && res.data.invoicefiledata){
- base64toPDF(res.data.invoicefiledata)
- }
- }
- })
- };
- //function issueEBill(realNo,amount,name,doctorCode) {
- // $.ajax({
- // type: "POST",
- // url: 'http://localhost:9206/thyy/api/public/ebill/invoicehisissue',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({
- // "timestamp":this.getCurrentTime(),
- // "busseqno":realNo,
- // "bustype": "02",
- // "totalAmount":amount,
- // "payerPartyType":"1",
- // "payerPartyName":name,
- // "bizcode":realNo,
- // "handlingPerson":doctorCode,
- //
- //
- // }),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // console.log('issueEBill',res);
- // if(res.code == 1 && res.data.invoice_url){
- //
- // // successMesageSimaple("电子发票查询成功!")
- // }
- // }
- // })
- //};
- /**
- * 列表类型按钮切换事件
- * @param object
- */
- function payMarkButtonChange(object) {
- $("#pay_mark_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");
- initFeeTable();
- }
- /**
- * 收费明细类型按钮切换事件
- * @param object
- */
- function billItemButtonChange(object) {
- $("#bill_item_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");
- initChargeDetailTable();
- //默认光标在卡号输入框
- $("#cardNo").focus();
- }
- /**
- * 收费明细类型按钮切换事件
- * @param object
- */
- function refundBillItemButtonChange(object) {
- $("#refund_bill_item_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");
- initMzChargeDetailByBillItem(false);
- }
- //初始化版本电子发票版本
- function initFpVersion() {
- getAjaxRequst("/thmz/queryFpVersion",{},true,function (res) {
- console.log('发票版本=',res.data)
- fpVsesionNo = res.data;
- })
- }
- /**
- * 初始化下拉选
- */
- function initSelect() {
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- initDeptSelect();
- initDoctorSelect();
- initCooperativeEnterprisesSelect();
- initMztczfSiReadCardTypeSelect();
- initTfGrzhzfSelect()
- }
- /**
- * 初始化读卡类型
- */
- function initMztczfSiReadCardTypeSelect() {
- // // $('#mztczfSiReadCardType').html("<option value='03'>社保卡</option><option value='01'>电子凭证</option><option value='02'>身份证</option><option value='04'>刷脸</option>");
- // $('#mztczfSiReadCardType').html("<option value='03'>社保卡</option><option value='01'>电子凭证</option><option value='04'>刷脸</option>");
- // $('#mztczfSiReadCardType').selectpicker('refresh');
- // var selectHtml = '<option value="0">否</option><option value="1">使用个账</option><option value="2">使用共济账户</option>';
- // $('#grzhzf').html(selectHtml);
- // $('#grzhzf').selectpicker('refresh');
- // 读卡类型和个账支付已改为单选框,不需要初始化下拉框
- initAdvmPro('mztczfAdvmPro')
- }
- function initTfGrzhzfSelect() {
- var selectHtml = '<option value="0">否</option><option value="1">使用个账</option><option value="2">使用共济账户</option>';
- $('#tfGrzhzf').html(selectHtml);
- $('#tfGrzhzf').selectpicker('refresh');
- initAdvmPro('tfAdvmPro')
- }
- //初始化参保地省
- function initAdvmPro(proId) {
- getAjaxRequst("/thmz/queryProvinceCodes",{},true,function (res) {
- if(res.code == 0 && res.data !=null && res.data.length > 0){
- let selectHtml = '';
- for (let i=0 ; i <res.data.length; i++ ){
- // 如果是医保读卡弹窗的省份选择,默认选中江苏省
- let selected = (proId === 'mztczfAdvmPro' && res.data[i].code === '320000') ? ' selected' : '';
- selectHtml+= `<option value="${res.data[i].code}"${selected}>${res.data[i].code} ${res.data[i].name}</option>`
- }
- $('#'+proId).html(selectHtml);
- $('#'+proId).selectpicker('refresh');
-
- // 如果是医保读卡弹窗且选中了江苏省,自动加载城市列表
- if(proId === 'mztczfAdvmPro' && $('#'+proId).val() === '320000') {
- cityChange('mztczfAdvmPro', 'mztczfAdvmCity');
- }
- }
- })
- }
- //初始化参保地市
- function cityChange(proId,cityId) {
- let code = $('#'+proId).val()
- postAjaxJsonHttpRequst("/thmz/queryCityCodes",{code:code},true,function (res) {
- if(res.code == 0 && res.data !=null && res.data.length > 0){
- let selectHtml = '';
- let suqianCityCode = null; // 用于存储宿迁市的code
-
- for (let i=0 ; i <res.data.length; i++ ){
- selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
-
- // 查找宿迁市的code,优先使用code匹配,其次使用name匹配
- if(cityId === 'mztczfAdvmCity') {
- if(res.data[i].code === '321300' || res.data[i].name.includes('宿迁市')) {
- suqianCityCode = res.data[i].code;
- }
- }
- }
-
- $('#'+cityId).html(selectHtml);
- $('#'+cityId).selectpicker('refresh');
-
- // 如果是医保读卡弹窗且找到了宿迁市,设置为默认选中
- if(cityId === 'mztczfAdvmCity' && suqianCityCode) {
- $('#'+cityId).selectpicker('val', suqianCityCode);
- $('#'+cityId).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>';
- });
- $('#deptNoParam').empty();
- $('#deptNoParam').html(html);
- $('#deptNoParam').selectpicker('refresh');
- }
- });
- }
- /**
- * 挂号列表中的医生列表初始化
- */
- function initDoctorSelect() {
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNoParam').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>';
- });
- $('#doctorParam').empty();
- $('#doctorParam').html(html);
- $('#doctorParam').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 合作企业列表
- */
- function initCooperativeEnterprisesSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/getAllCooperativeEnterprises',
- 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.id + '">' + comment.projectName + " " + comment.contractNo + '</option>';
- });
- $('#project').empty();
- $('#project').html(html);
- $('#project').selectpicker('destroy').selectpicker('refresh');
- $('#projectCharged').empty();
- $('#projectCharged').html(html);
- $('#projectCharged').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- var $table_1;
- /**
- * 初始化收费表格
- */
- function initFeeTable() {
- var payMarkGroup = getIndex("pay_mark_group");
- var timeColumusName = "处方时间";
- var timeColumus = "priceTime";
- $("#refundFeeTip").removeClass("in").addClass("hide");
- $("#chargeFeeTip").removeClass("hide").addClass("in");
- if (payMarkGroup == 1) {
- timeColumusName = "缴费时间";
- timeColumus = "chargeDate";
- $("#refundFeeTip").removeClass("hide").addClass("in");
- $("#chargeFeeTip").removeClass("in").addClass("hide");
- } else if (payMarkGroup == 2) {
- timeColumusName = "退费时间";
- timeColumus = "inputDate";
- }
- var patientId = $("#patientId").val();
- //查询记账信息
- if (payMarkGroup == 0 && patientId != null && patientId != '') {
- $("#patientIdHaveTally").val(patientId);
- $.ajax({
- type: "GET",
- url: '/thmz/getTallyTotalCharge?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- 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) {
- if (res.data != null && res.data > 0) {
- $("#haveTallyModal").modal();
- $("#totalTallyAmount").text(res.data.toFixed(2));
- } else {
- $("#haveTallyModal").modal('hide');
- }
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- $('#tb_table').bootstrapTable("destroy");
- $table_1 = $('#tb_table').bootstrapTable({
- url: '/thmz/listMzChargeDetail', //请求后台的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: [
- // {
- // checkbox: true
- // },
- {
- field: 'realNo',
- title: '缴费流水号',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value);
- }
- }, {
- field: 'patientId',
- title: '患者编号',
- align: "center",
- valign: 'middle',
- }, {
- field: 'name',
- title: '患者姓名',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'times',
- title: '就诊次数',
- align: "center",
- valign: 'middle',
- }, {
- field: 'visitTypeName',
- title: '患者身份',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'orderTypeName',
- title: '处方类型',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'receiptNo',
- title: '结算次数',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value);
- }
- }, {
- field: 'notDiscountAmount',
- title: '订单金额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value).toFixed(2);
- }
- }, {
- field: 'discountAmount',
- title: '优惠总额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value).toFixed(2);
- }
- }, {
- field: 'amount',
- title: '应付金额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value).toFixed(2);
- }
- }, {
- field: 'warnDept',
- title: '科室',
- align: "center",
- valign: 'middle',
- }, {
- field: 'doctorCode',
- title: '医生',
- align: "center",
- valign: 'middle',
- }, {
- field: timeColumus,
- title: timeColumusName,
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == null || value == "") {
- return "";
- }
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }, {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- var buttonCodes = localStorage.getItem("buttonCodes");
- var str = '<button type="button" class="registration-no-color-foot-button" title="费用明细" onclick="chargeDetailModal(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-plus"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button" title="诊断查询" onclick="diagnoseQuery(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-search-minus"></i></button>';
- var payMarkGroup = getIndex("pay_mark_group");
- if (payMarkGroup == 0) {
- if(row.countYbZf !=null && row.countYbZf > 0 ){
- str += '<button type="button" class="registration-no-color-foot-button"title="医保读卡" onclick="mztczfSiReadCardTypeModel(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-newspaper-o"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button"title="医保结算" onclick="directRegistration(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-credit-card"></i></button>';
- }
- str += '<button type="button" class="registration-no-color-foot-button"title="确认收费" onclick="tipHaveTally(' + row.amount + ',\'' + row.patientId + '\',' + row.times + ',\'' + row.name + '\',' + row.receiptNo + ',\'' + row.doctorCode + '\'' + ')"><i class="fa fa-rmb"></i></button>';
- if (buttonCodes != null) {
- if (isInArrayStr("init_clinic_for_exception", buttonCodes)) {
- str += '<button type="button" class="registration-no-color-foot-button" title="就诊记录修复" onclick="initClinicForException(\'' + row.patientId + '\',' + row.times + ',\'5\',' + row.receiptNo + ');"><i class="fa fa-wrench"></i></button>';
- }
- }
- if(row.orderLockFlag != null && row.orderLockFlag == 1){
- str += '<button type="button" class="registration-no-color-foot-button" title="解锁处方" onclick="deleteOrderLock(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-remove"></i></button>';
- }
- return str;
- }
- if (payMarkGroup == 1) {
- // str += '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="showChequType(\'' + row.patientId + '\','+row.times+','+row.receiptNo+')"><i class="fa fa-credit-card"></i></button>' ;
- if(isInArrayStr("mz_refund", buttonCodes)){
- str += '<button type="button" class="registration-no-color-foot-button" title="退费" onclick="refundFee(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ',' + row.printFlag+',\'' + row.orderTypeName +'\''+ ');"><i class="fa fa-reply"></i></button>';
- }
- if (row.printFlag == 0 && fpVsesionNo == 0) {
- str += '<button type="button" id="button_' + row.realNo + '" class="registration-no-color-foot-button" title="发票打印" onclick="prn1PrintHand(\'' + row.patientId + '\',' + row.times + ',true,' + row.receiptNo + ',' + row.realNo + ');" style="color: #35D082;"><i class="fa fa-print"></i></button>';
- } else if (row.printFlag == 1 && fpVsesionNo == 0) {
- str += '<button type="button" class="registration-no-color-foot-button" title="发票重打" onclick="repPrint(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ');" style="color: #F4BD00;"><i class="fa fa-print"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button" title="发票作废重打" onclick="obsoleteAndRepPrint(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ');" style="color: #E73E48;"><i class="fa fa-print"></i></button>';
- }
- if(fpVsesionNo == 1){
- str += '<button type="button" class="registration-no-color-foot-button" title="发票重打" onclick="prn1PrintAndQRCode(\'' + row.patientId + '\',' + row.times +',\'' + row.serialNo + '\''+',\'' + row.name + '\''+',' + row.amount +',\'' + row.doctorCode + '\'' + ')" style="color: #F4BD00;"><i class="fa fa-print"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button" title="上传电子发票" onclick="printDzfp(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo +',1'+ ',\'' + row.name + '\'' + ',' + row.amount + ',\'' + row.doctorCode + '\'' + ');" style="color: #35D082;"><i class="fa fa-upload"></i></button>';
- // str += '<button type="button" class="registration-no-color-foot-button" title="开具电子发票" onclick="issueEBill(\'' + row.realNo + '\',' + row.amount + ',\'' + row.name + '\',\'' + row.doctorCode +'\'' + ');" style="color: #35D082;"><i class="fa fa-sign-in"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button"title="下载电子发票" onclick="openDzfpDownModal(\'' + row.patientId + '\',' + row.times +',\'' + row.serialNo + '\'' + ')"><i class="fa fa-download"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button"title="查询电子发票" onclick="getEBill(\'' + row.serialNo+ '\',)"><i class="fa fa-search"></i></button>';
- // str += '<button type="button" class="registration-no-color-foot-button"title="下载电子发票" onclick="downloadEBill(\'' + row.serialNo+ '\',)"><i class="fa fa-download"></i></button>';
- }
- str += '<button type="button" class="registration-no-color-foot-button"title="支付明细" onclick="depositFileList(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-th-list"></i></button>';
- //是否有权限设置合同编号
- if (buttonCodes != null) {
- if (isInArrayStr("contract_match", buttonCodes)) {
- str += '<button type="button" class="registration-no-color-foot-button" title="合作项目维护" onclick="matchProject(\'' + row.realNo + '\');"><i class="fa fa-plug"></i></button>';
- }
- }
- if (row.countYbZf > 0) {
- str += '<button type="button" class="registration-no-color-foot-button" title="打印医保结算单" onclick="printYbjsd(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ');"><i class="fa fa-file-word-o"></i></button>';
- }
- if (row.mztcbl > 0) {
- str += '<button type="button" class="registration-no-color-foot-button" title="门诊统筹补录" onclick="mztcbl(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ');"><i class="fa fa-paypal"></i></button>';
- }
- if (buttonCodes != null) {
- if (isInArrayStr("init_clinic_for_exception", buttonCodes)) {
- str += '<button type="button" class="registration-no-color-foot-button" title="就诊记录修复" onclick="initClinicForException(\'' + row.patientId + '\',' + row.times + ',\'0\',' + row.receiptNo + ');"><i class="fa fa-wrench"></i></button>';
- }
- }
- return str;
- }
- if (payMarkGroup == 2) {
- str += '<button type="button" class="registration-no-color-foot-button"title="支付明细" onclick="depositFileList(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-th-list"></i></button>';
- if(fpVsesionNo == 1){
- str += '<button type="button" class="registration-no-color-foot-button"title="电子发票作废" onclick="uploadMzInvoice(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo +',2'+ ')"><i class="fa fa-mail-reply-all"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button"title="下载已作废的电子发票" onclick="openDzfpDownModal(\'' + row.patientId + '\',' + row.times +',\'' + row.serialNo + '\'' + ')"><i class="fa fa-download"></i></button>';
- }
- // str += '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="showChequType(\'' + row.patientId + '\','+row.times+','+row.receiptNo+')"><i class="fa fa-credit-card"></i></button>' ;
- return str;
- }
- }
- }
- ],
- 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": {} //数据
- };
- }
- // if(ress.pageViewVo.total==0){
- // $("#cardNo").val(null);
- // $("#name").val(null);
- // }
- return {
- "total": ress.pageViewVo.total,//总页数
- "rows": ress.pageViewVo.data //数据
- };
- },
- /**
- * @param {点击列的 field 名称} field
- * @param {点击列的 value 值} value
- * @param {点击列的整行数据} row
- * @param {td 元素} $element
- */
- onClickCell: function (field, value, row, $element) {
- var cardNo = $("#cardNo").val();
- if (cardNo == '120' && field == 'name' && (payMarkGroup == 0 || payMarkGroup == 1)) {
- $element.attr('contenteditable', true);
- $element.html(null);
- $element.focus();
- $element.blur(function () {
- var index = $element.parent().data('index');
- var tdValue = $element.html();
- saveData(index, field, tdValue, row, $table_1);
- })
- }
- },
- });
- }
- /**
- * 更新病人缴费记录病人姓名
- * @param index
- * @param field
- * @param value
- * @param row
- */
- function saveData(index, field, value, row, table) {
- $.ajax({
- type: "POST",
- url: '/thmz/changePatientIdName',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"patientId": row.patientId, "times": row.times, "name": value}),
- 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;
- }
- if (res.code == 0) {
- table.bootstrapTable('updateCell', {
- index: index, //行索引
- field: field, //列名
- value: value //cell值
- })
- } else {
- table.bootstrapTable('updateCell', {
- index: index, //行索引
- field: field, //列名
- value: row.name //cell值
- })
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 构建列表查询参数
- * @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 payMarkGroup = getIndex("pay_mark_group");
- var temp = {
- mzChargeDetail: {
- patientId: $("#patientId").val(),
- warnDept: $("#deptNoParam").val(),
- doctorCode: $("#doctorParam").val(),
- name: $("#name").val(),
- payMark: 5
- },
- beginTime: new Date(rePortRangeArr[0]),
- endTime: new Date(rePortRangeArr[1]),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- serialNo: $("#serialNo").val(),
- ownData: $('#ownData').is(':checked') ? 0 : 1,
- };
- if (payMarkGroup == 1) {
- temp.mzChargeDetail.payMark = 0;
- } else if (payMarkGroup == 2) {
- temp.mzChargeDetail.payMark = 1;
- }
- console.log('param=', temp)
- return temp;
- };
- function initChargeDetailTable() {
- initChargeDetailTablePublic('/thmz/getMzChargeDetailByBillItem', $('#charge_detail_table'), queryParamsForDetail);
- }
- function initMzChargeDetailByBillItem(flag) {
- if (flag) {
- $("#refund_bill_item_group").removeClass("hide").addClass("in");
- if ($("#plusOrMinus").hasClass("fa-plus")) {
- $("#plusOrMinus").removeClass("fa-plus").addClass("fa-minus");
- initChargeDetailTablePublic('/thmz/getNewListForRefundFeeByBillItem', $('#refund_fee_bill_table'), queryParamsForRefundByBillItem);
- } else if ($("#plusOrMinus").hasClass("fa-minus")) {
- $("#plusOrMinus").removeClass("fa-minus").addClass("fa-plus");
- $("#refund_bill_item_group").removeClass("in").addClass("hide");
- $('#refund_fee_bill_table').bootstrapTable("destroy");
- }
- } else {
- initChargeDetailTablePublic('/thmz/getNewListForRefundFeeByBillItem', $('#refund_fee_bill_table'), queryParamsForRefundByBillItem);
- }
- }
- //撤销医保重新 申请医保电子凭证
- function reqYb() {
- let tfReadType = $("#tfReadType").val();
- if(!stringNotBlank($("#tfGrzhzf").val())){
- errorMesageSimaple('请选择是否使用个账或共济账户支付')
- return
- }
- if(!stringNotBlank(tfReadType)){
- errorMesageSimaple('请选择读卡类型')
- return
- }
- if(tfReadType == '02'){
- sfzReadCard()
- }else {
- let param = {
- patientId :$("#patientIdRefund").val(),
- times :$("#timesRefund").val()
- }
- postAjaxJsonHttpRequst("/thmz/retractYbFees",param,true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(res.code == 0){
- successMesageSimaple('医保费用撤销成功!')
- reSiReadCard(false,tfReadType);
- }else {
- errorMesage(res)
- }
- })
- }
- }
- function sfzReadCard() {
- let tfAdvmCity = $("#tfAdvmCity").val()
- if(!stringNotBlank(tfAdvmCity)){
- errorMesageSimaple("请选择参保地")
- return
- }
- $.ajax({
- type: "GET",
- // url: 'http://localhost:8321/readcard/entry?param=idcard_01101',
- url: 'http://localhost:8321/readcard/entry?param=huashi_readcard',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: true,
- 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 == 200) {
- $("#cdReadCardResult").val(res.data);
- var str = res.data.split("^");
- var str1= str.filter(item=>item !='');
- let IDNumber = str1[0];
- postAjaxJsonHttpRequst("/thmz/queryNewInsuinfo",{
- patientId :$("#patientIdRefund").val(),
- times :$("#timesRefund").val(),
- admdvs:tfAdvmCity,
- socialNo:IDNumber
- },true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(res.code == 0){
- let param = {
- patientId :$("#patientIdRefund").val(),
- times :$("#timesRefund").val()
- }
- postAjaxJsonHttpRequst("/thmz/retractYbFees",param,true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if(res.code == 0){
- successMesageSimaple("撤销医保费用成功")
- }else {
- errorMesage(res)
- }
- })
- }else {
- errorMesage(res)
- }
- })
- } else {
- errorMesage(res);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- errorMesageSimaple("读卡错误")
- }
- });
- }
- function reSiReadCard(asyncFlag,tfReadType) {
- let params ='';
- let url = '';
-
- if(tfReadType == '03'){
- // 江苏医保读取社保卡使用专用地址
- url = 'http://localhost:8321/readcard/jiangsu/readcard_auto';
- }else if(tfReadType == '01'){
- // params ='qrcode_01101';
- params ='jiangsu_qrcode_01101';
- // url = 'http://localhost:8321/readcard/entry?param=' + params;
- url = 'http://localhost:8321/api/entry?param=' + params;
- }else if(tfReadType =='02'){
- // params ='idcard_01101'
- params ='huashi_readcard';
- url = 'http://localhost:8321/readcard/entry?param=' + params;
- }
-
- $.ajax({
- type: "GET",
- url: url,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: asyncFlag,
- 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 == 200) {
- successMesageSimaple('读卡成功')
- if(tfReadType == '01'){
- var data = JSON.parse(res.data);
- $("#cdReadCardResult").val(JSON.stringify(data.data));
- }else {
- $("#cdReadCardResult").val(res.data);
- }
- } else {
- errorMesage(res);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- errorMesageSimaple("读卡错误")
- }
- });
- }
- /**
- * 初始化收费明细表格
- */
- function initChargeDetailTablePublic(url, obj, params) {
- $(obj).bootstrapTable("destroy");
- $(obj).bootstrapTable({
- url: url, //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- // sortName: 'orderNo', //排序字段
- queryParams: params, //传递参数(*)
- 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: [
- // {
- // checkbox: true
- // },
- {
- field: 'orderNo',
- title: '处方号',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value);
- }
- }, {
- field: 'chargeItemCode',
- title: '编码',
- align: "center",
- valign: 'middle',
- }, {
- field: 'tcName',
- title: '项目',
- align: "center",
- valign: 'middle',
- },
- // {
- // field: 'times',
- // title: '规格',
- // align: "center",
- // valign: 'middle',
- // },
- {
- field: 'quantity',
- title: '数量',
- align: "center",
- valign: 'middle'
- }, {
- field: 'drugWin',
- title: '副数',
- align: "center",
- valign: 'middle',
- }, {
- field: 'origPrice',
- title: '原单价(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != undefined && value != null) {
- return value.toFixed(2);
- }
- }
- }, {
- field: 'unitPrice',
- title: '折后单价(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return value.toFixed(2);
- }
- }, {
- field: 'amount',
- title: '总金额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return value.toFixed(2);
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- //"total": ress.pageViewVo.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 构建列表查询参数
- * @param params
- * @returns {{patientId: string | number | string[] | undefined | jQuery, times: string | number | string[] | undefined | jQuery, billItemCode: number}}
- */
- function queryParamsForDetail(params) {
- var billItemGroup = getIndex("bill_item_group");
- var payMarkGroup = getIndex("pay_mark_group");
- var temp = {
- patientId: $("#patientIdChargeItem").val(),
- times: $("#timesChargeItem").val(),
- receiptNo: $("#receiptNoChargeItem").val(),
- billItemCode: billItemGroup,
- payMark: 5
- };
- if (payMarkGroup == 1) {
- temp.payMark = 0;
- } else if (payMarkGroup == 2) {
- temp.payMark = 1;
- }
- return temp;
- };
- /**
- * 构建列表查询参数
- * @param params
- * @returns {{patientId: string | number | string[] | undefined | jQuery, times: string | number | string[] | undefined | jQuery, billItemCode: number}}
- */
- function queryParamsForRefundByBillItem(params) {
- var billItemGroup = getIndex("refund_bill_item_group");
- return {
- patientId: $("#patientIdRefund").val(),
- times: $("#timesRefund").val(),
- receiptNo: $("#receiptNoRefund").val(),
- chargeItemCodes: chargeItemCodes,
- billItemCode: billItemGroup
- };
- };
- function debounce(func, delay = 500) {
- let timer = null;
- return function(...args) {
- clearTimeout(timer);
- timer = setTimeout(() => {
- func.apply(this, args); // 执行目标方法
- }, delay);
- };
- }
- /**
- * 卡号输入改变事件
- */
- function cardNoChange() {
- if (window.ActiveXObject || "ActiveXObject" in window) {
- $("#cardNo").on('input propertychange', debounce(queryUserInfoByCardNo, 500));
- } else {
- $("#cardNo").on('input οninput', debounce(queryUserInfoByCardNo, 500));
- }
- }
- /**
- * 卡号有变化后查询病人信息
- */
- function queryUserInfoByCardNo() {
- var cardNo = $("#cardNo").val();
- var index = cardNo.indexOf("-");
- if ((index > 0 && index === cardNo.length - 2) || true) {
- $("#patientId").val(cardNo);
- initFeeTable();
- } else if (cardNo == '120' || cardNo.length == 8) {
- $("#cardNo").attr("title", cardNo);
- $.ajax({
- type: "GET",
- url: '/thmz/getByIcCardNo?icCardNo=' + cardNo,
- contentType: "application/json;charset=UTF-8",
- 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) {
- if (res.data != null) {
- $("#patientId").val(res.data.patientId);
- initFeeTable();
- }
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- } else if (cardNo == null || cardNo == "") {
- cleanParams();
- }
- }
- /**
- * 获取按钮组选择的下标
- * @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;
- }
- /**
- * 获取时间选择器的时间数组
- * @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 confirmFeeModal(times, totalCharge, receiptNo) {
- var buttonCodes = localStorage.getItem("buttonCodes");
- if (buttonCodes != null) {
- if (isInArrayStr("contract_match", buttonCodes)) {
- $("#projectDiv").removeClass("hide").addClass("in");
- } else {
- $("#projectDiv").removeClass("in").addClass("hide");
- }
- } else {
- $("#projectDiv").removeClass("in").addClass("hide");
- }
- var payTypeList = $("#payType").children();
- if (payTypeList.length == 1) {
- $('#payType').selectpicker('val', 'Y');
- } else {
- $('#payType').selectpicker('val', 1);
- }
- $('#payType').selectpicker('refresh');
- var data = parseFloat($("#dataIdHaveTally").val());
- if (totalCharge != null && totalCharge > 0) {
- data = totalCharge;
- $("#timesHaveTally").val(times);
- $("#receiptNoHaveTally").val(receiptNo);
- }
- var prevAll = $("#changeAmountParent").prevAll();
- while (prevAll.length > 1) {
- $("#changeAmountParent").prev().remove();
- prevAll = $("#changeAmountParent").prevAll();
- }
- // $("#realMoney").val($("#amountMoneyConfirm").text());
- // $("#cash").val($("#amountMoneyConfirm").text());
- $("#tallyDetailModal").modal('hide');
- $("#haveTallyModal").modal('hide');
- $("#confirmFeeModal").modal();
- $("#amountMoneyConfirm").text(data);
- //医保报销金额
- var fundPay = $("#fundPay").val();
- //个人账户支付金额
- var acctPay = $("#acctPay").val();
- //医保卡类型
- var cardType = $("#cardType").val();
- var payTypeIndex = 0;
- if (fundPay > 0) {
- var payTypeId = "payType_" + payTypeIndex++;
- addPayType(payTypeId);
- $('#' + payTypeId).selectpicker('val', 2);
- $('#' + payTypeId).selectpicker('refresh');
- $('#' + payTypeId).parent().parent().next().children(':first').val(fundPay);
- $('#' + payTypeId).parent().parent().next().next().children(':first').remove();
- $('#' + payTypeId).attr("disabled", true);
- $('#' + payTypeId).parent().parent().next().children(':first').attr("readonly", "readonly");
- //payTypeIndex++;
- }
- if (acctPay > 0) {
- var payTypeId = "payType_" + payTypeIndex++;
- addPayType(payTypeId);
- // var ybkType = 'T';
- // if (cardType != null && (cardType == 2 || cardType == "2")) {
- // ybkType = 'P';
- // }
- $('#' + payTypeId).selectpicker('val', cardType);
- $('#' + payTypeId).selectpicker('refresh');
- $('#' + payTypeId).parent().parent().next().children(':first').val(acctPay);
- $('#' + payTypeId).parent().parent().next().next().children(':first').remove();
- $('#' + payTypeId).attr("disabled", true);
- $('#' + payTypeId).parent().parent().next().children(':first').attr("readonly", "readonly");
- }
- $("#payTypeIndex").val(payTypeIndex);
- //总金额减医保报销
- var realMoney = Minus(data, fundPay);
- //减完医保报销后减个人医保卡支付金额
- realMoney = Minus(realMoney, acctPay);
- $("#realMoney").val(data);
- if (realMoney > 0) {
- addPayType("payType");
- $("#cash").val(realMoney);
- }
- // $("#cash").val(null);
- setTimeout(function () {
- //默认光标在现金输入框
- $("#cash").focus();
- }, 800);
- if (payTypeList.length == 1) {
- $('#payType').selectpicker('val', 'Y');
- } else {
- $('#payType').selectpicker('val', 'O');
- }
- $("#changeAmount").val(0.0);
- $("#surplusAmount").val(0.0);
- $("input.refNo").val(null);
- $("input.transDate").val(null);
- $("input.payChannel").val(null);
- $("input.qrCodeParam").val(null);
- $("input.traceNo").val(null);
- sendPriceMessage(realMoney, 0.0, 0.0, $("#patientIdHaveTally").val());
- }
- /**
- * 打开收费明细窗口
- * @param data
- */
- function chargeDetailModal(patientId, times, receiptNo) {
- $("#patientIdChargeItem").val(patientId);
- $("#timesChargeItem").val(times);
- $("#receiptNoChargeItem").val(receiptNo);
- $("#chargeDetailModal").modal();
- initChargeDetailTable();
- }
- /**
- * 病人当前就诊次数的诊断查询
- * @param data
- */
- function diagnoseQuery(patientId, times) {
- $.ajax({
- type: "POST",
- url: '/thmz/getVisitTableByPatientIdAndTimes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"patientId": patientId, "times": times}),
- 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;
- }
- if (res.code == 0) {
- if (res.data.icdText != null || res.data.icdText != '') {
- $("#diagnoseModal").modal();
- $("#diagnose").html(res.data.icdText);
- } else {
- new PNotify({
- title: '操作提示',
- text: '当前病人诊断未知',
- type: 'warn',
- styling: 'bootstrap3'
- });
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- // /**
- // * 打开退费重收明细窗口
- // * @param data
- // */
- // function chargeRefundDetailModal(patientId, times) {
- // // $("#patientIdChargeItem").val(patientId);
- // // $("#timesChargeItem").val(times);
- // initMzChargeDetailByBillItem();
- // }
- /**
- * 初始门诊收银方式下拉选
- */
- function initChequeType(payType) {
- $.ajax({
- type: "GET",
- url: '/thmz/getAllZdChequeTypeForMz',
- 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>';
- });
- $('#' + payType).empty();
- $('#' + payType).html(html);
- $('#' + payType).selectpicker('refresh');
- if (res.data.length == 1) {
- $('#' + payType).selectpicker('val', 'Y');
- } else {
- $('#' + payType).selectpicker('val', 'O');
- }
- $('#' + payType).selectpicker('refresh');
- }
- });
- }
- /**
- * 关闭当前这个付款方式
- */
- function closeThisParent(obj) {
- $(obj).parent().parent().parent().remove();
- checkFee(false);
- }
- /**
- * 校验收款金额
- * @param flag 是否是提交时候的校验,是的话,如果缴费金额不够,需要返回 false
- */
- function checkFee(flag) {
- var realMoney = parseFloat($("#realMoney").val());
- realMoney = toDecimal(realMoney);
- $("#realMoney").val(realMoney);
- var arr = $("#payForm").find("div.pay-item");
- if (arr.length > 0) {
- // //是否存在未使用的收款方式
- // var hadNotFill=false;
- //非现金收款总金额
- var notCashAmount = 0;
- //现金收款总额
- var cashAmount = 0;
- for (var i = 0; i < arr.length; i++) {
- var temp = parseFloat($(arr[i]).find("input.money").val());
- if (isNaN(temp)) {
- temp = 0;
- // hadNotFill=true;
- }
- if ($(arr[i]).find("select").val() != 1) {
- notCashAmount = Add(notCashAmount, temp);
- } else {
- cashAmount = Add(cashAmount, temp);
- }
- for (var j = 0; j < arr.length; j++) {
- if ($(arr[i]).find("select").val() == $(arr[j]).find("select").val() && i != j) {
- new PNotify({
- title: '错误提示',
- text: "已经存在相同的收款方式,请不要重复添加!",
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return;
- }
- }
- }
- var totalAmount = Add(cashAmount, notCashAmount);
- $("#surplusAmount").val(0.0);
- if (totalAmount < realMoney) {
- if (flag) {
- new PNotify({
- title: '错误提示',
- text: "收款金额不能少于实收金额,请调整收款金额或者增加收款方式!",
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return false;
- }
- if (totalAmount == 0) {
- $("#addPayType").parent().removeClass("in").addClass("hide");
- } else {
- $("#addPayType").parent().removeClass("hide").addClass("in");
- }
- // if(!hadNotFill){
- // addPayType(null);
- // }
- $("#changeAmount").val(0.00);
- var surplusAmount = Minus(realMoney, totalAmount);
- $("#surplusAmount").val(surplusAmount);
- return;
- }
- var changeAmount = 0.00;
- if (totalAmount >= realMoney) {
- changeAmount = Minus(totalAmount, realMoney);
- //changeAmount = changeAmount.toFixed(2);
- $("#changeAmount").val(changeAmount);
- $("#addPayType").parent().removeClass("in").addClass("hide");
- if (!flag) {
- sendPriceMessage(realMoney, totalAmount, changeAmount, $("#patientIdHaveTally").val());
- }
- }
- //设置收费首页找零与应收和实收金额
- $("#payableAmount").text(realMoney);
- $("#paidAmount").text(totalAmount);
- $("#changedAmount").text(changeAmount);
- }
- //计算和设置折扣比例
- var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text());
- var discount = 100;
- if (realMoney < amountMoneyConfirm) {
- discount = Division(realMoney, Multiply(amountMoneyConfirm, 100));
- }
- $("#discount").text(toDecimal(discount));
- return true;
- }
- /**
- * 异常接诊数据修复
- * @param patientId
- * @param times
- * @param payMark
- * @param receiptNo
- */
- function initClinicForException(patientId, times, payMark, receiptNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/initClinicForException?patientId=' + patientId + '×=' + times+ '&receiptNo=' + receiptNo + "&payMark=" + payMark,
- contentType: "application/json;charset=UTF-8",
- 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);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 提示有记账记录
- */
- function tipHaveTally(data, patientId, times, name, receiptNo,doctorName) {
- addOrderLock(patientId,times,null)
- closeConfirmFeeModal();
- if (patientId == null || patientId == "") {
- return;
- }
- $("#patientIdHaveTally").val(patientId);
- $("#nameHaveTally").val(name);
- $("#dataIdHaveTally").val(data);
- $("#timesHaveTally").val(times);
- $("#receiptNoHaveTally").val(receiptNo);
- $("#doctorNameHaveTally").val(doctorName);
- saveFeeGzzf()
- // postAjaxJsonHttpRequst("/thmz/queryCountYbZf",{"patientId": patientId, "times": times},true,function (rs) {
- // if (rs == '401' || rs == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if(rs.code == 0){
- // if(rs.data > 0){
- //
- // }
- // }else {
- // errorMesage(rs);
- // }
- //
- // })
- }
- //收费时保存个账支付选择
- function saveFeeGzzf() {
- var param = {
- "patientId": $("#patientIdHaveTally").val(),
- "times": $("#timesHaveTally").val(),
- "receiptNo": $("#receiptNoHaveTally").val(),
- "readCardType": $('input[name="mztczfSiReadCardType"]:checked').val(),
- "readCardResult": $("#readCardResult").val(),
- "busCardInfo": $("#pBusiCardInfo").val()
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getTmFee',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(param),
- 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;
- }
- if (res.code == 0) {
- if (res.data != undefined && res.data != null) {
- $("#fundPay").val(res.data.fundPay);
- $("#acctPay").val(res.data.acctPay);
- $("#cardType").val(res.data.ybkType);
- //$("#realMoney").val(res.data.selfPay);
- } else {
- $("#fundPay").val(0.0);
- $("#acctPay").val(0.0);
- $("#cardType").val(null);
- }
- } else {
- errorMesage(res);
- }
- $("#saveConfirmFee").attr("disabled", false);
- }
- });
- confirmFeeModal(null, null, null);
- }
- var $tally_detail_table;
- /**
- * 初始化本院记账明细表格
- */
- function initTallyDetailTable() {
- $("#haveTallyModal").modal('hide');
- var patientId = $("#patientIdHaveTally").val();
- // var name = $("#nameHaveTally").val();
- if (patientId == null || patientId == '') {
- return;
- }
- $("#tallyDetailModal").modal();
- $('#tally_detail_table').bootstrapTable("destroy");
- $tally_detail_table = $('#tally_detail_table').bootstrapTable({
- url: '/thmz/getTallyReceiptSerial?patientId=' + patientId, //请求后台的URL(*)
- method: 'get', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [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: [
- // {
- // checkbox: true,
- // },
- {
- field: 'patientId',
- title: '病人编号',
- align: "center",
- valign: 'middle'
- }, {
- field: 'name',
- title: '病人姓名',
- align: "center",
- valign: 'middle',
- // formatter: function (value, row, index) {
- // return name;
- // }
- }, {
- field: 'times',
- title: '就诊次数',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'totalCharge',
- title: '总费用(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return value.toFixed(2);
- }
- },
- {
- field: 'chargeDate',
- title: '记账时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }
- // , {
- // title: '操作',
- // align: "center",
- // valign: 'middle',
- // // sortable: true,
- // formatter: function (value, row, index) {
- // var str = '<button type="button" class="registration-no-color-foot-button" title="同步费用明细" onclick="reInsertDetailModal(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-exchange"></i></button>';
- // return str;
- // }
- // }
- ],
- /**
- * @param {点击列的 field 名称} field
- * @param {点击列的 value 值} value
- * @param {点击列的整行数据} row
- * @param {td 元素} $element
- */
- onClickCell: function (field, value, row, $element) {
- var cardNo = $("#cardNo").val();
- if (cardNo == '120' && field == 'name') {
- $element.attr('contenteditable', true);
- $element.html(null);
- $element.focus();
- $element.blur(function () {
- var index = $element.parent().data('index');
- var tdValue = $element.html();
- saveData(index, field, tdValue, row, $tally_detail_table);
- })
- }
- },
- onDblClickRow: function (row) {
- confirmFeeModal(row.times, row.totalCharge, row.receiptNo);
- },
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(ress);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- if (ress.data == null || ress.data.length == 0) {
- $("#tallyDetailModal").modal("hide");
- }
- return {
- "rows": ress.data //数据
- };
- },
- });
- }
- function queryCodePay() {
- $.ajax({
- type: "GET",
- url: '/thmz/NongPay/query?mchOrderNo=202507221753175802948&type=0',
- 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;
- }
- }
- });
- }
- function codePay() {
- const moneyValues = [];
- $('.pay-item').each(function() {
- const $this = $(this);
- const $select = $this.find('select');
- const isAggregatePay = $select.find('option:selected').text() === '聚合支付';
- if (isAggregatePay) {
- const $moneyInput = $this.find('input.money');
- const moneyValue = parseFloat($moneyInput.val()) || 0;
- moneyValues.push(moneyValue);
- }
- });
- var authCode = $('#paymentCode').val();
- $.ajax({
- type: "POST",
- url: '/thmz/NongPay/unifiedOrder',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "amount": moneyValues[0],
- "authCode": authCode,
- "subject": "门诊收费",
- "body": "门诊收费"
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res.code === 9000) {
- if(res.data && (res.data.state === 2 || res.data.orderState === 2)) {
- alert("付款成功");
- }
- }
- }
- });
- }
- /*
- $('#paymentCode').on('input', debounce(codePay, 500));*/
- /**
- * 提交缴费申请
- */
- function saveConfirmFee() {
- $("#saveConfirmFee").attr("disabled", true);
- if (!checkFee(true)) {
- $("#saveConfirmFee").attr("disabled", false);
- return;
- }
- var project = $("#project").val();
- let dyTgId = $("#dyTgId").val();
- var jsonData = JSON.parse('{"patientId":"","times":"","receiptNo":"","mzDepositFiles":[]}');
- var patientId = $("#patientIdHaveTally").val();
- var name = $("#nameHaveTally").val();
- var times = $("#timesHaveTally").val();
- var receiptNo = $("#receiptNoHaveTally").val();
- var doctorName = $("#doctorNameHaveTally").val();
- var realMoney = $("#realMoney").val();
- jsonData.patientId = patientId;
- jsonData.times = times;
- jsonData.receiptNo = receiptNo;
- var arr = $("#payForm").find("div.pay-item");
- if (arr.length > 0) {
- for (var i = 0; i < arr.length; i++) {
- var temp = parseFloat($(arr[i]).find("input.money").val());
- if (temp == null || temp == 0) {
- continue;
- }
- var tempJson = JSON.parse('{"chequeType":"","amount":"","contractId":"","psordnum":"","agtordnum":"","parChannel":"","transDate":"","traceNo":"","dyTgNo":""}');
- tempJson.chequeType = $(arr[i]).find("select").val();
- tempJson.psordnum = $(arr[i]).find("input.refNo").val();
- tempJson.agtordnum = $(arr[i]).find("input.qrCodeParam").val();
- tempJson.parChannel = $(arr[i]).find("input.payChannel").val();
- tempJson.transDate = $(arr[i]).find("input.transDate").val();
- tempJson.traceNo = $(arr[i]).find("input.traceNo").val();
- //现金有可能会多收,比入实收37,对方给了100,需要找零63. 所以必须减去找零金额,才是实收金额
- if (tempJson.chequeType == "1") {
- temp = temp - $("#changeAmount").val();
- temp = temp.toFixed(2);
- }
- if (project != null && project != "null" && project != "") {
- tempJson.contractId = project;
- }
- if(stringNotBlank(dyTgId)){
- tempJson.dyTgNo = dyTgId;
- }
- tempJson.amount = temp;
- jsonData.mzDepositFiles[jsonData.mzDepositFiles.length] = tempJson;
- }
- }
- $.ajax({
- type: "POST",
- url: '/thmz/chargeFee',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(jsonData),
- 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) {
- // if(fpVsesionNo == 0){
- // prn1Print(patientId, times, true, res.receiptNo);
- // }else {
- // printDzfp(patientId, times,res.receiptNo,0)
- // }
- //进入电子发票开票
- printDzfp(patientId, times,res.receiptNo,0,name,realMoney,doctorName)
- successMesage(res);
- closeConfirmFeeModal();
- //缴费成功后清空全局参数
- patientIdFullForNucleicAcid = null;
- initFeeTable();
- //默认光标在卡号输入框
- $("#cardNo").focus();
- // toEvaluation(patientId);
- toNewEvaluation(patientId,times);
- } else {
- errorMesage(res);
- }
- $("#saveConfirmFee").attr("disabled", false);
- }
- });
- }
- /**
- * 关闭收费确认模态弹框
- */
- function closeConfirmFeeModal() {
- $("#confirmFeeModal").modal("hide");
- $("#patientId").val(null);
- $("#cardNo").val(null);
- $("#name").val(null);
- $("#fundPay").val(0);
- $("#acctPay").val(0);
- $("#cardType").val(null);
- }
- /**
- * 保存合作项目
- */
- function saveProject() {
- var projectRealNo = $("#projectRealNo").val();
- var projectCharged = $("#projectCharged").val();
- $.ajax({
- type: "GET",
- url: '/thmz/setMzDepositFileSetContractId?contractId=' + projectCharged + '&serialNo=' + projectRealNo,
- contentType: "application/json;charset=UTF-8",
- 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);
- $("#projectRealNo").val(null);
- $('#projectCharged').selectpicker('val', null);
- $('#projectCharged').selectpicker('refresh');
- $("#projectModal").modal("hide");
- } else {
- errorMesage(res);
- }
- $("#saveConfirmFee").attr("disabled", false);
- }
- });
- }
- //上传电子发票
- function printDzfp(patientId,times,receiptNo,loadingFlag,name,amount,doctorName) {
- if(loadingFlag == 1){
- $("#dzfpLoadingModal").modal('show');
- }
- postAjaxJsonHttpRequst("/thmz/getNewAllSerialForThisTime",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
- if(res.code == 0){
- var typeFlag = "1";
- postAjaxJsonHttpRequst("/thmz/uploadMzInvoice",{patientId:patientId,times:times,receiptNo:receiptNo,ghFlag:false,typeFlag:typeFlag},true,function (rs) {
- if(typeFlag == 1){
- $("#dzfpLoadingModal").modal('hide');
- }
- if(rs.code ==0){
- successMesageSimaple("电子发票上传成功,即将打印!")
- setTimeout(function(){
- prn1PrintAndQRCode(patientId, times,rs.data.serialNo,name,amount,doctorName);
- },3000)
- if(typeFlag == 1){
- initFeeTable();
- }
- }else {
- errorMesage(rs);
- }
- })
- }else {
- $("#dzfpLoadingModal").modal('hide');
- errorMesage(res)
- }
- })
- }
- /**
- *
- * @param patientId
- * @param times
- * @param receiptNo
- * @param typeFlag 1 上传门诊蓝字发票 2上传红字发票 (作废)
- */
- function uploadMzInvoice(patientId,times,receiptNo,typeFlag) {
- postAjaxJsonHttpRequst("/thmz/uploadMzInvoice",{patientId:patientId,times:times,receiptNo:receiptNo,ghFlag:false,typeFlag:typeFlag},true,function (rs) {
- if(typeFlag == 1){
- $("#dzfpLoadingModal").modal('hide');
- }
- if(rs.code ==0){
- successMesageSimaple("电子发票上传成功!")
- if(typeFlag == 1){
- initFeeTable();
- }
- }else {
- errorMesage(rs);
- }
- })
- }
- //下载电子发票
- function downloadDzfp() {
- postAjaxJsonHttpRequst("/thmz/selectDzfpUploadAboutSerialNo",{patientId:dzfp_patientId,times:dzfp_times,serialNo:dzfp_serialNo},true,function (res) {
- if(res.code == 0){
- $("#dzfpDownModal").modal("hide");
- if(res.data.resUrl){
- window.open(res.data.resUrl)
- } else {
- errorMesage("未获取到电子发票,请重新上传发票!");
- }
- }else {
- errorMesage(res)
- }
- })
- }
- var dzfp_patientId ;
- var dzfp_times ;
- var dzfp_serialNo;
- //var dzfp_typeFlag;
- //打开电子发票弹窗
- function openDzfpDownModal(patientId,times,serialNo) {
- console.log("dfds",patientId,times,serialNo)
- dzfp_patientId = patientId;
- dzfp_times = times;
- dzfp_serialNo = serialNo;
- // dzfp_typeFlag = typeFlag;
- $("#dzfpDownModal").modal();
- }
- /**
- * 直接打印发票
- * @param patientId
- * @param times
- * @param chargeFeeFlag 收费 退费标记 true 收费和重打发票来源 false 退费来源
- */
- function prn1PrintHand(patientId, times, chargeFeeFlag, receiptNo, realNo) {
- $("#button_" + realNo).css("display", "none");
- prn1Print(patientId, times, chargeFeeFlag, receiptNo);
- }
- /**
- * 直接打印发票
- * @param patientId
- * @param times
- * @param chargeFeeFlag 收费 退费标记 true 收费和重打发票来源 false 退费来源
- */
- function prn1Print(patientId, times, chargeFeeFlag, receiptNo) {
- var url = '/thmz/getAllSerialForThisTime?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo;
- printCommon(url, patientId, times, chargeFeeFlag);
- }
- /**
- * 重打发票
- * @param patientId
- * @param times
- */
- function repPrint(patientId, times, receiptNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/getReceiptForThisTime?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo,
- contentType: "application/json;charset=UTF-8",
- 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) {
- if (res.data.length == 1) {
- var message = "确定要重新打印发票号码为【" + res.data[0].receiptBill + "】的发票吗?请确认发票打印机即将要打印的发票编号";
- var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=0&receiptBill=" + res.data[0].receiptBill;
- confirmMessage(patientId, times, message, url);
- } else {
- $("#tip_message").text("请选择需要重新打印的发票号");
- $("#repPrintModal").modal();
- $("#repPrintTable").html(null);
- for (var i = 0; i < res.data.length; i++) {
- $("<tr><td>" + res.data[i].receiptBill + "</td></tr>").appendTo("#repPrintTable").bind('click', function () {
- $("#repPrintModal").modal("hide");
- var message = "确定要重新打印发票号码为【" + $(this).text() + "】的发票吗?请确认发票打印机即将要打印的发票编号";
- var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=0&receiptBill=" + $(this).text();
- confirmMessage(patientId, times, message, url);
- });
- }
- }
- }
- }
- });
- }
- /**
- * 发票重打提示
- * @param patientId
- * @param times
- * @param name
- */
- function confirmMessage(patientId, times, message, url) {
- if (!confirm(message)) {
- return;
- }
- //var url='/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=0" + "&receiptBill="+receiptBill;
- printCommon(url, patientId, times, true);
- }
- /**
- * 作废重打发票
- * @param patientId
- * @param times
- */
- function obsoleteAndRepPrint(patientId, times, receiptNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/getReceiptForThisTime?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo,
- contentType: "application/json;charset=UTF-8",
- 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) {
- if (res.data.length == 1) {
- var message = "确定要作废发票号码为【" + res.data[0].receiptBill + "】的发票吗?请确认需要作废发票编号";
- var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=1&receiptBill=" + res.data[0].receiptBill;
- confirmMessage(patientId, times, message, url);
- } else {
- $("#tip_message").text("请选择需要作废的发票号");
- $("#repPrintModal").modal();
- $("#repPrintTable").html(null);
- for (var i = 0; i < res.data.length; i++) {
- $("<tr><td>" + res.data[i].receiptBill + "</td></tr>").appendTo("#repPrintTable").bind('click', function () {
- $("#repPrintModal").modal("hide");
- var message = "确定要作废发票号码为【" + $(this).text() + "】的发票吗?请确认需要作废发票编号";
- var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=1&receiptBill=" + $(this).text();
- confirmMessage(patientId, times, message, url);
- });
- }
- }
- }
- }
- });
- }
- /**
- * 打印医保结算单
- * @param patientId
- * @param times
- * @param receiptNo
- */
- function printYbjsd(patientId, times, receiptNo) {
- if (mzjsdHost == null) {
- errorMesageSimaple("医保结算单域名为空,操作失败!");
- return;
- }
- const iframeEle = document.getElementById('ybjsdDiv');
- const loadingEle = document.getElementById('loading');
- //设置ififrame透明
- iframeEle.style.opacity = 0;
- loadingEle.style.display = 'block';
- var url = mzjsdHost + "/siSettleDetailList/" + patientId + "/" + times;
- $("#ybjsdDiv").attr("src", url);
- iframeEle.addEventListener('load', function () {
- // Hide the loading indicator
- loadingEle.style.display = 'none';
- // Bring the iframe back
- iframeEle.style.opacity = 1;
- });
- $("#ybjsdModal").modal();
- }
- /**
- * 匹配合作项目
- * @param realNo
- */
- function matchProject(realNo) {
- $("#projectRealNo").val(realNo);
- $("#projectModal").modal();
- $.ajax({
- type: "GET",
- url: '/thmz/getMzDepositFileContractId?serialNo=' + realNo,
- contentType: "application/json;charset=UTF-8",
- 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) {
- $('#projectCharged').selectpicker('val', res.data);
- $('#projectCharged').selectpicker('refresh');
- }
- }
- });
- }
- /**
- * 打印发票通用方法
- * @param patientId
- * @param times
- * @param chargeFeeFlag 收费 退费标记 true 收费和重打发票来源 false 退费来源
- */
- function printCommon(url, patientId, times, chargeFeeFlag) {
- setPrint();
- var height = "93.15mm";
- // if (countReceiot % 2 == 0) {
- // height = "93.2mm";
- // }
- $.ajax({
- type: "GET",
- url: url,
- contentType: "application/json;charset=UTF-8",
- 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;
- }
- if (res.code == 0) {
- if (res.data == null || res.data.length == 0) {
- return;
- }
- // countReceiot++;
- for (var i = 0; i < res.data.length; i++) {
- LODOP = getLodop();
- var temp = res.data[i].mzReceiptSerial;
- LODOP.PRINT_INITA(6, 0, "120mm", height, "铭和门诊发票打印");
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "120mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", height);
- LODOP.SET_PRINT_PAGESIZE(1, "120mm", height, "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
- LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
- LODOP.ADD_PRINT_TEXT("6mm", "0mm", "55mm", "3mm", hospitalName);
- LODOP.ADD_PRINT_TEXT("6mm", "59mm", "30mm", "3mm", "机制号:");
- LODOP.ADD_PRINT_TEXT("6mm", "72mm", "20mm", "3mm", temp.serialNo);
- LODOP.ADD_PRINT_TEXT("19mm", "0mm", "35mm", "3mm", temp.receiptBill);
- LODOP.ADD_PRINT_TEXT("25mm", "7mm", "40mm", "3mm", res.mzPatientMi.name);
- LODOP.ADD_PRINT_TEXT("25mm", "61mm", "27mm", "3mm", patientId);
- var feeList = res.data[i].feeList;
- if (feeList != null && feeList.length > 0) {
- var top = 32;
- var left = 6;
- for (var j = 0; j < feeList.length; j++) {
- var row = parseInt(j / 3);
- var tempTop = top + row * 5;
- var tempLeft = left;
- if (j % 3 == 1) {
- tempLeft = left + 30;
- } else if (j % 3 == 2) {
- tempLeft = left + 60;
- }
- LODOP.ADD_PRINT_TEXT(tempTop + "mm", tempLeft + "mm", "30mm", "3mm", feeList[j]);
- }
- }
- // LODOP.ADD_PRINT_TEXT("32mm","25mm","25mm","3mm","诊查费 10.00");
- // LODOP.ADD_PRINT_TEXT("32mm","50mm","25mm","3mm","中成药费30.10");
- // LODOP.ADD_PRINT_TEXT("37mm","25mm","25mm","3mm","治疗费 22.00");
- // LODOP.ADD_PRINT_TEXT("37mm","50mm","25mm","3mm","材料费 14.20");
- // LODOP.ADD_PRINT_TEXT("42mm","25mm","25mm","3mm","西药费 161.20");
- // var qyxxs = res.data[i].qyxxs;
- // if (qyxxs != null && qyxxs.length > 0) {
- // var top = 54;
- // for (var j = 0; j < qyxxs.length; j++) {
- // var row = j / 3;
- // var tempTop = top + row * 10;
- // var qyxx = qyxxs[j];
- // var arr = qyxx.split(",");
- // LODOP.ADD_PRINT_TEXT(tempTop + "mm", "6mm", "50mm", "3mm", "取药窗口:" + arr[0]);
- // LODOP.ADD_PRINT_TEXT(tempTop + "mm", "61mm", "50mm", "3mm", "取药号码:" + arr[1]);
- // }
- // }
- var payInfo = res.data[i].payInfo;
- LODOP.ADD_PRINT_TEXT("54mm", "6mm", "100mm", "3mm", payInfo);
- // LODOP.ADD_PRINT_TEXT("54mm","25mm","50mm","3mm","取药窗口:西药房4号窗口");
- // LODOP.ADD_PRINT_TEXT("54mm","80mm","35mm","3mm","取药号码:408392");
- var totalCharge = temp.totalCharge + " 元 ";
- if (res.data[i].countYbZf > 0) {
- totalCharge = totalCharge + "城职普门"
- } else {
- totalCharge = totalCharge + "自费"
- }
- LODOP.ADD_PRINT_TEXT("65mm", "21mm", "65mm", "3mm", totalCharge);
- LODOP.ADD_PRINT_TEXT("72mm", "19mm", "65mm", "3mm", res.data[i].totalChargeStr);
- LODOP.ADD_PRINT_TEXT("79mm", "0mm", "15mm", "3mm", res.data[i].year);//年
- LODOP.ADD_PRINT_TEXT("79mm", "13mm", "10mm", "3mm", res.data[i].month);//月
- LODOP.ADD_PRINT_TEXT("79mm", "25mm", "10mm", "3mm", res.data[i].day);//日
- LODOP.ADD_PRINT_TEXT("79mm", "53mm", "50mm", "3mm", temp.operatorId);//收费员
- // LODOP.PREVIEW();
- LODOP.PREVIEW();
- initFeeTable();
- }
- } else if (res.code == -1) {
- //退费就退出,不提示异常
- if (!chargeFeeFlag) {
- return;
- }
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 打印发票通用方法
- * @param patientId
- * @param times
- * @param chargeFeeFlag 收费 退费标记 true 收费和重打发票来源 false 退费来源
- */
- /**
- * 直接打印发票
- * @param patientId
- */
- function prn1PrintAndQRCode(patientId, times,serialNo,name,fee,doctorName) {
- // getInvoiceBase64(patientId,times,serialNo)
- // setPrint();
- // var height = "93.15mm";
- // var bkimgWidth = "120mm"
- // if(fpVsesionNo == 1){
- // height = "60mm"
- // bkimgWidth = "110mm"
- // }
- //
- // // countReceiot++;
- // LODOP = getLodop();
- // var temp = res.data;
- // LODOP.PRINT_INITA(6, 0, bkimgWidth, height, "铭和门诊发票打印");
- // //设置默认打印机
- // LODOP.SET_PRINTER_INDEX(printIndex);
- // LODOP.SET_SHOW_MODE("BKIMG_WIDTH", bkimgWidth);
- // LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", height);
- // LODOP.SET_PRINT_PAGESIZE(1,bkimgWidth, height, "CreateCustomPage");
- // LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
- // LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
- // LODOP.ADD_PRINT_TEXT("6mm", "0mm", "55mm", "3mm", hospitalName);
- //获取项目集合
- var params = {
- billItemCode:'012',
- patientId:patientId,
- times:times,
- payMark:0,
- receiptNo:'1',
- }
- // initChargeDetailTablePublic('/thmz/getMzChargeDetailByBillItem', $('#charge_detail_table'), queryParamsForDetail);
- // var projectList = [];
- $("#printProjectName").empty();
- postAjaxJsonHttpRequst("/thmz/getMzChargeDetailByBillItem",params,true,function (res) {
- if(res.code == 0){
- res.data.forEach((item,index)=>{
- console.log("item",item.tcName,item.amount)
- // projectList.add({
- // name:item.name,
- // fee:item.chargeAmount
- // })
- var html = '<div style="font-size:15px;line-height:15px;float:left;width:150px;"><span style="width:105px;display:inline-block;overflow:hidden;white-space: nowrap;" id="printProjectName'+(index+1)+'">'+item.tcName+'</span><span style="margin-left: 5px;line-height:15px;" id="printProjectFee'+(index+1)+'">'+item.amount+'</span><br /></div>'
- $('#printProjectName').append(html);
- })
- postAjaxJsonHttpRequst("/thmz/selectDzfpUploadAboutSerialNo",{patientId:patientId,times:times,serialNo:serialNo},true,function (dzfp) {
- if(dzfp.code == 0){
- if(dzfp.data.resUrl){
- JsBarcode('#barcode', patientId, {
- renderer: "svg",
- lineColor: '#000000', //线条颜色
- width: 1, //线宽
- height: 30, //条码高度
- displayValue: true, //是否显示文字信息
- fontSize: 14,
- });
- $("#printDate1").text(name);
- $("#printDate2").text(fee);
- $("#printDate3").text(dzfp.data.fpNo);
- $("#printDate4").text(dzfp.data.opCode);
- $("#printDate5").text(dzfp.data.blueIssueDate);
- $("#printDate5").text(dzfp.data.blueIssueDate);
- $("#printDate6").text(doctorName);
- let src = createInMemoryQR(dzfp.data.resUrl);
- let wxPayQrCardHtml =`<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 140px;margin-top: 2px;"></div>`;
- $("#dzfpImg").html(wxPayQrCardHtml);
- setPrint();
- LODOP = getLodop();
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "192mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "97mm");
- LODOP.SET_PRINT_PAGESIZE(1, "192mm", "97mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
- var strStyle = "<style>table{width: 170mm;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse;padding: 8px;}</style>"
- LODOP.ADD_PRINT_HTM("0mm", "8mm", "140mm", "380mm", strStyle + document.getElementById("report_table").innerHTML);
- LODOP.PREVIEW();
- // LODOP.ADD_PRINT_IMAGE("70mm", "3mm", "50mm", "50mm", createInMemoryQR(dzfp.data.resUrl));
- // console.log("img",createInMemoryQR(dzfp.data.resUrl))
- } else {
- errorMesage("未获取到电子发票,请重新上传发票!");
- }
- }else {
- errorMesage(res)
- }
- })
- } else {
- errorMesage("未获取到收费项目,请重试!");
- }
- })
- };
- function createInMemoryQR(url) {
- try {
- // 创建不可见的临时容器
- const tempContainer = document.createElement('div');
- tempContainer.style.display = 'none';
- document.body.appendChild(tempContainer);
- // 在临时容器中生成二维码
- new QRCode(tempContainer, {
- text: url,
- width: 200,
- height: 200,
- margin: 2,
- color: {
- dark: '#1a2980',
- light: '#ffffff'
- }
- });
- // 等待一小段时间确保二维码生成完成
- // 注意:这是一个简化处理,实际生产环境中可能需要更可靠的检测机制
- let attempts = 0;
- while (!tempContainer.querySelector('canvas') && attempts < 10) {
- attempts++;
- // 短暂延迟
- for (let i = 0; i < 1000000; i++);
- }
- // 获取生成的二维码canvas
- const qrCanvas = tempContainer.querySelector('canvas');
- if (!qrCanvas) {
- throw new Error('二维码生成失败');
- }
- // 创建内存中的canvas并复制内容
- const canvas = document.createElement('canvas');
- canvas.width = qrCanvas.width;
- canvas.height = qrCanvas.height;
- const ctx = canvas.getContext('2d');
- ctx.drawImage(qrCanvas, 0, 0);
- // 清理临时容器
- document.body.removeChild(tempContainer);
- // 返回Base64数据
- return canvas.toDataURL('image/png');
- } catch (error) {
- alert('生成失败: ' + error.message);
- return null;
- }
- }
- //
- // /**
- // * 加载打印机列表
- // * @constructor
- // */
- // function CreatePrinterList() {
- // LODOP = getLodop();
- // LODOP.PRINT_INITA(6, 0, "92mm", "120mm", "铭和门诊发票打印");
- // //获取打印机设备数,用于进行遍历
- // var count = LODOP.GET_PRINTER_COUNT();
- // var html = "";
- // for (var i = 0; i < count; i++) {
- // //根据设备序号获取设备名
- // var msg = LODOP.GET_PRINTER_NAME(i);
- // html += "<option value='" + i + "'>" + msg + "</option>";
- // }
- // $('#printSelect').html(html);
- // $('#printSelect').selectpicker('refresh');
- // $.ajax({
- // type: "GET",
- // url: '/thmz/getLastWindowsByCurrentUser',
- // contentType: "application/json;charset=UTF-8",
- // 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) {
- // $('#printSelect').selectpicker('val', res.data.printIndex);
- // $('#printSelect').selectpicker('refresh');
- // printIndex=res.data.printIndex;
- // }
- // }
- // });
- // }
- //
- //
- // /**
- // * 保存窗口号
- // */
- // function saveWindows() {
- // $.ajax({
- // type: "POST",
- // url: '/thmz/saveWindows',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({"windowsNo": $("#windowsNum").val()}),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // $('#editWindowsModal').modal('hide');
- // if (res.code == 0) {
- // new PNotify({
- // title: '操作提示',
- // text: res.message,
- // type: 'success',
- // hide: true,
- // styling: 'bootstrap3'
- // });
- // } else {
- // new PNotify({
- // title: '错误提示',
- // text: res.message,
- // type: 'error',
- // hide: true,
- // styling: 'bootstrap3'
- // });
- // }
- // }
- // });
- // }
- //
- //
- //
- // /**
- // * 保存打印机
- // */
- // function savePrint() {
- // $.ajax({
- // type: "POST",
- // url: '/thmz/savePrintIndex',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({"printIndex": $("#printSelect").val()}),
- // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- // success: function (res) {
- // if (res == '401' || res == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // LODOP = getLodop();
- // LODOP.PRINT_INITA(6, 0, "92mm", "120mm", "铭和门诊发票打印");
- // LODOP.SET_PRINTER_INDEX($("#printSelect").val());
- // printIndex=$("#printSelect").val();
- // $('#editPrintModal').modal('hide');
- // if (res.code == 0) {
- // new PNotify({
- // title: '操作提示',
- // text: res.message,
- // type: 'success',
- // hide: true,
- // styling: 'bootstrap3'
- // });
- // } else {
- // new PNotify({
- // title: '错误提示',
- // text: res.message,
- // type: 'error',
- // hide: true,
- // styling: 'bootstrap3'
- // });
- // }
- // }
- // });
- // }
- /**
- * 查询默认打印机
- */
- function setPrint() {
- if (printIndex >= 0) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getLastWindowsByCurrentUser',
- contentType: "application/json;charset=UTF-8",
- 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;
- }
- if (res.code == 0) {
- printIndex = res.data.printIndex;
- } else {
- printIndex = -1;
- }
- }
- });
- }
- /**
- * 退费操作
- */
- function refundFee(patientId, times, receiptNo, printFlag,orderTypeName) {
- if(orderTypeName =='商城处方'){
- errorMesageSimaple('商城处方不能退费')
- return
- }
- $("#refundFeePrepare").text(0.00);
- $("#refundFeeDetailModal").modal();
- $("#refund_bill_item_group").removeClass("in").addClass("hide");
- $('#refund_fee_bill_table').bootstrapTable("destroy");
- initRefundFeeDetailTable(patientId, times, receiptNo);
- }
- /**
- * 初始化退费明细表格
- * @param patientId
- * @param times
- * @param receiptNo
- */
- function initRefundFeeDetailTable(patientId, times, receiptNo) {
- $("#patientIdRefund").val(patientId);
- $("#timesRefund").val(times);
- $("#receiptNoRefund").val(receiptNo);
- $('#refund_fee_detail_table').bootstrapTable("destroy");
- $('#refund_fee_detail_table').bootstrapTable({
- url: '/thmz/getRefundFeeDetail', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- // sortName: 'orderNo', //排序字段
- queryParams: queryParamsForRefundFee(patientId, times, receiptNo), //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [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: [
- {
- checkbox: true,
- formatter: function (value, row, index) {
- if (row.confirmFlag == 1) {
- return {
- disabled: true, //设置是否可用
- checked: false//设置选中
- }
- }
- if (row.confirmFlag == 3) {
- //getRefundFee();
- return {
- disabled: true, //设置是否可用
- checked: true//设置选中
- }
- }
- }
- },
- {
- field: 'orderNo',
- title: '处方号',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value);
- }
- }, {
- field: '',
- title: '项目号',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return index + 1;
- }
- }, {
- field: 'billItemCode',
- title: '分类名称',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'yjName',
- title: '医技项目名称',
- align: "center",
- valign: 'middle',
- },{
- field: 'chargeItemCode',
- title: '收费编码',
- align: "center",
- valign: 'middle',
- }, {
- field: 'tcName',
- title: '项目',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'quantity',
- title: '数量',
- align: "center",
- valign: 'middle'
- ,
- formatter: function (value, row, index) {
- return value * row.drugWin;
- }
- }, {
- field: 'unitPrice',
- title: '单价(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return value.toFixed(2);
- }
- }, {
- field: 'amount',
- title: '总金额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return value.toFixed(2);
- }
- }, {
- field: 'confirmFlag',
- title: '确认标志',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == 0) {
- return "待确认";
- }
- if (value == 1) {
- return "已确认";
- }
- if (value == 3) {
- return "已取消";
- }
- if (value == 4) {
- return "已退费";
- }
- }
- }, {
- field: 'decAmount',
- title: '退药量',
- align: "center",
- valign: 'middle',
- // formatter: function (value, row, index) {
- // return value.toFixed(2);
- // }
- }, {
- field: 'execDept',
- title: '确认科室',
- align: "center",
- valign: 'middle'
- }, {
- field: 'confirmTime',
- title: '确认时间',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value != null && value != "") {
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- return "";
- }
- }
- ],
- //点击全选框时触发的操作
- onCheckAll: function (rows) {
- getRefundFee();
- },
- //取消所有
- onUncheckAll: function (row) {
- getRefundFee();
- },
- //点击每一个单选框时触发的操作
- onCheck: function (row) {
- getRefundFee();
- },
- //取消每一个单选框时对应的操作;
- onUncheck: function (row) {
- getRefundFee();
- },
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- //"total": ress.pageViewVo.total,//总页数
- "rows": ress.data //数据
- };
- },
- //加载完成事件
- onLoadSuccess: function (data) {
- getRefundFee();
- }
- });
- }
- /**
- * 退费列表参数
- * @param patientId
- * @param times
- * @returns {{patientId: *, times: *}}
- */
- function queryParamsForRefundFee(patientId, times, receiptNo) {
- var temp = {
- patientId: patientId,
- times: times,
- receiptNo: receiptNo
- };
- return temp;
- };
- /**
- * 每次选择费用清单明细时计算实际应退金额
- */
- function getRefundFee() {
- extracted();
- if (chargeItemCodes == null) {
- $("#refundFeePrepare").text(0.00);
- return;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getNewListForRefundFee',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- patientId: $("#patientIdRefund").val(),
- times: $("#timesRefund").val(),
- receiptNo: $("#receiptNoRefund").val(),
- chargeItemCodes: chargeItemCodes
- }),
- 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) {
- $("#refundFeePrepare").text(res.pageViewVo.data[0].refundFee.toFixed(2));
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 发起预退费
- */
- function readyRefundFee() {
- extracted();
- $("#refundFeeModal").modal();
- initRefundChargeDetailTable(chargeItemCodes);
- $("#refundFeeDetailModal").modal("hide");
- }
- /**
- * 获取预退费金额
- * @returns {*}
- */
- function extracted() {
- var allSelecteds = $('#refund_fee_detail_table').bootstrapTable('getAllSelections');
- chargeItemCodes = null;
- if (allSelecteds != null && allSelecteds.length > 0) {
- for (var i = 0; i < allSelecteds.length; i++) {
- var temp = allSelecteds[i].orderNo + "_" + allSelecteds[i].itemNo + "_" + allSelecteds[i].chargeItemCode;
- if (chargeItemCodes == null) {
- chargeItemCodes = temp;
- } else {
- chargeItemCodes += "," + temp;
- }
- }
- }
- }
- /**
- * 初始化退费重收费明细表格
- */
- function initRefundChargeDetailTable(chargeItemCodes) {
- $('#refund_fee_table').bootstrapTable("destroy");
- $('#refund_fee_table').bootstrapTable({
- url: '/thmz/getNewListForRefundFee', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- // sortName: 'orderNo', //排序字段
- queryParams: queryParamsForRefundDetail(chargeItemCodes), //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [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: [
- // {
- // checkbox: true
- // },
- {
- field: 'patientId',
- title: '患者编号',
- align: "center",
- valign: 'middle',
- }, {
- field: 'name',
- title: '患者姓名',
- align: "center",
- valign: 'middle',
- }, {
- field: 'oriAmount',
- title: '已收金额(元)',
- align: "center",
- valign: 'middle',
- }, {
- field: 'refundFee',
- title: '应退金额(元)',
- align: "center",
- valign: 'middle'
- }, {
- field: 'amount',
- title: '应收金额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value);
- }
- }, {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- var str = "";
- if (row.amount == 0 || row.amount == null || row.amount == undefined) {
- str = '<button type="button" class="can-not-used" title="费用明细" ><i id="plusOrMinus" class="fa fa-plus"></i></button>';
- } else {
- str = '<button type="button" class="registration-no-color-foot-button" title="费用明细" onclick="initMzChargeDetailByBillItem(true)"><i id="plusOrMinus" class="fa fa-plus"></i></button>';
- }
- if((row.amount == 0 || row.amount == null || row.amount == undefined) || row.ybZfFlag == null || row.ybZfFlag =='0'){
- str += '<button type="button" class="can-not-used" title="撤销医保重新登记医保" ><i class="fa fa-server"></i></button>';
- }else {
- str += '<button type="button" class="registration-no-color-foot-button" title="撤销医保重新登记医保" onclick="reqYb()"><i class="fa fa-server"></i></button>';
- }
- if(row.mipOrderFlag == 1){
- str += `<button type="button" class="registration-no-color-foot-button"title="读取电子凭证" onclick="reSiReadCard(true,'01')"><i class="fa fa-newspaper-o"></i></button>`;
- }
- str += '<button type="button" class="registration-no-color-foot-button"title="普通退费" onclick="saveRefundFee(0)"><i class="fa fa-check"></i></button>';
- str += '<button type="button" class="registration-no-color-foot-button"title="原路退费" onclick="saveRefundFee(1)"><i class="fa fa-exchange"></i></button>';
- return str;
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- if((ress.pageViewVo.data[0].ybZfFlag =='1' ) && (ress.pageViewVo.data[0].amount !=null && ress.pageViewVo.data[0].amount != undefined && ress.pageViewVo.data[0].amount != 0)){
- $("#tfGrzhzfDiv").removeClass("hide").addClass("in");
- }else {
- $("#tfGrzhzfDiv").removeClass("in").addClass("hide");
- }
- $("#oriAmount").text(ress.pageViewVo.data[0].oriAmount);
- $("#newAmount").text(ress.pageViewVo.data[0].amount);
- $("#refundAmount").text(ress.pageViewVo.data[0].refundFee);
- return {
- "total": ress.pageViewVo.total,//总页数
- "rows": ress.pageViewVo.data //数据
- };
- },
- });
- }
- /**
- * 构建列表查询参数
- * @param chargeItemCodes
- * @returns {{patientId: string | number | string[] | undefined | jQuery, times: string | number | string[] | undefined | jQuery, billItemCode: number}}
- */
- function queryParamsForRefundDetail(chargeItemCodes) {
- return {
- patientId: $("#patientIdRefund").val(),
- times: $("#timesRefund").val(),
- receiptNo: $("#receiptNoRefund").val(),
- chargeItemCodes: chargeItemCodes
- };
- };
- /**
- * 关闭预退费窗口
- */
- function closeRefundFeeDetailModal() {
- $("#refundFeeDetailModal").modal("hide");
- }
- /**
- * 提交退费操作
- * @param refundType 0 现金退费 1 原路退费
- */
- function saveRefundFee(refundType) {
- var params = queryParamsForRefundByBillItem(null);
- params.refundType = refundType;
- params['readCardResult'] = $("#cdReadCardResult").val()
- params['acctUsedFlag'] = $("#tfGrzhzf").val()
- params['readCardType'] = $("#tfReadType").val()
- $.ajax({
- type: "POST",
- url: '/thmz/saveRefundFee',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify(params),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#cdReadCardResult").val(null)
- if (res.code == 0 || res.code == -2) {
- successMesage(res);
- $("#refundFeeModal").modal("hide");
- var refundMzDepositFiles = res.refundMzDepositFiles;
- if (refundMzDepositFiles != null && refundMzDepositFiles.length > 0) {
- var html = '';
- for (var i = 0; i < refundMzDepositFiles.length; i++) {
- var mzDepositFile = refundMzDepositFiles[i];
- html += '<div class="item form-group col-md-12 col-sm-12 col-xs-12">';
- html += '<label style="padding-left: 0px;" class="control-label col-md-2 col-sm-2 col-xs-2">';
- html += mzDepositFile.chequeType;
- html += '</label>';
- html += '<div class="col-md-6 col-sm-6 col-xs-6">';
- html += '<input type="text" class="form-control" readonly value="' + Math.abs(mzDepositFile.amount) + '">';
- html += '</div>';
- html += '<label style="text-align: left;" class="control-label col-md-1 col-sm-1 col-xs-1">元</label>';
- html += '<label style="text-align: left;color: red" class="control-label col-md-3 col-sm-3 col-xs-3">';
- if(res.mipOrdeFlag !=null && res.mipOrdeFlag == 1){
- html += "原路退回";
- }
- else if ((refundType == 1 && (mzDepositFile.chequeType == "银联卡" || mzDepositFile.chequeType == "聚合支付")) || mzDepositFile.chequeType == "医保记账" || mzDepositFile.chequeType == "省医保个账" || mzDepositFile.chequeType == "市医保个账") {
- html += "原路退回";
- }
- html += '</label>';
- html += '</div>';
- }
- $("#refundPayDetailForm").html(html);
- $("#refundPayDetailModal").modal();
- }
- //作废电子发票
- if(fpVsesionNo == 1){
- uploadMzInvoice(params.patientId, params.times,params.receiptNo,2);
- }
- if (res.times > 0) {
- let fpTitle = fpVsesionNo == 0 ? '打印' : '上传';
- if(confirm(`是否${fpTitle}发票?`)){
- if(fpVsesionNo == 0){
- prn1Print(res.patientId, res.times, false, 1);
- }else {
- printDzfp(res.patientId, res.times,1,0)
- }
- }
- } else {
- initFeeTable();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空查询条件
- */
- function cleanParams() {
- $("#deptNoParam").selectpicker('val', null);//默认选中
- $("#deptNoParam").selectpicker('refresh');
- $("#doctorParam").selectpicker('val', null);//默认选中
- $("#doctorParam").selectpicker('refresh');
- $("#cardNo").val(null);
- $("#name").val(null);
- $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
- $("#patientId").val(null);
- //默认光标在卡号输入框
- $("#cardNo").focus();
- $("#serialNo").val(null);
- $("#ownData").removeAttr("checked");
- }
- /**
- * 增加收费方式
- */
- function addPayType(id) {
- // var arr = $("#payForm").find("div.pay-item");
- // if (arr.length > 0) {
- // for (var i = 0; i < arr.length; i++) {
- // var temp = parseFloat($(arr[i]).find("input").val());
- // if (temp == 0) {
- // new PNotify({
- // title: '错误提示',
- // text: "存在未使用的收款方式,请不要重复添加!",
- // type: 'error',
- // hide: true,
- // styling: 'bootstrap3'
- // });
- // return;
- // }
- // }
- // }
- var payTypeId = null;
- if (id != undefined && id != null) {
- payTypeId = id;
- } else {
- var payTypeIndex = $("#payTypeIndex").val();
- payTypeId = "payType_" + payTypeIndex;
- }
- var html = '<div class="item form-group pay-item"><div class="col-md-12 col-sm-12 col-xs-12"> <input type="hidden" class="refNo"/><input type="hidden" class="qrCodeParam"/><input type="hidden" class="transDate"/><input type="hidden" class="payChannel"/><input type="hidden" class="traceNo"/><div class="col-md-2 col-sm-2 col-xs-12"></div><label class="col-md-3 col-sm-3 col-xs-12"><select class="form-control selectpicker show-tick" required="true" id="' + payTypeId + '" onchange="checkFee(false)"></select></label><div class="col-md-3 col-sm-3 col-xs-12"><input class="form-control col-md-5 col-xs-12 money" type="number" data-placement="bottom-right" min="0" onchange="checkFee(false)" ';
- if ("payType" == id) {
- html += " id='cash' ";
- }
- html += '></div><div class="col-md-1 col-sm-1 col-xs-12" style="line-height: 34px;">元 <a style="line-height: 34px;cursor: pointer;" onclick="closeThisParent(this)"><i class="fa fa-close"></i></a></div></div></div>';
- $("#changeAmountParent").before(html);
- initChequeType(payTypeId)
- if (payTypeIndex != undefined && payTypeIndex != null) {
- payTypeIndex = Add(payTypeIndex, 1);
- $("#payTypeIndex").val(payTypeIndex);
- }
- $("#addPayType").parent().removeClass("in").addClass("hide");
- }
- // /**
- // * 取消费用上传
- // */
- // function cancelFee() {
- // var patientId = $("#patientIdHaveTally").val();
- // var times = $("#timesHaveTally").val();
- // var receiptNo = $("#receiptNoHaveTally").val();
- // $.ajax({
- // type: "POST",
- // url: '/thmz/cancelTmFee',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({"patientId": patientId, "times": times, "receiptNo": receiptNo}),
- // 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;
- // }
- // if (res.code == 0) {
- // $("#fundPay").val(0);
- // } else {
- // new PNotify({
- // title: '错误提示',
- // text: res.message,
- // type: 'error',
- // hide: true,
- // styling: 'bootstrap3'
- // });
- // }
- // }
- // });
- // }
- /**
- * 查询当前门诊缴费订单的所有缴费方式列表
- * @param patientId
- * @param times
- * @param receiptNo
- */
- function showChequType(patientId, times, receiptNo) {
- $("#depositFileModal").modal();
- $('#deposit_file_detail_table').bootstrapTable("destroy");
- $('#deposit_file_detail_table').bootstrapTable({
- url: '/thmz/getAllDepositFileForThisTime?patientId=' + patientId + "×=" + times + "&receiptNo=" + Math.abs(receiptNo), //请求后台的URL(*)
- method: 'get', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [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: [
- // {
- // checkbox: true,
- // },
- {
- field: 'patientId',
- title: '病人编号',
- align: "center",
- valign: 'middle'
- }, {
- field: 'times',
- title: '就诊次数',
- align: "center",
- valign: 'middle',
- }, {
- field: 'amount',
- title: '支付金额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return value.toFixed(2);
- }
- },
- {
- field: 'chequeTypeName',
- title: '支付方式',
- align: "center",
- valign: 'middle'
- }
- ],
- onDblClickRow: function (row) {
- editChequType(row.receiptSn, row.chequeType, row.dcountNo, row.chequeTypeName);
- },
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- if (ress.data == null || ress.data.length == 0) {
- $("#tallyDetailModal").modal("hide");
- }
- return {
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 修改收款方式
- * @param patientId
- * @param times
- * @param paymode
- */
- function editChequType(receiptSn, chequType, dcountNo, chequeTypeName) {
- var message = "当前病人本次门诊缴费的支付方式为【" + chequeTypeName + "】,确定需要修改吗?";
- if (dcountNo == 1) {
- message = "当前病人本次门诊缴费的支付方式为【" + chequeTypeName + "】,且本次缴费已经结算,确定需要修改吗?如仍需继续修改,会影响已经结算的报表,请重新打印本次缴费所在日期的【日结报表】!";
- }
- $("#editPayModeTip").html(message);
- $("#receiptSn").val(receiptSn);
- $("#chequType").val(chequType);
- $('#payTypeEditPayMode').selectpicker('val', 1);
- $('#payTypeEditPayMode').selectpicker('refresh');
- $("#editPayModeModal").modal();
- $("#depositFileModal").modal("hide");
- }
- /**
- * 提交修改收款方式
- */
- function saveEditPayMode() {
- $.ajax({
- type: "GET",
- url: '/thmz/updateChequType?oldChequeType=' + $("#chequType").val() + "&receiptSn=" + $("#receiptSn").val() + "&chequeType=" + $("#payTypeEditPayMode").val(),
- contentType: "application/json;charset=UTF-8",
- 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);
- clearEditPayMode();
- $("#editPayModeModal").modal("hide");
- } else if (res.code == -1) {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 清空
- */
- function clearEditPayMode() {
- $("#receiptSn").val(null);
- $("#chequType").val(null);
- }
- //
- // /**
- // * 反写备份表的数据到正式表中,记账的数据在备分表
- // * @param patientId
- // * @param times
- // * @param receiptNo
- // */
- // function reInsertDetailModal(patientId,times ,receiptNo) {
- // $.ajax({
- // type: "POST",
- // url: '/thmz/reSaveDetailForByjz',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({"patientId": patientId, "times": times, "receiptNo": receiptNo}),
- // 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;
- // }
- // if (res.code == 0) {
- // successMesage(res);
- // initFeeTable();
- // } else {
- // new PNotify({
- // title: '错误提示',
- // text: res.message,
- // type: 'error',
- // hide: true,
- // styling: 'bootstrap3'
- // });
- // }
- // }
- // });
- // }
- /**
- * 医保电子凭证读卡
- * @param params
- */
- function siReadCard(params) {
- $.ajax({
- type: "GET",
- url: params && params.startsWith('jiangsu_qrcode') ? 'http://localhost:8321/api/entry?param=' + params : 'http://localhost:8321/readcard/entry?param=' + params,
- contentType: "application/json;charset=UTF-8",
- 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;
- }
- //console.log(res);
- if (res.code == 200) {
- var data = JSON.parse(res.data);
- queryUserInfoBySocialNoNotFillPatient('cardNo', "" + data.data.idNo + "", initFeeTable, null);
- } else {
- errorMesage(res);
- }
- }
- });
- // window.open('ReadCard://'+prm, '_self')
- }
- /**
- * 读卡类型改变事件
- */
- // function mztczfSiReadCardTypeChange() {
- // var grzhzf = $("#grzhzf").val();
- // if (grzhzf == null || grzhzf == "") {
- // errorMesageSimaple("请先选择是否使用个人账户余额支付剩余门诊费用!")
- // $('#mztczfSiReadCardType').selectpicker('val', null);
- // $('#mztczfSiReadCardType').selectpicker('refresh');
- // return;
- // }
- // var mztczfSiReadCardType = $("#mztczfSiReadCardType").val();
- // if (mztczfSiReadCardType == null || mztczfSiReadCardType == "") {
- // return;
- // }
- // let admdvs = $('#mztczfAdvmCity').val()
- // if(!stringNotBlank(admdvs)){
- // errorMesageSimaple("请选择参保地!")
- // $('#mztczfSiReadCardType').selectpicker('val', null);
- // $('#mztczfSiReadCardType').selectpicker('refresh');
- // return;
- // }
- // postAjaxJsonHttpRequst("/thmz/queryNewInsuinfo",{
- // patientId :readPatientId,
- // times :readTimes,
- // admdvs:admdvs
- // },true,function (sfzRes) {
- // if (sfzRes == '401' || sfzRes == 401) {
- // window.location.href = '/thmz/login/view'
- // return;
- // }
- // if(sfzRes.code == 0){
- // var url = "http://localhost:8321/readcard/entry?param=";
- // if (mztczfSiReadCardType == "03") {
- // // url += 'sicard_01101';
- // url = "http://localhost:8321/readcard/jiangsu/readcard_auto";
- // // url += 'readcard_auto';
- // } else if (mztczfSiReadCardType == "01") {
- // // url += 'qrcode_01101';
- // url = "http://localhost:8321/api/entry?param=";
- // url += 'jiangsu_qrcode_01101';
- // } else if (mztczfSiReadCardType == "02") {
- // // url += 'idcard_01101';
- // url += 'huashi_readcard';
- // }else if (mztczfSiReadCardType == "04") {
- // url += 'face_01101';
- // url += 'jiangsu_face_01101';
- // }
- // $.ajax({
- // type: "GET",
- // url: url,
- // contentType: "application/json;charset=UTF-8",
- // 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 == 200) {
- // if (mztczfSiReadCardType == "03") {
- // $("#readCardResult").val(res.rawCardData);
- // $("#pBusiCardInfo").val(res.rawBusiData);
- // } else if (mztczfSiReadCardType == "01") {
- // var data = JSON.parse(res.data);
- // $("#readCardResult").val(JSON.stringify(data.data));
- // } else {
- // $("#readCardResult").val(res.data);
- // }
- // successMesageSimaple("读卡成功,可以进行医保结算操作。");
- // $("#mztczfSiReadCardModal").modal("hide");
- // } else {
- // warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!")
- // console.log(res);
- // }
- // },
- // error: function (XMLHttpRequest, textStatus, errorThrown) {
- // warningMesageSimaple("读卡异常,可以稍后重试或者自费结算(不享受门诊统筹)!")
- // }
- // });
- // }else {
- // errorMesage(sfzRes)
- // }
- // })
- // }
- function mztczfSiReadCardTypeChange() {
- // 显示loading效果
- $("#readLoadingModal").modal('show');
-
- // var grzhzf = $("#grzhzf").val();
- // if (grzhzf == null || grzhzf == "") {
- // errorMesageSimaple("请先选择是否使用个人账户余额支付剩余门诊费用!");
- // $('#mztczfSiReadCardType').selectpicker('val', null);
- // $('#mztczfSiReadCardType').selectpicker('refresh');
- // $("#readLoadingModal").modal('hide'); // 隐藏loading
- // return;
- // }
- // var mztczfSiReadCardType = $("#mztczfSiReadCardType").val();
- // if (mztczfSiReadCardType == null || mztczfSiReadCardType == "") {
- // $("#readLoadingModal").modal('hide'); // 隐藏loading
- // return;
- // }
- // let admdvs = $('#mztczfAdvmCity').val();
- // if (!stringNotBlank(admdvs)) {
- // errorMesageSimaple("请选择参保地!");
- // $('#mztczfSiReadCardType').selectpicker('val', null);
- // $('#mztczfSiReadCardType').selectpicker('refresh');
- // $("#readLoadingModal").modal('hide'); // 隐藏loading
- // return;
- // }
- var grzhzf = $('input[name="grzhzf"]:checked').val();
- if (grzhzf == null || grzhzf == "") {
- errorMesageSimaple("请先选择是否使用个人账户余额支付剩余门诊费用!");
- $('input[name="grzhzf"]').prop('checked', false);
- $("#grzhzf_0").prop('checked', true);
- $("#readLoadingModal").modal('hide'); // 隐藏loading
- return;
- }
- var mztczfSiReadCardType = $('input[name="mztczfSiReadCardType"]:checked').val();
- if (mztczfSiReadCardType == null || mztczfSiReadCardType == "") {
- errorMesageSimaple("请选择读卡类型!");
- $("#readLoadingModal").modal('hide'); // 隐藏loading
- return;
- }
- let admdvs = $('#mztczfAdvmCity').val();
- if (!stringNotBlank(admdvs)) {
- errorMesageSimaple("请选择参保地!");
- $('input[name="mztczfSiReadCardType"]').prop('checked', false);
- $("#mztczfSiReadCardType_03").prop('checked', true);
- $("#readLoadingModal").modal('hide'); // 隐藏loading
- return;
- }
- var url = "";
- if (mztczfSiReadCardType == "03") {
- url = "http://localhost:8321/readcard/jiangsu/readcard_auto";
- } else if (mztczfSiReadCardType == "01") {
- url = "http://localhost:8321/api/entry?param=jiangsu_qrcode_01101";
- } else if (mztczfSiReadCardType == "02") {
- url = "http://localhost:8321/readcard/entry?param=huashi_readcard";
- } else if (mztczfSiReadCardType == "04") {
- // url = "http://localhost:8321/readcard/entry?param=face_01101";
- url = "http://localhost:8321/readcard/entry?param=jiangsu_face_01101";
- }
- // 社保卡使用自动重试机制,其他读卡类型不使用重试
- if (mztczfSiReadCardType == "03") {
- // 社保卡:使用自动重试机制
- callReadCardWithRetry(url, 5, 500, function (res) {
- // 成功回调
- $("#readLoadingModal").modal('hide'); // 隐藏loading
- $("#readCardResult").val(res.rawCardData);
- $("#pBusiCardInfo").val(res.rawBusiData);
- successMesageSimaple("读卡成功,可以进行医保结算操作。");
- queryInsuinfo(readPatientId);
- $("#mztczfSiReadCardModal").modal("hide");
- }, function (err) {
- $("#readLoadingModal").modal('hide'); // 隐藏loading
- warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!");
- console.log(err);
- });
- } else {
- // 其他读卡类型:不使用重试,直接请求一次
- $.ajax({
- type: "GET",
- url: url,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- $("#readLoadingModal").modal('hide'); // 隐藏loading
- if (res.code == 200) {
- if (mztczfSiReadCardType == "01") {
- var data = JSON.parse(res.data);
- $("#readCardResult").val(JSON.stringify(data.data));
- } else {
- $("#readCardResult").val(res.data);
- }
- successMesageSimaple("读卡成功,可以进行医保结算操作。");
- $("#mztczfSiReadCardModal").modal("hide");
- } else {
- warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!");
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- $("#readLoadingModal").modal('hide'); // 隐藏loading
- warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!");
- console.log("读卡异常:", textStatus, errorThrown);
- }
- });
- }
- }
- // 自动重试的通用函数
- function callReadCardWithRetry(url, retryCount, retryDelay, successCallback, errorCallback) {
- $.ajax({
- type: "GET",
- url: url,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- },
- success: function (res) {
- if (res.code == 200) {
- successCallback(res);
- } else if (retryCount > 0) {
- // 重试时保持loading状态,不隐藏
- setTimeout(function () {
- callReadCardWithRetry(url, retryCount - 1, retryDelay, successCallback, errorCallback);
- }, retryDelay);
- } else {
- errorCallback(res);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- if (retryCount > 0) {
- // 重试时保持loading状态,不隐藏
- setTimeout(function () {
- callReadCardWithRetry(url, retryCount - 1, retryDelay, successCallback, errorCallback);
- }, retryDelay);
- } else {
- errorCallback({ message: "读卡异常" });
- }
- }
- });
- }
- /**
- * 打开读卡类型弹窗
- */
- function mztczfSiReadCardTypeModel(patientId,times) {
- addOrderLock(patientId,times,null)
- $("#readCardResult").val(null);
- $("#pBusiCardInfo").val(null);
- readPatientId = patientId
- readTimes = times
- // $('#mztczfSiReadCardType').selectpicker('val', null);
- // $('#mztczfSiReadCardType').selectpicker('refresh');
- // $('#grzhzf').selectpicker('val', null);
- // $('#grzhzf').selectpicker('refresh');
- // 重置单选框状态
- $('input[name="mztczfSiReadCardType"]').prop('checked', false);
- $("#mztczfSiReadCardType_03").prop('checked', true);
- $('input[name="grzhzf"]').prop('checked', false);
- $("#grzhzf_0").prop('checked', true);
-
- // 确保参保地已正确设置为江苏省宿迁市(如果还未设置)
- if($('#mztczfAdvmPro').val() !== '320000') {
- $('#mztczfAdvmPro').selectpicker('val', '320000');
- $('#mztczfAdvmPro').selectpicker('refresh');
- cityChange('mztczfAdvmPro', 'mztczfAdvmCity');
- }
-
- $("#mztczfSiReadCardModal").modal();
- }
- /**
- * 处方加锁
- */
- function addOrderLock(patientId,times,receiptNo) {
- postAjaxJsonHttpRequst("/thmz/addOrderLock",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
- })
- }
- /**
- * 处方解锁
- */
- function deleteOrderLock(patientId,times,receiptNo) {
- postAjaxJsonHttpRequst("/thmz/deleteOrderLock",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
- if(res.code == 0){
- successMesageSimaple('处方解锁成功')
- }
- })
- }
- function queryInsuinfo(patientId) {
- var param = {
- patientId: patientId,
- readCardType: $('input[name="mztczfSiReadCardType"]:checked').val(),
- readCardResult: $("#readCardResult").val(),
- busCardInfo: $("#pBusiCardInfo").val()
- }
- getAjaxRequst("/thmz/queryInsuinfo",param,true,function (insurRes) {
- if(insurRes.code == 0){
- var ybCode = localStorage.getItem("ybCode");
- if(ybCode !=null && ybCode !="" && ybCode.length > 0){
- $("#zgmztczf").selectpicker('val',1);
- $("#zgmztczf").selectpicker('refresh');
- if($("#mzOrderTypeSelect").val() !='4'){
- $("#mzOrderTypeSelect").selectpicker('val','2');
- $("#mzOrderTypeSelect").selectpicker('refresh');
- }else {
- $("#zgmztczf").selectpicker('val',0);
- $("#zgmztczf").selectpicker('refresh');
- }
- }else {
- $("#zgmztczf").selectpicker('val',0);
- $("#zgmztczf").selectpicker('refresh');
- }
- }else if(insurRes.code == -1){
- errorMesageSimaple(insurRes.message);
- }else if(insurRes.code == -2){
- warningMesageSimaple(insurRes.message);
- }
- })
- }
- /**
- * 医保结算
- * @param patientId
- * @param times
- */
- function directRegistration(patientId, times) {
- //显示弹层
- $("#loadingModal").modal('show');
- $.ajax({
- type: "POST",
- url: '/thmz/directRegistration',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- patientId: patientId,
- times: times,
- readCardResult: $("#readCardResult").val(),
- busCardInfo: $("#pBusiCardInfo").val(),
- // grzhzf: $("#grzhzf").val(),
- // readCardType: $("#mztczfSiReadCardType").val()
- grzhzf: $('input[name="grzhzf"]:checked').val(),
- readCardType: $('input[name="mztczfSiReadCardType"]:checked').val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- //隐藏
- $("#loadingModal").modal('hide');
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 门诊统筹补录
- * @param patientId
- * @param times
- * @param receiptNo
- */
- function mztcbl(patientId, times, receiptNo) {
- $.ajax({
- type: "GET",
- url: '/thmz/mztcblInfo?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo,
- contentType: "application/json;charset=UTF-8",
- 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) {
- $("#changedTotalAmount").val(res.data.totalAmount);
- $("#ybjzAmount").val(res.data.fund_pay_sumamt);
- $("#accAmount").val(res.data.acct_pay);
- $("#needRefundAmount").val(res.data.refundFee);
- $("#mzblPatientId").val(patientId);
- $("#mzblTimes").val(times);
- $("#mzblReceiptNo").val(receiptNo);
- //successMesage(res);
- } else {
- errorMesage(res);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- }
- });
- $("#mzblModal").modal();
- }
- /**
- * 提交门诊补录申请
- */
- function chargeFeeForMztcbl() {
- if (!confirm("确定要对当前费用进行门诊统筹补录操作吗?")) {
- return;
- }
- var patientId = $("#mzblPatientId").val();
- var times = $("#mzblTimes").val();
- var receiptNo = $("#mzblReceiptNo").val();
- var doctorName = $("#doctorNameHaveTally").val();
- var realMoney = $("#realMoney").val();
- var readCardType = $('input[name="mztczfSiReadCardType"]:checked').val();
- var readCardResult = $("#readCardResult").val();
- var busCardInfo = $("#pBusiCardInfo").val()
- $.ajax({
- type: "GET",
- url: '/thmz/chargeFeeForMztcbl?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo + "&readCardType=" + readCardType + "&readCardResult=" + readCardResult + "&busCardInfo=" + busCardInfo,
- contentType: "application/json;charset=UTF-8",
- 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) {
- $("#mzblModal").modal("hide");
- clearMztcbl();
- if(fpVsesionNo == 0){
- prn1Print(patientId, times, false, res.receiptNo);
- }else {
- printDzfp(patientId, times,res.receiptNo,0,realMoney,doctorName)
- }
- } else {
- errorMesage(res);
- }
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- }
- });
- }
- /**
- * 清空门诊统筹补录
- */
- function clearMztcbl() {
- $("#changedTotalAmount").val(null);
- $("#ybjzAmount").val(null);
- $("#accAmount").val(null);
- $("#needRefundAmount").val(null);
- $("#mzblPatientId").val(null);
- $("#mzblTimes").val(null);
- $("#mzblReceiptNo").val(null);
- }
- /**
- * 刷卡/扫码,正常收费的的接口
- */
- function consume() {
- $("#consume").attr("disabled", true);
- $("#saveConfirmFee").attr("disabled", true);
- var current = $("#payForm").find("div.pay-item").last();
- var patientId = $("#patientIdHaveTally").val();
- var times = $("#timesHaveTally").val();
- var chequeType = $(current).find("select").val();
- var amt = parseFloat($(current).find("input.money").val());
- $.ajax({
- type: "POST",
- url: '/thmz/consume',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": patientId,
- "times": times,
- "chequeType": chequeType,
- "amt": amt,
- "type": 0
- }),
- 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);
- $(current).find("input.refNo").val(res.data.refNo);
- $(current).find("input.transDate").val(res.data.transDate);
- $(current).find("input.payChannel").val(res.data.payChannel);
- $(current).find("input.qrCodeParam").val(res.data.wxAliPayOrderNo);
- $(current).find("input.traceNo").val(res.data.traceNo);
- } else {
- errorMesage(res);
- }
- $("#saveConfirmFee").attr("disabled", false);
- $("#consume").attr("disabled", false);
- }
- });
- }
- /**
- * 查看缴费方式列表
- * @param patientId
- * @param times
- * @param receiptNo
- */
- function depositFileList(patientId, times, receiptNo) {
- var payMarkGroup = getIndex("pay_mark_group");
- var payMark = 0;
- if (payMarkGroup == 2) {
- payMark = 1;
- }
- $("#depositFileListModal").modal();
- $('#deposit_fileList_table').bootstrapTable("destroy");
- $('#deposit_fileList_table').bootstrapTable({
- url: '/thmz/getMzDepositFileList', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: {"patientId": patientId, "times": times, "receiptNo": Math.abs(receiptNo), "payMark": payMark}, //传递参数(*)
- 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: [
- {
- field: 'patientId',
- title: '患者编号',
- align: "center",
- valign: 'middle',
- }, {
- field: 'times',
- title: '就诊次数',
- align: "center",
- valign: 'middle',
- }, {
- field: 'receiptNo',
- title: '结算次数',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value);
- }
- }, {
- field: 'chequeType',
- title: '支付方式',
- align: "center",
- valign: 'middle'
- }, {
- field: 'amount',
- title: '金额(元)',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return Math.abs(value).toFixed(2);
- }
- }, {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (payMarkGroup == 0) {
- return '';
- }
- var html = '';
- if (payMarkGroup > 0) {
- if ((row.chequeType == '银联卡' || row.chequeType == '聚合支付') && row.psordnum != null && row.psordnum != "" && row.psordnum != "null") {
- html += '<button type="button" class="registration-no-color-foot-button" title="智能支付参数与条形码" onclick="createBarcode(\'' + row.chequeType + '\',\'' + row.psordnum + '\',\'' + row.agtordnum + '\',\'' + row.parChannel + '\',\'' + row.traceNo + '\',\'' + row.patientId + '\',' + row.times + ',\'' + row.amountStr + '\',\'' + row.transDate + '\')"><i class="fa fa-barcode"></i></button>';
- }
- }
- return html;
- }
- }
- ],
- 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(ress);
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 创建退款条形码
- * @param chequeType
- * @param psordnum
- * @param agtordnum
- * @param parChannel
- * @param traceNo
- * @param patientId
- * @param times
- * @param amount
- * @param transDate
- */
- function createBarcode(chequeType, psordnum, agtordnum, parChannel, traceNo, patientId, times, amount, transDate) {
- var payMarkGroup = getIndex("pay_mark_group");
- $("#depositFileListModal").modal('hide');
- $("#parChannel").val('否');
- if (traceNo == null || traceNo == 'null') {
- traceNo = '';
- }
- $("#traceNo").val(traceNo);
- $("#transDate").val(transDate);
- amount = amount.replace("-", "");
- if (chequeType == "银联卡") {
- if (psordnum != null && psordnum != "" && psordnum != "null") {
- if (payMarkGroup == 1) {
- $("#plId").val(patientId + "_" + times + "_3");
- } else {
- $("#plId").val(psordnum + "_" + amount);
- }
- $("#refNo").val(psordnum);
- JsBarcode("#barcode", 'no barcode');
- $("#barcodeModal").modal();
- }
- return;
- }
- if (agtordnum != null && agtordnum != "" && agtordnum != "null") {
- if (payMarkGroup == 1) {
- $("#plId").val(patientId + "_" + times + "_O");
- //此时是未退费状态,不加载可退费的条形码,以免误操作退费
- JsBarcode("#barcode", 'no barcode');
- } else {
- JsBarcode("#barcode", agtordnum);
- $("#plId").val(psordnum + "_" + amount);
- }
- $("#refNo").val(psordnum);
- if (parChannel != null && parChannel == 'DIGITAL_CASH') {
- $("#parChannel").val('是');
- }
- $("#barcodeModal").modal();
- } else {
- $("#messageModal").modal();
- $("#messageContent").html("当前操作的缴费记录支付方式非聚合支付,无法生成对应的支付条形码!");
- return;
- }
- }
- //
- //
- // /**
- // * 签到
- // */
- // function sign() {
- // $.ajax({
- // type: "GET",
- // url: '/thmz/sign',
- // contentType: "application/json;charset=UTF-8",
- // 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);
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- //
- //
- // /**
- // * 查余
- // */
- // function balance() {
- // $.ajax({
- // type: "GET",
- // url: '/thmz/balance',
- // contentType: "application/json;charset=UTF-8",
- // 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);
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- // /**
- // * 打开刷卡消费页面
- // */
- // function consumeModal() {
- // $("#toolsModal").modal('hide');
- // $("#consumeModal").modal();
- // }
- //
- // /**
- // * 刷卡/扫码,财务工具调用
- // */
- // function consumeCommon() {
- // var chequeType = $("#consumeChequeType").val();
- // var amt = $("#consumeAmount").val();
- // $.ajax({
- // type: "POST",
- // url: '/thmz/consumeCommon',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({
- // "chequeType": chequeType,
- // "amt": amt
- // }),
- // 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);
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- // /**
- // * 打开退费窗口
- // */
- // function refundModal() {
- // $("#toolsModal").modal('hide');
- // $("#refundModal").modal();
- // }
- //
- // /**
- // * 退费
- // */
- // function refund() {
- // var chequeType = $("#consumeChequeTypeRefund").val();
- // var amt = $("#refundPosAmount").val();
- // var parChannel = $("#parChannelRefund").val();
- // var psordnum = $("#refNoRefund").val();
- // var transDate = $("#transDateRefund").val();
- // var agtordnum = $("#barcodeRefund").val();
- // $.ajax({
- // type: "POST",
- // url: '/thmz/refund',
- // contentType: "application/json;charset=UTF-8",
- // dataType: "json",
- // data: JSON.stringify({
- // "chequeType": chequeType,
- // "amt": amt,
- // "parChannel": parChannel,
- // "psordnum": psordnum,
- // "transDate": transDate,
- // "agtordnum": agtordnum
- // }),
- // 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);
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- // /**
- // * 打开重印窗口
- // */
- // function reprintModal() {
- // $("#toolsModal").modal('hide');
- // $("#reprintModal").modal();
- // }
- //
- //
- // /**
- // * 重印
- // */
- // function reprint() {
- // var traceNoReprint=$("#traceNoReprint").val();
- // $.ajax({
- // type: "GET",
- // url: '/thmz/reprint?traceNo='+traceNoReprint,
- // contentType: "application/json;charset=UTF-8",
- // 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);
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- // /**
- // * 打开交易查询页面
- // */
- // function queryModal() {
- // $("#toolsModal").modal('hide');
- // $("#queryModal").modal();
- // }
- //
- //
- // /**
- // * 交易查询
- // */
- // function query() {
- // var plId=$("#plIdReprint").val();
- // $.ajax({
- // type: "GET",
- // url: '/thmz/query?plId='+plId,
- // contentType: "application/json;charset=UTF-8",
- // 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) {
- // alert(res.data);
- // successMesage(res);
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- //
- // /**
- // * 结算
- // */
- // function settle() {
- // $.ajax({
- // type: "GET",
- // url: '/thmz/settle',
- // contentType: "application/json;charset=UTF-8",
- // 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);
- // } else {
- // errorMesage(res);
- // }
- // }
- // });
- // }
- //
- //
- //
- // /**
- // * 初始化财务工具的收费方式下拉选
- // */
- // function initConsumeChequeType() {
- // var html="<option value='3'>银联卡</option><option value='O'>聚合支付</option>";
- // $("#consumeChequeType").html(html);
- // $('#consumeChequeType').selectpicker('refresh');
- // $("#consumeChequeTypeRefund").html(html);
- // $('#consumeChequeTypeRefund').selectpicker('refresh');
- // $("#parChannelRefund").html("<option value='0'>否</option><option value='1'>是</option>");
- // $('#parChannelRefund').selectpicker('refresh');
- // }
- //
- //
- // /**
- // * 退货方式改变事件
- // */
- // function consumeChequeTypeRefundChange() {
- // var consumeChequeTypeRefund=$("#consumeChequeTypeRefund").val();
- // if(consumeChequeTypeRefund=='3'){
- // $("#barcodeRefundDiv").removeClass("in").addClass("hide");
- // $("#parChannelRefundDiv").removeClass("in").addClass("hide");
- // $("#refNoRefundDiv").removeClass("hide").addClass("in");
- // $("#transDateRefundDiv").removeClass("hide").addClass("in");
- // }else {
- // $("#barcodeRefundDiv").removeClass("hide").addClass("in");
- // $("#parChannelRefundDiv").removeClass("hide").addClass("in");
- // $("#refNoRefundDiv").removeClass("in").addClass("hide");
- // $("#transDateRefundDiv").removeClass("in").addClass("hide");
- // }
- // }
|