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

doctorDesk.vue 223KB

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