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

doctorDesk.vue 217KB

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