doctorDesk.vue 270KB

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