doctorDesk.vue 267KB

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