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

doctorDesk.vue 223KB

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