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

doctorDesk.vue 213KB

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