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

outpatientChargesManagement.vue 229KB

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