Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

outpatientChargesManagement.vue 192KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558
  1. <template>
  2. <div class="main-contain outpatientChargesManagement">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
  7. <div class="mainLeft">
  8. <!-- <div class="mainCell" style="justify-content: space-between;font-size:14px;">
  9. <p >未收费:<span style="color: red">{{cal_one}}</span>人</p>
  10. <p>已收费:<span style="color: red">{{cal_two}}</span>人</p>
  11. <p>已退费:<span style="color: red">{{cal_three}}</span>人</p>
  12. </div> -->
  13. <div class="mainCell">
  14. <el-radio-group v-model="radio" @change="changeRadio">
  15. <!-- <el-radio :label=1>未收费</el-radio>
  16. <el-radio :label=2>已收费</el-radio>
  17. <el-radio :label=3>已退费</el-radio>
  18. <el-radio :label=4>全部</el-radio> -->
  19. <el-radio :label=1>未收费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_one}}</span>人
  20. </el-radio>
  21. <el-radio :label=2>已收费<span style="color: red;margin-bottom:10px;display: inline-block;">{{cal_two}}</span>人
  22. </el-radio>
  23. <!--<el-radio :label=3>已退费<span-->
  24. <!--style="color: red;margin-bottom:10px;display: inline-block;">{{cal_three}}</span>人-->
  25. <!--</el-radio>-->
  26. <!--<el-radio :label=4>全部</el-radio>-->
  27. </el-radio-group>
  28. </div>
  29. <div class="mainCell" style="margin-bottom:10px;">
  30. <el-input size="small" @keyup.enter.native='searchAction' v-model.trim="search_input"
  31. class="filter-item"/>
  32. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"
  33. @click="searchAction">
  34. 搜索
  35. </el-button>
  36. </div>
  37. <div>
  38. <el-table :data="patientTableData" :height="tableHeight" border style="width: 100%;"
  39. :row-style="{ color: '#303133' }"
  40. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  41. highlight-current-row ref="tab"
  42. @current-change="handleCurrentChange">
  43. <el-table-column align="center" prop="name" label="姓名" wdith='89'>
  44. <template slot-scope="scope">{{scope.row.name}}</template>
  45. </el-table-column>
  46. <el-table-column align="center" prop="name" label="就诊号" width="110">
  47. <template slot-scope="scope">{{ scope.row.number?scope.row.number:''}}
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. </div>
  52. </div>
  53. <div class="mainRight">
  54. <div class="mainCell fixedCell" style="margin-bottom:10px;">
  55. <div v-if="this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10138">
  56. <el-button v-loading="loadingone" size="small"
  57. @click="sz_open(1)"
  58. type="primary">挂号
  59. </el-button>
  60. <!--<el-button-->
  61. <!--size="small" @click="sz_open(8)" type="primary"-->
  62. <!--&gt;预结算-->
  63. <!--</el-button>-->
  64. <!--<el-button-->
  65. <!--v-if="this.order.order_status == 1"-->
  66. <!--size="small" @click="sz_open(7)" type="primary"-->
  67. <!--&gt;撤销明细-->
  68. <!--</el-button>-->
  69. <!--<el-button-->
  70. <!--v-if="(this.hisPatientInfo.id > 0 && this.order.id == 0) || this.order.order_status == 1"-->
  71. <!--size="small"-->
  72. <!--@click="sz_open(3)"-->
  73. <!--type="primary">收费-->
  74. <!--</el-button>-->
  75. <el-button size="small" @click="sz_open(5)" type="primary"
  76. v-if="this.radio == 2 && this.order.order_status == 2"
  77. >
  78. 退费
  79. </el-button>
  80. <el-button size="small" @click="sz_open(10)" type="primary">打印</el-button>
  81. <el-button size="small" @click="sz_open(11)" type="primary"
  82. v-if="this.hisPatientInfo.id > 0 "
  83. >
  84. 退号
  85. </el-button>
  86. </div>
  87. <!--<el-button size="small" @click="sz_open(8)" type="primary"-->
  88. <!--&gt;-->
  89. <!--跨月退费-->
  90. <!--</el-button>-->
  91. <!--<el-button size="small" @click="sz_open(6)" type="primary"-->
  92. <!--v-if="this.order.order_status == 2"-->
  93. <!--&gt;打印-->
  94. <!--</el-button>-->
  95. <!-- <el-button size="small" @click="open(1)" type="primary" style="margin-left:10px;">打印处置单</el-button>
  96. <el-button size="small" @click="open(2)" type="primary">打印治疗单</el-button> -->
  97. <div v-if="this.$store.getters.xt_user.org_id != 9504 && this.$store.getters.xt_user.org_id != 10028 && this.$store.getters.xt_user.org_id != 10138">
  98. <el-button size="small" @click="open(3)" type="primary">打印</el-button>
  99. <el-button v-loading="loadingone" size="small"
  100. @click="open(6)"
  101. type="primary">挂号
  102. </el-button>
  103. <!--<el-button-->
  104. <!--size="small" @click="open(8)" type="primary"-->
  105. <!--&gt;预结算-->
  106. <!--</el-button>-->
  107. <!--<el-button v-loading="loadingtwo"-->
  108. <!--v-if="(this.hisPatientInfo.id > 0 && this.order.id == 0) || this.order.order_status == 1 || this.order.order_status == 3"-->
  109. <!--size="small"-->
  110. <!--@click="open(4)"-->
  111. <!--type="primary">收费-->
  112. <!--</el-button>-->
  113. <el-button size="small" @click="open(5)" type="primary"
  114. v-if="this.radio == 2 && this.hisPatientInfo.id > 0 && this.order.id > 0 && this.order.order_status == 2">
  115. 退费
  116. </el-button>
  117. <el-button v-if="this.radio == 2 && this.order.order_status == 2" size="small"
  118. @click="open(9)" type="primary"
  119. >结算单
  120. </el-button>
  121. <el-button
  122. v-if="this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990"
  123. size="small" @click="open(10)" type="primary"
  124. >退号
  125. </el-button>
  126. <!--<el-button-->
  127. <!--v-if="$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990"-->
  128. <!--size="small" @click="open(11)" type="primary"-->
  129. <!--&gt;撤销明细-->
  130. <!--</el-button>-->
  131. </div>
  132. <!--<el-button size="small" @click="query" type="primary"-->
  133. <!--&gt;查询-->
  134. <!--</el-button>-->
  135. </div>
  136. <div class="mainCenter" v-loading="loading">
  137. <el-tabs class="settlementTabs" v-model="activeName" @tab-click="handleClick">
  138. <el-tab-pane label="日结" name="first">
  139. <div style="display:flex;height:100%;">
  140. <div class="centerLeft">
  141. <div class="tabsBox" v-for="items,index in big_prescriptions" :key="index">
  142. <!--<el-radio v-model="check" label="11" style="margin:10px 0;"-->
  143. <!--v-if="items.med_type == 11">{{'普通门诊处方'}}-->
  144. <!--</el-radio>-->
  145. <!--<el-radio v-model="check" label="12" style="margin:10px 0;"-->
  146. <!--v-if="items.med_type == 12">{{'门诊挂号'}}-->
  147. <!--</el-radio>-->
  148. <!--<el-radio v-model="check" label="13" style="margin:10px 0;"-->
  149. <!--v-if="items.med_type == 13">{{'急诊'}}-->
  150. <!--</el-radio>-->
  151. <!--<el-radio v-model="check" label="14" style="margin:10px 0;"-->
  152. <!--v-if="items.med_type == 14">{{'门诊特殊病'}}-->
  153. <!--</el-radio>-->
  154. <!--<el-radio v-model="check" label="15" style="margin:10px 0;"-->
  155. <!--v-if="items.med_type == 15">{{'门诊统筹'}}-->
  156. <!--</el-radio>-->
  157. <!--<el-radio v-model="check" label="16" style="margin:10px 0;"-->
  158. <!--v-if="items.med_type == 16">{{'门诊慢性病'}}-->
  159. <!--</el-radio>-->
  160. <!--<el-radio v-model="check" label="21" style="margin:10px 0;"-->
  161. <!--v-if="items.med_type == 21">{{'普通住院'}}-->
  162. <!--</el-radio>-->
  163. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  164. @tab-click="tabclickEvent">
  165. <!--<el-radio-group v-model="med_radio">-->
  166. <el-tab-pane
  167. v-for="(item, index) in items.prescriptions"
  168. :key="index"
  169. :label="item.name"
  170. :name="item.name"
  171. >
  172. </el-tab-pane>
  173. <div style="margin-bottom:10px;float: right">
  174. <div v-if="org_id == 9504 || org_id == 10028 || org_id == 10138">
  175. <el-button
  176. v-if="(hisPatientInfo.id > 0 && items.prescriptions[0].order.id == 0) "
  177. size="small"
  178. @click="sz_open(8,items.med_type,items.prescriptions[0].order)"
  179. type="primary"
  180. >预结算
  181. </el-button>
  182. <el-button
  183. v-if="order.order_status == 1"
  184. size="small"
  185. @click="sz_open(7,items.med_type,items.prescriptions[0].order)"
  186. type="primary"
  187. >撤销明细
  188. </el-button>
  189. <el-button
  190. v-if="(hisPatientInfo.id > 0 && items.prescriptions[0].order.id == 0) || items.prescriptions[0].order.order_status == 1"
  191. size="small"
  192. @click="sz_open(3,items.med_type,items.prescriptions[0].order,items.prescriptions)"
  193. type="primary">收费
  194. </el-button>
  195. </div>
  196. <div v-if="org_id != 9504 && org_id != 10028 &&org_id != 10138">
  197. <el-button
  198. v-if="(hisPatientInfo.id > 0 && items.prescriptions[0].order.id == 0) "
  199. size="small"
  200. @click="open(8,items.med_type,items.prescriptions[0].order)"
  201. type="primary"
  202. >预结算
  203. </el-button>
  204. <el-button v-loading="loadingtwo"
  205. v-if="(hisPatientInfo.id > 0 && items.prescriptions[0].order.id == 0) || items.prescriptions[0].order.order_status == 1 || items.prescriptions[0].order.order_status == 3"
  206. size="small"
  207. @click="open(4,items.med_type,items.prescriptions[0].order,items.prescriptions)"
  208. type="primary">收费
  209. </el-button>
  210. <!--<el-button-->
  211. <!--v-if="$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990"-->
  212. <!--size="small" @click="open(11)" type="primary"-->
  213. <!--&gt;撤销明细-->
  214. <!--</el-button>-->
  215. </div>
  216. </div>
  217. <prescription-table ref="prescription_tables"
  218. :prescription="items.curPrescriptions"></prescription-table>
  219. <!--</el-radio-group>-->
  220. </el-tabs>
  221. <div class="costBox">
  222. <span>当前处方总费用:<span style="color:red;">{{items.total}}元</span></span>
  223. <span>总费用:<span style="color:red;">{{ items.curPrescriptions.order.medfee_sumamt ? items.curPrescriptions.order.medfee_sumamt:getTotalFour(items.prescriptions)?getTotalFour(items.prescriptions):'' }}元</span></span>
  224. <span>基金支付:<span style="color:red;">{{ items.curPrescriptions.order.fund_pay_sumamt?items.curPrescriptions.order.fund_pay_sumamt:''}}元</span></span>
  225. <span>个人支付:<span style="color:red;">{{ items.curPrescriptions.order.psn_cash_pay?items.curPrescriptions.order.psn_cash_pay:''}}元</span></span>
  226. <span v-if="items.curPrescriptions.order_status == 1">待结算</span>
  227. <span v-if="items.curPrescriptions.order_status == 2">已结算</span>
  228. <span v-if="items.curPrescriptions.order_status == 3">已退费</span>
  229. </div>
  230. </div>
  231. </div>
  232. <div class="centerRight">
  233. <p class="centerRightTitle" style="padding-top: 10px;" v-if="org_id != 9504 || org_id != 10028 || org_id != 10138">就诊信息</p>
  234. <div v-if="org_id != 9504 || org_id != 10028 || org_id != 10138">
  235. <el-form :model="form" :rules="rules" ref="formValue" label-width="100px">
  236. <!--<el-form-item label="处方类型:" prop="p_type" :validate-event="is_Name">-->
  237. <!--<el-select style="margin-right:5px;width:100px;" v-model="form.p_type"-->
  238. <!--placeholder=""-->
  239. <!--&gt;-->
  240. <!--<el-option-->
  241. <!--v-for="(item,index) in register"-->
  242. <!--:key="index"-->
  243. <!--:label="item.label"-->
  244. <!--:value="item.value">-->
  245. <!--</el-option>-->
  246. <!--</el-select>-->
  247. <!--</el-form-item>-->
  248. <el-form-item label="大病类别:" prop="sick_type" :validate-event="is_Name">
  249. <el-select style="margin-right:5px;width:100px;"
  250. v-model="form.sick_type" placeholder="">
  251. <el-option
  252. v-for="(item,index) in sick"
  253. :key="index"
  254. :label="item.class_name"
  255. :value="item.id">
  256. </el-option>
  257. </el-select>
  258. </el-form-item>
  259. <el-form-item label="诊断:" prop="diagnosis" :validate-event="is_Name">
  260. <el-select style="margin-right:5px;width:100px;"
  261. v-model="form.diagnosis" placeholder="">
  262. <el-option
  263. v-for="(item,index) in diagnoses"
  264. :key="index"
  265. :label="item.class_name"
  266. :value="item.id">
  267. </el-option>
  268. </el-select>
  269. </el-form-item>
  270. </el-form>
  271. </div>
  272. <p class="centerRightTitle">人员信息</p>
  273. <div style="display:flex;justify-content: space-between;line-height:30px;">
  274. <span style="font-size:14px;">人员编码:{{patientInfo.dialysis_no}}</span>
  275. <span style="font-size:14px;">日期:{{record_date}}</span>
  276. </div>
  277. <ul class="basicUl">
  278. <li style="width:50%;">姓名:{{patientInfo.name}}</li>
  279. <li style="width:50%;">性别:{{patientInfo.gender == 1 ? '男' : '女' }}</li>
  280. <li style="width:50%;">年龄:{{patientInfo.age }}</li>
  281. <li style="width:50%;">电话:{{patientInfo.phone}}</li>
  282. <!--<span>过敏病史:</span>-->
  283. <!--<el-autocomplete-->
  284. <!--style="width:100%;"-->
  285. <!--class="inline-input"-->
  286. <!--v-model="sick_history"-->
  287. <!--:fetch-suggestions="querySearch2"-->
  288. <!--placeholder="请输入内容"-->
  289. <!--&gt;</el-autocomplete>-->
  290. <!--<li style="width:100%;">地址:{{patientInfo.home_address}}</li>-->
  291. <!--<li style="width:100%;">过敏史及其他病史:{{info.sick_history}}</li>-->
  292. </ul>
  293. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  294. <div style="display:flex;justify-content: space-between;line-height:30px;">
  295. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number}}</span>
  296. </div>
  297. <ul class="basicUl">
  298. <li style="width:50%;">医生:{{ info.doctor }}</li>
  299. <li style="width:50%;">科室:{{ info.departments }}</li>
  300. <!--<li style="width:100%;">总费用:{{ getTotal() }}</li>-->
  301. <li style="width:100%;">判断结果:{{info.diagnosis}}</li>
  302. <li style="width:100%;">是否有传染病:</li>
  303. <li style="width:100%;">血压:</li>
  304. </ul>
  305. </div>
  306. </div>
  307. </el-tab-pane>
  308. <el-tab-pane label="月结" name="second">
  309. <div style="display:flex;height:100%;">
  310. <div class="centerLeft">
  311. <div class="RP">
  312. Rp
  313. <el-date-picker
  314. v-model="other_start_time"
  315. prefix-icon="el-icon-date"
  316. @change="changeTime"
  317. :editable="false"
  318. style="width: 150px;"
  319. type="date"
  320. :picker-options="pickerOptions"
  321. placeholder="选择开始时间"
  322. align="right"
  323. format="yyyy-MM-dd"
  324. value-format="yyyy-MM-dd">
  325. </el-date-picker>
  326. <span class>-</span>
  327. <el-date-picker
  328. v-model="other_end_time"
  329. prefix-icon="el-icon-date"
  330. @change="changeEndTime"
  331. :editable="false"
  332. style="width: 150px;"
  333. type="date"
  334. placeholder="选择结束时间"
  335. align="right"
  336. format="yyyy-MM-dd"
  337. value-format="yyyy-MM-dd">
  338. </el-date-picker>
  339. </div>
  340. <div class="tabsBox" v-for="items, index in big_month_prescriptions">
  341. <!--<el-radio v-model="month_check" label="11" style="margin:10px 0;"-->
  342. <!--v-if="items.med_type == 11">{{'普通门诊处方'}}-->
  343. <!--</el-radio>-->
  344. <!--<el-radio v-model="month_check" label="12" style="margin:10px 0;"-->
  345. <!--v-if="items.med_type == 12">{{'门诊挂号'}}-->
  346. <!--</el-radio>-->
  347. <!--<el-radio v-model="month_check" label="13" style="margin:10px 0;"-->
  348. <!--v-if="items.med_type == 13">{{'急诊'}}-->
  349. <!--</el-radio>-->
  350. <!--<el-radio v-model="month_check" label="14" style="margin:10px 0;"-->
  351. <!--v-if="items.med_type == 14">{{'门诊特殊病'}}-->
  352. <!--</el-radio>-->
  353. <!--<el-radio v-model="month_check" label="15" style="margin:10px 0;"-->
  354. <!--v-if="items.med_type == 15">{{'门诊统筹'}}-->
  355. <!--</el-radio>-->
  356. <!--<el-radio v-model="month_check" label="16" style="margin:10px 0;"-->
  357. <!--v-if="items.med_type == 16">{{'门诊慢性病'}}-->
  358. <!--</el-radio>-->
  359. <!--<el-radio v-model="month_check" label="21" style="margin:10px 0;"-->
  360. <!--v-if="items.med_type == 21">{{'普通住院'}}-->
  361. <!--</el-radio>-->
  362. <!-- <el-button type="text" class="addTab" @click="addCharges" icon="el-icon-circle-plus">附加收费</el-button> -->
  363. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  364. @tab-click="tabclickEventTwo">
  365. <el-tab-pane
  366. v-for="(item, index) in items.month_prescriptions"
  367. :key="index"
  368. :label="item.name"
  369. :name="item.name">
  370. </el-tab-pane>
  371. <div style="margin-bottom:10px;float: right">
  372. <div v-if="org_id == 9504 || org_id == 10028 || org_id == 10138">
  373. <el-button
  374. v-if="(hisPatientInfo.id > 0 && items.curMonthPrescriptions.order.id == 0) "
  375. size="small"
  376. @click="sz_open(8,items.med_type,items.curMonthPrescriptions.order)"
  377. type="primary"
  378. >预结算
  379. </el-button>
  380. <el-button
  381. v-if="order.order_status == 1"
  382. size="small"
  383. @click="sz_open(7,items.med_type,items.curMonthPrescriptions.order)"
  384. type="primary"
  385. >撤销明细
  386. </el-button>
  387. <el-button
  388. v-if="(hisPatientInfo.id > 0 && items.curMonthPrescriptions.order.id == 0) || items.curMonthPrescriptions.order.order_status == 1"
  389. size="small"
  390. @click="sz_open(3,items.med_type,items.curMonthPrescriptions.order, items.month_prescriptions)"
  391. type="primary">收费
  392. </el-button>
  393. </div>
  394. <div v-if="org_id != 9504 && org_id != 10028 &&org_id != 10138">
  395. <el-button
  396. v-if="(hisPatientInfo.id > 0 && items.curMonthPrescriptions.order.id == 0) "
  397. size="small"
  398. @click="open(8,items.med_type,items.curMonthPrescriptions.order)"
  399. type="primary"
  400. >预结算
  401. </el-button>
  402. <el-button v-loading="loadingtwo"
  403. v-if="(hisPatientInfo.id > 0 && items.curMonthPrescriptions.order.id == 0) || items.curMonthPrescriptions.order.order_status == 1 || items.curMonthPrescriptions.order.order_status == 3"
  404. size="small"
  405. @click="open(4,items.med_type,items.curMonthPrescriptions.order,items.month_prescriptions)"
  406. type="primary">收费
  407. </el-button>
  408. <!--<el-button-->
  409. <!--v-if="$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990"-->
  410. <!--size="small" @click="open(11)" type="primary"-->
  411. <!--&gt;撤销明细-->
  412. <!--</el-button>-->
  413. </div>
  414. </div>
  415. <!--<prescription-table :preTableData='preTableData'></prescription-table>-->
  416. <!--<month-prescription-table ref="prescription_tables"-->
  417. <!--:activeType="activeType" :prescription="curMonthPrescriptions"></month-prescription-table>-->
  418. <charge-month-prescription-table
  419. :prescription="items.curMonthPrescriptions"></charge-month-prescription-table>
  420. <div class="costBox">
  421. <span>当前处方总费用:<span
  422. style="color:red;">{{ items.month_total }}元</span></span>
  423. <span>总费用:<span style="color:red;">{{ items.curMonthPrescriptions.order.medfee_sumamt ? items.curMonthPrescriptions.order.medfee_sumamt:getTotalFour(items.month_prescriptions)?getTotalFour(items.month_prescriptions):'' }}元</span></span>
  424. <span>基金支付:<span style="color:red;">{{ items.curMonthPrescriptions.order.fund_pay_sumamt?items.curMonthPrescriptions.order.fund_pay_sumamt:''}}元</span></span>
  425. <span>个人支付:<span style="color:red;">{{ items.curMonthPrescriptions.order.psn_cash_pay?items.curMonthPrescriptions.order.psn_cash_pay:''}}元</span></span>
  426. <!--<span>{{ state }}</span>-->
  427. </div>
  428. </el-tabs>
  429. </div>
  430. </div>
  431. <div class="centerRight">
  432. <p class="centerRightTitle" style="padding-top: 10px;" v-if="org_id != 0 || org_id != 9504 || org_id != 10028 || org_id != 10138">就诊信息</p>
  433. <div v-if="org_id != 0 || org_id != 9504 || org_id != 10028 || org_id != 10138">
  434. <el-form :model="form" :rules="rules" ref="formValue" label-width="100px">
  435. <!--<el-form-item label="处方类型:" prop="p_type" :validate-event="is_Name">-->
  436. <!--<el-select style="margin-right:5px;width:100px;" v-model="form.p_type"-->
  437. <!--placeholder=""-->
  438. <!--&gt;-->
  439. <!--<el-option-->
  440. <!--v-for="(item,index) in register"-->
  441. <!--:key="index"-->
  442. <!--:label="item.label"-->
  443. <!--:value="item.value">-->
  444. <!--</el-option>-->
  445. <!--</el-select>-->
  446. <!--</el-form-item>-->
  447. <el-form-item label="大病类别:" prop="sick_type" :validate-event="is_Name">
  448. <el-select style="margin-right:5px;width:100px;"
  449. v-model="form.sick_type" placeholder="">
  450. <el-option
  451. v-for="(item,index) in sick"
  452. :key="index"
  453. :label="item.class_name"
  454. :value="item.id">
  455. </el-option>
  456. </el-select>
  457. </el-form-item>
  458. <el-form-item label="诊断:" prop="diagnosis" :validate-event="is_Name">
  459. <el-select style="margin-right:5px;width:100px;"
  460. v-model="form.diagnosis" placeholder="">
  461. <el-option
  462. v-for="(item,index) in diagnoses"
  463. :key="index"
  464. :label="item.class_name"
  465. :value="item.id">
  466. </el-option>
  467. </el-select>
  468. </el-form-item>
  469. </el-form>
  470. </div>
  471. <p class="centerRightTitle">人员信息</p>
  472. <div style="display:flex;justify-content: space-between;line-height:30px;">
  473. <span style="font-size:14px;">人员编码:{{patientInfo.dialysis_no}}</span>
  474. <span style="font-size:14px;">日期:{{record_date}}</span>
  475. </div>
  476. <ul class="basicUl">
  477. <li style="width:50%;">姓名:{{patientInfo.name}}</li>
  478. <li style="width:50%;">性别:{{patientInfo.gender == 1 ? '男' : '女' }}</li>
  479. <li style="width:50%;">年龄:{{patientInfo.age }}</li>
  480. <li style="width:50%;">电话:{{patientInfo.phone}}</li>
  481. <li style="width:100%;">过敏史及其他病史:{{info.sick_history}}</li>
  482. </ul>
  483. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  484. <div style="display:flex;justify-content: space-between;line-height:30px;">
  485. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number}}</span>
  486. </div>
  487. <ul class="basicUl">
  488. <li style="width:50%;">医生:{{ info.doctor }}</li>
  489. <li style="width:50%;">科室:{{ getDepartment(info.departments) }}</li>
  490. <!--<li style="width:100%;" v-if="activeName == 'first'">总费用:{{ getTotal() }}</li>-->
  491. <!--<li style="width:100%;" v-if="activeName == 'second'">总费用:{{ getTotalTwo() }}-->
  492. <!--</li>-->
  493. <li style="width:100%;">判断结果:{{info.diagnosis}}</li>
  494. <!--<li style="width:100%;">是否有传染病:</li>-->
  495. <!--<li style="width:100%;">血压:</li>-->
  496. </ul>
  497. </div>
  498. </div>
  499. </el-tab-pane>
  500. </el-tabs>
  501. </div>
  502. </div>
  503. </div>
  504. <additionalCharges ref='additionalCharges' @click="addCharges"
  505. :addtions_charge="addtions_charge"></additionalCharges>
  506. <register-dialog ref='register' :doctors="doctors" :department="department" :sick="sick" :diagnoses="diagnoses"
  507. v-on:confirm="confirm" v-on:cancel="cancel"></register-dialog>
  508. <register-dialog9504 ref='register9504' :doctors="doctors" :departments="department" :sick="sick"
  509. :diagnoses="diagnoses"
  510. v-on:confirm="registerConfirm" v-on:cancel="registerCancel"></register-dialog9504>
  511. <charge-dialog ref='charge' v-on:confirm="chargeConfirm" v-on:cancel="chargeCancel"></charge-dialog>
  512. <el-dialog
  513. class="centerDialog"
  514. width="900px"
  515. title="打印"
  516. :visible.sync="treatVisible">
  517. <treatPrint :paramsObj='paramsObj'></treatPrint>
  518. </el-dialog>
  519. <el-dialog
  520. class="centerDialog"
  521. width="1200px"
  522. title="打印"
  523. :visible.sync="statementVisible">
  524. <statementPrint ref="print" :paramsObj='orderObj'></statementPrint>
  525. </el-dialog>
  526. <el-dialog
  527. class="centerDialog"
  528. width="1200px"
  529. title="打印"
  530. :visible.sync="newStatementVisible">
  531. <new-statement-print-two :params-obj="newOrderObj"></new-statement-print-two>
  532. <!--<newStatementPrint ref="print" :paramsObj='newOrderObj'></newStatementPrint>-->
  533. </el-dialog>
  534. </div>
  535. </template>
  536. <script>
  537. import axios from 'axios'
  538. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  539. import noCharge from './components/noCharge'
  540. import charged from './components/charged'
  541. import medicalInsuranceRefund from './components/medicalInsuranceRefund'
  542. import prescriptionTable from './components/prescriptionTable'
  543. import additionalCharges from './components/additionalCharges'
  544. import { getPatientInformation, getPatientList } from '@/api/project/project'
  545. import {
  546. getChargeHisPatientInfo,
  547. getChargeHisPatientList,
  548. getDayOrMonthHisPrescription,
  549. getInitData,
  550. getSchedulePatientList,
  551. preSettle,
  552. Refund,
  553. register,
  554. upload
  555. } from '@/api/his/his'
  556. import RegisterDialog from './components/registerDialog'
  557. import treatPrint from './treatPrint'
  558. import statementPrint from './statementPrint'
  559. import ChargeDialog from './components/chargeDialog'
  560. import MonthPrescriptionTable from './components/monthPrescriptionTable'
  561. import ChargeMonthPrescriptionTable from './components/chargeMonthPrescriptionTable'
  562. import NewStatementPrintTwo from './newStatementPrintTwo'
  563. import RegisterDialog9504 from './components/registerDialog9504'
  564. const moment = require('moment')
  565. export default {
  566. components: {
  567. RegisterDialog9504,
  568. NewStatementPrintTwo,
  569. ChargeMonthPrescriptionTable,
  570. MonthPrescriptionTable,
  571. ChargeDialog,
  572. RegisterDialog,
  573. BreadCrumb,
  574. noCharge,
  575. charged,
  576. medicalInsuranceRefund,
  577. prescriptionTable,
  578. additionalCharges,
  579. treatPrint,
  580. statementPrint
  581. },
  582. data() {
  583. return {
  584. form: {
  585. p_type: '',
  586. sick_type: '',
  587. diagnosis: '',
  588. medical_care: ''
  589. },
  590. current_med_type: '',
  591. rules: {
  592. sick_type: [{ required: true, message: '大病类别不能为空', trigger: 'change' }],
  593. diagnosis: [{ required: true, message: '诊断不能为空', trigger: 'change' }]
  594. },
  595. medical_care: [
  596. { value: 11, label: '普通门诊' },
  597. { value: 12, label: '家庭通道' },
  598. { value: 13, label: '门诊大病' },
  599. { value: 14, label: '重疾特药' },
  600. { value: 15, label: '门诊慢病' },
  601. { value: 16, label: '门诊特检' },
  602. { value: 17, label: '健康体检' },
  603. { value: 18, label: '预防接种' },
  604. { value: 19, label: '门诊输血' },
  605. { value: 91, label: '新冠肺炎门诊' }
  606. ],
  607. register: [
  608. { value: 11, label: '普通门诊' },
  609. { value: 12, label: '门诊挂号' },
  610. { value: 13, label: '急诊' },
  611. { value: 14, label: '门诊特殊病' },
  612. { value: 15, label: '门诊统筹' },
  613. { value: 16, label: '门诊慢性病' },
  614. { value: 21, label: '普通住院' }
  615. ],
  616. loading: false,
  617. dise_loading: false,
  618. org_id: this.$store.getters.xt_user.org_id,
  619. sick_history: '',
  620. p_type: '',
  621. sick_type: '',
  622. diagnosis: '',
  623. month_check: '',
  624. month_p_type: '',
  625. month_sick_type: '',
  626. month_diagnosis: '',
  627. key: '',
  628. other_start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  629. other_end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  630. curMonthPrescriptions: null,
  631. big_month_prescriptions: [],
  632. month_total: 0,
  633. crumbs: [
  634. { path: false, name: '门诊收费' },
  635. { path: false, name: '门诊收费管理' }
  636. ],
  637. current_index: 0,
  638. cal_one: '',
  639. cal_two: '',
  640. cal_three: '',
  641. tableHeight: '',
  642. fullHeight: document.documentElement.clientHeight,
  643. activeName: 'first',
  644. info: {},
  645. curPrescriptions: {},
  646. prescriptions: [],
  647. big_prescriptions: [],
  648. check: 11,
  649. month_prescriptions: [],
  650. med_radio: '',
  651. record_date: '',
  652. tableData: [],
  653. editableTabsValue: '处方1',
  654. loadingone: false,
  655. editableTabs: [{
  656. title: '处方1',
  657. name: '1'
  658. }],
  659. tabIndex: 1,
  660. hisPatientInfo: {},
  661. loadingtwo: false,
  662. patientTableData: [{
  663. name: '杨美英',
  664. mdtrt_id: '1709946'
  665. }],
  666. patientInfo: { id: 0 },
  667. doctor: {},
  668. total: 0,
  669. state: '未收费',
  670. radio: 1,
  671. radioStatus: 1,
  672. search_input: '',
  673. start_time: moment().locale('zh-cn').format('YYYY-MM-DD'),
  674. patient_id: 0,
  675. prescription_id: 0,
  676. all_table_data: [],
  677. hisPatientDatas: [],
  678. order: {},
  679. currentOrder: {},
  680. addtions_charge: [],
  681. treatVisible: false,
  682. orderObj: {},
  683. paramsObj: {},
  684. newOrderObj: {},
  685. statementVisible: false,
  686. newStatementVisible: false,
  687. sick: [],
  688. diagnoses: [],
  689. department: []
  690. }
  691. },
  692. created() {
  693. let tableHeight = document.body.clientHeight - 243
  694. this.tableHeight = tableHeight
  695. var nowDate = new Date()
  696. var nowYear = nowDate.getFullYear()
  697. var nowMonth = nowDate.getMonth() + 1
  698. var nowDay = nowDate.getDate()
  699. this.record_date =
  700. nowYear +
  701. '-' +
  702. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  703. '-' +
  704. (nowDay < 10 ? '0' + nowDay : nowDay)
  705. this.getInitData()
  706. //获取患者信息
  707. this.getPatientList()
  708. },
  709. methods: {
  710. query() {
  711. if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  712. var that = this
  713. axios.get('http://127.0.0.1:9532/api/org/info', {
  714. params: {}
  715. })
  716. .then(function(response) {
  717. if (response.data.state == 0) {
  718. that.$message.error(response.data.msg)
  719. return false
  720. } else {
  721. }
  722. })
  723. .catch(function(error) {
  724. })
  725. }
  726. },
  727. getDepartment(department_id) {
  728. for (let i = 0; i < this.department.length; i++) {
  729. if (this.department[i].id == department_id) {
  730. return this.department[i].name
  731. }
  732. }
  733. },
  734. querySearch2(queryString, cb) {
  735. var restaurants = this.other_sick
  736. restaurants.map(item => {
  737. item.value = item.name
  738. })
  739. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  740. // 调用 callback 返回建议列表的数据
  741. cb(results)
  742. },
  743. changeTime(val) {
  744. let params = {
  745. patient_id: this.patientInfo.id,
  746. start_time: val,
  747. end_time: this.other_end_time,
  748. p_type: 2,
  749. type: this.radio
  750. }
  751. getDayOrMonthHisPrescription(params).then(response => {
  752. if (response.data.state == 1) {
  753. this.month_prescriptions = []
  754. this.setMonthPrescription(response.data.data.day_prescription)
  755. this.curMonthPrescriptions = this.month_prescriptions[0]
  756. } else {
  757. this.$message.error(response.data.msg)
  758. }
  759. })
  760. }, changeEndTime(val) {
  761. let params = {
  762. patient_id: this.patientInfo.id,
  763. start_time: this.other_start_time,
  764. end_time: val,
  765. p_type: 2
  766. }
  767. getDayOrMonthHisPrescription(params).then(response => {
  768. if (response.data.state == 1) {
  769. this.month_prescriptions = []
  770. this.setMonthPrescription(response.data.data.day_prescription)
  771. this.curMonthPrescriptions = this.month_prescriptions[0]
  772. } else {
  773. this.$message.error(response.data.msg)
  774. }
  775. })
  776. }, chargeConfirm(form) {
  777. form['id'] = this.patientInfo.id
  778. form['his_patient_id'] = this.hisPatientInfo.id
  779. form['record_time'] = this.record_date
  780. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  781. form['order_id'] = this.currentOrder.id
  782. form['org_id'] = this.$store.getters.xt_user.org_id
  783. form['p_type'] = this.current_med_type
  784. form['diagnosis'] = this.form.diagnosis
  785. form['sick_type'] = this.form.sick_type
  786. if (this.activeName == 'first') {
  787. form['settle_accounts_type'] = 1
  788. } else {
  789. form['start_time'] = this.other_start_time
  790. form['end_time'] = this.other_end_time
  791. form['settle_accounts_type'] = 2
  792. }
  793. if (this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10138) {
  794. var that = this
  795. axios.get('http://127.0.0.1:9532/sz/api/settle/get', {
  796. params: form
  797. })
  798. .then(function(response) {
  799. if (response.data.state == 0) {
  800. that.$message.error(response.data.msg)
  801. that.$refs.charge.hide()
  802. return false
  803. } else {
  804. if (response.data.data.failed_code == -10) {
  805. that.$confirm(response.data.data.msg, '医保错误信息', {
  806. confirmButtonText: '确 定',
  807. type: 'warning'
  808. }).then(() => {
  809. }).catch(() => {
  810. })
  811. } else {
  812. that.changeRadioAndPatient(2)
  813. that.radio = 2
  814. that.$refs.charge.hide()
  815. that.state = '已收费'
  816. that.$message({ message: '收费成功', type: 'success' })
  817. that.loadingtwo = false
  818. that.cal_one = this.cal_one - 1
  819. that.cal_two = this.cal_two + 1
  820. that.patientTableData.splice(this.current_index, 1)
  821. }
  822. }
  823. })
  824. .catch(function(error) {
  825. })
  826. } else if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  827. var that = this
  828. axios.get('http://127.0.0.1:9532/api/upload/get', {
  829. params: form,
  830. headers: {
  831. 'Permission': 5
  832. }
  833. })
  834. .then(function(response) {
  835. if (response.data.state == 0) {
  836. that.$message.error(response.data.msg)
  837. that.loadingtwo = false
  838. that.$refs.charge.hide()
  839. return false
  840. } else {
  841. if (response.data.data.failed_code == -10) {
  842. that.$confirm(response.data.data.msg, '医保错误信息', {
  843. confirmButtonText: '确 定',
  844. type: 'warning'
  845. }).then(() => {
  846. }).catch(() => {
  847. })
  848. } else {
  849. that.changeRadioAndPatient(2)
  850. that.radio = 2
  851. that.$refs.charge.hide()
  852. that.loadingtwo = false
  853. that.state = '已收费'
  854. that.$message({ message: '收费成功', type: 'success', duration: 5000 })
  855. that.loadingtwo = false
  856. that.cal_one = this.cal_one - 1
  857. that.cal_two = this.cal_two + 1
  858. that.patientTableData.splice(this.current_index, 1)
  859. }
  860. }
  861. })
  862. .catch(function(error) {
  863. })
  864. } else {
  865. upload(form).then(response => {
  866. if (response.data.state == 0) {
  867. this.$message.error(response.data.msg)
  868. this.loadingtwo = false
  869. this.$refs.charge.hide()
  870. return false
  871. } else {
  872. this.$refs.charge.hide()
  873. this.radio = 2
  874. this.changeRadioAndPatient(2)
  875. this.loadingtwo = false
  876. this.state = '已收费'
  877. this.$message({ message: '收费成功', type: 'success' })
  878. this.$refs.charge.hide()
  879. this.loadingtwo = false
  880. }
  881. })
  882. }
  883. }, chargeCancel() {
  884. this.$refs.charge.hide()
  885. }, registerCancel() {
  886. this.$refs.register9504.hide()
  887. }, registerConfirm(forms) {
  888. forms['record_time'] = this.record_date
  889. forms['admin_user_id'] = this.$store.getters.xt_user.user.id
  890. forms['org_id'] = this.$store.getters.xt_user.org_id
  891. this.loadingone = true
  892. var that = this
  893. if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10138) {
  894. axios.get('http://127.0.0.1:9532/sz/api/register/get', {
  895. params: forms,
  896. headers: {
  897. 'Permission': 5
  898. }
  899. })
  900. .then(function(response) {
  901. if (response.data.state == 0) {
  902. that.$message.error(response.data.msg)
  903. that.loadingone = false
  904. that.$refs.register9504.hide()
  905. return false
  906. } else {
  907. if (response.data.data.failed_code == -10) {
  908. that.$confirm(response.data.data.msg, '医保错误信息', {
  909. confirmButtonText: '确 定',
  910. type: 'warning'
  911. }).then(() => {
  912. }).catch(() => {
  913. })
  914. } else {
  915. that.changeRadio(1)
  916. that.$refs.register9504.hide()
  917. that.$message({ message: '挂号成功', type: 'success' })
  918. // let params = {
  919. // 'record_date': that.record_date
  920. // }
  921. // getChargeHisPatientList(params).then(response => {
  922. // if (response.data.state == 0) {
  923. // that.$message.error(response.data.msg)
  924. // return false
  925. // } else {
  926. // that.loadingone = false
  927. // that.patientTableData = []
  928. // that.all_table_data = []
  929. // that.hisPatientDatas = []
  930. // let one_count = 0
  931. // let two_count = 0
  932. // let three_count = 0
  933. // for (let i = 0; i < response.data.data.list.length; i++) {
  934. // if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  935. // if (response.data.data.list[i].prescription.length > 0) {
  936. // let obj = {
  937. // id: response.data.data.list[i].id,
  938. // name: response.data.data.list[i].name,
  939. // number: '',
  940. // order_status: 0,
  941. // order_number: '',
  942. // his_patient_id: 0
  943. // }
  944. //
  945. // that.all_table_data.push(obj)
  946. // }
  947. //
  948. // } else { //挂号
  949. // if (response.data.data.list[i].his_patient.length == 1) {
  950. // let obj = {
  951. // id: response.data.data.list[i].id,
  952. // name: response.data.data.list[i].name,
  953. // number: response.data.data.list[i].his_patient[0].number,
  954. // order_status: response.data.data.list[i].his_patient[0].order.order_status,
  955. // his_patient_id: response.data.data.list[i].his_patient[0].id,
  956. // order_number: response.data.data.list[i].his_patient[0].order.number,
  957. // order_id: response.data.data.list[i].his_patient[0].order.id
  958. // }
  959. // that.all_table_data.push(obj)
  960. //
  961. // }
  962. //
  963. // if (response.data.data.list[i].his_patient.length > 1) {
  964. // for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  965. // let obj = {
  966. // id: response.data.data.list[i].id,
  967. // name: response.data.data.list[i].name,
  968. // number: response.data.data.list[i].his_patient[b].number,
  969. // order_status: response.data.data.list[i].his_patient[b].order.order_status,
  970. // his_patient_id: response.data.data.list[i].his_patient[b].id,
  971. // order_number: response.data.data.list[i].his_patient[b].order.number,
  972. // order_id: response.data.data.list[i].his_patient[b].order.id
  973. // }
  974. // that.all_table_data.push(obj)
  975. //
  976. // }
  977. // }
  978. // }
  979. //
  980. // }
  981. //
  982. // for (let i = 0; i < that.all_table_data.length; i++) {
  983. // if (that.all_table_data[i].his_patient_id > 0) {
  984. // that.hisPatientDatas.push(that.all_table_data[i])
  985. // }
  986. // }
  987. //
  988. // for (let i = 0; i < that.all_table_data.length; i++) {
  989. //
  990. // if (that.all_table_data[i].order_status == 0 || that.all_table_data[i].order_status == 1 || that.all_table_data[i].order_status == 3) {
  991. // one_count = one_count + 1
  992. // that.patientTableData.push(that.all_table_data[i])
  993. // }
  994. // if (that.all_table_data[i].order_status == 2) {
  995. // two_count = two_count + 1
  996. // that.patientTableData.push(that.all_table_data[i])
  997. // }
  998. // }
  999. // that.cal_one = one_count
  1000. // that.cal_two = two_count
  1001. // that.cal_three = three_count
  1002. // that.current_index = 0
  1003. //
  1004. // for (let i = 0; i < that.patientTableData.length; i++) {
  1005. // if (that.patientTableData[i].his_patient_id == that.hisPatientInfo.id) {
  1006. // that.$refs.tab.setCurrentRow(that.patientTableData[i])
  1007. // that.getPatientInformation(that.patientTableData[i].id, that.patientTableData[i].order.number, that.patientTableData[i].his_patient_id)
  1008. // }
  1009. // }
  1010. // that.loadingone = false
  1011. // var his_info = response.data.data.his_info
  1012. // that.hisPatientInfo = his_info
  1013. // }
  1014. // })
  1015. }
  1016. }
  1017. })
  1018. .catch(function(error) {
  1019. })
  1020. }
  1021. },
  1022. confirm(forms) {
  1023. forms['record_time'] = this.record_date
  1024. forms['admin_user_id'] = this.$store.getters.xt_user.user.id
  1025. forms['org_id'] = this.$store.getters.xt_user.org_id
  1026. this.loadingone = true
  1027. var that = this
  1028. if (this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10138) {
  1029. axios.get('http://127.0.0.1:9532/sz/api/register/get', {
  1030. params: forms,
  1031. headers: {
  1032. 'Permission': 5
  1033. }
  1034. })
  1035. .then(function(response) {
  1036. if (response.data.state == 0) {
  1037. that.$message.error(response.data.msg)
  1038. that.loadingone = false
  1039. that.$refs.register.hide()
  1040. return false
  1041. } else {
  1042. if (response.data.data.failed_code == -10) {
  1043. // that.$message.error(response.data.data.msg);
  1044. that.$confirm(response.data.data.msg, '医保错误信息', {
  1045. confirmButtonText: '确 定',
  1046. type: 'warning'
  1047. }).then(() => {
  1048. }).catch(() => {
  1049. })
  1050. } else {
  1051. that.$refs.register.hide()
  1052. let params = {
  1053. 'record_date': that.record_date
  1054. }
  1055. getChargeHisPatientList(params).then(response => {
  1056. if (response.data.state == 0) {
  1057. that.$message.error(response.data.msg)
  1058. return false
  1059. } else {
  1060. that.changeRadio(1)
  1061. that.loadingone = false
  1062. //
  1063. // that.patientTableData = []
  1064. // that.all_table_data = []
  1065. // that.hisPatientDatas = []
  1066. // let one_count = 0
  1067. // let two_count = 0
  1068. // let three_count = 0
  1069. //
  1070. // for (let i = 0; i < response.data.data.list.length; i++) {
  1071. // if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  1072. // if (response.data.data.list[i].prescription.length > 0) {
  1073. // let obj = {
  1074. // id: response.data.data.list[i].id,
  1075. // name: response.data.data.list[i].name,
  1076. // number: '',
  1077. // order_status: 0,
  1078. // order_number: '',
  1079. // his_patient_id: 0
  1080. // }
  1081. //
  1082. // that.all_table_data.push(obj)
  1083. // }
  1084. //
  1085. // } else { //挂号
  1086. // if (response.data.data.list[i].his_patient.length == 1) {
  1087. // let obj = {
  1088. // id: response.data.data.list[i].id,
  1089. // name: response.data.data.list[i].name,
  1090. // number: response.data.data.list[i].his_patient[0].number,
  1091. // order_status: response.data.data.list[i].his_patient[0].order.order_status,
  1092. // his_patient_id: response.data.data.list[i].his_patient[0].id,
  1093. // order_number: response.data.data.list[i].his_patient[0].order.number,
  1094. // order_id: response.data.data.list[i].his_patient[0].order.id
  1095. // }
  1096. // that.all_table_data.push(obj)
  1097. //
  1098. // }
  1099. //
  1100. // if (response.data.data.list[i].his_patient.length > 1) {
  1101. // for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  1102. // let obj = {
  1103. // id: response.data.data.list[i].id,
  1104. // name: response.data.data.list[i].name,
  1105. // number: response.data.data.list[i].his_patient[b].number,
  1106. // order_status: response.data.data.list[i].his_patient[b].order.order_status,
  1107. // his_patient_id: response.data.data.list[i].his_patient[b].id,
  1108. // order_number: response.data.data.list[i].his_patient[b].order.number,
  1109. // order_id: response.data.data.list[i].his_patient[b].order.id
  1110. // }
  1111. // that.all_table_data.push(obj)
  1112. //
  1113. // }
  1114. // }
  1115. // }
  1116. //
  1117. // }
  1118. //
  1119. // for (let i = 0; i < that.all_table_data.length; i++) {
  1120. // if (that.all_table_data[i].his_patient_id > 0) {
  1121. // that.hisPatientDatas.push(that.all_table_data[i])
  1122. // }
  1123. // }
  1124. //
  1125. // for (let i = 0; i < that.all_table_data.length; i++) {
  1126. // if (that.all_table_data[i].order_status == 0 || that.all_table_data[i].order_status == 1 || that.all_table_data[i].order_status == 3) {
  1127. // one_count = one_count + 1
  1128. // that.patientTableData.push(that.all_table_data[i])
  1129. // }
  1130. // if (that.all_table_data[i].order_status == 2) {
  1131. // two_count = two_count + 1
  1132. // that.patientTableData.push(that.all_table_data[i])
  1133. // }
  1134. // }
  1135. // that.cal_one = one_count
  1136. // that.cal_two = two_count
  1137. // that.cal_three = three_count
  1138. // that.current_index = 0
  1139. //
  1140. // for (let i = 0; i < that.patientTableData.length; i++) {
  1141. // if (that.patientTableData[i].his_patient_id == that.hisPatientInfo.id) {
  1142. // that.$refs.tab.setCurrentRow(that.patientTableData[i])
  1143. // that.getPatientInformation(that.patientTableData[i].id, that.patientTableData[i].order_number, that.patientTableData[i].his_patient_id)
  1144. // }
  1145. // }
  1146. that.$message({ message: '挂号成功', type: 'success' })
  1147. that.loadingone = false
  1148. var his_info = response.data.data.his_info
  1149. that.hisPatientInfo = his_info
  1150. }
  1151. })
  1152. }
  1153. }
  1154. })
  1155. .catch(function(error) {
  1156. })
  1157. } else if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  1158. var that = this
  1159. axios.get('http://127.0.0.1:9532/api/register/get', {
  1160. params: forms,
  1161. headers: {
  1162. 'Permission': 5
  1163. }
  1164. })
  1165. .then(function(response) {
  1166. if (response.data.state == 0) {
  1167. that.$message.error(response.data.msg)
  1168. that.loadingone = false
  1169. that.$refs.register.hide()
  1170. return false
  1171. } else {
  1172. if (response.data.data.failed_code == -10) {
  1173. // that.$message.error(response.data.data.msg);
  1174. that.$confirm(response.data.data.msg, '医保错误信息', {
  1175. confirmButtonText: '确 定',
  1176. type: 'warning'
  1177. }).then(() => {
  1178. }).catch(() => {
  1179. })
  1180. } else {
  1181. that.changeRadio(1)
  1182. that.$message({ message: '挂号成功', type: 'success', duration: 5000 })
  1183. that.$refs.register.hide()
  1184. that.loadingone = false
  1185. // that.radio = 1
  1186. // that.$refs.register.hide();
  1187. // let params = {
  1188. // 'record_date': that.record_date
  1189. // };
  1190. // getChargeHisPatientList(params).then(response => {
  1191. // if (response.data.state == 0) {
  1192. // that.$message.error(response.data.msg);
  1193. // return false
  1194. // } else {
  1195. //
  1196. // that.loadingone = false;
  1197. // that.$message({ message: '挂号成功', type: 'success' });
  1198. //
  1199. // that.patientTableData = []
  1200. // that.all_table_data = []
  1201. // that.hisPatientDatas = []
  1202. // let one_count = 0
  1203. // let two_count = 0
  1204. // let three_count = 0
  1205. // for (let i = 0; i < response.data.data.list.length; i++) {
  1206. // if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  1207. // if (response.data.data.list[i].prescription.length > 0) {
  1208. // let obj = {
  1209. // id: response.data.data.list[i].id,
  1210. // name: response.data.data.list[i].name,
  1211. // number: '',
  1212. // order_status: 0,
  1213. // order_number: '',
  1214. // his_patient_id: 0
  1215. // }
  1216. //
  1217. // that.all_table_data.push(obj)
  1218. // }
  1219. //
  1220. // } else { //挂号
  1221. // if (response.data.data.list[i].his_patient.length == 1) {
  1222. // let obj = {
  1223. // id: response.data.data.list[i].id,
  1224. // name: response.data.data.list[i].name,
  1225. // number: response.data.data.list[i].his_patient[0].number,
  1226. // order_status: response.data.data.list[i].his_patient[0].order.order_status,
  1227. // his_patient_id: response.data.data.list[i].his_patient[0].id,
  1228. // order_number: response.data.data.list[i].his_patient[0].order.number,
  1229. // order_id: response.data.data.list[i].his_patient[0].order.id
  1230. // }
  1231. // that.all_table_data.push(obj)
  1232. //
  1233. // }
  1234. //
  1235. // if (response.data.data.list[i].his_patient.length > 1) {
  1236. // for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  1237. // let obj = {
  1238. // id: response.data.data.list[i].id,
  1239. // name: response.data.data.list[i].name,
  1240. // number: response.data.data.list[i].his_patient[b].number,
  1241. // order_status: response.data.data.list[i].his_patient[b].order.order_status,
  1242. // his_patient_id: response.data.data.list[i].his_patient[b].id,
  1243. // order_number: response.data.data.list[i].his_patient[b].order.number,
  1244. // order_id: response.data.data.list[i].his_patient[b].order.id
  1245. // }
  1246. // that.all_table_data.push(obj)
  1247. //
  1248. // }
  1249. // }
  1250. // }
  1251. //
  1252. // }
  1253. //
  1254. // for (let i = 0; i < that.all_table_data.length; i++) {
  1255. // if (that.all_table_data[i].his_patient_id > 0) {
  1256. // that.hisPatientDatas.push(this.all_table_data[i])
  1257. // }
  1258. // }
  1259. //
  1260. // for (let i = 0; i < that.all_table_data.length; i++) {
  1261. // if (that.all_table_data[i].order_status == 0 || that.all_table_data[i].order_status == 1 || that.all_table_data[i].order_status == 3) {
  1262. // one_count = one_count + 1
  1263. // that.patientTableData.push(that.all_table_data[i])
  1264. // }
  1265. // if (that.all_table_data[i].order_status == 2) {
  1266. // two_count = two_count + 1
  1267. // that.patientTableData.push(that.all_table_data[i])
  1268. // }
  1269. // }
  1270. // that.cal_one = one_count
  1271. // that.cal_two = two_count
  1272. // that.cal_three = three_count
  1273. // that.current_index = 0
  1274. // for (let i = 0; i < that.patientTableData.length; i++) {
  1275. // if (that.patientTableData[i].his_patient_id == that.hisPatientInfo.id) {
  1276. // that.$refs.tab.setCurrentRow(that.patientTableData[i])
  1277. // that.getPatientInformation(that.patientTableData[i].id, that.patientTableData[i].order_number, that.patientTableData[i].his_patient_id)
  1278. // }
  1279. // }
  1280. // var his_info = response.data.data.his_info
  1281. // that.hisPatientInfo = his_info
  1282. // }
  1283. // })
  1284. }
  1285. }
  1286. })
  1287. .catch(function(error) {
  1288. })
  1289. } else {
  1290. register(forms).then(response => {
  1291. if (response.data.state == 0) {
  1292. this.$message.error(response.data.msg)
  1293. this.loadingone = false
  1294. // this.$refs.register.hide()
  1295. return false
  1296. } else {
  1297. // this.getPatientList()
  1298. this.changeRadio(1)
  1299. this.$message({ message: '挂号成功', type: 'success', duration: 5000 })
  1300. this.$refs.register.hide()
  1301. this.loadingone = false
  1302. }
  1303. })
  1304. }
  1305. }, cancel() {
  1306. this.$refs.register.hide()
  1307. },
  1308. addCharges() {
  1309. this.$refs.additionalCharges.show()
  1310. },
  1311. changeDate(val) {
  1312. if (this.patientInfo.id == 0) {
  1313. this.$message.error('请先选择患者')
  1314. return
  1315. }
  1316. let params = {
  1317. 'record_date': val,
  1318. 'patient_id': this.patientInfo.id,
  1319. 'type': this.radio,
  1320. 'p_type': 2,
  1321. 'his_patient_id': this.hisPatientInfo.id
  1322. }
  1323. getChargeHisPatientInfo(params).then(response => {
  1324. if (response.data.state == 0) {
  1325. this.$message.error(response.data.msg)
  1326. return false
  1327. } else {
  1328. this.prescriptions = []
  1329. this.month_prescriptions = []
  1330. this.curPrescriptions = {}
  1331. this.month_prescriptions = {}
  1332. this.patientInfo = response.data.data.xt_info
  1333. this.hisPatientInfo = response.data.data.his_info
  1334. this.info = response.data.data.info
  1335. this.order = response.data.data.order
  1336. this.addtions_charge = response.data.data.addtions_charge
  1337. // this.setMonthPrescription(response.data.data.month_prescriptions)
  1338. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1339. var prescription = response.data.data.prescription[i]
  1340. let tempAdvice = []
  1341. let tempProject = []
  1342. for (let b = 0; b < prescription.advices.length; b++) {
  1343. let obj = {
  1344. advice_id: prescription.advices[b].id,
  1345. drug_name: prescription.advices[b].advice_name,
  1346. single_dose: prescription.advices[b].single_dose,
  1347. delivery_way: prescription.advices[b].delivery_way,
  1348. execution_frequency: prescription.advices[b].execution_frequency,
  1349. retail_price: prescription.advices[b].price,
  1350. remark: prescription.advices[b].remark,
  1351. day: prescription.advices[b].day,
  1352. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1353. single_dose_unit: prescription.advices[b].single_dose_unit,
  1354. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1355. medical_insurance_number: prescription.advices[b].med_list_codg
  1356. }
  1357. tempAdvice.push(obj)
  1358. }
  1359. for (let b = 0; b < prescription.project.length; b++) {
  1360. let obj = {
  1361. id: prescription.project[b].id,
  1362. project_id: prescription.project[b].project.id,
  1363. // project_name: prescription.project[b].project.project_name,
  1364. // statistical_classification: prescription.project[b].project.statistical_classification,
  1365. single_dose: prescription.project[b].single_dose,
  1366. delivery_way: prescription.project[b].delivery_way,
  1367. execution_frequency: prescription.project[b].execution_frequency,
  1368. number_days: prescription.project[b].day,
  1369. total: prescription.project[b].count.toString(),
  1370. price: prescription.project[b].price,
  1371. remark: prescription.project[b].remark,
  1372. // medical_code: prescription.project[b].project.medical_code,
  1373. unit: prescription.project[b].unit,
  1374. type: prescription.project[b].type
  1375. }
  1376. if (prescription.project[b].type == 2) {
  1377. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1378. obj['medical_code'] = prescription.project[b].project.medical_code
  1379. obj['project_name'] = prescription.project[b].project.project_name
  1380. } else if (prescription.project[b].type == 3) {
  1381. obj['statistical_classification'] = ''
  1382. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1383. obj['project_name'] = prescription.project[b].good_info.good_name
  1384. }
  1385. tempProject.push(obj)
  1386. }
  1387. let index = i + 1
  1388. let obj = {
  1389. id: prescription.id,
  1390. name: '处方' + index,
  1391. advices: tempAdvice,
  1392. project: tempProject,
  1393. type: prescription.type,
  1394. order_status: prescription.order_status
  1395. }
  1396. this.prescriptions.push(obj)
  1397. }
  1398. this.curPrescriptions = this.prescriptions[0]
  1399. this.total = 0
  1400. this.total = this.getTotalOne()
  1401. this.month_total = 0
  1402. this.month_total = this.getMonthTotalOne()
  1403. }
  1404. })
  1405. },
  1406. getInitData() {
  1407. getInitData().then(response => {
  1408. if (response.data.state == 0) {
  1409. this.$message.error(response.data.msg)
  1410. return false
  1411. } else {
  1412. this.doctors = response.data.data.doctors
  1413. this.department = response.data.data.department
  1414. this.sick = response.data.data.sick
  1415. this.diagnoses = response.data.data.diagnose
  1416. }
  1417. })
  1418. },
  1419. getDayPatientList() {
  1420. let params = {
  1421. 'record_date': this.record_date
  1422. }
  1423. getChargeHisPatientList(params).then(response => {
  1424. if (response.data.state == 0) {
  1425. this.$message.error(response.data.msg)
  1426. return false
  1427. } else {
  1428. this.patientTableData = []
  1429. this.all_table_data = []
  1430. this.hisPatientDatas = []
  1431. let one_count = 0
  1432. let two_count = 0
  1433. let three_count = 0
  1434. for (let i = 0; i < response.data.data.list.length; i++) {
  1435. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  1436. if (response.data.data.list[i].prescription.length > 0) {
  1437. let obj = {
  1438. id: response.data.data.list[i].id,
  1439. name: response.data.data.list[i].name,
  1440. number: '',
  1441. order_status: 0,
  1442. order_number: '',
  1443. his_patient_id: 0,
  1444. prescription: response.data.data.list[i].prescription
  1445. }
  1446. this.all_table_data.push(obj)
  1447. }
  1448. } else { //挂号
  1449. if (response.data.data.list[i].his_patient.length == 1) {
  1450. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  1451. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  1452. let obj = {
  1453. id: response.data.data.list[i].id,
  1454. name: response.data.data.list[i].name,
  1455. number: response.data.data.list[i].his_patient[0].number,
  1456. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  1457. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1458. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  1459. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  1460. prescription: response.data.data.list[i].prescription
  1461. }
  1462. this.all_table_data.push(obj)
  1463. }
  1464. } else {
  1465. let obj = {
  1466. id: response.data.data.list[i].id,
  1467. name: response.data.data.list[i].name,
  1468. number: response.data.data.list[i].his_patient[0].number,
  1469. order_status: 0,
  1470. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1471. order_number: '',
  1472. order_id: 0,
  1473. prescription: response.data.data.list[i].prescription
  1474. }
  1475. this.all_table_data.push(obj)
  1476. }
  1477. }
  1478. if (response.data.data.list[i].his_patient.length > 1) {
  1479. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  1480. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  1481. let obj = {
  1482. id: response.data.data.list[i].id,
  1483. name: response.data.data.list[i].name,
  1484. number: response.data.data.list[i].his_patient[b].number,
  1485. order_status: 1,
  1486. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1487. order_number: '',
  1488. order_id: 0,
  1489. prescription: response.data.data.list[i].prescription
  1490. }
  1491. this.all_table_data.push(obj)
  1492. } else {
  1493. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  1494. let obj = {
  1495. id: response.data.data.list[i].id,
  1496. name: response.data.data.list[i].name,
  1497. number: response.data.data.list[i].his_patient[b].number,
  1498. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  1499. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1500. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  1501. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  1502. prescription: response.data.data.list[i].prescription
  1503. }
  1504. this.all_table_data.push(obj)
  1505. }
  1506. }
  1507. }
  1508. }
  1509. }
  1510. }
  1511. for (let i = 0; i < this.all_table_data.length; i++) {
  1512. if (this.all_table_data[i].his_patient_id > 0) {
  1513. this.hisPatientDatas.push(this.all_table_data[i])
  1514. }
  1515. }
  1516. let unChargePatient = []
  1517. for (let i = 0; i < this.all_table_data.length; i++) {
  1518. let isHasUnCharge = false
  1519. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1520. if (this.all_table_data[i].order_status != 2) {
  1521. isHasUnCharge = true
  1522. } else {
  1523. if (this.all_table_data[i].his_patient_id > 0) {
  1524. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1525. isHasUnCharge = true
  1526. }
  1527. }
  1528. }
  1529. }
  1530. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  1531. isHasUnCharge = true
  1532. }
  1533. if (isHasUnCharge) {
  1534. unChargePatient.push(this.all_table_data[i])
  1535. }
  1536. }
  1537. unChargePatient = this.unique_four(unChargePatient)
  1538. one_count = one_count + unChargePatient.length
  1539. let ChargePatient = []
  1540. for (let i = 0; i < this.all_table_data.length; i++) {
  1541. if (this.all_table_data[i].order_status == 2) {
  1542. ChargePatient.push(this.all_table_data[i])
  1543. }
  1544. }
  1545. two_count = two_count + ChargePatient.length
  1546. if (this.radio == 1) {
  1547. this.all_table_data = this.unique_four(this.all_table_data)
  1548. }
  1549. switch (this.radio) {
  1550. case 1:
  1551. console.log(this.all_table_data)
  1552. this.patientTableData = []
  1553. for (let i = 0; i < this.all_table_data.length; i++) {
  1554. let isHasUnCharge = false
  1555. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1556. if (this.all_table_data[i].order_status != 2) {
  1557. isHasUnCharge = true
  1558. } else {
  1559. if (this.all_table_data[i].his_patient_id > 0) {
  1560. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1561. isHasUnCharge = true
  1562. }
  1563. }
  1564. }
  1565. }
  1566. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  1567. isHasUnCharge = true
  1568. }
  1569. if (isHasUnCharge) {
  1570. this.patientTableData.push(this.all_table_data[i])
  1571. }
  1572. }
  1573. break
  1574. case 2:
  1575. this.patientTableData = []
  1576. for (let i = 0; i < this.all_table_data.length; i++) {
  1577. if (this.all_table_data[i].order_status == 2) {
  1578. this.patientTableData.push(this.all_table_data[i])
  1579. }
  1580. }
  1581. break
  1582. case 4:
  1583. this.patientTableData = []
  1584. this.patientTableData = this.all_table_data
  1585. break
  1586. }
  1587. this.cal_one = one_count
  1588. this.cal_two = two_count
  1589. this.cal_three = three_count
  1590. this.current_index = 0
  1591. if (this.patientTableData.length > 0) {
  1592. for (let i = 0; i < this.patientTableData.length; i++) {
  1593. if (this.patientTableData[i].his_patient_id == this.hisPatientInfo.id) {
  1594. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  1595. this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order_number, this.patientTableData[i].his_patient_id)
  1596. }
  1597. }
  1598. }
  1599. }
  1600. })
  1601. },
  1602. getMonthPatientList() {
  1603. let params = {
  1604. 'record_date': this.record_date
  1605. }
  1606. getChargeHisPatientList(params).then(response => {
  1607. if (response.data.state == 0) {
  1608. this.$message.error(response.data.msg)
  1609. return false
  1610. } else {
  1611. this.patientTableData = []
  1612. this.all_table_data = []
  1613. this.hisPatientDatas = []
  1614. let one_count = 0
  1615. let two_count = 0
  1616. let three_count = 0
  1617. for (let i = 0; i < response.data.data.list.length; i++) {
  1618. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  1619. if (response.data.data.list[i].prescription.length > 0) {
  1620. let obj = {
  1621. id: response.data.data.list[i].id,
  1622. name: response.data.data.list[i].name,
  1623. number: '',
  1624. order_status: 0,
  1625. order_number: '',
  1626. his_patient_id: 0,
  1627. prescription: response.data.data.list[i].prescription
  1628. }
  1629. this.all_table_data.push(obj)
  1630. }
  1631. } else { //挂号
  1632. if (response.data.data.list[i].his_patient.length == 1) {
  1633. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  1634. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  1635. let obj = {
  1636. id: response.data.data.list[i].id,
  1637. name: response.data.data.list[i].name,
  1638. number: response.data.data.list[i].his_patient[0].number,
  1639. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  1640. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1641. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  1642. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  1643. prescription: response.data.data.list[i].prescription
  1644. }
  1645. this.all_table_data.push(obj)
  1646. }
  1647. } else {
  1648. let obj = {
  1649. id: response.data.data.list[i].id,
  1650. name: response.data.data.list[i].name,
  1651. number: response.data.data.list[i].his_patient[0].number,
  1652. order_status: 0,
  1653. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1654. order_number: '',
  1655. order_id: 0,
  1656. prescription: response.data.data.list[i].prescription
  1657. }
  1658. this.all_table_data.push(obj)
  1659. }
  1660. }
  1661. if (response.data.data.list[i].his_patient.length > 1) {
  1662. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  1663. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  1664. let obj = {
  1665. id: response.data.data.list[i].id,
  1666. name: response.data.data.list[i].name,
  1667. number: response.data.data.list[i].his_patient[b].number,
  1668. order_status: 1,
  1669. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1670. order_number: '',
  1671. order_id: 0,
  1672. prescription: response.data.data.list[i].prescription
  1673. }
  1674. this.all_table_data.push(obj)
  1675. } else {
  1676. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  1677. let obj = {
  1678. id: response.data.data.list[i].id,
  1679. name: response.data.data.list[i].name,
  1680. number: response.data.data.list[i].his_patient[b].number,
  1681. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  1682. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1683. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  1684. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  1685. prescription: response.data.data.list[i].prescription
  1686. }
  1687. this.all_table_data.push(obj)
  1688. }
  1689. }
  1690. }
  1691. }
  1692. }
  1693. }
  1694. for (let i = 0; i < this.all_table_data.length; i++) {
  1695. if (this.all_table_data[i].his_patient_id > 0) {
  1696. this.hisPatientDatas.push(this.all_table_data[i])
  1697. }
  1698. }
  1699. let unChargePatient = []
  1700. for (let i = 0; i < this.all_table_data.length; i++) {
  1701. let isHasUnCharge = false
  1702. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1703. if (this.all_table_data[i].order_status != 2) {
  1704. isHasUnCharge = true
  1705. } else {
  1706. if (this.all_table_data[i].his_patient_id > 0) {
  1707. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1708. isHasUnCharge = true
  1709. }
  1710. }
  1711. }
  1712. }
  1713. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  1714. isHasUnCharge = true
  1715. }
  1716. if (isHasUnCharge) {
  1717. unChargePatient.push(this.all_table_data[i])
  1718. }
  1719. }
  1720. unChargePatient = this.unique_four(unChargePatient)
  1721. one_count = one_count + unChargePatient.length
  1722. let ChargePatient = []
  1723. for (let i = 0; i < this.all_table_data.length; i++) {
  1724. if (this.all_table_data[i].order_status == 2) {
  1725. ChargePatient.push(this.all_table_data[i])
  1726. }
  1727. }
  1728. two_count = two_count + ChargePatient.length
  1729. if (this.radio == 1) {
  1730. this.all_table_data = this.unique_four(this.all_table_data)
  1731. }
  1732. switch (this.radio) {
  1733. case 1:
  1734. console.log(this.all_table_data)
  1735. this.patientTableData = []
  1736. for (let i = 0; i < this.all_table_data.length; i++) {
  1737. let isHasUnCharge = false
  1738. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1739. if (this.all_table_data[i].order_status != 2) {
  1740. isHasUnCharge = true
  1741. } else {
  1742. if (this.all_table_data[i].his_patient_id > 0) {
  1743. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1744. isHasUnCharge = true
  1745. }
  1746. }
  1747. }
  1748. }
  1749. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  1750. isHasUnCharge = true
  1751. }
  1752. if (isHasUnCharge) {
  1753. this.patientTableData.push(this.all_table_data[i])
  1754. }
  1755. }
  1756. break
  1757. case 2:
  1758. this.patientTableData = []
  1759. for (let i = 0; i < this.all_table_data.length; i++) {
  1760. if (this.all_table_data[i].order_status == 2) {
  1761. this.patientTableData.push(this.all_table_data[i])
  1762. }
  1763. }
  1764. break
  1765. case 4:
  1766. this.patientTableData = []
  1767. this.patientTableData = this.all_table_data
  1768. break
  1769. }
  1770. this.cal_one = one_count
  1771. this.cal_two = two_count
  1772. this.cal_three = three_count
  1773. this.current_index = 0
  1774. if (this.patientTableData.length > 0) {
  1775. for (let i = 0; i < this.patientTableData.length; i++) {
  1776. if (this.patientTableData[i].his_patient_id == this.hisPatientInfo.id) {
  1777. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  1778. this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order_number, this.patientTableData[i].his_patient_id, this.patientTableData[i].order.id)
  1779. }
  1780. }
  1781. }
  1782. }
  1783. })
  1784. },
  1785. handleClick() {
  1786. if (this.activeName == 'first') {
  1787. // this.patientTableData = this.all_table_data
  1788. this.getPatientList()
  1789. } else if (this.activeName == 'second') {
  1790. this.getMonthPatientList()
  1791. // if (this.patientTableData.length > 0) {
  1792. // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  1793. // this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order.number)
  1794. // }
  1795. }
  1796. },
  1797. searchAction() {
  1798. }, tabclickEventTwo(val) {
  1799. for (let b = 0; b < this.big_month_prescriptions.length; b++) {
  1800. for (let i = 0; i < this.big_month_prescriptions[b].month_prescriptions.length; i++) {
  1801. if (this.big_month_prescriptions[b].month_prescriptions[i].name == val.name) {
  1802. this.big_month_prescriptions[b].curMonthPrescriptions = {}
  1803. var temp = this.deepClone(this.big_month_prescriptions[b].month_prescriptions[i])
  1804. this.big_month_prescriptions[b].curMonthPrescriptions = temp
  1805. this.big_month_prescriptions[b].month_total = this.getMonthTotalTwo(temp)
  1806. }
  1807. }
  1808. }
  1809. // this.prescription_id = this.month_prescriptions.id
  1810. // this.month_total = 0
  1811. },
  1812. tabclickEvent(val) {
  1813. for (let i = 0; i < this.big_prescriptions.length; i++) {
  1814. for (let b = 0; b < this.big_prescriptions[i].prescriptions.length; b++) {
  1815. if (this.big_prescriptions[i].prescriptions[b].name == val.name) {
  1816. var temp = this.deepClone(this.big_prescriptions[i].prescriptions[b])
  1817. this.big_prescriptions[i].curPrescriptions = temp
  1818. // this.prescription_id = this.curPrescriptions.id
  1819. this.big_prescriptions[i].total = 0
  1820. this.big_prescriptions[i].total = this.getTotalThree(this.big_prescriptions[i])
  1821. }
  1822. }
  1823. }
  1824. }, deepClone(source) {
  1825. if (!source && typeof source !== 'object') {
  1826. throw new Error('error arguments', 'shallowClone')
  1827. }
  1828. const targetObj = source.constructor === Array ? [] : {}
  1829. Object.keys(source).forEach((keys) => {
  1830. if (source[keys] && typeof source[keys] === 'object') {
  1831. targetObj[keys] = this.deepClone(source[keys])
  1832. } else {
  1833. targetObj[keys] = source[keys]
  1834. }
  1835. })
  1836. return targetObj
  1837. },
  1838. getTotalOne(big_prescriptions) {
  1839. var total = 0
  1840. if (this.curPrescriptions.type == 1) {
  1841. if (this.curPrescriptions.advices != null) {
  1842. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1843. total = parseFloat(total) + parseFloat(this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number)
  1844. }
  1845. }
  1846. } else {
  1847. if (this.curPrescriptions.project != null) {
  1848. for (let b = 0; b < this.curPrescriptions.project.length; b++) {
  1849. total = parseFloat(total) + parseFloat(this.curPrescriptions.project[b].price * this.curPrescriptions.project[b].total)
  1850. }
  1851. }
  1852. }
  1853. if (this.curPrescriptions.addition != null) {
  1854. for (let b = 0; b < this.curPrescriptions.addition.length; b++) {
  1855. total = parseFloat(total) + parseFloat(this.curPrescriptions.addition[b].price * this.curPrescriptions.addition[b].count)
  1856. }
  1857. }
  1858. return total.toFixed(2)
  1859. },
  1860. getTotalThree(big_prescriptions) {
  1861. var total = 0
  1862. if (big_prescriptions.curPrescriptions.type == 1) {
  1863. if (big_prescriptions.curPrescriptions.advices != null) {
  1864. for (let a = 0; a < big_prescriptions.curPrescriptions.advices.length; a++) {
  1865. total = parseFloat(total) + parseFloat(big_prescriptions.curPrescriptions.advices[a].retail_price * big_prescriptions.curPrescriptions.advices[a].prescribing_number)
  1866. }
  1867. }
  1868. } else {
  1869. if (big_prescriptions.curPrescriptions.project != null) {
  1870. for (let b = 0; b < big_prescriptions.curPrescriptions.project.length; b++) {
  1871. total = parseFloat(total) + parseFloat(big_prescriptions.curPrescriptions.project[b].price * big_prescriptions.curPrescriptions.project[b].total)
  1872. }
  1873. }
  1874. }
  1875. if (big_prescriptions.curPrescriptions.addition != null) {
  1876. for (let b = 0; b < big_prescriptions.curPrescriptions.addition.length; b++) {
  1877. total = parseFloat(total) + parseFloat(big_prescriptions.curPrescriptions.addition[b].price * big_prescriptions.curPrescriptions.addition[b].count)
  1878. }
  1879. }
  1880. return total.toFixed(2)
  1881. },
  1882. getMonthTotalOne() {
  1883. var total = 0
  1884. if (this.curMonthPrescriptions.type == 1) {
  1885. if (this.curMonthPrescriptions.advices != null) {
  1886. for (let a = 0; a < this.curMonthPrescriptions.advices.length; a++) {
  1887. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.advices[a].retail_price * this.curMonthPrescriptions.advices[a].prescribing_number)
  1888. }
  1889. }
  1890. } else {
  1891. if (this.curMonthPrescriptions.project != null) {
  1892. for (let b = 0; b < this.curMonthPrescriptions.project.length; b++) {
  1893. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.project[b].price * this.curMonthPrescriptions.project[b].total)
  1894. }
  1895. }
  1896. }
  1897. if (this.curMonthPrescriptions.addition != null) {
  1898. for (let b = 0; b < this.curMonthPrescriptions.addition.length; b++) {
  1899. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.addition[b].price * this.curMonthPrescriptions.addition[b].count)
  1900. }
  1901. }
  1902. return total.toFixed(2)
  1903. },
  1904. getMonthTotalTwo(month_prescriptions) {
  1905. var total = 0
  1906. if (month_prescriptions.type == 1) {
  1907. if (month_prescriptions.advices != null) {
  1908. for (let a = 0; a < month_prescriptions.advices.length; a++) {
  1909. total = parseFloat(total) + parseFloat(month_prescriptions.advices[a].retail_price * month_prescriptions.advices[a].prescribing_number)
  1910. }
  1911. }
  1912. } else {
  1913. if (month_prescriptions.project != null) {
  1914. for (let b = 0; b < month_prescriptions.project.length; b++) {
  1915. total = parseFloat(total) + parseFloat(month_prescriptions.project[b].price * month_prescriptions.project[b].total)
  1916. }
  1917. }
  1918. }
  1919. if (month_prescriptions.addition != null) {
  1920. for (let b = 0; b < month_prescriptions.addition.length; b++) {
  1921. total = parseFloat(total) + parseFloat(month_prescriptions.addition[b].price * month_prescriptions.addition[b].count)
  1922. }
  1923. }
  1924. return total.toFixed(2)
  1925. },
  1926. getTotal() {
  1927. var total = 0
  1928. for (let c = 0; c < this.big_prescriptions.length; c++) {
  1929. for (let i = 0; i < this.big_prescriptions[c].prescriptions.length; i++) {
  1930. if (this.big_prescriptions[c].prescriptions[i].advices != null) {
  1931. for (let a = 0; a < this.big_prescriptions[c].prescriptions[i].advices.length; a++) {
  1932. total = parseFloat(total) + parseFloat(this.big_prescriptions[c].prescriptions[i].advices[a].retail_price * this.big_prescriptions[c].prescriptions[i].advices[a].prescribing_number)
  1933. }
  1934. }
  1935. if (this.big_prescriptions[c].prescriptions[i].project != null) {
  1936. for (let b = 0; b < this.big_prescriptions[c].prescriptions[i].project.length; b++) {
  1937. total = parseFloat(total) + parseFloat(this.big_prescriptions[c].prescriptions[i].project[b].price * this.big_prescriptions[c].prescriptions[i].project[b].total)
  1938. }
  1939. }
  1940. if (this.big_prescriptions[c].prescriptions[i].addition != null) {
  1941. for (let b = 0; b < this.big_prescriptions[c].prescriptions[i].addition.length; b++) {
  1942. total = parseFloat(total) + parseFloat(this.big_prescriptions[c].prescriptions[i].addition[b].price * this.big_prescriptions[c].prescriptions[i].addition[b].count)
  1943. }
  1944. }
  1945. }
  1946. }
  1947. return total.toFixed(2)
  1948. }, getTotalTwo() {
  1949. var total = 0
  1950. for (let i = 0; i < this.month_prescriptions.length; i++) {
  1951. if (this.month_prescriptions[i].advices != null) {
  1952. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  1953. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number)
  1954. }
  1955. }
  1956. if (this.month_prescriptions[i].project != null) {
  1957. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  1958. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].project[a].price * this.month_prescriptions[i].project[a].total)
  1959. }
  1960. }
  1961. if (this.month_prescriptions[i].addition != null) {
  1962. for (let b = 0; b < this.month_prescriptions[i].addition.length; b++) {
  1963. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].addition[a].price * this.month_prescriptions[i].addition[b].count)
  1964. }
  1965. }
  1966. }
  1967. return total.toFixed(2)
  1968. }, getTotalFour(month_prescriptions) {
  1969. var total = 0
  1970. for (let i = 0; i < month_prescriptions.length; i++) {
  1971. if (month_prescriptions[i].advices != null) {
  1972. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  1973. total = parseFloat(total) + parseFloat(month_prescriptions[i].advices[a].retail_price * month_prescriptions[i].advices[a].prescribing_number)
  1974. }
  1975. }
  1976. if (month_prescriptions[i].project != null) {
  1977. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  1978. total = parseFloat(total) + parseFloat(month_prescriptions[i].project[a].price * month_prescriptions[i].project[a].total)
  1979. }
  1980. }
  1981. if (month_prescriptions[i].addition != null) {
  1982. for (let b = 0; b < month_prescriptions[i].addition.length; b++) {
  1983. total = parseFloat(total) + parseFloat(month_prescriptions[i].addition[a].price * month_prescriptions[i].addition[b].count)
  1984. }
  1985. }
  1986. }
  1987. return total.toFixed(2)
  1988. },
  1989. moreState(tab, event) {
  1990. if (tab == 'more') {
  1991. return false
  1992. }
  1993. },
  1994. open(index, med_type, order, prescriptions) {
  1995. if (index == 1) {
  1996. } else if (index == 2) {
  1997. this.$router.push('/outpatientDoctorStation/printtwo?record=' + this.record_date)
  1998. } else if (index == 3) {
  1999. let obj = {
  2000. record_date: this.record_date,
  2001. patient_id: this.patient_id,
  2002. prescription_id: this.prescription_id,
  2003. order_id: this.order.id
  2004. }
  2005. this.paramsObj = obj
  2006. this.treatVisible = true
  2007. // this.$router.push('/outpatientCharges/treatPrint?record_date=' + this.record_date + '&patient_id=' + this.patient_id + '&prescription_id=' + this.prescription_id)
  2008. } else if (index == 4) {
  2009. this.currentOrder = order
  2010. this.current_med_type = med_type
  2011. if (this.patientInfo.id == 0) {
  2012. this.$message({ message: '该选择要收费的患者', type: 'error' })
  2013. return
  2014. }
  2015. if (this.hisPatientInfo.id == 0) {
  2016. this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
  2017. return
  2018. }
  2019. // let ids = []
  2020. // if (this.activeName == 'first') {
  2021. // for (let c = 0; c < this.big_prescriptions.length; c++) {
  2022. // for (let i = 0; i < this.big_prescriptions[c].prescriptions.length; i++) {
  2023. // for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  2024. // ids.push(this.prescriptions[i].advices[a].id)
  2025. // }
  2026. // for (let a = 0; a < this.prescriptions[i].addition.length; a++) {
  2027. // ids.push(this.prescriptions[i].addition[a].id)
  2028. // }
  2029. //
  2030. // for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  2031. // ids.push(this.prescriptions[i].project[a].id)
  2032. // }
  2033. // }
  2034. // }
  2035. // if (ids.length == 0) {
  2036. // this.$message.error('请先到医生工作站开处方再来结算')
  2037. // return
  2038. // }
  2039. //
  2040. // } else {
  2041. //
  2042. // for (let i = 0; i < this.month_prescriptions.length; i++) {
  2043. // for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  2044. // ids.push(this.month_prescriptions[i].advices[a].id)
  2045. // }
  2046. //
  2047. // for (let a = 0; a < this.month_prescriptions[i].addition.length; a++) {
  2048. // ids.push(this.month_prescriptions[i].addition[a].id)
  2049. // }
  2050. //
  2051. // for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  2052. // ids.push(this.month_prescriptions[i].project[a].id)
  2053. // }
  2054. // }
  2055. // if (ids.length == 0) {
  2056. // this.$message.error('请先到医生工作站开处方再来结算')
  2057. // return
  2058. // }
  2059. // }
  2060. if (this.activeName == 'first') {
  2061. this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  2062. } else {
  2063. this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  2064. }
  2065. } else if (index == 5) {
  2066. if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  2067. var that = this
  2068. this.$confirm('是否退费', '退费', {
  2069. confirmButtonText: '确 定',
  2070. cancelButtonText: '取 消',
  2071. type: 'warning'
  2072. }).then(() => {
  2073. let params = {
  2074. 'order_id': this.order.id,
  2075. 'number': this.order.number,
  2076. 'patient_id': this.patientInfo.id,
  2077. 'record_time': this.record_date,
  2078. 'admin_user_id': this.$store.getters.xt_user.user.id,
  2079. 'org_id': this.$store.getters.xt_user.org_id
  2080. }
  2081. axios.get('http://127.0.0.1:9532/api/refund/post', {
  2082. params: params
  2083. })
  2084. .then(function(response) {
  2085. if (response.data.state == 0) {
  2086. that.$message.error(response.data.msg)
  2087. that.loadingtwo = false
  2088. return false
  2089. } else {
  2090. if (response.data.data.failed_code == -10) {
  2091. // that.$message.error(response.data.data.msg)
  2092. that.$confirm(response.data.data.msg, '医保错误信息', {
  2093. confirmButtonText: '确 定',
  2094. type: 'warning'
  2095. }).then(() => {
  2096. }).catch(() => {
  2097. })
  2098. } else {
  2099. that.changeRadioAndPatient(1)
  2100. that.$message({ message: '退费成功', type: 'success', duration: 5000 })
  2101. that.loadingtwo = false
  2102. }
  2103. }
  2104. })
  2105. .catch(function(error) {
  2106. })
  2107. }).catch(() => {
  2108. })
  2109. } else {
  2110. this.$confirm('是否退费', '退费', {
  2111. confirmButtonText: '确 定',
  2112. cancelButtonText: '取 消',
  2113. type: 'warning'
  2114. }).then(() => {
  2115. let params = {
  2116. 'order_id': this.order.id,
  2117. 'number': this.order.number,
  2118. 'patient_id': this.patientInfo.id,
  2119. 'record_time': this.record_date
  2120. }
  2121. Refund(params).then(response => {
  2122. if (response.data.state == 0) {
  2123. this.$message.error(response.data.msg)
  2124. this.loadingtwo = false
  2125. return false
  2126. } else {
  2127. this.radio = 1
  2128. this.changeRadioAndPatient(1)
  2129. this.$message({ message: '退费成功', type: 'success' })
  2130. this.loadingtwo = false
  2131. }
  2132. })
  2133. }).catch(() => {
  2134. })
  2135. }
  2136. } else if (index == 6) {
  2137. // if (this.patientInfo.id == 0) {
  2138. // this.$message.error('请先选择要挂号的病人')
  2139. // return
  2140. // }
  2141. this.$refs.register.show()
  2142. } else if (index == 7) {
  2143. let params = {
  2144. start_time: '2020-12-28',
  2145. end_time: '2020-12-30',
  2146. insutype: '390',
  2147. clr_type: '11',
  2148. org_id: this.$store.getters.xt_user.org_id
  2149. }
  2150. var that = this
  2151. if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  2152. axios.get('http://127.0.0.1:9532/api/checkaccount/get', {
  2153. params: params
  2154. })
  2155. .then(function(response) {
  2156. if (response.data.state == 0) {
  2157. that.$message.error(response.data.msg)
  2158. // that.loadingtwo = false
  2159. return false
  2160. } else {
  2161. }
  2162. })
  2163. .catch(function(error) {
  2164. })
  2165. }
  2166. } else if (index == 8) {
  2167. if (this.$store.getters.xt_user.org_id != 10028 || this.$store.getters.xt_user.org_id != 9504 || this.$store.getters.xt_user.org_id != 10138) {
  2168. if (this.form.diagnosis.length || this.form.diagnosis == 0) {
  2169. that.$message.error('诊断不能为空,请选择诊断内容')
  2170. return
  2171. }
  2172. if (this.form.sick_type.length || this.form.sick_type == 0) {
  2173. that.$message.error('疾病类型不能为空,请选择疾病类型')
  2174. return
  2175. }
  2176. }
  2177. var that = this
  2178. let form = {}
  2179. form['id'] = this.patientInfo.id
  2180. form['his_patient_id'] = this.hisPatientInfo.id
  2181. form['record_time'] = this.record_date
  2182. form['p_type'] = med_type
  2183. form['diagnosis'] = this.form.diagnosis
  2184. form['sick_type'] = this.form.sick_type
  2185. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  2186. form['org_id'] = this.$store.getters.xt_user.org_id
  2187. if (this.activeName == 'first') {
  2188. form['settle_accounts_type'] = 1
  2189. } else {
  2190. form['start_time'] = this.other_start_time
  2191. form['end_time'] = this.other_end_time
  2192. form['settle_accounts_type'] = 2
  2193. }
  2194. if (that.$store.getters.xt_user.org_id == 12) {
  2195. this.$confirm('是否进行预结算', '预结算', {
  2196. confirmButtonText: '确 定',
  2197. cancelButtonText: '取 消',
  2198. type: 'warning'
  2199. }).then(() => {
  2200. preSettle(form).then(response => {
  2201. if (response.data.state == 0) {
  2202. this.$message.error(response.data.msg)
  2203. this.loadingtwo = false
  2204. return false
  2205. } else {
  2206. this.changeRadioAndPatient(1)
  2207. this.$message({ message: '预结算成功', type: 'success' })
  2208. }
  2209. })
  2210. }).catch(() => {
  2211. })
  2212. } else {
  2213. this.$confirm('是否进行预结算', '预结算', {
  2214. confirmButtonText: '确 定',
  2215. cancelButtonText: '取 消',
  2216. type: 'warning'
  2217. }).then(() => {
  2218. axios.get('http://127.0.0.1:9532/api/presettle/get', {
  2219. params: form,
  2220. headers: {
  2221. 'Permission': 5
  2222. }
  2223. })
  2224. .then(function(response) {
  2225. if (response.data.state == 0) {
  2226. that.$message.error(response.data.msg)
  2227. return false
  2228. } else {
  2229. if (response.data.data.failed_code == -10) {
  2230. that.$confirm(response.data.data.msg, '医保错误信息', {
  2231. confirmButtonText: '确 定',
  2232. type: 'warning'
  2233. }).then(() => {
  2234. }).catch(() => {
  2235. })
  2236. } else {
  2237. that.changeRadioAndPatient(1)
  2238. that.$message({ message: '预结算成功', type: 'success', duration: 5000 })
  2239. }
  2240. }
  2241. })
  2242. .catch(function(error) {
  2243. })
  2244. }).catch(() => {
  2245. })
  2246. }
  2247. } else if (index == 9) {
  2248. this.statementVisible = true
  2249. let obj = {
  2250. order_id: this.order.id,
  2251. settle_type: this.order.settle_type,
  2252. start_time: this.order.settle_start_time,
  2253. end_time: this.order.settle_end_time
  2254. }
  2255. this.orderObj = obj
  2256. // this.$refs.print.getInfo(this.order.id)
  2257. } else if (index == 10) {
  2258. var that = this
  2259. this.$confirm('是否退号', '退号', {
  2260. confirmButtonText: '确 定',
  2261. cancelButtonText: '取 消',
  2262. type: 'warning'
  2263. }).then(() => {
  2264. let params = {
  2265. 'id': this.hisPatientInfo.id,
  2266. 'patient_id': this.patientInfo.id,
  2267. 'record_time': this.record_date,
  2268. 'org_id': this.$store.getters.xt_user.org_id,
  2269. 'admin_user_id': this.$store.getters.xt_user.user.id
  2270. }
  2271. axios.get('http://127.0.0.1:9532/api/refundnumber/post', {
  2272. params: params
  2273. })
  2274. .then(function(response) {
  2275. if (response.data.state == 0) {
  2276. that.$message.error(response.data.msg)
  2277. return false
  2278. } else {
  2279. if (response.data.data.failed_code == -10) {
  2280. // that.$message.error(response.data.data.msg)
  2281. that.$confirm(response.data.data.msg, '医保错误信息', {
  2282. confirmButtonText: '确 定',
  2283. type: 'warning'
  2284. }).then(() => {
  2285. }).catch(() => {
  2286. })
  2287. } else {
  2288. that.radio = 1
  2289. that.changeRadioAndPatient(1)
  2290. that.$message({ message: '退号成功', type: 'success', duration: 5000 })
  2291. }
  2292. }
  2293. })
  2294. .catch(function(error) {
  2295. })
  2296. }).catch(() => {
  2297. })
  2298. } else if (index == 11) {
  2299. let params = {
  2300. 'order_id': this.order.id,
  2301. 'number': this.order.number,
  2302. 'patient_id': this.patientInfo.id,
  2303. 'record_time': this.record_date,
  2304. 'org_id': this.$store.getters.xt_user.org_id
  2305. }
  2306. axios.get('http://127.0.0.1:9532/api/refunddetail/post', {
  2307. params: params
  2308. })
  2309. .then(function(response) {
  2310. if (response.data.state == 0) {
  2311. that.$message.error(response.data.msg)
  2312. that.loadingtwo = false
  2313. return false
  2314. } else {
  2315. // that.$message({ message: '退号成功', type: 'success' })
  2316. that.$message({ message: '退明细成功', type: 'success', duration: 5000 })
  2317. that.loadingtwo = false
  2318. }
  2319. })
  2320. .catch(function(error) {
  2321. })
  2322. } else if (index == 12) {
  2323. let params = {
  2324. 'name': '琥珀酸亚铁片',
  2325. 'codg': 'XB03AAH026A001010104942'
  2326. }
  2327. axios.get('http://127.0.0.1:9532/api/code/get', {
  2328. params: params
  2329. })
  2330. .then(function(response) {
  2331. if (response.data.state == 0) {
  2332. that.$message.error(response.data.msg)
  2333. that.loadingtwo = false
  2334. return false
  2335. } else {
  2336. that.loadingtwo = false
  2337. }
  2338. })
  2339. .catch(function(error) {
  2340. })
  2341. } else if (index == 13) {
  2342. let params = {
  2343. 'id': this.patientInfo.id,
  2344. 'record_time': this.record_date
  2345. }
  2346. axios.get('http://127.0.0.1:9532/api/record/put', {
  2347. params: params
  2348. })
  2349. .then(function(response) {
  2350. if (response.data.state == 0) {
  2351. that.$message.error(response.data.msg)
  2352. that.loadingtwo = false
  2353. return false
  2354. } else {
  2355. that.loadingtwo = false
  2356. }
  2357. })
  2358. .catch(function(error) {
  2359. })
  2360. } else if (index == 15) {
  2361. var that = this
  2362. if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  2363. if (this.diagnosis.length || this.diagnosis == 0) {
  2364. that.$message.error('诊断不能为空,请选择诊断内容')
  2365. return
  2366. }
  2367. if (this.sick_type.length || this.sick_type == 0) {
  2368. that.$message.error('疾病类型不能为空,请选择疾病类型')
  2369. return
  2370. }
  2371. if (this.reg_type.length || this.reg_type == 0) {
  2372. that.$message.error('处方类型不能为空,请选择处方类型')
  2373. return
  2374. }
  2375. let params = {
  2376. 'id': that.patientInfo.id,
  2377. 'record_time': that.record_date,
  2378. 'diagnosis': that.diagnosis,
  2379. 'sick_type': that.sick_type,
  2380. 'reg_type': that.p_type
  2381. }
  2382. this.dise_loading = true
  2383. axios.get('http://127.0.0.1:9532/api/diag/upload', {
  2384. params: params
  2385. })
  2386. .then(function(response) {
  2387. if (response.data.state == 0) {
  2388. that.$message.error(response.data.msg)
  2389. that.dise_loading = false
  2390. return false
  2391. } else {
  2392. that.dise_loading = false
  2393. that.$message.success('上传成功')
  2394. }
  2395. })
  2396. .catch(function(error) {
  2397. })
  2398. }
  2399. } else if (index == 20) {
  2400. if (this.patientInfo.id == 0) {
  2401. this.$message({ message: '该选择要收费的患者', type: 'error' })
  2402. return
  2403. }
  2404. if (this.hisPatientInfo.id == 0) {
  2405. this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
  2406. return
  2407. }
  2408. let ids = []
  2409. if (this.activeName == 'first') {
  2410. for (let i = 0; i < this.prescriptions.length; i++) {
  2411. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  2412. ids.push(this.prescriptions[i].advices[a].id)
  2413. }
  2414. for (let a = 0; a < this.prescriptions[i].addition.length; a++) {
  2415. ids.push(this.prescriptions[i].addition[a].id)
  2416. }
  2417. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  2418. ids.push(this.prescriptions[i].project[a].id)
  2419. }
  2420. }
  2421. if (ids.length == 0) {
  2422. this.$message.error('请先到医生工作站开处方再来结算')
  2423. return
  2424. }
  2425. } else {
  2426. for (let i = 0; i < this.month_prescriptions.length; i++) {
  2427. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  2428. ids.push(this.month_prescriptions[i].advices[a].id)
  2429. }
  2430. for (let a = 0; a < this.month_prescriptions[i].addition.length; a++) {
  2431. ids.push(this.month_prescriptions[i].addition[a].id)
  2432. }
  2433. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  2434. ids.push(this.month_prescriptions[i].project[a].id)
  2435. }
  2436. }
  2437. if (ids.length == 0) {
  2438. this.$message.error('请先到医生工作站开处方再来结算')
  2439. return
  2440. }
  2441. }
  2442. var form = {}
  2443. form['id'] = this.patientInfo.id
  2444. form['record_time'] = this.record_date
  2445. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  2446. form['org_id'] = this.$store.getters.xt_user.org_id
  2447. if (this.activeName == 'first') {
  2448. form['settle_accounts_type'] = 1
  2449. } else {
  2450. form['start_time'] = this.other_start_time
  2451. form['end_time'] = this.other_end_time
  2452. form['settle_accounts_type'] = 2
  2453. }
  2454. this.loadingtwo = true
  2455. if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  2456. var that = this
  2457. axios.get('http://127.0.0.1:9532/api/pre_upload/get', {
  2458. params: form
  2459. })
  2460. .then(function(response) {
  2461. if (response.data.state == 0) {
  2462. that.$message.error(response.data.msg)
  2463. that.loadingtwo = false
  2464. that.$refs.charge.hide()
  2465. return false
  2466. } else {
  2467. that.loadingtwo = false
  2468. that.state = '预结算'
  2469. that.$message({ message: '预结算成功', type: 'success' })
  2470. }
  2471. })
  2472. .catch(function(error) {
  2473. })
  2474. } else {
  2475. }
  2476. } else if (index == 21) {
  2477. if (this.patientInfo.id == 0) {
  2478. this.$message({ message: '该选择要收费的患者', type: 'error' })
  2479. return
  2480. }
  2481. if (this.hisPatientInfo.id == 0) {
  2482. this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
  2483. return
  2484. }
  2485. let ids = []
  2486. if (this.activeName == 'first') {
  2487. for (let i = 0; i < this.prescriptions.length; i++) {
  2488. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  2489. ids.push(this.prescriptions[i].advices[a].id)
  2490. }
  2491. for (let a = 0; a < this.prescriptions[i].addition.length; a++) {
  2492. ids.push(this.prescriptions[i].addition[a].id)
  2493. }
  2494. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  2495. ids.push(this.prescriptions[i].project[a].id)
  2496. }
  2497. }
  2498. if (ids.length == 0) {
  2499. this.$message.error('请先到医生工作站开处方再来结算')
  2500. return
  2501. }
  2502. } else {
  2503. for (let i = 0; i < this.month_prescriptions.length; i++) {
  2504. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  2505. ids.push(this.month_prescriptions[i].advices[a].id)
  2506. }
  2507. for (let a = 0; a < this.month_prescriptions[i].addition.length; a++) {
  2508. ids.push(this.month_prescriptions[i].addition[a].id)
  2509. }
  2510. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  2511. ids.push(this.month_prescriptions[i].project[a].id)
  2512. }
  2513. }
  2514. if (ids.length == 0) {
  2515. this.$message.error('请先到医生工作站开处方再来结算')
  2516. return
  2517. }
  2518. }
  2519. if (this.activeName == 'first') {
  2520. this.$refs.charge.show(this.getTotal())
  2521. } else {
  2522. this.$refs.charge.show(this.getTotalTwo())
  2523. }
  2524. }
  2525. },
  2526. choosePatient() {
  2527. this.radioStatus = id
  2528. this.getPatientList()
  2529. }, changeRadioAndPatient(id) {
  2530. // console.log(id)
  2531. // this.radioStatus = id
  2532. // this.getPatientList()
  2533. let temp_id = id
  2534. let params = {
  2535. 'record_date': this.record_date
  2536. }
  2537. getChargeHisPatientList(params).then(response => {
  2538. if (response.data.state == 0) {
  2539. this.$message.error(response.data.msg)
  2540. return false
  2541. } else {
  2542. this.patientTableData = []
  2543. this.all_table_data = []
  2544. this.hisPatientDatas = []
  2545. let one_count = 0
  2546. let two_count = 0
  2547. let three_count = 0
  2548. for (let i = 0; i < response.data.data.list.length; i++) {
  2549. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  2550. if (response.data.data.list[i].prescription.length > 0) {
  2551. let obj = {
  2552. id: response.data.data.list[i].id,
  2553. name: response.data.data.list[i].name,
  2554. number: '',
  2555. order_status: 0,
  2556. order_number: '',
  2557. his_patient_id: 0,
  2558. prescription: response.data.data.list[i].prescription
  2559. }
  2560. this.all_table_data.push(obj)
  2561. }
  2562. } else { //挂号
  2563. if (response.data.data.list[i].his_patient.length == 1) {
  2564. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  2565. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  2566. let obj = {
  2567. id: response.data.data.list[i].id,
  2568. name: response.data.data.list[i].name,
  2569. number: response.data.data.list[i].his_patient[0].number,
  2570. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  2571. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2572. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  2573. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  2574. prescription: response.data.data.list[i].prescription
  2575. }
  2576. this.all_table_data.push(obj)
  2577. }
  2578. } else {
  2579. let obj = {
  2580. id: response.data.data.list[i].id,
  2581. name: response.data.data.list[i].name,
  2582. number: response.data.data.list[i].his_patient[0].number,
  2583. order_status: 0,
  2584. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2585. order_number: '',
  2586. order_id: 0,
  2587. prescription: response.data.data.list[i].prescription
  2588. }
  2589. this.all_table_data.push(obj)
  2590. }
  2591. }
  2592. if (response.data.data.list[i].his_patient.length > 1) {
  2593. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  2594. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  2595. let obj = {
  2596. id: response.data.data.list[i].id,
  2597. name: response.data.data.list[i].name,
  2598. number: response.data.data.list[i].his_patient[b].number,
  2599. order_status: 1,
  2600. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2601. order_number: '',
  2602. order_id: 0,
  2603. prescription: response.data.data.list[i].prescription
  2604. }
  2605. this.all_table_data.push(obj)
  2606. } else {
  2607. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  2608. let obj = {
  2609. id: response.data.data.list[i].id,
  2610. name: response.data.data.list[i].name,
  2611. number: response.data.data.list[i].his_patient[b].number,
  2612. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  2613. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2614. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  2615. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  2616. prescription: response.data.data.list[i].prescription
  2617. }
  2618. this.all_table_data.push(obj)
  2619. }
  2620. }
  2621. }
  2622. }
  2623. }
  2624. }
  2625. for (let i = 0; i < this.all_table_data.length; i++) {
  2626. if (this.all_table_data[i].his_patient_id > 0) {
  2627. this.hisPatientDatas.push(this.all_table_data[i])
  2628. }
  2629. }
  2630. let unChargePatient = []
  2631. for (let i = 0; i < this.all_table_data.length; i++) {
  2632. let isHasUnCharge = false
  2633. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  2634. if (this.all_table_data[i].order_status != 2) {
  2635. isHasUnCharge = true
  2636. } else {
  2637. if (this.all_table_data[i].his_patient_id > 0) {
  2638. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  2639. isHasUnCharge = true
  2640. }
  2641. }
  2642. }
  2643. }
  2644. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  2645. isHasUnCharge = true
  2646. }
  2647. if (isHasUnCharge) {
  2648. unChargePatient.push(this.all_table_data[i])
  2649. }
  2650. }
  2651. unChargePatient = this.unique_four(unChargePatient)
  2652. one_count = one_count + unChargePatient.length
  2653. let ChargePatient = []
  2654. for (let i = 0; i < this.all_table_data.length; i++) {
  2655. if (this.all_table_data[i].order_status == 2) {
  2656. ChargePatient.push(this.all_table_data[i])
  2657. }
  2658. }
  2659. two_count = two_count + ChargePatient.length
  2660. if (this.radio == 1) {
  2661. this.all_table_data = this.unique_four(this.all_table_data)
  2662. }
  2663. switch (this.radio) {
  2664. case 1:
  2665. console.log(this.all_table_data)
  2666. this.patientTableData = []
  2667. for (let i = 0; i < this.all_table_data.length; i++) {
  2668. let isHasUnCharge = false
  2669. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  2670. if (this.all_table_data[i].order_status != 2) {
  2671. isHasUnCharge = true
  2672. } else {
  2673. if (this.all_table_data[i].his_patient_id > 0) {
  2674. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  2675. isHasUnCharge = true
  2676. }
  2677. }
  2678. }
  2679. }
  2680. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  2681. isHasUnCharge = true
  2682. }
  2683. if (isHasUnCharge) {
  2684. this.patientTableData.push(this.all_table_data[i])
  2685. }
  2686. }
  2687. break
  2688. case 2:
  2689. this.patientTableData = []
  2690. for (let i = 0; i < this.all_table_data.length; i++) {
  2691. if (this.all_table_data[i].order_status == 2) {
  2692. this.patientTableData.push(this.all_table_data[i])
  2693. }
  2694. }
  2695. break
  2696. case 4:
  2697. this.patientTableData = []
  2698. this.patientTableData = this.all_table_data
  2699. break
  2700. }
  2701. this.cal_one = one_count
  2702. this.cal_two = two_count
  2703. this.cal_three = three_count
  2704. this.current_index = 0
  2705. for (let i = 0; i < this.patientTableData.length; i++) {
  2706. if (this.hisPatientInfo.id == this.patientTableData[i].his_patient_id) {
  2707. this.$refs.tab.setCurrentRow(this.patientTableData[i])
  2708. this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order.number, this.patientTableData[i].his_patient.id, this.patientTableData[i].order.id)
  2709. }
  2710. }
  2711. }
  2712. })
  2713. }, changeRadio(id) {
  2714. let temp_id = id
  2715. this.radio = id
  2716. let params = {
  2717. 'record_date': this.record_date
  2718. }
  2719. getChargeHisPatientList(params).then(response => {
  2720. if (response.data.state == 0) {
  2721. this.$message.error(response.data.msg)
  2722. return false
  2723. } else {
  2724. this.patientTableData = []
  2725. this.all_table_data = []
  2726. this.hisPatientDatas = []
  2727. let one_count = 0
  2728. let two_count = 0
  2729. let three_count = 0
  2730. for (let i = 0; i < response.data.data.list.length; i++) {
  2731. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  2732. if (response.data.data.list[i].prescription.length > 0) {
  2733. let obj = {
  2734. id: response.data.data.list[i].id,
  2735. name: response.data.data.list[i].name,
  2736. number: '',
  2737. order_status: 0,
  2738. order_number: '',
  2739. his_patient_id: 0,
  2740. prescription: response.data.data.list[i].prescription
  2741. }
  2742. this.all_table_data.push(obj)
  2743. }
  2744. } else { //挂号
  2745. if (response.data.data.list[i].his_patient.length == 1) {
  2746. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  2747. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  2748. let obj = {
  2749. id: response.data.data.list[i].id,
  2750. name: response.data.data.list[i].name,
  2751. number: response.data.data.list[i].his_patient[0].number,
  2752. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  2753. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2754. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  2755. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  2756. prescription: response.data.data.list[i].prescription
  2757. }
  2758. this.all_table_data.push(obj)
  2759. }
  2760. } else {
  2761. let obj = {
  2762. id: response.data.data.list[i].id,
  2763. name: response.data.data.list[i].name,
  2764. number: response.data.data.list[i].his_patient[0].number,
  2765. order_status: 0,
  2766. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2767. order_number: '',
  2768. order_id: 0,
  2769. prescription: response.data.data.list[i].prescription
  2770. }
  2771. this.all_table_data.push(obj)
  2772. }
  2773. }
  2774. if (response.data.data.list[i].his_patient.length > 1) {
  2775. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  2776. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  2777. let obj = {
  2778. id: response.data.data.list[i].id,
  2779. name: response.data.data.list[i].name,
  2780. number: response.data.data.list[i].his_patient[b].number,
  2781. order_status: 1,
  2782. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2783. order_number: '',
  2784. order_id: 0,
  2785. prescription: response.data.data.list[i].prescription
  2786. }
  2787. this.all_table_data.push(obj)
  2788. } else {
  2789. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  2790. let obj = {
  2791. id: response.data.data.list[i].id,
  2792. name: response.data.data.list[i].name,
  2793. number: response.data.data.list[i].his_patient[b].number,
  2794. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  2795. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2796. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  2797. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  2798. prescription: response.data.data.list[i].prescription
  2799. }
  2800. this.all_table_data.push(obj)
  2801. }
  2802. }
  2803. }
  2804. }
  2805. }
  2806. }
  2807. for (let i = 0; i < this.all_table_data.length; i++) {
  2808. if (this.all_table_data[i].his_patient_id > 0) {
  2809. this.hisPatientDatas.push(this.all_table_data[i])
  2810. }
  2811. }
  2812. let unChargePatient = []
  2813. for (let i = 0; i < this.all_table_data.length; i++) {
  2814. let isHasUnCharge = false
  2815. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  2816. if (this.all_table_data[i].order_status != 2) {
  2817. isHasUnCharge = true
  2818. } else {
  2819. if (this.all_table_data[i].his_patient_id > 0) {
  2820. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  2821. isHasUnCharge = true
  2822. }
  2823. }
  2824. }
  2825. }
  2826. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  2827. isHasUnCharge = true
  2828. }
  2829. if (isHasUnCharge) {
  2830. unChargePatient.push(this.all_table_data[i])
  2831. }
  2832. }
  2833. unChargePatient = this.unique_four(unChargePatient)
  2834. one_count = one_count + unChargePatient.length
  2835. let ChargePatient = []
  2836. for (let i = 0; i < this.all_table_data.length; i++) {
  2837. if (this.all_table_data[i].order_status == 2) {
  2838. ChargePatient.push(this.all_table_data[i])
  2839. }
  2840. }
  2841. two_count = two_count + ChargePatient.length
  2842. if (this.radio == 1) {
  2843. this.all_table_data = this.unique_four(this.all_table_data)
  2844. }
  2845. switch (this.radio) {
  2846. case 1:
  2847. console.log(this.all_table_data)
  2848. this.patientTableData = []
  2849. for (let i = 0; i < this.all_table_data.length; i++) {
  2850. let isHasUnCharge = false
  2851. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  2852. if (this.all_table_data[i].order_status != 2) {
  2853. isHasUnCharge = true
  2854. } else {
  2855. if (this.all_table_data[i].his_patient_id > 0) {
  2856. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  2857. isHasUnCharge = true
  2858. }
  2859. }
  2860. }
  2861. }
  2862. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  2863. isHasUnCharge = true
  2864. }
  2865. if (isHasUnCharge) {
  2866. this.patientTableData.push(this.all_table_data[i])
  2867. }
  2868. }
  2869. break
  2870. case 2:
  2871. this.patientTableData = []
  2872. for (let i = 0; i < this.all_table_data.length; i++) {
  2873. if (this.all_table_data[i].order_status == 2) {
  2874. this.patientTableData.push(this.all_table_data[i])
  2875. }
  2876. }
  2877. break
  2878. case 4:
  2879. this.patientTableData = []
  2880. this.patientTableData = this.all_table_data
  2881. break
  2882. }
  2883. this.cal_one = one_count
  2884. this.cal_two = two_count
  2885. this.cal_three = one_count + two_count
  2886. this.current_index = 0
  2887. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  2888. this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order_number, this.patientTableData[0].his_patient_id, this.patientTableData[0].order_id)
  2889. }
  2890. })
  2891. }, formatDecimal(num, decimal) {
  2892. num = num.toString()
  2893. let index = num.indexOf('.')
  2894. if (index !== -1) {
  2895. num = num.substring(0, decimal + index + 1)
  2896. } else {
  2897. num = num.substring(0)
  2898. }
  2899. return parseFloat(num).toFixed(decimal)
  2900. },
  2901. //患者列表
  2902. getPatientList() {
  2903. let params = {
  2904. 'record_date': this.record_date,
  2905. 'type': this.radio
  2906. }
  2907. getChargeHisPatientList(params).then(response => {
  2908. if (response.data.state == 0) {
  2909. this.$message.error(response.data.msg)
  2910. return false
  2911. } else {
  2912. this.patientTableData = []
  2913. this.all_table_data = []
  2914. this.hisPatientDatas = []
  2915. let one_count = 0
  2916. let two_count = 0
  2917. let three_count = 0
  2918. for (let i = 0; i < response.data.data.list.length; i++) {
  2919. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  2920. if (response.data.data.list[i].prescription.length > 0) {
  2921. let obj = {
  2922. id: response.data.data.list[i].id,
  2923. name: response.data.data.list[i].name,
  2924. number: '',
  2925. order_status: 0,
  2926. order_number: '',
  2927. his_patient_id: 0,
  2928. prescription: response.data.data.list[i].prescription
  2929. }
  2930. this.all_table_data.push(obj)
  2931. }
  2932. } else { //挂号
  2933. if (response.data.data.list[i].his_patient.length == 1) {
  2934. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  2935. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  2936. let obj = {
  2937. id: response.data.data.list[i].id,
  2938. name: response.data.data.list[i].name,
  2939. number: response.data.data.list[i].his_patient[0].number,
  2940. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  2941. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2942. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  2943. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  2944. prescription: response.data.data.list[i].prescription
  2945. }
  2946. this.all_table_data.push(obj)
  2947. }
  2948. } else {
  2949. let obj = {
  2950. id: response.data.data.list[i].id,
  2951. name: response.data.data.list[i].name,
  2952. number: response.data.data.list[i].his_patient[0].number,
  2953. order_status: 0,
  2954. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2955. order_number: '',
  2956. order_id: 0,
  2957. prescription: response.data.data.list[i].prescription
  2958. }
  2959. this.all_table_data.push(obj)
  2960. }
  2961. }
  2962. if (response.data.data.list[i].his_patient.length > 1) {
  2963. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  2964. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  2965. let obj = {
  2966. id: response.data.data.list[i].id,
  2967. name: response.data.data.list[i].name,
  2968. number: response.data.data.list[i].his_patient[b].number,
  2969. order_status: 1,
  2970. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2971. order_number: '',
  2972. order_id: 0,
  2973. prescription: response.data.data.list[i].prescription
  2974. }
  2975. this.all_table_data.push(obj)
  2976. } else {
  2977. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  2978. let obj = {
  2979. id: response.data.data.list[i].id,
  2980. name: response.data.data.list[i].name,
  2981. number: response.data.data.list[i].his_patient[b].number,
  2982. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  2983. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2984. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  2985. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  2986. prescription: response.data.data.list[i].prescription
  2987. }
  2988. this.all_table_data.push(obj)
  2989. }
  2990. }
  2991. }
  2992. }
  2993. }
  2994. }
  2995. for (let i = 0; i < this.all_table_data.length; i++) {
  2996. if (this.all_table_data[i].his_patient_id > 0) {
  2997. this.hisPatientDatas.push(this.all_table_data[i])
  2998. }
  2999. }
  3000. let unChargePatient = []
  3001. for (let i = 0; i < this.all_table_data.length; i++) {
  3002. let isHasUnCharge = false
  3003. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  3004. if (this.all_table_data[i].order_status != 2) {
  3005. isHasUnCharge = true
  3006. } else {
  3007. if (this.all_table_data[i].his_patient_id > 0) {
  3008. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  3009. isHasUnCharge = true
  3010. }
  3011. }
  3012. }
  3013. }
  3014. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  3015. isHasUnCharge = true
  3016. }
  3017. if (isHasUnCharge) {
  3018. unChargePatient.push(this.all_table_data[i])
  3019. }
  3020. }
  3021. unChargePatient = this.unique_four(unChargePatient)
  3022. one_count = one_count + unChargePatient.length
  3023. let ChargePatient = []
  3024. for (let i = 0; i < this.all_table_data.length; i++) {
  3025. if (this.all_table_data[i].order_status == 2) {
  3026. ChargePatient.push(this.all_table_data[i])
  3027. }
  3028. }
  3029. two_count = two_count + ChargePatient.length
  3030. if (this.radio == 1) {
  3031. this.all_table_data = this.unique_four(this.all_table_data)
  3032. }
  3033. switch (this.radio) {
  3034. case 1:
  3035. console.log(this.all_table_data)
  3036. this.patientTableData = []
  3037. for (let i = 0; i < this.all_table_data.length; i++) {
  3038. let isHasUnCharge = false
  3039. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  3040. if (this.all_table_data[i].order_status != 2) {
  3041. isHasUnCharge = true
  3042. } else {
  3043. if (this.all_table_data[i].his_patient_id > 0) {
  3044. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  3045. isHasUnCharge = true
  3046. }
  3047. }
  3048. }
  3049. }
  3050. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2) {
  3051. isHasUnCharge = true
  3052. }
  3053. if (isHasUnCharge) {
  3054. this.patientTableData.push(this.all_table_data[i])
  3055. }
  3056. }
  3057. break
  3058. case 2:
  3059. this.patientTableData = []
  3060. for (let i = 0; i < this.all_table_data.length; i++) {
  3061. if (this.all_table_data[i].order_status == 2) {
  3062. this.patientTableData.push(this.all_table_data[i])
  3063. }
  3064. }
  3065. break
  3066. case 4:
  3067. this.patientTableData = []
  3068. this.patientTableData = this.all_table_data
  3069. break
  3070. }
  3071. this.cal_one = one_count
  3072. this.cal_two = two_count
  3073. this.cal_three = one_count + two_count
  3074. this.current_index = 0
  3075. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  3076. this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order_number, this.patientTableData[0].his_patient_id, this.patientTableData[0].order_id)
  3077. }
  3078. })
  3079. },
  3080. setMonthPrescription(month_prescriptions) {
  3081. let big_prescriptions = []
  3082. for (let i = 0; i < this.unique_three(month_prescriptions).length; i++) {
  3083. let obj = {
  3084. med_type: this.unique_three(month_prescriptions)[i].med_type,
  3085. prescriptions: []
  3086. }
  3087. big_prescriptions.push(obj)
  3088. }
  3089. this.month_prescriptions = []
  3090. for (let c = 0; c < big_prescriptions.length; c++) {
  3091. let drug_month_prescriptions = {
  3092. advices: []
  3093. }
  3094. let drug_ids = []
  3095. let project_month_prescriptions = {
  3096. project: []
  3097. }
  3098. let project_ids = []
  3099. let additions_ids = []
  3100. let addition_month_prescriptions = {
  3101. addition: []
  3102. }
  3103. for (let i = 0; i < month_prescriptions.length; i++) {
  3104. if (big_prescriptions[c].med_type == month_prescriptions[i].med_type) {
  3105. if (month_prescriptions[i].type == 1) { //药品
  3106. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  3107. let obj = {
  3108. id: month_prescriptions[i].advices[a].drug_id,
  3109. price: month_prescriptions[i].advices[a].price
  3110. }
  3111. drug_ids.push(obj)
  3112. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  3113. }
  3114. } else if (month_prescriptions[i].type == 2) { //项目
  3115. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  3116. let obj = {
  3117. id: month_prescriptions[i].project[a].project_id,
  3118. price: month_prescriptions[i].project[a].price
  3119. }
  3120. project_ids.push(obj)
  3121. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  3122. }
  3123. }
  3124. //附加收费
  3125. for (let a = 0; a < month_prescriptions[i].addition.length; a++) {
  3126. let obj = {
  3127. id: month_prescriptions[i].addition[a].item_id,
  3128. price: month_prescriptions[i].addition[a].price
  3129. }
  3130. additions_ids.push(obj)
  3131. addition_month_prescriptions.addition.push(month_prescriptions[i].addition[a])
  3132. }
  3133. big_prescriptions[c]['drug_ids'] = []
  3134. big_prescriptions[c]['project_ids'] = []
  3135. big_prescriptions[c]['additions_ids'] = []
  3136. big_prescriptions[c]['drug_month_prescriptions'] = []
  3137. big_prescriptions[c]['project_month_prescriptions'] = []
  3138. big_prescriptions[c]['addition_month_prescriptions'] = []
  3139. big_prescriptions[c]['drug_ids'] = drug_ids
  3140. big_prescriptions[c]['project_ids'] = project_ids
  3141. big_prescriptions[c]['additions_ids'] = additions_ids
  3142. big_prescriptions[c]['drug_month_prescriptions'] = drug_month_prescriptions
  3143. big_prescriptions[c]['project_month_prescriptions'] = project_month_prescriptions
  3144. big_prescriptions[c]['addition_month_prescriptions'] = addition_month_prescriptions
  3145. big_prescriptions[c]['order'] = month_prescriptions[i].order
  3146. }
  3147. }
  3148. }
  3149. //
  3150. //
  3151. for (let y = 0; y < big_prescriptions.length; y++) {
  3152. let drug_ids = this.unique_two(big_prescriptions[y].drug_ids)
  3153. let project_ids = this.unique_two(big_prescriptions[y].project_ids)
  3154. let additions_ids = this.unique_two(big_prescriptions[y].additions_ids)
  3155. let drugs = []
  3156. let projects = []
  3157. let additions = []
  3158. for (let i = 0; i < drug_ids.length; i++) {
  3159. let obj = {}
  3160. let count = 0
  3161. for (let a = 0; a < big_prescriptions[y].drug_month_prescriptions.advices.length; a++) {
  3162. if (drug_ids[i].price == big_prescriptions[y].drug_month_prescriptions.advices[a].price && drug_ids[i].id == big_prescriptions[y].drug_month_prescriptions.advices[a].drug_id) {
  3163. obj['drug_name'] = big_prescriptions[y].drug_month_prescriptions.advices[a].advice_name
  3164. obj['single_dose'] = big_prescriptions[y].drug_month_prescriptions.advices[a].single_dose
  3165. obj['delivery_way'] = big_prescriptions[y].drug_month_prescriptions.advices[a].delivery_way
  3166. obj['execution_frequency'] = big_prescriptions[y].drug_month_prescriptions.advices[a].execution_frequency
  3167. obj['day'] = big_prescriptions[y].drug_month_prescriptions.advices[a].day
  3168. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  3169. obj['prescribing_number_unit'] = big_prescriptions[y].drug_month_prescriptions.advices[a].prescribing_number_unit
  3170. obj['medical_insurance_number'] = big_prescriptions[y].drug_month_prescriptions.advices[a].drug.medical_insurance_number
  3171. obj['id'] = big_prescriptions[y].drug_month_prescriptions.advices[a].drug_id
  3172. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  3173. obj['retail_price'] = parseFloat(big_prescriptions[y].drug_month_prescriptions.advices[a].price)
  3174. count = count + big_prescriptions[y].drug_month_prescriptions.advices[a].prescribing_number
  3175. }
  3176. }
  3177. obj['prescribing_number'] = count
  3178. drugs.push(obj)
  3179. }
  3180. for (let i = 0; i < project_ids.length; i++) {
  3181. let obj = {}
  3182. let count = 0
  3183. for (let a = 0; a < big_prescriptions[y].project_month_prescriptions.project.length; a++) {
  3184. if (project_ids[i].price == big_prescriptions[y].project_month_prescriptions.project[a].price && project_ids[i].id == big_prescriptions[y].project_month_prescriptions.project[a].project_id) {
  3185. if (big_prescriptions[y].project_month_prescriptions.project[a].type == 2) {
  3186. obj['statistical_classification'] = big_prescriptions[y].project_month_prescriptions.project[a].project.statistical_classification
  3187. obj['medical_code'] = big_prescriptions[y].project_month_prescriptions.project[a].project.medical_code
  3188. obj['project_name'] = big_prescriptions[y].project_month_prescriptions.project[a].project.project_name
  3189. } else if (big_prescriptions[y].project_month_prescriptions.project[a].type == 3) {
  3190. obj['statistical_classification'] = ''
  3191. obj['medical_code'] = big_prescriptions[y].project_month_prescriptions.project[a].good_info.medical_insurance_number
  3192. obj['project_name'] = big_prescriptions[y].project_month_prescriptions.project[a].good_info.good_name
  3193. }
  3194. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  3195. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  3196. obj['single_dose'] = big_prescriptions[y].project_month_prescriptions.project[a].single_dose
  3197. obj['delivery_way'] = big_prescriptions[y].project_month_prescriptions.project[a].delivery_way
  3198. obj['execution_frequency'] = big_prescriptions[y].project_month_prescriptions.project[a].execution_frequency
  3199. obj['number_days'] = big_prescriptions[y].project_month_prescriptions.project[a].day
  3200. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  3201. obj['unit'] = big_prescriptions[y].project_month_prescriptions.project[a].unit
  3202. obj['project_id'] = big_prescriptions[y].project_month_prescriptions.project[a].project_id
  3203. count = count + big_prescriptions[y].project_month_prescriptions.project[a].count
  3204. // price = price + project_month_prescriptions.project[a].price
  3205. obj['price'] = parseFloat(big_prescriptions[y].project_month_prescriptions.project[a].price)
  3206. obj['type'] = big_prescriptions[y].project_month_prescriptions.project[a].type
  3207. }
  3208. }
  3209. obj['total'] = count
  3210. projects.push(obj)
  3211. }
  3212. for (let i = 0; i < additions_ids.length; i++) {
  3213. let obj = {}
  3214. let count = 0
  3215. if (big_prescriptions[y].addition_month_prescriptions.addition) {
  3216. for (let a = 0; a < big_prescriptions[y].addition_month_prescriptions.addition.length; a++) {
  3217. if (additions_ids[i].price == big_prescriptions[y].addition_month_prescriptions.addition[a].price && additions_ids[i].id == big_prescriptions[y].addition_month_prescriptions.addition[a].item_id) {
  3218. obj['item_name'] = big_prescriptions[y].addition_month_prescriptions.addition[a].item_name
  3219. obj['id'] = big_prescriptions[y].addition_month_prescriptions.addition[a].id
  3220. obj['item_id'] = big_prescriptions[y].addition_month_prescriptions.addition[a].item_id
  3221. count = count + big_prescriptions[y].addition_month_prescriptions.addition[a].count
  3222. obj['price'] = parseFloat(big_prescriptions[y].addition_month_prescriptions.addition[a].price)
  3223. }
  3224. }
  3225. obj['count'] = count
  3226. additions.push(obj)
  3227. }
  3228. }
  3229. let p1 = {
  3230. name: this.getPName(big_prescriptions[y].med_type, 1),
  3231. advices: drugs,
  3232. project: [],
  3233. type: 1,
  3234. addition: additions,
  3235. order: big_prescriptions[y].order
  3236. }
  3237. let p2 = {
  3238. name: this.getPName(big_prescriptions[y].med_type, 2),
  3239. type: 2,
  3240. project: projects,
  3241. advices: [],
  3242. addition: [],
  3243. order: big_prescriptions[y].order
  3244. }
  3245. big_prescriptions[y]['month_prescriptions'] = []
  3246. big_prescriptions[y]['month_prescriptions'].push(p1)
  3247. big_prescriptions[y]['month_prescriptions'].push(p2)
  3248. }
  3249. this.big_month_prescriptions = big_prescriptions
  3250. for (let i = 0; i < this.big_month_prescriptions.length; i++) {
  3251. if (this.big_month_prescriptions[i].month_prescriptions.length > 0) {
  3252. this.big_month_prescriptions[i]['curMonthPrescriptions'] = this.big_month_prescriptions[i].month_prescriptions[0]
  3253. } else {
  3254. this.big_month_prescriptions[i]['curMonthPrescriptions'] = {}
  3255. }
  3256. this.big_month_prescriptions[i]['month_total'] = this.getMonthTotalTwo(this.big_month_prescriptions[i].month_prescriptions[0])
  3257. }
  3258. }, getPName(med_type, index) {
  3259. var med_type = parseInt(med_type)
  3260. switch (med_type) {
  3261. case 11:
  3262. return '普通门诊' + '处方' + index
  3263. break
  3264. case 12:
  3265. return '门诊挂号' + '处方' + index
  3266. break
  3267. case 13:
  3268. return '急诊' + '处方' + index
  3269. break
  3270. case 14:
  3271. return '门诊特殊病' + '处方' + index
  3272. break
  3273. case 15:
  3274. return '门诊统筹' + '处方' + index
  3275. break
  3276. case 16:
  3277. return '门诊慢性病' + '处方' + index
  3278. break
  3279. case 21:
  3280. return '普通住院' + '处方' + index
  3281. break
  3282. }
  3283. }, unique_four(array) {
  3284. // res用来存储结果
  3285. var res = []
  3286. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3287. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3288. if (array[i].id === res[j].id && array[i].number === res[j].number) {
  3289. break
  3290. }
  3291. }
  3292. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3293. if (j === resLen) {
  3294. res.push(array[i])
  3295. }
  3296. }
  3297. return res
  3298. },
  3299. unique_two(array) {
  3300. // res用来存储结果
  3301. var res = []
  3302. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3303. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3304. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  3305. break
  3306. }
  3307. }
  3308. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3309. if (j === resLen) {
  3310. res.push(array[i])
  3311. }
  3312. }
  3313. return res
  3314. },
  3315. unique(arr) {
  3316. const res = new Map()
  3317. return arr.filter((arr) => !res.has(arr.id_card_no) && res.set(arr.id_card_no, 1))
  3318. }, unique_three(array) {
  3319. // res用来存储结果
  3320. var res = []
  3321. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3322. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3323. if (array[i].med_type === res[j].med_type) {
  3324. break
  3325. }
  3326. }
  3327. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3328. if (j === resLen) {
  3329. res.push(array[i])
  3330. }
  3331. }
  3332. return res
  3333. },
  3334. handleCurrentChange(val) {
  3335. this.curPrescriptions = {}
  3336. this.curMonthPrescriptions = {}
  3337. this.prescriptions = []
  3338. this.month_prescriptions = []
  3339. this.getPatientInformation(val.id, val.order_number, val.his_patient_id, val.order_id)
  3340. this.patient_id = val.id
  3341. for (let i = 0; i < this.patientTableData.length; i++) {
  3342. if (this.patientTableData[i].his_patient_id == val.his_patient_id) {
  3343. this.current_index = i
  3344. }
  3345. }
  3346. },
  3347. //获取患者的基本信息
  3348. getPatientInformation(id, batch_number, his_patient_id, order_id) {
  3349. let params = {
  3350. 'record_date': this.record_date,
  3351. 'patient_id': id,
  3352. 'his_patient_id': his_patient_id,
  3353. 'number': batch_number,
  3354. 'start_time': this.other_start_time,
  3355. 'end_time': this.other_end_time,
  3356. 'type': this.radio,
  3357. 'p_type': 2,
  3358. 'order_id': order_id
  3359. }
  3360. this.loading = true
  3361. getChargeHisPatientInfo(params).then(response => {
  3362. if (response.data.state == 0) {
  3363. this.loading = false
  3364. this.$message.error(response.data.msg)
  3365. return false
  3366. } else {
  3367. this.prescriptions = []
  3368. this.month_prescriptions = []
  3369. this.curPrescriptions = {}
  3370. this.curMonthPrescriptions = {}
  3371. this.loading = false
  3372. this.patientInfo = response.data.data.xt_info
  3373. this.hisPatientInfo = response.data.data.his_info
  3374. this.info = response.data.data.info
  3375. this.order = response.data.data.order
  3376. this.p_type = ''
  3377. this.sick_type = ''
  3378. this.diagnosis = ''
  3379. this.sick_history = ''
  3380. if (this.info.id > 0) {
  3381. this.form.p_type = response.data.data.info.register_type
  3382. this.form.sick_type = response.data.data.info.sick_type
  3383. this.form.diagnosis = response.data.data.info.diagnosis
  3384. this.sick_history = this.info.sick_history
  3385. if (this.info.register_type == 0) {
  3386. this.form.p_type = ''
  3387. }
  3388. if (this.info.sick_type == 0) {
  3389. this.form.sick_type = ''
  3390. }
  3391. if (this.info.diagnosis == 0) {
  3392. this.form.diagnosis = ''
  3393. }
  3394. } else {
  3395. this.form.p_type = 14
  3396. this.form.sick_type = this.sick[0].id
  3397. this.form.diagnosis = this.diagnoses[0].id
  3398. this.sick_history = ''
  3399. }
  3400. this.addtions_charge = response.data.data.addtions_charge
  3401. this.setMonthPrescription(response.data.data.month_prescriptions)
  3402. if (response.data.data.prescription.length > 0 && response.data.data.prescription[0].advices.length > 0) {
  3403. this.prescription_id = response.data.data.prescription[0].advices[0].prescription_id
  3404. } else {
  3405. this.prescription_id = 0
  3406. }
  3407. let big_prescriptions = []
  3408. for (let i = 0; i < this.unique_three(response.data.data.prescription).length; i++) {
  3409. let obj = {
  3410. med_type: this.unique_three(response.data.data.prescription)[i].med_type,
  3411. prescriptions: []
  3412. }
  3413. big_prescriptions.push(obj)
  3414. }
  3415. for (let c = 0; c < big_prescriptions.length; c++) {
  3416. let inner_prescription = []
  3417. for (let i = 0; i < response.data.data.prescription.length; i++) {
  3418. var prescription = response.data.data.prescription[i]
  3419. if (big_prescriptions[c].med_type == prescription.med_type) {
  3420. let tempAdvice = []
  3421. let tempProject = []
  3422. let tempAddition = []
  3423. for (let b = 0; b < prescription.advices.length; b++) {
  3424. let obj = {
  3425. advice_id: prescription.advices[b].id,
  3426. drug_name: prescription.advices[b].advice_name,
  3427. single_dose: prescription.advices[b].single_dose,
  3428. delivery_way: prescription.advices[b].delivery_way,
  3429. execution_frequency: prescription.advices[b].execution_frequency,
  3430. retail_price: prescription.advices[b].price.toString(),
  3431. remark: prescription.advices[b].remark,
  3432. day: prescription.advices[b].day,
  3433. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3434. single_dose_unit: prescription.advices[b].single_dose_unit,
  3435. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3436. medical_insurance_number: prescription.advices[b].med_list_codg
  3437. }
  3438. tempAdvice.push(obj)
  3439. }
  3440. for (let b = 0; b < prescription.project.length; b++) {
  3441. let obj = {
  3442. id: prescription.project[b].id,
  3443. project_id: prescription.project[b].project.id,
  3444. // project_name: prescription.project[b].project.project_name,
  3445. // statistical_classification: prescription.project[b].project.statistical_classification,
  3446. single_dose: prescription.project[b].single_dose,
  3447. delivery_way: prescription.project[b].delivery_way,
  3448. execution_frequency: prescription.project[b].execution_frequency,
  3449. number_days: prescription.project[b].day,
  3450. total: prescription.project[b].count.toString(),
  3451. price: prescription.project[b].price,
  3452. remark: prescription.project[b].remark,
  3453. // medical_code: prescription.project[b].project.medical_code,
  3454. unit: prescription.project[b].unit,
  3455. type: prescription.project[b].type
  3456. }
  3457. if (prescription.project[b].type == 2) {
  3458. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  3459. obj['medical_code'] = prescription.project[b].project.medical_code
  3460. obj['project_name'] = prescription.project[b].project.project_name
  3461. } else if (prescription.project[b].type == 3) {
  3462. obj['statistical_classification'] = ''
  3463. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3464. obj['project_name'] = prescription.project[b].good_info.good_name
  3465. }
  3466. tempProject.push(obj)
  3467. }
  3468. for (let b = 0; b < prescription.addition.length; b++) {
  3469. let obj = {
  3470. id: prescription.addition[b].id,
  3471. item_name: prescription.addition[b].item_name,
  3472. price: prescription.addition[b].price,
  3473. count: prescription.addition[b].count,
  3474. item_id: prescription.addition[b].item_id
  3475. }
  3476. tempAddition.push(obj)
  3477. }
  3478. let index = i + 1
  3479. let obj = {
  3480. id: prescription.id,
  3481. name: this.getPName(prescription.med_type, index),
  3482. advices: tempAdvice,
  3483. project: tempProject,
  3484. addition: tempAddition,
  3485. order_status: prescription.order_status,
  3486. type: prescription.type,
  3487. med_type: prescription.med_type,
  3488. order: prescription.order
  3489. }
  3490. // inner_prescription.push(obj)
  3491. big_prescriptions[c].prescriptions.push(obj)
  3492. this.prescriptions.push(obj)
  3493. }
  3494. }
  3495. }
  3496. this.big_prescriptions = big_prescriptions
  3497. for (let i = 0; i < this.big_prescriptions.length; i++) {
  3498. if (this.big_prescriptions[i].prescriptions.length > 0) {
  3499. this.big_prescriptions[i]['curPrescriptions'] = this.big_prescriptions[i].prescriptions[0]
  3500. } else {
  3501. this.big_prescriptions[i]['curPrescriptions'] = {}
  3502. }
  3503. this.big_prescriptions[i]['total'] = this.getTotalThree(this.big_prescriptions[i])
  3504. }
  3505. console.log(this.big_prescriptions)
  3506. //
  3507. // if (this.prescriptions.length > 0) {
  3508. // this.curPrescriptions = this.prescriptions[0]
  3509. // } else {
  3510. // this.curPrescriptions = {}
  3511. // }
  3512. // if (this.month_prescriptions.length > 0) {
  3513. // this.curMonthPrescriptions = this.month_prescriptions[0]
  3514. // } else {
  3515. // this.curMonthPrescriptions = {}
  3516. // }
  3517. // this.month_total = this.getMonthTotalOne()
  3518. }
  3519. })
  3520. },
  3521. sz_open(index, med_type, order_id) {
  3522. switch (index) {
  3523. case 1:
  3524. this.$refs.register9504.show()
  3525. break
  3526. case 2:
  3527. var that = this
  3528. if (this.activeName == 'first') {
  3529. this.settle_accounts_type = 1
  3530. } else {
  3531. this.settle_accounts_type = 2
  3532. this.start_time = this.other_start_time
  3533. this.end_time = this.other_end_time
  3534. this.settle_accounts_type = 2
  3535. }
  3536. let params = {
  3537. 'patient_id': this.patientInfo.id,
  3538. 'record_time': this.record_date,
  3539. 'settle_accounts_type': this.settle_accounts_type,
  3540. 'admin_user_id': this.$store.getters.xt_user.user.id,
  3541. 'his_patient_id': this.hisPatientInfo.id
  3542. }
  3543. axios.get('http://127.0.0.1:9532/sz/api/upload/get', {
  3544. params: params,
  3545. headers: {
  3546. 'Permission': 5
  3547. }
  3548. })
  3549. .then(function(response) {
  3550. if (response.data.state == 0) {
  3551. that.$message.error(response.data.msg)
  3552. return false
  3553. } else {
  3554. if (response.data.data.failed_code == -10) {
  3555. that.$message.error(response.data.data.msg)
  3556. } else {
  3557. that.changeRadioAndPatient(1)
  3558. that.$message({ message: '预结算成功', type: 'success' })
  3559. }
  3560. }
  3561. })
  3562. .catch(function(error) {
  3563. })
  3564. break
  3565. case 3:
  3566. if (this.activeName == 'first') {
  3567. this.$refs.charge.show(this.getTotal())
  3568. } else {
  3569. this.$refs.charge.show(this.getTotalTwo())
  3570. }
  3571. break
  3572. case 4:
  3573. break
  3574. case 5:
  3575. var that = this
  3576. this.$confirm('是否退费', '退费', {
  3577. confirmButtonText: '确 定',
  3578. cancelButtonText: '取 消',
  3579. type: 'warning'
  3580. }).then(() => {
  3581. axios.get('http://127.0.0.1:9532/sz/api/refund/get', {
  3582. params: {
  3583. order_id: this.order.id,
  3584. record_time: this.record_date,
  3585. his_patient_id: this.hisPatientInfo.id,
  3586. admin_user_id: this.$store.getters.xt_user.user.id,
  3587. patient_id: this.patientInfo.id
  3588. }
  3589. })
  3590. .then(function(response) {
  3591. if (response.data.state == 0) {
  3592. that.$message.error(response.data.msg)
  3593. return false
  3594. } else {
  3595. if (response.data.data.failed_code == -10) {
  3596. that.$message.error(response.data.data.msg)
  3597. } else {
  3598. that.changeRadioAndPatient(1)
  3599. that.$message({ message: '退费成功', type: 'success' })
  3600. }
  3601. }
  3602. })
  3603. .catch(function(error) {
  3604. })
  3605. }).catch(() => {
  3606. })
  3607. break
  3608. case 6:
  3609. var that = this
  3610. axios.get('http://127.0.0.1:9532/sz/api/settle/query', {
  3611. params: {
  3612. order_id: this.order.id,
  3613. record_time: this.record_date,
  3614. admin_user_id: this.$store.getters.xt_user.user.id,
  3615. patient_id: this.patientInfo.id
  3616. }
  3617. })
  3618. .then(function(response) {
  3619. if (response.data.state == 0) {
  3620. that.$message.error(response.data.msg)
  3621. return false
  3622. } else {
  3623. if (response.data.data.failed_code == -10) {
  3624. that.$confirm(response.data.data.msg, '医保错误信息', {
  3625. confirmButtonText: '确 定',
  3626. type: 'warning'
  3627. }).then(() => {
  3628. }).catch(() => {
  3629. })
  3630. } else {
  3631. that.$message({ message: '查询成功', type: 'success' })
  3632. }
  3633. }
  3634. })
  3635. .catch(function(error) {
  3636. })
  3637. break
  3638. case 7:
  3639. var that = this
  3640. axios.get('http://127.0.0.1:9532/sz/api/detail/cancel', {
  3641. params: {
  3642. order_id: this.order.id,
  3643. record_time: this.record_date,
  3644. admin_user_id: this.$store.getters.xt_user.user.id,
  3645. patient_id: this.patientInfo.id
  3646. }
  3647. })
  3648. .then(function(response) {
  3649. if (response.data.state == 0) {
  3650. that.$message.error(response.data.msg)
  3651. return false
  3652. } else {
  3653. if (response.data.data.failed_code == -10) {
  3654. that.$confirm(response.data.data.msg, '医保错误信息', {
  3655. confirmButtonText: '确 定',
  3656. type: 'warning'
  3657. }).then(() => {
  3658. }).catch(() => {
  3659. })
  3660. } else {
  3661. that.$message({ message: '明细撤销成功', type: 'success' })
  3662. }
  3663. }
  3664. })
  3665. .catch(function(error) {
  3666. })
  3667. break
  3668. case 8:
  3669. var that = this
  3670. let form = {}
  3671. form['id'] = this.patientInfo.id
  3672. form['his_patient_id'] = this.hisPatientInfo.id
  3673. form['record_time'] = this.record_date
  3674. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  3675. form['org_id'] = this.$store.getters.xt_user.org_id
  3676. if (this.activeName == 'first') {
  3677. form['settle_accounts_type'] = 1
  3678. } else {
  3679. form['start_time'] = this.other_start_time
  3680. form['end_time'] = this.other_end_time
  3681. form['settle_accounts_type'] = 2
  3682. }
  3683. this.$confirm('是否进行预结算', '预结算', {
  3684. confirmButtonText: '确 定',
  3685. cancelButtonText: '取 消',
  3686. type: 'warning'
  3687. }).then(() => {
  3688. axios.get('http://127.0.0.1:9532/sz/api/presettle/get', {
  3689. params: form,
  3690. headers: {
  3691. 'Permission': 5
  3692. }
  3693. })
  3694. .then(function(response) {
  3695. if (response.data.state == 0) {
  3696. that.$message.error(response.data.msg)
  3697. return false
  3698. } else {
  3699. if (response.data.data.failed_code == -10) {
  3700. that.$confirm(response.data.data.msg, '医保错误信息', {
  3701. confirmButtonText: '确 定',
  3702. type: 'warning'
  3703. }).then(() => {
  3704. }).catch(() => {
  3705. })
  3706. } else {
  3707. that.changeRadioAndPatient(1)
  3708. that.$message({ message: '预结算成功', type: 'success', duration: 5000 })
  3709. }
  3710. }
  3711. })
  3712. .catch(function(error) {
  3713. })
  3714. }).catch(() => {
  3715. })
  3716. break
  3717. case 10:
  3718. this.newStatementVisible = true
  3719. let obj = {
  3720. record_time: this.record_date,
  3721. patient_id: this.patient_id,
  3722. prescription_id: this.prescription_id,
  3723. order_id: this.order.id,
  3724. admin_user_id: this.$store.getters.xt_user.user.id
  3725. }
  3726. this.newOrderObj = obj
  3727. // this.$refs.print.getInfo(this.order.id)
  3728. break
  3729. case 11:
  3730. var that = this
  3731. this.$confirm('是否退号', '退号', {
  3732. confirmButtonText: '确 定',
  3733. cancelButtonText: '取 消',
  3734. type: 'warning'
  3735. }).then(() => {
  3736. axios.get('http://127.0.0.1:9532/sz/api/refundnumber/get', {
  3737. params: {
  3738. order_id: this.order.id,
  3739. record_time: this.record_date,
  3740. admin_user_id: this.$store.getters.xt_user.user.id,
  3741. patient_id: this.patientInfo.id,
  3742. his_patient_id: this.hisPatientInfo.id
  3743. }
  3744. })
  3745. .then(function(response) {
  3746. if (response.data.state == 0) {
  3747. that.$message.error(response.data.msg)
  3748. return false
  3749. } else {
  3750. if (response.data.data.failed_code == -10) {
  3751. that.$confirm(response.data.data.msg, '医保错误信息', {
  3752. confirmButtonText: '确 定',
  3753. type: 'warning'
  3754. }).then(() => {
  3755. }).catch(() => {
  3756. })
  3757. } else {
  3758. that.changeRadioAndPatient(1)
  3759. that.$message({ message: '退号成功', type: 'success' })
  3760. }
  3761. }
  3762. })
  3763. .catch(function(error) {
  3764. })
  3765. }).catch(() => {
  3766. })
  3767. break
  3768. }
  3769. }
  3770. },
  3771. mounted() {
  3772. const that = this
  3773. window.onresize = () => {
  3774. return (() => {
  3775. window.fullHeight = document.documentElement.clientHeight
  3776. that.fullHeight = window.fullHeight
  3777. })()
  3778. }
  3779. },
  3780. watch: {
  3781. fullHeight(val) {
  3782. if (!this.timer) {
  3783. this.fullHeight = val
  3784. let tableHeight = val - 243
  3785. this.tableHeight = tableHeight
  3786. this.timer = true
  3787. let that = this
  3788. setTimeout(function() {
  3789. that.timer = false
  3790. }, 400)
  3791. }
  3792. }
  3793. }
  3794. }
  3795. </script>
  3796. <style lang="scss" scoped>
  3797. .app-container {
  3798. height: 100%;
  3799. }
  3800. .outpatientChargesManagement {
  3801. height: 100%;
  3802. display: flex;
  3803. flex-direction: column;
  3804. .mainLeft {
  3805. width: 200px;
  3806. height: 100%;
  3807. display: flex;
  3808. flex-direction: column;
  3809. padding-top: 20px;
  3810. .el-radio {
  3811. margin-right: 5px;
  3812. }
  3813. }
  3814. .mainCell {
  3815. height: 36px;
  3816. display: flex;
  3817. align-items: center;
  3818. }
  3819. .fixedCell {
  3820. position: fixed;
  3821. z-index: 99;
  3822. right: 42px;
  3823. background: #fff;
  3824. display: flex;
  3825. justify-content: space-between;
  3826. }
  3827. .mainRight {
  3828. margin-left: 10px;
  3829. flex: 1;
  3830. height: 100%;
  3831. display: flex;
  3832. flex-direction: column;
  3833. overflow-y: auto;
  3834. .cellSpan {
  3835. min-width: 80px;
  3836. display: inline-block;
  3837. margin-right: 10px;
  3838. }
  3839. }
  3840. .tabsBox {
  3841. position: relative;
  3842. height: 90%;
  3843. overflow-y: auto;
  3844. margin-bottom: 60px;
  3845. .el-tabs__item {
  3846. padding: 0 10px;
  3847. }
  3848. }
  3849. .addTab {
  3850. position: absolute;
  3851. right: 6px;
  3852. top: 3px;
  3853. z-index: 20;
  3854. }
  3855. .mainCenter {
  3856. display: flex;
  3857. flex: 1;
  3858. height: 100%;
  3859. }
  3860. .costBox {
  3861. width: 100%;
  3862. height: 60px;
  3863. background: #fff;
  3864. position: absolute;
  3865. bottom: 0;
  3866. display: flex;
  3867. align-items: center;
  3868. justify-content: space-between;
  3869. }
  3870. .centerLeft {
  3871. flex: 1;
  3872. display: flex;
  3873. flex-direction: column;
  3874. position: relative;
  3875. }
  3876. .preTabs {
  3877. height: 100%;
  3878. display: flex;
  3879. flex-direction: column;
  3880. .el-tab-pane {
  3881. height: auto !important;
  3882. }
  3883. }
  3884. .settlementTabs {
  3885. flex: 1;
  3886. .el-tab-pane {
  3887. height: 100%;
  3888. }
  3889. .el-tabs__content {
  3890. height: 100%;
  3891. }
  3892. }
  3893. .centerRight {
  3894. width: 300px;
  3895. margin-left: 10px;
  3896. display: flex;
  3897. flex-direction: column;
  3898. overflow-y: auto;
  3899. }
  3900. .RP {
  3901. color: #409EFF;
  3902. font-size: 20px;
  3903. margin-bottom: 5px;
  3904. }
  3905. .centerRightTitle {
  3906. color: #409EFF;
  3907. }
  3908. .basicUl {
  3909. border-top: 1px solid #e5e5e5;
  3910. border-left: 1px solid #e5e5e5;
  3911. display: flex;
  3912. flex-wrap: wrap;
  3913. li {
  3914. border-bottom: 1px solid #e5e5e5;
  3915. border-right: 1px solid #e5e5e5;
  3916. width: 100%;
  3917. min-height: 38px;
  3918. /* line-height: 38px;
  3919. text-indent: 5px; */
  3920. font-size: 14px;
  3921. display: flex;
  3922. align-items: center;
  3923. padding: 5px;
  3924. box-sizing: border-box;
  3925. }
  3926. }
  3927. }
  3928. </style>
  3929. <style lang="scss">
  3930. #tab-more {
  3931. .el-icon-close {
  3932. display: none;
  3933. }
  3934. }
  3935. .settlementTabs {
  3936. .el-tabs__content {
  3937. height: 90%;
  3938. }
  3939. }
  3940. .preTabs {
  3941. .el-tabs__content {
  3942. flex: 1;
  3943. overflow-y: auto;
  3944. padding: 5px 0 5px 5px;
  3945. }
  3946. }
  3947. .centerDialog {
  3948. .el-dialog__body {
  3949. max-height: calc(100vh - 100px) !important;
  3950. padding: 0 20px;
  3951. }
  3952. }
  3953. </style>