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

doctorDesk.vue 260KB

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