doctorDesk.vue 259KB

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