doctorDesk.vue 241KB

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