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

doctorDesk.vue 220KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890
  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 obj = {
  1403. advice_id: 0,
  1404. drug_name: prescription.advices[b].advice_name,
  1405. single_dose: prescription.advices[b].single_dose,
  1406. delivery_way: prescription.advices[b].delivery_way,
  1407. execution_frequency: prescription.advices[b].execution_frequency,
  1408. // retail_price: prescription.advices[b].price.toString(),
  1409. remark: prescription.advices[b].remark,
  1410. day: prescription.advices[b].day,
  1411. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1412. single_dose_unit: prescription.advices[b].single_dose_unit,
  1413. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1414. medical_insurance_number: prescription.advices[b].med_list_codg,
  1415. id: prescription.advices[b].drug_id,
  1416. drug: prescription.advices[b].drug,
  1417. groupno: prescription.advices[b].groupno,
  1418. hosp_appr_flag: '1'
  1419. }
  1420. console.log('看看数据6:')
  1421. console.log(obj.prescribing_number_unit)
  1422. console.log(prescription.advices[b].drug.min_unit)
  1423. console.log(prescription.advices[b].drug.max_unit)
  1424. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  1425. obj['retail_price'] = prescription.advices[b].drug.min_price
  1426. console.log('1')
  1427. console.log(obj.retail_price)
  1428. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  1429. obj['retail_price'] = prescription.advices[b].drug.retail_price
  1430. console.log('2')
  1431. console.log(obj.retail_price)
  1432. } else {
  1433. console.log('3')
  1434. obj['retail_price'] = prescription.advices[b].drug.min_price
  1435. console.log(obj.retail_price)
  1436. }
  1437. tempAdvice.push(obj)
  1438. }
  1439. //项目
  1440. for (let b = 0; b < prescription.project.length; b++) {
  1441. let obj = {
  1442. id: 0,
  1443. project_id: prescription.project[b].project_id,
  1444. project_name: prescription.project[b].project.project_name,
  1445. statistical_classification: prescription.project[b].project.statistical_classification,
  1446. single_dose: prescription.project[b].single_dose,
  1447. delivery_way: prescription.project[b].delivery_way,
  1448. execution_frequency: prescription.project[b].execution_frequency,
  1449. number_days: prescription.project[b].day,
  1450. total: prescription.project[b].count.toString(),
  1451. remark: prescription.project[b].remark,
  1452. medical_code: prescription.project[b].project.medical_code,
  1453. unit: prescription.project[b].project.unit,
  1454. type: prescription.project[b].type,
  1455. }
  1456. if (prescription.project[b].type == 2) {
  1457. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1458. obj['medical_code'] = prescription.project[b].project.medical_code
  1459. obj['project_name'] = prescription.project[b].project.project_name
  1460. obj['price'] = prescription.project[b].project.price
  1461. obj['project'] = prescription.project[b].project
  1462. } else if (prescription.project[b].type == 3) {
  1463. obj['statistical_classification'] = ''
  1464. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1465. obj['project_name'] = prescription.project[b].good_info.good_name
  1466. obj['price'] = prescription.project[b].good_info.packing_price
  1467. obj['good_info'] = prescription.project[b].good_info
  1468. }
  1469. tempProject.push(obj)
  1470. }
  1471. if (this.schedule.schedule_type == 1) {
  1472. var preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  1473. } else if (this.schedule.schedule_type == 2) {
  1474. var preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  1475. } else if (this.schedule.schedule_type == 3) {
  1476. var preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  1477. }
  1478. let index = i + 1
  1479. let obj = {
  1480. id: 0,
  1481. name: '处方' + index,
  1482. advices: tempAdvice,
  1483. project: tempProject,
  1484. addition: tempAddition,
  1485. order_status: 1,
  1486. pre_time: preTime,
  1487. med_type: ''
  1488. }
  1489. if (prescription.med_type == 0 || prescription.med_type == '') {
  1490. obj.med_type = ''
  1491. } else {
  1492. obj.med_type = parseInt(prescription.med_type)
  1493. }
  1494. if (obj.med_type == 0 || obj.med_type == '') {
  1495. obj.med_type = 14
  1496. }
  1497. this.prescriptions.push(obj)
  1498. }
  1499. } else {
  1500. let obj = {
  1501. id: 0,
  1502. name: '处方' + 1,
  1503. advices: [],
  1504. project: [],
  1505. addition: [],
  1506. order_status: 0,
  1507. pre_time: nowTime,
  1508. med_type: ''
  1509. }
  1510. obj.med_type = 14
  1511. this.prescriptions.push(obj)
  1512. }
  1513. }
  1514. console.log('~~~~~00000222222')
  1515. 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)
  1516. }
  1517. })
  1518. },
  1519. choosePatient(val) {
  1520. if (this.titleType == '电子病历') {
  1521. if (this.$refs.child.watchSign > 2) {
  1522. this.$confirm('是否保存当前病例', '保存', {
  1523. confirmButtonText: '确 定',
  1524. cancelButtonText: '取 消',
  1525. type: 'warning'
  1526. }).then(() => {
  1527. this.$refs.child.createCaseHistory(this.newPatientId)
  1528. this.patientid = val.id
  1529. let params = {
  1530. 'record_date': this.record_date,
  1531. 'patient_id': val.id,
  1532. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1533. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  1534. 'p_type': 2
  1535. }
  1536. var nowDate = new Date()
  1537. var nowYear = nowDate.getFullYear()
  1538. var nowMonth = nowDate.getMonth() + 1
  1539. var nowDay = nowDate.getDate()
  1540. var hours = nowDate.getHours()
  1541. var min = nowDate.getMinutes()
  1542. var nowTime =
  1543. nowYear +
  1544. '-' +
  1545. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1546. '-' +
  1547. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1548. ':' + (min < 10 ? '0' + min : min)
  1549. getPatientInfo(params).then(response => {
  1550. if (response.data.state == 0) {
  1551. this.$message.error(response.data.msg)
  1552. return false
  1553. } else {
  1554. if(response.data.data.sch_prescriptions== null){
  1555. response.data.data.sch_prescriptions = []
  1556. }
  1557. for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
  1558. if(response.data.data.sch_prescriptions[i].advices == null){
  1559. response.data.data.sch_prescriptions[i].advices = []
  1560. }
  1561. if(response.data.data.sch_prescriptions[i].project == null){
  1562. response.data.data.sch_prescriptions[i].project = []
  1563. }
  1564. }
  1565. this.prescriptions = []
  1566. this.month_prescriptions = []
  1567. // var month_prescriptions = response.data.data.month_prescriptions
  1568. // this.setMonthPrescription(month_prescriptions)
  1569. this.patientInfo = response.data.data.xt_info
  1570. this.hisPatientInfo = response.data.data.his_info
  1571. this.case_history = response.data.data.case_history
  1572. this.info = response.data.data.info
  1573. this.last_info = response.data.data.last_info
  1574. this.schedule = response.data.data.schedule
  1575. this.doctors = response.data.data.doctors
  1576. this.department = response.data.data.department
  1577. for (let i = 0; i < this.doctors.length; i++) {
  1578. if (this.doctors[i].user_type == 1) {
  1579. this.doctors.splice(i, 1)
  1580. }
  1581. }
  1582. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  1583. if (this.case_history.breathing <= 0) {
  1584. this.case_history.breathing = ''
  1585. }
  1586. if (this.case_history.sick <= 0) {
  1587. this.case_history.sick = ''
  1588. }
  1589. if (this.case_history.diagnose <= 0) {
  1590. this.case_history.diagnose = ''
  1591. }
  1592. if (this.case_history.temperature <= 0) {
  1593. this.case_history.temperature = ''
  1594. }
  1595. if (this.case_history.blood_sugar <= 0) {
  1596. this.case_history.blood_sugar = ''
  1597. }
  1598. if (this.case_history.pulse <= 0) {
  1599. this.case_history.pulse = ''
  1600. }
  1601. if (this.case_history.sbp <= 0) {
  1602. this.case_history.sbp = ''
  1603. }
  1604. if (this.case_history.dbp <= 0) {
  1605. this.case_history.dbp = ''
  1606. }
  1607. if (this.case_history.height <= 0) {
  1608. this.case_history.height = ''
  1609. }
  1610. if (this.case_history.blood_fat <= 0) {
  1611. this.case_history.blood_fat = ''
  1612. }
  1613. if (this.case_history.sick_type <= 0) {
  1614. this.case_history.sick_type = ''
  1615. }
  1616. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  1617. if (this.case_history.is_infect == 1) {
  1618. this.case_history.is_infect = true
  1619. } else {
  1620. this.case_history.is_infect = false
  1621. }
  1622. this.prescriptionList = response.data.data.prescription
  1623. if (response.data.data.prescription.length > 0) {
  1624. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1625. var prescription = response.data.data.prescription[i]
  1626. let tempAdvice = []
  1627. let tempProject = []
  1628. let tempAddition = []
  1629. //药品
  1630. for (let b = 0; b < prescription.advices.length; b++) {
  1631. let obj = {
  1632. advice_id: prescription.advices[b].id,
  1633. drug_name: prescription.advices[b].advice_name,
  1634. single_dose: prescription.advices[b].single_dose,
  1635. delivery_way: prescription.advices[b].delivery_way,
  1636. execution_frequency: prescription.advices[b].execution_frequency,
  1637. retail_price: prescription.advices[b].price.toString(),
  1638. remark: prescription.advices[b].remark,
  1639. day: prescription.advices[b].day,
  1640. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1641. single_dose_unit: prescription.advices[b].single_dose_unit,
  1642. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1643. medical_insurance_number: prescription.advices[b].med_list_codg,
  1644. id: prescription.advices[b].drug_id,
  1645. drug: prescription.advices[b].drug,
  1646. groupno: prescription.advices[b].groupno,
  1647. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  1648. }
  1649. tempAdvice.push(obj)
  1650. }
  1651. //项目
  1652. for (let b = 0; b < prescription.project.length; b++) {
  1653. let obj = {
  1654. id: prescription.project[b].id,
  1655. project_id: prescription.project[b].project_id,
  1656. project_name: prescription.project[b].project.project_name,
  1657. statistical_classification: prescription.project[b].project.statistical_classification,
  1658. single_dose: prescription.project[b].single_dose,
  1659. delivery_way: prescription.project[b].delivery_way,
  1660. execution_frequency: prescription.project[b].execution_frequency,
  1661. number_days: prescription.project[b].day,
  1662. total: prescription.project[b].count.toString(),
  1663. price: prescription.project[b].price,
  1664. remark: prescription.project[b].remark,
  1665. medical_code: prescription.project[b].project.medical_code,
  1666. unit: prescription.project[b].project.unit,
  1667. type: prescription.project[b].type
  1668. }
  1669. if (prescription.project[b].type == 2) {
  1670. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1671. obj['medical_code'] = prescription.project[b].project.medical_code
  1672. obj['project_name'] = prescription.project[b].project.project_name
  1673. obj['project'] = prescription.project[b].project
  1674. } else if (prescription.project[b].type == 3) {
  1675. obj['statistical_classification'] = ''
  1676. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1677. obj['project_name'] = prescription.project[b].good_info.good_name
  1678. obj['good_info'] = prescription.project[b].good_info
  1679. }
  1680. tempProject.push(obj)
  1681. }
  1682. //附加收费
  1683. for (let b = 0; b < prescription.addition.length; b++) {
  1684. let obj = {
  1685. id: prescription.addition[b].id,
  1686. item_name: prescription.addition[b].item_name,
  1687. price: prescription.addition[b].price,
  1688. count: prescription.addition[b].count,
  1689. item_id: prescription.addition[b].item_id
  1690. }
  1691. tempAddition.push(obj)
  1692. }
  1693. var preTime = ''
  1694. if (prescription.pre_time == 0) {
  1695. // preTime = nowTime
  1696. if (this.schedule.schedule_type == 1) {
  1697. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  1698. } else if (this.schedule.schedule_type == 2) {
  1699. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  1700. } else if (this.schedule.schedule_type == 3) {
  1701. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  1702. }
  1703. } else {
  1704. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  1705. }
  1706. let index = i + 1
  1707. let obj = {
  1708. id: prescription.id,
  1709. name: '处方' + index,
  1710. advices: tempAdvice,
  1711. project: tempProject,
  1712. addition: tempAddition,
  1713. order_status: prescription.order_status,
  1714. pre_time: preTime,
  1715. med_type: parseInt(prescription.med_type)
  1716. }
  1717. this.prescriptions.push(obj)
  1718. }
  1719. } else {
  1720. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  1721. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  1722. var prescription = response.data.data.sch_prescriptions[i]
  1723. for (let b = 0; b < prescription.advices.length; b++) {
  1724. console.log(prescription.advices[b].drug.is_special_diseases)
  1725. if (prescription.med_type == '14' && prescription.advices[b].drug.is_special_diseases != 1) {
  1726. prescription.advices.splice(b--, 1)
  1727. }
  1728. }
  1729. for (let b = 0; b < prescription.project.length; b++) {
  1730. if (prescription.project[b].type == 2) {
  1731. if (prescription.med_type == '14' && prescription.project[b].project.disease_directory != 1) {
  1732. prescription.project.splice(b--, 1)
  1733. }
  1734. } else if (prescription.project[b].type == 3) {
  1735. if (prescription.med_type == '14' && prescription.project[b].good_info.is_special_diseases != 1) {
  1736. prescription.project.splice(b--, 1)
  1737. }
  1738. }
  1739. }
  1740. }
  1741. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  1742. var prescription = response.data.data.sch_prescriptions[i]
  1743. let tempAdvice = []
  1744. let tempProject = []
  1745. let tempAddition = []
  1746. //药品
  1747. for (let b = 0; b < prescription.advices.length; b++) {
  1748. let obj = {
  1749. advice_id: 0,
  1750. drug_name: prescription.advices[b].advice_name,
  1751. single_dose: prescription.advices[b].single_dose,
  1752. delivery_way: prescription.advices[b].delivery_way,
  1753. execution_frequency: prescription.advices[b].execution_frequency,
  1754. // retail_price: prescription.advices[b].price.toString(),
  1755. remark: prescription.advices[b].remark,
  1756. day: prescription.advices[b].day,
  1757. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1758. single_dose_unit: prescription.advices[b].single_dose_unit,
  1759. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1760. medical_insurance_number: prescription.advices[b].med_list_codg,
  1761. id: prescription.advices[b].drug_id,
  1762. drug: prescription.advices[b].drug,
  1763. groupno: prescription.advices[b].groupno,
  1764. hosp_appr_flag: '1'
  1765. }
  1766. console.log('看看数据1:')
  1767. console.log(obj.prescribing_number_unit)
  1768. console.log(prescription.advices[b].drug.min_unit)
  1769. console.log(prescription.advices[b].drug.max_unit)
  1770. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  1771. obj['retail_price'] = prescription.advices[b].drug.min_price
  1772. console.log('1')
  1773. console.log(obj.retail_price)
  1774. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  1775. obj['retail_price'] = prescription.advices[b].drug.retail_price
  1776. console.log('2')
  1777. console.log(obj.retail_price)
  1778. } else {
  1779. console.log('3')
  1780. obj['retail_price'] = prescription.advices[b].drug.min_price
  1781. console.log(obj.retail_price)
  1782. }
  1783. tempAdvice.push(obj)
  1784. }
  1785. //项目
  1786. for (let b = 0; b < prescription.project.length; b++) {
  1787. let obj = {
  1788. id: 0,
  1789. project_id: prescription.project[b].project_id,
  1790. project_name: prescription.project[b].project.project_name,
  1791. statistical_classification: prescription.project[b].project.statistical_classification,
  1792. single_dose: prescription.project[b].single_dose,
  1793. delivery_way: prescription.project[b].delivery_way,
  1794. execution_frequency: prescription.project[b].execution_frequency,
  1795. number_days: prescription.project[b].day,
  1796. total: prescription.project[b].count.toString(),
  1797. remark: prescription.project[b].remark,
  1798. medical_code: prescription.project[b].project.medical_code,
  1799. unit: prescription.project[b].project.unit,
  1800. type: prescription.project[b].type
  1801. }
  1802. if (prescription.project[b].type == 2) {
  1803. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1804. obj['medical_code'] = prescription.project[b].project.medical_code
  1805. obj['project_name'] = prescription.project[b].project.project_name
  1806. obj['price'] = prescription.project[b].project.price
  1807. obj['project'] = prescription.project[b].project
  1808. } else if (prescription.project[b].type == 3) {
  1809. obj['statistical_classification'] = ''
  1810. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1811. obj['project_name'] = prescription.project[b].good_info.good_name
  1812. obj['price'] = prescription.project[b].good_info.packing_price
  1813. obj['good_info'] = prescription.project[b].good_info
  1814. }
  1815. tempProject.push(obj)
  1816. }
  1817. // var preTime = nowTime
  1818. var preTime = ''
  1819. if (this.schedule.schedule_type == 1) {
  1820. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  1821. } else if (this.schedule.schedule_type == 2) {
  1822. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  1823. } else if (this.schedule.schedule_type == 3) {
  1824. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  1825. }
  1826. let index = i + 1
  1827. let obj = {
  1828. id: 0,
  1829. name: '处方' + index,
  1830. advices: tempAdvice,
  1831. project: tempProject,
  1832. addition: tempAddition,
  1833. order_status: 1,
  1834. pre_time: preTime,
  1835. med_type: ''
  1836. }
  1837. if (prescription.med_type == 0 || prescription.med_type == '') {
  1838. obj.med_type = ''
  1839. } else {
  1840. obj.med_type = parseInt(prescription.med_type)
  1841. }
  1842. if (obj.med_type == 0 || obj.med_type == '') {
  1843. obj.med_type = 14
  1844. }
  1845. this.prescriptions.push(obj)
  1846. }
  1847. } else {
  1848. let obj = {
  1849. id: 0,
  1850. name: '处方' + 1,
  1851. advices: [],
  1852. project: [],
  1853. addition: [],
  1854. order_status: 0,
  1855. pre_time: nowTime,
  1856. med_type: ''
  1857. }
  1858. obj.med_type = 14
  1859. this.prescriptions.push(obj)
  1860. // if(response.data.data.count <= 1 ){
  1861. // if(response.data.data.last_prescriptions.length == 0){
  1862. // let obj = {
  1863. // id: 0,
  1864. // name: '处方' + 1,
  1865. // advices: [],
  1866. // project: [],
  1867. // addition: [],
  1868. // order_status: 0,
  1869. // pre_time: nowTime,
  1870. //
  1871. // };
  1872. // this.prescriptions.push(obj)
  1873. //
  1874. //
  1875. // }else {
  1876. // for (let i = 0; i < response.data.data.last_prescriptions.length; i++) {
  1877. // var prescription = response.data.data.last_prescriptions[i];
  1878. // let tempAdvice = [];
  1879. // let tempProject = [];
  1880. // let tempAddition = [];
  1881. //
  1882. // //药品
  1883. // for (let b = 0; b < prescription.advices.length; b++) {
  1884. // let obj = {
  1885. // advice_id:0,
  1886. // drug_name: prescription.advices[b].advice_name,
  1887. // single_dose: prescription.advices[b].single_dose,
  1888. // delivery_way: prescription.advices[b].delivery_way,
  1889. // execution_frequency: prescription.advices[b].execution_frequency,
  1890. // retail_price: prescription.advices[b].price.toString(),
  1891. // remark: prescription.advices[b].remark,
  1892. // day: prescription.advices[b].day,
  1893. // prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1894. // single_dose_unit: prescription.advices[b].single_dose_unit,
  1895. // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1896. // medical_insurance_number: prescription.advices[b].med_list_codg,
  1897. // id: prescription.advices[b].drug_id,
  1898. // drug:prescription.advices[b].drug
  1899. //
  1900. // };
  1901. // tempAdvice.push(obj)
  1902. // }
  1903. //
  1904. // //项目
  1905. // for (let b = 0; b < prescription.project.length; b++) {
  1906. // let obj = {
  1907. // id:0,
  1908. // project_id: prescription.project[b].project_id,
  1909. // project_name: prescription.project[b].project.project_name,
  1910. // statistical_classification: prescription.project[b].project.statistical_classification,
  1911. // single_dose: prescription.project[b].single_dose,
  1912. // delivery_way: prescription.project[b].delivery_way,
  1913. // execution_frequency: prescription.project[b].execution_frequency,
  1914. // number_days: prescription.project[b].day,
  1915. // total: prescription.project[b].count.toString(),
  1916. // price: prescription.project[b].price,
  1917. // remark: prescription.project[b].remark,
  1918. // medical_code: prescription.project[b].project.medical_code,
  1919. // unit: prescription.project[b].project.unit,
  1920. // type: prescription.project[b].type
  1921. // };
  1922. //
  1923. // if (prescription.project[b].type == 2) {
  1924. // obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1925. // obj['medical_code'] = prescription.project[b].project.medical_code
  1926. // obj['project_name'] = prescription.project[b].project.project_name
  1927. //
  1928. // } else if (prescription.project[b].type == 3) {
  1929. // obj['statistical_classification'] = ""
  1930. // obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1931. // obj['project_name'] = prescription.project[b].good_info.good_name
  1932. // }
  1933. // tempProject.push(obj)
  1934. // }
  1935. //
  1936. // //附加收费
  1937. // for (let b = 0; b < prescription.addition.length; b++) {
  1938. // let obj = {
  1939. // item_name: prescription.addition[b].item_name,
  1940. // price: prescription.addition[b].price,
  1941. // count: prescription.addition[b].count,
  1942. // item_id: prescription.addition[b].item_id,
  1943. // };
  1944. // tempAddition.push(obj)
  1945. // }
  1946. //
  1947. // var preTime = nowTime
  1948. //
  1949. // let index = i + 1;
  1950. // let obj = {
  1951. // id: 0,
  1952. // name: '处方' + index,
  1953. // advices: tempAdvice,
  1954. // project: tempProject,
  1955. // addition: tempAddition,
  1956. // order_status: 1,
  1957. // pre_time: preTime
  1958. // };
  1959. // this.prescriptions.push(obj)
  1960. // }
  1961. // }
  1962. // }
  1963. // else{
  1964. // let obj = {
  1965. // id: 0,
  1966. // name: '处方' + 1,
  1967. // advices: [],
  1968. // project: [],
  1969. // addition: [],
  1970. // order_status: 0,
  1971. // pre_time: nowTime,
  1972. //
  1973. // };
  1974. // this.prescriptions.push(obj)
  1975. // }
  1976. }
  1977. }
  1978. 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)
  1979. this.$refs.child.watchSign = 0
  1980. }
  1981. })
  1982. this.$refs.child.watchSign = 0
  1983. }).catch(() => {
  1984. this.patientid = val.id
  1985. let params = {
  1986. 'record_date': this.record_date,
  1987. 'patient_id': val.id,
  1988. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  1989. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  1990. 'p_type': 2
  1991. }
  1992. getPatientInfo(params).then(response => {
  1993. if (response.data.state == 0) {
  1994. this.$message.error(response.data.msg)
  1995. return false
  1996. } else {
  1997. if(response.data.data.sch_prescriptions== null){
  1998. response.data.data.sch_prescriptions = []
  1999. }
  2000. for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
  2001. if(response.data.data.sch_prescriptions[i].advices == null){
  2002. response.data.data.sch_prescriptions[i].advices = []
  2003. }
  2004. if(response.data.data.sch_prescriptions[i].project == null){
  2005. response.data.data.sch_prescriptions[i].project = []
  2006. }
  2007. }
  2008. this.prescriptions = []
  2009. this.month_prescriptions = []
  2010. // var month_prescriptions = response.data.data.month_prescriptions
  2011. // this.setMonthPrescription(month_prescriptions)
  2012. this.patientInfo = response.data.data.xt_info
  2013. this.hisPatientInfo = response.data.data.his_info
  2014. this.case_history = response.data.data.case_history
  2015. this.info = response.data.data.info
  2016. this.last_info = response.data.data.last_info
  2017. this.doctors = response.data.data.doctors
  2018. this.department = response.data.data.department
  2019. for (let i = 0; i < this.doctors.length; i++) {
  2020. if (this.doctors[i].user_type == 1) {
  2021. this.doctors.splice(i, 1)
  2022. }
  2023. }
  2024. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  2025. if (this.case_history.breathing <= 0) {
  2026. this.case_history.breathing = ''
  2027. }
  2028. if (this.case_history.sick <= 0) {
  2029. this.case_history.sick = ''
  2030. }
  2031. if (this.case_history.diagnose <= 0) {
  2032. this.case_history.diagnose = ''
  2033. }
  2034. if (this.case_history.temperature <= 0) {
  2035. this.case_history.temperature = ''
  2036. }
  2037. if (this.case_history.blood_sugar <= 0) {
  2038. this.case_history.blood_sugar = ''
  2039. }
  2040. if (this.case_history.pulse <= 0) {
  2041. this.case_history.pulse = ''
  2042. }
  2043. if (this.case_history.sbp <= 0) {
  2044. this.case_history.sbp = ''
  2045. }
  2046. if (this.case_history.dbp <= 0) {
  2047. this.case_history.dbp = ''
  2048. }
  2049. if (this.case_history.height <= 0) {
  2050. this.case_history.height = ''
  2051. }
  2052. if (this.case_history.blood_fat <= 0) {
  2053. this.case_history.blood_fat = ''
  2054. }
  2055. if (this.case_history.sick_type <= 0) {
  2056. this.case_history.sick_type = ''
  2057. }
  2058. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  2059. if (this.case_history.is_infect == 1) {
  2060. this.case_history.is_infect = true
  2061. } else {
  2062. this.case_history.is_infect = false
  2063. }
  2064. this.prescriptionList = response.data.data.prescription
  2065. if (response.data.data.prescription.length > 0) {
  2066. for (let i = 0; i < response.data.data.prescription.length; i++) {
  2067. var prescription = response.data.data.prescription[i]
  2068. let tempAdvice = []
  2069. let tempProject = []
  2070. let tempAddition = []
  2071. //药品
  2072. for (let b = 0; b < prescription.advices.length; b++) {
  2073. let obj = {
  2074. advice_id: prescription.advices[b].id,
  2075. drug_name: prescription.advices[b].advice_name,
  2076. single_dose: prescription.advices[b].single_dose,
  2077. delivery_way: prescription.advices[b].delivery_way,
  2078. execution_frequency: prescription.advices[b].execution_frequency,
  2079. retail_price: prescription.advices[b].price.toString(),
  2080. remark: prescription.advices[b].remark,
  2081. day: prescription.advices[b].day,
  2082. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2083. single_dose_unit: prescription.advices[b].single_dose_unit,
  2084. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2085. medical_insurance_number: prescription.advices[b].med_list_codg,
  2086. id: prescription.advices[b].drug_id,
  2087. drug: prescription.advices[b].drug,
  2088. groupno: prescription.advices[b].groupno,
  2089. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  2090. }
  2091. tempAdvice.push(obj)
  2092. }
  2093. //项目
  2094. for (let b = 0; b < prescription.project.length; b++) {
  2095. let obj = {
  2096. id: prescription.project[b].id,
  2097. project_id: prescription.project[b].project_id,
  2098. project_name: prescription.project[b].project.project_name,
  2099. statistical_classification: prescription.project[b].project.statistical_classification,
  2100. single_dose: prescription.project[b].single_dose,
  2101. delivery_way: prescription.project[b].delivery_way,
  2102. execution_frequency: prescription.project[b].execution_frequency,
  2103. number_days: prescription.project[b].day,
  2104. total: prescription.project[b].count.toString(),
  2105. price: prescription.project[b].price,
  2106. remark: prescription.project[b].remark,
  2107. medical_code: prescription.project[b].project.medical_code,
  2108. unit: prescription.project[b].project.unit,
  2109. type: prescription.project[b].type
  2110. }
  2111. if (prescription.project[b].type == 2) {
  2112. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2113. obj['medical_code'] = prescription.project[b].project.medical_code
  2114. obj['project_name'] = prescription.project[b].project.project_name
  2115. obj['project'] = prescription.project[b].project
  2116. } else if (prescription.project[b].type == 3) {
  2117. obj['statistical_classification'] = ''
  2118. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2119. obj['project_name'] = prescription.project[b].good_info.good_name
  2120. obj['good_info'] = prescription.project[b].good_info
  2121. }
  2122. tempProject.push(obj)
  2123. }
  2124. //附加收费
  2125. for (let b = 0; b < prescription.addition.length; b++) {
  2126. let obj = {
  2127. id: prescription.addition[b].id,
  2128. item_name: prescription.addition[b].item_name,
  2129. price: prescription.addition[b].price,
  2130. count: prescription.addition[b].count,
  2131. item_id: prescription.addition[b].item_id
  2132. }
  2133. tempAddition.push(obj)
  2134. }
  2135. var preTime = ''
  2136. if (prescription.pre_time == 0) {
  2137. preTime = nowTime
  2138. } else {
  2139. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  2140. }
  2141. let index = i + 1
  2142. let obj = {
  2143. id: prescription.id,
  2144. name: '处方' + index,
  2145. advices: tempAdvice,
  2146. project: tempProject,
  2147. addition: tempAddition,
  2148. order_status: prescription.order_status,
  2149. pre_time: preTime,
  2150. med_type: parseInt(prescription.med_type)
  2151. }
  2152. this.prescriptions.push(obj)
  2153. }
  2154. } else {
  2155. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  2156. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2157. var prescription = response.data.data.sch_prescriptions[i]
  2158. for (let b = 0; b < prescription.advices.length; b++) {
  2159. console.log(prescription.advices[b].drug.is_special_diseases)
  2160. if (prescription.med_type == '14' && prescription.advices[b].drug.is_special_diseases != 1) {
  2161. prescription.advices.splice(b--, 1)
  2162. }
  2163. }
  2164. for (let b = 0; b < prescription.project.length; b++) {
  2165. if (prescription.project[b].type == 2) {
  2166. if (prescription.med_type == '14' && prescription.project[b].project.disease_directory != 1) {
  2167. prescription.project.splice(b--, 1)
  2168. }
  2169. } else if (prescription.project[b].type == 3) {
  2170. if (prescription.med_type == '14' && prescription.project[b].good_info.is_special_diseases != 1) {
  2171. prescription.project.splice(b--, 1)
  2172. }
  2173. }
  2174. }
  2175. }
  2176. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2177. var prescription = response.data.data.sch_prescriptions[i]
  2178. let tempAdvice = []
  2179. let tempProject = []
  2180. let tempAddition = []
  2181. //药品
  2182. for (let b = 0; b < prescription.advices.length; b++) {
  2183. let obj = {
  2184. advice_id: 0,
  2185. drug_name: prescription.advices[b].advice_name,
  2186. single_dose: prescription.advices[b].single_dose,
  2187. delivery_way: prescription.advices[b].delivery_way,
  2188. execution_frequency: prescription.advices[b].execution_frequency,
  2189. // retail_price: prescription.advices[b].price.toString(),
  2190. remark: prescription.advices[b].remark,
  2191. day: prescription.advices[b].day,
  2192. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2193. single_dose_unit: prescription.advices[b].single_dose_unit,
  2194. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2195. medical_insurance_number: prescription.advices[b].med_list_codg,
  2196. id: prescription.advices[b].drug_id,
  2197. drug: prescription.advices[b].drug,
  2198. groupno: prescription.advices[b].groupno,
  2199. hosp_appr_flag: '1'
  2200. }
  2201. console.log('看看数据2:')
  2202. console.log(obj.prescribing_number_unit)
  2203. console.log(prescription.advices[b].drug.min_unit)
  2204. console.log(prescription.advices[b].drug.max_unit)
  2205. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  2206. obj['retail_price'] = prescription.advices[b].drug.min_price
  2207. console.log('1')
  2208. console.log(obj.retail_price)
  2209. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  2210. obj['retail_price'] = prescription.advices[b].drug.retail_price
  2211. console.log('2')
  2212. console.log(obj.retail_price)
  2213. } else {
  2214. console.log('3')
  2215. obj['retail_price'] = prescription.advices[b].drug.min_price
  2216. console.log(obj.retail_price)
  2217. }
  2218. tempAdvice.push(obj)
  2219. }
  2220. //项目
  2221. for (let b = 0; b < prescription.project.length; b++) {
  2222. let obj = {
  2223. id: 0,
  2224. project_id: prescription.project[b].project_id,
  2225. project_name: prescription.project[b].project.project_name,
  2226. statistical_classification: prescription.project[b].project.statistical_classification,
  2227. single_dose: prescription.project[b].single_dose,
  2228. delivery_way: prescription.project[b].delivery_way,
  2229. execution_frequency: prescription.project[b].execution_frequency,
  2230. number_days: prescription.project[b].day,
  2231. total: prescription.project[b].count.toString(),
  2232. remark: prescription.project[b].remark,
  2233. medical_code: prescription.project[b].project.medical_code,
  2234. unit: prescription.project[b].project.unit,
  2235. type: prescription.project[b].type
  2236. }
  2237. if (prescription.project[b].type == 2) {
  2238. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2239. obj['medical_code'] = prescription.project[b].project.medical_code
  2240. obj['project_name'] = prescription.project[b].project.project_name
  2241. obj['price'] = prescription.project[b].project.price
  2242. obj['project'] = prescription.project[b].project
  2243. } else if (prescription.project[b].type == 3) {
  2244. obj['statistical_classification'] = ''
  2245. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2246. obj['project_name'] = prescription.project[b].good_info.good_name
  2247. obj['price'] = prescription.project[b].good_info.packing_price
  2248. obj['good_info'] = prescription.project[b].good_info
  2249. }
  2250. tempProject.push(obj)
  2251. }
  2252. var preTime = nowTime
  2253. let index = i + 1
  2254. let obj = {
  2255. id: 0,
  2256. name: '处方' + index,
  2257. advices: tempAdvice,
  2258. project: tempProject,
  2259. addition: tempAddition,
  2260. order_status: 1,
  2261. pre_time: preTime,
  2262. med_type: ''
  2263. }
  2264. if (prescription.med_type == 0 || prescription.med_type == '') {
  2265. obj.med_type = ''
  2266. } else {
  2267. obj.med_type = parseInt(prescription.med_type)
  2268. }
  2269. if (obj.med_type == 0 || obj.med_type == '') {
  2270. obj.med_type = 14
  2271. }
  2272. this.prescriptions.push(obj)
  2273. }
  2274. } else {
  2275. let obj = {
  2276. id: 0,
  2277. name: '处方' + 1,
  2278. advices: [],
  2279. project: [],
  2280. addition: [],
  2281. order_status: 0,
  2282. pre_time: nowTime,
  2283. med_type: ''
  2284. }
  2285. obj.med_type = 14
  2286. this.prescriptions.push(obj)
  2287. // if(response.data.data.count <= 1 ){
  2288. // if(response.data.data.last_prescriptions.length == 0){
  2289. // let obj = {
  2290. // id: 0,
  2291. // name: '处方' + 1,
  2292. // advices: [],
  2293. // project: [],
  2294. // addition: [],
  2295. // order_status: 0,
  2296. // pre_time: nowTime,
  2297. //
  2298. // };
  2299. // this.prescriptions.push(obj)
  2300. //
  2301. //
  2302. // }else {
  2303. // for (let i = 0; i < response.data.data.last_prescriptions.length; i++) {
  2304. // var prescription = response.data.data.last_prescriptions[i];
  2305. // let tempAdvice = [];
  2306. // let tempProject = [];
  2307. // let tempAddition = [];
  2308. //
  2309. // //药品
  2310. // for (let b = 0; b < prescription.advices.length; b++) {
  2311. // let obj = {
  2312. // advice_id:0,
  2313. // drug_name: prescription.advices[b].advice_name,
  2314. // single_dose: prescription.advices[b].single_dose,
  2315. // delivery_way: prescription.advices[b].delivery_way,
  2316. // execution_frequency: prescription.advices[b].execution_frequency,
  2317. // retail_price: prescription.advices[b].price.toString(),
  2318. // remark: prescription.advices[b].remark,
  2319. // day: prescription.advices[b].day,
  2320. // prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2321. // single_dose_unit: prescription.advices[b].single_dose_unit,
  2322. // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2323. // medical_insurance_number: prescription.advices[b].med_list_codg,
  2324. // id: prescription.advices[b].drug_id,
  2325. // drug:prescription.advices[b].drug
  2326. //
  2327. // };
  2328. // tempAdvice.push(obj)
  2329. // }
  2330. //
  2331. // //项目
  2332. // for (let b = 0; b < prescription.project.length; b++) {
  2333. // let obj = {
  2334. // id:0,
  2335. // project_id: prescription.project[b].project_id,
  2336. // project_name: prescription.project[b].project.project_name,
  2337. // statistical_classification: prescription.project[b].project.statistical_classification,
  2338. // single_dose: prescription.project[b].single_dose,
  2339. // delivery_way: prescription.project[b].delivery_way,
  2340. // execution_frequency: prescription.project[b].execution_frequency,
  2341. // number_days: prescription.project[b].day,
  2342. // total: prescription.project[b].count.toString(),
  2343. // price: prescription.project[b].price,
  2344. // remark: prescription.project[b].remark,
  2345. // medical_code: prescription.project[b].project.medical_code,
  2346. // unit: prescription.project[b].project.unit,
  2347. // type: prescription.project[b].type
  2348. // };
  2349. //
  2350. // if (prescription.project[b].type == 2) {
  2351. // obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2352. // obj['medical_code'] = prescription.project[b].project.medical_code
  2353. // obj['project_name'] = prescription.project[b].project.project_name
  2354. //
  2355. // } else if (prescription.project[b].type == 3) {
  2356. // obj['statistical_classification'] = ""
  2357. // obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2358. // obj['project_name'] = prescription.project[b].good_info.good_name
  2359. // }
  2360. // tempProject.push(obj)
  2361. // }
  2362. //
  2363. // //附加收费
  2364. // for (let b = 0; b < prescription.addition.length; b++) {
  2365. // let obj = {
  2366. // item_name: prescription.addition[b].item_name,
  2367. // price: prescription.addition[b].price,
  2368. // count: prescription.addition[b].count,
  2369. // item_id: prescription.addition[b].item_id,
  2370. // };
  2371. // tempAddition.push(obj)
  2372. // }
  2373. //
  2374. // var preTime = nowTime
  2375. //
  2376. // let index = i + 1;
  2377. // let obj = {
  2378. // id: 0,
  2379. // name: '处方' + index,
  2380. // advices: tempAdvice,
  2381. // project: tempProject,
  2382. // addition: tempAddition,
  2383. // order_status: 1,
  2384. // pre_time: preTime
  2385. // };
  2386. // this.prescriptions.push(obj)
  2387. // }
  2388. // }
  2389. // }else{
  2390. // let obj = {
  2391. // id: 0,
  2392. // name: '处方' + 1,
  2393. // advices: [],
  2394. // project: [],
  2395. // addition: [],
  2396. // order_status: 0,
  2397. // pre_time: nowTime,
  2398. //
  2399. // };
  2400. // this.prescriptions.push(obj)
  2401. // }
  2402. }
  2403. }
  2404. 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)
  2405. this.$refs.child.watchSign = 0
  2406. }
  2407. })
  2408. })
  2409. this.$refs.child.watchSign = 0
  2410. } else {
  2411. this.patientid = val.id
  2412. let params = {
  2413. 'record_date': this.record_date,
  2414. 'patient_id': val.id,
  2415. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  2416. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  2417. 'p_type': 2
  2418. }
  2419. getPatientInfo(params).then(response => {
  2420. if (response.data.state == 0) {
  2421. this.$message.error(response.data.msg)
  2422. return false
  2423. } else {
  2424. if(response.data.data.sch_prescriptions== null){
  2425. response.data.data.sch_prescriptions = []
  2426. }
  2427. for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
  2428. if(response.data.data.sch_prescriptions[i].advices == null){
  2429. response.data.data.sch_prescriptions[i].advices = []
  2430. }
  2431. if(response.data.data.sch_prescriptions[i].project == null){
  2432. response.data.data.sch_prescriptions[i].project = []
  2433. }
  2434. }
  2435. this.prescriptions = []
  2436. this.month_prescriptions = []
  2437. // var month_prescriptions = response.data.data.month_prescriptions
  2438. // this.setMonthPrescription(month_prescriptions)
  2439. this.patientInfo = response.data.data.xt_info
  2440. this.hisPatientInfo = response.data.data.his_info
  2441. this.case_history = response.data.data.case_history
  2442. this.info = response.data.data.info
  2443. this.last_info = response.data.data.last_info
  2444. this.doctors = response.data.data.doctors
  2445. this.department = response.data.data.department
  2446. for (let i = 0; i < this.doctors.length; i++) {
  2447. if (this.doctors[i].user_type == 1) {
  2448. this.doctors.splice(i, 1)
  2449. }
  2450. }
  2451. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  2452. if (this.case_history.breathing <= 0) {
  2453. this.case_history.breathing = ''
  2454. }
  2455. if (this.case_history.sick <= 0) {
  2456. this.case_history.sick = ''
  2457. }
  2458. if (this.case_history.diagnose <= 0) {
  2459. this.case_history.diagnose = ''
  2460. }
  2461. if (this.case_history.temperature <= 0) {
  2462. this.case_history.temperature = ''
  2463. }
  2464. if (this.case_history.blood_sugar <= 0) {
  2465. this.case_history.blood_sugar = ''
  2466. }
  2467. if (this.case_history.pulse <= 0) {
  2468. this.case_history.pulse = ''
  2469. }
  2470. if (this.case_history.sbp <= 0) {
  2471. this.case_history.sbp = ''
  2472. }
  2473. if (this.case_history.dbp <= 0) {
  2474. this.case_history.dbp = ''
  2475. }
  2476. if (this.case_history.height <= 0) {
  2477. this.case_history.height = ''
  2478. }
  2479. if (this.case_history.blood_fat <= 0) {
  2480. this.case_history.blood_fat = ''
  2481. }
  2482. if (this.case_history.sick_type <= 0) {
  2483. this.case_history.sick_type = ''
  2484. }
  2485. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  2486. if (this.case_history.is_infect == 1) {
  2487. this.case_history.is_infect = true
  2488. } else {
  2489. this.case_history.is_infect = false
  2490. }
  2491. this.prescriptionList = response.data.data.prescription
  2492. if (response.data.data.prescription.length > 0) {
  2493. for (let i = 0; i < response.data.data.prescription.length; i++) {
  2494. var prescription = response.data.data.prescription[i]
  2495. let tempAdvice = []
  2496. let tempProject = []
  2497. let tempAddition = []
  2498. //药品
  2499. for (let b = 0; b < prescription.advices.length; b++) {
  2500. let obj = {
  2501. advice_id: prescription.advices[b].id,
  2502. drug_name: prescription.advices[b].advice_name,
  2503. single_dose: prescription.advices[b].single_dose,
  2504. delivery_way: prescription.advices[b].delivery_way,
  2505. execution_frequency: prescription.advices[b].execution_frequency,
  2506. retail_price: prescription.advices[b].price.toString(),
  2507. remark: prescription.advices[b].remark,
  2508. day: prescription.advices[b].day,
  2509. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2510. single_dose_unit: prescription.advices[b].single_dose_unit,
  2511. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2512. medical_insurance_number: prescription.advices[b].med_list_codg,
  2513. id: prescription.advices[b].drug_id,
  2514. drug: prescription.advices[b].drug,
  2515. groupno: prescription.advices[b].groupno,
  2516. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  2517. }
  2518. tempAdvice.push(obj)
  2519. }
  2520. //项目
  2521. for (let b = 0; b < prescription.project.length; b++) {
  2522. let obj = {
  2523. id: prescription.project[b].id,
  2524. project_id: prescription.project[b].project_id,
  2525. project_name: prescription.project[b].project.project_name,
  2526. statistical_classification: prescription.project[b].project.statistical_classification,
  2527. single_dose: prescription.project[b].single_dose,
  2528. delivery_way: prescription.project[b].delivery_way,
  2529. execution_frequency: prescription.project[b].execution_frequency,
  2530. number_days: prescription.project[b].day,
  2531. total: prescription.project[b].count.toString(),
  2532. price: prescription.project[b].price,
  2533. remark: prescription.project[b].remark,
  2534. medical_code: prescription.project[b].project.medical_code,
  2535. unit: prescription.project[b].project.unit,
  2536. type: prescription.project[b].type
  2537. }
  2538. if (prescription.project[b].type == 2) {
  2539. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2540. obj['medical_code'] = prescription.project[b].project.medical_code
  2541. obj['project_name'] = prescription.project[b].project.project_name
  2542. obj['project'] = prescription.project[b].project
  2543. } else if (prescription.project[b].type == 3) {
  2544. obj['statistical_classification'] = ''
  2545. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2546. obj['project_name'] = prescription.project[b].good_info.good_name
  2547. obj['good_info'] = prescription.project[b].good_info
  2548. }
  2549. tempProject.push(obj)
  2550. }
  2551. //附加收费
  2552. for (let b = 0; b < prescription.addition.length; b++) {
  2553. let obj = {
  2554. id: prescription.addition[b].id,
  2555. item_name: prescription.addition[b].item_name,
  2556. price: prescription.addition[b].price,
  2557. count: prescription.addition[b].count,
  2558. item_id: prescription.addition[b].item_id
  2559. }
  2560. tempAddition.push(obj)
  2561. }
  2562. var preTime = ''
  2563. if (prescription.pre_time == 0) {
  2564. preTime = nowTime
  2565. } else {
  2566. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  2567. }
  2568. let index = i + 1
  2569. let obj = {
  2570. id: prescription.id,
  2571. name: '处方' + index,
  2572. advices: tempAdvice,
  2573. project: tempProject,
  2574. addition: tempAddition,
  2575. order_status: prescription.order_status,
  2576. pre_time: preTime,
  2577. med_type: parseInt(prescription.med_type)
  2578. }
  2579. this.prescriptions.push(obj)
  2580. }
  2581. } else {
  2582. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  2583. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2584. var prescription = response.data.data.sch_prescriptions[i]
  2585. for (let b = 0; b < prescription.advices.length; b++) {
  2586. console.log(prescription.advices[b].drug.is_special_diseases)
  2587. if (prescription.med_type == '14' && prescription.advices[b].drug.is_special_diseases != 1) {
  2588. prescription.advices.splice(b--, 1)
  2589. }
  2590. }
  2591. for (let b = 0; b < prescription.project.length; b++) {
  2592. if (prescription.project[b].type == 2) {
  2593. if (prescription.med_type == '14' && prescription.project[b].project.disease_directory != 1) {
  2594. prescription.project.splice(b--, 1)
  2595. }
  2596. } else if (prescription.project[b].type == 3) {
  2597. if (prescription.med_type == '14' && prescription.project[b].good_info.is_special_diseases != 1) {
  2598. prescription.project.splice(b--, 1)
  2599. }
  2600. }
  2601. }
  2602. }
  2603. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  2604. var prescription = response.data.data.sch_prescriptions[i]
  2605. let tempAdvice = []
  2606. let tempProject = []
  2607. let tempAddition = []
  2608. //药品
  2609. for (let b = 0; b < prescription.advices.length; b++) {
  2610. let index = b + 1
  2611. let obj = {
  2612. advice_id: 0,
  2613. drug_name: prescription.advices[b].advice_name,
  2614. single_dose: prescription.advices[b].single_dose,
  2615. delivery_way: prescription.advices[b].delivery_way,
  2616. execution_frequency: prescription.advices[b].execution_frequency,
  2617. // retail_price: prescription.advices[b].price.toString(),
  2618. remark: prescription.advices[b].remark,
  2619. day: prescription.advices[b].day,
  2620. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2621. single_dose_unit: prescription.advices[b].single_dose_unit,
  2622. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2623. medical_insurance_number: prescription.advices[b].med_list_codg,
  2624. id: prescription.advices[b].drug_id,
  2625. drug: prescription.advices[b].drug,
  2626. groupno: prescription.advices[b].groupno,
  2627. hosp_appr_flag: '1'
  2628. }
  2629. console.log('看看数据3:')
  2630. console.log(obj.prescribing_number_unit)
  2631. console.log(prescription.advices[b].drug.min_unit)
  2632. console.log(prescription.advices[b].drug.max_unit)
  2633. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  2634. obj['retail_price'] = prescription.advices[b].drug.min_price
  2635. console.log('1')
  2636. console.log(obj.retail_price)
  2637. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  2638. obj['retail_price'] = prescription.advices[b].drug.retail_price
  2639. console.log('2')
  2640. console.log(obj.retail_price)
  2641. } else {
  2642. console.log('3')
  2643. obj['retail_price'] = prescription.advices[b].drug.min_price
  2644. console.log(obj.retail_price)
  2645. }
  2646. tempAdvice.push(obj)
  2647. }
  2648. //项目
  2649. for (let b = 0; b < prescription.project.length; b++) {
  2650. let obj = {
  2651. id: 0,
  2652. project_id: prescription.project[b].project_id,
  2653. project_name: prescription.project[b].project.project_name,
  2654. statistical_classification: prescription.project[b].project.statistical_classification,
  2655. single_dose: prescription.project[b].single_dose,
  2656. delivery_way: prescription.project[b].delivery_way,
  2657. execution_frequency: prescription.project[b].execution_frequency,
  2658. number_days: prescription.project[b].day,
  2659. total: prescription.project[b].count.toString(),
  2660. remark: prescription.project[b].remark,
  2661. medical_code: prescription.project[b].project.medical_code,
  2662. unit: prescription.project[b].project.unit,
  2663. type: prescription.project[b].type
  2664. }
  2665. if (prescription.project[b].type == 2) {
  2666. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2667. obj['medical_code'] = prescription.project[b].project.medical_code
  2668. obj['project_name'] = prescription.project[b].project.project_name
  2669. obj['price'] = prescription.project[b].project.price
  2670. obj['project'] = prescription.project[b].project
  2671. } else if (prescription.project[b].type == 3) {
  2672. obj['statistical_classification'] = ''
  2673. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2674. obj['project_name'] = prescription.project[b].good_info.good_name
  2675. obj['price'] = prescription.project[b].good_info.packing_price
  2676. obj['good_info'] = prescription.project[b].good_info
  2677. }
  2678. tempProject.push(obj)
  2679. }
  2680. var preTime = nowTime
  2681. let index = i + 1
  2682. let obj = {
  2683. id: 0,
  2684. name: '处方' + index,
  2685. advices: tempAdvice,
  2686. project: tempProject,
  2687. addition: tempAddition,
  2688. order_status: 1,
  2689. pre_time: preTime,
  2690. med_type: ''
  2691. }
  2692. if (prescription.med_type == 0 || prescription.med_type == '') {
  2693. obj.med_type = ''
  2694. } else {
  2695. obj.med_type = parseInt(prescription.med_type)
  2696. }
  2697. if (obj.med_type == 0 || obj.med_type == '') {
  2698. obj.med_type = 14
  2699. }
  2700. this.prescriptions.push(obj)
  2701. }
  2702. } else {
  2703. let obj = {
  2704. id: 0,
  2705. name: '处方' + 1,
  2706. advices: [],
  2707. project: [],
  2708. addition: [],
  2709. order_status: 0,
  2710. pre_time: nowTime,
  2711. med_type: ''
  2712. }
  2713. obj.med_type = 14
  2714. this.prescriptions.push(obj)
  2715. // if(response.data.data.count <= 1 ){
  2716. // if(response.data.data.last_prescriptions.length == 0){
  2717. // let obj = {
  2718. // id: 0,
  2719. // name: '处方' + 1,
  2720. // advices: [],
  2721. // project: [],
  2722. // addition: [],
  2723. // order_status: 0,
  2724. // pre_time: nowTime,
  2725. //
  2726. // };
  2727. // this.prescriptions.push(obj)
  2728. //
  2729. //
  2730. // }else {
  2731. // for (let i = 0; i < response.data.data.last_prescriptions.length; i++) {
  2732. // var prescription = response.data.data.last_prescriptions[i];
  2733. // let tempAdvice = [];
  2734. // let tempProject = [];
  2735. // let tempAddition = [];
  2736. //
  2737. // //药品
  2738. // for (let b = 0; b < prescription.advices.length; b++) {
  2739. // let obj = {
  2740. // advice_id:0,
  2741. // drug_name: prescription.advices[b].advice_name,
  2742. // single_dose: prescription.advices[b].single_dose,
  2743. // delivery_way: prescription.advices[b].delivery_way,
  2744. // execution_frequency: prescription.advices[b].execution_frequency,
  2745. // retail_price: prescription.advices[b].price.toString(),
  2746. // remark: prescription.advices[b].remark,
  2747. // day: prescription.advices[b].day,
  2748. // prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2749. // single_dose_unit: prescription.advices[b].single_dose_unit,
  2750. // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2751. // medical_insurance_number: prescription.advices[b].med_list_codg,
  2752. // id: prescription.advices[b].drug_id,
  2753. // drug:prescription.advices[b].drug
  2754. //
  2755. // };
  2756. // tempAdvice.push(obj)
  2757. // }
  2758. //
  2759. // //项目
  2760. // for (let b = 0; b < prescription.project.length; b++) {
  2761. // let obj = {
  2762. // id:0,
  2763. // project_id: prescription.project[b].project_id,
  2764. // project_name: prescription.project[b].project.project_name,
  2765. // statistical_classification: prescription.project[b].project.statistical_classification,
  2766. // single_dose: prescription.project[b].single_dose,
  2767. // delivery_way: prescription.project[b].delivery_way,
  2768. // execution_frequency: prescription.project[b].execution_frequency,
  2769. // number_days: prescription.project[b].day,
  2770. // total: prescription.project[b].count.toString(),
  2771. // price: prescription.project[b].price,
  2772. // remark: prescription.project[b].remark,
  2773. // medical_code: prescription.project[b].project.medical_code,
  2774. // unit: prescription.project[b].project.unit,
  2775. // type: prescription.project[b].type
  2776. // };
  2777. //
  2778. // if (prescription.project[b].type == 2) {
  2779. // obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2780. // obj['medical_code'] = prescription.project[b].project.medical_code
  2781. // obj['project_name'] = prescription.project[b].project.project_name
  2782. //
  2783. // } else if (prescription.project[b].type == 3) {
  2784. // obj['statistical_classification'] = ""
  2785. // obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2786. // obj['project_name'] = prescription.project[b].good_info.good_name
  2787. // }
  2788. // tempProject.push(obj)
  2789. // }
  2790. //
  2791. // //附加收费
  2792. // for (let b = 0; b < prescription.addition.length; b++) {
  2793. // let obj = {
  2794. // item_name: prescription.addition[b].item_name,
  2795. // price: prescription.addition[b].price,
  2796. // count: prescription.addition[b].count,
  2797. // item_id: prescription.addition[b].item_id,
  2798. // };
  2799. // tempAddition.push(obj)
  2800. // }
  2801. //
  2802. // var preTime = nowTime
  2803. //
  2804. // let index = i + 1;
  2805. // let obj = {
  2806. // id: 0,
  2807. // name: '处方' + index,
  2808. // advices: tempAdvice,
  2809. // project: tempProject,
  2810. // addition: tempAddition,
  2811. // order_status: 1,
  2812. // pre_time: preTime
  2813. // };
  2814. // this.prescriptions.push(obj)
  2815. // }
  2816. // }
  2817. // }else{
  2818. // let obj = {
  2819. // id: 0,
  2820. // name: '处方' + 1,
  2821. // advices: [],
  2822. // project: [],
  2823. // addition: [],
  2824. // order_status: 0,
  2825. // pre_time: nowTime,
  2826. //
  2827. // };
  2828. // this.prescriptions.push(obj)
  2829. // }
  2830. }
  2831. }
  2832. 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)
  2833. this.$refs.child.watchSign = 0
  2834. }
  2835. })
  2836. this.$refs.child.watchSign = 0
  2837. }
  2838. } else {
  2839. var nowDate = new Date()
  2840. var nowYear = nowDate.getFullYear()
  2841. var nowMonth = nowDate.getMonth() + 1
  2842. var nowDay = nowDate.getDate()
  2843. var hours = nowDate.getHours()
  2844. var min = nowDate.getMinutes()
  2845. var nowTime =
  2846. nowYear +
  2847. '-' +
  2848. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  2849. '-' +
  2850. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  2851. ':' + (min < 10 ? '0' + min : min)
  2852. var last_month = nowDate.getMonth() < 10 ? '0' + nowDate.getMonth().toString() : nowDate.getMonth() //获取当前月份(0-11,0代表1月)
  2853. var endTime =
  2854. nowYear +
  2855. '-' +
  2856. last_month +
  2857. '-' +
  2858. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  2859. ':' + (min < 10 ? '0' + min : min)
  2860. let isShowDailog = false
  2861. for (let i = 0; i < this.prescriptions.length; i++) {
  2862. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  2863. isShowDailog = true
  2864. }
  2865. }
  2866. if (isShowDailog) {
  2867. this.all_data.map((item, index) => {
  2868. if (item.id == this.oldCurrentRow.id) {
  2869. this.$refs.tab.setCurrentRow(this.all_data[index])
  2870. return
  2871. }
  2872. })
  2873. // this.$confirm('是否保存当前处方', '保存', {
  2874. // confirmButtonText: '确 定',
  2875. // cancelButtonText: '取 消',
  2876. // type: 'warning'
  2877. // }).then(() => {
  2878. // this.open(1)
  2879. // }).catch(() => {
  2880. for (let i = 0; i < this.all_data.length; i++) {
  2881. if (this.all_data[i].id == val.id) {
  2882. this.$refs.tab.setCurrentRow(this.all_data[i])
  2883. }
  2884. }
  2885. this.patientid = val.id
  2886. let params = {
  2887. 'record_date': this.record_date,
  2888. 'patient_id': val.id,
  2889. 'his_patient_id': val.his_patient_id,
  2890. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  2891. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  2892. 'p_type': 2
  2893. }
  2894. if (this.current_tab == 'day') {
  2895. getPatientInfo(params).then(response => {
  2896. if (response.data.state == 0) {
  2897. this.$message.error(response.data.msg)
  2898. return false
  2899. } else {
  2900. if(response.data.data.sch_prescriptions== null){
  2901. response.data.data.sch_prescriptions = []
  2902. }
  2903. for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
  2904. if(response.data.data.sch_prescriptions[i].advices == null){
  2905. response.data.data.sch_prescriptions[i].advices = []
  2906. }
  2907. if(response.data.data.sch_prescriptions[i].project == null){
  2908. response.data.data.sch_prescriptions[i].project = []
  2909. }
  2910. }
  2911. for (let i = 0; i < this.all_data.length; i++) {
  2912. if (this.all_data[i].id == val.id) {
  2913. this.oldCurrentRow = this.all_data[i]
  2914. }
  2915. }
  2916. this.prescriptions = []
  2917. this.patientInfo = response.data.data.xt_info
  2918. this.hisPatientInfo = response.data.data.his_info
  2919. this.case_history = response.data.data.case_history
  2920. this.doctors = response.data.data.doctors
  2921. this.department = response.data.data.department
  2922. this.schedule = response.data.data.schedule
  2923. for (let i = 0; i < this.doctors.length; i++) {
  2924. if (this.doctors[i].user_type == 1) {
  2925. this.doctors.splice(i, 1)
  2926. }
  2927. }
  2928. this.case_history = response.data.data.case_history
  2929. this.info = response.data.data.info
  2930. this.last_info = response.data.data.last_info
  2931. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  2932. if (this.case_history.breathing <= 0) {
  2933. this.case_history.breathing = ''
  2934. }
  2935. if (this.case_history.sick <= 0) {
  2936. this.case_history.sick = ''
  2937. }
  2938. if (this.case_history.diagnose <= 0) {
  2939. this.case_history.diagnose = ''
  2940. }
  2941. if (this.case_history.temperature <= 0) {
  2942. this.case_history.temperature = ''
  2943. }
  2944. if (this.case_history.blood_sugar <= 0) {
  2945. this.case_history.blood_sugar = ''
  2946. }
  2947. if (this.case_history.pulse <= 0) {
  2948. this.case_history.pulse = ''
  2949. }
  2950. if (this.case_history.sbp <= 0) {
  2951. this.case_history.sbp = ''
  2952. }
  2953. if (this.case_history.dbp <= 0) {
  2954. this.case_history.dbp = ''
  2955. }
  2956. if (this.case_history.height <= 0) {
  2957. this.case_history.height = ''
  2958. }
  2959. if (this.case_history.blood_fat <= 0) {
  2960. this.case_history.blood_fat = ''
  2961. }
  2962. if (this.case_history.sick_type <= 0) {
  2963. this.case_history.sick_type = ''
  2964. }
  2965. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  2966. if (this.case_history.is_infect == 1) {
  2967. this.case_history.is_infect = true
  2968. } else {
  2969. this.case_history.is_infect = false
  2970. }
  2971. this.prescriptionList = response.data.data.prescription
  2972. if (response.data.data.prescription.length > 0) {
  2973. for (let i = 0; i < response.data.data.prescription.length; i++) {
  2974. var prescription = response.data.data.prescription[i]
  2975. let tempAdvice = []
  2976. let tempProject = []
  2977. let tempAddition = []
  2978. //药品
  2979. for (let b = 0; b < prescription.advices.length; b++) {
  2980. let obj = {
  2981. advice_id: prescription.advices[b].id,
  2982. drug_name: prescription.advices[b].advice_name,
  2983. single_dose: prescription.advices[b].single_dose,
  2984. delivery_way: prescription.advices[b].delivery_way,
  2985. execution_frequency: prescription.advices[b].execution_frequency,
  2986. retail_price: prescription.advices[b].price.toString(),
  2987. remark: prescription.advices[b].remark,
  2988. day: prescription.advices[b].day,
  2989. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2990. single_dose_unit: prescription.advices[b].single_dose_unit,
  2991. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2992. medical_insurance_number: prescription.advices[b].med_list_codg,
  2993. id: prescription.advices[b].drug_id,
  2994. drug: prescription.advices[b].drug,
  2995. groupno: prescription.advices[b].groupno,
  2996. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  2997. }
  2998. tempAdvice.push(obj)
  2999. }
  3000. //项目
  3001. for (let b = 0; b < prescription.project.length; b++) {
  3002. let obj = {
  3003. id: prescription.project[b].id,
  3004. project_id: prescription.project[b].project_id,
  3005. project_name: prescription.project[b].project.project_name,
  3006. statistical_classification: prescription.project[b].project.statistical_classification,
  3007. single_dose: prescription.project[b].single_dose,
  3008. delivery_way: prescription.project[b].delivery_way,
  3009. execution_frequency: prescription.project[b].execution_frequency,
  3010. number_days: prescription.project[b].day,
  3011. total: prescription.project[b].count.toString(),
  3012. price: prescription.project[b].price,
  3013. remark: prescription.project[b].remark,
  3014. medical_code: prescription.project[b].project.medical_code,
  3015. unit: prescription.project[b].project.unit,
  3016. type: prescription.project[b].type
  3017. }
  3018. if (prescription.project[b].type == 2) {
  3019. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  3020. obj['medical_code'] = prescription.project[b].project.medical_code
  3021. obj['project_name'] = prescription.project[b].project.project_name
  3022. obj['project'] = prescription.project[b].project
  3023. } else if (prescription.project[b].type == 3) {
  3024. obj['statistical_classification'] = ''
  3025. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3026. obj['project_name'] = prescription.project[b].good_info.good_name
  3027. obj['good_info'] = prescription.project[b].good_info
  3028. }
  3029. tempProject.push(obj)
  3030. }
  3031. //附加收费
  3032. for (let b = 0; b < prescription.addition.length; b++) {
  3033. let obj = {
  3034. id: prescription.addition[b].id,
  3035. item_name: prescription.addition[b].item_name,
  3036. price: prescription.addition[b].price,
  3037. count: prescription.addition[b].count,
  3038. item_id: prescription.addition[b].item_id
  3039. }
  3040. tempAddition.push(obj)
  3041. }
  3042. var preTime = ''
  3043. if (prescription.pre_time == 0) {
  3044. // preTime = nowTime
  3045. if (this.schedule.schedule_type == 1) {
  3046. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  3047. } else if (this.schedule.schedule_type == 2) {
  3048. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  3049. } else if (this.schedule.schedule_type == 3) {
  3050. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  3051. }
  3052. } else {
  3053. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  3054. }
  3055. let index = i + 1
  3056. let obj = {
  3057. id: prescription.id,
  3058. name: '处方' + index,
  3059. advices: tempAdvice,
  3060. project: tempProject,
  3061. addition: tempAddition,
  3062. order_status: prescription.order_status,
  3063. pre_time: preTime,
  3064. med_type: parseInt(prescription.med_type)
  3065. }
  3066. this.prescriptions.push(obj)
  3067. }
  3068. } else {
  3069. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  3070. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  3071. var prescription = response.data.data.sch_prescriptions[i]
  3072. for (let b = 0; b < prescription.advices.length; b++) {
  3073. console.log(prescription.advices[b].drug.is_special_diseases)
  3074. if (prescription.med_type == '14' && prescription.advices[b].drug.is_special_diseases != 1) {
  3075. prescription.advices.splice(b--, 1)
  3076. }
  3077. }
  3078. for (let b = 0; b < prescription.project.length; b++) {
  3079. if (prescription.project[b].type == 2) {
  3080. if (prescription.med_type == '14' && prescription.project[b].project.disease_directory != 1) {
  3081. prescription.project.splice(b--, 1)
  3082. }
  3083. } else if (prescription.project[b].type == 3) {
  3084. if (prescription.med_type == '14' && prescription.project[b].good_info.is_special_diseases != 1) {
  3085. prescription.project.splice(b--, 1)
  3086. }
  3087. }
  3088. }
  3089. }
  3090. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  3091. var prescription = response.data.data.sch_prescriptions[i]
  3092. let tempAdvice = []
  3093. let tempProject = []
  3094. let tempAddition = []
  3095. //药品
  3096. for (let b = 0; b < prescription.advices.length; b++) {
  3097. let index = b + 1
  3098. let obj = {
  3099. advice_id: 0,
  3100. drug_name: prescription.advices[b].advice_name,
  3101. single_dose: prescription.advices[b].single_dose,
  3102. delivery_way: prescription.advices[b].delivery_way,
  3103. execution_frequency: prescription.advices[b].execution_frequency,
  3104. // retail_price: prescription.advices[b].price.toString(),
  3105. remark: prescription.advices[b].remark,
  3106. day: prescription.advices[b].day,
  3107. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3108. single_dose_unit: prescription.advices[b].single_dose_unit,
  3109. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3110. medical_insurance_number: prescription.advices[b].med_list_codg,
  3111. id: prescription.advices[b].drug_id,
  3112. drug: prescription.advices[b].drug,
  3113. groupno: prescription.advices[b].groupno,
  3114. hosp_appr_flag: '1'
  3115. }
  3116. console.log('看看数据4:')
  3117. console.log(obj.prescribing_number_unit)
  3118. console.log(prescription.advices[b].drug.min_unit)
  3119. console.log(prescription.advices[b].drug.max_unit)
  3120. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  3121. obj['retail_price'] = prescription.advices[b].drug.min_price
  3122. console.log('1')
  3123. console.log(obj.retail_price)
  3124. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  3125. obj['retail_price'] = prescription.advices[b].drug.retail_price
  3126. console.log('2')
  3127. console.log(obj.retail_price)
  3128. } else {
  3129. console.log('3')
  3130. obj['retail_price'] = prescription.advices[b].drug.min_price
  3131. console.log(obj.retail_price)
  3132. }
  3133. tempAdvice.push(obj)
  3134. }
  3135. //项目
  3136. for (let b = 0; b < prescription.project.length; b++) {
  3137. let obj = {
  3138. id: 0,
  3139. project_id: prescription.project[b].project_id,
  3140. project_name: prescription.project[b].project.project_name,
  3141. statistical_classification: prescription.project[b].project.statistical_classification,
  3142. single_dose: prescription.project[b].single_dose,
  3143. delivery_way: prescription.project[b].delivery_way,
  3144. execution_frequency: prescription.project[b].execution_frequency,
  3145. number_days: prescription.project[b].day,
  3146. total: prescription.project[b].count.toString(),
  3147. remark: prescription.project[b].remark,
  3148. medical_code: prescription.project[b].project.medical_code,
  3149. unit: prescription.project[b].project.unit,
  3150. type: prescription.project[b].type
  3151. }
  3152. if (prescription.project[b].type == 2) {
  3153. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  3154. obj['medical_code'] = prescription.project[b].project.medical_code
  3155. obj['project_name'] = prescription.project[b].project.project_name
  3156. obj['price'] = prescription.project[b].project.price
  3157. obj['project'] = prescription.project[b].project
  3158. } else if (prescription.project[b].type == 3) {
  3159. obj['statistical_classification'] = ''
  3160. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3161. obj['project_name'] = prescription.project[b].good_info.good_name
  3162. obj['price'] = prescription.project[b].good_info.packing_price
  3163. obj['good_info'] = prescription.project[b].good_info
  3164. }
  3165. tempProject.push(obj)
  3166. }
  3167. // var preTime = nowTime
  3168. var preTime = ''
  3169. if (this.schedule.schedule_type == 1) {
  3170. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  3171. } else if (this.schedule.schedule_type == 2) {
  3172. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  3173. } else if (this.schedule.schedule_type == 3) {
  3174. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  3175. }
  3176. let index = i + 1
  3177. let obj = {
  3178. id: 0,
  3179. name: '处方' + index,
  3180. advices: tempAdvice,
  3181. project: tempProject,
  3182. addition: tempAddition,
  3183. order_status: 1,
  3184. pre_time: preTime,
  3185. med_type: ''
  3186. }
  3187. if (prescription.med_type == 0 || prescription.med_type == '') {
  3188. obj.med_type = ''
  3189. } else {
  3190. obj.med_type = parseInt(prescription.med_type)
  3191. }
  3192. if (obj.med_type == 0 || obj.med_type == '') {
  3193. obj.med_type = 14
  3194. }
  3195. this.prescriptions.push(obj)
  3196. }
  3197. } else {
  3198. let obj = {
  3199. id: 0,
  3200. name: '处方' + 1,
  3201. advices: [],
  3202. project: [],
  3203. addition: [],
  3204. order_status: 0,
  3205. pre_time: nowTime,
  3206. med_type: ''
  3207. }
  3208. obj.med_type = 14
  3209. this.prescriptions.push(obj)
  3210. // if(response.data.data.count <= 1 ){
  3211. // if(response.data.data.last_prescriptions.length == 0){
  3212. // let obj = {
  3213. // id: 0,
  3214. // name: '处方' + 1,
  3215. // advices: [],
  3216. // project: [],
  3217. // addition: [],
  3218. // order_status: 0,
  3219. // pre_time: nowTime,
  3220. //
  3221. // };
  3222. // this.prescriptions.push(obj)
  3223. //
  3224. //
  3225. // }
  3226. // else {
  3227. // for (let i = 0; i < response.data.data.last_prescriptions.length; i++) {
  3228. // var prescription = response.data.data.last_prescriptions[i];
  3229. // let tempAdvice = [];
  3230. // let tempProject = [];
  3231. // let tempAddition = [];
  3232. //
  3233. // //药品
  3234. // for (let b = 0; b < prescription.advices.length; b++) {
  3235. // let obj = {
  3236. // advice_id:0,
  3237. // drug_name: prescription.advices[b].advice_name,
  3238. // single_dose: prescription.advices[b].single_dose,
  3239. // delivery_way: prescription.advices[b].delivery_way,
  3240. // execution_frequency: prescription.advices[b].execution_frequency,
  3241. // retail_price: prescription.advices[b].price.toString(),
  3242. // remark: prescription.advices[b].remark,
  3243. // day: prescription.advices[b].day,
  3244. // prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3245. // single_dose_unit: prescription.advices[b].single_dose_unit,
  3246. // prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3247. // medical_insurance_number: prescription.advices[b].med_list_codg,
  3248. // id: prescription.advices[b].drug_id,
  3249. // drug:prescription.advices[b].drug
  3250. //
  3251. // };
  3252. // tempAdvice.push(obj)
  3253. // }
  3254. //
  3255. // //项目
  3256. // for (let b = 0; b < prescription.project.length; b++) {
  3257. // let obj = {
  3258. // id:0,
  3259. // project_id: prescription.project[b].project_id,
  3260. // project_name: prescription.project[b].project.project_name,
  3261. // statistical_classification: prescription.project[b].project.statistical_classification,
  3262. // single_dose: prescription.project[b].single_dose,
  3263. // delivery_way: prescription.project[b].delivery_way,
  3264. // execution_frequency: prescription.project[b].execution_frequency,
  3265. // number_days: prescription.project[b].day,
  3266. // total: prescription.project[b].count.toString(),
  3267. // price: prescription.project[b].price,
  3268. // remark: prescription.project[b].remark,
  3269. // medical_code: prescription.project[b].project.medical_code,
  3270. // unit: prescription.project[b].project.unit,
  3271. // type: prescription.project[b].type
  3272. // };
  3273. //
  3274. // if (prescription.project[b].type == 2) {
  3275. // obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  3276. // obj['medical_code'] = prescription.project[b].project.medical_code
  3277. // obj['project_name'] = prescription.project[b].project.project_name
  3278. //
  3279. // } else if (prescription.project[b].type == 3) {
  3280. // obj['statistical_classification'] = ""
  3281. // obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3282. // obj['project_name'] = prescription.project[b].good_info.good_name
  3283. // }
  3284. // tempProject.push(obj)
  3285. // }
  3286. //
  3287. // //附加收费
  3288. // for (let b = 0; b < prescription.addition.length; b++) {
  3289. // let obj = {
  3290. // item_name: prescription.addition[b].item_name,
  3291. // price: prescription.addition[b].price,
  3292. // count: prescription.addition[b].count,
  3293. // item_id: prescription.addition[b].item_id,
  3294. // };
  3295. // tempAddition.push(obj)
  3296. // }
  3297. //
  3298. // var preTime = nowTime
  3299. //
  3300. // let index = i + 1;
  3301. // let obj = {
  3302. // id: 0,
  3303. // name: '处方' + index,
  3304. // advices: tempAdvice,
  3305. // project: tempProject,
  3306. // addition: tempAddition,
  3307. // order_status: 1,
  3308. // pre_time: preTime
  3309. // };
  3310. // this.prescriptions.push(obj)
  3311. // }
  3312. // }
  3313. // }else{
  3314. // let obj = {
  3315. // id: 0,
  3316. // name: '处方' + 1,
  3317. // advices: [],
  3318. // project: [],
  3319. // addition: [],
  3320. // order_status: 0,
  3321. // pre_time: nowTime,
  3322. //
  3323. // };
  3324. // this.prescriptions.push(obj)
  3325. // }
  3326. }
  3327. }
  3328. 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)
  3329. }
  3330. })
  3331. } else {
  3332. getMonthHisPateintInfo(params).then(response => {
  3333. if (response.data.state == 0) {
  3334. this.$message.error(response.data.msg)
  3335. return false
  3336. } else {
  3337. for (let i = 0; i < this.all_data.length; i++) {
  3338. if (this.all_data[i].id == val.id) {
  3339. this.oldCurrentRow = this.all_data[i]
  3340. }
  3341. }
  3342. this.patientInfo = response.data.data.xt_info
  3343. this.hisPatientInfo = response.data.data.his_info
  3344. this.case_history = response.data.data.case_history
  3345. var month_prescriptions = response.data.data.month_prescriptions
  3346. this.setMonthPrescription(month_prescriptions)
  3347. this.doctors = response.data.data.doctors
  3348. this.department = response.data.data.department
  3349. this.schedule = response.data.data.schedule
  3350. for (let i = 0; i < this.doctors.length; i++) {
  3351. if (this.doctors[i].user_type == 1) {
  3352. this.doctors.splice(i, 1)
  3353. }
  3354. }
  3355. this.case_history = response.data.data.case_history
  3356. this.info = response.data.data.info
  3357. this.last_info = response.data.data.last_info
  3358. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  3359. if (this.case_history.breathing <= 0) {
  3360. this.case_history.breathing = ''
  3361. }
  3362. if (this.case_history.sick <= 0) {
  3363. this.case_history.sick = ''
  3364. }
  3365. if (this.case_history.diagnose <= 0) {
  3366. this.case_history.diagnose = ''
  3367. }
  3368. if (this.case_history.temperature <= 0) {
  3369. this.case_history.temperature = ''
  3370. }
  3371. if (this.case_history.blood_sugar <= 0) {
  3372. this.case_history.blood_sugar = ''
  3373. }
  3374. if (this.case_history.pulse <= 0) {
  3375. this.case_history.pulse = ''
  3376. }
  3377. if (this.case_history.sbp <= 0) {
  3378. this.case_history.sbp = ''
  3379. }
  3380. if (this.case_history.dbp <= 0) {
  3381. this.case_history.dbp = ''
  3382. }
  3383. if (this.case_history.height <= 0) {
  3384. this.case_history.height = ''
  3385. }
  3386. if (this.case_history.blood_fat <= 0) {
  3387. this.case_history.blood_fat = ''
  3388. }
  3389. if (this.case_history.sick_type <= 0) {
  3390. this.case_history.sick_type = ''
  3391. }
  3392. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  3393. if (this.case_history.is_infect == 1) {
  3394. this.case_history.is_infect = true
  3395. } else {
  3396. this.case_history.is_infect = false
  3397. }
  3398. this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
  3399. }
  3400. })
  3401. }
  3402. } else {
  3403. this.patientid = val.id
  3404. let params = {
  3405. 'record_date': this.record_date,
  3406. 'patient_id': val.id,
  3407. 'his_patient_id': val.his_patient_id,
  3408. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  3409. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  3410. 'p_type': 2
  3411. }
  3412. if (this.current_tab == 'day') {
  3413. getPatientInfo(params).then(response => {
  3414. if (response.data.state == 0) {
  3415. this.$message.error(response.data.msg)
  3416. return false
  3417. } else {
  3418. if(response.data.data.sch_prescriptions== null){
  3419. response.data.data.sch_prescriptions = []
  3420. }
  3421. for(let i = 0;i < response.data.data.sch_prescriptions.length; i++){
  3422. if(response.data.data.sch_prescriptions[i].advices == null){
  3423. response.data.data.sch_prescriptions[i].advices = []
  3424. }
  3425. if(response.data.data.sch_prescriptions[i].project == null){
  3426. response.data.data.sch_prescriptions[i].project = []
  3427. }
  3428. }
  3429. this.prescriptions = []
  3430. this.month_prescriptions = []
  3431. this.patientInfo = response.data.data.xt_info
  3432. this.hisPatientInfo = response.data.data.his_info
  3433. this.case_history = response.data.data.case_history
  3434. this.info = response.data.data.info
  3435. this.last_info = response.data.data.last_info
  3436. this.schedule = response.data.data.schedule
  3437. this.doctors = response.data.data.doctors
  3438. this.department = response.data.data.department
  3439. for (let i = 0; i < this.doctors.length; i++) {
  3440. if (this.doctors[i].user_type == 1) {
  3441. this.doctors.splice(i, 1)
  3442. }
  3443. }
  3444. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  3445. if (this.case_history.breathing <= 0) {
  3446. this.case_history.breathing = ''
  3447. }
  3448. if (this.case_history.sick <= 0) {
  3449. this.case_history.sick = ''
  3450. }
  3451. if (this.case_history.diagnose <= 0) {
  3452. this.case_history.diagnose = ''
  3453. }
  3454. if (this.case_history.temperature <= 0) {
  3455. this.case_history.temperature = ''
  3456. }
  3457. if (this.case_history.blood_sugar <= 0) {
  3458. this.case_history.blood_sugar = ''
  3459. }
  3460. if (this.case_history.pulse <= 0) {
  3461. this.case_history.pulse = ''
  3462. }
  3463. if (this.case_history.sbp <= 0) {
  3464. this.case_history.sbp = ''
  3465. }
  3466. if (this.case_history.dbp <= 0) {
  3467. this.case_history.dbp = ''
  3468. }
  3469. if (this.case_history.height <= 0) {
  3470. this.case_history.height = ''
  3471. }
  3472. if (this.case_history.blood_fat <= 0) {
  3473. this.case_history.blood_fat = ''
  3474. }
  3475. if (this.case_history.sick_type <= 0) {
  3476. this.case_history.sick_type = ''
  3477. }
  3478. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  3479. if (this.case_history.is_infect == 1) {
  3480. this.case_history.is_infect = true
  3481. } else {
  3482. this.case_history.is_infect = false
  3483. }
  3484. this.prescriptionList = response.data.data.prescription
  3485. if (response.data.data.prescription.length > 0) {
  3486. for (let i = 0; i < response.data.data.prescription.length; i++) {
  3487. var prescription = response.data.data.prescription[i]
  3488. let tempAdvice = []
  3489. let tempProject = []
  3490. let tempAddition = []
  3491. //药品
  3492. for (let b = 0; b < prescription.advices.length; b++) {
  3493. let obj = {
  3494. advice_id: prescription.advices[b].id,
  3495. drug_name: prescription.advices[b].advice_name,
  3496. single_dose: prescription.advices[b].single_dose,
  3497. delivery_way: prescription.advices[b].delivery_way,
  3498. execution_frequency: prescription.advices[b].execution_frequency,
  3499. retail_price: prescription.advices[b].price.toString(),
  3500. remark: prescription.advices[b].remark,
  3501. day: prescription.advices[b].day,
  3502. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3503. single_dose_unit: prescription.advices[b].single_dose_unit,
  3504. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3505. medical_insurance_number: prescription.advices[b].med_list_codg,
  3506. id: prescription.advices[b].drug_id,
  3507. drug: prescription.advices[b].drug,
  3508. groupno: prescription.advices[b].groupno,
  3509. hosp_appr_flag: prescription.advices[b].hosp_appr_flag.toString()
  3510. }
  3511. tempAdvice.push(obj)
  3512. }
  3513. //项目
  3514. for (let b = 0; b < prescription.project.length; b++) {
  3515. let obj = {
  3516. id: prescription.project[b].id,
  3517. project_id: prescription.project[b].project_id,
  3518. project_name: prescription.project[b].project.project_name,
  3519. statistical_classification: prescription.project[b].project.statistical_classification,
  3520. single_dose: prescription.project[b].single_dose,
  3521. delivery_way: prescription.project[b].delivery_way,
  3522. execution_frequency: prescription.project[b].execution_frequency,
  3523. number_days: prescription.project[b].day,
  3524. total: prescription.project[b].count.toString(),
  3525. price: prescription.project[b].price,
  3526. remark: prescription.project[b].remark,
  3527. medical_code: prescription.project[b].project.medical_code,
  3528. unit: prescription.project[b].project.unit,
  3529. type: prescription.project[b].type
  3530. }
  3531. if (prescription.project[b].type == 2) {
  3532. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  3533. obj['medical_code'] = prescription.project[b].project.medical_code
  3534. obj['project_name'] = prescription.project[b].project.project_name
  3535. obj['project'] = prescription.project[b].project
  3536. } else if (prescription.project[b].type == 3) {
  3537. obj['statistical_classification'] = ''
  3538. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3539. obj['project_name'] = prescription.project[b].good_info.good_name
  3540. obj['good_info'] = prescription.project[b].good_info
  3541. }
  3542. tempProject.push(obj)
  3543. }
  3544. //附加收费
  3545. for (let b = 0; b < prescription.addition.length; b++) {
  3546. let obj = {
  3547. id: prescription.addition[b].id,
  3548. item_name: prescription.addition[b].item_name,
  3549. price: prescription.addition[b].price,
  3550. count: prescription.addition[b].count,
  3551. item_id: prescription.addition[b].item_id
  3552. }
  3553. tempAddition.push(obj)
  3554. }
  3555. var preTime = ''
  3556. if (prescription.pre_time == 0) {
  3557. // preTime = nowTime
  3558. if (this.schedule.schedule_type == 1) {
  3559. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  3560. } else if (this.schedule.schedule_type == 2) {
  3561. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  3562. } else if (this.schedule.schedule_type == 3) {
  3563. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  3564. }
  3565. } else {
  3566. preTime = this.getTime(prescription.pre_time, '{y}-{m}-{d} {h}:{i}')
  3567. }
  3568. let index = i + 1
  3569. let obj = {
  3570. id: prescription.id,
  3571. name: '处方' + index,
  3572. advices: tempAdvice,
  3573. project: tempProject,
  3574. addition: tempAddition,
  3575. order_status: prescription.order_status,
  3576. pre_time: preTime,
  3577. med_type: parseInt(prescription.med_type)
  3578. }
  3579. this.prescriptions.push(obj)
  3580. }
  3581. } else {
  3582. if (response.data.data.count <= 1 && response.data.data.schedule.id > 0 && response.data.data.sch_prescriptions.length > 0) {
  3583. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  3584. var prescription = response.data.data.sch_prescriptions[i]
  3585. for (let b = 0; b < prescription.advices.length; b++) {
  3586. console.log(prescription.advices[b].drug.is_special_diseases)
  3587. if (prescription.med_type == '14' && prescription.advices[b].drug.is_special_diseases != 1) {
  3588. prescription.advices.splice(b--, 1)
  3589. }
  3590. }
  3591. for (let b = 0; b < prescription.project.length; b++) {
  3592. if (prescription.project[b].type == 2) {
  3593. if (prescription.med_type == '14' && prescription.project[b].project.disease_directory != 1) {
  3594. prescription.project.splice(b--, 1)
  3595. }
  3596. } else if (prescription.project[b].type == 3) {
  3597. if (prescription.med_type == '14' && prescription.project[b].good_info.is_special_diseases != 1) {
  3598. prescription.project.splice(b--, 1)
  3599. }
  3600. }
  3601. }
  3602. }
  3603. for (let i = 0; i < response.data.data.sch_prescriptions.length; i++) {
  3604. var prescription = response.data.data.sch_prescriptions[i]
  3605. let tempAdvice = []
  3606. let tempProject = []
  3607. let tempAddition = []
  3608. //药品
  3609. for (let b = 0; b < prescription.advices.length; b++) {
  3610. let index = b + 1
  3611. let obj = {
  3612. advice_id: 0,
  3613. drug_name: prescription.advices[b].advice_name,
  3614. single_dose: prescription.advices[b].single_dose,
  3615. delivery_way: prescription.advices[b].delivery_way,
  3616. execution_frequency: prescription.advices[b].execution_frequency,
  3617. // retail_price: prescription.advices[b].price.toString(),
  3618. remark: prescription.advices[b].remark,
  3619. day: prescription.advices[b].day,
  3620. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3621. single_dose_unit: prescription.advices[b].single_dose_unit,
  3622. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3623. medical_insurance_number: prescription.advices[b].med_list_codg,
  3624. id: prescription.advices[b].drug_id,
  3625. drug: prescription.advices[b].drug,
  3626. groupno: prescription.advices[b].groupno,
  3627. hosp_appr_flag: '1'
  3628. }
  3629. console.log('看看数据5:')
  3630. console.log(obj.prescribing_number_unit)
  3631. console.log(prescription.advices[b].drug.min_unit)
  3632. console.log(prescription.advices[b].drug.max_unit)
  3633. if (obj.prescribing_number_unit == prescription.advices[b].drug.min_unit) {
  3634. obj['retail_price'] = prescription.advices[b].drug.min_price
  3635. console.log('1')
  3636. console.log(obj.retail_price)
  3637. } else if (obj.prescribing_number_unit == prescription.advices[b].drug.max_unit) {
  3638. obj['retail_price'] = prescription.advices[b].drug.retail_price
  3639. console.log('2')
  3640. console.log(obj.retail_price)
  3641. } else {
  3642. console.log('3')
  3643. obj['retail_price'] = prescription.advices[b].drug.min_price
  3644. console.log(obj.retail_price)
  3645. }
  3646. tempAdvice.push(obj)
  3647. }
  3648. //项目
  3649. for (let b = 0; b < prescription.project.length; b++) {
  3650. let obj = {
  3651. id: 0,
  3652. project_id: prescription.project[b].project_id,
  3653. project_name: prescription.project[b].project.project_name,
  3654. statistical_classification: prescription.project[b].project.statistical_classification,
  3655. single_dose: prescription.project[b].single_dose,
  3656. delivery_way: prescription.project[b].delivery_way,
  3657. execution_frequency: prescription.project[b].execution_frequency,
  3658. number_days: prescription.project[b].day,
  3659. total: prescription.project[b].count.toString(),
  3660. remark: prescription.project[b].remark,
  3661. medical_code: prescription.project[b].project.medical_code,
  3662. unit: prescription.project[b].project.unit,
  3663. type: prescription.project[b].type
  3664. }
  3665. if (prescription.project[b].type == 2) {
  3666. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  3667. obj['medical_code'] = prescription.project[b].project.medical_code
  3668. obj['project_name'] = prescription.project[b].project.project_name
  3669. obj['price'] = prescription.project[b].project.price
  3670. obj['project'] = prescription.project[b].project
  3671. } else if (prescription.project[b].type == 3) {
  3672. obj['statistical_classification'] = ''
  3673. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3674. obj['project_name'] = prescription.project[b].good_info.good_name
  3675. obj['price'] = prescription.project[b].good_info.packing_price
  3676. obj['good_info'] = prescription.project[b].good_info
  3677. }
  3678. tempProject.push(obj)
  3679. }
  3680. // var preTime = nowTime
  3681. var preTime = ''
  3682. if (this.schedule.schedule_type == 1) {
  3683. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '7:00'
  3684. } else if (this.schedule.schedule_type == 2) {
  3685. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '11:00'
  3686. } else if (this.schedule.schedule_type == 3) {
  3687. preTime = nowYear + '-' + (nowMonth < 10 ? '0' + nowMonth : nowMonth) + '-' + (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + '17:00'
  3688. }
  3689. let index = i + 1
  3690. let obj = {
  3691. id: 0,
  3692. name: '处方' + index,
  3693. advices: tempAdvice,
  3694. project: tempProject,
  3695. addition: tempAddition,
  3696. order_status: 1,
  3697. pre_time: preTime,
  3698. med_type: ''
  3699. }
  3700. if (prescription.med_type == 0 || prescription.med_type == '') {
  3701. obj.med_type = ''
  3702. } else {
  3703. obj.med_type = parseInt(prescription.med_type)
  3704. }
  3705. if (obj.med_type == 0 || obj.med_type == '') {
  3706. obj.med_type = 14
  3707. }
  3708. this.prescriptions.push(obj)
  3709. }
  3710. } else {
  3711. let obj = {
  3712. id: 0,
  3713. name: '处方' + 1,
  3714. advices: [],
  3715. project: [],
  3716. addition: [],
  3717. order_status: 0,
  3718. pre_time: nowTime,
  3719. med_type: ''
  3720. }
  3721. obj.med_type = 14
  3722. this.prescriptions.push(obj)
  3723. }
  3724. }
  3725. 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)
  3726. }
  3727. })
  3728. } else {
  3729. getMonthHisPateintInfo(params).then(response => {
  3730. if (response.data.state == 0) {
  3731. this.$message.error(response.data.msg)
  3732. return false
  3733. } else {
  3734. this.prescriptions = []
  3735. this.month_prescriptions = []
  3736. var month_prescriptions = response.data.data.month_prescriptions
  3737. this.setMonthPrescription(month_prescriptions)
  3738. this.patientInfo = response.data.data.xt_info
  3739. this.hisPatientInfo = response.data.data.his_info
  3740. this.case_history = response.data.data.case_history
  3741. this.info = response.data.data.info
  3742. this.last_info = response.data.data.last_info
  3743. this.schedule = response.data.data.schedule
  3744. this.doctors = response.data.data.doctors
  3745. this.department = response.data.data.department
  3746. for (let i = 0; i < this.doctors.length; i++) {
  3747. if (this.doctors[i].user_type == 1) {
  3748. this.doctors.splice(i, 1)
  3749. }
  3750. }
  3751. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  3752. if (this.case_history.breathing <= 0) {
  3753. this.case_history.breathing = ''
  3754. }
  3755. if (this.case_history.sick <= 0) {
  3756. this.case_history.sick = ''
  3757. }
  3758. if (this.case_history.diagnose <= 0) {
  3759. this.case_history.diagnose = ''
  3760. }
  3761. if (this.case_history.temperature <= 0) {
  3762. this.case_history.temperature = ''
  3763. }
  3764. if (this.case_history.blood_sugar <= 0) {
  3765. this.case_history.blood_sugar = ''
  3766. }
  3767. if (this.case_history.pulse <= 0) {
  3768. this.case_history.pulse = ''
  3769. }
  3770. if (this.case_history.sbp <= 0) {
  3771. this.case_history.sbp = ''
  3772. }
  3773. if (this.case_history.dbp <= 0) {
  3774. this.case_history.dbp = ''
  3775. }
  3776. if (this.case_history.height <= 0) {
  3777. this.case_history.height = ''
  3778. }
  3779. if (this.case_history.blood_fat <= 0) {
  3780. this.case_history.blood_fat = ''
  3781. }
  3782. if (this.case_history.sick_type <= 0) {
  3783. this.case_history.sick_type = ''
  3784. }
  3785. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  3786. if (this.case_history.is_infect == 1) {
  3787. this.case_history.is_infect = true
  3788. } else {
  3789. this.case_history.is_infect = false
  3790. }
  3791. this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
  3792. }
  3793. })
  3794. }
  3795. }
  3796. }
  3797. },
  3798. currentChange(currentRow, oldCurrentRow) {
  3799. if (oldCurrentRow) {
  3800. this.newPatientId = oldCurrentRow.id
  3801. this.patientid = oldCurrentRow.id
  3802. }
  3803. let isShowDailog = false
  3804. for (let i = 0; i < this.prescriptions.length; i++) {
  3805. if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
  3806. isShowDailog = true
  3807. }
  3808. }
  3809. if (!isShowDailog) {
  3810. this.oldCurrentRow = currentRow
  3811. return
  3812. }
  3813. }, open_two() {
  3814. this.$refs.prescriptions.open_two()
  3815. }, open_three() {
  3816. this.$refs.prescriptions.open_three()
  3817. },
  3818. open(index) {
  3819. this.index = index
  3820. if (index == 1) {
  3821. this.$refs.prescriptions.open(1, this.saveLoading)
  3822. } else if (index == 2) {
  3823. this.getPrescriptionList(this.patientInfo.id,this.record_date, 1)
  3824. // this.$router.push("/outpatientDoctorStation/print?record="+this.record_date+"&prescription_id="+this.prescription_id)
  3825. } else if (index == 3) {
  3826. this.$refs.prescriptions.open(3)
  3827. } else if (index == 4) {
  3828. this.$refs.prescriptions.open(4)
  3829. } else if (index == 6) {
  3830. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  3831. this.getPrescriptionList(this.patientInfo.id,this.record_date, 2)
  3832. // this.$router.push("/outpatientDoctorStation/treatPrint?record="+this.record_date+"&prescription_id="+this.prescription_id)
  3833. } else if (index == 20) {
  3834. this.getPrescriptionList(this.patientInfo.id,this.record_date, 2, 3)
  3835. }
  3836. },
  3837. opentwo(index) {
  3838. if (index == 1) {
  3839. if (this.patientInfo.id == undefined) {
  3840. this.$message.error('请先选择病人')
  3841. return
  3842. }
  3843. this.$refs.child.createCaseHistory()
  3844. } else if (index == 2) {
  3845. this.recordVisible = true
  3846. this.$refs.recordPrint.show(this.patientid)
  3847. // this.$router.push('/outpatientDoctorStation/recordPrint?record='+this.record_date+"&patient_id="+this.patientid)
  3848. } else if (index == 3) {
  3849. var mode_status = this.$refs.saveRecordTemplate.mode_status
  3850. this.$refs.medicalRecord.show(mode_status)
  3851. } else if (index == 4) {
  3852. this.$refs.saveRecordTemplate.show(this.case_history)
  3853. }
  3854. },
  3855. // changePatient(val){
  3856. // console.log("患者val",val)
  3857. // this.hisPatientInfo = val.hisPatientInfo
  3858. // console.log("333333",this.hisPatientInfo)
  3859. // }
  3860. getMsgFormSon(id) {
  3861. this.detalid = id
  3862. },
  3863. changetwo(data) {
  3864. this.prescription_id = data
  3865. },
  3866. getPrescriptionList(id,record_date, type, checkType) {
  3867. getPrescriptionList(id, 2,record_date).then(response => {
  3868. if (response.data.state == 1) {
  3869. if (checkType != 3) {
  3870. this.centerDialogVisible = true
  3871. var list = response.data.data.list
  3872. let arr1 = []
  3873. let arr2 = []
  3874. let arr3 = []
  3875. let arr4 = []
  3876. for (var i = list.length - 1; i >= 0; i--) {
  3877. if (list[i].type == 1) {
  3878. list[i].prescription_number = list[i].prescription_number + i
  3879. arr1.push(list[i])
  3880. }
  3881. if (list[i].type == 2) {
  3882. list[i].prescription_number = list[i].prescription_number + i
  3883. arr2.push(list[i])
  3884. arr3.push(list[i])
  3885. arr4.push(list[i])
  3886. }
  3887. if (list[i].type == 2) {
  3888. let count = 0
  3889. list[i].project.map(item => {
  3890. if (item.type == 2) {
  3891. if (item.project.cost_classify == 3) {
  3892. count++
  3893. }
  3894. }
  3895. })
  3896. if (count == list[i].project.length) {
  3897. arr2.map((items, index) => {
  3898. if (items.id == list[i].id) {
  3899. arr2.splice(index, 1)
  3900. }
  3901. })
  3902. }
  3903. }
  3904. }
  3905. this.tableData1 = arr1
  3906. this.tableData2 = arr2
  3907. this.tableData4 = arr4
  3908. this.tableData3 = [arr3[0]]
  3909. } else {
  3910. var list = response.data.data.list
  3911. let arr = []
  3912. for (let i = 0; i < list.length; i++) {
  3913. if (list[i].type == type) {
  3914. list[i].prescription_number = list[i].prescription_number + i
  3915. arr.push(list[i])
  3916. }
  3917. }
  3918. console.log('arrrrrrrrrr', arr)
  3919. this.selecting_schs = arr
  3920. this.savePrint()
  3921. }
  3922. }
  3923. })
  3924. },
  3925. handleSelectionChange1(val) {
  3926. console.log('val', val)
  3927. this.selecting_schs1 = val
  3928. },
  3929. handleSelectionChange2(val) {
  3930. this.selecting_schs2 = val
  3931. },
  3932. handleSelectionChange3(val) {
  3933. if (val.length == 0) {
  3934. this.selecting_schs3 = []
  3935. } else {
  3936. this.selecting_schs3 = this.tableData4
  3937. }
  3938. },
  3939. handleClick() {
  3940. if (this.titleType == '电子处方') {
  3941. if (this.radio == 1) {
  3942. this.un_cure_data.map(item => {
  3943. console.log('~~~~~~~~')
  3944. if (item.id == this.patientid) {
  3945. console.log('~~~~~~~~22222222')
  3946. this.getPatientInfo(item)
  3947. }
  3948. })
  3949. } else if (this.radio == 2) {
  3950. this.cure_data.map(item => {
  3951. if (item.id == this.patientid) {
  3952. this.getPatientInfo(item)
  3953. }
  3954. })
  3955. } else {
  3956. this.all_data.map(item => {
  3957. if (item.id == this.patientid) {
  3958. this.getPatientInfo(item)
  3959. }
  3960. })
  3961. }
  3962. }
  3963. },
  3964. savePrint() {
  3965. //处方
  3966. var arr1 = []
  3967. if (this.selecting_schs1.length > 0) {
  3968. for (let i = 0; i < this.selecting_schs1.length; i++) {
  3969. arr1.push(this.selecting_schs1[i].id)
  3970. }
  3971. var ids1 = arr1.join(',')
  3972. let obj1 = {
  3973. record: this.record_date,
  3974. prescription_id: this.prescription_id,
  3975. ids: ids1,
  3976. patient_id: this.patientid
  3977. }
  3978. this.paramsObj = obj1
  3979. }
  3980. //治疗
  3981. var arr2 = []
  3982. if (this.selecting_schs2.length > 0) {
  3983. for (let i = 0; i < this.selecting_schs2.length; i++) {
  3984. arr2.push(this.selecting_schs2[i].id)
  3985. }
  3986. var ids2 = arr2.join(',')
  3987. let obj2 = {
  3988. record: this.record_date,
  3989. prescription_id: this.prescription_id,
  3990. ids: ids2,
  3991. patient_id: this.patientid
  3992. }
  3993. this.paramsObj2 = obj2
  3994. }
  3995. var arr3 = []
  3996. if (this.selecting_schs3.length > 0) {
  3997. for (let i = 0; i < this.selecting_schs3.length; i++) {
  3998. arr3.push(this.selecting_schs3[i].id)
  3999. }
  4000. var ids2 = arr3.join(',')
  4001. let obj3 = {
  4002. record: this.record_date,
  4003. prescription_id: this.prescription_id,
  4004. ids: ids2,
  4005. patient_id: this.patientid
  4006. }
  4007. this.paramsObj3 = obj3
  4008. }
  4009. this.innerVisible = true
  4010. // if(this.index == 20){
  4011. // console.log('ids',ids)
  4012. // let obj = {
  4013. // record: this.record_date,
  4014. // prescription_id: this.prescription_id,
  4015. // ids: ids,
  4016. // patient_id: this.patientid
  4017. // };
  4018. // this.paramsObj = obj;
  4019. // this.checkVisible = true
  4020. // }
  4021. }, getTime(val, temp) {
  4022. if (val != 0) {
  4023. return uParseTime(val, temp)
  4024. } else {
  4025. return ''
  4026. }
  4027. }, getGoodUnit(id) {
  4028. var goodUnit = this.$store.getters.good_unit
  4029. for (let i = 0; i < goodUnit.length; i++) {
  4030. if (goodUnit[i].id == id) {
  4031. return goodUnit[i].name
  4032. }
  4033. }
  4034. }, changeDay() {
  4035. this.current_tab = 'day'
  4036. }, changeMonth(val) {
  4037. console.log('33333333')
  4038. this.current_tab = 'month'
  4039. var nowDate = new Date()
  4040. var nowYear = nowDate.getFullYear()
  4041. var nowMonth = nowDate.getMonth() + 1
  4042. var nowDay = nowDate.getDate()
  4043. var hours = nowDate.getHours()
  4044. var min = nowDate.getMinutes()
  4045. var nowTime =
  4046. nowYear +
  4047. '-' +
  4048. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  4049. '-' +
  4050. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  4051. ':' + (min < 10 ? '0' + min : min)
  4052. let params = {
  4053. 'record_date': this.record_date,
  4054. 'patient_id': val.id,
  4055. 'his_patient_id': val.his_patient_id,
  4056. 'start_time': moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  4057. 'end_time': moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  4058. 'p_type': 2
  4059. }
  4060. this.isloading = true
  4061. getMonthHisPateintInfo(params).then(response => {
  4062. if (response.data.state == 0) {
  4063. this.$message.error(response.data.msg)
  4064. this.isloading = false
  4065. return false
  4066. } else {
  4067. this.patientid = val.id
  4068. this.isloading = false
  4069. this.prescriptions = []
  4070. this.month_prescriptions = []
  4071. this.patientInfo = response.data.data.xt_info
  4072. this.hisPatientInfo = response.data.data.his_info
  4073. this.case_history = response.data.data.case_history
  4074. this.info = response.data.data.info
  4075. this.last_info = response.data.data.last_info
  4076. this.schedule = response.data.data.schedule
  4077. this.doctors = response.data.data.doctors
  4078. this.department = response.data.data.department
  4079. for (let i = 0; i < this.doctors.length; i++) {
  4080. if (this.doctors[i].user_type == 1) {
  4081. this.doctors.splice(i, 1)
  4082. }
  4083. }
  4084. var month_prescriptions = response.data.data.month_prescriptions
  4085. this.setMonthPrescription(month_prescriptions)
  4086. this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
  4087. if (this.case_history.temperature <= 0) {
  4088. this.case_history.temperature = ''
  4089. }
  4090. if (this.case_history.blood_sugar <= 0) {
  4091. this.case_history.blood_sugar = ''
  4092. }
  4093. if (this.case_history.pulse <= 0) {
  4094. this.case_history.pulse = ''
  4095. }
  4096. if (this.case_history.sbp <= 0) {
  4097. this.case_history.sbp = ''
  4098. }
  4099. if (this.case_history.dbp <= 0) {
  4100. this.case_history.dbp = ''
  4101. }
  4102. if (this.case_history.height <= 0) {
  4103. this.case_history.height = ''
  4104. }
  4105. if (this.case_history.blood_fat <= 0) {
  4106. this.case_history.blood_fat = ''
  4107. }
  4108. if (this.case_history.sick_type <= 0) {
  4109. this.case_history.sick_type = ''
  4110. }
  4111. if (this.case_history.sick <= 0) {
  4112. this.case_history.sick = ''
  4113. }
  4114. if (this.case_history.diagnose <= 0) {
  4115. this.case_history.diagnose = ''
  4116. }
  4117. this.case_history.sick_date = uParseTime(this.case_history.sick_date, '{y}-{m}-{d}')
  4118. if (this.case_history.is_infect == 1) {
  4119. this.case_history.is_infect = true
  4120. } else {
  4121. this.case_history.is_infect = false
  4122. }
  4123. this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
  4124. }
  4125. })
  4126. }
  4127. },
  4128. created() {
  4129. this.getInitData()
  4130. var nowDate = new Date()
  4131. var nowYear = nowDate.getFullYear()
  4132. var nowMonth = nowDate.getMonth() + 1
  4133. var nowDay = nowDate.getDate()
  4134. this.record_date =
  4135. nowYear +
  4136. '-' +
  4137. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  4138. '-' +
  4139. (nowDay < 10 ? '0' + nowDay : nowDay)
  4140. this.getList()
  4141. // this.diagnoses = this.getDictionaryDataConfig('system', 'diagnose')
  4142. // this.other_sick = this.getDictionaryDataConfig('system', 'other_sick_history')
  4143. let tableHeight = document.body.clientHeight - 263
  4144. this.tableHeight = tableHeight
  4145. },
  4146. mounted() {
  4147. const that = this
  4148. window.onresize = () => {
  4149. return (() => {
  4150. window.fullHeight = document.documentElement.clientHeight
  4151. that.fullHeight = window.fullHeight
  4152. })()
  4153. }
  4154. },
  4155. watch: {
  4156. fullHeight(val) {
  4157. if (!this.timer) {
  4158. this.fullHeight = val
  4159. let tableHeight = val - 263
  4160. this.tableHeight = tableHeight
  4161. this.timer = true
  4162. let that = this
  4163. setTimeout(function() {
  4164. that.timer = false
  4165. }, 400)
  4166. }
  4167. }
  4168. }
  4169. }
  4170. </script>
  4171. <style lang="scss" scoped>
  4172. .new-main-contain {
  4173. height: 100%;
  4174. display: flex;
  4175. flex-direction: column;
  4176. }
  4177. .app-container {
  4178. height: 100%;
  4179. }
  4180. .mainCell {
  4181. height: 36px;
  4182. display: flex;
  4183. align-items: center;
  4184. }
  4185. .mainLeft {
  4186. width: 200px;
  4187. height: 100%;
  4188. display: flex;
  4189. flex-direction: column;
  4190. .el-radio {
  4191. margin-right: 5px;
  4192. }
  4193. }
  4194. .mainRight {
  4195. margin-left: 10px;
  4196. flex: 1;
  4197. height: 100%;
  4198. display: flex;
  4199. flex-direction: column;
  4200. overflow-y: auto;
  4201. .cellSpan {
  4202. min-width: 80px;
  4203. display: inline-block;
  4204. margin-right: 10px;
  4205. }
  4206. }
  4207. .mainCenter {
  4208. display: flex;
  4209. flex: 1;
  4210. }
  4211. .centerLeft {
  4212. flex: 1;
  4213. display: flex;
  4214. flex-direction: column;
  4215. position: relative;
  4216. .el-form-item {
  4217. width: 32%;
  4218. margin-right: 1%;
  4219. float: left;
  4220. }
  4221. .el-form-item__label {
  4222. text-align: left;
  4223. }
  4224. }
  4225. .backColor {
  4226. background: #f6f8f9;
  4227. height: 5px;
  4228. margin-bottom: 5px;
  4229. }
  4230. .tabsBox {
  4231. position: relative;
  4232. height: 76%;
  4233. overflow-y: auto;
  4234. margin-bottom: 60px;
  4235. .el-tabs__item {
  4236. padding: 0 10px;
  4237. }
  4238. }
  4239. .preTabs {
  4240. height: 100%;
  4241. display: flex;
  4242. flex-direction: column;
  4243. .el-tabs__content {
  4244. flex: 1;
  4245. overflow-y: auto;
  4246. }
  4247. }
  4248. .costBox {
  4249. width: 100%;
  4250. height: 60px;
  4251. background: #fff;
  4252. position: absolute;
  4253. bottom: 0;
  4254. display: flex;
  4255. align-items: center;
  4256. }
  4257. .addTab {
  4258. position: absolute;
  4259. right: 0;
  4260. top: 14px;
  4261. z-index: 20;
  4262. }
  4263. .centerRight {
  4264. width: 300px;
  4265. margin-left: 10px;
  4266. display: flex;
  4267. flex-direction: column;
  4268. position: relative;
  4269. }
  4270. .rightTab {
  4271. height: 40px;
  4272. width: 100%;
  4273. border: 1px solid #d2d2d2;
  4274. box-sizing: border-box;
  4275. p {
  4276. width: 50%;
  4277. height: 40px;
  4278. line-height: 40px;
  4279. text-align: center;
  4280. background: #eee;
  4281. float: left;
  4282. }
  4283. > p:last-child {
  4284. border-left: 1px solid #d2d2d2;
  4285. float: right;
  4286. }
  4287. .activeP {
  4288. background: #409EFF;
  4289. color: #fff;
  4290. }
  4291. }
  4292. .comfirmBox {
  4293. width: 100%;
  4294. height: 60px;
  4295. background: #fff;
  4296. position: absolute;
  4297. bottom: 0;
  4298. display: flex;
  4299. align-items: center;
  4300. justify-content: space-between;
  4301. }
  4302. .mainHeader {
  4303. width: 100%;
  4304. background: #fff;
  4305. position: fixed;
  4306. z-index: 100;
  4307. height: 36px;
  4308. }
  4309. .titleBox {
  4310. position: fixed;
  4311. z-index: 99;
  4312. background: #fff;
  4313. }
  4314. .fixedCell {
  4315. position: fixed;
  4316. z-index: 99;
  4317. right: 30px;
  4318. background: #fff;
  4319. width: 300px;
  4320. display: flex;
  4321. justify-content: space-between;
  4322. }
  4323. </style>
  4324. <style lang="scss">
  4325. .centerLeft {
  4326. .el-form-item__label {
  4327. text-align: left;
  4328. }
  4329. }
  4330. .tabsBox {
  4331. .el-tabs__item {
  4332. padding: 0 10px;
  4333. }
  4334. .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) {
  4335. padding: 0 10px;
  4336. }
  4337. .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 {
  4338. padding: 0 10px;
  4339. }
  4340. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  4341. padding: 0 10px;
  4342. }
  4343. }
  4344. .centerRight {
  4345. .el-tabs__nav-scroll {
  4346. display: flex;
  4347. }
  4348. .el-tabs__nav {
  4349. margin: 0 auto;
  4350. }
  4351. .el-table th .cell, .el-table td .cell {
  4352. padding: 0 2px;
  4353. }
  4354. }
  4355. .preTabs {
  4356. .el-tabs__content {
  4357. }
  4358. }
  4359. .rightTabs {
  4360. height: 100%;
  4361. .el-tabs__content {
  4362. }
  4363. }
  4364. .centerDialog {
  4365. .el-dialog__body {
  4366. max-height: calc(100vh - 100px) !important;
  4367. padding: 0 20px;
  4368. }
  4369. }
  4370. </style>