outpatientChargesManagement.vue 197KB

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