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

doctorDesk.vue 260KB

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