outpatientChargesManagement.vue 205KB

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