Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

doctorDesk.vue 220KB

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