doctorDesk.vue 285KB

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