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

doctorDesk.vue 260KB

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