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

doctorDesk.vue 199KB

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