doctorDesk.vue 249KB

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