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

doctorDesk.vue 199KB

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