doctorDesk.vue 291KB

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