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

outpatientChargesManagement.vue 205KB

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