toll_administration.js 152 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062
  1. //@ sourceURL=toll_administration.js
  2. var LODOP; //声明为全局变量
  3. //默认打印机下标
  4. var printIndex = -1;
  5. //选中的要退的费用收费编码
  6. var chargeItemCodes = null;
  7. //门诊结算单地址
  8. var mzjsdHost = null;
  9. var readPatientId ='';
  10. var readTimes = null
  11. var fpVsesionNo = 0;
  12. var hospitalName ='沭阳铭和医院'
  13. $(function () {
  14. getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
  15. hospitalName = res.data
  16. })
  17. //默认光标在卡号输入框
  18. $("#cardNo").focus();
  19. init_daterangepicker();
  20. initFpVersion();
  21. initSelect();
  22. // initConsumeChequeType();
  23. initFeeTable();
  24. //卡号输入改变事件
  25. cardNoChange();
  26. //重置查询参数
  27. $('#btn_clean').click(function () {
  28. cleanParams();
  29. });
  30. //初始化页面上面的按钮事件
  31. //查询
  32. $('#btn_query').click(function () {
  33. initFeeTable();
  34. });
  35. // //财务工具包
  36. // $('#btn_tools').click(function () {
  37. // $("#toolsModal").modal();
  38. // });
  39. /**
  40. * 增加收款方式按钮事件
  41. */
  42. $("#addPayType").on("click", function () {
  43. addPayType(null);
  44. });
  45. //初始门诊收银方式下拉选
  46. initChequeType("payType");
  47. //初始门诊收银方式下拉选
  48. initChequeType("payTypeEditPayMode");
  49. setTimeout(function () {
  50. getLodop();
  51. }, 800);
  52. /**
  53. * 核酸检测跳转过来的直接刷新待收费列表
  54. */
  55. if (patientIdFullForNucleicAcid != null && patientIdFullForNucleicAcid != "") {
  56. $("#cardNo").val(patientIdFullForNucleicAcid);
  57. $("#patientId").val(patientIdFullForNucleicAcid);
  58. initFeeTable();
  59. }
  60. /**
  61. * 医保电子凭证读卡
  62. */
  63. $("#siReadCard").on("click", function (t) {
  64. // siReadCard("qrcode_01101");
  65. siReadCard("jiangsu_qrcode_01101");
  66. });
  67. /**
  68. * 医保刷脸
  69. */
  70. $("#siReadCardFace").on("click", function (t) {
  71. siReadCard("face_01101");
  72. });
  73. //获取门诊医保结算单打印服务地址
  74. $.ajax({
  75. type: "GET",
  76. url: '/thmz/getMzjsdHost',
  77. dataType: "json",
  78. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  79. success: function (res) {
  80. if (res == '401' || res == 401) {
  81. window.location.href = '/thmz/login/view'
  82. return;
  83. }
  84. mzjsdHost = res.data;
  85. }
  86. });
  87. /**
  88. * 刷卡/扫码
  89. */
  90. $("#consume").on("click", function (t) {
  91. consume();
  92. });
  93. });
  94. /**
  95. * 列表类型按钮切换事件
  96. * @param object
  97. */
  98. function payMarkButtonChange(object) {
  99. $("#pay_mark_group").find("button").each(function (index, element) {
  100. if ($(element).hasClass("btn-primary")) {
  101. $(element).removeClass("btn-primary").addClass("btn-default");
  102. }
  103. });
  104. $(object).removeClass("btn-default").addClass("btn-primary");
  105. initFeeTable();
  106. }
  107. /**
  108. * 收费明细类型按钮切换事件
  109. * @param object
  110. */
  111. function billItemButtonChange(object) {
  112. $("#bill_item_group").find("button").each(function (index, element) {
  113. if ($(element).hasClass("btn-primary")) {
  114. $(element).removeClass("btn-primary").addClass("btn-default");
  115. }
  116. });
  117. $(object).removeClass("btn-default").addClass("btn-primary");
  118. initChargeDetailTable();
  119. //默认光标在卡号输入框
  120. $("#cardNo").focus();
  121. }
  122. /**
  123. * 收费明细类型按钮切换事件
  124. * @param object
  125. */
  126. function refundBillItemButtonChange(object) {
  127. $("#refund_bill_item_group").find("button").each(function (index, element) {
  128. if ($(element).hasClass("btn-primary")) {
  129. $(element).removeClass("btn-primary").addClass("btn-default");
  130. }
  131. });
  132. $(object).removeClass("btn-default").addClass("btn-primary");
  133. initMzChargeDetailByBillItem(false);
  134. }
  135. //初始化版本电子发票版本
  136. function initFpVersion() {
  137. getAjaxRequst("/thmz/queryFpVersion",{},true,function (res) {
  138. console.log('发票版本=',res.data)
  139. fpVsesionNo = res.data;
  140. })
  141. }
  142. /**
  143. * 初始化下拉选
  144. */
  145. function initSelect() {
  146. $(".selectpicker").selectpicker({
  147. dropuAuto: false
  148. });
  149. initDeptSelect();
  150. initDoctorSelect();
  151. initCooperativeEnterprisesSelect();
  152. initMztczfSiReadCardTypeSelect();
  153. initTfGrzhzfSelect()
  154. }
  155. /**
  156. * 初始化读卡类型
  157. */
  158. function initMztczfSiReadCardTypeSelect() {
  159. $('#mztczfSiReadCardType').html("<option value='03'>社保卡</option><option value='01'>电子凭证</option><option value='02'>身份证</option><option value='04'>刷脸</option>");
  160. $('#mztczfSiReadCardType').selectpicker('refresh');
  161. var selectHtml = '<option value="0">否</option><option value="1">使用个账</option><option value="2">使用共济账户</option>';
  162. $('#grzhzf').html(selectHtml);
  163. $('#grzhzf').selectpicker('refresh');
  164. initAdvmPro('mztczfAdvmPro')
  165. }
  166. function initTfGrzhzfSelect() {
  167. var selectHtml = '<option value="0">否</option><option value="1">使用个账</option><option value="2">使用共济账户</option>';
  168. $('#tfGrzhzf').html(selectHtml);
  169. $('#tfGrzhzf').selectpicker('refresh');
  170. initAdvmPro('tfAdvmPro')
  171. }
  172. //初始化参保地省
  173. function initAdvmPro(proId) {
  174. getAjaxRequst("/thmz/queryProvinceCodes",{},true,function (res) {
  175. if(res.code == 0 && res.data !=null && res.data.length > 0){
  176. let selectHtml = '';
  177. for (let i=0 ; i <res.data.length; i++ ){
  178. selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
  179. }
  180. $('#'+proId).html(selectHtml);
  181. $('#'+proId).selectpicker('refresh');
  182. }
  183. })
  184. }
  185. //初始化参保地市
  186. function cityChange(proId,cityId) {
  187. let code = $('#'+proId).val()
  188. postAjaxJsonHttpRequst("/thmz/queryCityCodes",{code:code},true,function (res) {
  189. if(res.code == 0 && res.data !=null && res.data.length > 0){
  190. let selectHtml = '';
  191. for (let i=0 ; i <res.data.length; i++ ){
  192. selectHtml+= `<option value="${res.data[i].code}">${res.data[i].code} ${res.data[i].name}</option>`
  193. }
  194. $('#'+cityId).html(selectHtml);
  195. $('#'+cityId).selectpicker('refresh');
  196. }
  197. })
  198. }
  199. /**
  200. * 挂号列表中的科室列表
  201. */
  202. function initDeptSelect() {
  203. //科室列表
  204. $.ajax({
  205. type: "GET",
  206. url: '/thmz/allMzUnitCode',
  207. dataType: "json",
  208. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  209. success: function (data) {
  210. if (data == '401' || data == 401) {
  211. window.location.href = '/thmz/login/view'
  212. return;
  213. }
  214. var html = '';
  215. $.each(data.data, function (commentIndex, comment) {
  216. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  217. });
  218. $('#deptNoParam').empty();
  219. $('#deptNoParam').html(html);
  220. $('#deptNoParam').selectpicker('refresh');
  221. }
  222. });
  223. }
  224. /**
  225. * 挂号列表中的医生列表初始化
  226. */
  227. function initDoctorSelect() {
  228. //医生列表
  229. $.ajax({
  230. type: "GET",
  231. url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNoParam').val(),
  232. dataType: "json",
  233. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  234. success: function (res) {
  235. if (res == '401' || res == 401) {
  236. window.location.href = '/thmz/login/view'
  237. return;
  238. }
  239. var html = '';
  240. $.each(res.data, function (commentIndex, comment) {
  241. html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
  242. });
  243. $('#doctorParam').empty();
  244. $('#doctorParam').html(html);
  245. $('#doctorParam').selectpicker('destroy').selectpicker('refresh');
  246. }
  247. });
  248. }
  249. /**
  250. * 合作企业列表
  251. */
  252. function initCooperativeEnterprisesSelect() {
  253. $.ajax({
  254. type: "GET",
  255. url: '/thmz/getAllCooperativeEnterprises',
  256. dataType: "json",
  257. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  258. success: function (res) {
  259. if (res == '401' || res == 401) {
  260. window.location.href = '/thmz/login/view'
  261. return;
  262. }
  263. var html = '';
  264. $.each(res.data, function (commentIndex, comment) {
  265. html += '<option value="' + comment.id + '">' + comment.projectName + " " + comment.contractNo + '</option>';
  266. });
  267. $('#project').empty();
  268. $('#project').html(html);
  269. $('#project').selectpicker('destroy').selectpicker('refresh');
  270. $('#projectCharged').empty();
  271. $('#projectCharged').html(html);
  272. $('#projectCharged').selectpicker('destroy').selectpicker('refresh');
  273. }
  274. });
  275. }
  276. var $table_1;
  277. /**
  278. * 初始化收费表格
  279. */
  280. function initFeeTable() {
  281. var payMarkGroup = getIndex("pay_mark_group");
  282. var timeColumusName = "处方时间";
  283. var timeColumus = "priceTime";
  284. $("#refundFeeTip").removeClass("in").addClass("hide");
  285. $("#chargeFeeTip").removeClass("hide").addClass("in");
  286. if (payMarkGroup == 1) {
  287. timeColumusName = "缴费时间";
  288. timeColumus = "chargeDate";
  289. $("#refundFeeTip").removeClass("hide").addClass("in");
  290. $("#chargeFeeTip").removeClass("in").addClass("hide");
  291. } else if (payMarkGroup == 2) {
  292. timeColumusName = "退费时间";
  293. timeColumus = "inputDate";
  294. }
  295. var patientId = $("#patientId").val();
  296. //查询记账信息
  297. if (payMarkGroup == 0 && patientId != null && patientId != '') {
  298. $("#patientIdHaveTally").val(patientId);
  299. $.ajax({
  300. type: "GET",
  301. url: '/thmz/getTallyTotalCharge?patientId=' + patientId,
  302. contentType: "application/json;charset=UTF-8",
  303. dataType: "json",
  304. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  305. success: function (res) {
  306. if (res == '401' || res == 401) {
  307. window.location.href = '/thmz/login/view'
  308. return;
  309. }
  310. if (res.code == 0) {
  311. if (res.data != null && res.data > 0) {
  312. $("#haveTallyModal").modal();
  313. $("#totalTallyAmount").text(res.data.toFixed(2));
  314. } else {
  315. $("#haveTallyModal").modal('hide');
  316. }
  317. } else {
  318. new PNotify({
  319. title: '错误提示',
  320. text: res.message,
  321. type: 'error',
  322. hide: true,
  323. styling: 'bootstrap3'
  324. });
  325. }
  326. }
  327. });
  328. }
  329. $('#tb_table').bootstrapTable("destroy");
  330. $table_1 = $('#tb_table').bootstrapTable({
  331. url: '/thmz/listMzChargeDetail', //请求后台的URL(*)
  332. method: 'post', //请求方式(*)
  333. toolbar: '#toolbar', //工具按钮用哪个容器
  334. striped: true, //是否显示行间隔色
  335. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  336. pagination: true, //是否显示分页(*)
  337. sortable: true, //是否启用排序
  338. sortOrder: "asc", //排序方式
  339. queryParams: queryParams, //传递参数(*)
  340. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  341. pageNumber: 1, //初始化加载第一页,默认第一页
  342. pageSize: 5, //每页的记录行数(*)
  343. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  344. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  345. strictSearch: true,
  346. showColumns: false, //是否显示所有的列
  347. showRefresh: false, //是否显示刷新按钮
  348. minimumCountColumns: 2, //最少允许的列数
  349. clickToSelect: true, //是否启用点击选中行
  350. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  351. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  352. cardView: false, //是否显示详细视图
  353. detailView: false,
  354. //rowStyle:rowStyle,//通过自定义函数设置行样式
  355. ajaxOptions: {
  356. headers: {
  357. 'Accept': 'application/json',
  358. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  359. }
  360. },
  361. columns: [
  362. // {
  363. // checkbox: true
  364. // },
  365. {
  366. field: 'realNo',
  367. title: '缴费流水号',
  368. align: "center",
  369. valign: 'middle',
  370. formatter: function (value, row, index) {
  371. return Math.abs(value);
  372. }
  373. }, {
  374. field: 'patientId',
  375. title: '患者编号',
  376. align: "center",
  377. valign: 'middle',
  378. }, {
  379. field: 'name',
  380. title: '患者姓名',
  381. align: "center",
  382. valign: 'middle',
  383. },
  384. {
  385. field: 'times',
  386. title: '就诊次数',
  387. align: "center",
  388. valign: 'middle',
  389. }, {
  390. field: 'visitTypeName',
  391. title: '患者身份',
  392. align: "center",
  393. valign: 'middle',
  394. },
  395. {
  396. field: 'orderTypeName',
  397. title: '处方类型',
  398. align: "center",
  399. valign: 'middle',
  400. },
  401. {
  402. field: 'receiptNo',
  403. title: '结算次数',
  404. align: "center",
  405. valign: 'middle',
  406. formatter: function (value, row, index) {
  407. return Math.abs(value);
  408. }
  409. }, {
  410. field: 'notDiscountAmount',
  411. title: '订单金额(元)',
  412. align: "center",
  413. valign: 'middle',
  414. formatter: function (value, row, index) {
  415. return Math.abs(value).toFixed(2);
  416. }
  417. }, {
  418. field: 'discountAmount',
  419. title: '优惠总额(元)',
  420. align: "center",
  421. valign: 'middle',
  422. formatter: function (value, row, index) {
  423. return Math.abs(value).toFixed(2);
  424. }
  425. }, {
  426. field: 'amount',
  427. title: '应付金额(元)',
  428. align: "center",
  429. valign: 'middle',
  430. formatter: function (value, row, index) {
  431. return Math.abs(value).toFixed(2);
  432. }
  433. }, {
  434. field: 'warnDept',
  435. title: '科室',
  436. align: "center",
  437. valign: 'middle',
  438. }, {
  439. field: 'doctorCode',
  440. title: '医生',
  441. align: "center",
  442. valign: 'middle',
  443. }, {
  444. field: timeColumus,
  445. title: timeColumusName,
  446. align: "center",
  447. valign: 'middle',
  448. formatter: function (value, row, index) {
  449. if (value == null || value == "") {
  450. return "";
  451. }
  452. return format(value, "yyyy-MM-dd HH:mm:ss");
  453. }
  454. }, {
  455. title: '操作',
  456. align: "center",
  457. valign: 'middle',
  458. // sortable: true,
  459. formatter: function (value, row, index) {
  460. var buttonCodes = localStorage.getItem("buttonCodes");
  461. 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>';
  462. 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>';
  463. var payMarkGroup = getIndex("pay_mark_group");
  464. if (payMarkGroup == 0) {
  465. if(row.countYbZf !=null && row.countYbZf > 0 ){
  466. 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>';
  467. 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>';
  468. }
  469. str += '<button type="button" class="registration-no-color-foot-button"title="确认收费" onclick="tipHaveTally(' + row.amount + ',\'' + row.patientId + '\',' + row.times + ',\'' + row.name + '\',' + row.receiptNo + ')"><i class="fa fa-rmb"></i></button>';
  470. if (buttonCodes != null) {
  471. if (isInArrayStr("init_clinic_for_exception", buttonCodes)) {
  472. 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>';
  473. }
  474. }
  475. if(row.orderLockFlag != null && row.orderLockFlag == 1){
  476. 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>';
  477. }
  478. return str;
  479. }
  480. if (payMarkGroup == 1) {
  481. // 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>' ;
  482. if(isInArrayStr("mz_refund", buttonCodes)){
  483. 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>';
  484. }
  485. if (row.printFlag == 0 && fpVsesionNo == 0) {
  486. 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>';
  487. } else if (row.printFlag == 1 && fpVsesionNo == 0) {
  488. 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>';
  489. 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>';
  490. }
  491. if(fpVsesionNo == 1){
  492. str += '<button type="button" class="registration-no-color-foot-button" title="上传电子发票" onclick="printDzfp(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo +',1'+ ');" style="color: #35D082;"><i class="fa fa-upload"></i></button>';
  493. str += '<button type="button" class="registration-no-color-foot-button"title="下载电子发票" onclick="openDzfpDownModal(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ',1'+')"><i class="fa fa-download"></i></button>';
  494. }
  495. 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>';
  496. //是否有权限设置合同编号
  497. if (buttonCodes != null) {
  498. if (isInArrayStr("contract_match", buttonCodes)) {
  499. str += '<button type="button" class="registration-no-color-foot-button" title="合作项目维护" onclick="matchProject(\'' + row.realNo + '\');"><i class="fa fa-plug"></i></button>';
  500. }
  501. }
  502. if (row.countYbZf > 0) {
  503. 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>';
  504. }
  505. if (row.mztcbl > 0) {
  506. 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>';
  507. }
  508. if (buttonCodes != null) {
  509. if (isInArrayStr("init_clinic_for_exception", buttonCodes)) {
  510. 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>';
  511. }
  512. }
  513. return str;
  514. }
  515. if (payMarkGroup == 2) {
  516. 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>';
  517. if(fpVsesionNo == 1){
  518. 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>';
  519. str += '<button type="button" class="registration-no-color-foot-button"title="下载已作废的电子发票" onclick="openDzfpDownModal(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo +',2'+ ')" style="color: red;"><i class="fa fa-download"></i></button>';
  520. }
  521. // 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>' ;
  522. return str;
  523. }
  524. }
  525. }
  526. ],
  527. responseHandler: function (res) {
  528. if (res == '401' || res == 401) {
  529. window.location.href = '/thmz/login/view'
  530. return;
  531. }
  532. var ress = eval(res);
  533. if (ress.code == -1) {
  534. if (ress.message != null && ress.message != '') {
  535. new PNotify({
  536. title: '错误提示',
  537. text: ress.message,
  538. type: 'error',
  539. hide: true,
  540. styling: 'bootstrap3'
  541. });
  542. }
  543. return {
  544. "total": 0,//总页数
  545. "rows": {} //数据
  546. };
  547. }
  548. // if(ress.pageViewVo.total==0){
  549. // $("#cardNo").val(null);
  550. // $("#name").val(null);
  551. // }
  552. return {
  553. "total": ress.pageViewVo.total,//总页数
  554. "rows": ress.pageViewVo.data //数据
  555. };
  556. },
  557. /**
  558. * @param {点击列的 field 名称} field
  559. * @param {点击列的 value 值} value
  560. * @param {点击列的整行数据} row
  561. * @param {td 元素} $element
  562. */
  563. onClickCell: function (field, value, row, $element) {
  564. var cardNo = $("#cardNo").val();
  565. if (cardNo == '120' && field == 'name' && (payMarkGroup == 0 || payMarkGroup == 1)) {
  566. $element.attr('contenteditable', true);
  567. $element.html(null);
  568. $element.focus();
  569. $element.blur(function () {
  570. var index = $element.parent().data('index');
  571. var tdValue = $element.html();
  572. saveData(index, field, tdValue, row, $table_1);
  573. })
  574. }
  575. },
  576. });
  577. }
  578. /**
  579. * 更新病人缴费记录病人姓名
  580. * @param index
  581. * @param field
  582. * @param value
  583. * @param row
  584. */
  585. function saveData(index, field, value, row, table) {
  586. $.ajax({
  587. type: "POST",
  588. url: '/thmz/changePatientIdName',
  589. contentType: "application/json;charset=UTF-8",
  590. dataType: "json",
  591. data: JSON.stringify({"patientId": row.patientId, "times": row.times, "name": value}),
  592. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  593. async: false,
  594. success: function (res) {
  595. if (res == '401' || res == 401) {
  596. window.location.href = '/thmz/login/view'
  597. return;
  598. }
  599. if (res.code == 0) {
  600. table.bootstrapTable('updateCell', {
  601. index: index, //行索引
  602. field: field, //列名
  603. value: value //cell值
  604. })
  605. } else {
  606. table.bootstrapTable('updateCell', {
  607. index: index, //行索引
  608. field: field, //列名
  609. value: row.name //cell值
  610. })
  611. errorMesage(res);
  612. }
  613. }
  614. });
  615. }
  616. /**
  617. * 构建列表查询参数
  618. * @param params
  619. * @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}}
  620. */
  621. function queryParams(params) {
  622. var rePortRangeArr = getRePortRangeArr();
  623. var payMarkGroup = getIndex("pay_mark_group");
  624. var temp = {
  625. mzChargeDetail: {
  626. patientId: $("#patientId").val(),
  627. warnDept: $("#deptNoParam").val(),
  628. doctorCode: $("#doctorParam").val(),
  629. name: $("#name").val(),
  630. payMark: 5
  631. },
  632. beginTime: new Date(rePortRangeArr[0]),
  633. endTime: new Date(rePortRangeArr[1]),
  634. pageSize: params.limit, //页面大小
  635. pageIndex: params.offset / params.limit, //页码
  636. serialNo: $("#serialNo").val(),
  637. ownData: $('#ownData').is(':checked') ? 0 : 1,
  638. };
  639. if (payMarkGroup == 1) {
  640. temp.mzChargeDetail.payMark = 0;
  641. } else if (payMarkGroup == 2) {
  642. temp.mzChargeDetail.payMark = 1;
  643. }
  644. return temp;
  645. };
  646. function initChargeDetailTable() {
  647. initChargeDetailTablePublic('/thmz/getMzChargeDetailByBillItem', $('#charge_detail_table'), queryParamsForDetail);
  648. }
  649. function initMzChargeDetailByBillItem(flag) {
  650. if (flag) {
  651. $("#refund_bill_item_group").removeClass("hide").addClass("in");
  652. if ($("#plusOrMinus").hasClass("fa-plus")) {
  653. $("#plusOrMinus").removeClass("fa-plus").addClass("fa-minus");
  654. initChargeDetailTablePublic('/thmz/getNewListForRefundFeeByBillItem', $('#refund_fee_bill_table'), queryParamsForRefundByBillItem);
  655. } else if ($("#plusOrMinus").hasClass("fa-minus")) {
  656. $("#plusOrMinus").removeClass("fa-minus").addClass("fa-plus");
  657. $("#refund_bill_item_group").removeClass("in").addClass("hide");
  658. $('#refund_fee_bill_table').bootstrapTable("destroy");
  659. }
  660. } else {
  661. initChargeDetailTablePublic('/thmz/getNewListForRefundFeeByBillItem', $('#refund_fee_bill_table'), queryParamsForRefundByBillItem);
  662. }
  663. }
  664. //撤销医保重新 申请医保电子凭证
  665. function reqYb() {
  666. let tfReadType = $("#tfReadType").val();
  667. if(!stringNotBlank($("#tfGrzhzf").val())){
  668. errorMesageSimaple('请选择是否使用个账或共济账户支付')
  669. return
  670. }
  671. if(!stringNotBlank(tfReadType)){
  672. errorMesageSimaple('请选择读卡类型')
  673. return
  674. }
  675. if(tfReadType == '02'){
  676. sfzReadCard()
  677. }else {
  678. let param = {
  679. patientId :$("#patientIdRefund").val(),
  680. times :$("#timesRefund").val()
  681. }
  682. postAjaxJsonHttpRequst("/thmz/retractYbFees",param,true,function (res) {
  683. if (res == '401' || res == 401) {
  684. window.location.href = '/thmz/login/view'
  685. return;
  686. }
  687. if(res.code == 0){
  688. successMesageSimaple('医保费用撤销成功!')
  689. reSiReadCard(false,tfReadType);
  690. }else {
  691. errorMesage(res)
  692. }
  693. })
  694. }
  695. }
  696. function sfzReadCard() {
  697. let tfAdvmCity = $("#tfAdvmCity").val()
  698. if(!stringNotBlank(tfAdvmCity)){
  699. errorMesageSimaple("请选择参保地")
  700. return
  701. }
  702. $.ajax({
  703. type: "GET",
  704. // url: 'http://localhost:8321/readcard/entry?param=idcard_01101',
  705. url: 'http://localhost:8321/readcard/entry?param=huashi_readcard',
  706. contentType: "application/json;charset=UTF-8",
  707. dataType: "json",
  708. async: true,
  709. headers: {
  710. 'Accept': 'application/json',
  711. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  712. },
  713. success: function (res) {
  714. if (res == '401' || res == 401) {
  715. window.location.href = '/thmz/login/view'
  716. return;
  717. }
  718. if (res.code == 200) {
  719. $("#cdReadCardResult").val(res.data);
  720. var str = res.data.split("^");
  721. var str1= str.filter(item=>item !='');
  722. let IDNumber = str1[0];
  723. postAjaxJsonHttpRequst("/thmz/queryNewInsuinfo",{
  724. patientId :$("#patientIdRefund").val(),
  725. times :$("#timesRefund").val(),
  726. admdvs:tfAdvmCity,
  727. socialNo:IDNumber
  728. },true,function (res) {
  729. if (res == '401' || res == 401) {
  730. window.location.href = '/thmz/login/view'
  731. return;
  732. }
  733. if(res.code == 0){
  734. let param = {
  735. patientId :$("#patientIdRefund").val(),
  736. times :$("#timesRefund").val()
  737. }
  738. postAjaxJsonHttpRequst("/thmz/retractYbFees",param,true,function (res) {
  739. if (res == '401' || res == 401) {
  740. window.location.href = '/thmz/login/view'
  741. return;
  742. }
  743. if(res.code == 0){
  744. successMesageSimaple("撤销医保费用成功")
  745. }else {
  746. errorMesage(res)
  747. }
  748. })
  749. }else {
  750. errorMesage(res)
  751. }
  752. })
  753. } else {
  754. errorMesage(res);
  755. }
  756. },
  757. error: function (XMLHttpRequest, textStatus, errorThrown) {
  758. errorMesageSimaple("读卡错误")
  759. }
  760. });
  761. }
  762. function reSiReadCard(asyncFlag,tfReadType) {
  763. let params ='';
  764. let url = '';
  765. if(tfReadType == '03'){
  766. // 江苏医保读取社保卡使用专用地址
  767. url = 'http://localhost:8321/readcard/jiangsu/readcard_auto';
  768. }else if(tfReadType == '01'){
  769. // params ='qrcode_01101';
  770. params ='jiangsu_qrcode_01101';
  771. // url = 'http://localhost:8321/readcard/entry?param=' + params;
  772. url = 'http://localhost:8321/api/entry?param=' + params;
  773. }else if(tfReadType =='02'){
  774. // params ='idcard_01101'
  775. params ='huashi_readcard';
  776. url = 'http://localhost:8321/readcard/entry?param=' + params;
  777. }
  778. $.ajax({
  779. type: "GET",
  780. url: url,
  781. contentType: "application/json;charset=UTF-8",
  782. dataType: "json",
  783. async: asyncFlag,
  784. headers: {
  785. 'Accept': 'application/json',
  786. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  787. },
  788. success: function (res) {
  789. if (res == '401' || res == 401) {
  790. window.location.href = '/thmz/login/view'
  791. return;
  792. }
  793. if (res.code == 200) {
  794. successMesageSimaple('读卡成功')
  795. if(tfReadType == '01'){
  796. var data = JSON.parse(res.data);
  797. $("#cdReadCardResult").val(JSON.stringify(data.data));
  798. }else {
  799. $("#cdReadCardResult").val(res.data);
  800. }
  801. } else {
  802. errorMesage(res);
  803. }
  804. },
  805. error: function (XMLHttpRequest, textStatus, errorThrown) {
  806. errorMesageSimaple("读卡错误")
  807. }
  808. });
  809. }
  810. /**
  811. * 初始化收费明细表格
  812. */
  813. function initChargeDetailTablePublic(url, obj, params) {
  814. $(obj).bootstrapTable("destroy");
  815. $(obj).bootstrapTable({
  816. url: url, //请求后台的URL(*)
  817. method: 'post', //请求方式(*)
  818. toolbar: '#toolbar', //工具按钮用哪个容器
  819. striped: true, //是否显示行间隔色
  820. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  821. pagination: true, //是否显示分页(*)
  822. sortable: true, //是否启用排序
  823. sortOrder: "asc", //排序方式
  824. // sortName: 'orderNo', //排序字段
  825. queryParams: params, //传递参数(*)
  826. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  827. pageNumber: 1, //初始化加载第一页,默认第一页
  828. pageSize: 5, //每页的记录行数(*)
  829. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  830. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  831. strictSearch: true,
  832. showColumns: false, //是否显示所有的列
  833. showRefresh: false, //是否显示刷新按钮
  834. minimumCountColumns: 2, //最少允许的列数
  835. clickToSelect: true, //是否启用点击选中行
  836. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  837. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  838. cardView: false, //是否显示详细视图
  839. detailView: false,
  840. //rowStyle:rowStyle,//通过自定义函数设置行样式
  841. ajaxOptions: {
  842. headers: {
  843. 'Accept': 'application/json',
  844. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  845. }
  846. },
  847. columns: [
  848. // {
  849. // checkbox: true
  850. // },
  851. {
  852. field: 'orderNo',
  853. title: '处方号',
  854. align: "center",
  855. valign: 'middle',
  856. formatter: function (value, row, index) {
  857. return Math.abs(value);
  858. }
  859. }, {
  860. field: 'chargeItemCode',
  861. title: '编码',
  862. align: "center",
  863. valign: 'middle',
  864. }, {
  865. field: 'tcName',
  866. title: '项目',
  867. align: "center",
  868. valign: 'middle',
  869. },
  870. // {
  871. // field: 'times',
  872. // title: '规格',
  873. // align: "center",
  874. // valign: 'middle',
  875. // },
  876. {
  877. field: 'quantity',
  878. title: '数量',
  879. align: "center",
  880. valign: 'middle'
  881. }, {
  882. field: 'drugWin',
  883. title: '副数',
  884. align: "center",
  885. valign: 'middle',
  886. }, {
  887. field: 'origPrice',
  888. title: '原单价(元)',
  889. align: "center",
  890. valign: 'middle',
  891. formatter: function (value, row, index) {
  892. if (value != undefined && value != null) {
  893. return value.toFixed(2);
  894. }
  895. }
  896. }, {
  897. field: 'unitPrice',
  898. title: '折后单价(元)',
  899. align: "center",
  900. valign: 'middle',
  901. formatter: function (value, row, index) {
  902. return value.toFixed(2);
  903. }
  904. }, {
  905. field: 'amount',
  906. title: '总金额(元)',
  907. align: "center",
  908. valign: 'middle',
  909. formatter: function (value, row, index) {
  910. return value.toFixed(2);
  911. }
  912. }
  913. ],
  914. responseHandler: function (res) {
  915. if (res == '401' || res == 401) {
  916. window.location.href = '/thmz/login/view'
  917. return;
  918. }
  919. var ress = eval(res);
  920. if (ress.code == -1) {
  921. new PNotify({
  922. title: '错误提示',
  923. text: ress.message,
  924. type: 'error',
  925. hide: true,
  926. styling: 'bootstrap3'
  927. });
  928. return {
  929. "total": 0,//总页数
  930. "rows": {} //数据
  931. };
  932. }
  933. return {
  934. //"total": ress.pageViewVo.total,//总页数
  935. "rows": ress.data //数据
  936. };
  937. },
  938. });
  939. }
  940. /**
  941. * 构建列表查询参数
  942. * @param params
  943. * @returns {{patientId: string | number | string[] | undefined | jQuery, times: string | number | string[] | undefined | jQuery, billItemCode: number}}
  944. */
  945. function queryParamsForDetail(params) {
  946. var billItemGroup = getIndex("bill_item_group");
  947. var payMarkGroup = getIndex("pay_mark_group");
  948. var temp = {
  949. patientId: $("#patientIdChargeItem").val(),
  950. times: $("#timesChargeItem").val(),
  951. receiptNo: $("#receiptNoChargeItem").val(),
  952. billItemCode: billItemGroup,
  953. payMark: 5
  954. };
  955. if (payMarkGroup == 1) {
  956. temp.payMark = 0;
  957. } else if (payMarkGroup == 2) {
  958. temp.payMark = 1;
  959. }
  960. return temp;
  961. };
  962. /**
  963. * 构建列表查询参数
  964. * @param params
  965. * @returns {{patientId: string | number | string[] | undefined | jQuery, times: string | number | string[] | undefined | jQuery, billItemCode: number}}
  966. */
  967. function queryParamsForRefundByBillItem(params) {
  968. var billItemGroup = getIndex("refund_bill_item_group");
  969. return {
  970. patientId: $("#patientIdRefund").val(),
  971. times: $("#timesRefund").val(),
  972. receiptNo: $("#receiptNoRefund").val(),
  973. chargeItemCodes: chargeItemCodes,
  974. billItemCode: billItemGroup
  975. };
  976. };
  977. /**
  978. * 卡号输入改变事件
  979. */
  980. function cardNoChange() {
  981. if (window.ActiveXObject || "ActiveXObject" in window) {
  982. $("#cardNo").on('input propertychange', function () {
  983. queryUserInfoByCardNo();
  984. });
  985. } else {
  986. $("#cardNo").on('input οninput', function () {
  987. queryUserInfoByCardNo();
  988. });
  989. }
  990. }
  991. /**
  992. * 卡号有变化后查询病人信息
  993. */
  994. function queryUserInfoByCardNo() {
  995. var cardNo = $("#cardNo").val();
  996. var index = cardNo.indexOf("-");
  997. if (index > 0 && index == cardNo.length - 2) {
  998. $("#patientId").val(cardNo);
  999. initFeeTable();
  1000. } else if (cardNo == '120' || cardNo.length == 8) {
  1001. $("#cardNo").attr("title", cardNo);
  1002. $.ajax({
  1003. type: "GET",
  1004. url: '/thmz/getByIcCardNo?icCardNo=' + cardNo,
  1005. contentType: "application/json;charset=UTF-8",
  1006. dataType: "json",
  1007. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1008. success: function (res) {
  1009. if (res == '401' || res == 401) {
  1010. window.location.href = '/thmz/login/view'
  1011. return;
  1012. }
  1013. if (res.code == 0) {
  1014. if (res.data != null) {
  1015. $("#patientId").val(res.data.patientId);
  1016. initFeeTable();
  1017. }
  1018. } else {
  1019. new PNotify({
  1020. title: '错误提示',
  1021. text: res.message,
  1022. type: 'error',
  1023. hide: true,
  1024. styling: 'bootstrap3'
  1025. });
  1026. }
  1027. }
  1028. });
  1029. } else if (cardNo == null || cardNo == "") {
  1030. cleanParams();
  1031. }
  1032. }
  1033. /**
  1034. * 获取按钮组选择的下标
  1035. * @param id
  1036. * @returns {number}
  1037. */
  1038. function getIndex(id) {
  1039. var index = 0;
  1040. var item = $("#" + id).find("button");
  1041. for (var i = 0; i <= item.length; i++) {
  1042. if ($(item[i]).hasClass("btn-primary")) {
  1043. index = i;
  1044. break;
  1045. }
  1046. }
  1047. return index;
  1048. }
  1049. /**
  1050. * 获取时间选择器的时间数组
  1051. * @returns {string[]}
  1052. */
  1053. function getRePortRangeArr() {
  1054. var rePortRange = $('#reportrange span').html();
  1055. var rePortRangeArr = rePortRange.split(" - ");
  1056. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  1057. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  1058. return rePortRangeArr;
  1059. }
  1060. /**
  1061. * 打开收费窗口
  1062. */
  1063. function confirmFeeModal(times, totalCharge, receiptNo) {
  1064. var buttonCodes = localStorage.getItem("buttonCodes");
  1065. if (buttonCodes != null) {
  1066. if (isInArrayStr("contract_match", buttonCodes)) {
  1067. $("#projectDiv").removeClass("hide").addClass("in");
  1068. } else {
  1069. $("#projectDiv").removeClass("in").addClass("hide");
  1070. }
  1071. } else {
  1072. $("#projectDiv").removeClass("in").addClass("hide");
  1073. }
  1074. var payTypeList = $("#payType").children();
  1075. if (payTypeList.length == 1) {
  1076. $('#payType').selectpicker('val', 'Y');
  1077. } else {
  1078. $('#payType').selectpicker('val', 1);
  1079. }
  1080. $('#payType').selectpicker('refresh');
  1081. var data = parseFloat($("#dataIdHaveTally").val());
  1082. if (totalCharge != null && totalCharge > 0) {
  1083. data = totalCharge;
  1084. $("#timesHaveTally").val(times);
  1085. $("#receiptNoHaveTally").val(receiptNo);
  1086. }
  1087. var prevAll = $("#changeAmountParent").prevAll();
  1088. while (prevAll.length > 1) {
  1089. $("#changeAmountParent").prev().remove();
  1090. prevAll = $("#changeAmountParent").prevAll();
  1091. }
  1092. // $("#realMoney").val($("#amountMoneyConfirm").text());
  1093. // $("#cash").val($("#amountMoneyConfirm").text());
  1094. $("#tallyDetailModal").modal('hide');
  1095. $("#haveTallyModal").modal('hide');
  1096. $("#confirmFeeModal").modal();
  1097. $("#amountMoneyConfirm").text(data);
  1098. //医保报销金额
  1099. var fundPay = $("#fundPay").val();
  1100. //个人账户支付金额
  1101. var acctPay = $("#acctPay").val();
  1102. //医保卡类型
  1103. var cardType = $("#cardType").val();
  1104. var payTypeIndex = 0;
  1105. if (fundPay > 0) {
  1106. var payTypeId = "payType_" + payTypeIndex++;
  1107. addPayType(payTypeId);
  1108. $('#' + payTypeId).selectpicker('val', 2);
  1109. $('#' + payTypeId).selectpicker('refresh');
  1110. $('#' + payTypeId).parent().parent().next().children(':first').val(fundPay);
  1111. $('#' + payTypeId).parent().parent().next().next().children(':first').remove();
  1112. $('#' + payTypeId).attr("disabled", true);
  1113. $('#' + payTypeId).parent().parent().next().children(':first').attr("readonly", "readonly");
  1114. //payTypeIndex++;
  1115. }
  1116. if (acctPay > 0) {
  1117. var payTypeId = "payType_" + payTypeIndex++;
  1118. addPayType(payTypeId);
  1119. // var ybkType = 'T';
  1120. // if (cardType != null && (cardType == 2 || cardType == "2")) {
  1121. // ybkType = 'P';
  1122. // }
  1123. $('#' + payTypeId).selectpicker('val', cardType);
  1124. $('#' + payTypeId).selectpicker('refresh');
  1125. $('#' + payTypeId).parent().parent().next().children(':first').val(acctPay);
  1126. $('#' + payTypeId).parent().parent().next().next().children(':first').remove();
  1127. $('#' + payTypeId).attr("disabled", true);
  1128. $('#' + payTypeId).parent().parent().next().children(':first').attr("readonly", "readonly");
  1129. }
  1130. $("#payTypeIndex").val(payTypeIndex);
  1131. //总金额减医保报销
  1132. var realMoney = Minus(data, fundPay);
  1133. //减完医保报销后减个人医保卡支付金额
  1134. realMoney = Minus(realMoney, acctPay);
  1135. $("#realMoney").val(data);
  1136. if (realMoney > 0) {
  1137. addPayType("payType");
  1138. $("#cash").val(realMoney);
  1139. }
  1140. // $("#cash").val(null);
  1141. setTimeout(function () {
  1142. //默认光标在现金输入框
  1143. $("#cash").focus();
  1144. }, 800);
  1145. if (payTypeList.length == 1) {
  1146. $('#payType').selectpicker('val', 'Y');
  1147. } else {
  1148. $('#payType').selectpicker('val', 'O');
  1149. }
  1150. $("#changeAmount").val(0.0);
  1151. $("#surplusAmount").val(0.0);
  1152. $("input.refNo").val(null);
  1153. $("input.transDate").val(null);
  1154. $("input.payChannel").val(null);
  1155. $("input.qrCodeParam").val(null);
  1156. $("input.traceNo").val(null);
  1157. sendPriceMessage(realMoney, 0.0, 0.0, $("#patientIdHaveTally").val());
  1158. }
  1159. /**
  1160. * 打开收费明细窗口
  1161. * @param data
  1162. */
  1163. function chargeDetailModal(patientId, times, receiptNo) {
  1164. $("#patientIdChargeItem").val(patientId);
  1165. $("#timesChargeItem").val(times);
  1166. $("#receiptNoChargeItem").val(receiptNo);
  1167. $("#chargeDetailModal").modal();
  1168. initChargeDetailTable();
  1169. }
  1170. /**
  1171. * 病人当前就诊次数的诊断查询
  1172. * @param data
  1173. */
  1174. function diagnoseQuery(patientId, times) {
  1175. $.ajax({
  1176. type: "POST",
  1177. url: '/thmz/getVisitTableByPatientIdAndTimes',
  1178. contentType: "application/json;charset=UTF-8",
  1179. dataType: "json",
  1180. data: JSON.stringify({"patientId": patientId, "times": times}),
  1181. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1182. async: false,
  1183. success: function (res) {
  1184. if (res == '401' || res == 401) {
  1185. window.location.href = '/thmz/login/view'
  1186. return;
  1187. }
  1188. if (res.code == 0) {
  1189. if (res.data.icdText != null || res.data.icdText != '') {
  1190. $("#diagnoseModal").modal();
  1191. $("#diagnose").html(res.data.icdText);
  1192. } else {
  1193. new PNotify({
  1194. title: '操作提示',
  1195. text: '当前病人诊断未知',
  1196. type: 'warn',
  1197. styling: 'bootstrap3'
  1198. });
  1199. }
  1200. } else {
  1201. errorMesage(res);
  1202. }
  1203. }
  1204. });
  1205. }
  1206. // /**
  1207. // * 打开退费重收明细窗口
  1208. // * @param data
  1209. // */
  1210. // function chargeRefundDetailModal(patientId, times) {
  1211. // // $("#patientIdChargeItem").val(patientId);
  1212. // // $("#timesChargeItem").val(times);
  1213. // initMzChargeDetailByBillItem();
  1214. // }
  1215. /**
  1216. * 初始门诊收银方式下拉选
  1217. */
  1218. function initChequeType(payType) {
  1219. $.ajax({
  1220. type: "GET",
  1221. url: '/thmz/getAllZdChequeTypeForMz',
  1222. dataType: "json",
  1223. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1224. async: false,
  1225. success: function (res) {
  1226. if (res == '401' || res == 401) {
  1227. window.location.href = '/thmz/login/view'
  1228. return;
  1229. }
  1230. var html = '';
  1231. $.each(res.data, function (commentIndex, comment) {
  1232. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  1233. });
  1234. $('#' + payType).empty();
  1235. $('#' + payType).html(html);
  1236. $('#' + payType).selectpicker('refresh');
  1237. if (res.data.length == 1) {
  1238. $('#' + payType).selectpicker('val', 'Y');
  1239. } else {
  1240. $('#' + payType).selectpicker('val', 'O');
  1241. }
  1242. $('#' + payType).selectpicker('refresh');
  1243. }
  1244. });
  1245. }
  1246. /**
  1247. * 关闭当前这个付款方式
  1248. */
  1249. function closeThisParent(obj) {
  1250. $(obj).parent().parent().parent().remove();
  1251. checkFee(false);
  1252. }
  1253. /**
  1254. * 校验收款金额
  1255. * @param flag 是否是提交时候的校验,是的话,如果缴费金额不够,需要返回 false
  1256. */
  1257. function checkFee(flag) {
  1258. var realMoney = parseFloat($("#realMoney").val());
  1259. realMoney = toDecimal(realMoney);
  1260. $("#realMoney").val(realMoney);
  1261. var arr = $("#payForm").find("div.pay-item");
  1262. if (arr.length > 0) {
  1263. // //是否存在未使用的收款方式
  1264. // var hadNotFill=false;
  1265. //非现金收款总金额
  1266. var notCashAmount = 0;
  1267. //现金收款总额
  1268. var cashAmount = 0;
  1269. for (var i = 0; i < arr.length; i++) {
  1270. var temp = parseFloat($(arr[i]).find("input.money").val());
  1271. if (isNaN(temp)) {
  1272. temp = 0;
  1273. // hadNotFill=true;
  1274. }
  1275. if ($(arr[i]).find("select").val() != 1) {
  1276. notCashAmount = Add(notCashAmount, temp);
  1277. } else {
  1278. cashAmount = Add(cashAmount, temp);
  1279. }
  1280. for (var j = 0; j < arr.length; j++) {
  1281. if ($(arr[i]).find("select").val() == $(arr[j]).find("select").val() && i != j) {
  1282. new PNotify({
  1283. title: '错误提示',
  1284. text: "已经存在相同的收款方式,请不要重复添加!",
  1285. type: 'error',
  1286. hide: true,
  1287. styling: 'bootstrap3'
  1288. });
  1289. return;
  1290. }
  1291. }
  1292. }
  1293. var totalAmount = Add(cashAmount, notCashAmount);
  1294. $("#surplusAmount").val(0.0);
  1295. if (totalAmount < realMoney) {
  1296. if (flag) {
  1297. new PNotify({
  1298. title: '错误提示',
  1299. text: "收款金额不能少于实收金额,请调整收款金额或者增加收款方式!",
  1300. type: 'error',
  1301. hide: true,
  1302. styling: 'bootstrap3'
  1303. });
  1304. return false;
  1305. }
  1306. if (totalAmount == 0) {
  1307. $("#addPayType").parent().removeClass("in").addClass("hide");
  1308. } else {
  1309. $("#addPayType").parent().removeClass("hide").addClass("in");
  1310. }
  1311. // if(!hadNotFill){
  1312. // addPayType(null);
  1313. // }
  1314. $("#changeAmount").val(0.00);
  1315. var surplusAmount = Minus(realMoney, totalAmount);
  1316. $("#surplusAmount").val(surplusAmount);
  1317. return;
  1318. }
  1319. var changeAmount = 0.00;
  1320. if (totalAmount >= realMoney) {
  1321. changeAmount = Minus(totalAmount, realMoney);
  1322. //changeAmount = changeAmount.toFixed(2);
  1323. $("#changeAmount").val(changeAmount);
  1324. $("#addPayType").parent().removeClass("in").addClass("hide");
  1325. if (!flag) {
  1326. sendPriceMessage(realMoney, totalAmount, changeAmount, $("#patientIdHaveTally").val());
  1327. }
  1328. }
  1329. //设置收费首页找零与应收和实收金额
  1330. $("#payableAmount").text(realMoney);
  1331. $("#paidAmount").text(totalAmount);
  1332. $("#changedAmount").text(changeAmount);
  1333. }
  1334. //计算和设置折扣比例
  1335. var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text());
  1336. var discount = 100;
  1337. if (realMoney < amountMoneyConfirm) {
  1338. discount = Division(realMoney, Multiply(amountMoneyConfirm, 100));
  1339. }
  1340. $("#discount").text(toDecimal(discount));
  1341. return true;
  1342. }
  1343. /**
  1344. * 异常接诊数据修复
  1345. * @param patientId
  1346. * @param times
  1347. * @param payMark
  1348. * @param receiptNo
  1349. */
  1350. function initClinicForException(patientId, times, payMark, receiptNo) {
  1351. $.ajax({
  1352. type: "GET",
  1353. url: '/thmz/initClinicForException?patientId=' + patientId + '&times=' + times+ '&receiptNo=' + receiptNo + "&payMark=" + payMark,
  1354. contentType: "application/json;charset=UTF-8",
  1355. dataType: "json",
  1356. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1357. success: function (res) {
  1358. if (res == '401' || res == 401) {
  1359. window.location.href = '/thmz/login/view'
  1360. return;
  1361. }
  1362. if (res.code == 0) {
  1363. successMesage(res);
  1364. } else {
  1365. errorMesage(res);
  1366. }
  1367. }
  1368. });
  1369. }
  1370. /**
  1371. * 提示有记账记录
  1372. */
  1373. function tipHaveTally(data, patientId, times, name, receiptNo) {
  1374. addOrderLock(patientId,times,null)
  1375. closeConfirmFeeModal();
  1376. if (patientId == null || patientId == "") {
  1377. return;
  1378. }
  1379. $("#patientIdHaveTally").val(patientId);
  1380. $("#nameHaveTally").val(name);
  1381. $("#dataIdHaveTally").val(data);
  1382. $("#timesHaveTally").val(times);
  1383. $("#receiptNoHaveTally").val(receiptNo);
  1384. saveFeeGzzf()
  1385. // postAjaxJsonHttpRequst("/thmz/queryCountYbZf",{"patientId": patientId, "times": times},true,function (rs) {
  1386. // if (rs == '401' || rs == 401) {
  1387. // window.location.href = '/thmz/login/view'
  1388. // return;
  1389. // }
  1390. // if(rs.code == 0){
  1391. // if(rs.data > 0){
  1392. //
  1393. // }
  1394. // }else {
  1395. // errorMesage(rs);
  1396. // }
  1397. //
  1398. // })
  1399. }
  1400. //收费时保存个账支付选择
  1401. function saveFeeGzzf() {
  1402. $.ajax({
  1403. type: "POST",
  1404. url: '/thmz/getTmFee',
  1405. contentType: "application/json;charset=UTF-8",
  1406. dataType: "json",
  1407. data: JSON.stringify({"patientId": $("#patientIdHaveTally").val(), "times": $("#timesHaveTally").val(), "receiptNo": $("#receiptNoHaveTally").val()}),
  1408. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1409. async: false,
  1410. success: function (res) {
  1411. if (res == '401' || res == 401) {
  1412. window.location.href = '/thmz/login/view'
  1413. return;
  1414. }
  1415. if (res.code == 0) {
  1416. if (res.data != undefined && res.data != null) {
  1417. $("#fundPay").val(res.data.fundPay);
  1418. $("#acctPay").val(res.data.acctPay);
  1419. $("#cardType").val(res.data.ybkType);
  1420. //$("#realMoney").val(res.data.selfPay);
  1421. } else {
  1422. $("#fundPay").val(0.0);
  1423. $("#acctPay").val(0.0);
  1424. $("#cardType").val(null);
  1425. }
  1426. } else {
  1427. errorMesage(res);
  1428. }
  1429. $("#saveConfirmFee").attr("disabled", false);
  1430. }
  1431. });
  1432. confirmFeeModal(null, null, null);
  1433. }
  1434. var $tally_detail_table;
  1435. /**
  1436. * 初始化本院记账明细表格
  1437. */
  1438. function initTallyDetailTable() {
  1439. $("#haveTallyModal").modal('hide');
  1440. var patientId = $("#patientIdHaveTally").val();
  1441. // var name = $("#nameHaveTally").val();
  1442. if (patientId == null || patientId == '') {
  1443. return;
  1444. }
  1445. $("#tallyDetailModal").modal();
  1446. $('#tally_detail_table').bootstrapTable("destroy");
  1447. $tally_detail_table = $('#tally_detail_table').bootstrapTable({
  1448. url: '/thmz/getTallyReceiptSerial?patientId=' + patientId, //请求后台的URL(*)
  1449. method: 'get', //请求方式(*)
  1450. toolbar: '#toolbar', //工具按钮用哪个容器
  1451. striped: true, //是否显示行间隔色
  1452. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1453. pagination: false, //是否显示分页(*)
  1454. sortable: true, //是否启用排序
  1455. sortOrder: "asc", //排序方式
  1456. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  1457. pageNumber: 1, //初始化加载第一页,默认第一页
  1458. pageSize: 10, //每页的记录行数(*)
  1459. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  1460. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1461. strictSearch: true,
  1462. showColumns: false, //是否显示所有的列
  1463. showRefresh: false, //是否显示刷新按钮
  1464. minimumCountColumns: 2, //最少允许的列数
  1465. clickToSelect: true, //是否启用点击选中行
  1466. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1467. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1468. cardView: false, //是否显示详细视图
  1469. detailView: false,
  1470. //rowStyle:rowStyle,//通过自定义函数设置行样式
  1471. ajaxOptions: {
  1472. headers: {
  1473. 'Accept': 'application/json',
  1474. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1475. }
  1476. },
  1477. columns: [
  1478. // {
  1479. // checkbox: true,
  1480. // },
  1481. {
  1482. field: 'patientId',
  1483. title: '病人编号',
  1484. align: "center",
  1485. valign: 'middle'
  1486. }, {
  1487. field: 'name',
  1488. title: '病人姓名',
  1489. align: "center",
  1490. valign: 'middle',
  1491. // formatter: function (value, row, index) {
  1492. // return name;
  1493. // }
  1494. }, {
  1495. field: 'times',
  1496. title: '就诊次数',
  1497. align: "center",
  1498. valign: 'middle',
  1499. },
  1500. {
  1501. field: 'totalCharge',
  1502. title: '总费用(元)',
  1503. align: "center",
  1504. valign: 'middle',
  1505. formatter: function (value, row, index) {
  1506. return value.toFixed(2);
  1507. }
  1508. },
  1509. {
  1510. field: 'chargeDate',
  1511. title: '记账时间',
  1512. align: "center",
  1513. valign: 'middle',
  1514. formatter: function (value, row, index) {
  1515. return format(value, "yyyy-MM-dd HH:mm:ss");
  1516. }
  1517. }
  1518. // , {
  1519. // title: '操作',
  1520. // align: "center",
  1521. // valign: 'middle',
  1522. // // sortable: true,
  1523. // formatter: function (value, row, index) {
  1524. // 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>';
  1525. // return str;
  1526. // }
  1527. // }
  1528. ],
  1529. /**
  1530. * @param {点击列的 field 名称} field
  1531. * @param {点击列的 value 值} value
  1532. * @param {点击列的整行数据} row
  1533. * @param {td 元素} $element
  1534. */
  1535. onClickCell: function (field, value, row, $element) {
  1536. var cardNo = $("#cardNo").val();
  1537. if (cardNo == '120' && field == 'name') {
  1538. $element.attr('contenteditable', true);
  1539. $element.html(null);
  1540. $element.focus();
  1541. $element.blur(function () {
  1542. var index = $element.parent().data('index');
  1543. var tdValue = $element.html();
  1544. saveData(index, field, tdValue, row, $tally_detail_table);
  1545. })
  1546. }
  1547. },
  1548. onDblClickRow: function (row) {
  1549. confirmFeeModal(row.times, row.totalCharge, row.receiptNo);
  1550. },
  1551. responseHandler: function (res) {
  1552. if (res == '401' || res == 401) {
  1553. window.location.href = '/thmz/login/view'
  1554. return;
  1555. }
  1556. var ress = eval(res);
  1557. if (ress.code == -1) {
  1558. errorMesage(ress);
  1559. return {
  1560. "total": 0,//总页数
  1561. "rows": {} //数据
  1562. };
  1563. }
  1564. if (ress.data == null || ress.data.length == 0) {
  1565. $("#tallyDetailModal").modal("hide");
  1566. }
  1567. return {
  1568. "rows": ress.data //数据
  1569. };
  1570. },
  1571. });
  1572. }
  1573. /**
  1574. * 提交缴费申请
  1575. */
  1576. function saveConfirmFee() {
  1577. $("#saveConfirmFee").attr("disabled", true);
  1578. if (!checkFee(true)) {
  1579. $("#saveConfirmFee").attr("disabled", false);
  1580. return;
  1581. }
  1582. var project = $("#project").val();
  1583. let dyTgId = $("#dyTgId").val();
  1584. var jsonData = JSON.parse('{"patientId":"","times":"","receiptNo":"","mzDepositFiles":[]}');
  1585. var patientId = $("#patientIdHaveTally").val();
  1586. var times = $("#timesHaveTally").val();
  1587. var receiptNo = $("#receiptNoHaveTally").val();
  1588. jsonData.patientId = patientId;
  1589. jsonData.times = times;
  1590. jsonData.receiptNo = receiptNo;
  1591. var arr = $("#payForm").find("div.pay-item");
  1592. if (arr.length > 0) {
  1593. for (var i = 0; i < arr.length; i++) {
  1594. var temp = parseFloat($(arr[i]).find("input.money").val());
  1595. if (temp == null || temp == 0) {
  1596. continue;
  1597. }
  1598. var tempJson = JSON.parse('{"chequeType":"","amount":"","contractId":"","psordnum":"","agtordnum":"","parChannel":"","transDate":"","traceNo":"","dyTgNo":""}');
  1599. tempJson.chequeType = $(arr[i]).find("select").val();
  1600. tempJson.psordnum = $(arr[i]).find("input.refNo").val();
  1601. tempJson.agtordnum = $(arr[i]).find("input.qrCodeParam").val();
  1602. tempJson.parChannel = $(arr[i]).find("input.payChannel").val();
  1603. tempJson.transDate = $(arr[i]).find("input.transDate").val();
  1604. tempJson.traceNo = $(arr[i]).find("input.traceNo").val();
  1605. //现金有可能会多收,比入实收37,对方给了100,需要找零63. 所以必须减去找零金额,才是实收金额
  1606. if (tempJson.chequeType == "1") {
  1607. temp = temp - $("#changeAmount").val();
  1608. temp = temp.toFixed(2);
  1609. }
  1610. if (project != null && project != "null" && project != "") {
  1611. tempJson.contractId = project;
  1612. }
  1613. if(stringNotBlank(dyTgId)){
  1614. tempJson.dyTgNo = dyTgId;
  1615. }
  1616. tempJson.amount = temp;
  1617. jsonData.mzDepositFiles[jsonData.mzDepositFiles.length] = tempJson;
  1618. }
  1619. }
  1620. $.ajax({
  1621. type: "POST",
  1622. url: '/thmz/chargeFee',
  1623. contentType: "application/json;charset=UTF-8",
  1624. dataType: "json",
  1625. data: JSON.stringify(jsonData),
  1626. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1627. success: function (res) {
  1628. if (res == '401' || res == 401) {
  1629. window.location.href = '/thmz/login/view'
  1630. return;
  1631. }
  1632. if (res.code == 0) {
  1633. if(fpVsesionNo == 0){
  1634. prn1Print(patientId, times, true, res.receiptNo);
  1635. }else {
  1636. printDzfp(patientId, times,res.receiptNo,0)
  1637. }
  1638. successMesage(res);
  1639. closeConfirmFeeModal();
  1640. //缴费成功后清空全局参数
  1641. patientIdFullForNucleicAcid = null;
  1642. initFeeTable();
  1643. //默认光标在卡号输入框
  1644. $("#cardNo").focus();
  1645. // toEvaluation(patientId);
  1646. toNewEvaluation(patientId,times);
  1647. } else {
  1648. errorMesage(res);
  1649. }
  1650. $("#saveConfirmFee").attr("disabled", false);
  1651. }
  1652. });
  1653. }
  1654. /**
  1655. * 关闭收费确认模态弹框
  1656. */
  1657. function closeConfirmFeeModal() {
  1658. $("#confirmFeeModal").modal("hide");
  1659. $("#patientId").val(null);
  1660. $("#cardNo").val(null);
  1661. $("#name").val(null);
  1662. $("#fundPay").val(0);
  1663. $("#acctPay").val(0);
  1664. $("#cardType").val(null);
  1665. }
  1666. /**
  1667. * 保存合作项目
  1668. */
  1669. function saveProject() {
  1670. var projectRealNo = $("#projectRealNo").val();
  1671. var projectCharged = $("#projectCharged").val();
  1672. $.ajax({
  1673. type: "GET",
  1674. url: '/thmz/setMzDepositFileSetContractId?contractId=' + projectCharged + '&serialNo=' + projectRealNo,
  1675. contentType: "application/json;charset=UTF-8",
  1676. dataType: "json",
  1677. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1678. success: function (res) {
  1679. if (res == '401' || res == 401) {
  1680. window.location.href = '/thmz/login/view'
  1681. return;
  1682. }
  1683. if (res.code == 0) {
  1684. successMesage(res);
  1685. $("#projectRealNo").val(null);
  1686. $('#projectCharged').selectpicker('val', null);
  1687. $('#projectCharged').selectpicker('refresh');
  1688. $("#projectModal").modal("hide");
  1689. } else {
  1690. errorMesage(res);
  1691. }
  1692. $("#saveConfirmFee").attr("disabled", false);
  1693. }
  1694. });
  1695. }
  1696. //上传电子发票
  1697. function printDzfp(patientId,times,receiptNo,loadingFlag) {
  1698. if(loadingFlag == 1){
  1699. $("#dzfpLoadingModal").modal('show');
  1700. }
  1701. postAjaxJsonHttpRequst("/thmz/getNewAllSerialForThisTime",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
  1702. if(res.code == 0){
  1703. uploadMzInvoice(patientId,times,receiptNo,1)
  1704. }else {
  1705. $("#dzfpLoadingModal").modal('hide');
  1706. errorMesage(res)
  1707. }
  1708. })
  1709. }
  1710. /**
  1711. *
  1712. * @param patientId
  1713. * @param times
  1714. * @param receiptNo
  1715. * @param typeFlag 1 上传门诊蓝字发票 2上传红字发票 (作废)
  1716. */
  1717. function uploadMzInvoice(patientId,times,receiptNo,typeFlag) {
  1718. postAjaxJsonHttpRequst("/thmz/uploadMzInvoice",{patientId:patientId,times:times,receiptNo:receiptNo,ghFlag:false,typeFlag:typeFlag},true,function (rs) {
  1719. if(typeFlag == 1){
  1720. $("#dzfpLoadingModal").modal('hide');
  1721. }
  1722. if(rs.code ==0){
  1723. successMesageSimaple("电子发票上传成功!")
  1724. if(typeFlag == 1){
  1725. initFeeTable();
  1726. }
  1727. }else {
  1728. errorMesage(rs);
  1729. }
  1730. })
  1731. }
  1732. var dzfp_patientId ;
  1733. var dzfp_times ;
  1734. var dzfp_receiptNo;
  1735. var dzfp_typeFlag;
  1736. //打开电子发票弹窗
  1737. function openDzfpDownModal(patientId,times,receiptNo,typeFlag) {
  1738. dzfp_patientId = patientId;
  1739. dzfp_times = times;
  1740. dzfp_receiptNo = receiptNo;
  1741. dzfp_typeFlag = typeFlag;
  1742. $("#dzfpDownModal").modal();
  1743. }
  1744. /**
  1745. * @param type 1 打印二维码 2 下载pdf
  1746. */
  1747. function downOrPrintDzfp(type) {
  1748. downloadDzfp(dzfp_patientId,dzfp_times,dzfp_receiptNo,dzfp_typeFlag,type)
  1749. }
  1750. //下载电子发票
  1751. function downloadDzfp(patientId,times,receiptNo,typeFlag,type) {
  1752. setPrint();
  1753. postAjaxJsonHttpRequst("/thmz/queryInvoiceFile",{patientId:patientId,times:times,typeFlag:typeFlag,receiptNo:receiptNo},true,function (res) {
  1754. if(res.code == 0){
  1755. $("#dzfpDownModal").modal("hide");
  1756. if(type == 2 || !stringNotBlank(type)){
  1757. base64toPDF(res.data.pdfFileStr)
  1758. }else {
  1759. //打印二维码
  1760. let height = "70mm"
  1761. let bkimgWidth = "110mm"
  1762. LODOP = getLodop();
  1763. LODOP.PRINT_INITA(6, 0, bkimgWidth, height, hospitalName+"门诊电子发票二维码打印");
  1764. //设置默认打印机
  1765. LODOP.SET_PRINTER_INDEX(printIndex);
  1766. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", bkimgWidth);
  1767. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", height);
  1768. LODOP.SET_PRINT_PAGESIZE(1,bkimgWidth, height, "CreateCustomPage");
  1769. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊电子发票二维码");//对新建的纸张重命名
  1770. LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
  1771. LODOP.ADD_PRINT_TEXT("6mm", "3mm", "60mm", "3mm", hospitalName+"发票二维码");
  1772. LODOP.ADD_PRINT_IMAGE("10mm", "3mm", "50mm", "50mm", "data:image/png;base64,"+res.data.qrcode);
  1773. LODOP.PRINT();
  1774. // LODOP.PREVIEW();
  1775. }
  1776. }else {
  1777. errorMesage(res)
  1778. }
  1779. })
  1780. }
  1781. /**
  1782. * 直接打印发票
  1783. * @param patientId
  1784. * @param times
  1785. * @param chargeFeeFlag 收费 退费标记 true 收费和重打发票来源 false 退费来源
  1786. */
  1787. function prn1PrintHand(patientId, times, chargeFeeFlag, receiptNo, realNo) {
  1788. $("#button_" + realNo).css("display", "none");
  1789. prn1Print(patientId, times, chargeFeeFlag, receiptNo);
  1790. }
  1791. /**
  1792. * 直接打印发票
  1793. * @param patientId
  1794. * @param times
  1795. * @param chargeFeeFlag 收费 退费标记 true 收费和重打发票来源 false 退费来源
  1796. */
  1797. function prn1Print(patientId, times, chargeFeeFlag, receiptNo) {
  1798. var url = '/thmz/getAllSerialForThisTime?patientId=' + patientId + "&times=" + times + "&receiptNo=" + receiptNo;
  1799. printCommon(url, patientId, times, chargeFeeFlag);
  1800. }
  1801. /**
  1802. * 重打发票
  1803. * @param patientId
  1804. * @param times
  1805. */
  1806. function repPrint(patientId, times, receiptNo) {
  1807. $.ajax({
  1808. type: "GET",
  1809. url: '/thmz/getReceiptForThisTime?patientId=' + patientId + "&times=" + times + "&receiptNo=" + receiptNo,
  1810. contentType: "application/json;charset=UTF-8",
  1811. dataType: "json",
  1812. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1813. success: function (res) {
  1814. if (res == '401' || res == 401) {
  1815. window.location.href = '/thmz/login/view'
  1816. return;
  1817. }
  1818. if (res.code == 0) {
  1819. if (res.data.length == 1) {
  1820. var message = "确定要重新打印发票号码为【" + res.data[0].receiptBill + "】的发票吗?请确认发票打印机即将要打印的发票编号";
  1821. var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "&times=" + times + "&obsolete=0&receiptBill=" + res.data[0].receiptBill;
  1822. confirmMessage(patientId, times, message, url);
  1823. } else {
  1824. $("#tip_message").text("请选择需要重新打印的发票号");
  1825. $("#repPrintModal").modal();
  1826. $("#repPrintTable").html(null);
  1827. for (var i = 0; i < res.data.length; i++) {
  1828. $("<tr><td>" + res.data[i].receiptBill + "</td></tr>").appendTo("#repPrintTable").bind('click', function () {
  1829. $("#repPrintModal").modal("hide");
  1830. var message = "确定要重新打印发票号码为【" + $(this).text() + "】的发票吗?请确认发票打印机即将要打印的发票编号";
  1831. var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "&times=" + times + "&obsolete=0&receiptBill=" + $(this).text();
  1832. confirmMessage(patientId, times, message, url);
  1833. });
  1834. }
  1835. }
  1836. }
  1837. }
  1838. });
  1839. }
  1840. /**
  1841. * 发票重打提示
  1842. * @param patientId
  1843. * @param times
  1844. * @param name
  1845. */
  1846. function confirmMessage(patientId, times, message, url) {
  1847. if (!confirm(message)) {
  1848. return;
  1849. }
  1850. //var url='/thmz/repPrintForThisTime?patientId=' + patientId + "&times=" + times + "&obsolete=0" + "&receiptBill="+receiptBill;
  1851. printCommon(url, patientId, times, true);
  1852. }
  1853. /**
  1854. * 作废重打发票
  1855. * @param patientId
  1856. * @param times
  1857. */
  1858. function obsoleteAndRepPrint(patientId, times, receiptNo) {
  1859. $.ajax({
  1860. type: "GET",
  1861. url: '/thmz/getReceiptForThisTime?patientId=' + patientId + "&times=" + times + "&receiptNo=" + receiptNo,
  1862. contentType: "application/json;charset=UTF-8",
  1863. dataType: "json",
  1864. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1865. success: function (res) {
  1866. if (res == '401' || res == 401) {
  1867. window.location.href = '/thmz/login/view'
  1868. return;
  1869. }
  1870. if (res.code == 0) {
  1871. if (res.data.length == 1) {
  1872. var message = "确定要作废发票号码为【" + res.data[0].receiptBill + "】的发票吗?请确认需要作废发票编号";
  1873. var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "&times=" + times + "&obsolete=1&receiptBill=" + res.data[0].receiptBill;
  1874. confirmMessage(patientId, times, message, url);
  1875. } else {
  1876. $("#tip_message").text("请选择需要作废的发票号");
  1877. $("#repPrintModal").modal();
  1878. $("#repPrintTable").html(null);
  1879. for (var i = 0; i < res.data.length; i++) {
  1880. $("<tr><td>" + res.data[i].receiptBill + "</td></tr>").appendTo("#repPrintTable").bind('click', function () {
  1881. $("#repPrintModal").modal("hide");
  1882. var message = "确定要作废发票号码为【" + $(this).text() + "】的发票吗?请确认需要作废发票编号";
  1883. var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "&times=" + times + "&obsolete=1&receiptBill=" + $(this).text();
  1884. confirmMessage(patientId, times, message, url);
  1885. });
  1886. }
  1887. }
  1888. }
  1889. }
  1890. });
  1891. }
  1892. /**
  1893. * 打印医保结算单
  1894. * @param patientId
  1895. * @param times
  1896. * @param receiptNo
  1897. */
  1898. function printYbjsd(patientId, times, receiptNo) {
  1899. if (mzjsdHost == null) {
  1900. errorMesageSimaple("医保结算单域名为空,操作失败!");
  1901. return;
  1902. }
  1903. const iframeEle = document.getElementById('ybjsdDiv');
  1904. const loadingEle = document.getElementById('loading');
  1905. //设置ififrame透明
  1906. iframeEle.style.opacity = 0;
  1907. loadingEle.style.display = 'block';
  1908. var url = mzjsdHost + "/siSettleDetailList/" + patientId + "/" + times;
  1909. $("#ybjsdDiv").attr("src", url);
  1910. iframeEle.addEventListener('load', function () {
  1911. // Hide the loading indicator
  1912. loadingEle.style.display = 'none';
  1913. // Bring the iframe back
  1914. iframeEle.style.opacity = 1;
  1915. });
  1916. $("#ybjsdModal").modal();
  1917. }
  1918. /**
  1919. * 匹配合作项目
  1920. * @param realNo
  1921. */
  1922. function matchProject(realNo) {
  1923. $("#projectRealNo").val(realNo);
  1924. $("#projectModal").modal();
  1925. $.ajax({
  1926. type: "GET",
  1927. url: '/thmz/getMzDepositFileContractId?serialNo=' + realNo,
  1928. contentType: "application/json;charset=UTF-8",
  1929. dataType: "json",
  1930. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1931. success: function (res) {
  1932. if (res == '401' || res == 401) {
  1933. window.location.href = '/thmz/login/view'
  1934. return;
  1935. }
  1936. if (res.code == 0) {
  1937. $('#projectCharged').selectpicker('val', res.data);
  1938. $('#projectCharged').selectpicker('refresh');
  1939. }
  1940. }
  1941. });
  1942. }
  1943. /**
  1944. * 打印发票通用方法
  1945. * @param patientId
  1946. * @param times
  1947. * @param chargeFeeFlag 收费 退费标记 true 收费和重打发票来源 false 退费来源
  1948. */
  1949. function printCommon(url, patientId, times, chargeFeeFlag) {
  1950. setPrint();
  1951. var height = "93.15mm";
  1952. // if (countReceiot % 2 == 0) {
  1953. // height = "93.2mm";
  1954. // }
  1955. $.ajax({
  1956. type: "GET",
  1957. url: url,
  1958. contentType: "application/json;charset=UTF-8",
  1959. dataType: "json",
  1960. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1961. async: false,
  1962. success: function (res) {
  1963. if (res == '401' || res == 401) {
  1964. window.location.href = '/thmz/login/view'
  1965. return;
  1966. }
  1967. if (res.code == 0) {
  1968. if (res.data == null || res.data.length == 0) {
  1969. return;
  1970. }
  1971. // countReceiot++;
  1972. for (var i = 0; i < res.data.length; i++) {
  1973. LODOP = getLodop();
  1974. var temp = res.data[i].mzReceiptSerial;
  1975. LODOP.PRINT_INITA(6, 0, "120mm", height, "铭和门诊发票打印");
  1976. //设置默认打印机
  1977. LODOP.SET_PRINTER_INDEX(printIndex);
  1978. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "120mm");
  1979. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", height);
  1980. LODOP.SET_PRINT_PAGESIZE(1, "120mm", height, "CreateCustomPage");
  1981. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
  1982. LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
  1983. LODOP.ADD_PRINT_TEXT("6mm", "0mm", "55mm", "3mm", hospitalName);
  1984. LODOP.ADD_PRINT_TEXT("6mm", "59mm", "30mm", "3mm", "机制号:");
  1985. LODOP.ADD_PRINT_TEXT("6mm", "72mm", "20mm", "3mm", temp.serialNo);
  1986. LODOP.ADD_PRINT_TEXT("19mm", "0mm", "35mm", "3mm", temp.receiptBill);
  1987. LODOP.ADD_PRINT_TEXT("25mm", "7mm", "40mm", "3mm", res.mzPatientMi.name);
  1988. LODOP.ADD_PRINT_TEXT("25mm", "61mm", "27mm", "3mm", patientId);
  1989. var feeList = res.data[i].feeList;
  1990. if (feeList != null && feeList.length > 0) {
  1991. var top = 32;
  1992. var left = 6;
  1993. for (var j = 0; j < feeList.length; j++) {
  1994. var row = parseInt(j / 3);
  1995. var tempTop = top + row * 5;
  1996. var tempLeft = left;
  1997. if (j % 3 == 1) {
  1998. tempLeft = left + 30;
  1999. } else if (j % 3 == 2) {
  2000. tempLeft = left + 60;
  2001. }
  2002. LODOP.ADD_PRINT_TEXT(tempTop + "mm", tempLeft + "mm", "30mm", "3mm", feeList[j]);
  2003. }
  2004. }
  2005. // LODOP.ADD_PRINT_TEXT("32mm","25mm","25mm","3mm","诊查费 10.00");
  2006. // LODOP.ADD_PRINT_TEXT("32mm","50mm","25mm","3mm","中成药费30.10");
  2007. // LODOP.ADD_PRINT_TEXT("37mm","25mm","25mm","3mm","治疗费 22.00");
  2008. // LODOP.ADD_PRINT_TEXT("37mm","50mm","25mm","3mm","材料费 14.20");
  2009. // LODOP.ADD_PRINT_TEXT("42mm","25mm","25mm","3mm","西药费 161.20");
  2010. // var qyxxs = res.data[i].qyxxs;
  2011. // if (qyxxs != null && qyxxs.length > 0) {
  2012. // var top = 54;
  2013. // for (var j = 0; j < qyxxs.length; j++) {
  2014. // var row = j / 3;
  2015. // var tempTop = top + row * 10;
  2016. // var qyxx = qyxxs[j];
  2017. // var arr = qyxx.split(",");
  2018. // LODOP.ADD_PRINT_TEXT(tempTop + "mm", "6mm", "50mm", "3mm", "取药窗口:" + arr[0]);
  2019. // LODOP.ADD_PRINT_TEXT(tempTop + "mm", "61mm", "50mm", "3mm", "取药号码:" + arr[1]);
  2020. // }
  2021. // }
  2022. var payInfo = res.data[i].payInfo;
  2023. LODOP.ADD_PRINT_TEXT("54mm", "6mm", "100mm", "3mm", payInfo);
  2024. // LODOP.ADD_PRINT_TEXT("54mm","25mm","50mm","3mm","取药窗口:西药房4号窗口");
  2025. // LODOP.ADD_PRINT_TEXT("54mm","80mm","35mm","3mm","取药号码:408392");
  2026. var totalCharge = temp.totalCharge + " 元 ";
  2027. if (res.data[i].countYbZf > 0) {
  2028. totalCharge = totalCharge + "城职普门"
  2029. } else {
  2030. totalCharge = totalCharge + "自费"
  2031. }
  2032. LODOP.ADD_PRINT_TEXT("65mm", "21mm", "65mm", "3mm", totalCharge);
  2033. LODOP.ADD_PRINT_TEXT("72mm", "19mm", "65mm", "3mm", res.data[i].totalChargeStr);
  2034. LODOP.ADD_PRINT_TEXT("79mm", "0mm", "15mm", "3mm", res.data[i].year);//年
  2035. LODOP.ADD_PRINT_TEXT("79mm", "13mm", "10mm", "3mm", res.data[i].month);//月
  2036. LODOP.ADD_PRINT_TEXT("79mm", "25mm", "10mm", "3mm", res.data[i].day);//日
  2037. LODOP.ADD_PRINT_TEXT("79mm", "53mm", "50mm", "3mm", temp.operatorId);//收费员
  2038. LODOP.PRINT();
  2039. //LODOP.PREVIEW();
  2040. initFeeTable();
  2041. }
  2042. } else if (res.code == -1) {
  2043. //退费就退出,不提示异常
  2044. if (!chargeFeeFlag) {
  2045. return;
  2046. }
  2047. new PNotify({
  2048. title: '错误提示',
  2049. text: res.message,
  2050. type: 'error',
  2051. hide: true,
  2052. styling: 'bootstrap3'
  2053. });
  2054. }
  2055. }
  2056. });
  2057. }
  2058. //
  2059. // /**
  2060. // * 加载打印机列表
  2061. // * @constructor
  2062. // */
  2063. // function CreatePrinterList() {
  2064. // LODOP = getLodop();
  2065. // LODOP.PRINT_INITA(6, 0, "92mm", "120mm", "铭和门诊发票打印");
  2066. // //获取打印机设备数,用于进行遍历
  2067. // var count = LODOP.GET_PRINTER_COUNT();
  2068. // var html = "";
  2069. // for (var i = 0; i < count; i++) {
  2070. // //根据设备序号获取设备名
  2071. // var msg = LODOP.GET_PRINTER_NAME(i);
  2072. // html += "<option value='" + i + "'>" + msg + "</option>";
  2073. // }
  2074. // $('#printSelect').html(html);
  2075. // $('#printSelect').selectpicker('refresh');
  2076. // $.ajax({
  2077. // type: "GET",
  2078. // url: '/thmz/getLastWindowsByCurrentUser',
  2079. // contentType: "application/json;charset=UTF-8",
  2080. // dataType: "json",
  2081. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2082. // success: function (res) {
  2083. // if (res == '401' || res == 401) {
  2084. // window.location.href = '/thmz/login/view'
  2085. // return;
  2086. // }
  2087. // if (res.code == 0) {
  2088. // $('#printSelect').selectpicker('val', res.data.printIndex);
  2089. // $('#printSelect').selectpicker('refresh');
  2090. // printIndex=res.data.printIndex;
  2091. // }
  2092. // }
  2093. // });
  2094. // }
  2095. //
  2096. //
  2097. // /**
  2098. // * 保存窗口号
  2099. // */
  2100. // function saveWindows() {
  2101. // $.ajax({
  2102. // type: "POST",
  2103. // url: '/thmz/saveWindows',
  2104. // contentType: "application/json;charset=UTF-8",
  2105. // dataType: "json",
  2106. // data: JSON.stringify({"windowsNo": $("#windowsNum").val()}),
  2107. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2108. // success: function (res) {
  2109. // if (res == '401' || res == 401) {
  2110. // window.location.href = '/thmz/login/view'
  2111. // return;
  2112. // }
  2113. // $('#editWindowsModal').modal('hide');
  2114. // if (res.code == 0) {
  2115. // new PNotify({
  2116. // title: '操作提示',
  2117. // text: res.message,
  2118. // type: 'success',
  2119. // hide: true,
  2120. // styling: 'bootstrap3'
  2121. // });
  2122. // } else {
  2123. // new PNotify({
  2124. // title: '错误提示',
  2125. // text: res.message,
  2126. // type: 'error',
  2127. // hide: true,
  2128. // styling: 'bootstrap3'
  2129. // });
  2130. // }
  2131. // }
  2132. // });
  2133. // }
  2134. //
  2135. //
  2136. //
  2137. // /**
  2138. // * 保存打印机
  2139. // */
  2140. // function savePrint() {
  2141. // $.ajax({
  2142. // type: "POST",
  2143. // url: '/thmz/savePrintIndex',
  2144. // contentType: "application/json;charset=UTF-8",
  2145. // dataType: "json",
  2146. // data: JSON.stringify({"printIndex": $("#printSelect").val()}),
  2147. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2148. // success: function (res) {
  2149. // if (res == '401' || res == 401) {
  2150. // window.location.href = '/thmz/login/view'
  2151. // return;
  2152. // }
  2153. // LODOP = getLodop();
  2154. // LODOP.PRINT_INITA(6, 0, "92mm", "120mm", "铭和门诊发票打印");
  2155. // LODOP.SET_PRINTER_INDEX($("#printSelect").val());
  2156. // printIndex=$("#printSelect").val();
  2157. // $('#editPrintModal').modal('hide');
  2158. // if (res.code == 0) {
  2159. // new PNotify({
  2160. // title: '操作提示',
  2161. // text: res.message,
  2162. // type: 'success',
  2163. // hide: true,
  2164. // styling: 'bootstrap3'
  2165. // });
  2166. // } else {
  2167. // new PNotify({
  2168. // title: '错误提示',
  2169. // text: res.message,
  2170. // type: 'error',
  2171. // hide: true,
  2172. // styling: 'bootstrap3'
  2173. // });
  2174. // }
  2175. // }
  2176. // });
  2177. // }
  2178. /**
  2179. * 查询默认打印机
  2180. */
  2181. function setPrint() {
  2182. if (printIndex >= 0) {
  2183. return;
  2184. }
  2185. $.ajax({
  2186. type: "GET",
  2187. url: '/thmz/getLastWindowsByCurrentUser',
  2188. contentType: "application/json;charset=UTF-8",
  2189. dataType: "json",
  2190. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2191. async: false,
  2192. success: function (res) {
  2193. if (res == '401' || res == 401) {
  2194. window.location.href = '/thmz/login/view'
  2195. return;
  2196. }
  2197. if (res.code == 0) {
  2198. printIndex = res.data.printIndex;
  2199. } else {
  2200. printIndex = -1;
  2201. }
  2202. }
  2203. });
  2204. }
  2205. /**
  2206. * 退费操作
  2207. */
  2208. function refundFee(patientId, times, receiptNo, printFlag,orderTypeName) {
  2209. if(orderTypeName =='商城处方'){
  2210. errorMesageSimaple('商城处方不能退费')
  2211. return
  2212. }
  2213. $("#refundFeePrepare").text(0.00);
  2214. $("#refundFeeDetailModal").modal();
  2215. $("#refund_bill_item_group").removeClass("in").addClass("hide");
  2216. $('#refund_fee_bill_table').bootstrapTable("destroy");
  2217. initRefundFeeDetailTable(patientId, times, receiptNo);
  2218. }
  2219. /**
  2220. * 初始化退费明细表格
  2221. * @param patientId
  2222. * @param times
  2223. * @param receiptNo
  2224. */
  2225. function initRefundFeeDetailTable(patientId, times, receiptNo) {
  2226. $("#patientIdRefund").val(patientId);
  2227. $("#timesRefund").val(times);
  2228. $("#receiptNoRefund").val(receiptNo);
  2229. $('#refund_fee_detail_table').bootstrapTable("destroy");
  2230. $('#refund_fee_detail_table').bootstrapTable({
  2231. url: '/thmz/getRefundFeeDetail', //请求后台的URL(*)
  2232. method: 'post', //请求方式(*)
  2233. toolbar: '#toolbar', //工具按钮用哪个容器
  2234. striped: true, //是否显示行间隔色
  2235. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  2236. pagination: false, //是否显示分页(*)
  2237. sortable: true, //是否启用排序
  2238. sortOrder: "asc", //排序方式
  2239. // sortName: 'orderNo', //排序字段
  2240. queryParams: queryParamsForRefundFee(patientId, times, receiptNo), //传递参数(*)
  2241. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  2242. pageNumber: 1, //初始化加载第一页,默认第一页
  2243. pageSize: 10, //每页的记录行数(*)
  2244. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  2245. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  2246. strictSearch: true,
  2247. showColumns: false, //是否显示所有的列
  2248. showRefresh: false, //是否显示刷新按钮
  2249. minimumCountColumns: 2, //最少允许的列数
  2250. clickToSelect: true, //是否启用点击选中行
  2251. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  2252. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  2253. cardView: false, //是否显示详细视图
  2254. detailView: false,
  2255. //rowStyle:rowStyle,//通过自定义函数设置行样式
  2256. ajaxOptions: {
  2257. headers: {
  2258. 'Accept': 'application/json',
  2259. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  2260. }
  2261. },
  2262. columns: [
  2263. {
  2264. checkbox: true,
  2265. formatter: function (value, row, index) {
  2266. if (row.confirmFlag == 1) {
  2267. return {
  2268. disabled: true, //设置是否可用
  2269. checked: false//设置选中
  2270. }
  2271. }
  2272. if (row.confirmFlag == 3) {
  2273. //getRefundFee();
  2274. return {
  2275. disabled: true, //设置是否可用
  2276. checked: true//设置选中
  2277. }
  2278. }
  2279. }
  2280. },
  2281. {
  2282. field: 'orderNo',
  2283. title: '处方号',
  2284. align: "center",
  2285. valign: 'middle',
  2286. formatter: function (value, row, index) {
  2287. return Math.abs(value);
  2288. }
  2289. }, {
  2290. field: '',
  2291. title: '项目号',
  2292. align: "center",
  2293. valign: 'middle',
  2294. formatter: function (value, row, index) {
  2295. return index + 1;
  2296. }
  2297. }, {
  2298. field: 'billItemCode',
  2299. title: '分类名称',
  2300. align: "center",
  2301. valign: 'middle',
  2302. },
  2303. {
  2304. field: 'yjName',
  2305. title: '医技项目名称',
  2306. align: "center",
  2307. valign: 'middle',
  2308. },{
  2309. field: 'chargeItemCode',
  2310. title: '收费编码',
  2311. align: "center",
  2312. valign: 'middle',
  2313. }, {
  2314. field: 'tcName',
  2315. title: '项目',
  2316. align: "center",
  2317. valign: 'middle',
  2318. },
  2319. {
  2320. field: 'quantity',
  2321. title: '数量',
  2322. align: "center",
  2323. valign: 'middle'
  2324. ,
  2325. formatter: function (value, row, index) {
  2326. return value * row.drugWin;
  2327. }
  2328. }, {
  2329. field: 'unitPrice',
  2330. title: '单价(元)',
  2331. align: "center",
  2332. valign: 'middle',
  2333. formatter: function (value, row, index) {
  2334. return value.toFixed(2);
  2335. }
  2336. }, {
  2337. field: 'amount',
  2338. title: '总金额(元)',
  2339. align: "center",
  2340. valign: 'middle',
  2341. formatter: function (value, row, index) {
  2342. return value.toFixed(2);
  2343. }
  2344. }, {
  2345. field: 'confirmFlag',
  2346. title: '确认标志',
  2347. align: "center",
  2348. valign: 'middle',
  2349. formatter: function (value, row, index) {
  2350. if (value == 0) {
  2351. return "待确认";
  2352. }
  2353. if (value == 1) {
  2354. return "已确认";
  2355. }
  2356. if (value == 3) {
  2357. return "已取消";
  2358. }
  2359. if (value == 4) {
  2360. return "已退费";
  2361. }
  2362. }
  2363. }, {
  2364. field: 'decAmount',
  2365. title: '退药量',
  2366. align: "center",
  2367. valign: 'middle',
  2368. // formatter: function (value, row, index) {
  2369. // return value.toFixed(2);
  2370. // }
  2371. }, {
  2372. field: 'execDept',
  2373. title: '确认科室',
  2374. align: "center",
  2375. valign: 'middle'
  2376. }, {
  2377. field: 'confirmTime',
  2378. title: '确认时间',
  2379. align: "center",
  2380. valign: 'middle',
  2381. formatter: function (value, row, index) {
  2382. if (value != null && value != "") {
  2383. return format(value, "yyyy-MM-dd HH:mm:ss");
  2384. }
  2385. return "";
  2386. }
  2387. }
  2388. ],
  2389. //点击全选框时触发的操作
  2390. onCheckAll: function (rows) {
  2391. getRefundFee();
  2392. },
  2393. //取消所有
  2394. onUncheckAll: function (row) {
  2395. getRefundFee();
  2396. },
  2397. //点击每一个单选框时触发的操作
  2398. onCheck: function (row) {
  2399. getRefundFee();
  2400. },
  2401. //取消每一个单选框时对应的操作;
  2402. onUncheck: function (row) {
  2403. getRefundFee();
  2404. },
  2405. responseHandler: function (res) {
  2406. if (res == '401' || res == 401) {
  2407. window.location.href = '/thmz/login/view'
  2408. return;
  2409. }
  2410. var ress = eval(res);
  2411. if (ress.code == -1) {
  2412. new PNotify({
  2413. title: '错误提示',
  2414. text: ress.message,
  2415. type: 'error',
  2416. hide: true,
  2417. styling: 'bootstrap3'
  2418. });
  2419. return {
  2420. "total": 0,//总页数
  2421. "rows": {} //数据
  2422. };
  2423. }
  2424. return {
  2425. //"total": ress.pageViewVo.total,//总页数
  2426. "rows": ress.data //数据
  2427. };
  2428. },
  2429. //加载完成事件
  2430. onLoadSuccess: function (data) {
  2431. getRefundFee();
  2432. }
  2433. });
  2434. }
  2435. /**
  2436. * 退费列表参数
  2437. * @param patientId
  2438. * @param times
  2439. * @returns {{patientId: *, times: *}}
  2440. */
  2441. function queryParamsForRefundFee(patientId, times, receiptNo) {
  2442. var temp = {
  2443. patientId: patientId,
  2444. times: times,
  2445. receiptNo: receiptNo
  2446. };
  2447. return temp;
  2448. };
  2449. /**
  2450. * 每次选择费用清单明细时计算实际应退金额
  2451. */
  2452. function getRefundFee() {
  2453. extracted();
  2454. if (chargeItemCodes == null) {
  2455. $("#refundFeePrepare").text(0.00);
  2456. return;
  2457. }
  2458. $.ajax({
  2459. type: "POST",
  2460. url: '/thmz/getNewListForRefundFee',
  2461. contentType: "application/json;charset=UTF-8",
  2462. dataType: "json",
  2463. data: JSON.stringify({
  2464. patientId: $("#patientIdRefund").val(),
  2465. times: $("#timesRefund").val(),
  2466. receiptNo: $("#receiptNoRefund").val(),
  2467. chargeItemCodes: chargeItemCodes
  2468. }),
  2469. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2470. success: function (res) {
  2471. if (res == '401' || res == 401) {
  2472. window.location.href = '/thmz/login/view'
  2473. return;
  2474. }
  2475. if (res.code == 0) {
  2476. $("#refundFeePrepare").text(res.pageViewVo.data[0].refundFee.toFixed(2));
  2477. } else {
  2478. new PNotify({
  2479. title: '错误提示',
  2480. text: res.message,
  2481. type: 'error',
  2482. hide: true,
  2483. styling: 'bootstrap3'
  2484. });
  2485. }
  2486. }
  2487. });
  2488. }
  2489. /**
  2490. * 发起预退费
  2491. */
  2492. function readyRefundFee() {
  2493. extracted();
  2494. $("#refundFeeModal").modal();
  2495. initRefundChargeDetailTable(chargeItemCodes);
  2496. $("#refundFeeDetailModal").modal("hide");
  2497. }
  2498. /**
  2499. * 获取预退费金额
  2500. * @returns {*}
  2501. */
  2502. function extracted() {
  2503. var allSelecteds = $('#refund_fee_detail_table').bootstrapTable('getAllSelections');
  2504. chargeItemCodes = null;
  2505. if (allSelecteds != null && allSelecteds.length > 0) {
  2506. for (var i = 0; i < allSelecteds.length; i++) {
  2507. var temp = allSelecteds[i].orderNo + "_" + allSelecteds[i].itemNo + "_" + allSelecteds[i].chargeItemCode;
  2508. if (chargeItemCodes == null) {
  2509. chargeItemCodes = temp;
  2510. } else {
  2511. chargeItemCodes += "," + temp;
  2512. }
  2513. }
  2514. }
  2515. }
  2516. /**
  2517. * 初始化退费重收费明细表格
  2518. */
  2519. function initRefundChargeDetailTable(chargeItemCodes) {
  2520. $('#refund_fee_table').bootstrapTable("destroy");
  2521. $('#refund_fee_table').bootstrapTable({
  2522. url: '/thmz/getNewListForRefundFee', //请求后台的URL(*)
  2523. method: 'post', //请求方式(*)
  2524. toolbar: '#toolbar', //工具按钮用哪个容器
  2525. striped: true, //是否显示行间隔色
  2526. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  2527. pagination: false, //是否显示分页(*)
  2528. sortable: true, //是否启用排序
  2529. sortOrder: "asc", //排序方式
  2530. // sortName: 'orderNo', //排序字段
  2531. queryParams: queryParamsForRefundDetail(chargeItemCodes), //传递参数(*)
  2532. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  2533. pageNumber: 1, //初始化加载第一页,默认第一页
  2534. pageSize: 10, //每页的记录行数(*)
  2535. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  2536. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  2537. strictSearch: true,
  2538. showColumns: false, //是否显示所有的列
  2539. showRefresh: false, //是否显示刷新按钮
  2540. minimumCountColumns: 2, //最少允许的列数
  2541. clickToSelect: true, //是否启用点击选中行
  2542. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  2543. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  2544. cardView: false, //是否显示详细视图
  2545. detailView: false,
  2546. //rowStyle:rowStyle,//通过自定义函数设置行样式
  2547. ajaxOptions: {
  2548. headers: {
  2549. 'Accept': 'application/json',
  2550. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  2551. }
  2552. },
  2553. columns: [
  2554. // {
  2555. // checkbox: true
  2556. // },
  2557. {
  2558. field: 'patientId',
  2559. title: '患者编号',
  2560. align: "center",
  2561. valign: 'middle',
  2562. }, {
  2563. field: 'name',
  2564. title: '患者姓名',
  2565. align: "center",
  2566. valign: 'middle',
  2567. }, {
  2568. field: 'oriAmount',
  2569. title: '已收金额(元)',
  2570. align: "center",
  2571. valign: 'middle',
  2572. }, {
  2573. field: 'refundFee',
  2574. title: '应退金额(元)',
  2575. align: "center",
  2576. valign: 'middle'
  2577. }, {
  2578. field: 'amount',
  2579. title: '应收金额(元)',
  2580. align: "center",
  2581. valign: 'middle',
  2582. formatter: function (value, row, index) {
  2583. return Math.abs(value);
  2584. }
  2585. }, {
  2586. title: '操作',
  2587. align: "center",
  2588. valign: 'middle',
  2589. // sortable: true,
  2590. formatter: function (value, row, index) {
  2591. var str = "";
  2592. if (row.amount == 0 || row.amount == null || row.amount == undefined) {
  2593. str = '<button type="button" class="can-not-used" title="费用明细" ><i id="plusOrMinus" class="fa fa-plus"></i></button>';
  2594. } else {
  2595. str = '<button type="button" class="registration-no-color-foot-button" title="费用明细" onclick="initMzChargeDetailByBillItem(true)"><i id="plusOrMinus" class="fa fa-plus"></i></button>';
  2596. }
  2597. if((row.amount == 0 || row.amount == null || row.amount == undefined) || row.ybZfFlag == null || row.ybZfFlag =='0'){
  2598. str += '<button type="button" class="can-not-used" title="撤销医保重新登记医保" ><i class="fa fa-server"></i></button>';
  2599. }else {
  2600. str += '<button type="button" class="registration-no-color-foot-button" title="撤销医保重新登记医保" onclick="reqYb()"><i class="fa fa-server"></i></button>';
  2601. }
  2602. if(row.mipOrderFlag == 1){
  2603. str += `<button type="button" class="registration-no-color-foot-button"title="读取电子凭证" onclick="reSiReadCard(true,'01')"><i class="fa fa-newspaper-o"></i></button>`;
  2604. }
  2605. str += '<button type="button" class="registration-no-color-foot-button"title="普通退费" onclick="saveRefundFee(0)"><i class="fa fa-check"></i></button>';
  2606. str += '<button type="button" class="registration-no-color-foot-button"title="原路退费" onclick="saveRefundFee(1)"><i class="fa fa-exchange"></i></button>';
  2607. return str;
  2608. }
  2609. }
  2610. ],
  2611. responseHandler: function (res) {
  2612. if (res == '401' || res == 401) {
  2613. window.location.href = '/thmz/login/view'
  2614. return;
  2615. }
  2616. var ress = eval(res);
  2617. if (ress.code == -1) {
  2618. new PNotify({
  2619. title: '错误提示',
  2620. text: ress.message,
  2621. type: 'error',
  2622. hide: true,
  2623. styling: 'bootstrap3'
  2624. });
  2625. return {
  2626. "total": 0,//总页数
  2627. "rows": {} //数据
  2628. };
  2629. }
  2630. 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)){
  2631. $("#tfGrzhzfDiv").removeClass("hide").addClass("in");
  2632. }else {
  2633. $("#tfGrzhzfDiv").removeClass("in").addClass("hide");
  2634. }
  2635. $("#oriAmount").text(ress.pageViewVo.data[0].oriAmount);
  2636. $("#newAmount").text(ress.pageViewVo.data[0].amount);
  2637. $("#refundAmount").text(ress.pageViewVo.data[0].refundFee);
  2638. return {
  2639. "total": ress.pageViewVo.total,//总页数
  2640. "rows": ress.pageViewVo.data //数据
  2641. };
  2642. },
  2643. });
  2644. }
  2645. /**
  2646. * 构建列表查询参数
  2647. * @param chargeItemCodes
  2648. * @returns {{patientId: string | number | string[] | undefined | jQuery, times: string | number | string[] | undefined | jQuery, billItemCode: number}}
  2649. */
  2650. function queryParamsForRefundDetail(chargeItemCodes) {
  2651. return {
  2652. patientId: $("#patientIdRefund").val(),
  2653. times: $("#timesRefund").val(),
  2654. receiptNo: $("#receiptNoRefund").val(),
  2655. chargeItemCodes: chargeItemCodes
  2656. };
  2657. };
  2658. /**
  2659. * 关闭预退费窗口
  2660. */
  2661. function closeRefundFeeDetailModal() {
  2662. $("#refundFeeDetailModal").modal("hide");
  2663. }
  2664. /**
  2665. * 提交退费操作
  2666. * @param refundType 0 现金退费 1 原路退费
  2667. */
  2668. function saveRefundFee(refundType) {
  2669. var params = queryParamsForRefundByBillItem(null);
  2670. params.refundType = refundType;
  2671. params['readCardResult'] = $("#cdReadCardResult").val()
  2672. params['acctUsedFlag'] = $("#tfGrzhzf").val()
  2673. params['readCardType'] = $("#tfReadType").val()
  2674. $.ajax({
  2675. type: "POST",
  2676. url: '/thmz/saveRefundFee',
  2677. contentType: "application/json;charset=UTF-8",
  2678. dataType: "json",
  2679. data: JSON.stringify(params),
  2680. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2681. success: function (res) {
  2682. if (res == '401' || res == 401) {
  2683. window.location.href = '/thmz/login/view'
  2684. return;
  2685. }
  2686. $("#cdReadCardResult").val(null)
  2687. if (res.code == 0 || res.code == -2) {
  2688. successMesage(res);
  2689. $("#refundFeeModal").modal("hide");
  2690. var refundMzDepositFiles = res.refundMzDepositFiles;
  2691. if (refundMzDepositFiles != null && refundMzDepositFiles.length > 0) {
  2692. var html = '';
  2693. for (var i = 0; i < refundMzDepositFiles.length; i++) {
  2694. var mzDepositFile = refundMzDepositFiles[i];
  2695. html += '<div class="item form-group col-md-12 col-sm-12 col-xs-12">';
  2696. html += '<label style="padding-left: 0px;" class="control-label col-md-2 col-sm-2 col-xs-2">';
  2697. html += mzDepositFile.chequeType;
  2698. html += '</label>';
  2699. html += '<div class="col-md-6 col-sm-6 col-xs-6">';
  2700. html += '<input type="text" class="form-control" readonly value="' + Math.abs(mzDepositFile.amount) + '">';
  2701. html += '</div>';
  2702. html += '<label style="text-align: left;" class="control-label col-md-1 col-sm-1 col-xs-1">元</label>';
  2703. html += '<label style="text-align: left;color: red" class="control-label col-md-3 col-sm-3 col-xs-3">';
  2704. if(res.mipOrdeFlag !=null && res.mipOrdeFlag == 1){
  2705. html += "原路退回";
  2706. }
  2707. else if ((refundType == 1 && (mzDepositFile.chequeType == "银联卡" || mzDepositFile.chequeType == "聚合支付")) || mzDepositFile.chequeType == "医保记账" || mzDepositFile.chequeType == "省医保个账" || mzDepositFile.chequeType == "市医保个账") {
  2708. html += "原路退回";
  2709. }
  2710. html += '</label>';
  2711. html += '</div>';
  2712. }
  2713. $("#refundPayDetailForm").html(html);
  2714. $("#refundPayDetailModal").modal();
  2715. }
  2716. //作废电子发票
  2717. if(fpVsesionNo == 1){
  2718. uploadMzInvoice(params.patientId, params.times,params.receiptNo,2);
  2719. }
  2720. if (res.times > 0) {
  2721. let fpTitle = fpVsesionNo == 0 ? '打印' : '上传';
  2722. if(confirm(`是否${fpTitle}发票?`)){
  2723. if(fpVsesionNo == 0){
  2724. prn1Print(res.patientId, res.times, false, 1);
  2725. }else {
  2726. printDzfp(res.patientId, res.times,1,0)
  2727. }
  2728. }
  2729. } else {
  2730. initFeeTable();
  2731. }
  2732. } else {
  2733. errorMesage(res);
  2734. }
  2735. }
  2736. });
  2737. }
  2738. /**
  2739. * 清空查询条件
  2740. */
  2741. function cleanParams() {
  2742. $("#deptNoParam").selectpicker('val', null);//默认选中
  2743. $("#deptNoParam").selectpicker('refresh');
  2744. $("#doctorParam").selectpicker('val', null);//默认选中
  2745. $("#doctorParam").selectpicker('refresh');
  2746. $("#cardNo").val(null);
  2747. $("#name").val(null);
  2748. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  2749. $("#patientId").val(null);
  2750. //默认光标在卡号输入框
  2751. $("#cardNo").focus();
  2752. $("#serialNo").val(null);
  2753. $("#ownData").removeAttr("checked");
  2754. }
  2755. /**
  2756. * 增加收费方式
  2757. */
  2758. function addPayType(id) {
  2759. // var arr = $("#payForm").find("div.pay-item");
  2760. // if (arr.length > 0) {
  2761. // for (var i = 0; i < arr.length; i++) {
  2762. // var temp = parseFloat($(arr[i]).find("input").val());
  2763. // if (temp == 0) {
  2764. // new PNotify({
  2765. // title: '错误提示',
  2766. // text: "存在未使用的收款方式,请不要重复添加!",
  2767. // type: 'error',
  2768. // hide: true,
  2769. // styling: 'bootstrap3'
  2770. // });
  2771. // return;
  2772. // }
  2773. // }
  2774. // }
  2775. var payTypeId = null;
  2776. if (id != undefined && id != null) {
  2777. payTypeId = id;
  2778. } else {
  2779. var payTypeIndex = $("#payTypeIndex").val();
  2780. payTypeId = "payType_" + payTypeIndex;
  2781. }
  2782. 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)" ';
  2783. if ("payType" == id) {
  2784. html += " id='cash' ";
  2785. }
  2786. html += '></div><div class="col-md-1 col-sm-1 col-xs-12" style="line-height: 34px;">元&nbsp;&nbsp;<a style="line-height: 34px;cursor: pointer;" onclick="closeThisParent(this)"><i class="fa fa-close"></i></a></div></div></div>';
  2787. $("#changeAmountParent").before(html);
  2788. initChequeType(payTypeId)
  2789. if (payTypeIndex != undefined && payTypeIndex != null) {
  2790. payTypeIndex = Add(payTypeIndex, 1);
  2791. $("#payTypeIndex").val(payTypeIndex);
  2792. }
  2793. $("#addPayType").parent().removeClass("in").addClass("hide");
  2794. }
  2795. // /**
  2796. // * 取消费用上传
  2797. // */
  2798. // function cancelFee() {
  2799. // var patientId = $("#patientIdHaveTally").val();
  2800. // var times = $("#timesHaveTally").val();
  2801. // var receiptNo = $("#receiptNoHaveTally").val();
  2802. // $.ajax({
  2803. // type: "POST",
  2804. // url: '/thmz/cancelTmFee',
  2805. // contentType: "application/json;charset=UTF-8",
  2806. // dataType: "json",
  2807. // data: JSON.stringify({"patientId": patientId, "times": times, "receiptNo": receiptNo}),
  2808. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2809. // async: false,
  2810. // success: function (res) {
  2811. // if (res == '401' || res == 401) {
  2812. // window.location.href = '/thmz/login/view'
  2813. // return;
  2814. // }
  2815. // if (res.code == 0) {
  2816. // $("#fundPay").val(0);
  2817. // } else {
  2818. // new PNotify({
  2819. // title: '错误提示',
  2820. // text: res.message,
  2821. // type: 'error',
  2822. // hide: true,
  2823. // styling: 'bootstrap3'
  2824. // });
  2825. // }
  2826. // }
  2827. // });
  2828. // }
  2829. /**
  2830. * 查询当前门诊缴费订单的所有缴费方式列表
  2831. * @param patientId
  2832. * @param times
  2833. * @param receiptNo
  2834. */
  2835. function showChequType(patientId, times, receiptNo) {
  2836. $("#depositFileModal").modal();
  2837. $('#deposit_file_detail_table').bootstrapTable("destroy");
  2838. $('#deposit_file_detail_table').bootstrapTable({
  2839. url: '/thmz/getAllDepositFileForThisTime?patientId=' + patientId + "&times=" + times + "&receiptNo=" + Math.abs(receiptNo), //请求后台的URL(*)
  2840. method: 'get', //请求方式(*)
  2841. toolbar: '#toolbar', //工具按钮用哪个容器
  2842. striped: true, //是否显示行间隔色
  2843. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  2844. pagination: false, //是否显示分页(*)
  2845. sortable: true, //是否启用排序
  2846. sortOrder: "asc", //排序方式
  2847. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  2848. pageNumber: 1, //初始化加载第一页,默认第一页
  2849. pageSize: 5, //每页的记录行数(*)
  2850. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  2851. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  2852. strictSearch: true,
  2853. showColumns: false, //是否显示所有的列
  2854. showRefresh: false, //是否显示刷新按钮
  2855. minimumCountColumns: 2, //最少允许的列数
  2856. clickToSelect: true, //是否启用点击选中行
  2857. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  2858. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  2859. cardView: false, //是否显示详细视图
  2860. detailView: false,
  2861. //rowStyle:rowStyle,//通过自定义函数设置行样式
  2862. ajaxOptions: {
  2863. headers: {
  2864. 'Accept': 'application/json',
  2865. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  2866. }
  2867. },
  2868. columns: [
  2869. // {
  2870. // checkbox: true,
  2871. // },
  2872. {
  2873. field: 'patientId',
  2874. title: '病人编号',
  2875. align: "center",
  2876. valign: 'middle'
  2877. }, {
  2878. field: 'times',
  2879. title: '就诊次数',
  2880. align: "center",
  2881. valign: 'middle',
  2882. }, {
  2883. field: 'amount',
  2884. title: '支付金额(元)',
  2885. align: "center",
  2886. valign: 'middle',
  2887. formatter: function (value, row, index) {
  2888. return value.toFixed(2);
  2889. }
  2890. },
  2891. {
  2892. field: 'chequeTypeName',
  2893. title: '支付方式',
  2894. align: "center",
  2895. valign: 'middle'
  2896. }
  2897. ],
  2898. onDblClickRow: function (row) {
  2899. editChequType(row.receiptSn, row.chequeType, row.dcountNo, row.chequeTypeName);
  2900. },
  2901. responseHandler: function (res) {
  2902. if (res == '401' || res == 401) {
  2903. window.location.href = '/thmz/login/view'
  2904. return;
  2905. }
  2906. var ress = eval(res);
  2907. if (ress.code == -1) {
  2908. new PNotify({
  2909. title: '错误提示',
  2910. text: ress.message,
  2911. type: 'error',
  2912. hide: true,
  2913. styling: 'bootstrap3'
  2914. });
  2915. return {
  2916. "total": 0,//总页数
  2917. "rows": {} //数据
  2918. };
  2919. }
  2920. if (ress.data == null || ress.data.length == 0) {
  2921. $("#tallyDetailModal").modal("hide");
  2922. }
  2923. return {
  2924. "rows": ress.data //数据
  2925. };
  2926. },
  2927. });
  2928. }
  2929. /**
  2930. * 修改收款方式
  2931. * @param patientId
  2932. * @param times
  2933. * @param paymode
  2934. */
  2935. function editChequType(receiptSn, chequType, dcountNo, chequeTypeName) {
  2936. var message = "当前病人本次门诊缴费的支付方式为【" + chequeTypeName + "】,确定需要修改吗?";
  2937. if (dcountNo == 1) {
  2938. message = "当前病人本次门诊缴费的支付方式为【" + chequeTypeName + "】,且本次缴费已经结算,确定需要修改吗?如仍需继续修改,会影响已经结算的报表,请重新打印本次缴费所在日期的【日结报表】!";
  2939. }
  2940. $("#editPayModeTip").html(message);
  2941. $("#receiptSn").val(receiptSn);
  2942. $("#chequType").val(chequType);
  2943. $('#payTypeEditPayMode').selectpicker('val', 1);
  2944. $('#payTypeEditPayMode').selectpicker('refresh');
  2945. $("#editPayModeModal").modal();
  2946. $("#depositFileModal").modal("hide");
  2947. }
  2948. /**
  2949. * 提交修改收款方式
  2950. */
  2951. function saveEditPayMode() {
  2952. $.ajax({
  2953. type: "GET",
  2954. url: '/thmz/updateChequType?oldChequeType=' + $("#chequType").val() + "&receiptSn=" + $("#receiptSn").val() + "&chequeType=" + $("#payTypeEditPayMode").val(),
  2955. contentType: "application/json;charset=UTF-8",
  2956. dataType: "json",
  2957. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2958. success: function (res) {
  2959. if (res == '401' || res == 401) {
  2960. window.location.href = '/thmz/login/view'
  2961. return;
  2962. }
  2963. if (res.code == 0) {
  2964. successMesage(res);
  2965. clearEditPayMode();
  2966. $("#editPayModeModal").modal("hide");
  2967. } else if (res.code == -1) {
  2968. new PNotify({
  2969. title: '错误提示',
  2970. text: res.message,
  2971. type: 'error',
  2972. hide: true,
  2973. styling: 'bootstrap3'
  2974. });
  2975. }
  2976. }
  2977. });
  2978. }
  2979. /**
  2980. * 清空
  2981. */
  2982. function clearEditPayMode() {
  2983. $("#receiptSn").val(null);
  2984. $("#chequType").val(null);
  2985. }
  2986. //
  2987. // /**
  2988. // * 反写备份表的数据到正式表中,记账的数据在备分表
  2989. // * @param patientId
  2990. // * @param times
  2991. // * @param receiptNo
  2992. // */
  2993. // function reInsertDetailModal(patientId,times ,receiptNo) {
  2994. // $.ajax({
  2995. // type: "POST",
  2996. // url: '/thmz/reSaveDetailForByjz',
  2997. // contentType: "application/json;charset=UTF-8",
  2998. // dataType: "json",
  2999. // data: JSON.stringify({"patientId": patientId, "times": times, "receiptNo": receiptNo}),
  3000. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3001. // async: false,
  3002. // success: function (res) {
  3003. // if (res == '401' || res == 401) {
  3004. // window.location.href = '/thmz/login/view'
  3005. // return;
  3006. // }
  3007. // if (res.code == 0) {
  3008. // successMesage(res);
  3009. // initFeeTable();
  3010. // } else {
  3011. // new PNotify({
  3012. // title: '错误提示',
  3013. // text: res.message,
  3014. // type: 'error',
  3015. // hide: true,
  3016. // styling: 'bootstrap3'
  3017. // });
  3018. // }
  3019. // }
  3020. // });
  3021. // }
  3022. /**
  3023. * 医保电子凭证读卡
  3024. * @param params
  3025. */
  3026. function siReadCard(params) {
  3027. $.ajax({
  3028. type: "GET",
  3029. url: params && params.startsWith('jiangsu_qrcode') ? 'http://localhost:8321/api/entry?param=' + params : 'http://localhost:8321/readcard/entry?param=' + params,
  3030. contentType: "application/json;charset=UTF-8",
  3031. dataType: "json",
  3032. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3033. success: function (res) {
  3034. if (res == '401' || res == 401) {
  3035. window.location.href = '/thmz/login/view'
  3036. return;
  3037. }
  3038. //console.log(res);
  3039. if (res.code == 200) {
  3040. var data = JSON.parse(res.data);
  3041. queryUserInfoBySocialNoNotFillPatient('cardNo', "" + data.data.idNo + "", initFeeTable, null);
  3042. } else {
  3043. errorMesage(res);
  3044. }
  3045. }
  3046. });
  3047. // window.open('ReadCard://'+prm, '_self')
  3048. }
  3049. /**
  3050. * 读卡类型改变事件
  3051. */
  3052. // function mztczfSiReadCardTypeChange() {
  3053. // var grzhzf = $("#grzhzf").val();
  3054. // if (grzhzf == null || grzhzf == "") {
  3055. // errorMesageSimaple("请先选择是否使用个人账户余额支付剩余门诊费用!")
  3056. // $('#mztczfSiReadCardType').selectpicker('val', null);
  3057. // $('#mztczfSiReadCardType').selectpicker('refresh');
  3058. // return;
  3059. // }
  3060. // var mztczfSiReadCardType = $("#mztczfSiReadCardType").val();
  3061. // if (mztczfSiReadCardType == null || mztczfSiReadCardType == "") {
  3062. // return;
  3063. // }
  3064. // let admdvs = $('#mztczfAdvmCity').val()
  3065. // if(!stringNotBlank(admdvs)){
  3066. // errorMesageSimaple("请选择参保地!")
  3067. // $('#mztczfSiReadCardType').selectpicker('val', null);
  3068. // $('#mztczfSiReadCardType').selectpicker('refresh');
  3069. // return;
  3070. // }
  3071. // postAjaxJsonHttpRequst("/thmz/queryNewInsuinfo",{
  3072. // patientId :readPatientId,
  3073. // times :readTimes,
  3074. // admdvs:admdvs
  3075. // },true,function (sfzRes) {
  3076. // if (sfzRes == '401' || sfzRes == 401) {
  3077. // window.location.href = '/thmz/login/view'
  3078. // return;
  3079. // }
  3080. // if(sfzRes.code == 0){
  3081. // var url = "http://localhost:8321/readcard/entry?param=";
  3082. // if (mztczfSiReadCardType == "03") {
  3083. // // url += 'sicard_01101';
  3084. // url = "http://localhost:8321/readcard/jiangsu/readcard_auto";
  3085. // // url += 'readcard_auto';
  3086. // } else if (mztczfSiReadCardType == "01") {
  3087. // // url += 'qrcode_01101';
  3088. // url = "http://localhost:8321/api/entry?param=";
  3089. // url += 'jiangsu_qrcode_01101';
  3090. // } else if (mztczfSiReadCardType == "02") {
  3091. // // url += 'idcard_01101';
  3092. // url += 'huashi_readcard';
  3093. // }else if (mztczfSiReadCardType == "04") {
  3094. // url += 'face_01101';
  3095. // }
  3096. // $.ajax({
  3097. // type: "GET",
  3098. // url: url,
  3099. // contentType: "application/json;charset=UTF-8",
  3100. // dataType: "json",
  3101. // headers: {
  3102. // 'Accept': 'application/json',
  3103. // 'Authorization': 'Bearer ' + localStorage.getItem("token")
  3104. // },
  3105. // success: function (res) {
  3106. // if (res == '401' || res == 401) {
  3107. // window.location.href = '/thmz/login/view'
  3108. // return;
  3109. // }
  3110. // if (res.code == 200) {
  3111. // if (mztczfSiReadCardType == "03") {
  3112. // $("#readCardResult").val(res.rawCardData);
  3113. // $("#pBusiCardInfo").val(res.rawBusiData);
  3114. // } else if (mztczfSiReadCardType == "01") {
  3115. // var data = JSON.parse(res.data);
  3116. // $("#readCardResult").val(JSON.stringify(data.data));
  3117. // } else {
  3118. // $("#readCardResult").val(res.data);
  3119. // }
  3120. // successMesageSimaple("读卡成功,可以进行医保结算操作。");
  3121. // $("#mztczfSiReadCardModal").modal("hide");
  3122. // } else {
  3123. // warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!")
  3124. // console.log(res);
  3125. // }
  3126. // },
  3127. // error: function (XMLHttpRequest, textStatus, errorThrown) {
  3128. // warningMesageSimaple("读卡异常,可以稍后重试或者自费结算(不享受门诊统筹)!")
  3129. // }
  3130. // });
  3131. // }else {
  3132. // errorMesage(sfzRes)
  3133. // }
  3134. // })
  3135. // }
  3136. function mztczfSiReadCardTypeChange() {
  3137. // 显示loading效果
  3138. $("#readLoadingModal").modal('show');
  3139. var grzhzf = $("#grzhzf").val();
  3140. if (grzhzf == null || grzhzf == "") {
  3141. errorMesageSimaple("请先选择是否使用个人账户余额支付剩余门诊费用!");
  3142. $('#mztczfSiReadCardType').selectpicker('val', null);
  3143. $('#mztczfSiReadCardType').selectpicker('refresh');
  3144. $("#readLoadingModal").modal('hide'); // 隐藏loading
  3145. return;
  3146. }
  3147. var mztczfSiReadCardType = $("#mztczfSiReadCardType").val();
  3148. if (mztczfSiReadCardType == null || mztczfSiReadCardType == "") {
  3149. $("#readLoadingModal").modal('hide'); // 隐藏loading
  3150. return;
  3151. }
  3152. let admdvs = $('#mztczfAdvmCity').val();
  3153. if (!stringNotBlank(admdvs)) {
  3154. errorMesageSimaple("请选择参保地!");
  3155. $('#mztczfSiReadCardType').selectpicker('val', null);
  3156. $('#mztczfSiReadCardType').selectpicker('refresh');
  3157. $("#readLoadingModal").modal('hide'); // 隐藏loading
  3158. return;
  3159. }
  3160. postAjaxJsonHttpRequst("/thmz/queryNewInsuinfo", {
  3161. patientId: readPatientId,
  3162. times: readTimes,
  3163. admdvs: admdvs
  3164. }, true, function (sfzRes) {
  3165. if (sfzRes == '401' || sfzRes == 401) {
  3166. window.location.href = '/thmz/login/view';
  3167. $("#readLoadingModal").modal('hide'); // 隐藏loading
  3168. return;
  3169. }
  3170. if (sfzRes.code == 0) {
  3171. var url = "";
  3172. if (mztczfSiReadCardType == "03") {
  3173. url = "http://localhost:8321/readcard/jiangsu/readcard_auto";
  3174. } else if (mztczfSiReadCardType == "01") {
  3175. url = "http://localhost:8321/api/entry?param=jiangsu_qrcode_01101";
  3176. } else if (mztczfSiReadCardType == "02") {
  3177. url = "http://localhost:8321/readcard/entry?param=huashi_readcard";
  3178. } else if (mztczfSiReadCardType == "04") {
  3179. url = "http://localhost:8321/readcard/entry?param=face_01101";
  3180. }
  3181. // 自动重试机制
  3182. callReadCardWithRetry(url, 5, 500, function (res) {
  3183. // 成功回调
  3184. $("#readLoadingModal").modal('hide'); // 隐藏loading
  3185. if (mztczfSiReadCardType == "03") {
  3186. $("#readCardResult").val(res.rawCardData);
  3187. $("#pBusiCardInfo").val(res.rawBusiData);
  3188. } else if (mztczfSiReadCardType == "01") {
  3189. var data = JSON.parse(res.data);
  3190. $("#readCardResult").val(JSON.stringify(data.data));
  3191. } else {
  3192. $("#readCardResult").val(res.data);
  3193. }
  3194. successMesageSimaple("读卡成功,可以进行医保结算操作。");
  3195. $("#mztczfSiReadCardModal").modal("hide");
  3196. }, function (err) {
  3197. $("#readLoadingModal").modal('hide'); // 隐藏loading
  3198. warningMesageSimaple("读卡失败,可以稍后重试或者自费结算(不享受门诊统筹)!");
  3199. console.log(err);
  3200. });
  3201. } else {
  3202. $("#readLoadingModal").modal('hide'); // 隐藏loading
  3203. errorMesage(sfzRes);
  3204. }
  3205. });
  3206. }
  3207. // 自动重试的通用函数
  3208. function callReadCardWithRetry(url, retryCount, retryDelay, successCallback, errorCallback) {
  3209. $.ajax({
  3210. type: "GET",
  3211. url: url,
  3212. contentType: "application/json;charset=UTF-8",
  3213. dataType: "json",
  3214. headers: {
  3215. 'Accept': 'application/json',
  3216. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  3217. },
  3218. success: function (res) {
  3219. if (res.code == 200) {
  3220. successCallback(res);
  3221. } else if (retryCount > 0) {
  3222. // 重试时保持loading状态,不隐藏
  3223. setTimeout(function () {
  3224. callReadCardWithRetry(url, retryCount - 1, retryDelay, successCallback, errorCallback);
  3225. }, retryDelay);
  3226. } else {
  3227. errorCallback(res);
  3228. }
  3229. },
  3230. error: function (XMLHttpRequest, textStatus, errorThrown) {
  3231. if (retryCount > 0) {
  3232. // 重试时保持loading状态,不隐藏
  3233. setTimeout(function () {
  3234. callReadCardWithRetry(url, retryCount - 1, retryDelay, successCallback, errorCallback);
  3235. }, retryDelay);
  3236. } else {
  3237. errorCallback({ message: "读卡异常" });
  3238. }
  3239. }
  3240. });
  3241. }
  3242. /**
  3243. * 打开读卡类型弹窗
  3244. */
  3245. function mztczfSiReadCardTypeModel(patientId,times) {
  3246. addOrderLock(patientId,times,null)
  3247. $("#readCardResult").val(null);
  3248. $("#pBusiCardInfo").val(null);
  3249. readPatientId = patientId
  3250. readTimes = times
  3251. $('#mztczfSiReadCardType').selectpicker('val', null);
  3252. $('#mztczfSiReadCardType').selectpicker('refresh');
  3253. $('#grzhzf').selectpicker('val', null);
  3254. $('#grzhzf').selectpicker('refresh');
  3255. $("#mztczfSiReadCardModal").modal();
  3256. }
  3257. /**
  3258. * 处方加锁
  3259. */
  3260. function addOrderLock(patientId,times,receiptNo) {
  3261. postAjaxJsonHttpRequst("/thmz/addOrderLock",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
  3262. })
  3263. }
  3264. /**
  3265. * 处方解锁
  3266. */
  3267. function deleteOrderLock(patientId,times,receiptNo) {
  3268. postAjaxJsonHttpRequst("/thmz/deleteOrderLock",{patientId:patientId,times:times,receiptNo:receiptNo},true,function (res) {
  3269. if(res.code == 0){
  3270. successMesageSimaple('处方解锁成功')
  3271. }
  3272. })
  3273. }
  3274. /**
  3275. * 医保结算
  3276. * @param patientId
  3277. * @param times
  3278. */
  3279. function directRegistration(patientId, times) {
  3280. //显示弹层
  3281. $("#loadingModal").modal('show');
  3282. $.ajax({
  3283. type: "POST",
  3284. url: '/thmz/directRegistration',
  3285. contentType: "application/json;charset=UTF-8",
  3286. dataType: "json",
  3287. data: JSON.stringify({
  3288. patientId: patientId,
  3289. times: times,
  3290. readCardResult: $("#readCardResult").val(),
  3291. busCardInfo: $("#pBusiCardInfo").val(),
  3292. grzhzf: $("#grzhzf").val(),
  3293. readCardType: $("#mztczfSiReadCardType").val()
  3294. }),
  3295. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3296. success: function (res) {
  3297. //隐藏
  3298. $("#loadingModal").modal('hide');
  3299. if (res == '401' || res == 401) {
  3300. window.location.href = '/thmz/login/view'
  3301. return;
  3302. }
  3303. if (res.code == 0) {
  3304. successMesage(res);
  3305. } else {
  3306. errorMesage(res);
  3307. }
  3308. }
  3309. });
  3310. }
  3311. /**
  3312. * 门诊统筹补录
  3313. * @param patientId
  3314. * @param times
  3315. * @param receiptNo
  3316. */
  3317. function mztcbl(patientId, times, receiptNo) {
  3318. $.ajax({
  3319. type: "GET",
  3320. url: '/thmz/mztcblInfo?patientId=' + patientId + "&times=" + times + "&receiptNo=" + receiptNo,
  3321. contentType: "application/json;charset=UTF-8",
  3322. dataType: "json",
  3323. headers: {
  3324. 'Accept': 'application/json',
  3325. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  3326. },
  3327. success: function (res) {
  3328. if (res == '401' || res == 401) {
  3329. window.location.href = '/thmz/login/view'
  3330. return;
  3331. }
  3332. if (res.code == 0) {
  3333. $("#changedTotalAmount").val(res.data.totalAmount);
  3334. $("#ybjzAmount").val(res.data.fund_pay_sumamt);
  3335. $("#accAmount").val(res.data.acct_pay);
  3336. $("#needRefundAmount").val(res.data.refundFee);
  3337. $("#mzblPatientId").val(patientId);
  3338. $("#mzblTimes").val(times);
  3339. $("#mzblReceiptNo").val(receiptNo);
  3340. //successMesage(res);
  3341. } else {
  3342. errorMesage(res);
  3343. }
  3344. },
  3345. error: function (XMLHttpRequest, textStatus, errorThrown) {
  3346. }
  3347. });
  3348. $("#mzblModal").modal();
  3349. }
  3350. /**
  3351. * 提交门诊补录申请
  3352. */
  3353. function chargeFeeForMztcbl() {
  3354. if (!confirm("确定要对当前费用进行门诊统筹补录操作吗?")) {
  3355. return;
  3356. }
  3357. var patientId = $("#mzblPatientId").val();
  3358. var times = $("#mzblTimes").val();
  3359. var receiptNo = $("#mzblReceiptNo").val();
  3360. $.ajax({
  3361. type: "GET",
  3362. url: '/thmz/chargeFeeForMztcbl?patientId=' + patientId + "&times=" + times + "&receiptNo=" + receiptNo,
  3363. contentType: "application/json;charset=UTF-8",
  3364. dataType: "json",
  3365. headers: {
  3366. 'Accept': 'application/json',
  3367. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  3368. },
  3369. success: function (res) {
  3370. if (res == '401' || res == 401) {
  3371. window.location.href = '/thmz/login/view'
  3372. return;
  3373. }
  3374. if (res.code == 0) {
  3375. $("#mzblModal").modal("hide");
  3376. clearMztcbl();
  3377. if(fpVsesionNo == 0){
  3378. prn1Print(patientId, times, false, res.receiptNo);
  3379. }else {
  3380. printDzfp(patientId, times,res.receiptNo,0)
  3381. }
  3382. } else {
  3383. errorMesage(res);
  3384. }
  3385. },
  3386. error: function (XMLHttpRequest, textStatus, errorThrown) {
  3387. }
  3388. });
  3389. }
  3390. /**
  3391. * 清空门诊统筹补录
  3392. */
  3393. function clearMztcbl() {
  3394. $("#changedTotalAmount").val(null);
  3395. $("#ybjzAmount").val(null);
  3396. $("#accAmount").val(null);
  3397. $("#needRefundAmount").val(null);
  3398. $("#mzblPatientId").val(null);
  3399. $("#mzblTimes").val(null);
  3400. $("#mzblReceiptNo").val(null);
  3401. }
  3402. /**
  3403. * 刷卡/扫码,正常收费的的接口
  3404. */
  3405. function consume() {
  3406. $("#consume").attr("disabled", true);
  3407. $("#saveConfirmFee").attr("disabled", true);
  3408. var current = $("#payForm").find("div.pay-item").last();
  3409. var patientId = $("#patientIdHaveTally").val();
  3410. var times = $("#timesHaveTally").val();
  3411. var chequeType = $(current).find("select").val();
  3412. var amt = parseFloat($(current).find("input.money").val());
  3413. $.ajax({
  3414. type: "POST",
  3415. url: '/thmz/consume',
  3416. contentType: "application/json;charset=UTF-8",
  3417. dataType: "json",
  3418. data: JSON.stringify({
  3419. "patientId": patientId,
  3420. "times": times,
  3421. "chequeType": chequeType,
  3422. "amt": amt,
  3423. "type": 0
  3424. }),
  3425. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3426. success: function (res) {
  3427. if (res == '401' || res == 401) {
  3428. window.location.href = '/thmz/login/view'
  3429. return;
  3430. }
  3431. if (res.code == 0) {
  3432. successMesage(res);
  3433. $(current).find("input.refNo").val(res.data.refNo);
  3434. $(current).find("input.transDate").val(res.data.transDate);
  3435. $(current).find("input.payChannel").val(res.data.payChannel);
  3436. $(current).find("input.qrCodeParam").val(res.data.wxAliPayOrderNo);
  3437. $(current).find("input.traceNo").val(res.data.traceNo);
  3438. } else {
  3439. errorMesage(res);
  3440. }
  3441. $("#saveConfirmFee").attr("disabled", false);
  3442. $("#consume").attr("disabled", false);
  3443. }
  3444. });
  3445. }
  3446. /**
  3447. * 查看缴费方式列表
  3448. * @param patientId
  3449. * @param times
  3450. * @param receiptNo
  3451. */
  3452. function depositFileList(patientId, times, receiptNo) {
  3453. var payMarkGroup = getIndex("pay_mark_group");
  3454. var payMark = 0;
  3455. if (payMarkGroup == 2) {
  3456. payMark = 1;
  3457. }
  3458. $("#depositFileListModal").modal();
  3459. $('#deposit_fileList_table').bootstrapTable("destroy");
  3460. $('#deposit_fileList_table').bootstrapTable({
  3461. url: '/thmz/getMzDepositFileList', //请求后台的URL(*)
  3462. method: 'post', //请求方式(*)
  3463. toolbar: '#toolbar', //工具按钮用哪个容器
  3464. striped: true, //是否显示行间隔色
  3465. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  3466. pagination: true, //是否显示分页(*)
  3467. sortable: true, //是否启用排序
  3468. sortOrder: "asc", //排序方式
  3469. queryParams: {"patientId": patientId, "times": times, "receiptNo": Math.abs(receiptNo), "payMark": payMark}, //传递参数(*)
  3470. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  3471. pageNumber: 1, //初始化加载第一页,默认第一页
  3472. pageSize: 5, //每页的记录行数(*)
  3473. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  3474. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  3475. strictSearch: true,
  3476. showColumns: false, //是否显示所有的列
  3477. showRefresh: false, //是否显示刷新按钮
  3478. minimumCountColumns: 2, //最少允许的列数
  3479. clickToSelect: true, //是否启用点击选中行
  3480. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  3481. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  3482. cardView: false, //是否显示详细视图
  3483. detailView: false,
  3484. //rowStyle:rowStyle,//通过自定义函数设置行样式
  3485. ajaxOptions: {
  3486. headers: {
  3487. 'Accept': 'application/json',
  3488. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  3489. }
  3490. },
  3491. columns: [
  3492. {
  3493. field: 'patientId',
  3494. title: '患者编号',
  3495. align: "center",
  3496. valign: 'middle',
  3497. }, {
  3498. field: 'times',
  3499. title: '就诊次数',
  3500. align: "center",
  3501. valign: 'middle',
  3502. }, {
  3503. field: 'receiptNo',
  3504. title: '结算次数',
  3505. align: "center",
  3506. valign: 'middle',
  3507. formatter: function (value, row, index) {
  3508. return Math.abs(value);
  3509. }
  3510. }, {
  3511. field: 'chequeType',
  3512. title: '支付方式',
  3513. align: "center",
  3514. valign: 'middle'
  3515. }, {
  3516. field: 'amount',
  3517. title: '金额(元)',
  3518. align: "center",
  3519. valign: 'middle',
  3520. formatter: function (value, row, index) {
  3521. return Math.abs(value).toFixed(2);
  3522. }
  3523. }, {
  3524. title: '操作',
  3525. align: "center",
  3526. valign: 'middle',
  3527. // sortable: true,
  3528. formatter: function (value, row, index) {
  3529. if (payMarkGroup == 0) {
  3530. return '';
  3531. }
  3532. var html = '';
  3533. if (payMarkGroup > 0) {
  3534. if ((row.chequeType == '银联卡' || row.chequeType == '聚合支付') && row.psordnum != null && row.psordnum != "" && row.psordnum != "null") {
  3535. 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>';
  3536. }
  3537. }
  3538. return html;
  3539. }
  3540. }
  3541. ],
  3542. responseHandler: function (res) {
  3543. if (res == '401' || res == 401) {
  3544. window.location.href = '/thmz/login/view'
  3545. return;
  3546. }
  3547. var ress = eval(res);
  3548. if (ress.code == -1) {
  3549. if (ress.message != null && ress.message != '') {
  3550. errorMesage(ress);
  3551. }
  3552. return {
  3553. "total": 0,//总页数
  3554. "rows": {} //数据
  3555. };
  3556. }
  3557. return {
  3558. "total": ress.data.length,//总页数
  3559. "rows": ress.data //数据
  3560. };
  3561. },
  3562. });
  3563. }
  3564. /**
  3565. * 创建退款条形码
  3566. * @param chequeType
  3567. * @param psordnum
  3568. * @param agtordnum
  3569. * @param parChannel
  3570. * @param traceNo
  3571. * @param patientId
  3572. * @param times
  3573. * @param amount
  3574. * @param transDate
  3575. */
  3576. function createBarcode(chequeType, psordnum, agtordnum, parChannel, traceNo, patientId, times, amount, transDate) {
  3577. var payMarkGroup = getIndex("pay_mark_group");
  3578. $("#depositFileListModal").modal('hide');
  3579. $("#parChannel").val('否');
  3580. if (traceNo == null || traceNo == 'null') {
  3581. traceNo = '';
  3582. }
  3583. $("#traceNo").val(traceNo);
  3584. $("#transDate").val(transDate);
  3585. amount = amount.replace("-", "");
  3586. if (chequeType == "银联卡") {
  3587. if (psordnum != null && psordnum != "" && psordnum != "null") {
  3588. if (payMarkGroup == 1) {
  3589. $("#plId").val(patientId + "_" + times + "_3");
  3590. } else {
  3591. $("#plId").val(psordnum + "_" + amount);
  3592. }
  3593. $("#refNo").val(psordnum);
  3594. JsBarcode("#barcode", 'no barcode');
  3595. $("#barcodeModal").modal();
  3596. }
  3597. return;
  3598. }
  3599. if (agtordnum != null && agtordnum != "" && agtordnum != "null") {
  3600. if (payMarkGroup == 1) {
  3601. $("#plId").val(patientId + "_" + times + "_O");
  3602. //此时是未退费状态,不加载可退费的条形码,以免误操作退费
  3603. JsBarcode("#barcode", 'no barcode');
  3604. } else {
  3605. JsBarcode("#barcode", agtordnum);
  3606. $("#plId").val(psordnum + "_" + amount);
  3607. }
  3608. $("#refNo").val(psordnum);
  3609. if (parChannel != null && parChannel == 'DIGITAL_CASH') {
  3610. $("#parChannel").val('是');
  3611. }
  3612. $("#barcodeModal").modal();
  3613. } else {
  3614. $("#messageModal").modal();
  3615. $("#messageContent").html("当前操作的缴费记录支付方式非聚合支付,无法生成对应的支付条形码!");
  3616. return;
  3617. }
  3618. }
  3619. //
  3620. //
  3621. // /**
  3622. // * 签到
  3623. // */
  3624. // function sign() {
  3625. // $.ajax({
  3626. // type: "GET",
  3627. // url: '/thmz/sign',
  3628. // contentType: "application/json;charset=UTF-8",
  3629. // dataType: "json",
  3630. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3631. // success: function (res) {
  3632. // if (res == '401' || res == 401) {
  3633. // window.location.href = '/thmz/login/view'
  3634. // return;
  3635. // }
  3636. // if (res.code == 0) {
  3637. // successMesage(res);
  3638. // } else {
  3639. // errorMesage(res);
  3640. // }
  3641. // }
  3642. // });
  3643. // }
  3644. //
  3645. //
  3646. //
  3647. // /**
  3648. // * 查余
  3649. // */
  3650. // function balance() {
  3651. // $.ajax({
  3652. // type: "GET",
  3653. // url: '/thmz/balance',
  3654. // contentType: "application/json;charset=UTF-8",
  3655. // dataType: "json",
  3656. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3657. // success: function (res) {
  3658. // if (res == '401' || res == 401) {
  3659. // window.location.href = '/thmz/login/view'
  3660. // return;
  3661. // }
  3662. // if (res.code == 0) {
  3663. // successMesage(res);
  3664. // } else {
  3665. // errorMesage(res);
  3666. // }
  3667. // }
  3668. // });
  3669. // }
  3670. //
  3671. // /**
  3672. // * 打开刷卡消费页面
  3673. // */
  3674. // function consumeModal() {
  3675. // $("#toolsModal").modal('hide');
  3676. // $("#consumeModal").modal();
  3677. // }
  3678. //
  3679. // /**
  3680. // * 刷卡/扫码,财务工具调用
  3681. // */
  3682. // function consumeCommon() {
  3683. // var chequeType = $("#consumeChequeType").val();
  3684. // var amt = $("#consumeAmount").val();
  3685. // $.ajax({
  3686. // type: "POST",
  3687. // url: '/thmz/consumeCommon',
  3688. // contentType: "application/json;charset=UTF-8",
  3689. // dataType: "json",
  3690. // data: JSON.stringify({
  3691. // "chequeType": chequeType,
  3692. // "amt": amt
  3693. // }),
  3694. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3695. // success: function (res) {
  3696. // if (res == '401' || res == 401) {
  3697. // window.location.href = '/thmz/login/view'
  3698. // return;
  3699. // }
  3700. // if (res.code == 0) {
  3701. // successMesage(res);
  3702. // } else {
  3703. // errorMesage(res);
  3704. // }
  3705. // }
  3706. // });
  3707. // }
  3708. //
  3709. // /**
  3710. // * 打开退费窗口
  3711. // */
  3712. // function refundModal() {
  3713. // $("#toolsModal").modal('hide');
  3714. // $("#refundModal").modal();
  3715. // }
  3716. //
  3717. // /**
  3718. // * 退费
  3719. // */
  3720. // function refund() {
  3721. // var chequeType = $("#consumeChequeTypeRefund").val();
  3722. // var amt = $("#refundPosAmount").val();
  3723. // var parChannel = $("#parChannelRefund").val();
  3724. // var psordnum = $("#refNoRefund").val();
  3725. // var transDate = $("#transDateRefund").val();
  3726. // var agtordnum = $("#barcodeRefund").val();
  3727. // $.ajax({
  3728. // type: "POST",
  3729. // url: '/thmz/refund',
  3730. // contentType: "application/json;charset=UTF-8",
  3731. // dataType: "json",
  3732. // data: JSON.stringify({
  3733. // "chequeType": chequeType,
  3734. // "amt": amt,
  3735. // "parChannel": parChannel,
  3736. // "psordnum": psordnum,
  3737. // "transDate": transDate,
  3738. // "agtordnum": agtordnum
  3739. // }),
  3740. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3741. // success: function (res) {
  3742. // if (res == '401' || res == 401) {
  3743. // window.location.href = '/thmz/login/view'
  3744. // return;
  3745. // }
  3746. // if (res.code == 0) {
  3747. // successMesage(res);
  3748. // } else {
  3749. // errorMesage(res);
  3750. // }
  3751. // }
  3752. // });
  3753. // }
  3754. //
  3755. // /**
  3756. // * 打开重印窗口
  3757. // */
  3758. // function reprintModal() {
  3759. // $("#toolsModal").modal('hide');
  3760. // $("#reprintModal").modal();
  3761. // }
  3762. //
  3763. //
  3764. // /**
  3765. // * 重印
  3766. // */
  3767. // function reprint() {
  3768. // var traceNoReprint=$("#traceNoReprint").val();
  3769. // $.ajax({
  3770. // type: "GET",
  3771. // url: '/thmz/reprint?traceNo='+traceNoReprint,
  3772. // contentType: "application/json;charset=UTF-8",
  3773. // dataType: "json",
  3774. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3775. // success: function (res) {
  3776. // if (res == '401' || res == 401) {
  3777. // window.location.href = '/thmz/login/view'
  3778. // return;
  3779. // }
  3780. // if (res.code == 0) {
  3781. // successMesage(res);
  3782. // } else {
  3783. // errorMesage(res);
  3784. // }
  3785. // }
  3786. // });
  3787. // }
  3788. //
  3789. // /**
  3790. // * 打开交易查询页面
  3791. // */
  3792. // function queryModal() {
  3793. // $("#toolsModal").modal('hide');
  3794. // $("#queryModal").modal();
  3795. // }
  3796. //
  3797. //
  3798. // /**
  3799. // * 交易查询
  3800. // */
  3801. // function query() {
  3802. // var plId=$("#plIdReprint").val();
  3803. // $.ajax({
  3804. // type: "GET",
  3805. // url: '/thmz/query?plId='+plId,
  3806. // contentType: "application/json;charset=UTF-8",
  3807. // dataType: "json",
  3808. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3809. // success: function (res) {
  3810. // if (res == '401' || res == 401) {
  3811. // window.location.href = '/thmz/login/view'
  3812. // return;
  3813. // }
  3814. // if (res.code == 0) {
  3815. // alert(res.data);
  3816. // successMesage(res);
  3817. // } else {
  3818. // errorMesage(res);
  3819. // }
  3820. // }
  3821. // });
  3822. // }
  3823. //
  3824. //
  3825. // /**
  3826. // * 结算
  3827. // */
  3828. // function settle() {
  3829. // $.ajax({
  3830. // type: "GET",
  3831. // url: '/thmz/settle',
  3832. // contentType: "application/json;charset=UTF-8",
  3833. // dataType: "json",
  3834. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  3835. // success: function (res) {
  3836. // if (res == '401' || res == 401) {
  3837. // window.location.href = '/thmz/login/view'
  3838. // return;
  3839. // }
  3840. // if (res.code == 0) {
  3841. // successMesage(res);
  3842. // } else {
  3843. // errorMesage(res);
  3844. // }
  3845. // }
  3846. // });
  3847. // }
  3848. //
  3849. //
  3850. //
  3851. // /**
  3852. // * 初始化财务工具的收费方式下拉选
  3853. // */
  3854. // function initConsumeChequeType() {
  3855. // var html="<option value='3'>银联卡</option><option value='O'>聚合支付</option>";
  3856. // $("#consumeChequeType").html(html);
  3857. // $('#consumeChequeType').selectpicker('refresh');
  3858. // $("#consumeChequeTypeRefund").html(html);
  3859. // $('#consumeChequeTypeRefund').selectpicker('refresh');
  3860. // $("#parChannelRefund").html("<option value='0'>否</option><option value='1'>是</option>");
  3861. // $('#parChannelRefund').selectpicker('refresh');
  3862. // }
  3863. //
  3864. //
  3865. // /**
  3866. // * 退货方式改变事件
  3867. // */
  3868. // function consumeChequeTypeRefundChange() {
  3869. // var consumeChequeTypeRefund=$("#consumeChequeTypeRefund").val();
  3870. // if(consumeChequeTypeRefund=='3'){
  3871. // $("#barcodeRefundDiv").removeClass("in").addClass("hide");
  3872. // $("#parChannelRefundDiv").removeClass("in").addClass("hide");
  3873. // $("#refNoRefundDiv").removeClass("hide").addClass("in");
  3874. // $("#transDateRefundDiv").removeClass("hide").addClass("in");
  3875. // }else {
  3876. // $("#barcodeRefundDiv").removeClass("hide").addClass("in");
  3877. // $("#parChannelRefundDiv").removeClass("hide").addClass("in");
  3878. // $("#refNoRefundDiv").removeClass("in").addClass("hide");
  3879. // $("#transDateRefundDiv").removeClass("in").addClass("hide");
  3880. // }
  3881. // }