editTableData.vue 202KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375
  1. <template>
  2. <!-- <div> -->
  3. <!-- 编辑排班 -->
  4. <div id="edit_table_data" v-show="schedulingTableVisible" >
  5. <slot></slot>
  6. <div class="table_contain">
  7. <!-- 左侧 -->
  8. <div class="left_contain">
  9. <div class="cell clearfix"
  10. v-if="
  11. weekTime == 'thisWeek' ||
  12. weekTime == 'nextWeek' ||
  13. weekTime == 'nextTwoWeek'
  14. ">
  15. <el-input
  16. size="small"
  17. style="width: 160px"
  18. class="filter-item"
  19. v-model.trim="keywords"
  20. placeholder="病人名称/透析号"
  21. @keyup.enter.native="search"
  22. />
  23. <el-button
  24. size="small"
  25. class="filter-item"
  26. type="primary"
  27. icon="el-icon-search"
  28. @click="search"
  29. >搜索</el-button>
  30. </div>
  31. <div style="margin-bottom: 10px; display: flex">
  32. <h3 style="line-height: 45px">
  33. <span
  34. style="margin-right: 10px; font-size: 16px; white-space: nowrap"
  35. >当前选择</span
  36. >
  37. </h3>
  38. <div style="line-height: 30px">
  39. <!-- 拖拽dragstart -->
  40. <div
  41. draggable="true"
  42. class="item_touz"
  43. style="font-weight: bolder"
  44. @dragstart="curInfoDragStart()"
  45. >
  46. <span>{{ cur_info.patient_name }}</span>
  47. &nbsp;
  48. <span>{{ cur_info.mode_name }}</span>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="patient_mode">
  53. <el-table
  54. :row-style="{ color: '#303133' }"
  55. :header-cell-style="{
  56. backgroundColor: 'rgb(245, 247, 250)',
  57. color: '#606266',
  58. }"
  59. :data="patientList"
  60. height='600'
  61. border
  62. @row-click="patientClick"
  63. :cell-class-name="patientClass"
  64. ref="patient_table"
  65. style="width: 100%; margin-right: 14px ;"
  66. >
  67. <el-table-column
  68. label="患者名称"
  69. align="center"
  70. >
  71. <template slot-scope="scope">
  72. <span v-if="scope.row.is_infectious == 2" style="color: red;">{{scope.row.name }}</span>
  73. <span v-if="scope.row.is_infectious != 2" >
  74. {{scope.row.name }}
  75. </span>
  76. <!-- <span class="touxi_cishu" @click="chishuclick(scope.row.name)">
  77. 0/4
  78. </span> -->
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <el-table
  83. :row-style="{ color: '#303133' }"
  84. :header-cell-style="{
  85. backgroundColor: 'rgb(245, 247, 250)',
  86. color: '#606266',
  87. }"
  88. :data="modes"
  89. height="600"
  90. :cell-class-name="dialysis_patient"
  91. ref="mode_table"
  92. @row-click="modeClick"
  93. border
  94. style="width: 100%;"
  95. >
  96. <el-table-column
  97. prop="name"
  98. label="透析模式"
  99. align="center"
  100. ></el-table-column>
  101. </el-table>
  102. </div>
  103. </div>
  104. <!-- 右侧 -->
  105. <div class="right_contain">
  106. <span>日期:</span>
  107. <el-select v-model="week_type" style="margin-bottom: 15px;" placeholder="请选择" multiple>
  108. <el-option
  109. @change="changeWeekDay"
  110. v-for="(item, index) in week_zhongwens"
  111. :key="index"
  112. :label="item"
  113. :value="item"
  114. >
  115. </el-option>
  116. </el-select>
  117. <span>分区:</span>
  118. <!-- 下拉框 -->
  119. <el-select
  120. v-model="partition_id"
  121. multiple
  122. placeholder="请选择"
  123. @change="changePartiton"
  124. >
  125. <el-option
  126. v-for="item in this.zones"
  127. :key="item.id"
  128. :label="item.name"
  129. :value="item.id"
  130. >
  131. </el-option>
  132. </el-select>
  133. <!-- 显示透析模式开关 -->
  134. <el-switch
  135. v-model="modename_value"
  136. :active-value=true
  137. active-text="显示透析模式"
  138. @change="switchMode(modename_value)">
  139. </el-switch>
  140. <!-- 编辑排班表格 -->
  141. <el-table id="eltable"
  142. :row-style="{ color: '#303133' }"
  143. :header-cell-style="{
  144. backgroundColor: 'rgb(245, 247, 250)',
  145. color: '#606266',
  146. // border: '1px solid aqua',
  147. }"
  148. v-loading="loading"
  149. element-loading-text="拼命加载中"
  150. element-loading-spinner="el-icon-loading"
  151. element-loading-background="rgba(0, 0, 0, 0.8)"
  152. :fit="true"
  153. :data="scheduleZone"
  154. @cell-click="clickThis"
  155. @cell-mouse-enter="hoverMouse"
  156. @cell-mouse-leave="leavemouse"
  157. @cell-dblclick="dblclickThis"
  158. :span-method="objectSpanMethod"
  159. :summary-method="getSummaries"
  160. :cell-class-name="cellClass"
  161. :cell-style ='cellstyle'
  162. :row-class-name="tableRowClassName"
  163. show-summary
  164. height="calc(100% - 50px)"
  165. ref="table"
  166. style="table-layout: fixed;"
  167. >
  168. <!-- :cell-style ='cellstyle' :height="tableContainHeight" calc(100% - 50px) 600-->
  169. <el-table-column
  170. prop="area"
  171. label="分区"
  172. min-width="60"
  173. align="center"
  174. fixed
  175. ></el-table-column>
  176. <el-table-column
  177. prop="cut"
  178. label="机号"
  179. min-width="50"
  180. align="center"
  181. fixed
  182. ></el-table-column>
  183. <el-table-column
  184. :label="'周一 (' + weekTitle[0] + ')'"
  185. v-if="isShowOne"
  186. align="center"
  187. >
  188. <el-table-column prop="Mon_M" label="上" min-width="50" align="center">
  189. <template slot-scope="scope">
  190. <div class="del_table_btn">
  191. <!-- 排班表取消排班按钮 v-if="showclickIcon==true&&scope.row.id==rowid"-->
  192. <el-button
  193. type="danger"
  194. size="mini"
  195. icon="el-icon-close"
  196. circle
  197. @click.stop="deletePatientMode(scope.row.Mon_M)"
  198. v-show="scope.row.Mon_M.patient_id== 0 ? false : true"
  199. ></el-button>
  200. </div>
  201. <div
  202. @drop="
  203. drop(
  204. $event,
  205. 'Mon_M',
  206. scope.row.index,
  207. scope.row.Mon_M,
  208. scope.row
  209. )"
  210. @dragover="allowDrop"
  211. @dragover.prevent
  212. >
  213. <schedule-item
  214. :schedule-detail="scope.row.Mon_M"
  215. :draggable="isEditForDate('Mon_M')&& scope.row.Mon_M ? 'true' : 'false'"
  216. class="contitem"
  217. :style="{
  218. cursor: scope.row.Mon_M ? 'move' : 'default',
  219. }"
  220. @dragstart.native="
  221. drag(
  222. $event,
  223. 'Mon_M',
  224. scope.row.index,
  225. scope.row.Mon_M,
  226. scope.row
  227. )"
  228. @mouseover.native="
  229. mouseoveinfo(
  230. $event,
  231. 'Mon_M',
  232. scope.row.index,
  233. scope.row.Mon_M,
  234. scope.row
  235. )"
  236. :schedulMode="modename_value">
  237. </schedule-item>
  238. </div>
  239. </template>
  240. </el-table-column>
  241. <el-table-column prop="Mon_A" label="下" min-width="50" align="center">
  242. <template slot-scope="scope">
  243. <div class="del_table_btn">
  244. <el-button
  245. type="danger"
  246. size="mini"
  247. icon="el-icon-close"
  248. circle
  249. @click.stop="deletePatientMode(scope.row.Mon_A)"
  250. v-show="scope.row.Mon_A.patient_id== 0 ? false : true"
  251. ></el-button>
  252. </div>
  253. <div
  254. @drop="
  255. drop(
  256. $event,
  257. 'Mon_A',
  258. scope.row.index,
  259. scope.row.Mon_A,
  260. scope.row
  261. )"
  262. @dragover="allowDrop"
  263. @dragover.prevent
  264. >
  265. <schedule-item
  266. :schedule-detail="scope.row.Mon_A"
  267. :draggable="isEditForDate('Mon_A')&&scope.row.Mon_A ? 'true' : 'false'"
  268. class="contitem"
  269. :style="{
  270. cursor: scope.row.Mon_A ? 'move' : 'default',
  271. }"
  272. @dragstart.native="
  273. drag(
  274. $event,
  275. 'Mon_A',
  276. scope.row.index,
  277. scope.row.Mon_A,
  278. scope.row
  279. )"
  280. @mouseover.native="
  281. mouseoveinfo(
  282. $event,
  283. 'Mon_A',
  284. scope.row.index,
  285. scope.row.Mon_A,
  286. scope.row
  287. )"
  288. :schedulMode="modename_value"
  289. >
  290. <!-- -->
  291. </schedule-item>
  292. </div>
  293. </template>
  294. </el-table-column>
  295. <el-table-column prop="Mon_N" label="晚" min-width="50" align="center">
  296. <template slot-scope="scope">
  297. <div class="del_table_btn">
  298. <el-button
  299. type="danger"
  300. size="mini"
  301. icon="el-icon-close"
  302. circle
  303. @click.stop="deletePatientMode(scope.row.Mon_N)"
  304. v-show="scope.row.Mon_N.patient_id== 0 ? false : true"
  305. ></el-button>
  306. </div>
  307. <div
  308. @drop="
  309. drop(
  310. $event,
  311. 'Mon_N',
  312. scope.row.index,
  313. scope.row.Mon_N,
  314. scope.row
  315. )
  316. "
  317. @dragover="allowDrop"
  318. >
  319. <schedule-item
  320. :schedule-detail="scope.row.Mon_N"
  321. :draggable="isEditForDate('Mon_N') && scope.row.Mon_N ? 'true' : 'false'"
  322. class="contitem"
  323. :style="{
  324. cursor: scope.row.Mon_N ? 'move' : 'default',
  325. }"
  326. @dragstart.native="
  327. drag(
  328. $event,
  329. 'Mon_N',
  330. scope.row.index,
  331. scope.row.Mon_N,
  332. scope.row
  333. )"
  334. @mouseover.native="
  335. mouseoveinfo(
  336. $event,
  337. 'Mon_N',
  338. scope.row.index,
  339. scope.row.Mon_N,
  340. scope.row
  341. )
  342. "
  343. :schedulMode="modename_value"
  344. >
  345. <!-- -->
  346. </schedule-item>
  347. </div>
  348. </template>
  349. </el-table-column>
  350. </el-table-column>
  351. <el-table-column
  352. :label="'周二 (' + weekTitle[1] + ')'"
  353. v-if="isShowTwo"
  354. align="center"
  355. >
  356. <el-table-column prop="Tue_M" label="上" min-width="50" align="center">
  357. <template slot-scope="scope">
  358. <div class="del_table_btn">
  359. <el-button
  360. type="danger"
  361. size="mini"
  362. icon="el-icon-close"
  363. circle
  364. @click.stop="deletePatientMode(scope.row.Tue_M)"
  365. v-show="scope.row.Tue_M.patient_id== 0 ? false : true"
  366. ></el-button>
  367. </div>
  368. <div
  369. @drop="
  370. drop(
  371. $event,
  372. 'Tue_M',
  373. scope.row.index,
  374. scope.row.Tue_M,
  375. scope.row
  376. )
  377. "
  378. @dragover="allowDrop"
  379. >
  380. <schedule-item
  381. :schedule-detail="scope.row.Tue_M"
  382. :draggable="isEditForDate('Tue_M')&&scope.row.Tue_M ? 'true' : 'false'"
  383. class="contitem"
  384. :style="{
  385. cursor: scope.row.Tue_M ? 'move' : 'default',
  386. }"
  387. @dragstart.native="
  388. drag(
  389. $event,
  390. 'Tue_M',
  391. scope.row.index,
  392. scope.row.Tue_M,
  393. scope.row
  394. )"
  395. @mouseover.native="mouseoveinfo(
  396. $event,
  397. 'Tue_M',
  398. scope.row.index,
  399. scope.row.Tue_M,
  400. scope.row
  401. )"
  402. :schedulMode="modename_value"
  403. >
  404. </schedule-item>
  405. </div>
  406. </template>
  407. </el-table-column>
  408. <el-table-column prop="Tue_A" label="下" min-width="50" align="center">
  409. <template slot-scope="scope">
  410. <div class="del_table_btn">
  411. <el-button
  412. type="danger"
  413. size="mini"
  414. icon="el-icon-close"
  415. circle
  416. @click.stop="deletePatientMode(scope.row.Tue_A)"
  417. v-show="scope.row.Tue_A.patient_id== 0 ? false : true"
  418. ></el-button>
  419. </div>
  420. <div
  421. @drop="
  422. drop(
  423. $event,
  424. 'Tue_A',
  425. scope.row.index,
  426. scope.row.Tue_A,
  427. scope.row
  428. )
  429. "
  430. @dragover="allowDrop"
  431. >
  432. <schedule-item
  433. :schedule-detail="scope.row.Tue_A"
  434. :draggable="isEditForDate('Tue_A')&&scope.row.Tue_A ? 'true' : 'false'"
  435. class="contitem"
  436. :style="{
  437. cursor: scope.row.Tue_A ? 'move' : 'default',
  438. }"
  439. @dragstart.native="
  440. drag(
  441. $event,
  442. 'Tue_A',
  443. scope.row.index,
  444. scope.row.Tue_A,
  445. scope.row
  446. )
  447. "
  448. @mouseover.native="
  449. mouseoveinfo(
  450. $event,
  451. 'Tue_A',
  452. scope.row.index,
  453. scope.row.Tue_A,
  454. scope.row
  455. )
  456. "
  457. :schedulMode="modename_value"
  458. ></schedule-item>
  459. </div>
  460. </template>
  461. </el-table-column>
  462. <el-table-column prop="Tue_N" label="晚" min-width="50" align="center">
  463. <template slot-scope="scope">
  464. <div class="del_table_btn">
  465. <el-button
  466. type="danger"
  467. size="mini"
  468. icon="el-icon-close"
  469. circle
  470. @click.stop="deletePatientMode(scope.row.Tue_N)"
  471. v-show="scope.row.Tue_N.patient_id== 0 ? false : true"
  472. ></el-button>
  473. </div>
  474. <div
  475. @drop="
  476. drop(
  477. $event,
  478. 'Tue_N',
  479. scope.row.index,
  480. scope.row.Tue_N,
  481. scope.row
  482. )
  483. "
  484. @dragover="allowDrop"
  485. >
  486. <schedule-item
  487. :schedule-detail="scope.row.Tue_N"
  488. :draggable="isEditForDate('Tue_N')&&scope.row.Tue_N ? 'true' : 'false'"
  489. class="contitem"
  490. :style="{
  491. cursor: scope.row.Tue_N ? 'move' : 'default',
  492. }"
  493. @dragstart.native="
  494. drag(
  495. $event,
  496. 'Tue_N',
  497. scope.row.index,
  498. scope.row.Tue_N,
  499. scope.row
  500. )
  501. "
  502. @mouseover.native="
  503. mouseoveinfo(
  504. $event,
  505. 'Tue_N',
  506. scope.row.index,
  507. scope.row.Tue_N,
  508. scope.row
  509. )
  510. "
  511. :schedulMode="modename_value"
  512. ></schedule-item>
  513. </div>
  514. </template>
  515. </el-table-column>
  516. </el-table-column>
  517. <el-table-column
  518. :label="'周三 (' + weekTitle[2] + ')'"
  519. v-if="isShowThree"
  520. align="center"
  521. >
  522. <el-table-column prop="Wed_M" label="上" min-width="50" align="center">
  523. <template slot-scope="scope">
  524. <div class="del_table_btn">
  525. <el-button
  526. type="danger"
  527. size="mini"
  528. icon="el-icon-close"
  529. circle
  530. @click.stop="deletePatientMode(scope.row.Wed_M)"
  531. v-show="scope.row.Wed_M.patient_id== 0 ? false : true"
  532. ></el-button>
  533. </div>
  534. <div
  535. @drop="
  536. drop(
  537. $event,
  538. 'Wed_M',
  539. scope.row.index,
  540. scope.row.Wed_M,
  541. scope.row
  542. )
  543. "
  544. @dragover="allowDrop"
  545. >
  546. <schedule-item
  547. :schedulMode="modename_value"
  548. :schedule-detail="scope.row.Wed_M"
  549. :draggable="isEditForDate('Wed_M')&&scope.row.Wed_M ? 'true' : 'false'"
  550. class="contitem"
  551. :style="{
  552. cursor: scope.row.Wed_M ? 'move' : 'default',
  553. }"
  554. @dragstart.native="
  555. drag(
  556. $event,
  557. 'Wed_M',
  558. scope.row.index,
  559. scope.row.Wed_M,
  560. scope.row
  561. )
  562. "
  563. @mouseover.native="
  564. mouseoveinfo(
  565. $event,
  566. 'Wed_M',
  567. scope.row.index,
  568. scope.row.Wed_M,
  569. scope.row
  570. )"
  571. ></schedule-item>
  572. </div>
  573. </template>
  574. </el-table-column>
  575. <el-table-column prop="Wed_A" label="下" min-width="50" align="center">
  576. <template slot-scope="scope">
  577. <div class="del_table_btn">
  578. <el-button
  579. type="danger"
  580. size="mini"
  581. icon="el-icon-close"
  582. circle
  583. @click.stop="deletePatientMode(scope.row.Wed_A)"
  584. v-show="scope.row.Wed_A.patient_id== 0 ? false : true"
  585. ></el-button>
  586. </div>
  587. <div
  588. @drop="
  589. drop(
  590. $event,
  591. 'Wed_A',
  592. scope.row.index,
  593. scope.row.Wed_A,
  594. scope.row
  595. )
  596. "
  597. @dragover="allowDrop"
  598. >
  599. <schedule-item
  600. :schedule-detail="scope.row.Wed_A"
  601. :draggable="isEditForDate('Wed_A')&&scope.row.Wed_A ? 'true' : 'false'"
  602. class="contitem"
  603. :style="{
  604. cursor: scope.row.Wed_A ? 'move' : 'default',
  605. }"
  606. @dragstart.native="
  607. drag(
  608. $event,
  609. 'Wed_A',
  610. scope.row.index,
  611. scope.row.Wed_A,
  612. scope.row
  613. )"
  614. @mouseover.native="
  615. mouseoveinfo(
  616. $event,
  617. 'Wed_A',
  618. scope.row.index,
  619. scope.row.Wed_A,
  620. scope.row
  621. )"
  622. :schedulMode="modename_value"
  623. ></schedule-item>
  624. </div>
  625. </template>
  626. </el-table-column>
  627. <el-table-column prop="Wed_N" label="晚" min-width="50" align="center">
  628. <template slot-scope="scope">
  629. <div class="del_table_btn">
  630. <el-button
  631. type="danger"
  632. size="mini"
  633. icon="el-icon-close"
  634. circle
  635. @click.stop="deletePatientMode(scope.row.Wed_N)"
  636. v-show="scope.row.Wed_N.patient_id== 0 ? false : true"
  637. ></el-button>
  638. </div>
  639. <div
  640. @drop="
  641. drop(
  642. $event,
  643. 'Wed_N',
  644. scope.row.index,
  645. scope.row.Wed_N,
  646. scope.row
  647. )
  648. "
  649. @dragover="allowDrop"
  650. >
  651. <schedule-item
  652. :schedule-detail="scope.row.Wed_N"
  653. :draggable="isEditForDate('Wed_N')&&scope.row.Wed_N ? 'true' : 'false'"
  654. class="contitem"
  655. :style="{
  656. cursor: scope.row.Wed_N ? 'move' : 'default',
  657. }"
  658. @dragstart.native="
  659. drag(
  660. $event,
  661. 'Wed_N',
  662. scope.row.index,
  663. scope.row.Wed_N,
  664. scope.row
  665. )
  666. "
  667. @mouseover.native="
  668. mouseoveinfo(
  669. $event,
  670. 'Wed_N',
  671. scope.row.index,
  672. scope.row.Wed_N,
  673. scope.row
  674. )"
  675. :schedulMode="modename_value"
  676. ></schedule-item>
  677. </div>
  678. </template>
  679. </el-table-column>
  680. </el-table-column>
  681. <el-table-column
  682. :label="'周四 (' + weekTitle[3] + ')'"
  683. align="center"
  684. v-if="isShowFour"
  685. >
  686. <el-table-column prop="Thurs_M" label="上" min-width="50" align="center"
  687. >
  688. <template slot-scope="scope">
  689. <div class="del_table_btn">
  690. <el-button
  691. type="danger"
  692. size="mini"
  693. icon="el-icon-close"
  694. circle
  695. @click.stop="deletePatientMode(scope.row.Thurs_M)"
  696. v-show="scope.row.Thurs_M.patient_id== 0 ? false : true"
  697. ></el-button>
  698. </div>
  699. <div
  700. @drop="
  701. drop(
  702. $event,
  703. 'Thurs_M',
  704. scope.row.index,
  705. scope.row.Thurs_M,
  706. scope.row
  707. )
  708. "
  709. @dragover="allowDrop"
  710. >
  711. <schedule-item
  712. :schedule-detail="scope.row.Thurs_M"
  713. :draggable="isEditForDate('Thurs_M')&&scope.row.Thurs_M ? 'true' : 'false'"
  714. class="contitem"
  715. :style="{
  716. cursor: scope.row.Thurs_M ? 'move' : 'default',
  717. }"
  718. @dragstart.native="
  719. drag(
  720. $event,
  721. 'Thurs_M',
  722. scope.row.index,
  723. scope.row.Thurs_M,
  724. scope.row
  725. )"
  726. @mouseover.native="
  727. mouseoveinfo(
  728. $event,
  729. 'Thurs_M',
  730. scope.row.index,
  731. scope.row.Thurs_M,
  732. scope.row
  733. )"
  734. :schedulMode="modename_value"
  735. ></schedule-item>
  736. </div>
  737. </template>
  738. </el-table-column>
  739. <el-table-column
  740. prop="Thurs_A"
  741. label="下"
  742. min-width="50"
  743. align="center"
  744. >
  745. <template slot-scope="scope">
  746. <div class="del_table_btn">
  747. <el-button
  748. type="danger"
  749. size="mini"
  750. icon="el-icon-close"
  751. circle
  752. @click.stop="deletePatientMode(scope.row.Thurs_A)"
  753. v-show="scope.row.Thurs_A.patient_id== 0 ? false : true"
  754. ></el-button>
  755. </div>
  756. <div
  757. @drop="
  758. drop(
  759. $event,
  760. 'Thurs_A',
  761. scope.row.index,
  762. scope.row.Thurs_A,
  763. scope.row
  764. )
  765. "
  766. @dragover="allowDrop"
  767. >
  768. <schedule-item
  769. :schedule-detail="scope.row.Thurs_A"
  770. :draggable="isEditForDate('Thurs_A')&&scope.row.Thurs_A ? 'true' : 'false'"
  771. class="contitem"
  772. :style="{
  773. cursor: scope.row.Thurs_A ? 'move' : 'default',
  774. }"
  775. @dragstart.native="
  776. drag(
  777. $event,
  778. 'Thurs_A',
  779. scope.row.index,
  780. scope.row.Thurs_A,
  781. scope.row
  782. )
  783. "
  784. @mouseover.native="
  785. mouseoveinfo(
  786. $event,
  787. 'Thurs_A',
  788. scope.row.index,
  789. scope.row.Thurs_A,
  790. scope.row
  791. )"
  792. :schedulMode="modename_value"
  793. ></schedule-item>
  794. </div>
  795. </template>
  796. </el-table-column>
  797. <el-table-column
  798. prop="Thurs_N"
  799. label="晚"
  800. min-width="50"
  801. align="center"
  802. >
  803. <template slot-scope="scope">
  804. <div class="del_table_btn">
  805. <el-button
  806. type="danger"
  807. size="mini"
  808. icon="el-icon-close"
  809. circle
  810. @click.stop="deletePatientMode(scope.row.Thurs_N)"
  811. v-show="scope.row.Thurs_N.patient_id== 0 ? false : true"
  812. ></el-button>
  813. </div>
  814. <div
  815. @drop="
  816. drop(
  817. $event,
  818. 'Thurs_N',
  819. scope.row.index,
  820. scope.row.Thurs_N,
  821. scope.row
  822. )
  823. "
  824. @dragover="allowDrop"
  825. >
  826. <schedule-item
  827. :schedule-detail="scope.row.Thurs_N"
  828. :draggable="isEditForDate('Thurs_N')&&scope.row.Thurs_N ? 'true' : 'false'"
  829. class="contitem"
  830. :style="{
  831. cursor: scope.row.Thurs_N ? 'move' : 'default',
  832. }"
  833. @dragstart.native="
  834. drag(
  835. $event,
  836. 'Thurs_N',
  837. scope.row.index,
  838. scope.row.Thurs_N,
  839. scope.row
  840. )
  841. "
  842. @mouseover.native="
  843. mouseoveinfo(
  844. $event,
  845. 'Thurs_N',
  846. scope.row.index,
  847. scope.row.Thurs_N,
  848. scope.row
  849. )"
  850. :schedulMode="modename_value"
  851. ></schedule-item>
  852. </div>
  853. </template>
  854. </el-table-column>
  855. </el-table-column>
  856. <el-table-column
  857. :label="'周五 (' + weekTitle[4] + ')'"
  858. align="center"
  859. v-if="isShowFive"
  860. >
  861. <el-table-column prop="Fri_M" label="上" min-width="50" align="center">
  862. <template slot-scope="scope">
  863. <div class="del_table_btn">
  864. <el-button
  865. type="danger"
  866. size="mini"
  867. icon="el-icon-close"
  868. circle
  869. @click.stop="deletePatientMode(scope.row.Fri_M)"
  870. v-show="scope.row.Fri_M.patient_id== 0 ? false : true"
  871. ></el-button>
  872. </div>
  873. <div
  874. draggable="true"
  875. @drop="
  876. drop($event,
  877. 'Fri_M',
  878. scope.row.index,
  879. scope.row.Fri_M,
  880. scope.row)"
  881. @dragover="allowDrop"
  882. >
  883. <schedule-item
  884. :schedule-detail="scope.row.Fri_M"
  885. :draggable="isEditForDate('Fri_M')&&scope.row.Fri_M ? 'true' : 'false'"
  886. class="contitem"
  887. :style="{ cursor: scope.row.Fri_M ? 'move' : 'default' }"
  888. @dragstart.native="drag($event,
  889. 'Fri_M',
  890. scope.row.index,
  891. scope.row.Fri_M,
  892. scope.row )"
  893. @mouseover.native="
  894. mouseoveinfo(
  895. $event,
  896. 'Fri_M',
  897. scope.row.index,
  898. scope.row.Fri_M,
  899. scope.row
  900. )"
  901. :schedulMode="modename_value"
  902. ></schedule-item>
  903. </div>
  904. </template>
  905. </el-table-column>
  906. <el-table-column prop="Fri_A" label="下" min-width="50" align="center">
  907. <template slot-scope="scope">
  908. <div class="del_table_btn">
  909. <el-button
  910. type="danger"
  911. size="mini"
  912. icon="el-icon-close"
  913. circle
  914. @click.stop="deletePatientMode(scope.row.Fri_A)"
  915. v-show="scope.row.Fri_A.patient_id== 0 ? false : true"
  916. ></el-button>
  917. </div>
  918. <div @drop="
  919. drop($event,
  920. 'Fri_A',
  921. scope.row.index,
  922. scope.row.Fri_A,
  923. scope.row)"
  924. @dragover="allowDrop">
  925. <schedule-item
  926. :schedule-detail="scope.row.Fri_A"
  927. :draggable="isEditForDate('Fri_A')&&scope.row.Fri_A ? 'true' : 'false'"
  928. class="contitem"
  929. :style="{ cursor: scope.row.Fri_A ? 'move' : 'default' }"
  930. @dragstart.native="
  931. drag(
  932. $event,
  933. 'Fri_A',
  934. scope.row.index,
  935. scope.row.Fri_A,
  936. scope.row
  937. ) "
  938. @mouseover.native="
  939. mouseoveinfo(
  940. $event,
  941. 'Fri_A',
  942. scope.row.index,
  943. scope.row.Fri_A,
  944. scope.row
  945. )"
  946. :schedulMode="modename_value"
  947. ></schedule-item>
  948. </div>
  949. </template>
  950. </el-table-column>
  951. <el-table-column prop="Fri_N" label="晚" min-width="50" align="center">
  952. <template slot-scope="scope">
  953. <div class="del_table_btn">
  954. <el-button
  955. type="danger"
  956. size="mini"
  957. icon="el-icon-close"
  958. circle
  959. @click.stop="deletePatientMode(scope.row.Fri_N)"
  960. v-show="scope.row.Fri_N.patient_id== 0 ? false : true"
  961. ></el-button>
  962. </div>
  963. <div
  964. @drop="
  965. drop(
  966. $event,
  967. 'Fri_N',
  968. scope.row.index,
  969. scope.row.Fri_N,
  970. scope.row
  971. )
  972. "
  973. @dragover="allowDrop"
  974. >
  975. <schedule-item
  976. :schedule-detail="scope.row.Fri_N"
  977. :draggable="isEditForDate('Fri_N')&&scope.row.Fri_N ? 'true' : 'false'"
  978. class="contitem"
  979. :style="{ cursor: scope.row.Fri_N ? 'move' : 'default' }"
  980. @dragstart.native="
  981. drag(
  982. $event,
  983. 'Fri_N',
  984. scope.row.index,
  985. scope.row.Fri_N,
  986. scope.row
  987. )"
  988. @mouseover.native="
  989. mouseoveinfo(
  990. $event,
  991. 'Fri_N',
  992. scope.row.index,
  993. scope.row.Fri_N,
  994. scope.row
  995. )"
  996. :schedulMode="modename_value"
  997. >
  998. </schedule-item
  999. >
  1000. </div>
  1001. </template>
  1002. </el-table-column>
  1003. </el-table-column>
  1004. <el-table-column
  1005. :label="'周六 (' + weekTitle[5] + ')'"
  1006. align="center"
  1007. v-if="isShowSix"
  1008. >
  1009. <el-table-column prop="Sat_M" label="上" min-width="50" align="center">
  1010. <template slot-scope="scope">
  1011. <div class="del_table_btn">
  1012. <el-button
  1013. type="danger"
  1014. size="mini"
  1015. icon="el-icon-close"
  1016. circle
  1017. @click.stop="deletePatientMode(scope.row.Sat_M)"
  1018. v-show="scope.row.Sat_M.patient_id== 0 ? false : true"
  1019. ></el-button>
  1020. </div>
  1021. <div
  1022. @drop="
  1023. drop(
  1024. $event,
  1025. 'Sat_M',
  1026. scope.row.index,
  1027. scope.row.Sat_M,
  1028. scope.row
  1029. )
  1030. "
  1031. @dragover="allowDrop"
  1032. >
  1033. <schedule-item
  1034. :schedule-detail="scope.row.Sat_M"
  1035. :draggable="isEditForDate('Sat_M')&&scope.row.Sat_M ? 'true' : 'false'"
  1036. class="contitem"
  1037. :style="{ cursor: scope.row.Sat_M ? 'move' : 'default' }"
  1038. @dragstart.native="
  1039. drag(
  1040. $event,
  1041. 'Sat_M',
  1042. scope.row.index,
  1043. scope.row.Sat_M,
  1044. scope.row
  1045. )"
  1046. @mouseover.native="
  1047. mouseoveinfo(
  1048. $event,
  1049. 'Sat_M',
  1050. scope.row.index,
  1051. scope.row.Sat_M,
  1052. scope.row
  1053. )"
  1054. :schedulMode="modename_value"
  1055. >
  1056. </schedule-item>
  1057. </div>
  1058. </template>
  1059. </el-table-column>
  1060. <el-table-column prop="Sat_A" label="下" min-width="50" align="center">
  1061. <template slot-scope="scope">
  1062. <div class="del_table_btn">
  1063. <el-button
  1064. type="danger"
  1065. size="mini"
  1066. icon="el-icon-close"
  1067. circle
  1068. @click.stop="deletePatientMode(scope.row.Sat_A)"
  1069. v-show="scope.row.Sat_A.patient_id== 0 ? false : true"
  1070. ></el-button>
  1071. </div>
  1072. <div
  1073. @drop="
  1074. drop(
  1075. $event,
  1076. 'Sat_A',
  1077. scope.row.index,
  1078. scope.row.Sat_A,
  1079. scope.row
  1080. )"
  1081. @dragover="allowDrop"
  1082. >
  1083. <schedule-item
  1084. :schedule-detail="scope.row.Sat_A"
  1085. :draggable="isEditForDate('Sat_A')&&scope.row.Sat_A ? 'true' : 'false'"
  1086. class="contitem"
  1087. :style="{ cursor: scope.row.Sat_A ? 'move' : 'default' }"
  1088. @dragstart.native="
  1089. drag(
  1090. $event,
  1091. 'Sat_A',
  1092. scope.row.index,
  1093. scope.row.Sat_A,
  1094. scope.row
  1095. )"
  1096. @mouseover.native="
  1097. mouseoveinfo(
  1098. $event,
  1099. 'Sat_A',
  1100. scope.row.index,
  1101. scope.row.Sat_A,
  1102. scope.row
  1103. )"
  1104. :schedulMode="modename_value"
  1105. >
  1106. </schedule-item>
  1107. </div>
  1108. </template>
  1109. </el-table-column>
  1110. <el-table-column prop="Sat_N" label="晚" min-width="50" align="center">
  1111. <template slot-scope="scope">
  1112. <div class="del_table_btn">
  1113. <el-button
  1114. type="danger"
  1115. size="mini"
  1116. icon="el-icon-close"
  1117. circle
  1118. @click.stop="deletePatientMode(scope.row.Sat_N)"
  1119. v-show="scope.row.Sat_N.patient_id== 0 ? false : true"
  1120. ></el-button>
  1121. </div>
  1122. <div
  1123. @drop="
  1124. drop(
  1125. $event,
  1126. 'Sat_N',
  1127. scope.row.index,
  1128. scope.row.Sat_N,
  1129. scope.row
  1130. )
  1131. "
  1132. @dragover="allowDrop"
  1133. >
  1134. <schedule-item
  1135. :schedule-detail="scope.row.Sat_N"
  1136. :draggable="isEditForDate('Sat_N')&&scope.row.Sat_N ? 'true' : 'false'"
  1137. class="contitem"
  1138. :style="{ cursor: scope.row.Sat_N ? 'move' : 'default' }"
  1139. @dragstart.native="
  1140. drag(
  1141. $event,
  1142. 'Sat_N',
  1143. scope.row.index,
  1144. scope.row.Sat_N,
  1145. scope.row
  1146. )
  1147. "
  1148. @mouseover.native="
  1149. mouseoveinfo(
  1150. $event,
  1151. 'Sat_N',
  1152. scope.row.index,
  1153. scope.row.Sat_N,
  1154. scope.row
  1155. )"
  1156. :schedulMode="modename_value"
  1157. ></schedule-item>
  1158. </div>
  1159. </template>
  1160. </el-table-column>
  1161. </el-table-column>
  1162. <el-table-column
  1163. :label="'周日 (' + weekTitle[6] + ')'"
  1164. align="center"
  1165. v-if="isShowSeven"
  1166. >
  1167. <el-table-column
  1168. prop="Sun_M"
  1169. label="上"
  1170. min-width="50"
  1171. align="center"
  1172. >
  1173. <template slot-scope="scope">
  1174. <div class="del_table_btn">
  1175. <el-button
  1176. type="danger"
  1177. size="mini"
  1178. icon="el-icon-close"
  1179. circle
  1180. @click.stop="deletePatientMode(scope.row.Sun_M)"
  1181. v-show="scope.row.Sun_M.patient_id== 0 ? false : true"
  1182. ></el-button>
  1183. </div>
  1184. <div
  1185. @drop="
  1186. drop(
  1187. $event,
  1188. 'Sun_M',
  1189. scope.row.index,
  1190. scope.row.Sun_M,
  1191. scope.row
  1192. )
  1193. "
  1194. @dragover="allowDrop"
  1195. >
  1196. <schedule-item
  1197. :draggable="isEditForDate('Sun_M')&&scope.row.Sun_M ? 'true' : 'false'"
  1198. :schedule-detail="scope.row.Sun_M"
  1199. class="contitem"
  1200. :style="{ cursor: scope.row.Sun_M ? 'move' : 'default' }"
  1201. @dragstart.native="
  1202. drag(
  1203. $event,
  1204. 'Sun_M',
  1205. scope.row.index,
  1206. scope.row.Sun_M,
  1207. scope.row
  1208. )"
  1209. @mouseover.native="
  1210. mouseoveinfo(
  1211. $event,
  1212. 'Sun_M',
  1213. scope.row.index,
  1214. scope.row.Sun_M,
  1215. scope.row
  1216. )"
  1217. :schedulMode="modename_value"
  1218. >
  1219. </schedule-item>
  1220. </div>
  1221. </template>
  1222. </el-table-column>
  1223. <el-table-column
  1224. prop="Sun_A"
  1225. label="下"
  1226. min-width="50"
  1227. align="center"
  1228. >
  1229. <template slot-scope="scope">
  1230. <div class="del_table_btn">
  1231. <el-button
  1232. type="danger"
  1233. size="mini"
  1234. icon="el-icon-close"
  1235. circle
  1236. @click.stop="deletePatientMode(scope.row.Sun_A)"
  1237. v-show="scope.row.Sun_A.patient_id== 0 ? false : true"
  1238. ></el-button>
  1239. </div>
  1240. <div
  1241. @drop="
  1242. drop(
  1243. $event,
  1244. 'Sun_A',
  1245. scope.row.index,
  1246. scope.row.Sun_A,
  1247. scope.row
  1248. )
  1249. "
  1250. @dragover="allowDrop"
  1251. >
  1252. <schedule-item
  1253. :schedule-detail="scope.row.Sun_A"
  1254. :draggable="isEditForDate('Sun_A')&&scope.row.Sun_A ? 'true' : 'false'"
  1255. class="contitem"
  1256. :style="{ cursor: scope.row.Sun_A ? 'move' : 'default' }"
  1257. @dragstart.native="
  1258. drag(
  1259. $event,
  1260. 'Sun_A',
  1261. scope.row.index,
  1262. scope.row.Sun_A,
  1263. scope.row
  1264. )
  1265. "
  1266. @mouseover.native="
  1267. mouseoveinfo(
  1268. $event,
  1269. 'Sun_A',
  1270. scope.row.index,
  1271. scope.row.Sun_A,
  1272. scope.row
  1273. )"
  1274. :schedulMode="modename_value"
  1275. >
  1276. </schedule-item>
  1277. </div>
  1278. </template>
  1279. </el-table-column>
  1280. <el-table-column
  1281. prop="Sun_N"
  1282. label="晚"
  1283. min-width="50"
  1284. align="center"
  1285. >
  1286. <template slot-scope="scope">
  1287. <div class="del_table_btn">
  1288. <el-button
  1289. type="danger"
  1290. size="mini"
  1291. icon="el-icon-close"
  1292. circle
  1293. @click.stop="deletePatientMode(scope.row.Sun_N)"
  1294. v-show="scope.row.Sun_N.patient_id== 0 ? false : true"
  1295. ></el-button>
  1296. </div>
  1297. <div
  1298. @drop="
  1299. drop(
  1300. $event,
  1301. 'Sun_N',
  1302. scope.row.index,
  1303. scope.row.Sun_N,
  1304. scope.row
  1305. )
  1306. "
  1307. @dragover="allowDrop"
  1308. >
  1309. <schedule-item
  1310. :schedule-detail="scope.row.Sun_N"
  1311. :draggable="isEditForDate('Sun_N')&&scope.row.Sun_N ? 'true' : 'false'"
  1312. class="contitem"
  1313. :style="{ cursor: scope.row.Sun_N ? 'move' : 'default' }"
  1314. @dragstart.native="
  1315. drag(
  1316. $event,
  1317. 'Sun_N',
  1318. scope.row.index,
  1319. scope.row.Sun_N,
  1320. scope.row
  1321. )
  1322. "
  1323. @mouseover.native="
  1324. mouseoveinfo(
  1325. $event,
  1326. 'Sun_N',
  1327. scope.row.index,
  1328. scope.row.Sun_N,
  1329. scope.row
  1330. )"
  1331. :schedulMode="modename_value"
  1332. >
  1333. </schedule-item>
  1334. </div>
  1335. </template>
  1336. </el-table-column>
  1337. </el-table-column>
  1338. <el-table-column
  1339. prop="total"
  1340. label="合计"
  1341. width="30"
  1342. align="center"
  1343. >
  1344. </el-table-column>
  1345. </el-table>
  1346. </div>
  1347. </div>
  1348. <!-- 单击排班表格的空白单元格弹窗 -->
  1349. <el-dialog
  1350. title="排班"
  1351. :visible.sync="dialogTableVisible"
  1352. width="1000px;"
  1353. :v-model="dialog"
  1354. v-loading="creating_schedule"
  1355. :modal-append-to-body='false'
  1356. :close-on-click-modal="false"
  1357. >
  1358. <div>
  1359. <div class="cell clearfix">
  1360. <label class="title"><span class="name">当前排班</span> : </label>
  1361. <div class="time">
  1362. <ul class="">
  1363. <span class="current"
  1364. >日期 : {{ currentData.schedule_date }} &nbsp;&nbsp; 班次 :
  1365. {{ currentData.type_name }} &nbsp;&nbsp; 病房 :
  1366. {{ currentData.zone_name }} &nbsp;&nbsp; 透析机 :
  1367. {{ currentData.bed_name }}
  1368. </span>
  1369. </ul>
  1370. </div>
  1371. </div>
  1372. <div class="cell clearfix">
  1373. <label class="title"><span class="name">患者搜索</span> : </label>
  1374. <div class="time">
  1375. <ul class="">
  1376. <el-input
  1377. size="medium"
  1378. v-model="searchKey"
  1379. placeholder="请输入搜索的内容"
  1380. style="width: 260px"
  1381. @keyup.enter.native="SubmitSearch"
  1382. ></el-input>
  1383. <el-button
  1384. type="primary"
  1385. icon="el-icon-search"
  1386. @click="SubmitSearch"
  1387. >搜索</el-button
  1388. >
  1389. </ul>
  1390. </div>
  1391. </div>
  1392. <div class="cell clearfix">
  1393. <label class="title"><span class="name">排班</span> : </label>
  1394. <div class="time">
  1395. <ul class="">
  1396. <li
  1397. v-for="item in schedulArr"
  1398. @click="changeSearchSchedule(item.value)"
  1399. :key="item.value"
  1400. :class="patientQuery.schedule == item.value ? 'active' : ''"
  1401. >
  1402. {{ item.label }}
  1403. </li>
  1404. </ul>
  1405. </div>
  1406. </div>
  1407. <!-- <div class="cell clearfix">
  1408. <label class="title"><span class="name">标签</span> : </label>
  1409. <div class="time ">
  1410. <ul class="">
  1411. <li v-for="item in tagArr" :key="item.value" >{{item.label}}</li>
  1412. </ul>
  1413. </div>
  1414. </div> -->
  1415. <div class="cell clearfix">
  1416. <label class="title"><span class="name">传染病</span> : </label>
  1417. <div class="time">
  1418. <ul class="">
  1419. <li
  1420. v-for="item in diseasesArr"
  1421. @click="changeSearchContagion(item.value)"
  1422. :key="item.value"
  1423. :class="patientQuery.contagion == item.value ? 'active' : ''"
  1424. >
  1425. {{ item.label }}
  1426. </li>
  1427. </ul>
  1428. </div>
  1429. </div>
  1430. </div>
  1431. <el-table
  1432. ref="singleTable"
  1433. :data="patients"
  1434. border
  1435. highlight-current-row
  1436. @current-change="handleCurrentChange"
  1437. :header-cell-style="{ backgroundColor: 'rgb(236, 245, 255)' }"
  1438. >
  1439. <el-table-column
  1440. type="index"
  1441. label="序号"
  1442. width="89"
  1443. align="center"
  1444. ></el-table-column>
  1445. <el-table-column
  1446. property="dialysis_no"
  1447. label="透析号"
  1448. min-width="110"
  1449. align="center"
  1450. ></el-table-column>
  1451. <el-table-column
  1452. property="name"
  1453. label="姓名"
  1454. min-width="110"
  1455. align="center"
  1456. ></el-table-column>
  1457. <el-table-column
  1458. property="schedules"
  1459. label="双周已排"
  1460. min-width="80"
  1461. align="center"
  1462. >
  1463. <template slot-scope="scope">
  1464. <span>{{ scope.row.schedules.length }}次</span>
  1465. </template>
  1466. </el-table-column>
  1467. <el-table-column
  1468. property="solutions"
  1469. label="治疗频率"
  1470. min-width="200"
  1471. align="center"
  1472. >
  1473. <template slot-scope="scope">
  1474. <span v-for="solution in scope.row.solutions" :key="solution.id"
  1475. >{{ solution.name }}({{ solution.period }}{{ solution.times }})
  1476. </span>
  1477. </template>
  1478. </el-table-column>
  1479. <el-table-column
  1480. property="sch_remark"
  1481. label="备注"
  1482. min-width="200"
  1483. align="center"
  1484. >
  1485. </el-table-column>
  1486. </el-table>
  1487. <div slot="footer" class="dialog-footer">
  1488. <el-button @click="dialogTableVisible=false">取 消</el-button>
  1489. <!-- closePatientPanel -->
  1490. <el-button
  1491. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  1492. type="primary"
  1493. @click="setSchedule"
  1494. >保 存
  1495. </el-button>
  1496. </div>
  1497. </el-dialog>
  1498. <el-dialog
  1499. title="调整排班"
  1500. :visible.sync="tzDialogVisible"
  1501. width="500px"
  1502. class="mode_change"
  1503. :modal-append-to-body='false'
  1504. :close-on-click-modal="false"
  1505. >
  1506. <div style="width: 100%; margin: 0 auto; text-align: center">
  1507. <!-- <el-radio-group v-model="tiaoZhengType" :class="tiaozhengclass">
  1508. <el-radio :label="1">取消排班</el-radio>
  1509. <el-radio :label="2">调整机号</el-radio>
  1510. <el-radio :label="3">调整模式</el-radio>
  1511. </el-radio-group> -->
  1512. <span>调整模式:</span>
  1513. <el-select v-model="value" placeholder="请选择">
  1514. <el-option
  1515. v-for="item in mode_select"
  1516. :key="item.value"
  1517. :label="item.label"
  1518. :value="item.value"
  1519. >
  1520. </el-option>
  1521. </el-select>
  1522. </div>
  1523. <span slot="footer" class="dialog-footer" style="text-align: center">
  1524. <el-button
  1525. @click="
  1526. tzDialogVisible = false;
  1527. tiaoZhengType = 1;
  1528. "
  1529. >取 消</el-button
  1530. >
  1531. <el-button
  1532. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  1533. type="primary"
  1534. @click="submitTiaoX"
  1535. >
  1536. <span v-if="tiaoZhengType == 1">保存</span>
  1537. <span v-if="tiaoZhengType == 2">下一步</span>
  1538. <span v-if="tiaoZhengType == 3">下一步</span>
  1539. </el-button>
  1540. </span>
  1541. </el-dialog>
  1542. <!-- 双击弹窗 -->
  1543. <el-dialog
  1544. title="调整模式"
  1545. :visible.sync="msDialogVisible"
  1546. width="500px"
  1547. v-loading="changing_mode"
  1548. :modal-append-to-body='false'
  1549. :close-on-click-modal="false"
  1550. >
  1551. <div>
  1552. <el-form
  1553. :model="changeSchedule"
  1554. ref="changeSchedule"
  1555. :rules="changeRules"
  1556. >
  1557. <el-form-item label="" prop="mode_id">
  1558. <span>透析模式:</span>
  1559. <el-select
  1560. filterable
  1561. v-model="changeSchedule.mode_id"
  1562. placeholder="请选择"
  1563. style="width: 100%"
  1564. >
  1565. <el-option
  1566. :disabled="item.id == currentData.mode_id"
  1567. v-for="item in modeOptions"
  1568. :key="item.id"
  1569. :label="item.name"
  1570. :value="item.id"
  1571. >
  1572. </el-option>
  1573. </el-select>
  1574. </el-form-item>
  1575. <!-- <el-form-item>
  1576. <span>透析班次:</span>
  1577. <el-select
  1578. filterable
  1579. v-model="changeSchedule.schedule_type"
  1580. placeholder="请选择"
  1581. style="width: 100%"
  1582. @change="changeScheduleType"
  1583. >
  1584. <el-option
  1585. v-for="item in scheduleType"
  1586. :key="item.id"
  1587. :label="item.name"
  1588. :value="item.id"
  1589. >
  1590. </el-option>
  1591. </el-select>
  1592. </el-form-item>
  1593. <el-form-item>
  1594. <span>透析分区:</span>
  1595. <el-select
  1596. filterable
  1597. v-model="changeSchedule.partition_id"
  1598. placeholder="请选择"
  1599. style="width: 100%"
  1600. @change="changePartitionOne"
  1601. >
  1602. <el-option
  1603. v-for="(item, index) in zones"
  1604. :key="index"
  1605. :label="item.name"
  1606. :value="item.id"
  1607. >
  1608. </el-option>
  1609. </el-select>
  1610. </el-form-item>
  1611. <el-form-item>
  1612. <span>透析床位:</span>
  1613. <el-select
  1614. filterable
  1615. v-model="changeSchedule.bed_id"
  1616. placeholder="请选择"
  1617. style="width: 100%"
  1618. >
  1619. <el-option
  1620. v-for="item in numberList"
  1621. :key="item.id"
  1622. :label="item.number"
  1623. :value="item.id"
  1624. >
  1625. </el-option>
  1626. </el-select>
  1627. </el-form-item> -->
  1628. </el-form>
  1629. </div>
  1630. <span slot="footer" class="dialog-footer">
  1631. <el-button @click="msDialogVisible = false">取 消</el-button>
  1632. <el-button
  1633. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  1634. type="primary"
  1635. @click="submitMode('changeSchedule')"
  1636. >保 存</el-button
  1637. >
  1638. </span>
  1639. </el-dialog>
  1640. <!--调整机号 -->
  1641. <el-dialog
  1642. title="调整机号"
  1643. :visible.sync="jhDialogVisible"
  1644. width="500px"
  1645. v-loading="changing_bed"
  1646. :modal-append-to-body='false'
  1647. :close-on-click-modal="false"
  1648. >
  1649. <div>
  1650. <el-form
  1651. :model="changeSchedule"
  1652. ref="changeSchedule"
  1653. :rules="changeRules"
  1654. label-width="90px"
  1655. >
  1656. <el-form-item label="排班日期: ">
  1657. <el-input v-model="currentData.schedule_date" disabled></el-input>
  1658. </el-form-item>
  1659. <el-form-item label="班次: " prop="schedule_type">
  1660. <el-select
  1661. v-model="changeSchedule.schedule_type"
  1662. placeholder="请选择"
  1663. style="width: 100%"
  1664. @change="changeScheduleType"
  1665. >
  1666. <el-option
  1667. v-for="item in scheduleType"
  1668. :key="item.id"
  1669. :label="item.name"
  1670. :value="item.id"
  1671. >
  1672. </el-option>
  1673. </el-select>
  1674. </el-form-item>
  1675. <el-form-item label="分区: " prop="partition_id">
  1676. <el-select
  1677. v-model="zone_name"
  1678. placeholder="请选择"
  1679. style="width: 100%"
  1680. @change="changePartition"
  1681. >
  1682. <el-option
  1683. v-for="(item, index) in zone_names"
  1684. :key="index"
  1685. :label="item"
  1686. :value="item"
  1687. >
  1688. </el-option>
  1689. </el-select>
  1690. </el-form-item>
  1691. <el-form-item label="透析机: " prop="bed_id">
  1692. <el-select
  1693. v-model="device_id"
  1694. placeholder="请选择"
  1695. style="width: 100%"
  1696. >
  1697. <el-option
  1698. v-for="item in current_devices"
  1699. :key="item.id"
  1700. :label="item.number"
  1701. :value="item.id"
  1702. >
  1703. </el-option>
  1704. </el-select>
  1705. </el-form-item>
  1706. </el-form>
  1707. </div>
  1708. <span slot="footer" class="dialog-footer">
  1709. <el-button @click="jhDialogVisible = false">取 消</el-button>
  1710. <el-button
  1711. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  1712. type="primary"
  1713. @click="submitTiaoZJH('changeSchedule')"
  1714. >保 存</el-button
  1715. >
  1716. </span>
  1717. </el-dialog>
  1718. <!-- 智能排班弹窗 -->
  1719. <el-dialog
  1720. class="samrt_arrage"
  1721. :title="`智能排班 (姓名:${
  1722. this.cur_smart_patient_name ? this.cur_smart_patient_name : ''
  1723. } 透析号:${
  1724. this.cur_smart_patient_no ? this.cur_smart_patient_no : ''
  1725. })`"
  1726. width="900px"
  1727. :visible.sync="smartVisible"
  1728. :modal-append-to-body='false'
  1729. :close-on-click-modal="false"
  1730. >
  1731. <el-autocomplete
  1732. class="checkSearch"
  1733. popper-class="my-autocomplete"
  1734. v-model.trim="smart_keyword"
  1735. :fetch-suggestions="querySearchAsync"
  1736. placeholder="病人透析号/姓名"
  1737. @select="handleSelect"
  1738. >
  1739. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  1740. <template slot-scope="{ item }">
  1741. <div class="name">{{ item.name }}</div>
  1742. </template>
  1743. </el-autocomplete>
  1744. <el-tabs v-model="editableTabsValue" type="card" @tab-click="handleClick">
  1745. <el-tab-pane
  1746. :key="item.name"
  1747. v-for="(item, index) in editableTabs"
  1748. :label="item.title"
  1749. :name="item.name"
  1750. >
  1751. <el-table v-loading="dataloading" border :data="item.tableWeekArrage" style="width: 100%">
  1752. <!-- 自定义表结构 -->
  1753. <el-table-column
  1754. label="星期"
  1755. prop="week"
  1756. align="center"
  1757. width="100"
  1758. >
  1759. </el-table-column>
  1760. <el-table-column align="left">
  1761. <template slot="header" slot-scope="scope">
  1762. <el-checkbox-group
  1763. v-model="item.checkedWeek"
  1764. @change="select_week"
  1765. >
  1766. <el-checkbox
  1767. v-for="(i, index) in weeks"
  1768. :label="i"
  1769. :key="index"
  1770. :value="i"
  1771. :disabled="!i.is_edit"
  1772. >
  1773. {{ i.name }}
  1774. </el-checkbox>
  1775. </el-checkbox-group>
  1776. </template>
  1777. <template slot-scope="scope">
  1778. <div>
  1779. <span>模式:</span>
  1780. <el-select
  1781. v-model="scope.row.mode_id"
  1782. placeholder="请选择"
  1783. size="mini"
  1784. :disabled="!scope.row.is_edit"
  1785. class="select_list_arrage"
  1786. >
  1787. <el-option
  1788. v-for="(item, index) in modes"
  1789. :key="index"
  1790. :label="item.name"
  1791. :value="item.id"
  1792. >
  1793. </el-option>
  1794. </el-select>
  1795. <span>班次:</span
  1796. ><el-select
  1797. v-model="scope.row.sch_type"
  1798. placeholder="请选择"
  1799. :disabled="!scope.row.is_edit"
  1800. @change="changeSch(scope.row)"
  1801. size="mini"
  1802. class="select_list_arrage"
  1803. >
  1804. <el-option
  1805. v-for="(item, index) in teem_sel"
  1806. :key="index"
  1807. :label="item.name"
  1808. :value="item.id"
  1809. >
  1810. </el-option>
  1811. </el-select>
  1812. <span>分区:</span
  1813. ><el-select
  1814. v-model="scope.row.zone_id"
  1815. placeholder="请选择"
  1816. :disabled="!scope.row.is_edit"
  1817. @change="changeArea(scope.row)"
  1818. size="mini"
  1819. class="select_list_arrage"
  1820. >
  1821. <el-option
  1822. v-for="(item, index) in partitionsProp"
  1823. :key="index"
  1824. :label="item.name"
  1825. :value="item.id"
  1826. >
  1827. </el-option>
  1828. </el-select>
  1829. <span>机号:</span
  1830. ><el-select
  1831. v-model="scope.row.jihao_id"
  1832. placeholder="请选择"
  1833. :disabled="!scope.row.is_edit"
  1834. size="mini"
  1835. @click.native="blurclick(scope.row)"
  1836. class="select_list_arrage"
  1837. >
  1838. <el-option
  1839. v-for="(item, index) in scope.row.jihaos"
  1840. :key="index"
  1841. :label="item.number"
  1842. :value="item.id"
  1843. >
  1844. </el-option>
  1845. </el-select>
  1846. </div>
  1847. </template>
  1848. </el-table-column>
  1849. </el-table>
  1850. </el-tab-pane>
  1851. </el-tabs>
  1852. <span slot="footer" class="dialog-footer">
  1853. <el-button @click="cancel">取 消</el-button>
  1854. <el-button type="primary" v-loading="saveloading" @click="batchSetSch"
  1855. >保 存</el-button
  1856. >
  1857. </span>
  1858. </el-dialog>
  1859. <!-- 排班替换/交换提示弹窗 -->
  1860. <el-dialog
  1861. title="提示"
  1862. :visible.sync="tipDialogVisible"
  1863. width="300px"
  1864. :modal-append-to-body='false'
  1865. :close-on-click-modal="false"
  1866. >
  1867. <div>
  1868. 所选位置已有排班,请选择操作
  1869. </div>
  1870. <span slot="footer" class="dialog-footer">
  1871. <el-button
  1872. type="danger"
  1873. @click="tipDialogVisibleTwo = true"
  1874. >替换</el-button>
  1875. <el-button
  1876. type="primary"
  1877. @click="tipDialogVisibleThree = true"
  1878. >交换</el-button>
  1879. <el-button @click="tipDialogVisible = false">取 消</el-button>
  1880. </span>
  1881. </el-dialog>
  1882. <!-- 排班替换 -->
  1883. <el-dialog
  1884. title="提示"
  1885. :visible.sync="tipDialogVisibleTwo"
  1886. width="300px"
  1887. class="replace"
  1888. :modal-append-to-body='false'
  1889. :close-on-click-modal="false"
  1890. >
  1891. <div>
  1892. 是否将此位置排班替换
  1893. </div>
  1894. <span slot="footer" class="dialog-footer">
  1895. <el-button
  1896. type="primary"
  1897. @click="coverSch()"
  1898. >确定</el-button>
  1899. <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
  1900. </span>
  1901. </el-dialog>
  1902. <!-- 将此位置排班互换 -->
  1903. <el-dialog
  1904. title="提示"
  1905. :visible.sync="tipDialogVisibleThree"
  1906. width="300px"
  1907. class="exchange"
  1908. :modal-append-to-body='false'
  1909. :close-on-click-modal="false"
  1910. >
  1911. <div>
  1912. 是否将此位置排班互换
  1913. </div>
  1914. <span slot="footer" class="dialog-footer">
  1915. <el-button
  1916. type="primary"
  1917. @click="changeSchTwo()"
  1918. >确定</el-button>
  1919. <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
  1920. </span>
  1921. </el-dialog>
  1922. <!-- 显示透析日期的弹窗 -->
  1923. <el-dialog
  1924. :title="'患者信息(姓名:'+Dialysis_patient+'、透析号:'+20011120+')'"
  1925. :visible.sync="cishu_dialogVisible"
  1926. width="50%"
  1927. :modal-append-to-body='false'
  1928. :close-on-click-modal="false">
  1929. <div>
  1930. <div style="line-height: 40px;">
  1931. 透析频率:HD(每周2次)
  1932. </div>
  1933. <div style="line-height: 40px;">
  1934. 已排详情
  1935. </div>
  1936. <div>
  1937. <el-calendar>
  1938. <!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
  1939. <template
  1940. slot="dateCell"
  1941. slot-scope="{date, data}">
  1942. <P v-if="data.day.split('-').slice(1).join('-')=='03-06'"
  1943. style="background: red;color: white;text-align: center;">
  1944. HD
  1945. </P>
  1946. <p :class="data.isSelected ? 'is-selected' : ''" style="text-align: center;">
  1947. {{ data.day.split('-').slice(2).join('-') }} {{ data.isSelected ? '✔️' : ''}}<br/>
  1948. <span v-if="data.day.split('-').slice(1).join('-')=='03-06'">上午 门诊</span>
  1949. </p>
  1950. </template>
  1951. </el-calendar>
  1952. </div>
  1953. </div>
  1954. </el-dialog>
  1955. </div>
  1956. </template>
  1957. <script>
  1958. import { uParseTime } from "@/utils/tools";
  1959. import print from "print-js";
  1960. import draggable from "vuedraggable";
  1961. const moment = require("moment");
  1962. import {
  1963. PostSearchSmartSchPatient,
  1964. getSmartDevices,
  1965. getSmartSchByPatient,
  1966. CoverSch,
  1967. ExchangeSch,
  1968. getPatientSmartSch,
  1969. BatchSmartSch,
  1970. } from "@/api/schedule_template/sch_template";
  1971. import {
  1972. CancelScheduleTwo,
  1973. CancelSchedule,
  1974. ChangeSchedule,
  1975. CreateSchedule,
  1976. CreateScheduleTwo,
  1977. getSchedulePatients,
  1978. getSchedulesOne,
  1979. getSearchResult,
  1980. getUrgentScheduleInitData,
  1981. getWeekPanelsOne,
  1982. getAllZones,
  1983. ChangeScheduleTen,
  1984. getNumberList
  1985. } from "@/api/schedule";
  1986. import ScheduleItem from "./ScheduleItem";
  1987. const weekOptions = [
  1988. {
  1989. name: "周一",
  1990. week_type: 1,
  1991. is_edit: true,
  1992. },
  1993. {
  1994. name: "周二",
  1995. week_type: 2,
  1996. is_edit: true,
  1997. },
  1998. {
  1999. name: "周三",
  2000. week_type: 3,
  2001. is_edit: true,
  2002. },
  2003. {
  2004. name: "周四",
  2005. week_type: 4,
  2006. is_edit: true,
  2007. },
  2008. {
  2009. name: "周五",
  2010. week_type: 5,
  2011. is_edit: true,
  2012. },
  2013. {
  2014. name: "周六",
  2015. week_type: 6,
  2016. is_edit: true,
  2017. },
  2018. {
  2019. name: "周日",
  2020. week_type: 7,
  2021. is_edit: true,
  2022. },
  2023. ];
  2024. let rowNumber = 0;
  2025. export default {
  2026. name: "editTableData",
  2027. props: {
  2028. // 选择的周次
  2029. weekTime: {
  2030. type: String,
  2031. default: "thisWeek",
  2032. },
  2033. scheduleZoneRowProp: {
  2034. type: Array,
  2035. dafault: [],
  2036. },
  2037. partitionsProp: {
  2038. type: Object,
  2039. dafault: {},
  2040. },
  2041. },
  2042. data() {
  2043. return {
  2044. schedulingTableVisible:true,//全屏
  2045. tipDialogVisibleTwo:false,
  2046. tipDialogVisibleThree:false,
  2047. cishu_dialogVisible:false,//透析次数
  2048. modename_value:true,//关闭透析模式开关
  2049. Dialysis_patient:'',
  2050. cur_date:"",
  2051. loading:false,//加载
  2052. dataloading:false,
  2053. current_patient_data:[],
  2054. week_zhongwens: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
  2055. week_type: "",
  2056. saveloading: false,
  2057. zones: [],
  2058. weeks: weekOptions,
  2059. first_weeks:[],
  2060. smart_keyword: "",
  2061. cur_smart_patient_id: 0,
  2062. cur_smart_patient_name: "",
  2063. cur_smart_patient_no: "",
  2064. all_zones: [],
  2065. // 周次
  2066. editableTabs: [
  2067. {
  2068. checkedWeek: [],
  2069. title: "本周",
  2070. name: "1",
  2071. tableWeekArrage: [],
  2072. weeks:[],
  2073. },
  2074. {
  2075. checkedWeek: [],
  2076. title: "下周",
  2077. name: "2",
  2078. tableWeekArrage: [],
  2079. weeks:[],
  2080. },
  2081. {
  2082. checkedWeek: [],
  2083. title: "下下周",
  2084. name: "3",
  2085. tableWeekArrage: [],
  2086. weeks:[],
  2087. },
  2088. ],
  2089. mode_sel: ["HDF"],
  2090. teem_sel: [
  2091. { name: "上午", id: 1 },
  2092. { name: "下午", id: 2 },
  2093. { name: "晚上", id: 3 },
  2094. ],
  2095. region_sel: ["A区"],
  2096. equip_sel: ["1号"],
  2097. checkedWeek: [], //默认选中那些星期,如不需要可去掉
  2098. week: weekOptions,
  2099. editableTabsValue: "1",
  2100. smartVisible: false,
  2101. cur_drag_obj:1, //當前拖拽對象,用來區分病人列表那的當前選擇和表格内的拖拽對象,1.病人列表,2.表格内的
  2102. //拖拽的元素内容
  2103. cur_drag_info: {
  2104. patient_name: "",
  2105. patient_id: "",
  2106. mode_name: "",
  2107. mode_id: "",
  2108. schedule_date:"",
  2109. schedule_type:"",
  2110. bed_id:"",
  2111. partition_id:"",
  2112. schedule_week:"",
  2113. type_name:"",
  2114. zone_name:"",
  2115. bed_name:"",
  2116. id:"",
  2117. contagions:[],
  2118. },
  2119. // 鼠标移入
  2120. mouseove_info: {
  2121. patient_name: "",
  2122. patient_id: "",
  2123. mode_name: "",
  2124. mode_id: "",
  2125. schedule_date:"",
  2126. schedule_type:"",
  2127. bed_id:"",
  2128. partition_id:"",
  2129. schedule_week:"",
  2130. type_name:"",
  2131. zone_name:"",
  2132. bed_name:"",
  2133. id:"",
  2134. contagions:[],
  2135. },
  2136. // 左侧患者名称表格数据
  2137. cur_info: {
  2138. patient_name: "",
  2139. patient_id: 0,
  2140. mode_name: "",
  2141. mode_id: 0,
  2142. contagions:[],
  2143. },
  2144. // 左侧透析模式
  2145. modes: [],
  2146. patientList: [],
  2147. all_patients: [],
  2148. systemDate:'',
  2149. mode_select: [
  2150. {
  2151. value: "1",
  2152. label: "模式一",
  2153. },
  2154. {
  2155. value: "选2",
  2156. label: "模式二",
  2157. },
  2158. {
  2159. value: "3",
  2160. label: "模式三",
  2161. },
  2162. ],
  2163. value: "",
  2164. patient_pre: [],
  2165. // tableContainHeight:600,
  2166. // tableHeight:'window.innerHeight - 0',
  2167. // rowClass: "table-row-new-class schedule-table-row",
  2168. searchKey: "",
  2169. tiaoZhengType: 1,
  2170. modeOptions: null,
  2171. keywords: "",
  2172. schedulePatients: [],
  2173. searchTableVisible: false,
  2174. tipDialogVisible:false,
  2175. dialog: {
  2176. tag: "",
  2177. },
  2178. patients: [],
  2179. toDay: "",
  2180. schedulArr: [
  2181. { value: 0, label: "不限" },
  2182. { value: 2, label: "未排班" },
  2183. { value: 1, label: "已排班" },
  2184. ],
  2185. tagArr: [
  2186. { value: 1, label: "不限" },
  2187. { value: 2, label: "透析记录" },
  2188. { value: 3, label: "传染病" },
  2189. ],
  2190. diseasesArr: [{ value: 0, label: "不限" }],
  2191. scheduleType: [
  2192. { id: 1, name: "上午" },
  2193. { id: 2, name: "下午" },
  2194. { id: 3, name: "晚上" },
  2195. ],
  2196. dialogTableVisible: false,
  2197. tzDialogVisible: false,
  2198. msDialogVisible: false,
  2199. jhDialogVisible: false,
  2200. // scheduleZone: this.scheduleZoneProp,
  2201. scheduleZoneRow: -1,
  2202. partitions: [],
  2203. partitions_two: [],
  2204. jihaos_two: [],
  2205. subzone:[],
  2206. jihaos: [],
  2207. weekTitle: ["", "", "", "", "", "", ""],
  2208. isShowOne: true,
  2209. isShowTwo: true,
  2210. isShowThree: true,
  2211. isShowFour: true,
  2212. isShowFive: true,
  2213. isShowSix: true,
  2214. isShowSeven: true,
  2215. weekList: ["", "", "", "", "", "", ""],
  2216. weekDays: ["", "", "", "", "", "", ""],
  2217. currentData: {
  2218. id: 0,
  2219. schedule_date: "",
  2220. schedule_type: 0,
  2221. bed_id: 0,
  2222. partition_id: 0,
  2223. patient_id: 0,
  2224. schedule_week: 0,
  2225. mode_id: 0,
  2226. type_name: "",
  2227. bed_name: "",
  2228. partition_type: 0,
  2229. contagions: [],
  2230. patient: "",
  2231. },
  2232. // 弹窗数据
  2233. changeSchedule: {
  2234. mode_id: "",
  2235. schedule_type: "",
  2236. partition_id: "",
  2237. bed_id: "",
  2238. schedule_week: "",
  2239. partition_type: "",
  2240. },
  2241. patientQuery: {
  2242. keywords: "",
  2243. schedule: 0,
  2244. contagion: 0,
  2245. },
  2246. tiaozhengclass: "tiaozhengclass",
  2247. changeRules: {
  2248. mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
  2249. schedule_type: [
  2250. { required: true, message: "请选择班次", trigger: "blur" },
  2251. ],
  2252. partition_id: [
  2253. { required: true, message: "请选择病房", trigger: "blur" },
  2254. ],
  2255. bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }],
  2256. },
  2257. weekday: 0,//星期几
  2258. creating_schedule: false,
  2259. changing_mode: false,
  2260. changing_bed: false,
  2261. current_all_sch: [],
  2262. delete_all_sch:[],
  2263. src_all_sch:[],
  2264. tableHeight: document.documentElement.clientHeight,
  2265. patient_selc: {},
  2266. origin_schedules: [],
  2267. origin_device_numbers: [],
  2268. zone_device_map: {},
  2269. device_id: 0,
  2270. zone_name: "",
  2271. current_devices: [],
  2272. zone_names: [],
  2273. zone_device_options: [],
  2274. options: [
  2275. { id: 0, name: "全部" },
  2276. { id: 1, name: "上午" },
  2277. { id: 2, name: "下午" },
  2278. { id: 3, name: "晚上" },
  2279. ],
  2280. partition_id: 0,
  2281. schedule_type: "",
  2282. smart_jihaos: [
  2283. {
  2284. name: "1号机",
  2285. id: "1",
  2286. },
  2287. {
  2288. name: "2号机",
  2289. id: "2",
  2290. },
  2291. ],
  2292. theType: "",
  2293. scheduleZone: [],
  2294. days: [],
  2295. theWeek: {
  2296. lastWeek: 0,
  2297. thisWeek: 0,
  2298. nextWeek: 0,
  2299. nextTwoWeek: 0,
  2300. },
  2301. zoneIdList: [],
  2302. strArr: "",
  2303. patient_id_hover: 0,//高亮id
  2304. // Mouse_id_hover:0,
  2305. now_time: "",
  2306. activeItem: {
  2307. day: null,
  2308. index: null,
  2309. name: null,
  2310. },
  2311. cellflag: 0,
  2312. schedulesGroup:[],
  2313. numberList:[],
  2314. newschedules:[],
  2315. newArr:[],
  2316. count_num:null,
  2317. pageY:0,
  2318. draggable:true,
  2319. org_id:'',
  2320. };
  2321. },
  2322. watch: {
  2323. week_type: function () {
  2324. this.isShowOne = false;
  2325. this.isShowTwo = false;
  2326. this.isShowThree = false;
  2327. this.isShowFour = false;
  2328. this.isShowFive = false;
  2329. this.isShowSix = false;
  2330. this.isShowSeven = false;
  2331. if (this.week_type.length > 0) {
  2332. for (let i = 0; i < this.week_type.length; i++) {
  2333. if (this.week_type[i] == "周一") {
  2334. this.isShowOne = true;
  2335. } else if (this.week_type[i] == "周二") {
  2336. this.isShowTwo = true;
  2337. } else if (this.week_type[i] == "周三") {
  2338. this.isShowThree = true;
  2339. } else if (this.week_type[i] == "周四") {
  2340. this.isShowFour = true;
  2341. } else if (this.week_type[i] == "周五") {
  2342. this.isShowFive = true;
  2343. } else if (this.week_type[i] == "周六") {
  2344. this.isShowSix = true;
  2345. } else if (this.week_type[i] == "周日") {
  2346. this.isShowSeven = true;
  2347. }
  2348. }
  2349. } else {
  2350. this.isShowOne = true;
  2351. this.isShowTwo = true;
  2352. this.isShowThree = true;
  2353. this.isShowFour = true;
  2354. this.isShowFive = true;
  2355. this.isShowSix = true;
  2356. this.isShowSeven = true;
  2357. }
  2358. },
  2359. weekTime: function () {
  2360. var theType = this.weekType(this.weekTime);
  2361. this.theType = theType;
  2362. this.getSchedules();
  2363. },
  2364. scheduleZoneRow: function () {
  2365. var theType = this.weekType(this.weekTime);
  2366. this.theType = theType;
  2367. this.getSchedules();
  2368. },
  2369. tableHeight(val) {
  2370. if (!this.timer) {
  2371. this.tableHeight = val;
  2372. this.timer = true;
  2373. const that = this;
  2374. setTimeout(function () {
  2375. that.timer = false;
  2376. }, 400);
  2377. }
  2378. },
  2379. },
  2380. methods: {
  2381. // 关闭透析模式
  2382. switchMode(flag){
  2383. console.log(flag);
  2384. },
  2385. // 透析次数
  2386. chishuclick(row){
  2387. this.cishu_dialogVisible=true
  2388. console.log('ddddddd',row);
  2389. this.Dialysis_patient=row
  2390. },
  2391. changeSch(row) {
  2392. let params = {
  2393. zone_id: row.zone_id,
  2394. sch_type: row.sch_type,
  2395. schedule_date: row.schedule_date,
  2396. patient_id: this.cur_smart_patient_id,
  2397. };
  2398. //进行网络请求,获取空排班机位
  2399. getSmartDevices(params).then((response) => {
  2400. if (response.data.state == 0) {
  2401. return false;
  2402. } else {
  2403. var devices = response.data.data.devices;
  2404. row.ihaos = [];
  2405. row.jihaos = devices;
  2406. if (devices && devices.length > 0) {
  2407. row.jihao_id = devices[0].id;
  2408. } else {
  2409. row.jihao_id = "";
  2410. }
  2411. }
  2412. });
  2413. },
  2414. // 智能排班机号
  2415. blurclick(row) {
  2416. let params = {
  2417. zone_id: row.zone_id,
  2418. sch_type: row.sch_type,
  2419. schedule_date: row.schedule_date,
  2420. patient_id: this.cur_smart_patient_id,
  2421. };
  2422. //进行网络请求,获取空排班机位
  2423. getSmartDevices(params).then((response) => {
  2424. if (response.data.state == 0) {
  2425. return false;
  2426. } else {
  2427. var devices = response.data.data.devices;
  2428. row.jihaos = [];
  2429. row.jihaos = devices;
  2430. }
  2431. });
  2432. },
  2433. changeArea(row) {
  2434. let params = {
  2435. zone_id: row.zone_id,
  2436. sch_type: row.sch_type,
  2437. schedule_date: row.schedule_date,
  2438. patient_id: this.cur_smart_patient_id,
  2439. };
  2440. //进行网络请求,获取空排班机位
  2441. getSmartDevices(params).then((response) => {
  2442. if (response.data.state == 0) {
  2443. return false;
  2444. } else {
  2445. var devices = response.data.data.devices;
  2446. row.jihaos = [];
  2447. row.jihaos = devices;
  2448. if (devices && devices.length > 0) {
  2449. row.jihao_id = devices[0].id;
  2450. } else {
  2451. row.jihao_id = "";
  2452. }
  2453. }
  2454. });
  2455. },
  2456. handleClick() {
  2457. if (this.editableTabsValue == "1") {
  2458. console.log(this.first_weeks)
  2459. console.log(this.weeks)
  2460. for (let i = 0; i < this.weeks.length; i++) {
  2461. var tempDate = new Date();
  2462. var day = tempDate.getDay();
  2463. if (day == 0) {
  2464. day = 7;
  2465. }
  2466. if (this.weeks[i].week_type >= day) {
  2467. this.weeks[i].is_edit = true;
  2468. } else {
  2469. this.weeks[i].is_edit = false;
  2470. }
  2471. }
  2472. for(let i = 0; i < this.weeks.length; i++){
  2473. for(let b = 0; b < this.first_weeks.length; b++){
  2474. if(this.weeks[i].week_type == this.first_weeks[b].week_type && this.first_weeks[b].order_id > 0){
  2475. console.log(this.weeks[i].week_type)
  2476. console.log(this.first_weeks[b].week_type)
  2477. console.log(this.first_weeks[b].order_id)
  2478. this.weeks[i].is_edit = false
  2479. }
  2480. }
  2481. }
  2482. } else {
  2483. for (let i = 0; i < this.weeks.length; i++) {
  2484. this.weeks[i].is_edit = true;
  2485. }
  2486. }
  2487. },
  2488. getWeekByzhongwen(week_str) {
  2489. switch (week_str) {
  2490. case "周一":
  2491. return 1;
  2492. break;
  2493. case "周二":
  2494. return 2;
  2495. break;
  2496. case "周三":
  2497. return 3;
  2498. break;
  2499. case "周四":
  2500. return 4;
  2501. break;
  2502. case "周五":
  2503. return 5;
  2504. break;
  2505. case "周六":
  2506. return 6;
  2507. break;
  2508. case "周日":
  2509. return 7;
  2510. break;
  2511. }
  2512. },
  2513. cancel() {
  2514. this.smartVisible = false;
  2515. this.smart_keyword = "";
  2516. },
  2517. batchSetSch() {
  2518. var saveOrEditTempData = [];
  2519. var delTempData = [];
  2520. var day = new Date().getDay();
  2521. if (day == 0) {
  2522. day = 7;
  2523. }
  2524. for (let b = 0; b < this.editableTabs[0].tableWeekArrage.length; b++) {
  2525. //只有大于等于今天的数据才能保存和没有上机的
  2526. if (
  2527. this.getWeekByzhongwen(
  2528. this.editableTabs[0].tableWeekArrage[b].week
  2529. ) >= day &&
  2530. this.editableTabs[0].tableWeekArrage[b].is_edit
  2531. ) {
  2532. let obj = {
  2533. schedule_date:
  2534. this.editableTabs[0].tableWeekArrage[b].schedule_date,
  2535. schedule_type: this.editableTabs[0].tableWeekArrage[b].sch_type,
  2536. bed_id: this.editableTabs[0].tableWeekArrage[b].jihao_id,
  2537. schedule_week: this.getWeekByzhongwen(
  2538. this.editableTabs[0].tableWeekArrage[b].week
  2539. ),
  2540. mode_id: this.editableTabs[0].tableWeekArrage[b].mode_id,
  2541. sch_id: this.editableTabs[0].tableWeekArrage[b].sch_id,
  2542. zone_id: this.editableTabs[0].tableWeekArrage[b].zone_id,
  2543. week_type: "1",
  2544. week_name: this.editableTabs[0].tableWeekArrage[b].week,
  2545. };
  2546. saveOrEditTempData.push(obj);
  2547. }
  2548. }
  2549. for (let b = 0; b < this.editableTabs[1].tableWeekArrage.length; b++) {
  2550. let obj = {
  2551. schedule_date: this.editableTabs[1].tableWeekArrage[b].schedule_date,
  2552. schedule_type: this.editableTabs[1].tableWeekArrage[b].sch_type,
  2553. bed_id: this.editableTabs[1].tableWeekArrage[b].jihao_id,
  2554. schedule_week: this.getWeekByzhongwen(
  2555. this.editableTabs[1].tableWeekArrage[b].week
  2556. ),
  2557. mode_id: this.editableTabs[1].tableWeekArrage[b].mode_id,
  2558. sch_id: this.editableTabs[1].tableWeekArrage[b].sch_id,
  2559. zone_id: this.editableTabs[1].tableWeekArrage[b].zone_id,
  2560. week_type: "2",
  2561. week_name: this.editableTabs[1].tableWeekArrage[b].week,
  2562. };
  2563. saveOrEditTempData.push(obj);
  2564. }
  2565. for (let b = 0; b < this.editableTabs[2].tableWeekArrage.length; b++) {
  2566. let obj = {
  2567. schedule_date: this.editableTabs[2].tableWeekArrage[b].schedule_date,
  2568. schedule_type: this.editableTabs[2].tableWeekArrage[b].sch_type,
  2569. bed_id: this.editableTabs[2].tableWeekArrage[b].jihao_id,
  2570. schedule_week: this.getWeekByzhongwen(
  2571. this.editableTabs[2].tableWeekArrage[b].week
  2572. ),
  2573. mode_id: this.editableTabs[2].tableWeekArrage[b].mode_id,
  2574. sch_id: this.editableTabs[2].tableWeekArrage[b].sch_id,
  2575. zone_id: this.editableTabs[2].tableWeekArrage[b].zone_id,
  2576. week_type: "3",
  2577. week_name: this.editableTabs[2].tableWeekArrage[b].week,
  2578. };
  2579. saveOrEditTempData.push(obj);
  2580. }
  2581. //原始数据,用来与智能排版的数据进行比对,查出有排班记录,取消勾选的数据,作为删除的数据,提交给后端
  2582. for (let b = 0; b < this.current_patient_data[0].tableWeekArrage.length; b++) {
  2583. //只有大于等于今天的数据才能保存和没有上机的
  2584. if (
  2585. this.getWeekByzhongwen(
  2586. this.current_patient_data[0].tableWeekArrage[b].week
  2587. ) >= day &&
  2588. this.current_patient_data[0].tableWeekArrage[b].is_edit
  2589. ) {
  2590. let obj = {
  2591. schedule_date:
  2592. this.current_patient_data[0].tableWeekArrage[b].schedule_date,
  2593. schedule_type: this.current_patient_data[0].tableWeekArrage[b].sch_type,
  2594. bed_id: this.current_patient_data[0].tableWeekArrage[b].jihao_id,
  2595. schedule_week: this.getWeekByzhongwen(
  2596. this.current_patient_data[0].tableWeekArrage[b].week
  2597. ),
  2598. mode_id: this.current_patient_data[0].tableWeekArrage[b].mode_id,
  2599. sch_id: this.current_patient_data[0].tableWeekArrage[b].sch_id,
  2600. zone_id: this.current_patient_data[0].tableWeekArrage[b].zone_id,
  2601. week_type: "1",
  2602. week_name: this.current_patient_data[0].tableWeekArrage[b].week,
  2603. };
  2604. delTempData.push(obj);
  2605. }
  2606. }
  2607. for (let b = 0; b < this.current_patient_data[1].tableWeekArrage.length; b++) {
  2608. let obj = {
  2609. schedule_date: this.current_patient_data[1].tableWeekArrage[b].schedule_date,
  2610. schedule_type: this.current_patient_data[1].tableWeekArrage[b].sch_type,
  2611. bed_id: this.current_patient_data[1].tableWeekArrage[b].jihao_id,
  2612. schedule_week: this.getWeekByzhongwen(
  2613. this.current_patient_data[1].tableWeekArrage[b].week
  2614. ),
  2615. mode_id: this.current_patient_data[1].tableWeekArrage[b].mode_id,
  2616. sch_id: this.current_patient_data[1].tableWeekArrage[b].sch_id,
  2617. zone_id: this.current_patient_data[1].tableWeekArrage[b].zone_id,
  2618. week_type: "2",
  2619. week_name: this.current_patient_data[1].tableWeekArrage[b].week,
  2620. };
  2621. delTempData.push(obj);
  2622. }
  2623. for (let b = 0; b < this.current_patient_data[2].tableWeekArrage.length; b++) {
  2624. let obj = {
  2625. schedule_date: this.current_patient_data[2].tableWeekArrage[b].schedule_date,
  2626. schedule_type: this.current_patient_data[2].tableWeekArrage[b].sch_type,
  2627. bed_id: this.current_patient_data[2].tableWeekArrage[b].jihao_id,
  2628. schedule_week: this.getWeekByzhongwen(
  2629. this.current_patient_data[2].tableWeekArrage[b].week
  2630. ),
  2631. mode_id: this.current_patient_data[2].tableWeekArrage[b].mode_id,
  2632. sch_id: this.current_patient_data[2].tableWeekArrage[b].sch_id,
  2633. zone_id: this.current_patient_data[2].tableWeekArrage[b].zone_id,
  2634. week_type: "3",
  2635. week_name: this.current_patient_data[2].tableWeekArrage[b].week,
  2636. };
  2637. delTempData.push(obj);
  2638. }
  2639. console.log(saveOrEditTempData)
  2640. console.log(delTempData)
  2641. if(saveOrEditTempData.length > 0 ){
  2642. for (let i = 0; i < delTempData.length; i++) {
  2643. for (let b = 0; b < saveOrEditTempData.length; b++) {
  2644. if(saveOrEditTempData[b].sch_id&&delTempData[i].sch_id&&delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
  2645. delTempData.splice(i,1)
  2646. }
  2647. }
  2648. }
  2649. }
  2650. for (let i = 0; i < saveOrEditTempData.length; i++) {
  2651. if (saveOrEditTempData[i].bed_id == "" || saveOrEditTempData[i].zone_id == "") {
  2652. this.$message.error("分区或者床位不能空");
  2653. return;
  2654. }
  2655. }
  2656. if (saveOrEditTempData.length > 0 || delTempData.length > 0) {
  2657. let obj = {
  2658. smart_schs: saveOrEditTempData,
  2659. del_schs:delTempData,
  2660. };
  2661. if(!this.saveloading){
  2662. this.saveloading = true;
  2663. BatchSmartSch(obj, this.cur_smart_patient_id).then((response) => {
  2664. if (response.data.state == 1) {
  2665. this.saveloading = false;
  2666. this.$message.success("保存成功");
  2667. this.smartVisible = false;
  2668. this.smart_keyword = "";
  2669. this.getSchedules();
  2670. } else {
  2671. this.saveloading = false;
  2672. this.smart_keyword = "";
  2673. this.$message.error(response.data.msg);
  2674. return;
  2675. }
  2676. });
  2677. }
  2678. } else {
  2679. this.$message.success("保存成功");
  2680. }
  2681. var week = this.weekDay(day);
  2682. if (week[0] == -1 || week[1] == -1) {
  2683. return false;
  2684. }
  2685. if (this.toDay > this.weekDays[week[0] - 1]) {
  2686. return false;
  2687. }
  2688. this.currentData.schedule_date = this.weekDays[week[0] - 1];
  2689. this.currentData.schedule_type = week[1];
  2690. this.currentData.bed_id = row.jihao_id;
  2691. this.currentData.partition_id = row.zone_id;
  2692. this.currentData.schedule_week = week[0];
  2693. this.currentData.type_name = this.dayType(week[1]);
  2694. this.currentData.zone_name = row.area;
  2695. this.currentData.bed_name = row.cut;
  2696. this.currentData.partition_type = row.zone_type;
  2697. this.currentData.mode_id = this.cur_info.mode_id;
  2698. this.currentData.id = 0;
  2699. this.currentData.contagions = this.cur_info.contagions;
  2700. this.currentData.patient_id = this.cur_info.patient_id;
  2701. this.currentData.patient = this.cur_info.patient_name;
  2702. this.setSchedule()
  2703. },
  2704. querySearchAsync(keyword, cb) {
  2705. let key = "";
  2706. if (keyword != undefined) {
  2707. key = keyword;
  2708. }
  2709. let searchArray = [];
  2710. let obj = {
  2711. keyword: key,
  2712. };
  2713. PostSearchSmartSchPatient(obj).then((response) => {
  2714. if (response.data.state == 1) {
  2715. searchArray = response.data.data.patient;
  2716. cb(searchArray);
  2717. } else {
  2718. cb([]);
  2719. }
  2720. });
  2721. },
  2722. getTime(value, temp) {
  2723. if (value != undefined) {
  2724. return uParseTime(value, temp);
  2725. }
  2726. return "";
  2727. },
  2728. handleSelect(val) {
  2729. this.first_weeks = []
  2730. this.dataloading = true
  2731. getSmartSchByPatient(val.id).then((response) => {
  2732. this.dataloading = false
  2733. var sch = response.data.data.sch
  2734. this.editableTabsValue = "1";
  2735. this.editableTabs[0].tableWeekArrage = [];
  2736. this.editableTabs[1].tableWeekArrage = [];
  2737. this.editableTabs[2].tableWeekArrage = [];
  2738. this.editableTabs[0].checkedWeek = [];
  2739. this.editableTabs[1].checkedWeek = [];
  2740. this.editableTabs[2].checkedWeek = [];
  2741. var tempDate = new Date();
  2742. var day = tempDate.getDay();
  2743. if (day == 0) {
  2744. day = 7;
  2745. }
  2746. this.smart_keyword = val.name;
  2747. this.cur_smart_patient_id = val.id;
  2748. this.cur_smart_patient_name = val.name;
  2749. this.cur_smart_patient_no = val.dialysis_no;
  2750. //过滤出当前患者所有排班信息,填充对应的数据到智能排班列表
  2751. //根据患者的排班日期判断属于本周还是下周还是下下周
  2752. for (let i = 0; i < sch.length; i++) {
  2753. var week_type = this.getWeekType(
  2754. this.getTime(sch[i].schedule_date, "{y}-{m}-{d}")
  2755. );
  2756. switch (week_type) {
  2757. case "1":
  2758. var obj = {
  2759. mode_id: sch[i].mode_id,
  2760. sch_type: sch[i].schedule_type,
  2761. zone_id: sch[i].partition_id,
  2762. jihao_id:sch[i].bed_id,
  2763. is_edit: false,
  2764. week: this.getWeek(sch[i].schedule_week),
  2765. jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
  2766. schedule_date: this.getDate(sch[i].schedule_week),
  2767. sch_id: sch[i].id,
  2768. };
  2769. let is_edit = true;
  2770. if (sch[i].schedule_week < day || sch[i].order.id > 0) {
  2771. is_edit = false;
  2772. } else {
  2773. is_edit = true;
  2774. }
  2775. obj.is_edit = is_edit;
  2776. for (let b = 0; b < this.weeks.length; b++) {
  2777. if (sch[i].schedule_week == this.weeks[b].week_type) {
  2778. if (
  2779. this.weeks[b].week_type >= day ||
  2780. sch[i].order.id == 0
  2781. ) {
  2782. this.weeks[b].is_edit = true;
  2783. } else {
  2784. let obj = {
  2785. week_type:this.weeks[b].week_type,
  2786. order_id:sch[i].order.id,
  2787. }
  2788. this.first_weeks.push(obj)
  2789. this.weeks[b].is_edit = false;
  2790. }
  2791. this.editableTabs[0].checkedWeek.push(this.weeks[b]);
  2792. }
  2793. }
  2794. this.editableTabs[0].tableWeekArrage.push(obj);
  2795. break;
  2796. case "2":
  2797. var obj2 = {
  2798. mode_id: sch[i].mode_id,
  2799. sch_type: sch[i].schedule_type,
  2800. zone_id: sch[i].partition_id,
  2801. jihao_id: sch[i].bed_id,
  2802. is_edit: false,
  2803. week: this.getWeek(sch[i].schedule_week),
  2804. jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
  2805. schedule_date: this.getDate(sch[i].schedule_week + 7),
  2806. sch_id: sch[i].id,
  2807. };
  2808. let is_edit2 = true;
  2809. obj2.is_edit = is_edit2;
  2810. // let checkObj2={
  2811. // name:this.getWeek(val.sch[i].schedule_week),
  2812. // week_type:val.sch[i].schedule_week,
  2813. // is_edit:is_edit2
  2814. // }
  2815. // this.editableTabs[1].checkedWeek.push(checkObj2)
  2816. for (let b = 0; b < this.weeks.length; b++) {
  2817. if (sch[i].schedule_week == this.weeks[b].week_type) {
  2818. // this.weeks[b].is_edit = true;
  2819. this.editableTabs[1].checkedWeek.push(this.weeks[b]);
  2820. }
  2821. }
  2822. this.editableTabs[1].tableWeekArrage.push(obj2);
  2823. break;
  2824. case "3":
  2825. let obj3 = {
  2826. mode_id: sch[i].mode_id,
  2827. sch_type: sch[i].schedule_type,
  2828. zone_id: sch[i].partition_id,
  2829. jihao_id: sch[i].bed_id,
  2830. is_edit: false,
  2831. week: this.getWeek(sch[i].schedule_week),
  2832. jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
  2833. schedule_date: this.getDate(sch[i].schedule_week + 14),
  2834. sch_id: sch[i].id,
  2835. };
  2836. let is_edit3 = true;
  2837. obj3.is_edit = is_edit3;
  2838. for (let b = 0; b < this.weeks.length; b++) {
  2839. if (sch[i].schedule_week == this.weeks[b].week_type) {
  2840. // this.weeks[b].is_edit = true;
  2841. this.editableTabs[2].checkedWeek.push(this.weeks[b]);
  2842. }
  2843. }
  2844. this.editableTabs[2].tableWeekArrage.push(obj3);
  2845. break;
  2846. }
  2847. }
  2848. if(this.editableTabsValue == "1") {
  2849. var tempDate = new Date();
  2850. var day = tempDate.getDay();
  2851. if (day == 0) {
  2852. day = 7;
  2853. }
  2854. for (let i = 0; i < this.weeks.length; i++) {
  2855. if (this.weeks[i].week_type < day) {
  2856. this.weeks[i].is_edit = false;
  2857. }
  2858. }
  2859. }
  2860. this.src_all_sch = this.editableTabs;
  2861. this.current_patient_data = []
  2862. this.current_patient_data = this.deepClone(this.src_all_sch)
  2863. });
  2864. },
  2865. getDate(week_type) {
  2866. switch (week_type) {
  2867. case 1:
  2868. return this.days[0];
  2869. break;
  2870. case 2:
  2871. return this.days[1];
  2872. break;
  2873. case 3:
  2874. return this.days[2];
  2875. break;
  2876. case 4:
  2877. return this.days[3];
  2878. break;
  2879. case 5:
  2880. return this.days[4];
  2881. break;
  2882. case 6:
  2883. return this.days[5];
  2884. break;
  2885. case 7:
  2886. return this.days[6];
  2887. break;
  2888. case 8:
  2889. return this.days[7];
  2890. break;
  2891. case 9:
  2892. return this.days[8];
  2893. break;
  2894. case 10:
  2895. return this.days[9];
  2896. break;
  2897. case 11:
  2898. return this.days[10];
  2899. break;
  2900. case 12:
  2901. return this.days[11];
  2902. break;
  2903. case 13:
  2904. return this.days[12];
  2905. break;
  2906. case 14:
  2907. return this.days[13];
  2908. break;
  2909. case 15:
  2910. return this.days[14];
  2911. break;
  2912. case 16:
  2913. return this.days[15];
  2914. break;
  2915. case 17:
  2916. return this.days[16];
  2917. break;
  2918. case 18:
  2919. return this.days[17];
  2920. break;
  2921. case 19:
  2922. return this.days[18];
  2923. break;
  2924. case 20:
  2925. return this.days[19];
  2926. break;
  2927. case 21:
  2928. return this.days[20];
  2929. break;
  2930. }
  2931. },
  2932. deepClone(source) {
  2933. if (!source && typeof source !== 'object') {
  2934. throw new Error('error arguments', 'shallowClone')
  2935. }
  2936. const targetObj = source.constructor === Array ? [] : {}
  2937. Object.keys(source).forEach((keys) => {
  2938. if (source[keys] && typeof source[keys] === 'object') {
  2939. targetObj[keys] = this.deepClone(source[keys])
  2940. } else {
  2941. targetObj[keys] = source[keys]
  2942. }
  2943. })
  2944. return targetObj
  2945. },
  2946. getWeek(week) {
  2947. switch (week) {
  2948. case 1:
  2949. return "周一";
  2950. break;
  2951. case 2:
  2952. return "周二";
  2953. break;
  2954. case 3:
  2955. return "周三";
  2956. break;
  2957. case 4:
  2958. return "周四";
  2959. break;
  2960. case 5:
  2961. return "周五";
  2962. break;
  2963. case 6:
  2964. return "周六";
  2965. break;
  2966. case 7:
  2967. return "周日";
  2968. break;
  2969. }
  2970. },
  2971. getWeekType(date) {
  2972. let index = 0;
  2973. for (let i = 0; i < this.days.length; i++) {
  2974. if (date == this.days[i]) {
  2975. index = i;
  2976. }
  2977. }
  2978. if (index >= 0 && index <= 6) {
  2979. return "1";
  2980. } else if (index > 6 && index <= 13) {
  2981. return "2";
  2982. } else if (index > 13 && index <= 20) {
  2983. return "3";
  2984. }
  2985. },
  2986. showSmartDialog() {
  2987. // this.dataloading = true
  2988. this.editableTabsValue = "1";
  2989. // for (let i = 0; i < this.patientList.length; i++) {
  2990. // if (this.patientList[i].id == this.cur_info.patient_id) {
  2991. // this.cur_smart_patient_name = this.patientList[i].name;
  2992. // this.cur_smart_patient_no = this.patientList[i].dialysis_no;
  2993. // this.cur_smart_patient_id = this.patientList[i].id;
  2994. // }
  2995. // }
  2996. //
  2997. // let params = {
  2998. // patient_id: this.cur_info.patient_id,
  2999. // };
  3000. // let data = [
  3001. // {
  3002. // checkedWeek: [],
  3003. // title: "本周",
  3004. // name: "1",
  3005. // tableWeekArrage: [],
  3006. // },
  3007. // {
  3008. // checkedWeek: [],
  3009. // title: "下周",
  3010. // name: "2",
  3011. // tableWeekArrage: [],
  3012. // },
  3013. // {
  3014. // checkedWeek: [],
  3015. // title: "下下周",
  3016. // name: "3",
  3017. // tableWeekArrage: [],
  3018. // },
  3019. // ];
  3020. // this.first_weeks = []
  3021. // getPatientSmartSch(params).then((response) => {
  3022. // if (response.data.state == 0) {
  3023. // return false;
  3024. // }
  3025. // var schedules = response.data.data.schedules;
  3026. // this.dataloading = false
  3027. // this.current_all_sch[0].tableWeekArrage = [];
  3028. // this.current_all_sch[1].tableWeekArrage = [];
  3029. // this.current_all_sch[2].tableWeekArrage = [];
  3030. // this.editableTabs[0].tableWeekArrage = [];
  3031. // this.editableTabs[0].checkedWeek = [];
  3032. // this.editableTabs[1].tableWeekArrage = [];
  3033. // this.editableTabs[1].checkedWeek = [];
  3034. // this.editableTabs[2].tableWeekArrage = [];
  3035. // this.editableTabs[2].checkedWeek = [];
  3036. // var tempDate = new Date();
  3037. // var day = tempDate.getDay();
  3038. // if (day == 0) {
  3039. // day = 7;
  3040. // }
  3041. //
  3042. // for (let i = 0; i < schedules.length; i++) {
  3043. //
  3044. //
  3045. // var week_type = this.getWeekType(
  3046. // this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
  3047. // ).toString();
  3048. //
  3049. // switch (week_type) {
  3050. // case "1":
  3051. // var obj = {
  3052. // mode_id: schedules[i].mode_id,
  3053. // sch_type: schedules[i].schedule_type,
  3054. // zone_id: schedules[i].partition_id,
  3055. // jihao_id: schedules[i].bed_id,
  3056. // is_edit: false,
  3057. // week: this.getWeek(schedules[i].schedule_week),
  3058. // schedule_date: this.getDate(schedules[i].schedule_week),
  3059. // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
  3060. // sch_id: schedules[i].id,
  3061. // };
  3062. // let is_edit = true;
  3063. // if (
  3064. // schedules[i].schedule_week < day ||
  3065. // schedules[i].order.id > 0
  3066. // ) {
  3067. // is_edit = false;
  3068. // } else {
  3069. // is_edit = true;
  3070. // }
  3071. // obj.is_edit = is_edit;
  3072. // console.log("schedules[i].order.id")
  3073. //
  3074. // console.log(schedules[i].order.id)
  3075. //
  3076. // for (let b = 0; b < this.weeks.length; b++) {
  3077. // if (schedules[i].schedule_week == this.weeks[b].week_type) {
  3078. // if (
  3079. // this.weeks[b].week_type >= day &&
  3080. // schedules[i].order.id == 0
  3081. // ) {
  3082. // this.weeks[b].is_edit = true;
  3083. // } else {
  3084. // let obj = {
  3085. // week_type:this.weeks[b].week_type,
  3086. // order_id:schedules[i].order.id,
  3087. // }
  3088. // this.first_weeks.push(obj)
  3089. // this.weeks[b].is_edit = false;
  3090. // }
  3091. //
  3092. // this.editableTabs[0].checkedWeek.push(this.weeks[b]);
  3093. // }
  3094. // }
  3095. // data[0].tableWeekArrage.push(obj);
  3096. //
  3097. // this.editableTabs[0].tableWeekArrage.push(obj);
  3098. // break;
  3099. // case "2":
  3100. // var obj2 = {
  3101. // mode_id: schedules[i].mode_id,
  3102. // sch_type: schedules[i].schedule_type,
  3103. // zone_id: schedules[i].partition_id,
  3104. // jihao_id: schedules[i].bed_id,
  3105. // is_edit: true,
  3106. // week: this.getWeek(schedules[i].schedule_week),
  3107. // schedule_date: this.getDate(schedules[i].schedule_week + 7),
  3108. // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
  3109. // sch_id: schedules[i].id,
  3110. // };
  3111. //
  3112. // for (let b = 0; b < this.weeks.length; b++) {
  3113. // if (schedules[i].schedule_week == this.weeks[b].week_type) {
  3114. // // this.weeks[b].is_edit = true;
  3115. // this.editableTabs[1].checkedWeek.push(this.weeks[b]);
  3116. // }
  3117. // }
  3118. // data[1].tableWeekArrage.push(obj2);
  3119. // this.editableTabs[1].tableWeekArrage.push(obj2);
  3120. // break;
  3121. //
  3122. // case "3":
  3123. // let obj3 = {
  3124. // mode_id: schedules[i].mode_id,
  3125. // sch_type: schedules[i].schedule_type,
  3126. // zone_id: schedules[i].partition_id,
  3127. // jihao_id: schedules[i].bed_id,
  3128. // is_edit: true,
  3129. // week: this.getWeek(schedules[i].schedule_week),
  3130. // schedule_date: this.getDate(schedules[i].schedule_week + 14),
  3131. // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
  3132. // sch_id: schedules[i].id,
  3133. // };
  3134. // for (let b = 0; b < this.weeks.length; b++) {
  3135. // if (schedules[i].schedule_week == this.weeks[b].week_type) {
  3136. // // this.weeks[b].is_edit = true;
  3137. // this.editableTabs[2].checkedWeek.push(this.weeks[b]);
  3138. // }
  3139. // }
  3140. // data[2].tableWeekArrage.push(obj3);
  3141. //
  3142. // this.editableTabs[2].tableWeekArrage.push(obj3);
  3143. // break;
  3144. // }
  3145. // }
  3146. // });
  3147. // if(this.editableTabsValue == "1") {
  3148. // var tempDate = new Date();
  3149. // var day = tempDate.getDay();
  3150. // if (day == 0) {
  3151. // day = 7;
  3152. // }
  3153. // for (let i = 0; i < this.weeks.length; i++) {
  3154. // if (this.weeks[i].week_type < day) {
  3155. // this.weeks[i].is_edit = false;
  3156. // }
  3157. // }
  3158. // }
  3159. //
  3160. //
  3161. // for (let i = 0; i < this.editableTabs.length; i++) {
  3162. // for(let b = 0; b < this.editableTabs[i].tableWeekArrage.length;b++){
  3163. // data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
  3164. //
  3165. //
  3166. //
  3167. // }
  3168. // }
  3169. //
  3170. // data.sort(function (a, b) {
  3171. // return a.week_type - b.week_type;
  3172. // });
  3173. //
  3174. //
  3175. //
  3176. // this.current_patient_data = data
  3177. // console.log("current_patient_data")
  3178. // console.log(this.current_patient_data)
  3179. this.smartVisible = true;
  3180. // this.current_all_sch = data;
  3181. // this.src_all_sch = data;
  3182. },
  3183. select_week(val) {
  3184. this.current_all_sch = this.editableTabs
  3185. var sch = [];
  3186. for (let i = 0; i < this.current_all_sch.length; i++) {
  3187. if (this.current_all_sch[i].name == this.editableTabsValue) {
  3188. sch = this.current_all_sch[i];
  3189. }
  3190. }
  3191. let data = [];
  3192. for (let i = 0; i < val.length; i++) {
  3193. let is_new = true;
  3194. let week_name = val[i].name;
  3195. let obj = {};
  3196. for (let b = 0; b < sch.tableWeekArrage.length; b++) {
  3197. if (week_name == sch.tableWeekArrage[b].week) {
  3198. is_new = false;
  3199. obj = sch.tableWeekArrage[b];
  3200. }
  3201. }
  3202. let keyIndex = "";
  3203. for (var key in this.partitionsProp) {
  3204. keyIndex = key;
  3205. }
  3206. if (!is_new) {
  3207. data.push(obj);
  3208. } else {
  3209. if (this.editableTabsValue == "2") {
  3210. data.push({
  3211. mode_id: 1,
  3212. week: val[i].name,
  3213. sch_type: 1,
  3214. zone_id: "",
  3215. jihao_id: "",
  3216. is_edit: true,
  3217. schedule_date: this.getDate(val[i].week_type + 7),
  3218. jihaos: [],
  3219. sch_id: 0,
  3220. });
  3221. } else if (this.editableTabsValue == "3") {
  3222. data.push({
  3223. mode_id: 1,
  3224. week: val[i].name,
  3225. sch_type: 1,
  3226. zone_id: "",
  3227. jihao_id: "",
  3228. is_edit: true,
  3229. schedule_date: this.getDate(val[i].week_type + 14),
  3230. jihaos: [],
  3231. sch_id: 0,
  3232. });
  3233. } else {
  3234. data.push({
  3235. mode_id: 1,
  3236. week: val[i].name,
  3237. sch_type: 1,
  3238. zone_id: "",
  3239. jihao_id: "",
  3240. is_edit: true,
  3241. schedule_date: this.getDate(val[i].week_type),
  3242. jihaos: [],
  3243. sch_id: 0,
  3244. });
  3245. }
  3246. }
  3247. }
  3248. for (let i = 0; i < data.length; i++) {
  3249. data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
  3250. }
  3251. data.sort(function (a, b) {
  3252. return a.week_type - b.week_type;
  3253. });
  3254. for (let i = 0; i < this.editableTabs.length; i++) {
  3255. if (this.editableTabs[i].name == this.editableTabsValue) {
  3256. this.editableTabs[i].tableWeekArrage = data;
  3257. }
  3258. }
  3259. this.current_all_sch = this.editableTabs
  3260. },
  3261. // 左侧的拖拽内容
  3262. curInfoDragStart(){
  3263. this.cur_drag_obj = 1
  3264. this.cur_drag_info={
  3265. patient_id : this.cur_info.patient_id,
  3266. patient_name : this.cur_info.patient_name,
  3267. mode_id : this.cur_info.mode_id,
  3268. mode_name : this.cur_info.mode_name,
  3269. contagions:this.cur_info.contagions,
  3270. },
  3271. console.log('拖拽的内容',this.cur_drag_info);
  3272. },
  3273. // 左侧选择病人(单击)
  3274. patientClick(row) {
  3275. console.log("row-222--2-2",row)
  3276. this.cur_info.patient_name = row.name;
  3277. this.cur_info.patient_id = row.id;
  3278. var obj = {
  3279. created_time:0,
  3280. disease_id:2,
  3281. id:0,
  3282. patient_id:row.patient_id,
  3283. status:1,
  3284. updated_time:0
  3285. }
  3286. if(row.is_infectious==2){
  3287. this.cur_info.contagions = []
  3288. this.cur_info.contagions.push(obj)
  3289. }else{
  3290. this.cur_info.contagions = []
  3291. }
  3292. this.patient_id_hover = row.id
  3293. },
  3294. // 选择透析模式
  3295. modeClick(row) {
  3296. this.cur_info.mode_name = row.name;
  3297. this.cur_info.mode_id = row.id;
  3298. },
  3299. setEditData(patients, modes, days, zones) {
  3300. console.log("patients2oo2o2o2o",patients)
  3301. var date = new Date()
  3302. this.time = date
  3303. var year = date.getFullYear()
  3304. var month = date.getMonth() + 1
  3305. if (month < 10) {
  3306. month = "0" + month
  3307. }
  3308. var day = date.getDate()
  3309. if (day < 10) {
  3310. day = "0" + day
  3311. }
  3312. var nowDate = year + "-" + month + "-" + day
  3313. var date = new Date(nowDate + " 00:00:00")
  3314. this.cur_date = date.getTime()/1000
  3315. this.days = days;
  3316. this.all_zones = zones;
  3317. this.patientList = patients;
  3318. this.all_patients = patients;
  3319. for (var key in modes) {
  3320. let obj = {
  3321. id: modes[key].id,
  3322. name: modes[key].name,
  3323. };
  3324. this.modes.push(obj);
  3325. }
  3326. this.cur_info["patient_name"] = this.patientList[0].name;
  3327. this.cur_info["mode_name"] = this.modes[0].name;
  3328. this.cur_info["patient_id"] = this.patientList[0].id;
  3329. this.cur_info["mode_id"] = this.modes[0].id;
  3330. this.patient_id_hover = this.patientList[0].id
  3331. this.$refs.patient_table.setCurrentRow(this.patientList[0]);
  3332. this.$refs.mode_table.setCurrentRow(this.modes[0]);
  3333. for (let i = 0; i < this.weeks.length; i++) {
  3334. var tempDate = new Date();
  3335. var day = tempDate.getDay();
  3336. if (day == 0) {
  3337. day = 7;
  3338. }
  3339. if (this.weeks[i].week_type >= day) {
  3340. this.weeks[i].is_edit = true;
  3341. } else {
  3342. this.weeks[i].is_edit = false;
  3343. }
  3344. }
  3345. if (this.partitions_two.length > 0) {
  3346. this.jihaos_two.push(this.partitions_two[0].jihaos);
  3347. }
  3348. },
  3349. // dragstartTwo(event, item) {},
  3350. // dragendTwo(event) {},
  3351. isEditForDate(day){
  3352. var week = this.weekDay(day);
  3353. if( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 >= this.cur_date){
  3354. return true
  3355. }else{
  3356. return false
  3357. }
  3358. },
  3359. // 鼠标移动
  3360. drag(e, day, index, name, row) {
  3361. // console.log('sssssss',el_table.clientHeight,window.screen.availHeight,e.pageY);
  3362. // console.log('ddddddd',row);
  3363. // this.pageY= el_table.clientHeight
  3364. // e.preventDefault();
  3365. for (var key in row) {
  3366. if (key == day) {
  3367. if(row[key].patient_id > 0){
  3368. this.cur_drag_obj = 2
  3369. var week = this.weekDay(day);
  3370. this.cur_drag_info={
  3371. schedule_date : this.weekDays[week[0] - 1],
  3372. schedule_type : week[1],
  3373. bed_id : row.jihao_id,
  3374. partition_id : row.zone_id,
  3375. schedule_week : week[0],
  3376. type_name : this.dayType(week[1]),
  3377. zone_name : row.area,
  3378. bed_name : row.cut,
  3379. mode_id : row[key].mode_id,
  3380. mode_name : row[key].mode_name,
  3381. patient_name : row[key].patient,
  3382. patient_id : row[key].patient_id,
  3383. id : row[key].schedule_id,
  3384. contagions: row[key].patient_contagions,
  3385. }
  3386. console.log('ddddddd',this.cur_drag_info);
  3387. }else{
  3388. this.cur_drag_obj = 3
  3389. this.cur_drag_info={
  3390. schedule_date : '',
  3391. schedule_type : '',
  3392. bed_id : '',
  3393. partition_id : '',
  3394. schedule_week : '',
  3395. type_name : '',
  3396. zone_name : '',
  3397. bed_name : '',
  3398. mode_id : '',
  3399. mode_name : '',
  3400. patient_name : '',
  3401. patient_id : 0,
  3402. id : 0,
  3403. }
  3404. // console.log('nnnnnnn',this.cur_drag_info)
  3405. }
  3406. }
  3407. }
  3408. // if(el_table.scrollHeight-e.pageY <= 320 && el_table.scrollTop<el_table.scrollHeight){
  3409. // el_table.scrollTop ++
  3410. // console.log('66666',el_table.scrollTop);
  3411. // }
  3412. },
  3413. mouseoveinfo(e, day, index, name, row) {
  3414. // console.log('sssssss',el_table.clientHeight,window.screen.availHeight,e.pageY);
  3415. // console.log('ddddddd',row);
  3416. // this.pageY= el_table.clientHeight
  3417. // e.preventDefault();
  3418. for (var key in row) {
  3419. if (key == day) {
  3420. if(row[key].patient_id > 0){
  3421. this.cur_drag_obj = 2
  3422. var week = this.weekDay(day);
  3423. this.mouseove_info={
  3424. schedule_date : this.weekDays[week[0] - 1],
  3425. schedule_type : week[1],
  3426. bed_id : row.jihao_id,
  3427. partition_id : row.zone_id,
  3428. schedule_week : week[0],
  3429. type_name : this.dayType(week[1]),
  3430. zone_name : row.area,
  3431. bed_name : row.cut,
  3432. mode_id : row[key].mode_id,
  3433. mode_name : row[key].mode_name,
  3434. patient_name : row[key].patient,
  3435. patient_id : row[key].patient_id,
  3436. id : row[key].schedule_id,
  3437. contagions: row[key].patient_contagions,
  3438. }
  3439. console.log('ddddddd',this.mouseove_info);
  3440. }
  3441. // else{
  3442. // this.cur_drag_obj = 3
  3443. // this.mouseove_info={
  3444. // schedule_date : '',
  3445. // schedule_type : '',
  3446. // bed_id : '',
  3447. // partition_id : '',
  3448. // schedule_week : '',
  3449. // type_name : '',
  3450. // zone_name : '',
  3451. // bed_name : '',
  3452. // mode_id : '',
  3453. // mode_name : '',
  3454. // patient_name : '',
  3455. // patient_id : 0,
  3456. // id : 0,
  3457. // }
  3458. // }
  3459. }
  3460. }
  3461. },
  3462. // 拖拽
  3463. allowDrop(e) {
  3464. e.preventDefault();
  3465. },
  3466. // 取消排班
  3467. CancelSchedule(id) {
  3468. this.$confirm("确定要取消当前排班?", "提示", {
  3469. confirmButtonText: "确定",
  3470. cancelButtonText: "取消",
  3471. type: "warning",
  3472. }).then(() => {
  3473. CancelSchedule(id).then((response) => {
  3474. if (response.data.state == 0) {
  3475. this.$message.error(response.data.msg);
  3476. } else {
  3477. this.$message({
  3478. type: "success",
  3479. message: "排班已取消!",
  3480. });
  3481. var that = this;
  3482. var schedule = response.data.data.schedule;
  3483. this.scheduleZone.forEach(function (zone, index) {
  3484. if (
  3485. zone.zone_id == schedule.partition_id &&
  3486. zone.jihao_id == schedule.bed_id
  3487. ) {
  3488. var weekPath = that.weekPath(
  3489. schedule.schedule_week,
  3490. schedule.schedule_type
  3491. );
  3492. if (weekPath.length == 2) {
  3493. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3494. that.scheduleZone[index][weekPathKey] = {
  3495. schedule_id: 0,
  3496. mode_id: 0,
  3497. patient_id: 0,
  3498. patient: "",
  3499. mode_name: "",
  3500. dialysis_machine_name: "",
  3501. };
  3502. that.scheduleZone[index].total -= 1;
  3503. }
  3504. }
  3505. });
  3506. }
  3507. });
  3508. })
  3509. .catch(() => {});
  3510. },
  3511. // 删除某一单元格内的患者透析排班
  3512. deletePatientMode(row) {
  3513. console.log('12345566',row, this.systemDate);
  3514. if (row.schedule_id > 0 && this.mouseove_info.schedule_date >= this.systemDate) {
  3515. console.log('22222222',this.mouseove_info.schedule_date >= this.systemDate);
  3516. this.CancelSchedule(row.schedule_id);
  3517. }
  3518. console.log('deletePatientMode',row);
  3519. },
  3520. // 替换
  3521. coverSch(){
  3522. this.tipDialogVisible=false
  3523. let params={
  3524. id_one:this.cur_drag_info.id,
  3525. id_two:this.currentData.id
  3526. }
  3527. CoverSch(params).then((response) => {
  3528. if (response.data.state == 0) {
  3529. this.$message.error(response.data.msg);
  3530. this.tipDialogVisibleTwo = false
  3531. } else {
  3532. this.$message.success("替换成功");
  3533. this.tipDialogVisible = false
  3534. this.tipDialogVisibleTwo = false
  3535. this.getSchedules();
  3536. }
  3537. });
  3538. },
  3539. // 交换位置
  3540. changeSchTwo(){
  3541. // this.tipDialogVisibleThree = false
  3542. this.tipDialogVisible=false
  3543. let params={
  3544. id_one:this.cur_drag_info.id,
  3545. id_two:this.currentData.id
  3546. }
  3547. console.log('this.cur_drag_info.id',this.cur_drag_info.id,'this.currentData.id',this.currentData.id);
  3548. ExchangeSch(params).then((response) => {
  3549. if (response.data.state == 0) {
  3550. this.$message.error(response.data.msg);
  3551. this.tipDialogVisibleThree = false
  3552. } else {
  3553. this.$message.success("交换成功");
  3554. this.tipDialogVisible = false
  3555. this.tipDialogVisibleThree = false
  3556. this.getSchedules();
  3557. }
  3558. });
  3559. },
  3560. // draging(e){
  3561. // const step = 5
  3562. // const scrollWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper')
  3563. // console.log('eeeeeee',e.pageY);
  3564. // // console.log('33333',this.pageY);
  3565. // if(e.pageY>=this.pageY){
  3566. // scrollWrapper.scrollTop += step
  3567. // console.log('wwwwwww',this.cur_drag_info);
  3568. // // console.log('eeeeeee',e.pageY);
  3569. // console.log('33333',e.pageY,this.pageY);
  3570. // // this.drop()
  3571. // return
  3572. // }else{
  3573. // return
  3574. // // scrollWrapper.scrollTop -= step
  3575. // }
  3576. // // if(e.pageY>= this.pageY){
  3577. // // // return
  3578. // // scrollWrapper.scrollTop = 0
  3579. // // }else if(e.pageY>= this.pageY){
  3580. // // scrollWrapper.scrollTop += step
  3581. // // }else if(e.pageY<= this.pageY&&scrollWrapper.scrollTop==0){
  3582. // // return
  3583. // // }else if(e.pageY<= this.pageY&&scrollWrapper.scrollTop>0){
  3584. // // scrollWrapper.scrollTop -= step
  3585. // // }
  3586. // },
  3587. // !在html里面的chedule-item里绑定的| ":draggable"可控制该表格能否拖动,根据实际情况进行修改async
  3588. drop(e, day,index,name, row) {
  3589. this.allowDrop(e)
  3590. for (var key in row) {
  3591. if (key == day) {
  3592. if(this.cur_drag_obj == 3){
  3593. return
  3594. }
  3595. // console.log(this.cur_drag_obj)
  3596. var week = this.weekDay(day);
  3597. this.currentData={
  3598. schedule_date : this.weekDays[week[0] - 1],
  3599. schedule_type : week[1],
  3600. bed_id : row.jihao_id,
  3601. partition_id : row.zone_id,
  3602. schedule_week : week[0],
  3603. type_name : this.dayType(week[1]),
  3604. zone_name : row.area,
  3605. bed_name : row.cut,
  3606. id : row[key].schedule_id,
  3607. partition_type : row.zone_type,
  3608. }
  3609. // let nowDate = new Date();
  3610. // let date = {
  3611. // year: nowDate.getFullYear(),
  3612. // month: nowDate.getMonth() + 1,
  3613. // date: nowDate.getDate(),
  3614. // }
  3615. // let Month=date.month<10 ? '0'+ date.month : date.month
  3616. // let Dateday= date.date<10 ? '0'+date.date : date.date
  3617. // this.systemDate = date.year + '-'+ Month + '-'+ Dateday;
  3618. // console.log('this.currentData的数据',this.currentData);
  3619. // console.log('this.cur_drag_info的数据',this.cur_drag_info);
  3620. // console.log('123453545',this.systemDate);
  3621. // 当表格有数据
  3622. if ( row[key].mode_id > 0 || row[key].patient_id > 0) {
  3623. // 且是表格数据拖拽
  3624. if (this.cur_drag_obj == 2){
  3625. if (row[key].patient_id != this.cur_drag_info.patient_id ) {
  3626. if( this.currentData.schedule_date >= this.systemDate ){
  3627. this.tipDialogVisible = true
  3628. }
  3629. } else {
  3630. this.tipDialogVisible = false
  3631. }
  3632. }else{
  3633. return this.$message.error("当前机号已有排班");
  3634. }
  3635. } else {
  3636. //當前類型是表格内的拖拽,如果是同一天内的表格拖拽到空床位則先刪除原先排版,后在將排班弄到空床位
  3637. //接口提交排班数据
  3638. if(this.cur_drag_obj == 2){
  3639. if(this.cur_drag_info.schedule_date == this.currentData.schedule_date){ //同一天
  3640. if(row[key].patient_id == 0) { //空床位
  3641. const that = this;
  3642. //接口提交排班数据
  3643. that.currentData.mode_id = that.cur_drag_info.mode_id
  3644. that.currentData.id = 0
  3645. that.currentData.patient_id = that.cur_drag_info.patient_id
  3646. that.currentData.patient = that.cur_drag_info.patient_name
  3647. that.currentData.contagions = that.cur_drag_info.contagions
  3648. console.log("中国hshshshshhs",that.cur_drag_info)
  3649. that.setScheduleTwo(this.cur_drag_info.id);
  3650. }
  3651. }else{ // 非同一天
  3652. if(row[key].patient_id == 0) { //空床位
  3653. this.currentData.mode_id = this.cur_drag_info.mode_id;
  3654. this.currentData.id = 0;
  3655. this.currentData.contagions = this.cur_drag_info.contagions;
  3656. this.currentData.patient_id = this.cur_drag_info.patient_id;
  3657. this.currentData.patient = this.cur_drag_info.patient_name;
  3658. this.setSchedule();
  3659. }
  3660. }
  3661. }else{
  3662. console.log("wowowowowowowowow",this.cur_drag_info)
  3663. //接口提交排班数据
  3664. this.currentData.mode_id = this.cur_drag_info.mode_id;
  3665. this.currentData.id = 0;
  3666. this.currentData.contagions = this.cur_drag_info.contagions;
  3667. this.currentData.patient_id = this.cur_drag_info.patient_id;
  3668. this.currentData.patient = this.cur_drag_info.patient_name;
  3669. this.setSchedule();
  3670. }
  3671. }
  3672. }
  3673. }
  3674. },
  3675. // 左边栏选中名字和模式拖动结束后
  3676. taskDraggerEnd(e) {},
  3677. //move回调方法
  3678. onMove(e, originalEvent) {
  3679. return true;
  3680. },
  3681. compare(p) {
  3682. //这是比较函数
  3683. return function (m, n) {
  3684. var a = m[p];
  3685. var b = n[p];
  3686. return a - b; //升序
  3687. };
  3688. },
  3689. // 病房病人/时间日期接口
  3690. getWeekPanels() {
  3691. this.scheduleZone = [];
  3692. var partionStr = this.partition_id;
  3693. var arr = this.zoneIdList.join(",");
  3694. var str = "";
  3695. if (partionStr == 0) {
  3696. str = arr;
  3697. }
  3698. if (partionStr != 0) {
  3699. str = partionStr.join(",");
  3700. }
  3701. getWeekPanelsOne(1, str).then((response) => {
  3702. if (response.data.state == 0) {
  3703. return false;
  3704. }
  3705. var partitions = response.data.data.partitions;
  3706. this.subzone = response.data.data.partitions;
  3707. console.log('ooooooeeeee',this.subzone);
  3708. this.theWeek.thisWeek = response.data.data.theWeek;
  3709. this.theWeek.lastWeek = this.theWeek.thisWeek - 1;
  3710. this.theWeek.nextWeek = this.theWeek.thisWeek + 1;
  3711. this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2;
  3712. var that = this;
  3713. if (partitions.length > 0) {
  3714. partitions.forEach(function (partition) {
  3715. if (partition.jihaos.length == 0) {
  3716. return false;
  3717. }
  3718. that.scheduleZoneRow.push(partition.jihaos.length);
  3719. that.partitions[partition.id] = partition;
  3720. partition.jihaos.forEach(function (jihao) {
  3721. var thisPa = {
  3722. area: partition.name,
  3723. zone_id: partition.id,
  3724. zone_type: partition.type,
  3725. cut: jihao.number,
  3726. jihao_id: jihao.id,
  3727. sort: jihao.sort,
  3728. Mon_M: {
  3729. schedule_id: 0,
  3730. mode_id: 0,
  3731. mode_name: "",
  3732. dialysis_machine_name: "",
  3733. patient_id: 0,
  3734. patient: "",
  3735. zone_id: partition.id,
  3736. jihao_id: jihao.id,
  3737. },
  3738. Mon_A: {
  3739. schedule_id: 0,
  3740. mode_id: 0,
  3741. mode_name: "",
  3742. patient_id: 0,
  3743. dialysis_machine_name: "",
  3744. patient: "",
  3745. zone_id: partition.id,
  3746. jihao_id: jihao.id,
  3747. },
  3748. Mon_N: {
  3749. schedule_id: 0,
  3750. mode_id: 0,
  3751. mode_name: "",
  3752. patient_id: 0,
  3753. dialysis_machine_name: "",
  3754. patient: "",
  3755. zone_id: partition.id,
  3756. jihao_id: jihao.id,
  3757. },
  3758. Tue_M: {
  3759. schedule_id: 0,
  3760. mode_id: 0,
  3761. mode_name: "",
  3762. dialysis_machine_name: "",
  3763. patient_id: 0,
  3764. patient: "",
  3765. zone_id: partition.id,
  3766. jihao_id: jihao.id,
  3767. },
  3768. Tue_A: {
  3769. schedule_id: 0,
  3770. mode_id: 0,
  3771. dialysis_machine_name: "",
  3772. mode_name: "",
  3773. patient_id: 0,
  3774. patient: "",
  3775. zone_id: partition.id,
  3776. jihao_id: jihao.id,
  3777. },
  3778. Tue_N: {
  3779. schedule_id: 0,
  3780. mode_id: 0,
  3781. dialysis_machine_name: "",
  3782. mode_name: "",
  3783. patient_id: 0,
  3784. patient: "",
  3785. zone_id: partition.id,
  3786. jihao_id: jihao.id,
  3787. },
  3788. Wed_M: {
  3789. schedule_id: 0,
  3790. mode_id: 0,
  3791. dialysis_machine_name: "",
  3792. mode_name: "",
  3793. patient_id: 0,
  3794. patient: "",
  3795. zone_id: partition.id,
  3796. jihao_id: jihao.id,
  3797. },
  3798. Wed_A: {
  3799. schedule_id: 0,
  3800. mode_id: 0,
  3801. mode_name: "",
  3802. patient_id: 0,
  3803. patient: "",
  3804. zone_id: partition.id,
  3805. dialysis_machine_name: "",
  3806. jihao_id: jihao.id,
  3807. },
  3808. Wed_N: {
  3809. schedule_id: 0,
  3810. mode_id: 0,
  3811. mode_name: "",
  3812. patient_id: 0,
  3813. patient: "",
  3814. zone_id: partition.id,
  3815. dialysis_machine_name: "",
  3816. jihao_id: jihao.id,
  3817. },
  3818. Thurs_M: {
  3819. schedule_id: 0,
  3820. mode_id: 0,
  3821. mode_name: "",
  3822. patient_id: 0,
  3823. patient: "",
  3824. zone_id: partition.id,
  3825. dialysis_machine_name: "",
  3826. jihao_id: jihao.id,
  3827. },
  3828. Thurs_A: {
  3829. schedule_id: 0,
  3830. mode_id: 0,
  3831. mode_name: "",
  3832. patient_id: 0,
  3833. patient: "",
  3834. dialysis_machine_name: "",
  3835. zone_id: partition.id,
  3836. jihao_id: jihao.id,
  3837. },
  3838. Thurs_N: {
  3839. schedule_id: 0,
  3840. mode_id: 0,
  3841. mode_name: "",
  3842. patient_id: 0,
  3843. patient: "",
  3844. dialysis_machine_name: "",
  3845. zone_id: partition.id,
  3846. jihao_id: jihao.id,
  3847. },
  3848. Fri_M: {
  3849. schedule_id: 0,
  3850. mode_id: 0,
  3851. mode_name: "",
  3852. patient_id: 0,
  3853. dialysis_machine_name: "",
  3854. patient: "",
  3855. zone_id: partition.id,
  3856. jihao_id: jihao.id,
  3857. },
  3858. Fri_A: {
  3859. schedule_id: 0,
  3860. mode_id: 0,
  3861. mode_name: "",
  3862. patient_id: 0,
  3863. dialysis_machine_name: "",
  3864. patient: "",
  3865. zone_id: partition.id,
  3866. jihao_id: jihao.id,
  3867. },
  3868. Fri_N: {
  3869. schedule_id: 0,
  3870. mode_id: 0,
  3871. mode_name: "",
  3872. patient_id: 0,
  3873. dialysis_machine_name: "",
  3874. patient: "",
  3875. zone_id: partition.id,
  3876. jihao_id: jihao.id,
  3877. },
  3878. Sat_M: {
  3879. schedule_id: 0,
  3880. mode_id: 0,
  3881. mode_name: "",
  3882. dialysis_machine_name: "",
  3883. patient_id: 0,
  3884. patient: "",
  3885. zone_id: partition.id,
  3886. jihao_id: jihao.id,
  3887. },
  3888. Sat_A: {
  3889. schedule_id: 0,
  3890. mode_id: 0,
  3891. mode_name: "",
  3892. patient_id: 0,
  3893. dialysis_machine_name: "",
  3894. patient: "",
  3895. zone_id: partition.id,
  3896. jihao_id: jihao.id,
  3897. },
  3898. Sat_N: {
  3899. schedule_id: 0,
  3900. mode_id: 0,
  3901. mode_name: "",
  3902. patient_id: 0,
  3903. dialysis_machine_name: "",
  3904. patient: "",
  3905. },
  3906. Sun_A: {
  3907. schedule_id: 0,
  3908. mode_id: 0,
  3909. mode_name: "",
  3910. dialysis_machine_name: "",
  3911. patient_id: 0,
  3912. patient: "",
  3913. zone_id: partition.id,
  3914. jihao_id: jihao.id,
  3915. },
  3916. Sun_N: {
  3917. schedule_id: 0,
  3918. mode_id: 0,
  3919. mode_name: "",
  3920. dialysis_machine_name: "",
  3921. patient_id: 0,
  3922. patient: "",
  3923. zone_id: partition.id,
  3924. jihao_id: jihao.id,
  3925. },
  3926. Sun_M: {
  3927. schedule_id: 0,
  3928. mode_id: 0,
  3929. mode_name: "",
  3930. dialysis_machine_name: "",
  3931. patient_id: 0,
  3932. patient: "",
  3933. zone_id: partition.id,
  3934. jihao_id: jihao.id,
  3935. },
  3936. total: 0,
  3937. };
  3938. that.scheduleZone.push(thisPa);
  3939. });
  3940. });
  3941. }
  3942. this.scheduleZone.sort(this.compare("sort"));
  3943. });
  3944. },
  3945. // 高亮
  3946. hoverMouse(row, column, cell, event) {
  3947. // clearInterval(this.memberScrollTimer)
  3948. // this.memberScrollTimer = 0
  3949. // console.log('sdf12344565');
  3950. // if (row[column.property].schedule_id > 0) {
  3951. // let patient_id = row[column.property].patient_id
  3952. // this.Mouse_id_hover = patient_id
  3953. // // this.cur_info.patient_id = row.id
  3954. // } else {
  3955. // this.Mouse_id_hover = -1
  3956. // }
  3957. },
  3958. leavemouse(){
  3959. const step = 1
  3960. const stepTime = 200
  3961. // if (this.scheduleZone.length <= 1) {
  3962. // // this.scheduleZone = this.copyscheduleZone
  3963. // return
  3964. // } else {
  3965. // // 需要滚动将数据赋值一份
  3966. // // this.scheduleZone = this.copyscheduleZone.concat(this.copyscheduleZone)
  3967. // // 通过 ref获取el-table__body-wrapper的dom元素
  3968. // const scrollWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper')
  3969. // // 开启一个定时器控制滚动
  3970. // this.memberScrollTimer = setInterval(() => {
  3971. // if (scrollWrapper.scrollHeight <= scrollWrapper.scrollTop) {
  3972. // scrollWrapper.scrollTop = 0
  3973. // } else {
  3974. // scrollWrapper.scrollTop += step
  3975. // }
  3976. // }, stepTime)
  3977. // }
  3978. },
  3979. // 单元格样式
  3980. cellstyle({row, column, rowIndex, columnIndex}){
  3981. // for(let i=0;i<this.subzone.length;i++){
  3982. // const subslice=this.subzone[i].jihaos.slice(-1)
  3983. // // console.log('这是row',subslice);
  3984. // if(row.zone_id==subslice[0].zone_id && row.jihao_id == subslice[0].id ){
  3985. // // console.log('33333333333',subslice);
  3986. // return 'border-bottom: 1px solid #707174;'
  3987. // }
  3988. // }
  3989. // if(columnIndex==0){
  3990. // return 'border-bottom: 1px solid #707174;'
  3991. // }
  3992. },
  3993. // 单元格的 className 的回调方法
  3994. cellClass({ row, column, rowIndex, columnIndex }) {
  3995. // 传染病区机器橙色背景
  3996. if(columnIndex==1&&row.zone_type!=1){
  3997. //
  3998. return "table-row-new-class schedule-table-row Infectious_disease";
  3999. }
  4000. // if(columnIndex==1 ){
  4001. // return 'border_bott '
  4002. // }
  4003. // if(columnIndex==0){
  4004. // return 'border_left'
  4005. // }
  4006. if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
  4007. return "";
  4008. } else {
  4009. if (this.weekTime == "lastWeek") {
  4010. // if(column.label == '晚' ){
  4011. // return 'evening_border schedule-table-cell-disable'
  4012. // }
  4013. if (
  4014. row[column.property].patient_id > 0 &&
  4015. row[column.property].patient_id == this.patient_id_hover
  4016. ) {
  4017. return "hover-td schedule-table-cell-disable";
  4018. } else {
  4019. return "schedule-table-cell-disable";
  4020. }
  4021. // return "schedule-table-cell-disable";
  4022. } else if (this.weekTime == "thisWeek") {
  4023. var weekday = Math.floor((columnIndex - 2) / 3 + 1);
  4024. if (weekday < this.weekday) {
  4025. if (
  4026. row[column.property].patient_id > 0 &&
  4027. row[column.property].patient_id == this.patient_id_hover
  4028. ) {
  4029. return "hover-td schedule-table-cell-disable";
  4030. }
  4031. // if(column.label == '晚'){
  4032. // return 'evening_border schedule-table-cell-disable'
  4033. // }
  4034. return "schedule-table-cell-disable";
  4035. } else {
  4036. // if(column.label == '晚' ){
  4037. // return 'evening_border'
  4038. // }
  4039. if (
  4040. row[column.property].patient_id > 0 &&
  4041. row[column.property].patient_id == this.patient_id_hover
  4042. ) {
  4043. return "hover-td";
  4044. } else {
  4045. return "";
  4046. }
  4047. }
  4048. }else{
  4049. // if(column.label == '晚' ){
  4050. // return 'evening_border '
  4051. // }
  4052. if (
  4053. row[column.property].patient_id > 0 &&
  4054. row[column.property].patient_id == this.patient_id_hover
  4055. ) {
  4056. return "hover-td schedule-table-cell-disable";
  4057. } else {
  4058. return "";
  4059. }
  4060. }
  4061. }
  4062. return "";
  4063. },
  4064. // 单元格的患者名称的回调方法
  4065. patientClass({row,column, rowIndex,columnIndex}){
  4066. if(this.cur_info.patient_id == row.id){
  4067. // console.log('patientClassrowIndex的数据',rowIndex);
  4068. // console.log('row的数据',row);
  4069. return 'highlight'
  4070. }
  4071. },
  4072. // 单元格的透析模式的回调方法
  4073. dialysis_patient({row,column, rowIndex,columnIndex}){
  4074. if(this.cur_info.mode_id == row.id){
  4075. return 'highlight'
  4076. }
  4077. },
  4078. // 单击排班表格的空白单元格弹窗搜索
  4079. SubmitSearch() {
  4080. this.patientQuery.keywords = this.searchKey;
  4081. this.getSchedulePatients();
  4082. },
  4083. // 单击排班表格的空白单元格弹窗选择传染病
  4084. changeSearchContagion(id) {
  4085. this.patientQuery.contagion = id;
  4086. this.getSchedulePatients();
  4087. },
  4088. // 单击排班表格的空白单元格弹窗选择排班
  4089. changeSearchSchedule(id) {
  4090. this.patientQuery.schedule = id;
  4091. this.getSchedulePatients();
  4092. },
  4093. // 计算总数
  4094. getSummaries(param) {
  4095. if(this.org_id !=10597){
  4096. const { columns, data } = param;
  4097. const sums = [];
  4098. columns.forEach((column, index) => {
  4099. if (index === 0 || index === 25) {
  4100. sums[index] = "总数";
  4101. return;
  4102. }
  4103. if (index === 1 || index === 24) {
  4104. sums[index] = data.length;
  4105. return;
  4106. }
  4107. const values = data.map((item) => item[column.property]);
  4108. if (index === 23) {
  4109. sums[index] = values.reduce((prev, curr) => {
  4110. const value = Number(curr);
  4111. if (!isNaN(value)) {
  4112. return prev + curr;
  4113. } else {
  4114. return prev;
  4115. }
  4116. }, 0);
  4117. sums[index];
  4118. return;
  4119. }
  4120. sums[index] = values.reduce((prev, curr) => {
  4121. if (typeof curr["mode_id"] === "undefined") {
  4122. return prev;
  4123. }
  4124. const value = Number(curr["mode_id"]);
  4125. if (!isNaN(value) && value > 0) {
  4126. return prev + 1;
  4127. } else {
  4128. return prev;
  4129. }
  4130. }, 0);
  4131. sums[index];
  4132. });
  4133. this.$nextTick(() => {
  4134. this.$refs.table.doLayout();
  4135. });
  4136. // if(this.$store.getters.xt_user.template_info.org_id == 9671 || this.$store.getters.xt_user.template_info.org_id == 0 || this.$store.getters.xt_user.template_info.org_id == 3877 || this.$store.getters.xt_user.template_info.org_id == 10340){
  4137. //表格某列全部数据
  4138. var Mon_M = []
  4139. var Mon_A = []
  4140. var Mon_N = []
  4141. var Tue_M =[]
  4142. var Tue_A = []
  4143. var Tue_N = []
  4144. var Wed_M = []
  4145. var Wed_A = []
  4146. var Wed_N = []
  4147. var Thurs_M = []
  4148. var Thurs_A = []
  4149. var Thurs_N = []
  4150. var Fri_M = []
  4151. var Fri_A = []
  4152. var Fri_N = []
  4153. var Sat_M = []
  4154. var Sat_A = []
  4155. var Sat_N = []
  4156. var Sun_M = []
  4157. var Sun_A = []
  4158. var Sun_N = []
  4159. // 操作后数据
  4160. var Mon_M_One= []
  4161. var Mon_A_One = []
  4162. var Mon_N_One = []
  4163. var Tue_M_One =[]
  4164. var Tue_A_One = []
  4165. var Tue_N_One = []
  4166. var Wed_M_One = []
  4167. var Wed_A_One = []
  4168. var Wed_N_One = []
  4169. var Thurs_M_One = []
  4170. var Thurs_A_One = []
  4171. var Thurs_N_One = []
  4172. var Fri_M_One = []
  4173. var Fri_A_One = []
  4174. var Fri_N_One = []
  4175. var Sat_M_One = []
  4176. var Sat_A_One = []
  4177. var Sat_N_One = []
  4178. var Sun_M_One = []
  4179. var Sun_A_One = []
  4180. var Sun_N_One= []
  4181. for(let j in data){
  4182. if(data[j].hasOwnProperty ('Mon_A') == true){
  4183. Mon_A.push(data[j].Mon_A.mode_name)
  4184. Mon_A=Mon_A.filter(item=> item && item.trim())//去掉空字符串
  4185. var countNum =Mon_A.reduce((obj,name)=>{
  4186. if(name in obj){
  4187. obj[name]++
  4188. }else{
  4189. obj[name]=1
  4190. }
  4191. return obj
  4192. },{})
  4193. }
  4194. }
  4195. for(let x in countNum){
  4196. Mon_A_One.push(x + ':' + countNum[x]+"\n")
  4197. }
  4198. var result = [];
  4199. for (var i = 0,len = Mon_A_One.length; i < len; i+=29) {
  4200. var strObjcet = Mon_A_One.slice(i, i+29);
  4201. var str = strObjcet.toString();
  4202. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4203. result.push(str);
  4204. }
  4205. sums[3]="总人数:"+ sums[3] +"\n"+result
  4206. for(let j in data){
  4207. if(data[j].hasOwnProperty ('Mon_M') == true){
  4208. Mon_M.push(data[j].Mon_M.mode_name)
  4209. Mon_M=Mon_M.filter(item=> item && item.trim())
  4210. var countNum =Mon_M.reduce((obj,name)=>{
  4211. if(name in obj){
  4212. obj[name]++
  4213. }else{
  4214. obj[name]=1
  4215. }
  4216. return obj
  4217. },{})
  4218. }
  4219. }
  4220. for(let x in countNum){
  4221. Mon_M_One.push(x + ':' + countNum[x]+"\n")
  4222. }
  4223. var result = [];
  4224. for (var i = 0,len = Mon_M_One.length; i < len; i+=29) {
  4225. var strObjcet = Mon_M_One.slice(i, i+29);
  4226. var str = strObjcet.toString();
  4227. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4228. result.push(str);
  4229. }
  4230. sums[2]="总人数:"+ sums[2] +"\n"+result
  4231. for(let j in data){
  4232. if(data[j].hasOwnProperty ('Mon_N') == true){
  4233. Mon_N.push(data[j].Mon_N.mode_name)
  4234. Mon_N=Mon_N.filter(item=> item && item.trim())
  4235. var countNum =Mon_N.reduce((obj,name)=>{
  4236. if(name in obj){
  4237. obj[name]++
  4238. }else{
  4239. obj[name]=1
  4240. }
  4241. return obj
  4242. },{})
  4243. }
  4244. }
  4245. for(let x in countNum){
  4246. Mon_N_One.push(x + ':' + countNum[x]+"\n")
  4247. }
  4248. var result = [];
  4249. for (var i = 0,len = Mon_N_One.length; i < len; i+=29) {
  4250. var strObjcet = Mon_N_One.slice(i, i+29);
  4251. var str = strObjcet.toString();
  4252. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4253. result.push(str);
  4254. }
  4255. sums[4]="总人数:"+ sums[4] +"\n"+result
  4256. // 星期二
  4257. for(let j in data){
  4258. if(data[j].hasOwnProperty ('Tue_M') == true){
  4259. Tue_M.push(data[j].Tue_M.mode_name)
  4260. Tue_M=Tue_M.filter(item=> item && item.trim())
  4261. var countNum =Tue_M.reduce((obj,name)=>{
  4262. if(name in obj){
  4263. obj[name]++
  4264. }else{
  4265. obj[name]=1
  4266. }
  4267. return obj
  4268. },{})
  4269. }
  4270. }
  4271. for(let x in countNum){
  4272. Tue_M_One.push(x + ':' + countNum[x]+"\n")
  4273. }
  4274. var result = [];
  4275. for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
  4276. var strObjcet = Tue_M_One.slice(i, i+29);
  4277. var str = strObjcet.toString();
  4278. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4279. result.push(str);
  4280. }
  4281. sums[5]="总人数:"+ sums[5] +"\n"+result
  4282. // var newTue_A
  4283. for(let j in data){
  4284. if(data[j].hasOwnProperty ('Tue_A') == true){
  4285. Tue_A.push(data[j].Tue_A.mode_name)
  4286. Tue_A=Tue_A.filter(item=> item && item.trim())
  4287. var countNum =Tue_A.reduce((obj,name)=>{
  4288. if(name in obj){
  4289. obj[name]++
  4290. }else{
  4291. obj[name]=1
  4292. }
  4293. return obj
  4294. },{})
  4295. }
  4296. }
  4297. for(let x in countNum){
  4298. Tue_A_One.push(x + ':' + countNum[x]+"\n")
  4299. }
  4300. var result = [];
  4301. for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
  4302. var strObjcet = Tue_A_One.slice(i, i+29);
  4303. var str = strObjcet.toString();
  4304. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4305. result.push(str);
  4306. }
  4307. sums[6]="总人数:"+ sums[6] +"\n"+result
  4308. for(let j in data){
  4309. if(data[j].hasOwnProperty ('Tue_N') == true){
  4310. Tue_N.push(data[j].Tue_N.mode_name)
  4311. Tue_N=Tue_N.filter(item=> item && item.trim())
  4312. var countNum =Tue_N.reduce((obj,name)=>{
  4313. if(name in obj){
  4314. obj[name]++
  4315. }else{
  4316. obj[name]=1
  4317. }
  4318. return obj
  4319. },{})
  4320. }
  4321. }
  4322. for(let x in countNum){
  4323. Tue_N_One.push(x + ':' + countNum[x]+"\n")
  4324. }
  4325. var result = [];
  4326. for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
  4327. var strObjcet = Tue_N_One.slice(i, i+29);
  4328. var str = strObjcet.toString();
  4329. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4330. result.push(str);
  4331. }
  4332. sums[7]="总人数:"+ sums[7] +"\n"+result
  4333. // 星期三
  4334. for(let j in data){
  4335. if(data[j].hasOwnProperty ('Wed_M') == true){
  4336. Wed_M.push(data[j].Wed_M.mode_name)
  4337. Wed_M=Wed_M.filter(item=> item && item.trim())
  4338. var countNum =Wed_M.reduce((obj,name)=>{
  4339. if(name in obj){
  4340. obj[name]++
  4341. }else{
  4342. obj[name]=1
  4343. }
  4344. return obj
  4345. },{})
  4346. }
  4347. }
  4348. for(let x in countNum){
  4349. Wed_M_One.push(x + ':' + countNum[x]+"\n")
  4350. }
  4351. var result = [];
  4352. for (var i = 0,len = Wed_M_One.length; i < len; i+=29) {
  4353. var strObjcet = Wed_M_One.slice(i, i+29);
  4354. var str = strObjcet.toString();
  4355. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4356. result.push(str);
  4357. }
  4358. sums[8]="总人数:"+ sums[8] +"\n"+result
  4359. for(let j in data){
  4360. if(data[j].hasOwnProperty ('Wed_A') == true){
  4361. Wed_A.push(data[j].Wed_A.mode_name)
  4362. Wed_A=Wed_A.filter(item=> item && item.trim())
  4363. var countNum =Wed_A.reduce((obj,name)=>{
  4364. if(name in obj){
  4365. obj[name]++
  4366. }else{
  4367. obj[name]=1
  4368. }
  4369. return obj
  4370. },{})
  4371. }
  4372. }
  4373. for(let x in countNum){
  4374. Wed_A_One.push(x + ':' + countNum[x]+"\n")
  4375. }
  4376. var result = [];
  4377. for (var i = 0,len = Wed_A_One.length; i < len; i+=29) {
  4378. var strObjcet = Wed_A_One.slice(i, i+29);
  4379. var str = strObjcet.toString();
  4380. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4381. result.push(str);
  4382. }
  4383. sums[9]="总人数:"+ sums[9] +"\n"+result
  4384. for(let j in data){
  4385. if(data[j].hasOwnProperty ('Wed_N') == true){
  4386. Wed_N.push(data[j].Wed_N.mode_name)
  4387. Wed_N=Wed_N.filter(item=> item && item.trim())
  4388. var countNum =Wed_N.reduce((obj,name)=>{
  4389. if(name in obj){
  4390. obj[name]++
  4391. }else{
  4392. obj[name]=1
  4393. }
  4394. return obj
  4395. },{})
  4396. }
  4397. }
  4398. for(let x in countNum){
  4399. Wed_N_One.push(x + ':' + countNum[x]+"\n")
  4400. }
  4401. var result = [];
  4402. for (var i = 0,len = Wed_N_One.length; i < len; i+=29) {
  4403. var strObjcet = Wed_N_One.slice(i, i+29);
  4404. var str = strObjcet.toString();
  4405. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4406. result.push(str);
  4407. }
  4408. sums[10]="总人数:"+ sums[10] +"\n"+result
  4409. // 星期四
  4410. for(let j in data){
  4411. if(data[j].hasOwnProperty ('Thurs_M') == true){
  4412. Thurs_M.push(data[j].Thurs_M.mode_name)
  4413. Thurs_M=Thurs_M.filter(item=> item && item.trim())
  4414. var countNum =Thurs_M.reduce((obj,name)=>{
  4415. if(name in obj){
  4416. obj[name]++
  4417. }else{
  4418. obj[name]=1
  4419. }
  4420. return obj
  4421. },{})
  4422. }
  4423. }
  4424. for(let x in countNum){
  4425. Thurs_M_One.push(x + ':' + countNum[x]+"\n")
  4426. }
  4427. var result = [];
  4428. for (var i = 0,len = Thurs_M_One.length; i < len; i+=29) {
  4429. var strObjcet = Thurs_M_One.slice(i, i+29);
  4430. var str = strObjcet.toString();
  4431. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4432. result.push(str);
  4433. }
  4434. sums[11]="总人数:"+ sums[11] +"\n"+result
  4435. for(let j in data){
  4436. if(data[j].hasOwnProperty ('Thurs_A') == true){
  4437. Thurs_A.push(data[j].Thurs_A.mode_name)
  4438. Thurs_A=Thurs_A.filter(item=> item && item.trim())
  4439. var countNum =Thurs_A.reduce((obj,name)=>{
  4440. if(name in obj){
  4441. obj[name]++
  4442. }else{
  4443. obj[name]=1
  4444. }
  4445. return obj
  4446. },{})
  4447. }
  4448. }
  4449. for(let x in countNum){
  4450. Thurs_A_One.push(x + ':' + countNum[x]+"\n")
  4451. }
  4452. var result = [];
  4453. for (var i = 0,len = Thurs_A_One.length; i < len; i+=29) {
  4454. var strObjcet = Thurs_A_One.slice(i, i+29);
  4455. var str = strObjcet.toString();
  4456. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4457. result.push(str);
  4458. }
  4459. sums[12]="总人数:"+ sums[12] +"\n"+result
  4460. for(let j in data){
  4461. if(data[j].hasOwnProperty ('Thurs_N') == true){
  4462. Thurs_N.push(data[j].Thurs_N.mode_name)
  4463. Thurs_N=Thurs_N.filter(item=> item && item.trim())
  4464. var countNum =Thurs_N.reduce((obj,name)=>{
  4465. if(name in obj){
  4466. obj[name]++
  4467. }else{
  4468. obj[name]=1
  4469. }
  4470. return obj
  4471. },{})
  4472. }
  4473. }
  4474. for(let x in countNum){
  4475. Thurs_N_One.push(x + ':' + countNum[x]+"\n")
  4476. }
  4477. var result = [];
  4478. for (var i = 0,len = Thurs_N_One.length; i < len; i+=29) {
  4479. var strObjcet = Thurs_N_One.slice(i, i+29);
  4480. var str = strObjcet.toString();
  4481. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4482. result.push(str);
  4483. }
  4484. sums[13]="总人数:"+ sums[13] +"\n"+result
  4485. // 星期五
  4486. for(let j in data){
  4487. if(data[j].hasOwnProperty ('Fri_M') == true){
  4488. Fri_M.push(data[j].Fri_M.mode_name)
  4489. Fri_M=Fri_M.filter(item=> item && item.trim())
  4490. var countNum =Fri_M.reduce((obj,name)=>{
  4491. if(name in obj){
  4492. obj[name]++
  4493. }else{
  4494. obj[name]=1
  4495. }
  4496. return obj
  4497. },{})
  4498. }
  4499. }
  4500. for(let x in countNum){
  4501. Fri_M_One.push(x + ':' + countNum[x]+"\n")
  4502. }
  4503. var result = [];
  4504. for (var i = 0,len = Fri_M_One.length; i < len; i+=29) {
  4505. var strObjcet = Fri_M_One.slice(i, i+29);
  4506. var str = strObjcet.toString();
  4507. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4508. result.push(str);
  4509. }
  4510. sums[14]="总人数:"+ sums[14] +"\n"+result
  4511. for(let j in data){
  4512. if(data[j].hasOwnProperty ('Fri_A') == true){
  4513. Fri_A.push(data[j].Fri_A.mode_name)
  4514. Fri_A=Fri_A.filter(item=> item && item.trim())
  4515. var countNum =Fri_A.reduce((obj,name)=>{
  4516. if(name in obj){
  4517. obj[name]++
  4518. }else{
  4519. obj[name]=1
  4520. }
  4521. return obj
  4522. },{})
  4523. }
  4524. }
  4525. for(let x in countNum){
  4526. Fri_A_One.push(x + ':' + countNum[x]+"\n")
  4527. }
  4528. var result = [];
  4529. for (var i = 0,len = Fri_A_One.length; i < len; i+=29) {
  4530. var strObjcet = Fri_A_One.slice(i, i+29);
  4531. var str = strObjcet.toString();
  4532. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4533. result.push(str);
  4534. }
  4535. sums[15]="总人数:"+ sums[15] +"\n"+result
  4536. for(let j in data){
  4537. if(data[j].hasOwnProperty ('Fri_N') == true){
  4538. Fri_N.push(data[j].Fri_N.mode_name)
  4539. Fri_N=Fri_N.filter(item=> item && item.trim())
  4540. var countNum =Fri_N.reduce((obj,name)=>{
  4541. if(name in obj){
  4542. obj[name]++
  4543. }else{
  4544. obj[name]=1
  4545. }
  4546. return obj
  4547. },{})
  4548. }
  4549. }
  4550. for(let x in countNum){
  4551. Fri_N_One.push(x + ':' + countNum[x]+"\n")
  4552. }
  4553. var result = [];
  4554. for (var i = 0,len = Fri_N_One.length; i < len; i+=29) {
  4555. var strObjcet = Fri_N_One.slice(i, i+29);
  4556. var str = strObjcet.toString();
  4557. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4558. result.push(str);
  4559. }
  4560. sums[16]="总人数:"+ sums[16] +"\n"+result
  4561. // 星期六
  4562. for(let j in data){
  4563. if(data[j].hasOwnProperty ('Sat_M') == true){
  4564. Sat_M.push(data[j].Sat_M.mode_name)
  4565. Sat_M=Sat_M.filter(item=> item && item.trim())
  4566. var countNum =Sat_M.reduce((obj,name)=>{
  4567. if(name in obj){
  4568. obj[name]++
  4569. }else{
  4570. obj[name]=1
  4571. }
  4572. return obj
  4573. },{})
  4574. }
  4575. }
  4576. for(let x in countNum){
  4577. Sat_M_One.push(x + ':' + countNum[x]+"\n")
  4578. }
  4579. var result = [];
  4580. for (var i = 0,len = Sat_M_One.length; i < len; i+=29) {
  4581. var strObjcet = Sat_M_One.slice(i, i+29);
  4582. var str = strObjcet.toString();
  4583. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4584. result.push(str);
  4585. }
  4586. sums[17]="总人数:"+ sums[17] +"\n"+result
  4587. for(let j in data){
  4588. if(data[j].hasOwnProperty ('Sat_A') == true){
  4589. Sat_A.push(data[j].Sat_A.mode_name)
  4590. Sat_A=Sat_A.filter(item=> item && item.trim())
  4591. var countNum =Sat_A.reduce((obj,name)=>{
  4592. if(name in obj){
  4593. obj[name]++
  4594. }else{
  4595. obj[name]=1
  4596. }
  4597. return obj
  4598. },{})
  4599. }
  4600. }
  4601. for(let x in countNum){
  4602. Sat_A_One.push(x + ':' + countNum[x]+"\n")
  4603. }
  4604. var result = [];
  4605. for (var i = 0,len = Sat_A_One.length; i < len; i+=29) {
  4606. var strObjcet = Sat_A_One.slice(i, i+29);
  4607. var str = strObjcet.toString();
  4608. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4609. result.push(str);
  4610. }
  4611. sums[18]="总人数:"+ sums[18] +"\n"+result
  4612. for(let j in data){
  4613. if(data[j].hasOwnProperty ('Sat_N') == true){
  4614. Sat_N.push(data[j].Sat_N.mode_name)
  4615. Sat_N=Sat_N.filter(item=> item && item.trim())
  4616. var countNum =Sat_N.reduce((obj,name)=>{
  4617. if(name in obj){
  4618. obj[name]++
  4619. }else{
  4620. obj[name]=1
  4621. }
  4622. return obj
  4623. },{})
  4624. }
  4625. }
  4626. for(let x in countNum){
  4627. Sat_N_One.push(x + ':' + countNum[x]+"\n")
  4628. }
  4629. var result = [];
  4630. for (var i = 0,len = Sat_N_One.length; i < len; i+=29) {
  4631. var strObjcet = Sat_N_One.slice(i, i+29);
  4632. var str = strObjcet.toString();
  4633. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4634. result.push(str);
  4635. }
  4636. sums[19]="总人数:"+ sums[19] +"\n"+result
  4637. // 星期天
  4638. for(let j in data){
  4639. if(data[j].hasOwnProperty ('Sun_M') == true){
  4640. Sun_M.push(data[j].Sun_M.mode_name)
  4641. Sun_M=Sun_M.filter(item=> item && item.trim())
  4642. var countNum =Sun_M.reduce((obj,name)=>{
  4643. if(name in obj){
  4644. obj[name]++
  4645. }else{
  4646. obj[name]=1
  4647. }
  4648. return obj
  4649. },{})
  4650. }
  4651. }
  4652. for(let x in countNum){
  4653. Sun_M_One.push(x + ':' + countNum[x]+"\n")
  4654. }
  4655. var result = [];
  4656. for (var i = 0,len = Sun_M_One.length; i < len; i+=29) {
  4657. var strObjcet = Sun_M_One.slice(i, i+29);
  4658. var str = strObjcet.toString();
  4659. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4660. result.push(str);
  4661. }
  4662. sums[20]="总人数:"+ sums[20] +"\n"+result
  4663. for(let j in data){
  4664. if(data[j].hasOwnProperty ('Sun_A') == true){
  4665. Sun_A.push(data[j].Sun_A.mode_name)
  4666. Sun_A=Sun_A.filter(item=> item && item.trim())
  4667. var countNum =Sun_A.reduce((obj,name)=>{
  4668. if(name in obj){
  4669. obj[name]++
  4670. }else{
  4671. obj[name]=1
  4672. }
  4673. return obj
  4674. },{})
  4675. }
  4676. }
  4677. for(let x in countNum){
  4678. Sun_A_One.push(x + ':' + countNum[x]+"\n")
  4679. }
  4680. var result = [];
  4681. for (var i = 0,len = Sun_A_One.length; i < len; i+=29) {
  4682. var strObjcet = Sun_A_One.slice(i, i+29);
  4683. var str = strObjcet.toString();
  4684. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4685. result.push(str);
  4686. }
  4687. sums[21]="总人数:"+ sums[21] +"\n"+result
  4688. for(let j in data){
  4689. if(data[j].hasOwnProperty ('Sun_N') == true){
  4690. Sun_N.push(data[j].Sun_N.mode_name)
  4691. Sun_N=Sun_N.filter(item=> item && item.trim())
  4692. var countNum =Sun_N.reduce((obj,name)=>{
  4693. if(name in obj){
  4694. obj[name]++
  4695. }else{
  4696. obj[name]=1
  4697. }
  4698. return obj
  4699. },{})
  4700. }
  4701. }
  4702. for(let x in countNum){
  4703. Sun_N_One.push(x + ':' + countNum[x]+"\n")
  4704. }
  4705. var result = [];
  4706. for (var i = 0,len = Sun_N_One.length; i < len; i+=29) {
  4707. var strObjcet = Sun_N_One.slice(i, i+29);
  4708. var str = strObjcet.toString();
  4709. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  4710. result.push(str);
  4711. }
  4712. sums[22]="总人数:"+ sums[22] +"\n"+result
  4713. return sums;
  4714. // }
  4715. // if(this.$store.getters.xt_user.template_info.org_id != 9671 && this.$store.getters.xt_user.template_info.org_id != 0 && this.$store.getters.xt_user.template_info.org_id != 3877 && this.$store.getters.xt_user.template_info.org_id != 10340){
  4716. // return sums;
  4717. // }
  4718. }
  4719. },
  4720. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  4721. var that = this;
  4722. var rowNum = 0;
  4723. rowNumber = 0;
  4724. var rutrnData = {};
  4725. if (columnIndex === 0 || columnIndex == 25) {
  4726. var rowLen = this.scheduleZoneRow.length;
  4727. if (rowLen > 0) {
  4728. for (let index = 0; index < rowLen; index++) {
  4729. rowNum = this.scheduleZoneRow[index];
  4730. rowNumber += rowNum;
  4731. var f = rowNumber - rowNum;
  4732. if (f == rowIndex) {
  4733. rutrnData = {
  4734. rowspan: rowNum,
  4735. colspan: 1,
  4736. };
  4737. break;
  4738. } else if (rowIndex < rowNumber) {
  4739. rutrnData = {
  4740. rowspan: 0,
  4741. colspan: 0,
  4742. };
  4743. break;
  4744. }
  4745. }
  4746. return rutrnData;
  4747. }
  4748. }
  4749. },
  4750. handleCurrentChange(row) {
  4751. if (typeof row === "undefined" || row == null) {
  4752. this.currentData.patient_id = 0;
  4753. this.currentData.contagions = [];
  4754. } else {
  4755. this.currentData.patient_id = row.id;
  4756. this.currentData.contagions = row.contagions;
  4757. }
  4758. },
  4759. // 数据源
  4760. getSchedules() {
  4761. var partionStr = this.partition_id;
  4762. var arr = this.zoneIdList.join(",");
  4763. var str = "";
  4764. if (partionStr == 0) {
  4765. str = arr;
  4766. }
  4767. if (partionStr != 0) {
  4768. str = partionStr.join(",");
  4769. }
  4770. const params = {
  4771. weekTime: this.theType,
  4772. patitionid: str,
  4773. schedule_type: this.schedule_type,
  4774. };
  4775. getSchedulesOne(params).then((response) => {
  4776. if (response.data.state == 1) {
  4777. this.weekTitle = response.data.data.weekTitle;
  4778. this.weekDays = response.data.data.days;
  4779. this.toDay = response.data.data.today;
  4780. var theSchedules = response.data.data.schdules;
  4781. this.newschedules= theSchedules
  4782. var schedulesGroup = response.data.data.schedulesGroup
  4783. this.schedulesGroup = schedulesGroup
  4784. var that = this;
  4785. this.scheduleZone.forEach(function (zone, index) {
  4786. that.scheduleZone[index].Mon_M = {
  4787. mode_id: 0,
  4788. mode_name: "",
  4789. patient_id: 0,
  4790. patient: "",
  4791. dialysis_machine_name: "",
  4792. };
  4793. that.scheduleZone[index].Mon_A = {
  4794. mode_id: 0,
  4795. mode_name: "",
  4796. patient_id: 0,
  4797. patient: "",
  4798. dialysis_machine_name: "",
  4799. };
  4800. that.scheduleZone[index].Mon_N = {
  4801. mode_id: 0,
  4802. mode_name: "",
  4803. patient_id: 0,
  4804. patient: "",
  4805. dialysis_machine_name: "",
  4806. };
  4807. that.scheduleZone[index].Tue_M = {
  4808. mode_id: 0,
  4809. mode_name: "",
  4810. patient_id: 0,
  4811. patient: "",
  4812. dialysis_machine_name: "",
  4813. };
  4814. that.scheduleZone[index].Tue_A = {
  4815. mode_id: 0,
  4816. mode_name: "",
  4817. dialysis_machine_name: "",
  4818. patient_id: 0,
  4819. patient: "",
  4820. };
  4821. that.scheduleZone[index].Tue_N = {
  4822. mode_id: 0,
  4823. mode_name: "",
  4824. dialysis_machine_name: "",
  4825. patient_id: 0,
  4826. patient: "",
  4827. };
  4828. that.scheduleZone[index].Wed_M = {
  4829. mode_id: 0,
  4830. mode_name: "",
  4831. patient_id: 0,
  4832. dialysis_machine_name: "",
  4833. patient: "",
  4834. };
  4835. that.scheduleZone[index].Wed_A = {
  4836. mode_id: 0,
  4837. mode_name: "",
  4838. dialysis_machine_name: "",
  4839. patient_id: 0,
  4840. patient: "",
  4841. };
  4842. that.scheduleZone[index].Wed_N = {
  4843. mode_id: 0,
  4844. mode_name: "",
  4845. dialysis_machine_name: "",
  4846. patient_id: 0,
  4847. patient: "",
  4848. };
  4849. that.scheduleZone[index].Thurs_M = {
  4850. mode_id: 0,
  4851. mode_name: "",
  4852. patient_id: 0,
  4853. patient: "",
  4854. };
  4855. that.scheduleZone[index].Thurs_A = {
  4856. mode_id: 0,
  4857. mode_name: "",
  4858. dialysis_machine_name: "",
  4859. patient_id: 0,
  4860. patient: "",
  4861. };
  4862. that.scheduleZone[index].Thurs_N = {
  4863. mode_id: 0,
  4864. mode_name: "",
  4865. patient_id: 0,
  4866. patient: "",
  4867. };
  4868. that.scheduleZone[index].Fri_M = {
  4869. mode_id: 0,
  4870. mode_name: "",
  4871. dialysis_machine_name: "",
  4872. patient_id: 0,
  4873. patient: "",
  4874. };
  4875. that.scheduleZone[index].Fri_A = {
  4876. mode_id: 0,
  4877. mode_name: "",
  4878. patient_id: 0,
  4879. dialysis_machine_name: "",
  4880. patient: "",
  4881. };
  4882. that.scheduleZone[index].Fri_N = {
  4883. mode_id: 0,
  4884. mode_name: "",
  4885. patient_id: 0,
  4886. dialysis_machine_name: "",
  4887. patient: "",
  4888. };
  4889. that.scheduleZone[index].Sat_M = {
  4890. mode_id: 0,
  4891. mode_name: "",
  4892. dialysis_machine_name: "",
  4893. patient_id: 0,
  4894. patient: "",
  4895. };
  4896. that.scheduleZone[index].Sat_A = {
  4897. mode_id: 0,
  4898. mode_name: "",
  4899. patient_id: 0,
  4900. dialysis_machine_name: "",
  4901. patient: "",
  4902. };
  4903. that.scheduleZone[index].Sat_N = {
  4904. mode_id: 0,
  4905. mode_name: "",
  4906. patient_id: 0,
  4907. patient: "",
  4908. dialysis_machine_name: "",
  4909. };
  4910. that.scheduleZone[index].Sun_A = {
  4911. mode_id: 0,
  4912. mode_name: "",
  4913. patient_id: 0,
  4914. dialysis_machine_name: "",
  4915. patient: "",
  4916. };
  4917. that.scheduleZone[index].Sun_N = {
  4918. mode_id: 0,
  4919. mode_name: "",
  4920. dialysis_machine_name: "",
  4921. patient_id: 0,
  4922. patient: "",
  4923. };
  4924. that.scheduleZone[index].Sun_M = {
  4925. mode_id: 0,
  4926. mode_name: "",
  4927. patient_id: 0,
  4928. dialysis_machine_name: "",
  4929. patient: "",
  4930. };
  4931. that.scheduleZone[index].total = 0;
  4932. if (response.data.data.schdules.length > 0) {
  4933. theSchedules.forEach(function (schedule, sindex) {
  4934. if (zone.jihao_id == schedule.bed_id) {
  4935. var weekPath = that.weekPath(
  4936. schedule.schedule_week,
  4937. schedule.schedule_type
  4938. );
  4939. if (weekPath.length == 2) {
  4940. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  4941. that.scheduleZone[index][weekPathKey] = {
  4942. schedule_id: schedule.id,
  4943. mode_id: schedule.mode_id,
  4944. patient_id: schedule.patient_id,
  4945. patient: schedule.patient,
  4946. dialysis_machine_name: schedule.dialysis_machine_name,
  4947. patient_contagions: schedule.patient_contagions,
  4948. mode_name:
  4949. typeof that.modeOptions[schedule.mode_id] ===
  4950. "undefined"
  4951. ? ""
  4952. : that.modeOptions[schedule.mode_id].name,
  4953. };
  4954. that.scheduleZone[index].total += 1;
  4955. }
  4956. }
  4957. });
  4958. }
  4959. });
  4960. } else {
  4961. this.$message.error("网络错误");
  4962. return false;
  4963. }
  4964. });
  4965. },
  4966. getSchedulePatients() {
  4967. getSchedulePatients(this.patientQuery).then((response) => {
  4968. if (response.data.state == 1) {
  4969. this.patients = response.data.data.patients;
  4970. }
  4971. });
  4972. },
  4973. // 排班成功接口
  4974. async CreateSchedule(id, data) {
  4975. this.creating_schedule = true;
  4976. let response =await CreateSchedule(id, data)
  4977. this.dialogTableVisible=false
  4978. if (response.data.state == 0) {
  4979. this.$message.error(response.data.msg);
  4980. } else {
  4981. var that = this;
  4982. var schedule = response.data.data.schedule;
  4983. this.creating_schedule=false;
  4984. this.dialogTableVisible=false
  4985. this.scheduleZone.forEach(function (zone, index) {
  4986. if (
  4987. zone.zone_id == schedule.partition_id &&
  4988. zone.jihao_id == schedule.bed_id
  4989. ) {
  4990. var weekPath = that.weekPath(
  4991. schedule.schedule_week,
  4992. schedule.schedule_type
  4993. );
  4994. if (weekPath.length == 2) {
  4995. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  4996. that.scheduleZone[index][weekPathKey] = {
  4997. schedule_id: schedule.id,
  4998. mode_id: schedule.mode_id,
  4999. patient_id: schedule.patient_id,
  5000. patient: schedule.patient,
  5001. dialysis_machine_name: schedule.dialysis_machine_name,
  5002. patient_contagions: that.currentData.contagions,
  5003. mode_name:
  5004. typeof that.modeOptions[schedule.mode_id] === "undefined"
  5005. ? ""
  5006. : that.modeOptions[schedule.mode_id].name,
  5007. };
  5008. that.scheduleZone[index].total += 1;
  5009. }
  5010. }
  5011. });
  5012. }
  5013. this.creating_schedule = false;
  5014. },
  5015. async CreateScheduleTwo(id, data,id_two) {
  5016. this.loading =true
  5017. this.creating_schedule = true;
  5018. let response =await CreateScheduleTwo(id, data,id_two)
  5019. if (response.data.state == 0) {
  5020. this.$message.error(response.data.msg);
  5021. } else {
  5022. var that = this;
  5023. var schedule = response.data.data.schedule;
  5024. this.creating_schedule=false;
  5025. this.dialogTableVisible=false
  5026. // this.getSchedules()
  5027. console.log('vvvvvv',schedule)
  5028. console.log('cccccc',this.cur_drag_info);
  5029. const curdrag = this.cur_drag_info
  5030. if(curdrag.bed_id!=''){
  5031. this.scheduleZone.forEach(function (zone, index) {
  5032. if (
  5033. zone.zone_id == schedule.partition_id &&
  5034. zone.jihao_id == schedule.bed_id
  5035. ) {
  5036. // console.log('111111',zone.zone_id,zone.jihao_id);
  5037. var weekPath = that.weekPath(
  5038. schedule.schedule_week,
  5039. schedule.schedule_type
  5040. );
  5041. console.log('22222',weekPath);
  5042. if (weekPath.length == 2) {
  5043. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  5044. that.scheduleZone[index][weekPathKey] = {
  5045. schedule_id: schedule.id,
  5046. mode_id: schedule.mode_id,
  5047. patient_id: schedule.patient_id,
  5048. patient: schedule.patient,
  5049. dialysis_machine_name: schedule.dialysis_machine_name,
  5050. patient_contagions: that.currentData.contagions,
  5051. mode_name:
  5052. typeof that.modeOptions[schedule.mode_id] === "undefined"
  5053. ? ""
  5054. : that.modeOptions[schedule.mode_id].name,
  5055. };
  5056. // console.log('3333',that.scheduleZone[index][weekPathKey]);
  5057. that.scheduleZone[index].total += 1;
  5058. }
  5059. }
  5060. if(zone.zone_id == curdrag.partition_id &&
  5061. zone.jihao_id == curdrag.bed_id
  5062. ){
  5063. // console.log('aaaaaa',curdrag);
  5064. var weekPath = that.weekPath(
  5065. curdrag.schedule_week,
  5066. curdrag.schedule_type
  5067. );
  5068. console.log('aaaaaa',weekPath);
  5069. if(weekPath.length == 2){
  5070. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  5071. that.scheduleZone[index][weekPathKey] ={
  5072. schedule_id: '',
  5073. mode_id: '',
  5074. patient_id: '',
  5075. patient: '',
  5076. dialysis_machine_name: '',
  5077. patient_contagions: '',
  5078. mode_name:''
  5079. };
  5080. that.scheduleZone[index].total += 1;
  5081. }
  5082. }
  5083. });
  5084. }else{
  5085. this.getSchedules()
  5086. }
  5087. // return that.scheduleZone()
  5088. // this.closePatientPanel();
  5089. }
  5090. this.creating_schedule = false;
  5091. this.loading=false
  5092. },
  5093. // 单击选中患者
  5094. clickThis(row, column, cell, event) {
  5095. if (row[column.property].schedule_id > 0) {
  5096. this.cur_info.patient_id=row[column.property].patient_id
  5097. this.cur_info.mode_id=row[column.property].mode_id
  5098. this.patient_id_hover = this.cur_info.patient_id;
  5099. this.cur_info.patient_name = row[column.property].patient
  5100. this.cur_info.mode_name = row[column.property].mode_name
  5101. console.log('单击选中患者',row[column.property]);
  5102. } else {
  5103. var week = this.weekDay(column.property);
  5104. if (week[0] == -1 || week[1] == -1) {
  5105. return false;
  5106. }
  5107. if (this.toDay > this.weekDays[week[0] - 1]) {
  5108. return false;
  5109. }
  5110. this.currentData.schedule_date = this.weekDays[week[0] - 1];
  5111. this.currentData.schedule_type = week[1];
  5112. this.currentData.bed_id = row.jihao_id;
  5113. this.currentData.partition_id = row.zone_id;
  5114. this.currentData.schedule_week = week[0];
  5115. this.currentData.type_name = this.dayType(week[1]);
  5116. this.currentData.zone_name = row.area;
  5117. this.currentData.bed_name = row.cut;
  5118. this.currentData.partition_type = row.zone_type;
  5119. this.patient_id_hover = -1;
  5120. this.currentData.mode_id = 1;
  5121. this.currentData.id = 0;
  5122. this.currentData.patient_id = 0;
  5123. this.currentData.patient = "";
  5124. this.currentData.contagions = [];
  5125. this.getSchedulePatients();
  5126. this.dialogTableVisible = true;
  5127. }
  5128. },
  5129. // 双击有内容的单元格
  5130. dblclickThis(row, column, cell, event){
  5131. var week = this.weekDay(column.property);
  5132. if (week[0] == -1 || week[1] == -1) {
  5133. return false;
  5134. }
  5135. if (this.toDay > this.weekDays[week[0] - 1]) {
  5136. return false;
  5137. }else{
  5138. this.currentData.schedule_date = this.weekDays[week[0] - 1];
  5139. this.currentData.schedule_type = week[1];
  5140. this.currentData.bed_id = row.jihao_id;
  5141. this.currentData.partition_id = row.zone_id;
  5142. this.currentData.schedule_week = week[0];
  5143. this.currentData.type_name = this.dayType(week[1]);
  5144. this.currentData.zone_name = row.area;
  5145. this.currentData.bed_name = row.cut;
  5146. this.currentData.partition_type = row.zone_type;
  5147. if (row[column.property].schedule_id > 0) {
  5148. this.currentData.mode_id = row[column.property].mode_id;
  5149. this.currentData.id = row[column.property].schedule_id;
  5150. this.currentData.patient_id = row[column.property].patient_id;
  5151. this.currentData.patient = row[column.property].patient;
  5152. this.currentData.contagions = row[column.property].patient_contagions;
  5153. this.tiaoZhengType = 1;
  5154. this.msDialogVisible=true
  5155. }
  5156. console.log("ROW22O2O2OWOOW",row)
  5157. console.log("CHANGESHCUEL2O2O2O",this.changeSchedule)
  5158. console.log("WOOWOWOWOWOW",this.zones)
  5159. console.log("numberowowow",this.numberList)
  5160. this.changeSchedule.mode_id = row[column.property].mode_id
  5161. // var zone_names = ""
  5162. // for(let i=0;i<this.zones.length;i++){
  5163. // if(row.zone_id == this.zones[i].id){
  5164. // zone_names = this.zones[i].name
  5165. // }
  5166. // }
  5167. this.changeSchedule.partition_id = row.zone_id
  5168. this.changeSchedule.schedule_type = week[1];
  5169. this.changeSchedule.bed_id = row.jihao_id;
  5170. console.log("床位id",this.changeSchedule.bed_id)
  5171. this.changeSchedule.schedule_week = week[0];
  5172. }
  5173. },
  5174. // 双击弹窗确认按钮
  5175. submitMode(formName) {
  5176. console.log("wowowoowow",this.changeSchedule)
  5177. this.changing_mode = true;
  5178. this.changeSchedule.change_action = "change_mode";
  5179. ChangeSchedule(this.currentData.id, this.changeSchedule).then((response) => {
  5180. if (response.data.state == 0) {
  5181. this.$message.error(response.data.msg);
  5182. } else {
  5183. this.$message({
  5184. type: "success",
  5185. message: "修改成功!",
  5186. });
  5187. var that = this;
  5188. var schedule = response.data.data.schedule;
  5189. this.msDialogVisible = false
  5190. this.scheduleZone.forEach(function (zone, index) {
  5191. if (
  5192. zone.zone_id == schedule.partition_id &&
  5193. zone.jihao_id == schedule.bed_id
  5194. ) {
  5195. var weekPath = that.weekPath(
  5196. schedule.schedule_week,
  5197. schedule.schedule_type
  5198. );
  5199. if (weekPath.length == 2) {
  5200. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  5201. that.scheduleZone[index][weekPathKey].dialysis_machine_name =
  5202. schedule.dialysis_machine_name;
  5203. that.scheduleZone[index][weekPathKey].mode_id =
  5204. schedule.mode_id;
  5205. that.scheduleZone[index][weekPathKey].mode_name = typeof that.modeOptions[schedule.mode_id] === "undefined"
  5206. ? ""
  5207. : that.modeOptions[schedule.mode_id].name;
  5208. }
  5209. }
  5210. });
  5211. // this.msDialogVisible = false;
  5212. // this.getAllZones()
  5213. }
  5214. this.changing_mode = false;
  5215. }).catch((err) => {
  5216. this.$message.error(err);
  5217. this.changing_mode = false;
  5218. });
  5219. },
  5220. changePartition(value) {
  5221. this.current_devices = this.zone_device_map[value];
  5222. this.device_id = this.current_devices[0].id;
  5223. },
  5224. changePartitionOne(val){
  5225. console.log("valwoowow",val)
  5226. getNumberList(val).then(response=>{
  5227. if(response.data.state==1){
  5228. var number = response.data.data.number
  5229. this.numberList = []
  5230. this.numberList = number
  5231. }
  5232. })
  5233. },
  5234. // 选择下拉框方法
  5235. changeScheduleType(schedule_type) {
  5236. const params = {
  5237. type: schedule_type,
  5238. date: this.currentData.schedule_date,
  5239. };
  5240. getUrgentScheduleInitData(params)
  5241. .then((rs) => {
  5242. if (rs.data.state == 1) {
  5243. this.origin_schedules = rs.data.data.schedules;
  5244. this.origin_device_numbers = rs.data.data.device_numbers;
  5245. var zone_device_map = {};
  5246. for (
  5247. let index = 0;
  5248. index < this.origin_device_numbers.length;
  5249. index++
  5250. ) {
  5251. const device_number = this.origin_device_numbers[index];
  5252. if (
  5253. zone_device_map[device_number.zone_name] == null ||
  5254. zone_device_map[device_number.zone_name] == undefined
  5255. ) {
  5256. zone_device_map[device_number.zone_name] = [];
  5257. }
  5258. zone_device_map[device_number.zone_name].push(device_number);
  5259. }
  5260. this.zone_device_map = zone_device_map;
  5261. this.zone_names = Object.keys(this.zone_device_map);
  5262. if (this.zone_names.length > 0) {
  5263. this.zone_name = this.zone_names[0];
  5264. this.current_devices = this.zone_device_map[this.zone_name];
  5265. this.device_id = this.current_devices[0].id;
  5266. }
  5267. this.zone_device_options = [
  5268. { values: this.zone_names },
  5269. // { values: this.getDeviceNumberNames(this.current_devices) },
  5270. { values: this.current_devices },
  5271. ];
  5272. } else {
  5273. }
  5274. })
  5275. .catch((err) => {
  5276. this.loading = false;
  5277. });
  5278. },
  5279. submitTiaoX() {
  5280. if (this.tiaoZhengType==1) {
  5281. this.$confirm('确定要取消当前排班?', '提示', {
  5282. confirmButtonText: '确定',
  5283. cancelButtonText: '取消',
  5284. type: 'warning'
  5285. }).then(() => {
  5286. this.CancelSchedule(this.currentData.id);
  5287. }).catch(() => {});
  5288. }
  5289. switch (this.tiaoZhengType) {
  5290. case 1:
  5291. this.CancelSchedule(this.currentData.id);
  5292. break;
  5293. case 2:
  5294. this.changeSchedule = {
  5295. mode_id: this.currentData.mode_id,
  5296. schedule_type: this.currentData.schedule_type,
  5297. partition_id: this.currentData.partition_id,
  5298. bed_id: this.currentData.bed_id,
  5299. schedule_week: this.currentData.schedule_week,
  5300. partition_type: "",
  5301. };
  5302. if (
  5303. typeof this.partitions[this.currentData.partition_id].jihaos !==
  5304. "undefined"
  5305. ) {
  5306. this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
  5307. } else {
  5308. this.jihaos = [];
  5309. }
  5310. const params = {
  5311. type: this.currentData.schedule_type,
  5312. date: this.currentData.schedule_date,
  5313. };
  5314. getUrgentScheduleInitData(params)
  5315. .then((response) => {
  5316. if (response.data.state == 0) {
  5317. this.$message.error(response.data.msg);
  5318. } else {
  5319. if (response.data.state == 1) {
  5320. this.origin_schedules = response.data.data.schedules;
  5321. this.origin_device_numbers =
  5322. response.data.data.device_numbers;
  5323. var zone_device_map = {};
  5324. for (
  5325. let index = 0;
  5326. index < this.origin_device_numbers.length;
  5327. index++
  5328. ) {
  5329. const device_number = this.origin_device_numbers[index];
  5330. if (
  5331. zone_device_map[device_number.zone_name] == null ||
  5332. zone_device_map[device_number.zone_name] == undefined
  5333. ) {
  5334. zone_device_map[device_number.zone_name] = [];
  5335. }
  5336. zone_device_map[device_number.zone_name].push(
  5337. device_number
  5338. );
  5339. }
  5340. this.zone_device_map = zone_device_map;
  5341. this.zone_names = Object.keys(this.zone_device_map);
  5342. if (this.zone_names.length > 0) {
  5343. this.zone_name = this.zone_names[0];
  5344. this.current_devices = this.zone_device_map[this.zone_name];
  5345. this.device_id = this.current_devices[0].id;
  5346. }
  5347. this.zone_device_options = [
  5348. { values: this.zone_names },
  5349. // { values: this.getDeviceNumberNames(this.current_devices) },
  5350. { values: this.current_devices },
  5351. ];
  5352. //
  5353. // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
  5354. // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
  5355. // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
  5356. // this.origin_device_numbers.splice(y, 1)
  5357. // }
  5358. // }
  5359. // }
  5360. // // debugger
  5361. // var zone_device_map = {}
  5362. // for (let index = 0; index < this.origin_device_numbers.length; index++) {
  5363. // const device_number = this.origin_device_numbers[index]
  5364. // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
  5365. // zone_device_map[device_number.zone.name] = []
  5366. // }
  5367. // zone_device_map[device_number.zone.name].push(device_number)
  5368. // }
  5369. // this.zone_device_map = zone_device_map
  5370. //
  5371. // this.zone_names = Object.keys(this.zone_device_map)
  5372. // if (this.zone_names.length > 0) {
  5373. // this.zone_name = this.zone_names[0]
  5374. // this.current_devices = this.zone_device_map[this.zone_name]
  5375. // this.device_id = this.current_devices[0].id
  5376. // }
  5377. //
  5378. // this.zone_device_options = [
  5379. // { values: this.zone_names },
  5380. // // { values: this.getDeviceNumberNames(this.current_devices) },
  5381. // { values: this.current_devices }
  5382. // ]
  5383. } else {
  5384. }
  5385. }
  5386. })
  5387. .catch((err) => {
  5388. this.$message.error(err);
  5389. });
  5390. this.tzDialogVisible = false;
  5391. this.jhDialogVisible = true;
  5392. break;
  5393. case 3:
  5394. this.changeSchedule = {
  5395. mode_id: "",
  5396. schedule_type: "",
  5397. partition_id: "",
  5398. bed_id: "",
  5399. schedule_week: "",
  5400. partition_type: "",
  5401. };
  5402. this.tzDialogVisible = false;
  5403. this.msDialogVisible = true;
  5404. break;
  5405. default:
  5406. break;
  5407. }
  5408. },
  5409. setScheduleTwo(id_two) {
  5410. console.log("1112222222",this.currentData.contagions.length)
  5411. var that = this;
  5412. // var submitFlag = true;
  5413. // if (this.currentData.patient_id <= 0) {
  5414. // this.$message.error("请先选择患者");
  5415. // return false;
  5416. // }
  5417. // if (
  5418. // this.currentData.schedule_date.length == 0 ||
  5419. // this.currentData.schedule_type < 1 ||
  5420. // this.currentData.schedule_type > 3 ||
  5421. // this.currentData.bed_id < 1 ||
  5422. // this.currentData.partition_id < 1 ||
  5423. // this.currentData.schedule_week < 1 ||
  5424. // this.currentData.schedule_week > 7
  5425. // ) {
  5426. // this.$message.error("请先选择排班时间或机号");
  5427. // return false;
  5428. // }
  5429. // 可能
  5430. // 患者有传染病,与选择的机器类型(传染病)不匹配
  5431. // 患者没有传染病,但机器是某个传染病的专用透析器
  5432. // 机器的透析模式与患者不匹配
  5433. if (this.currentData.contagions.length > 0) {
  5434. var cflag = false;
  5435. this.currentData.contagions.forEach(function (contagion) {
  5436. if (contagion.disease_id == that.currentData.partition_type) {
  5437. cflag = true;
  5438. }
  5439. });
  5440. if (!cflag) {
  5441. this.$confirm(
  5442. "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
  5443. "提示",
  5444. {
  5445. confirmButtonText: "确 定",
  5446. cancelButtonText: "取 消",
  5447. type: "warning",
  5448. }
  5449. )
  5450. .then(() => {
  5451. this.CreateScheduleTwo(
  5452. this.currentData.patient_id,
  5453. this.currentData,
  5454. id_two
  5455. );
  5456. this.dialogTableVisible=false
  5457. })
  5458. .catch(() => {
  5459. this.dialogTableVisible=false
  5460. });
  5461. } else {
  5462. this.CreateScheduleTwo(this.currentData.patient_id, this.currentData,id_two);
  5463. }
  5464. } else if (that.currentData.partition_type > 1) {
  5465. this.$confirm(
  5466. "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
  5467. "提示",
  5468. {
  5469. confirmButtonText: "确 定",
  5470. cancelButtonText: "取 消",
  5471. type: "warning",
  5472. }
  5473. )
  5474. .then(() => {
  5475. this.CreateScheduleTwo(this.currentData.patient_id, this.currentData,id_two);
  5476. })
  5477. .catch(() => {});
  5478. } else {
  5479. this.CreateScheduleTwo(this.currentData.patient_id, this.currentData,id_two);
  5480. }
  5481. },
  5482. // 排班成功调用的方法
  5483. setSchedule() {
  5484. console.log("6666969696969699",this.currentData.contagions.length)
  5485. var that = this;
  5486. // var submitFlag = true;
  5487. // if (this.currentData.patient_id <= 0) {
  5488. // this.$message.error("请先选择患者");
  5489. // return false;
  5490. // }
  5491. // if (
  5492. // this.currentData.schedule_date.length == 0 ||
  5493. // this.currentData.schedule_type < 1 ||
  5494. // this.currentData.schedule_type > 3 ||
  5495. // this.currentData.bed_id < 1 ||
  5496. // this.currentData.partition_id < 1 ||
  5497. // this.currentData.schedule_week < 1 ||
  5498. // this.currentData.schedule_week > 7
  5499. // ) {
  5500. // this.$message.error("请先选择排班时间或机号");
  5501. // return false;
  5502. // }
  5503. // 可能
  5504. // 患者有传染病,与选择的机器类型(传染病)不匹配
  5505. // 患者没有传染病,但机器是某个传染病的专用透析器
  5506. // 机器的透析模式与患者不匹配
  5507. if (this.currentData.contagions.length > 0) {
  5508. var cflag = false;
  5509. this.currentData.contagions.forEach(function (contagion) {
  5510. console.log("woowowowowowow",that.currentData.partition_type)
  5511. if (contagion.disease_id == that.currentData.partition_type) {
  5512. cflag = true;
  5513. }
  5514. });
  5515. if (!cflag) {
  5516. this.$confirm(
  5517. "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
  5518. "提示",
  5519. {
  5520. confirmButtonText: "确 定",
  5521. cancelButtonText: "取 消",
  5522. type: "warning",
  5523. }
  5524. )
  5525. .then(() => {
  5526. this.CreateSchedule(
  5527. this.currentData.patient_id,
  5528. this.currentData
  5529. );
  5530. this.dialogTableVisible=false
  5531. })
  5532. .catch(() => {
  5533. this.dialogTableVisible=false
  5534. });
  5535. } else {
  5536. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  5537. }
  5538. } else if (that.currentData.partition_type > 1) {
  5539. this.$confirm(
  5540. "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
  5541. "提示",
  5542. {
  5543. confirmButtonText: "确 定",
  5544. cancelButtonText: "取 消",
  5545. type: "warning",
  5546. }
  5547. )
  5548. .then(() => {
  5549. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  5550. })
  5551. .catch(() => {
  5552. this.dialogTableVisible=false
  5553. });
  5554. } else {
  5555. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  5556. }
  5557. },
  5558. // 选择周次
  5559. weekType(weekTime) {
  5560. var theType = 2;
  5561. switch (weekTime) {
  5562. case "lastWeek":
  5563. theType = 1;
  5564. break;
  5565. case "thisWeek":
  5566. theType = 2;
  5567. break;
  5568. case "nextWeek":
  5569. theType = 3;
  5570. break;
  5571. case "nextTwoWeek":
  5572. theType = 4;
  5573. break;
  5574. default:
  5575. theType = 2;
  5576. break;
  5577. }
  5578. return theType;
  5579. },
  5580. // 选择早中晚
  5581. dayType(theType) {
  5582. var jType = "";
  5583. switch (theType) {
  5584. case 1:
  5585. jType = "上午";
  5586. break;
  5587. case 2:
  5588. jType = "下午";
  5589. break;
  5590. case 3:
  5591. jType = "晚上";
  5592. break;
  5593. default:
  5594. break;
  5595. }
  5596. return jType;
  5597. },
  5598. weekPath(week, schedule_type) {
  5599. var weekArr = {
  5600. 1: "Mon",
  5601. 2: "Tue",
  5602. 3: "Wed",
  5603. 4: "Thurs",
  5604. 5: "Fri",
  5605. 6: "Sat",
  5606. 7: "Sun",
  5607. };
  5608. var typeArr = { 1: "M", 2: "A", 3: "N" };
  5609. if (
  5610. typeof weekArr[week] === "undefined" ||
  5611. typeof typeArr[schedule_type] === "undefined"
  5612. ) {
  5613. return [];
  5614. }
  5615. return [weekArr[week], typeArr[schedule_type]];
  5616. },
  5617. weekDay(prop) {
  5618. var week = prop.split("_");
  5619. if (week.length != 2) {
  5620. return [-1, -1];
  5621. }
  5622. var w = -1;
  5623. var n = -1;
  5624. switch (week[0]) {
  5625. case "Mon":
  5626. w = 1;
  5627. break;
  5628. case "Tue":
  5629. w = 2;
  5630. break;
  5631. case "Wed":
  5632. w = 3;
  5633. break;
  5634. case "Thurs":
  5635. w = 4;
  5636. break;
  5637. case "Fri":
  5638. w = 5;
  5639. break;
  5640. case "Sat":
  5641. w = 6;
  5642. break;
  5643. case "Sun":
  5644. w = 7;
  5645. break;
  5646. default:
  5647. w = -1;
  5648. break;
  5649. }
  5650. switch (week[1]) {
  5651. case "M":
  5652. n = 1;
  5653. break;
  5654. case "A":
  5655. n = 2;
  5656. break;
  5657. case "N":
  5658. n = 3;
  5659. break;
  5660. default:
  5661. n = -1;
  5662. break;
  5663. }
  5664. if (w == -1 || n == -1) {
  5665. return [-1, -1];
  5666. }
  5667. return [w, n];
  5668. },
  5669. // 左侧搜索
  5670. search: function () {
  5671. if (this.keywords.length == 0) {
  5672. this.patientList = this.all_patients;
  5673. } else {
  5674. this.patientList = [];
  5675. console.log("this.all_patients",this.all_patients)
  5676. for (let i = 0; i < this.all_patients.length; i++) {
  5677. if (
  5678. this.all_patients[i].name.indexOf(this.keywords) != -1 ||
  5679. this.all_patients[i].dialysis_no.indexOf(this.keywords) != -1
  5680. || this.all_patients[i].first_letter.indexOf(this.keywords) != -1
  5681. ) {
  5682. this.patientList.push(this.all_patients[i]);
  5683. }
  5684. }
  5685. if (this.patientList.length > 0) {
  5686. this.cur_info.patient_name = this.patientList[0].name;
  5687. this.cur_info.mode_name = this.modes[0].name;
  5688. this.cur_info.patient_id = this.patientList[0].id;
  5689. this.cur_info.mode_id = this.modes[0].id;
  5690. this.$refs.patient_table.setCurrentRow(this.patientList[0]);
  5691. this.$refs.mode_table.setCurrentRow(this.modes[0]);
  5692. }
  5693. }
  5694. },
  5695. getDialysisDate: function (row) {
  5696. let week = "";
  5697. switch (row.schedule_week) {
  5698. case 7:
  5699. week = "周日";
  5700. break;
  5701. case 1:
  5702. week = "周一";
  5703. break;
  5704. case 2:
  5705. week = "周二";
  5706. break;
  5707. case 3:
  5708. week = "周三";
  5709. break;
  5710. case 4:
  5711. week = "周四";
  5712. break;
  5713. case 5:
  5714. week = "周五";
  5715. break;
  5716. case 6:
  5717. week = "周六";
  5718. break;
  5719. }
  5720. return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
  5721. },
  5722. getSchedulesType: function (type) {
  5723. let type_name = "";
  5724. switch (type) {
  5725. case 1:
  5726. type_name = "上午";
  5727. break;
  5728. case 2:
  5729. type_name = "下午";
  5730. break;
  5731. case 3:
  5732. type_name = "晚上";
  5733. break;
  5734. }
  5735. return type_name;
  5736. },
  5737. changeMode: function (index, row) {
  5738. this.changeSchedule = {
  5739. mode_id: "",
  5740. schedule_type: "",
  5741. partition_id: "",
  5742. bed_id: "",
  5743. schedule_week: "",
  5744. partition_type: "",
  5745. };
  5746. this.currentData.id = row.id;
  5747. this.searchTableVisible = false;
  5748. this.msDialogVisible = true;
  5749. },
  5750. // 行的 className 的回调方法添加颜色
  5751. tableRowClassName({ row, rowIndex}) {
  5752. if (row.zone_type == 1) {
  5753. return "table-row-new-class schedule-table-row ";
  5754. } else {
  5755. return "table-row-new-class schedule-table-row infectious";
  5756. };
  5757. //
  5758. },
  5759. // 分区接口
  5760. getAllZones() {
  5761. getAllZones().then((response) => {
  5762. if (response.data.state == 1) {
  5763. var zones = response.data.data.zones;
  5764. for (let i = 0; i < zones.length; i++) {
  5765. this.zoneIdList.push(zones[i].id);
  5766. }
  5767. this.zones.push(...zones);
  5768. console.log("zoneswoowowow",this.zones)
  5769. var strArr = this.zoneIdList.join(",");
  5770. this.strArr = strArr;
  5771. var device_number = response.data.data.devicenumber
  5772. this.numberList = []
  5773. this.numberList = device_number
  5774. console.log("所有床位",device_number)
  5775. this.getWeekPanels();
  5776. }
  5777. });
  5778. },
  5779. // 分区选择框
  5780. changePartiton(val) {
  5781. this.$emit("event1", val);
  5782. this.partition_id = val;
  5783. this.getWeekPanels();
  5784. this.getSchedules();
  5785. },
  5786. changeSchedule_type(val) {
  5787. this.$emit("event2", val);
  5788. this.schedule_type = val;
  5789. this.getSchedules();
  5790. },
  5791. changeWeekDay(val){
  5792. this.$emit("event3", val);
  5793. }
  5794. },
  5795. components: {
  5796. ScheduleItem,
  5797. draggable,
  5798. },
  5799. mounted() {
  5800. this.tableContainHeight =
  5801. window.innerHeight - this.$refs.table.$el.offsetTop - 100;
  5802. var theType = this.weekType(this.weekTime);
  5803. this.getSchedules(theType);
  5804. const that = this;
  5805. window.onresize = () => {
  5806. return (() => {
  5807. window.fullHeight = document.documentElement.clientHeight;
  5808. if (window.fullHeight < 200) {
  5809. that.tableHeight = 200;
  5810. } else {
  5811. that.tableHeight = window.fullHeight - 160;
  5812. }
  5813. })();
  5814. };
  5815. },
  5816. created() {
  5817. var date = new Date();
  5818. this.time = date;
  5819. var year = date.getFullYear();
  5820. var month = date.getMonth() + 1;
  5821. if (month < 10) {
  5822. month = "0" + month;
  5823. }
  5824. var day = date.getDate();
  5825. if (day < 10) {
  5826. day = "0" + day;
  5827. }
  5828. var nowDate = year + "-" + month + "-" + day;
  5829. this.systemDate=nowDate
  5830. console.log('当前时间',nowDate);
  5831. var date = new Date(nowDate + " 00:00:00");
  5832. this.now_time = date.getTime() / 1000;
  5833. this.getAllZones();
  5834. this.changeScheduleType(1);
  5835. rowNumber = 0;
  5836. this.modeOptions = this.$store.getters.treatment_mode;
  5837. this.org_id = this.$store.getters.xt_user.org.id;
  5838. this.partitions = this.partitionsProp;
  5839. var contagions = this.$store.getters.contagions;
  5840. if (contagions.length > 0) {
  5841. var that = this;
  5842. contagions.forEach(function (citem) {
  5843. if (citem.type == 2) {
  5844. that.diseasesArr.push({ value: citem.id, label: citem.name });
  5845. }
  5846. });
  5847. }
  5848. this.scheduleZoneRow = this.scheduleZoneRowProp;
  5849. this.weekday = new Date().getDay();
  5850. if (this.weekday == 0) {
  5851. this.weekday = 7;
  5852. }
  5853. },
  5854. };
  5855. </script>
  5856. <style rel="stylesheet/css" lang="scss">
  5857. // 文字禁止选中
  5858. *{
  5859. -webkit-touch-callout:none; /*系统默认菜单被禁用*/
  5860. -webkit-user-select:none; /*webkit浏览器*/
  5861. -khtml-user-select:none; /*早期浏览器*/
  5862. -moz-user-select:none;/*火狐*/
  5863. -ms-user-select:none; /*IE10*/
  5864. user-select:none;
  5865. }
  5866. input{
  5867. -webkit-user-select:auto; /*webkit浏览器*/
  5868. }
  5869. textarea{
  5870. -webkit-user-select:auto; /*webkit浏览器*/
  5871. }
  5872. .table_contain {
  5873. display: flex;
  5874. height: 90vh;
  5875. // justify-content: space-between;
  5876. .left_contain {
  5877. width: 14%;
  5878. margin-right: 15px;
  5879. .patient_mode {
  5880. display: flex;
  5881. justify-content: space-between;
  5882. .highlight{
  5883. background-color: #ecf5ff !important;
  5884. color: #3a8ee6;
  5885. }
  5886. .touxi_cishu{
  5887. display: inline-block;
  5888. border: 1px solid #409eff;
  5889. width: 30px;
  5890. text-align: center;
  5891. border-radius: 10px;
  5892. }
  5893. }
  5894. .el-table td .cell,.el-table th .cell {
  5895. padding: 0 0px ;
  5896. }
  5897. .el-table {
  5898. font-size: 12px !important;
  5899. }
  5900. }
  5901. .right_contain {
  5902. width: 86%;
  5903. .el-table .cell{
  5904. white-space: pre-wrap;
  5905. padding: 0px 0px !important;
  5906. }
  5907. .schedule-table-row td .cell:hover {
  5908. background: #3a8ee6 !important;
  5909. }
  5910. }
  5911. .select_list {
  5912. text-align: right;
  5913. margin-bottom: 15px;
  5914. .el-select {
  5915. width: 13%;
  5916. }
  5917. }
  5918. }
  5919. .tiaozhengclass {
  5920. display: block;
  5921. margin: 0 auto;
  5922. }
  5923. .schedule-table-row {
  5924. background: #fff !important;
  5925. }
  5926. .schedule-table-row:hover {
  5927. background: #fff !important;
  5928. }
  5929. .schedule-table-row td:hover {
  5930. background: #3a8ee6 !important;
  5931. }
  5932. .schedule-table-row td .cell {
  5933. font-size: 12px;
  5934. white-space: normal !important;
  5935. }
  5936. // .el-table--medium td, .el-table--medium th {
  5937. // padding: 5px 0 !important;
  5938. // }
  5939. // 动态样式
  5940. .schedule-table-cell-disable {
  5941. background-color: rgb(245, 245, 245) !important;
  5942. }
  5943. #edit_table_data {
  5944. // min-height: calc(100vh - 350px);
  5945. position: fixed;
  5946. top: 0;
  5947. right: 0;
  5948. bottom: 0;
  5949. left: 0;
  5950. overflow: auto;
  5951. margin: 0;
  5952. background: #fff;
  5953. padding: 20px;
  5954. z-index:2000;
  5955. height: 100%;
  5956. }
  5957. #edit_table_data ::-webkit-scrollbar {
  5958. height: 15px;
  5959. }
  5960. .el-table td,
  5961. .el-table th.is-leaf,
  5962. .el-table--border,
  5963. .el-table--group {
  5964. border-color: #d0d3da;
  5965. }
  5966. .el-table--border::after,
  5967. .el-table--group::after,
  5968. .el-table::before {
  5969. background-color: #d0d3da;
  5970. }
  5971. .el-table--border th {
  5972. border-color: #d0d3da;
  5973. }
  5974. .el-table--border td {
  5975. border-color: #d0d3da;
  5976. }
  5977. .el-table td {
  5978. border-color: #d0d3da;
  5979. // color: #3a8ee6;
  5980. }
  5981. #edit_table_data {
  5982. // .el-table__body tr.current-row {
  5983. // background-color: #ecf5ff !important;
  5984. // color: #3a8ee6;
  5985. // }
  5986. .el-table__body tr > td:hover {
  5987. background-color: #3a8ee6 !important;
  5988. color: #fff;
  5989. .del_table_btn {
  5990. visibility: visible;
  5991. }
  5992. }
  5993. .el-table__body tr .hover-td {
  5994. background-color: #3a8ee6 !important;
  5995. color: #fff;
  5996. }
  5997. }
  5998. .infectious {
  5999. color: red !important;
  6000. }
  6001. // .border_bott{
  6002. // border-left: 1px solid aqua !important;
  6003. // border-right: 1px solid aqua !important;
  6004. // }
  6005. // .border_left{
  6006. // border-left: 1px solid aqua !important;
  6007. // }
  6008. // .evening_border{
  6009. // border-right: 1px solid aqua !important;
  6010. // }
  6011. .Infectious_disease{
  6012. background-color: red !important;
  6013. color: white;
  6014. }
  6015. .del_table_btn {
  6016. position: absolute;
  6017. right: 0px;
  6018. top: -3px;
  6019. visibility: hidden;
  6020. .el-button {
  6021. width: 15px;
  6022. height: 15px;
  6023. padding: 0px;
  6024. }
  6025. }
  6026. .mode_change {
  6027. .el-dialog {
  6028. .el-dialog__footer {
  6029. text-align: center;
  6030. }
  6031. }
  6032. }
  6033. </style>
  6034. <style scoped>
  6035. .itxst {
  6036. margin: 10px;
  6037. text-align: left;
  6038. }
  6039. .col {
  6040. width: 40%;
  6041. flex: 1;
  6042. padding: 10px;
  6043. border: solid 1px #eee;
  6044. border-radius: 5px;
  6045. float: left;
  6046. }
  6047. .col + .col {
  6048. margin-left: 10px;
  6049. }
  6050. .item_touz {
  6051. width: 115px;
  6052. padding: 6px 5px;
  6053. margin: 0px 5px ;
  6054. border: solid 1px #eee;
  6055. background-color: #409eff;
  6056. text-align: left;
  6057. color: #fff;
  6058. }
  6059. .item_touz + .item_touz {
  6060. border-top: none;
  6061. margin-top: 6px;
  6062. }
  6063. .item_touz:hover {
  6064. background-color: #5695d4;
  6065. cursor: move;
  6066. }
  6067. .item2 {
  6068. padding: 6px 12px;
  6069. margin: 0px 10px 0px 10px;
  6070. border: solid 1px #eee;
  6071. background-color: pink;
  6072. text-align: left;
  6073. }
  6074. .item2 + .item2 {
  6075. border-top: none;
  6076. margin-top: 6px;
  6077. }
  6078. .item2:hover {
  6079. outline: solid 1px #ddd;
  6080. cursor: move;
  6081. }
  6082. .select_list_arrage {
  6083. width: 105px !important;
  6084. }
  6085. .checkSearch{
  6086. position: absolute;
  6087. top: 15px;
  6088. right: 120px;
  6089. }
  6090. </style>