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

editTableData.vue 188KB

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