doctorDesk.vue 226KB

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