123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063 |
- <template>
- <!-- <div> -->
- <!-- 编辑排班 -->
- <div id="edit_table_data" v-show="schedulingTableVisible" >
- <slot></slot>
- <div class="table_contain">
- <!-- 左侧 -->
- <div class="left_contain">
- <div class="cell clearfix"
- v-if="
- weekTime == 'thisWeek' ||
- weekTime == 'nextWeek' ||
- weekTime == 'nextTwoWeek'
- ">
- <el-input
- size="small"
- style="width: 160px"
- class="filter-item"
- v-model.trim="keywords"
- placeholder="病人名称/透析号"
- @keyup.enter.native="search"
- />
- <el-button
- size="small"
- class="filter-item"
- type="primary"
- icon="el-icon-search"
- @click="search"
- >搜索</el-button>
-
- </div>
- <div style="margin-bottom: 10px; display: flex">
- <h3 style="line-height: 45px">
- <span
- style="margin-right: 10px; font-size: 16px; white-space: nowrap"
- >当前选择</span
- >
- </h3>
- <div style="line-height: 30px">
- <!-- 拖拽dragstart -->
- <div
- draggable="true"
- class="item_touz"
- style="font-weight: bolder"
- @dragstart="curInfoDragStart()"
- >
- <span>{{ cur_info.patient_name }}</span>
-
- <span>{{ cur_info.mode_name }}</span>
- </div>
- </div>
- </div>
- <div class="patient_mode">
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="patientList"
- height='600'
- border
- @row-click="patientClick"
- :cell-class-name="patientClass"
- ref="patient_table"
- style="width: 100%; margin-right: 14px ;"
- >
- <el-table-column
- label="患者名称"
- align="center"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.is_infectious == 2" style="color: red;">{{scope.row.name }}</span>
- <span v-if="scope.row.is_infectious != 2" >
- {{scope.row.name }}
- </span>
- <!-- <span class="touxi_cishu" @click="chishuclick(scope.row.name)">
- 0/4
- </span> -->
- </template>
- </el-table-column>
- </el-table>
-
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="modes"
- height="600"
- :cell-class-name="dialysis_patient"
- ref="mode_table"
- @row-click="modeClick"
- border
- style="width: 100%;"
- >
- <el-table-column
- prop="name"
- label="透析模式"
- align="center"
- ></el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 右侧 -->
- <div class="right_contain">
- <span>日期:</span>
- <el-select v-model="week_type" style="margin-bottom: 15px;" placeholder="请选择" multiple>
- <el-option
- @change="changeWeekDay"
- v-for="(item, index) in week_zhongwens"
- :key="index"
- :label="item"
- :value="item"
- >
- </el-option>
- </el-select>
-
- <span>分区:</span>
- <!-- 下拉框 -->
- <el-select
- v-model="partition_id"
- multiple
- placeholder="请选择"
- @change="changePartiton"
- >
- <el-option
- v-for="item in this.zones"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <!-- 显示透析模式开关 -->
- <el-switch
- v-model="modename_value"
- :active-value=true
- active-text="显示透析模式"
- @change="switchMode(modename_value)">
- </el-switch>
- <!-- 编辑排班表格 -->
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- // border: '1px solid aqua',
- }"
- v-loading="loading"
- element-loading-text="拼命加载中"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)"
- :fit="true"
- :data="scheduleZone"
- @cell-click="clickThis"
- @cell-mouse-enter="hoverMouse"
- @cell-dblclick="dblclickThis"
- :span-method="objectSpanMethod"
- :summary-method="getSummaries"
- :cell-class-name="cellClass"
- :row-class-name="tableRowClassName"
- show-summary
- sum-text="总数"
- height="calc(100% - 50px)"
- ref="table"
- style="table-layout: fixed;"
- >
- <!-- :cell-style ='cellstyle' :height="tableContainHeight" calc(100% - 50px) 600-->
- <el-table-column
- prop="area"
- label="分区"
- min-width="60"
- align="center"
- fixed
-
- ></el-table-column>
- <el-table-column
- prop="cut"
- label="机号"
- min-width="50"
- align="center"
- fixed
-
- ></el-table-column>
- <el-table-column
- :label="'周一 (' + weekTitle[0] + ')'"
- v-if="isShowOne"
- align="center"
- >
- <el-table-column prop="Mon_M" label="上" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <!-- 排班表取消排班按钮 v-if="showclickIcon==true&&scope.row.id==rowid"-->
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Mon_M)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Mon_M',
- scope.row.index,
- scope.row.Mon_M,
- scope.row
- )"
- @dragover="allowDrop"
- @dragover.prevent
- >
- <schedule-item
- :schedule-detail="scope.row.Mon_M"
- :draggable="isEditForDate('Mon_M')&& scope.row.Mon_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Mon_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Mon_M',
- scope.row.index,
- scope.row.Mon_M,
- scope.row
- )"
- :schedulMode="modename_value">
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Mon_A" label="下" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Mon_A)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
-
- <div
- @drop="
- drop(
- $event,
- 'Mon_A',
- scope.row.index,
- scope.row.Mon_A,
- scope.row
- )"
- @dragover="allowDrop"
- @dragover.prevent
- >
- <schedule-item
- :schedule-detail="scope.row.Mon_A"
- :draggable="isEditForDate('Mon_A')&&scope.row.Mon_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Mon_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Mon_A',
- scope.row.index,
- scope.row.Mon_A,
- scope.row
- )"
- :schedulMode="modename_value"
- >
- <!-- -->
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Mon_N" label="晚" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Mon_N)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Mon_N',
- scope.row.index,
- scope.row.Mon_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Mon_N"
- :draggable="isEditForDate('Mon_N') && scope.row.Mon_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Mon_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Mon_N',
- scope.row.index,
- scope.row.Mon_N,
- scope.row
- )"
- :schedulMode="modename_value"
- >
- <!-- -->
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周二 (' + weekTitle[1] + ')'"
- v-if="isShowTwo"
- align="center"
- >
- <el-table-column prop="Tue_M" label="上" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Tue_M)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Tue_M',
- scope.row.index,
- scope.row.Tue_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Tue_M"
- :draggable="isEditForDate('Tue_M')&&scope.row.Tue_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Tue_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Tue_M',
- scope.row.index,
- scope.row.Tue_M,
- scope.row
- )"
- :schedulMode="modename_value"
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Tue_A" label="下" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Tue_A)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Tue_A',
- scope.row.index,
- scope.row.Tue_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Tue_A"
- :draggable="isEditForDate('Tue_A')&&scope.row.Tue_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Tue_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Tue_A',
- scope.row.index,
- scope.row.Tue_A,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Tue_N" label="晚" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Tue_N)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Tue_N',
- scope.row.index,
- scope.row.Tue_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Tue_N"
- :draggable="isEditForDate('Tue_N')&&scope.row.Tue_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Tue_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Tue_N',
- scope.row.index,
- scope.row.Tue_N,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周三 (' + weekTitle[2] + ')'"
- v-if="isShowThree"
- align="center"
- >
- <el-table-column prop="Wed_M" label="上" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Wed_M)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Wed_M',
- scope.row.index,
- scope.row.Wed_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedulMode="modename_value"
- :schedule-detail="scope.row.Wed_M"
- :draggable="isEditForDate('Wed_M')&&scope.row.Wed_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Wed_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Wed_M',
- scope.row.index,
- scope.row.Wed_M,
- scope.row
- )
- "
-
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Wed_A" label="下" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Wed_A)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Wed_A',
- scope.row.index,
- scope.row.Wed_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Wed_A"
- :draggable="isEditForDate('Wed_A')&&scope.row.Wed_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Wed_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Wed_A',
- scope.row.index,
- scope.row.Wed_A,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Wed_N" label="晚" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Wed_N)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Wed_N',
- scope.row.index,
- scope.row.Wed_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Wed_N"
- :draggable="isEditForDate('Wed_N')&&scope.row.Wed_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Wed_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Wed_N',
- scope.row.index,
- scope.row.Wed_N,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周四 (' + weekTitle[3] + ')'"
- align="center"
- v-if="isShowFour"
- >
- <el-table-column prop="Thurs_M" label="上" min-width="50" align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Thurs_M)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Thurs_M',
- scope.row.index,
- scope.row.Thurs_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Thurs_M"
- :draggable="isEditForDate('Thurs_M')&&scope.row.Thurs_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Thurs_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Thurs_M',
- scope.row.index,
- scope.row.Thurs_M,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Thurs_A"
- label="下"
- min-width="50"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Thurs_A)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Thurs_A',
- scope.row.index,
- scope.row.Thurs_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Thurs_A"
- :draggable="isEditForDate('Thurs_A')&&scope.row.Thurs_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Thurs_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Thurs_A',
- scope.row.index,
- scope.row.Thurs_A,
- scope.row
-
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Thurs_N"
- label="晚"
- min-width="50"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Thurs_N)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Thurs_N',
- scope.row.index,
- scope.row.Thurs_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Thurs_N"
- :draggable="isEditForDate('Thurs_N')&&scope.row.Thurs_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Thurs_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Thurs_N',
- scope.row.index,
- scope.row.Thurs_N,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周五 (' + weekTitle[4] + ')'"
- align="center"
- v-if="isShowFive"
- >
- <el-table-column prop="Fri_M" label="上" min-width="50" align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Fri_M)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event,
- 'Fri_M',
- scope.row.index,
- scope.row.Fri_M,
- scope.row)"
- @dragover="allowDrop"
- >
-
- <schedule-item
- :schedule-detail="scope.row.Fri_M"
- :draggable="isEditForDate('Fri_M')&&scope.row.Fri_M ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Fri_M ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Fri_M',
- scope.row.index,
- scope.row.Fri_M,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Fri_A" label="下" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Fri_A)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
-
- <div @drop="
- drop($event,
- 'Fri_A',
- scope.row.index,
- scope.row.Fri_A,
- scope.row)"
- @dragover="allowDrop">
- <schedule-item
- :schedule-detail="scope.row.Fri_A"
- :draggable="isEditForDate('Fri_A')&&scope.row.Fri_A ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Fri_A ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Fri_A',
- scope.row.index,
- scope.row.Fri_A,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Fri_N" label="晚" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Fri_N)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Fri_N',
- scope.row.index,
- scope.row.Fri_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Fri_N"
- :draggable="isEditForDate('Fri_N')&&scope.row.Fri_N ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Fri_N ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Fri_N',
- scope.row.index,
- scope.row.Fri_N,
- scope.row
- )
- "
- :schedulMode="modename_value"
- >
- </schedule-item
- >
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周六 (' + weekTitle[5] + ')'"
-
- align="center"
- v-if="isShowSix"
- >
- <el-table-column prop="Sat_M" label="上" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sat_M)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sat_M',
- scope.row.index,
- scope.row.Sat_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sat_M"
- :draggable="isEditForDate('Sat_M')&&scope.row.Sat_M ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sat_M ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sat_M',
- scope.row.index,
- scope.row.Sat_M,
- scope.row
- )
- "
- :schedulMode="modename_value"
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Sat_A" label="下" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sat_A)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sat_A',
- scope.row.index,
- scope.row.Sat_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sat_A"
- :draggable="isEditForDate('Sat_A')&&scope.row.Sat_A ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sat_A ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sat_A',
- scope.row.index,
- scope.row.Sat_A,
- scope.row
- )
- "
- :schedulMode="modename_value"
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Sat_N" label="晚" min-width="50" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sat_N)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sat_N',
- scope.row.index,
- scope.row.Sat_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sat_N"
- :draggable="isEditForDate('Sat_N')&&scope.row.Sat_N ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sat_N ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sat_N',
- scope.row.index,
- scope.row.Sat_N,
- scope.row
- )
- "
- :schedulMode="modename_value"
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周日 (' + weekTitle[6] + ')'"
- align="center"
- v-if="isShowSeven"
- >
- <el-table-column
- prop="Sun_M"
- label="上"
- min-width="50"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sun_M)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sun_M',
- scope.row.index,
- scope.row.Sun_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :draggable="isEditForDate('Sun_M')&&scope.row.Sun_M ? 'true' : 'false'"
- :schedule-detail="scope.row.Sun_M"
-
- class="contitem"
- :style="{ cursor: scope.row.Sun_M ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sun_M',
- scope.row.index,
- scope.row.Sun_M,
- scope.row
- )"
- :schedulMode="modename_value"
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Sun_A"
- label="下"
- min-width="50"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sun_A)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sun_A',
- scope.row.index,
- scope.row.Sun_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sun_A"
- :draggable="isEditForDate('Sun_A')&&scope.row.Sun_A ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sun_A ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sun_A',
- scope.row.index,
- scope.row.Sun_A,
- scope.row
- )
- "
- :schedulMode="modename_value"
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Sun_N"
- label="晚"
- min-width="50"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sun_N)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sun_N',
- scope.row.index,
- scope.row.Sun_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sun_N"
- :draggable="isEditForDate('Sun_N')&&scope.row.Sun_N ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sun_N ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sun_N',
- scope.row.index,
- scope.row.Sun_N,
- scope.row
- )
- "
- :schedulMode="modename_value"
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- prop="total"
- label="合计"
- width="30"
- align="center"
- >
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 单击排班表格的空白单元格弹窗 -->
- <el-dialog
- title="排班"
- :visible.sync="dialogTableVisible"
- width="1000px;"
- :v-model="dialog"
- v-loading="creating_schedule"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- <div class="cell clearfix">
- <label class="title"><span class="name">当前排班</span> : </label>
- <div class="time">
- <ul class="">
- <span class="current"
- >日期 : {{ currentData.schedule_date }} 班次 :
- {{ currentData.type_name }} 病房 :
- {{ currentData.zone_name }} 透析机 :
- {{ currentData.bed_name }}
- </span>
- </ul>
- </div>
- </div>
-
- <div class="cell clearfix">
- <label class="title"><span class="name">患者搜索</span> : </label>
- <div class="time">
- <ul class="">
- <el-input
- size="medium"
- v-model="searchKey"
- placeholder="请输入搜索的内容"
- style="width: 260px"
- @keyup.enter.native="SubmitSearch"
- ></el-input>
- <el-button
- type="primary"
- icon="el-icon-search"
- @click="SubmitSearch"
- >搜索</el-button
- >
- </ul>
- </div>
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">排班</span> : </label>
- <div class="time">
- <ul class="">
- <li
- v-for="item in schedulArr"
- @click="changeSearchSchedule(item.value)"
- :key="item.value"
- :class="patientQuery.schedule == item.value ? 'active' : ''"
- >
- {{ item.label }}
- </li>
- </ul>
- </div>
- </div>
- <!-- <div class="cell clearfix">
- <label class="title"><span class="name">标签</span> : </label>
- <div class="time ">
- <ul class="">
- <li v-for="item in tagArr" :key="item.value" >{{item.label}}</li>
- </ul>
- </div>
- </div> -->
- <div class="cell clearfix">
- <label class="title"><span class="name">传染病</span> : </label>
- <div class="time">
- <ul class="">
- <li
- v-for="item in diseasesArr"
- @click="changeSearchContagion(item.value)"
- :key="item.value"
- :class="patientQuery.contagion == item.value ? 'active' : ''"
- >
- {{ item.label }}
- </li>
- </ul>
- </div>
- </div>
- </div>
- <el-table
- ref="singleTable"
- :data="patients"
- border
- highlight-current-row
- @current-change="handleCurrentChange"
- :header-cell-style="{ backgroundColor: 'rgb(236, 245, 255)' }"
- >
- <el-table-column
- type="index"
- label="序号"
- width="89"
- align="center"
- ></el-table-column>
- <el-table-column
- property="dialysis_no"
- label="透析号"
- min-width="110"
- align="center"
- ></el-table-column>
- <el-table-column
- property="name"
- label="姓名"
- min-width="110"
- align="center"
- ></el-table-column>
- <el-table-column
- property="schedules"
- label="双周已排"
- min-width="80"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.schedules.length }}次</span>
- </template>
- </el-table-column>
- <el-table-column
- property="solutions"
- label="治疗频率"
- min-width="200"
- align="center"
- >
- <template slot-scope="scope">
- <span v-for="solution in scope.row.solutions" :key="solution.id"
- >{{ solution.name }}({{ solution.period }}{{ solution.times }})
- </span>
- </template>
- </el-table-column>
- <el-table-column
- property="sch_remark"
- label="备注"
- min-width="200"
- align="center"
- >
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogTableVisible=false">取 消</el-button>
- <!-- closePatientPanel -->
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="setSchedule"
- >保 存
- </el-button>
- </div>
- </el-dialog>
-
- <el-dialog
- title="调整排班"
- :visible.sync="tzDialogVisible"
- width="500px"
- class="mode_change"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
-
- <div style="width: 100%; margin: 0 auto; text-align: center">
- <!-- <el-radio-group v-model="tiaoZhengType" :class="tiaozhengclass">
- <el-radio :label="1">取消排班</el-radio>
- <el-radio :label="2">调整机号</el-radio>
- <el-radio :label="3">调整模式</el-radio>
- </el-radio-group> -->
-
- <span>调整模式:</span>
- <el-select v-model="value" placeholder="请选择">
- <el-option
- v-for="item in mode_select"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
-
-
- </div>
- <span slot="footer" class="dialog-footer" style="text-align: center">
- <el-button
- @click="
- tzDialogVisible = false;
- tiaoZhengType = 1;
- "
- >取 消</el-button
- >
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitTiaoX"
- >
- <span v-if="tiaoZhengType == 1">保存</span>
- <span v-if="tiaoZhengType == 2">下一步</span>
- <span v-if="tiaoZhengType == 3">下一步</span>
- </el-button>
- </span>
- </el-dialog>
-
- <!-- 双击弹窗 -->
- <el-dialog
- title="调整模式"
- :visible.sync="msDialogVisible"
- width="500px"
- v-loading="changing_mode"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- <el-form
- :model="changeSchedule"
- ref="changeSchedule"
- :rules="changeRules"
- >
- <el-form-item label="" prop="mode_id">
- <span>透析模式:</span>
- <el-select
- filterable
- v-model="changeSchedule.mode_id"
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- :disabled="item.id == currentData.mode_id"
- v-for="item in modeOptions"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
-
- <!-- <el-form-item>
- <span>透析班次:</span>
- <el-select
- filterable
- v-model="changeSchedule.schedule_type"
- placeholder="请选择"
- style="width: 100%"
- @change="changeScheduleType"
- >
- <el-option
- v-for="item in scheduleType"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
-
- <el-form-item>
- <span>透析分区:</span>
- <el-select
- filterable
- v-model="changeSchedule.partition_id"
- placeholder="请选择"
- style="width: 100%"
- @change="changePartitionOne"
- >
- <el-option
- v-for="(item, index) in zones"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
-
- <el-form-item>
- <span>透析床位:</span>
- <el-select
- filterable
- v-model="changeSchedule.bed_id"
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- v-for="item in numberList"
- :key="item.id"
- :label="item.number"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item> -->
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="msDialogVisible = false">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitMode('changeSchedule')"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <!--调整机号 -->
- <el-dialog
- title="调整机号"
- :visible.sync="jhDialogVisible"
- width="500px"
- v-loading="changing_bed"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- <el-form
- :model="changeSchedule"
- ref="changeSchedule"
- :rules="changeRules"
- label-width="90px"
-
- >
- <el-form-item label="排班日期: ">
- <el-input v-model="currentData.schedule_date" disabled></el-input>
- </el-form-item>
- <el-form-item label="班次: " prop="schedule_type">
- <el-select
- v-model="changeSchedule.schedule_type"
- placeholder="请选择"
- style="width: 100%"
- @change="changeScheduleType"
- >
- <el-option
- v-for="item in scheduleType"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="分区: " prop="partition_id">
- <el-select
- v-model="zone_name"
- placeholder="请选择"
- style="width: 100%"
- @change="changePartition"
- >
- <el-option
- v-for="(item, index) in zone_names"
- :key="index"
- :label="item"
- :value="item"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="透析机: " prop="bed_id">
- <el-select
- v-model="device_id"
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- v-for="item in current_devices"
- :key="item.id"
- :label="item.number"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="jhDialogVisible = false">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitTiaoZJH('changeSchedule')"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <!-- 智能排班弹窗 -->
- <el-dialog
- class="samrt_arrage"
- :title="`智能排班 (姓名:${
- this.cur_smart_patient_name ? this.cur_smart_patient_name : ''
- } 透析号:${
- this.cur_smart_patient_no ? this.cur_smart_patient_no : ''
- })`"
- width="900px"
- :visible.sync="smartVisible"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model.trim="smart_keyword"
- :fetch-suggestions="querySearchAsync"
- placeholder="病人透析号/姓名"
- @select="handleSelect"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.name }}</div>
- </template>
- </el-autocomplete>
-
- <el-tabs v-model="editableTabsValue" type="card" @tab-click="handleClick">
- <el-tab-pane
- :key="item.name"
- v-for="(item, index) in editableTabs"
- :label="item.title"
- :name="item.name"
- >
- <el-table v-loading="dataloading" border :data="item.tableWeekArrage" style="width: 100%">
- <!-- 自定义表结构 -->
- <el-table-column
- label="星期"
- prop="week"
- align="center"
- width="100"
- >
- </el-table-column>
- <el-table-column align="left">
- <template slot="header" slot-scope="scope">
- <el-checkbox-group
- v-model="item.checkedWeek"
- @change="select_week"
- >
- <el-checkbox
- v-for="(i, index) in weeks"
- :label="i"
- :key="index"
- :value="i"
- :disabled="!i.is_edit"
- >
- {{ i.name }}
- </el-checkbox>
- </el-checkbox-group>
- </template>
- <template slot-scope="scope">
- <div>
- <span>模式:</span>
- <el-select
- v-model="scope.row.mode_id"
- placeholder="请选择"
- size="mini"
- :disabled="!scope.row.is_edit"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in modes"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>班次:</span
- ><el-select
- v-model="scope.row.sch_type"
- placeholder="请选择"
- :disabled="!scope.row.is_edit"
- @change="changeSch(scope.row)"
- size="mini"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in teem_sel"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>分区:</span
- ><el-select
- v-model="scope.row.zone_id"
- placeholder="请选择"
- :disabled="!scope.row.is_edit"
- @change="changeArea(scope.row)"
- size="mini"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in partitionsProp"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>机号:</span
- ><el-select
- v-model="scope.row.jihao_id"
- placeholder="请选择"
- :disabled="!scope.row.is_edit"
- size="mini"
- @click.native="blurclick(scope.row)"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in scope.row.jihaos"
- :key="index"
- :label="item.number"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- <span slot="footer" class="dialog-footer">
- <el-button @click="cancel">取 消</el-button>
- <el-button type="primary" v-loading="saveloading" @click="batchSetSch"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <!-- 排班替换/交换提示弹窗 -->
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisible"
- width="300px"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- 所选位置已有排班,请选择操作
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="danger"
- @click="tipDialogVisibleTwo = true"
- >替换</el-button>
- <el-button
- type="primary"
- @click="tipDialogVisibleThree = true"
- >交换</el-button>
- <el-button @click="tipDialogVisible = false">取 消</el-button>
- </span>
- </el-dialog>
- <!-- 排班替换 -->
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisibleTwo"
- width="300px"
- class="replace"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- 是否将此位置排班替换
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- @click="coverSch()"
- >确定</el-button>
-
- <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
- </span>
- </el-dialog>
- <!-- 将此位置排班互换 -->
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisibleThree"
- width="300px"
- class="exchange"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- 是否将此位置排班互换
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- @click="changeSchTwo()"
- >确定</el-button>
- <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
- </span>
- </el-dialog>
- <!-- 显示透析日期的弹窗 -->
- <el-dialog
- :title="'患者信息(姓名:'+Dialysis_patient+'、透析号:'+20011120+')'"
- :visible.sync="cishu_dialogVisible"
- width="50%"
- :modal-append-to-body='false'
- :close-on-click-modal="false">
- <div>
- <div style="line-height: 40px;">
- 透析频率:HD(每周2次)
- </div>
- <div style="line-height: 40px;">
- 已排详情
- </div>
- <div>
- <el-calendar>
- <!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
- <template
- slot="dateCell"
- slot-scope="{date, data}">
- <P v-if="data.day.split('-').slice(1).join('-')=='11-27'"
- style="background: red;color: white;text-align: center;">
- HD
- </P>
- <p :class="data.isSelected ? 'is-selected' : ''" style="text-align: center;">
- {{ data.day.split('-').slice(2).join('-') }} {{ data.isSelected ? '✔️' : ''}}<br/>
- <span v-if="data.day.split('-').slice(1).join('-')=='11-27'">上午 门诊</span>
- </p>
-
- </template>
- </el-calendar>
- </div>
- </div>
- </el-dialog>
-
- </div>
- </template>
-
-
- <script>
- import { uParseTime } from "@/utils/tools";
- import print from "print-js";
- import draggable from "vuedraggable";
- const moment = require("moment");
- import {
- PostSearchSmartSchPatient,
- getSmartDevices,
- getSmartSchByPatient,
- CoverSch,
- ExchangeSch,
- getPatientSmartSch,
- BatchSmartSch,
-
- } from "@/api/schedule_template/sch_template";
- import {
- CancelScheduleTwo,
- CancelSchedule,
- ChangeSchedule,
- CreateSchedule,
- CreateScheduleTwo,
- getSchedulePatients,
- getSchedulesOne,
- getSearchResult,
- getUrgentScheduleInitData,
- getWeekPanelsOne,
- getAllZones,
- ChangeScheduleTen,
- getNumberList
- } from "@/api/schedule";
- import ScheduleItem from "./ScheduleItem";
-
- const weekOptions = [
- {
- name: "周一",
- week_type: 1,
- is_edit: true,
- },
- {
- name: "周二",
- week_type: 2,
- is_edit: true,
- },
- {
- name: "周三",
- week_type: 3,
- is_edit: true,
- },
- {
- name: "周四",
- week_type: 4,
- is_edit: true,
- },
- {
- name: "周五",
- week_type: 5,
- is_edit: true,
- },
- {
- name: "周六",
- week_type: 6,
- is_edit: true,
- },
- {
- name: "周日",
- week_type: 7,
- is_edit: true,
- },
- ];
- let rowNumber = 0;
- export default {
- name: "editTableData",
- props: {
- // 选择的周次
- weekTime: {
- type: String,
- default: "thisWeek",
- },
- scheduleZoneRowProp: {
- type: Array,
- dafault: [],
- },
- partitionsProp: {
- type: Object,
- dafault: {},
- },
- },
-
- data() {
- return {
- schedulingTableVisible:true,//全屏
- tipDialogVisibleTwo:false,
- tipDialogVisibleThree:false,
- cishu_dialogVisible:false,//透析次数
- modename_value:true,//关闭透析模式开关
- Dialysis_patient:'',
- cur_date:"",
- loading:false,//加载
- dataloading:false,
- current_patient_data:[],
- week_zhongwens: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
- week_type: "",
- saveloading: false,
- zones: [],
- weeks: weekOptions,
- first_weeks:[],
- smart_keyword: "",
- cur_smart_patient_id: 0,
- cur_smart_patient_name: "",
- cur_smart_patient_no: "",
- all_zones: [],
- // 周次
- editableTabs: [
- {
- checkedWeek: [],
- title: "本周",
- name: "1",
- tableWeekArrage: [],
- weeks:[],
- },
- {
- checkedWeek: [],
- title: "下周",
- name: "2",
- tableWeekArrage: [],
- weeks:[],
-
- },
- {
- checkedWeek: [],
- title: "下下周",
- name: "3",
- tableWeekArrage: [],
- weeks:[],
-
- },
- ],
-
- mode_sel: ["HDF"],
- teem_sel: [
- { name: "上午", id: 1 },
- { name: "下午", id: 2 },
- { name: "晚上", id: 3 },
- ],
- region_sel: ["A区"],
- equip_sel: ["1号"],
- checkedWeek: [], //默认选中那些星期,如不需要可去掉
- week: weekOptions,
- editableTabsValue: "1",
- smartVisible: false,
- cur_drag_obj:1, //當前拖拽對象,用來區分病人列表那的當前選擇和表格内的拖拽對象,1.病人列表,2.表格内的
- //拖拽的元素内容
- cur_drag_info: {
- patient_name: "",
- patient_id: "",
- mode_name: "",
- mode_id: "",
- schedule_date:"",
- schedule_type:"",
- bed_id:"",
- partition_id:"",
- schedule_week:"",
- type_name:"",
- zone_name:"",
- bed_name:"",
- id:"",
- contagions:[],
- },
- // 左侧患者名称表格数据
- cur_info: {
- patient_name: "",
- patient_id: 0,
- mode_name: "",
- mode_id: 0,
- contagions:[],
- },
- // 左侧透析模式
- modes: [],
- patientList: [],
- all_patients: [],
- systemDate:'',
-
- mode_select: [
- {
- value: "1",
- label: "模式一",
- },
- {
- value: "选2",
- label: "模式二",
- },
- {
- value: "3",
- label: "模式三",
- },
- ],
- value: "",
- patient_pre: [],
- // tableContainHeight:600,
- // tableHeight:'window.innerHeight - 0',
- // rowClass: "table-row-new-class schedule-table-row",
- searchKey: "",
- tiaoZhengType: 1,
- modeOptions: null,
- keywords: "",
- schedulePatients: [],
- searchTableVisible: false,
- tipDialogVisible:false,
- dialog: {
- tag: "",
- },
- patients: [],
- toDay: "",
- schedulArr: [
- { value: 0, label: "不限" },
- { value: 2, label: "未排班" },
- { value: 1, label: "已排班" },
- ],
- tagArr: [
- { value: 1, label: "不限" },
- { value: 2, label: "透析记录" },
- { value: 3, label: "传染病" },
- ],
- diseasesArr: [{ value: 0, label: "不限" }],
- scheduleType: [
- { id: 1, name: "上午" },
- { id: 2, name: "下午" },
- { id: 3, name: "晚上" },
- ],
- dialogTableVisible: false,
- tzDialogVisible: false,
- msDialogVisible: false,
- jhDialogVisible: false,
- // scheduleZone: this.scheduleZoneProp,
- scheduleZoneRow: -1,
- partitions: [],
- partitions_two: [],
- jihaos_two: [],
- subzone:[],
- jihaos: [],
- weekTitle: ["", "", "", "", "", "", ""],
- isShowOne: true,
- isShowTwo: true,
- isShowThree: true,
- isShowFour: true,
- isShowFive: true,
- isShowSix: true,
- isShowSeven: true,
- weekList: ["", "", "", "", "", "", ""],
- weekDays: ["", "", "", "", "", "", ""],
- currentData: {
- id: 0,
- schedule_date: "",
- schedule_type: 0,
- bed_id: 0,
- partition_id: 0,
- patient_id: 0,
- schedule_week: 0,
- mode_id: 0,
- type_name: "",
- bed_name: "",
-
- partition_type: 0,
- contagions: [],
- patient: "",
- },
- // 弹窗数据
- changeSchedule: {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: "",
- },
- patientQuery: {
- keywords: "",
- schedule: 0,
- contagion: 0,
- },
-
- tiaozhengclass: "tiaozhengclass",
- changeRules: {
- mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
- schedule_type: [
- { required: true, message: "请选择班次", trigger: "blur" },
- ],
- partition_id: [
- { required: true, message: "请选择病房", trigger: "blur" },
- ],
- bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }],
- },
-
- weekday: 0,//星期几
-
- creating_schedule: false,
- changing_mode: false,
- changing_bed: false,
- current_all_sch: [],
-
- delete_all_sch:[],
- src_all_sch:[],
-
- tableHeight: document.documentElement.clientHeight,
- patient_selc: {},
- origin_schedules: [],
- origin_device_numbers: [],
- zone_device_map: {},
- device_id: 0,
- zone_name: "",
- current_devices: [],
- zone_names: [],
- zone_device_options: [],
- options: [
- { id: 0, name: "全部" },
- { id: 1, name: "上午" },
- { id: 2, name: "下午" },
- { id: 3, name: "晚上" },
- ],
- partition_id: 0,
- schedule_type: "",
-
- smart_jihaos: [
- {
- name: "1号机",
- id: "1",
- },
- {
- name: "2号机",
- id: "2",
- },
- ],
- theType: "",
- scheduleZone: [],
- days: [],
- theWeek: {
- lastWeek: 0,
- thisWeek: 0,
- nextWeek: 0,
- nextTwoWeek: 0,
- },
- zoneIdList: [],
- strArr: "",
- patient_id_hover: 0,//高亮id
- // Mouse_id_hover:0,
- now_time: "",
- activeItem: {
- day: null,
- index: null,
- name: null,
- },
- cellflag: 0,
- schedulesGroup:[],
- numberList:[],
- newschedules:[],
- newArr:[],
- count_num:null
- };
- },
-
- watch: {
- week_type: function () {
- this.isShowOne = false;
- this.isShowTwo = false;
- this.isShowThree = false;
- this.isShowFour = false;
- this.isShowFive = false;
- this.isShowSix = false;
- this.isShowSeven = false;
- if (this.week_type.length > 0) {
- for (let i = 0; i < this.week_type.length; i++) {
- if (this.week_type[i] == "周一") {
- this.isShowOne = true;
- } else if (this.week_type[i] == "周二") {
- this.isShowTwo = true;
- } else if (this.week_type[i] == "周三") {
- this.isShowThree = true;
- } else if (this.week_type[i] == "周四") {
- this.isShowFour = true;
- } else if (this.week_type[i] == "周五") {
- this.isShowFive = true;
- } else if (this.week_type[i] == "周六") {
- this.isShowSix = true;
- } else if (this.week_type[i] == "周日") {
- this.isShowSeven = true;
- }
- }
- } else {
- this.isShowOne = true;
- this.isShowTwo = true;
- this.isShowThree = true;
- this.isShowFour = true;
- this.isShowFive = true;
- this.isShowSix = true;
- this.isShowSeven = true;
- }
- },
-
- weekTime: function () {
- var theType = this.weekType(this.weekTime);
- this.theType = theType;
- this.getSchedules();
- },
- scheduleZoneRow: function () {
- var theType = this.weekType(this.weekTime);
- this.theType = theType;
- this.getSchedules();
- },
- tableHeight(val) {
- if (!this.timer) {
- this.tableHeight = val;
- this.timer = true;
- const that = this;
- setTimeout(function () {
- that.timer = false;
- }, 400);
- }
- },
- },
- methods: {
- // 关闭透析模式
- switchMode(flag){
- console.log(flag);
- },
- // 透析次数
- chishuclick(row){
- this.cishu_dialogVisible=true
- console.log('ddddddd',row);
- this.Dialysis_patient=row
- },
-
- changeSch(row) {
- let params = {
- zone_id: row.zone_id,
- sch_type: row.sch_type,
- schedule_date: row.schedule_date,
- patient_id: this.cur_smart_patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.ihaos = [];
- row.jihaos = devices;
- if (devices && devices.length > 0) {
- row.jihao_id = devices[0].id;
- } else {
- row.jihao_id = "";
- }
- }
- });
- },
- // 智能排班机号
- blurclick(row) {
- let params = {
- zone_id: row.zone_id,
- sch_type: row.sch_type,
- schedule_date: row.schedule_date,
- patient_id: this.cur_smart_patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.jihaos = [];
- row.jihaos = devices;
- }
- });
-
- },
- changeArea(row) {
- let params = {
- zone_id: row.zone_id,
- sch_type: row.sch_type,
- schedule_date: row.schedule_date,
- patient_id: this.cur_smart_patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.jihaos = [];
- row.jihaos = devices;
- if (devices && devices.length > 0) {
- row.jihao_id = devices[0].id;
- } else {
- row.jihao_id = "";
- }
- }
- });
- },
- handleClick() {
- if (this.editableTabsValue == "1") {
-
- console.log(this.first_weeks)
- console.log(this.weeks)
-
-
- for (let i = 0; i < this.weeks.length; i++) {
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
- if (this.weeks[i].week_type >= day) {
- this.weeks[i].is_edit = true;
- } else {
- this.weeks[i].is_edit = false;
- }
- }
-
- for(let i = 0; i < this.weeks.length; i++){
- for(let b = 0; b < this.first_weeks.length; b++){
- if(this.weeks[i].week_type == this.first_weeks[b].week_type && this.first_weeks[b].order_id > 0){
- console.log(this.weeks[i].week_type)
- console.log(this.first_weeks[b].week_type)
- console.log(this.first_weeks[b].order_id)
-
- this.weeks[i].is_edit = false
- }
-
- }
- }
- } else {
- for (let i = 0; i < this.weeks.length; i++) {
- this.weeks[i].is_edit = true;
- }
- }
- },
- getWeekByzhongwen(week_str) {
- switch (week_str) {
- case "周一":
- return 1;
- break;
- case "周二":
- return 2;
- break;
- case "周三":
- return 3;
- break;
- case "周四":
- return 4;
- break;
- case "周五":
- return 5;
- break;
- case "周六":
- return 6;
- break;
- case "周日":
- return 7;
- break;
- }
- },
- cancel() {
- this.smartVisible = false;
- this.smart_keyword = "";
- },
- batchSetSch() {
- var saveOrEditTempData = [];
- var delTempData = [];
-
- var day = new Date().getDay();
- if (day == 0) {
- day = 7;
- }
-
- for (let b = 0; b < this.editableTabs[0].tableWeekArrage.length; b++) {
- //只有大于等于今天的数据才能保存和没有上机的
- if (
- this.getWeekByzhongwen(
- this.editableTabs[0].tableWeekArrage[b].week
- ) >= day &&
- this.editableTabs[0].tableWeekArrage[b].is_edit
- ) {
- let obj = {
- schedule_date:
- this.editableTabs[0].tableWeekArrage[b].schedule_date,
- schedule_type: this.editableTabs[0].tableWeekArrage[b].sch_type,
- bed_id: this.editableTabs[0].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.editableTabs[0].tableWeekArrage[b].week
- ),
- mode_id: this.editableTabs[0].tableWeekArrage[b].mode_id,
- sch_id: this.editableTabs[0].tableWeekArrage[b].sch_id,
- zone_id: this.editableTabs[0].tableWeekArrage[b].zone_id,
- week_type: "1",
- week_name: this.editableTabs[0].tableWeekArrage[b].week,
- };
- saveOrEditTempData.push(obj);
- }
- }
- for (let b = 0; b < this.editableTabs[1].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.editableTabs[1].tableWeekArrage[b].schedule_date,
- schedule_type: this.editableTabs[1].tableWeekArrage[b].sch_type,
- bed_id: this.editableTabs[1].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.editableTabs[1].tableWeekArrage[b].week
- ),
- mode_id: this.editableTabs[1].tableWeekArrage[b].mode_id,
- sch_id: this.editableTabs[1].tableWeekArrage[b].sch_id,
- zone_id: this.editableTabs[1].tableWeekArrage[b].zone_id,
- week_type: "2",
- week_name: this.editableTabs[1].tableWeekArrage[b].week,
- };
- saveOrEditTempData.push(obj);
- }
- for (let b = 0; b < this.editableTabs[2].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.editableTabs[2].tableWeekArrage[b].schedule_date,
- schedule_type: this.editableTabs[2].tableWeekArrage[b].sch_type,
- bed_id: this.editableTabs[2].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.editableTabs[2].tableWeekArrage[b].week
- ),
- mode_id: this.editableTabs[2].tableWeekArrage[b].mode_id,
- sch_id: this.editableTabs[2].tableWeekArrage[b].sch_id,
- zone_id: this.editableTabs[2].tableWeekArrage[b].zone_id,
- week_type: "3",
- week_name: this.editableTabs[2].tableWeekArrage[b].week,
- };
-
- saveOrEditTempData.push(obj);
- }
-
- //原始数据,用来与智能排版的数据进行比对,查出有排班记录,取消勾选的数据,作为删除的数据,提交给后端
-
- for (let b = 0; b < this.current_patient_data[0].tableWeekArrage.length; b++) {
- //只有大于等于今天的数据才能保存和没有上机的
- if (
- this.getWeekByzhongwen(
- this.current_patient_data[0].tableWeekArrage[b].week
- ) >= day &&
- this.current_patient_data[0].tableWeekArrage[b].is_edit
- ) {
- let obj = {
- schedule_date:
- this.current_patient_data[0].tableWeekArrage[b].schedule_date,
- schedule_type: this.current_patient_data[0].tableWeekArrage[b].sch_type,
- bed_id: this.current_patient_data[0].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.current_patient_data[0].tableWeekArrage[b].week
- ),
- mode_id: this.current_patient_data[0].tableWeekArrage[b].mode_id,
- sch_id: this.current_patient_data[0].tableWeekArrage[b].sch_id,
- zone_id: this.current_patient_data[0].tableWeekArrage[b].zone_id,
- week_type: "1",
- week_name: this.current_patient_data[0].tableWeekArrage[b].week,
- };
- delTempData.push(obj);
- }
- }
- for (let b = 0; b < this.current_patient_data[1].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.current_patient_data[1].tableWeekArrage[b].schedule_date,
- schedule_type: this.current_patient_data[1].tableWeekArrage[b].sch_type,
- bed_id: this.current_patient_data[1].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.current_patient_data[1].tableWeekArrage[b].week
- ),
- mode_id: this.current_patient_data[1].tableWeekArrage[b].mode_id,
- sch_id: this.current_patient_data[1].tableWeekArrage[b].sch_id,
- zone_id: this.current_patient_data[1].tableWeekArrage[b].zone_id,
- week_type: "2",
- week_name: this.current_patient_data[1].tableWeekArrage[b].week,
- };
- delTempData.push(obj);
- }
- for (let b = 0; b < this.current_patient_data[2].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.current_patient_data[2].tableWeekArrage[b].schedule_date,
- schedule_type: this.current_patient_data[2].tableWeekArrage[b].sch_type,
- bed_id: this.current_patient_data[2].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.current_patient_data[2].tableWeekArrage[b].week
- ),
- mode_id: this.current_patient_data[2].tableWeekArrage[b].mode_id,
- sch_id: this.current_patient_data[2].tableWeekArrage[b].sch_id,
- zone_id: this.current_patient_data[2].tableWeekArrage[b].zone_id,
- week_type: "3",
- week_name: this.current_patient_data[2].tableWeekArrage[b].week,
- };
- delTempData.push(obj);
- }
-
-
- console.log(saveOrEditTempData)
- console.log(delTempData)
-
-
- if(saveOrEditTempData.length > 0 ){
- for (let i = 0; i < delTempData.length; i++) {
- for (let b = 0; b < saveOrEditTempData.length; b++) {
- if(saveOrEditTempData[b].sch_id&&delTempData[i].sch_id&&delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
- delTempData.splice(i,1)
- }
- }
- }
-
- }
- for (let i = 0; i < saveOrEditTempData.length; i++) {
- if (saveOrEditTempData[i].bed_id == "" || saveOrEditTempData[i].zone_id == "") {
- this.$message.error("分区或者床位不能空");
- return;
- }
- }
-
-
- if (saveOrEditTempData.length > 0 || delTempData.length > 0) {
-
- let obj = {
- smart_schs: saveOrEditTempData,
- del_schs:delTempData,
- };
- if(!this.saveloading){
- this.saveloading = true;
- BatchSmartSch(obj, this.cur_smart_patient_id).then((response) => {
- if (response.data.state == 1) {
- this.saveloading = false;
-
- this.$message.success("保存成功");
- this.smartVisible = false;
- this.smart_keyword = "";
- this.getSchedules();
- } else {
- this.saveloading = false;
- this.smart_keyword = "";
-
- this.$message.error(response.data.msg);
- return;
- }
- });
-
-
- }
-
- } else {
- this.$message.success("保存成功");
- }
- var week = this.weekDay(day);
- if (week[0] == -1 || week[1] == -1) {
- return false;
- }
- if (this.toDay > this.weekDays[week[0] - 1]) {
- return false;
- }
- this.currentData.schedule_date = this.weekDays[week[0] - 1];
- this.currentData.schedule_type = week[1];
- this.currentData.bed_id = row.jihao_id;
- this.currentData.partition_id = row.zone_id;
- this.currentData.schedule_week = week[0];
- this.currentData.type_name = this.dayType(week[1]);
- this.currentData.zone_name = row.area;
- this.currentData.bed_name = row.cut;
- this.currentData.partition_type = row.zone_type;
- this.currentData.mode_id = this.cur_info.mode_id;
- this.currentData.id = 0;
- this.currentData.contagions = this.cur_info.contagions;
- this.currentData.patient_id = this.cur_info.patient_id;
- this.currentData.patient = this.cur_info.patient_name;
- this.setSchedule()
- },
- querySearchAsync(keyword, cb) {
- let key = "";
- if (keyword != undefined) {
- key = keyword;
- }
- let searchArray = [];
- let obj = {
- keyword: key,
- };
- PostSearchSmartSchPatient(obj).then((response) => {
- if (response.data.state == 1) {
- searchArray = response.data.data.patient;
- cb(searchArray);
- } else {
- cb([]);
- }
- });
- },
- getTime(value, temp) {
- if (value != undefined) {
- return uParseTime(value, temp);
- }
- return "";
- },
- handleSelect(val) {
- this.first_weeks = []
- this.dataloading = true
- getSmartSchByPatient(val.id).then((response) => {
- this.dataloading = false
- var sch = response.data.data.sch
- this.editableTabsValue = "1";
- this.editableTabs[0].tableWeekArrage = [];
- this.editableTabs[1].tableWeekArrage = [];
- this.editableTabs[2].tableWeekArrage = [];
- this.editableTabs[0].checkedWeek = [];
- this.editableTabs[1].checkedWeek = [];
- this.editableTabs[2].checkedWeek = [];
-
- var tempDate = new Date();
- var day = tempDate.getDay();
-
- if (day == 0) {
- day = 7;
- }
- this.smart_keyword = val.name;
- this.cur_smart_patient_id = val.id;
- this.cur_smart_patient_name = val.name;
- this.cur_smart_patient_no = val.dialysis_no;
- //过滤出当前患者所有排班信息,填充对应的数据到智能排班列表
- //根据患者的排班日期判断属于本周还是下周还是下下周
- for (let i = 0; i < sch.length; i++) {
- var week_type = this.getWeekType(
- this.getTime(sch[i].schedule_date, "{y}-{m}-{d}")
- );
-
- switch (week_type) {
- case "1":
- var obj = {
- mode_id: sch[i].mode_id,
- sch_type: sch[i].schedule_type,
- zone_id: sch[i].partition_id,
- jihao_id:sch[i].bed_id,
- is_edit: false,
- week: this.getWeek(sch[i].schedule_week),
- jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
- schedule_date: this.getDate(sch[i].schedule_week),
- sch_id: sch[i].id,
- };
- let is_edit = true;
-
-
- if (sch[i].schedule_week < day || sch[i].order.id > 0) {
- is_edit = false;
- } else {
- is_edit = true;
- }
- obj.is_edit = is_edit;
-
- for (let b = 0; b < this.weeks.length; b++) {
-
- if (sch[i].schedule_week == this.weeks[b].week_type) {
- if (
- this.weeks[b].week_type >= day ||
- sch[i].order.id == 0
- ) {
- this.weeks[b].is_edit = true;
- } else {
- let obj = {
- week_type:this.weeks[b].week_type,
- order_id:sch[i].order.id,
- }
- this.first_weeks.push(obj)
- this.weeks[b].is_edit = false;
- }
- this.editableTabs[0].checkedWeek.push(this.weeks[b]);
- }
-
-
-
- }
-
- this.editableTabs[0].tableWeekArrage.push(obj);
- break;
- case "2":
- var obj2 = {
- mode_id: sch[i].mode_id,
- sch_type: sch[i].schedule_type,
- zone_id: sch[i].partition_id,
- jihao_id: sch[i].bed_id,
- is_edit: false,
- week: this.getWeek(sch[i].schedule_week),
- jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
- schedule_date: this.getDate(sch[i].schedule_week + 7),
- sch_id: sch[i].id,
- };
- let is_edit2 = true;
- obj2.is_edit = is_edit2;
-
- // let checkObj2={
- // name:this.getWeek(val.sch[i].schedule_week),
- // week_type:val.sch[i].schedule_week,
- // is_edit:is_edit2
- // }
-
- // this.editableTabs[1].checkedWeek.push(checkObj2)
-
- for (let b = 0; b < this.weeks.length; b++) {
- if (sch[i].schedule_week == this.weeks[b].week_type) {
- // this.weeks[b].is_edit = true;
- this.editableTabs[1].checkedWeek.push(this.weeks[b]);
- }
-
-
- }
-
- this.editableTabs[1].tableWeekArrage.push(obj2);
- break;
-
- case "3":
- let obj3 = {
- mode_id: sch[i].mode_id,
- sch_type: sch[i].schedule_type,
- zone_id: sch[i].partition_id,
- jihao_id: sch[i].bed_id,
- is_edit: false,
- week: this.getWeek(sch[i].schedule_week),
- jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
- schedule_date: this.getDate(sch[i].schedule_week + 14),
- sch_id: sch[i].id,
- };
- let is_edit3 = true;
- obj3.is_edit = is_edit3;
- for (let b = 0; b < this.weeks.length; b++) {
- if (sch[i].schedule_week == this.weeks[b].week_type) {
- // this.weeks[b].is_edit = true;
- this.editableTabs[2].checkedWeek.push(this.weeks[b]);
-
- }
-
-
- }
-
- this.editableTabs[2].tableWeekArrage.push(obj3);
- break;
- }
- }
- if(this.editableTabsValue == "1") {
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
- for (let i = 0; i < this.weeks.length; i++) {
- if (this.weeks[i].week_type < day) {
- this.weeks[i].is_edit = false;
- }
- }
- }
-
- this.src_all_sch = this.editableTabs;
- this.current_patient_data = []
- this.current_patient_data = this.deepClone(this.src_all_sch)
-
- });
-
-
- },
- getDate(week_type) {
-
- switch (week_type) {
- case 1:
- return this.days[0];
- break;
- case 2:
- return this.days[1];
- break;
- case 3:
- return this.days[2];
- break;
- case 4:
- return this.days[3];
- break;
- case 5:
- return this.days[4];
- break;
- case 6:
- return this.days[5];
- break;
- case 7:
- return this.days[6];
- break;
- case 8:
- return this.days[7];
- break;
- case 9:
- return this.days[8];
- break;
- case 10:
- return this.days[9];
- break;
- case 11:
- return this.days[10];
- break;
- case 12:
- return this.days[11];
- break;
- case 13:
- return this.days[12];
- break;
- case 14:
- return this.days[13];
- break;
- case 15:
- return this.days[14];
- break;
- case 16:
- return this.days[15];
- break;
- case 17:
- return this.days[16];
- break;
- case 18:
- return this.days[17];
- break;
- case 19:
- return this.days[18];
- break;
- case 20:
- return this.days[19];
- break;
- case 21:
- return this.days[20];
- break;
- }
- },
- deepClone(source) {
- if (!source && typeof source !== 'object') {
- throw new Error('error arguments', 'shallowClone')
- }
- const targetObj = source.constructor === Array ? [] : {}
- Object.keys(source).forEach((keys) => {
- if (source[keys] && typeof source[keys] === 'object') {
- targetObj[keys] = this.deepClone(source[keys])
- } else {
- targetObj[keys] = source[keys]
- }
- })
- return targetObj
- },
- getWeek(week) {
- switch (week) {
- case 1:
- return "周一";
- break;
- case 2:
- return "周二";
-
- break;
- case 3:
- return "周三";
-
- break;
- case 4:
- return "周四";
-
- break;
- case 5:
- return "周五";
-
- break;
- case 6:
- return "周六";
-
- break;
- case 7:
- return "周日";
-
- break;
- }
- },
- getWeekType(date) {
- let index = 0;
- for (let i = 0; i < this.days.length; i++) {
- if (date == this.days[i]) {
- index = i;
-
- }
- }
-
- if (index >= 0 && index <= 6) {
- return "1";
- } else if (index > 6 && index <= 13) {
- return "2";
- } else if (index > 13 && index <= 20) {
- return "3";
- }
- },
- showSmartDialog() {
- // this.dataloading = true
- this.editableTabsValue = "1";
- // for (let i = 0; i < this.patientList.length; i++) {
- // if (this.patientList[i].id == this.cur_info.patient_id) {
- // this.cur_smart_patient_name = this.patientList[i].name;
- // this.cur_smart_patient_no = this.patientList[i].dialysis_no;
- // this.cur_smart_patient_id = this.patientList[i].id;
- // }
- // }
- //
- // let params = {
- // patient_id: this.cur_info.patient_id,
- // };
- // let data = [
- // {
- // checkedWeek: [],
- // title: "本周",
- // name: "1",
- // tableWeekArrage: [],
- // },
- // {
- // checkedWeek: [],
- // title: "下周",
- // name: "2",
- // tableWeekArrage: [],
- // },
- // {
- // checkedWeek: [],
- // title: "下下周",
- // name: "3",
- // tableWeekArrage: [],
- // },
- // ];
- // this.first_weeks = []
- // getPatientSmartSch(params).then((response) => {
- // if (response.data.state == 0) {
- // return false;
- // }
- // var schedules = response.data.data.schedules;
- // this.dataloading = false
- // this.current_all_sch[0].tableWeekArrage = [];
- // this.current_all_sch[1].tableWeekArrage = [];
- // this.current_all_sch[2].tableWeekArrage = [];
- // this.editableTabs[0].tableWeekArrage = [];
- // this.editableTabs[0].checkedWeek = [];
- // this.editableTabs[1].tableWeekArrage = [];
- // this.editableTabs[1].checkedWeek = [];
- // this.editableTabs[2].tableWeekArrage = [];
- // this.editableTabs[2].checkedWeek = [];
- // var tempDate = new Date();
- // var day = tempDate.getDay();
- // if (day == 0) {
- // day = 7;
- // }
- //
- // for (let i = 0; i < schedules.length; i++) {
- //
- //
- // var week_type = this.getWeekType(
- // this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
- // ).toString();
- //
- // switch (week_type) {
- // case "1":
- // var obj = {
- // mode_id: schedules[i].mode_id,
- // sch_type: schedules[i].schedule_type,
- // zone_id: schedules[i].partition_id,
- // jihao_id: schedules[i].bed_id,
- // is_edit: false,
- // week: this.getWeek(schedules[i].schedule_week),
- // schedule_date: this.getDate(schedules[i].schedule_week),
- // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
- // sch_id: schedules[i].id,
- // };
- // let is_edit = true;
- // if (
- // schedules[i].schedule_week < day ||
- // schedules[i].order.id > 0
- // ) {
- // is_edit = false;
- // } else {
- // is_edit = true;
- // }
- // obj.is_edit = is_edit;
- // console.log("schedules[i].order.id")
- //
- // console.log(schedules[i].order.id)
- //
- // for (let b = 0; b < this.weeks.length; b++) {
- // if (schedules[i].schedule_week == this.weeks[b].week_type) {
- // if (
- // this.weeks[b].week_type >= day &&
- // schedules[i].order.id == 0
- // ) {
- // this.weeks[b].is_edit = true;
- // } else {
- // let obj = {
- // week_type:this.weeks[b].week_type,
- // order_id:schedules[i].order.id,
- // }
- // this.first_weeks.push(obj)
- // this.weeks[b].is_edit = false;
- // }
- //
- // this.editableTabs[0].checkedWeek.push(this.weeks[b]);
- // }
- // }
- // data[0].tableWeekArrage.push(obj);
- //
- // this.editableTabs[0].tableWeekArrage.push(obj);
- // break;
- // case "2":
- // var obj2 = {
- // mode_id: schedules[i].mode_id,
- // sch_type: schedules[i].schedule_type,
- // zone_id: schedules[i].partition_id,
- // jihao_id: schedules[i].bed_id,
- // is_edit: true,
- // week: this.getWeek(schedules[i].schedule_week),
- // schedule_date: this.getDate(schedules[i].schedule_week + 7),
- // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
- // sch_id: schedules[i].id,
- // };
- //
- // for (let b = 0; b < this.weeks.length; b++) {
- // if (schedules[i].schedule_week == this.weeks[b].week_type) {
- // // this.weeks[b].is_edit = true;
- // this.editableTabs[1].checkedWeek.push(this.weeks[b]);
- // }
- // }
- // data[1].tableWeekArrage.push(obj2);
- // this.editableTabs[1].tableWeekArrage.push(obj2);
- // break;
- //
- // case "3":
- // let obj3 = {
- // mode_id: schedules[i].mode_id,
- // sch_type: schedules[i].schedule_type,
- // zone_id: schedules[i].partition_id,
- // jihao_id: schedules[i].bed_id,
- // is_edit: true,
- // week: this.getWeek(schedules[i].schedule_week),
- // schedule_date: this.getDate(schedules[i].schedule_week + 14),
- // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
- // sch_id: schedules[i].id,
- // };
- // for (let b = 0; b < this.weeks.length; b++) {
- // if (schedules[i].schedule_week == this.weeks[b].week_type) {
- // // this.weeks[b].is_edit = true;
- // this.editableTabs[2].checkedWeek.push(this.weeks[b]);
- // }
- // }
- // data[2].tableWeekArrage.push(obj3);
- //
- // this.editableTabs[2].tableWeekArrage.push(obj3);
- // break;
- // }
- // }
- // });
-
- // if(this.editableTabsValue == "1") {
- // var tempDate = new Date();
- // var day = tempDate.getDay();
- // if (day == 0) {
- // day = 7;
- // }
- // for (let i = 0; i < this.weeks.length; i++) {
- // if (this.weeks[i].week_type < day) {
- // this.weeks[i].is_edit = false;
- // }
- // }
- // }
- //
- //
- // for (let i = 0; i < this.editableTabs.length; i++) {
- // for(let b = 0; b < this.editableTabs[i].tableWeekArrage.length;b++){
- // data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
- //
- //
- //
- // }
- // }
- //
- // data.sort(function (a, b) {
- // return a.week_type - b.week_type;
- // });
- //
- //
- //
- // this.current_patient_data = data
- // console.log("current_patient_data")
- // console.log(this.current_patient_data)
-
- this.smartVisible = true;
- // this.current_all_sch = data;
- // this.src_all_sch = data;
-
- },
-
- select_week(val) {
- this.current_all_sch = this.editableTabs
- var sch = [];
- for (let i = 0; i < this.current_all_sch.length; i++) {
- if (this.current_all_sch[i].name == this.editableTabsValue) {
- sch = this.current_all_sch[i];
- }
- }
- let data = [];
- for (let i = 0; i < val.length; i++) {
- let is_new = true;
- let week_name = val[i].name;
-
- let obj = {};
- for (let b = 0; b < sch.tableWeekArrage.length; b++) {
- if (week_name == sch.tableWeekArrage[b].week) {
- is_new = false;
- obj = sch.tableWeekArrage[b];
- }
- }
-
-
- let keyIndex = "";
- for (var key in this.partitionsProp) {
- keyIndex = key;
- }
-
- if (!is_new) {
- data.push(obj);
- } else {
- if (this.editableTabsValue == "2") {
- data.push({
- mode_id: 1,
- week: val[i].name,
- sch_type: 1,
- zone_id: "",
- jihao_id: "",
- is_edit: true,
- schedule_date: this.getDate(val[i].week_type + 7),
- jihaos: [],
- sch_id: 0,
- });
- } else if (this.editableTabsValue == "3") {
- data.push({
- mode_id: 1,
- week: val[i].name,
- sch_type: 1,
- zone_id: "",
- jihao_id: "",
- is_edit: true,
- schedule_date: this.getDate(val[i].week_type + 14),
- jihaos: [],
- sch_id: 0,
- });
- } else {
- data.push({
- mode_id: 1,
- week: val[i].name,
- sch_type: 1,
- zone_id: "",
- jihao_id: "",
- is_edit: true,
- schedule_date: this.getDate(val[i].week_type),
- jihaos: [],
- sch_id: 0,
- });
- }
- }
- }
-
- for (let i = 0; i < data.length; i++) {
- data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
- }
-
- data.sort(function (a, b) {
- return a.week_type - b.week_type;
- });
-
- for (let i = 0; i < this.editableTabs.length; i++) {
- if (this.editableTabs[i].name == this.editableTabsValue) {
- this.editableTabs[i].tableWeekArrage = data;
- }
- }
-
- this.current_all_sch = this.editableTabs
- },
- // 左侧的拖拽内容
- curInfoDragStart(){
- this.cur_drag_obj = 1
- this.cur_drag_info={
- patient_id : this.cur_info.patient_id,
- patient_name : this.cur_info.patient_name,
- mode_id : this.cur_info.mode_id,
- mode_name : this.cur_info.mode_name,
- contagions:this.cur_info.contagions,
- },
- console.log('拖拽的内容',this.cur_drag_info);
- },
- // 左侧选择病人(单击)
- patientClick(row) {
- console.log("row-222--2-2",row)
- this.cur_info.patient_name = row.name;
- this.cur_info.patient_id = row.id;
- var obj = {
- created_time:0,
- disease_id:2,
- id:0,
- patient_id:row.patient_id,
- status:1,
- updated_time:0
- }
- if(row.is_infectious==2){
- this.cur_info.contagions = []
- this.cur_info.contagions.push(obj)
- }else{
- this.cur_info.contagions = []
- }
-
- this.patient_id_hover = row.id
- },
- // 选择透析模式
- modeClick(row) {
- this.cur_info.mode_name = row.name;
- this.cur_info.mode_id = row.id;
- },
- setEditData(patients, modes, days, zones) {
- console.log("patients2oo2o2o2o",patients)
- var date = new Date()
- this.time = date
- var year = date.getFullYear()
- var month = date.getMonth() + 1
- if (month < 10) {
- month = "0" + month
- }
- var day = date.getDate()
- if (day < 10) {
- day = "0" + day
- }
- var nowDate = year + "-" + month + "-" + day
- var date = new Date(nowDate + " 00:00:00")
- this.cur_date = date.getTime()/1000
-
- this.days = days;
- this.all_zones = zones;
- this.patientList = patients;
- this.all_patients = patients;
- for (var key in modes) {
- let obj = {
- id: modes[key].id,
- name: modes[key].name,
- };
- this.modes.push(obj);
- }
- this.cur_info["patient_name"] = this.patientList[0].name;
- this.cur_info["mode_name"] = this.modes[0].name;
- this.cur_info["patient_id"] = this.patientList[0].id;
- this.cur_info["mode_id"] = this.modes[0].id;
- this.patient_id_hover = this.patientList[0].id
- this.$refs.patient_table.setCurrentRow(this.patientList[0]);
- this.$refs.mode_table.setCurrentRow(this.modes[0]);
- for (let i = 0; i < this.weeks.length; i++) {
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
- if (this.weeks[i].week_type >= day) {
- this.weeks[i].is_edit = true;
- } else {
- this.weeks[i].is_edit = false;
- }
- }
-
-
- if (this.partitions_two.length > 0) {
- this.jihaos_two.push(this.partitions_two[0].jihaos);
- }
- },
- // dragstartTwo(event, item) {},
- // dragendTwo(event) {},
-
- isEditForDate(day){
- var week = this.weekDay(day);
- if( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 >= this.cur_date){
- return true
- }else{
- return false
- }
-
- },
- // 鼠标移动
- drag(e, day, index, name, row) {
- e.preventDefault();
- for (var key in row) {
- if (key == day) {
- if(row[key].patient_id > 0){
- this.cur_drag_obj = 2
- var week = this.weekDay(day);
- this.cur_drag_info={
- schedule_date : this.weekDays[week[0] - 1],
- schedule_type : week[1],
- bed_id : row.jihao_id,
- partition_id : row.zone_id,
- schedule_week : week[0],
- type_name : this.dayType(week[1]),
- zone_name : row.area,
- bed_name : row.cut,
- mode_id : row[key].mode_id,
- mode_name : row[key].mode_name,
- patient_name : row[key].patient,
- patient_id : row[key].patient_id,
- id : row[key].schedule_id,
- contagions: row[key].patient_contagions,
- }
- }else{
- this.cur_drag_obj = 3
- this.cur_drag_info={
- schedule_date : '',
- schedule_type : '',
- bed_id : '',
- partition_id : '',
- schedule_week : '',
- type_name : '',
- zone_name : '',
- bed_name : '',
- mode_id : '',
- mode_name : '',
- patient_name : '',
- patient_id : 0,
- id : 0,
- }
- }
- }
- }
- },
-
- // 拖拽
- allowDrop(e) {
- e.preventDefault();
- },
- // 取消排班
- CancelSchedule(id) {
- this.$confirm("确定要取消当前排班?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- CancelSchedule(id).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "排班已取消!",
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: 0,
- mode_id: 0,
- patient_id: 0,
- patient: "",
- mode_name: "",
- dialysis_machine_name: "",
- };
-
- that.scheduleZone[index].total -= 1;
- }
- }
- });
- }
- });
- })
- .catch(() => {});
- },
- // 删除某一单元格内的患者透析排班
- deletePatientMode(row) {
- console.log('12345566',this.cur_drag_info, this.systemDate);
- if (row.schedule_id > 0 && this.cur_drag_info.schedule_date >= this.systemDate) {
- console.log('22222222',this.cur_drag_info.schedule_date >= this.systemDate);
- this.CancelSchedule(row.schedule_id);
- }
- console.log('deletePatientMode',row);
- },
- // 替换
- coverSch(){
- this.tipDialogVisible=false
- let params={
- id_one:this.cur_drag_info.id,
- id_two:this.currentData.id
- }
- CoverSch(params).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.tipDialogVisibleTwo = false
- } else {
- this.$message.success("替换成功");
- this.tipDialogVisible = false
- this.tipDialogVisibleTwo = false
- this.getSchedules();
- }
- });
- },
- // 交换位置
- changeSchTwo(){
- // this.tipDialogVisibleThree = false
- this.tipDialogVisible=false
- let params={
- id_one:this.cur_drag_info.id,
- id_two:this.currentData.id
-
- }
- ExchangeSch(params).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.tipDialogVisibleThree = false
- } else {
- this.$message.success("交换成功");
- this.tipDialogVisible = false
- this.tipDialogVisibleThree = false
- this.getSchedules();
- }
- });
- },
-
- // !在html里面的chedule-item里绑定的| ":draggable"可控制该表格能否拖动,根据实际情况进行修改async
- drop(e, day,index,name, row) {
- this.allowDrop(e)
- for (var key in row) {
- if (key == day) {
- if(this.cur_drag_obj == 3){
- return
- }
- // console.log(this.cur_drag_obj)
- var week = this.weekDay(day);
- this.currentData={
- schedule_date : this.weekDays[week[0] - 1],
- schedule_type : week[1],
- bed_id : row.jihao_id,
- partition_id : row.zone_id,
- schedule_week : week[0],
- type_name : this.dayType(week[1]),
- zone_name : row.area,
- bed_name : row.cut,
- id : row[key].schedule_id,
- partition_type : row.zone_type,
- }
- // let nowDate = new Date();
- // let date = {
- // year: nowDate.getFullYear(),
- // month: nowDate.getMonth() + 1,
- // date: nowDate.getDate(),
- // }
- // let Month=date.month<10 ? '0'+ date.month : date.month
- // let Dateday= date.date<10 ? '0'+date.date : date.date
- // this.systemDate = date.year + '-'+ Month + '-'+ Dateday;
- // console.log('this.currentData的数据',this.currentData);
- // console.log('this.cur_drag_info的数据',this.cur_drag_info);
- // console.log('123453545',this.systemDate);
- // 当表格有数据
- if ( row[key].mode_id > 0 || row[key].patient_id > 0) {
- // 且是表格数据拖拽
- if (this.cur_drag_obj == 2){
- if (row[key].patient_id != this.cur_drag_info.patient_id ) {
- if( this.currentData.schedule_date >= this.systemDate ){
- this.tipDialogVisible = true
- }
- } else {
- this.tipDialogVisible = false
- }
- }else{
- return this.$message.error("当前机号已有排班");
- }
- } else {
- //當前類型是表格内的拖拽,如果是同一天内的表格拖拽到空床位則先刪除原先排版,后在將排班弄到空床位
- //接口提交排班数据
- if(this.cur_drag_obj == 2){
- if(this.cur_drag_info.schedule_date == this.currentData.schedule_date){ //同一天
- if(row[key].patient_id == 0) { //空床位
- const that = this;
- //接口提交排班数据
- that.currentData.mode_id = that.cur_drag_info.mode_id
- that.currentData.id = 0
- that.currentData.patient_id = that.cur_drag_info.patient_id
- that.currentData.patient = that.cur_drag_info.patient_name
- that.currentData.contagions = that.cur_drag_info.contagions
- console.log("中国hshshshshhs",that.cur_drag_info.contagions)
- that.setScheduleTwo(this.cur_drag_info.id);
- }
- }else{ // 非同一天
- if(row[key].patient_id == 0) { //空床位
- this.currentData.mode_id = this.cur_drag_info.mode_id;
- this.currentData.id = 0;
- this.currentData.contagions = this.cur_drag_info.contagions;
- this.currentData.patient_id = this.cur_drag_info.patient_id;
- this.currentData.patient = this.cur_drag_info.patient_name;
- this.setSchedule();
- }
- }
- }else{
- console.log("wowowowowowowowow",this.cur_drag_info)
- //接口提交排班数据
- this.currentData.mode_id = this.cur_drag_info.mode_id;
- this.currentData.id = 0;
- this.currentData.contagions = this.cur_drag_info.contagions;
- this.currentData.patient_id = this.cur_drag_info.patient_id;
- this.currentData.patient = this.cur_drag_info.patient_name;
- this.setSchedule();
- }
- }
- }
- }
- },
-
- // 左边栏选中名字和模式拖动结束后
- taskDraggerEnd(e) {},
- //move回调方法
- onMove(e, originalEvent) {
- return true;
- },
-
- compare(p) {
- //这是比较函数
- return function (m, n) {
- var a = m[p];
- var b = n[p];
- return a - b; //升序
- };
- },
- // 病房病人/时间日期接口
- getWeekPanels() {
- this.scheduleZone = [];
- var partionStr = this.partition_id;
- var arr = this.zoneIdList.join(",");
-
- var str = "";
- if (partionStr == 0) {
- str = arr;
- }
- if (partionStr != 0) {
- str = partionStr.join(",");
- }
-
- getWeekPanelsOne(1, str).then((response) => {
- if (response.data.state == 0) {
- return false;
- }
- var partitions = response.data.data.partitions;
- this.subzone = response.data.data.partitions;
- this.theWeek.thisWeek = response.data.data.theWeek;
-
- this.theWeek.lastWeek = this.theWeek.thisWeek - 1;
- this.theWeek.nextWeek = this.theWeek.thisWeek + 1;
- this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2;
- var that = this;
- if (partitions.length > 0) {
- partitions.forEach(function (partition) {
- if (partition.jihaos.length == 0) {
- return false;
- }
- that.scheduleZoneRow.push(partition.jihaos.length);
-
- that.partitions[partition.id] = partition;
-
- partition.jihaos.forEach(function (jihao) {
- var thisPa = {
- area: partition.name,
- zone_id: partition.id,
- zone_type: partition.type,
- cut: jihao.number,
- jihao_id: jihao.id,
- sort: jihao.sort,
- Mon_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Mon_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Mon_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Tue_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Tue_A: {
- schedule_id: 0,
- mode_id: 0,
- dialysis_machine_name: "",
-
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Tue_N: {
- schedule_id: 0,
- mode_id: 0,
- dialysis_machine_name: "",
-
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Wed_M: {
- schedule_id: 0,
- mode_id: 0,
- dialysis_machine_name: "",
-
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Wed_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- dialysis_machine_name: "",
-
- jihao_id: jihao.id,
- },
- Wed_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- dialysis_machine_name: "",
-
- jihao_id: jihao.id,
- },
- Thurs_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- dialysis_machine_name: "",
-
- jihao_id: jihao.id,
- },
- Thurs_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
-
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Thurs_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
-
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Fri_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Fri_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Fri_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sat_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sat_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sat_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- },
- Sun_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sun_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sun_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- total: 0,
- };
-
- that.scheduleZone.push(thisPa);
- });
- });
- }
-
- this.scheduleZone.sort(this.compare("sort"));
- });
- },
- // 高亮
- hoverMouse(row, column, cell, event) {
- // console.log('sdf12344565');
- // if (row[column.property].schedule_id > 0) {
- // let patient_id = row[column.property].patient_id
- // this.Mouse_id_hover = patient_id
- // // this.cur_info.patient_id = row.id
- // } else {
- // this.Mouse_id_hover = -1
- // }
- },
- // 单元格的 className 的回调方法
- cellClass({ row, column, rowIndex, columnIndex }) {
- // 传染病区机器橙色背景
- if(columnIndex==1&&row.zone_type!=1){
- //
- return "table-row-new-class schedule-table-row Infectious_disease";
- }
- // if(columnIndex==1 ){
- // return 'border_bott '
- // }
- // if(columnIndex==0){
- // return 'border_left'
- // }
- if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
- return "";
- } else {
- if (this.weekTime == "lastWeek") {
- // if(column.label == '晚' ){
- // return 'evening_border schedule-table-cell-disable'
- // }
- if (
- row[column.property].patient_id > 0 &&
- row[column.property].patient_id == this.patient_id_hover
- ) {
- return "hover-td schedule-table-cell-disable";
- } else {
- return "schedule-table-cell-disable";
- }
- // return "schedule-table-cell-disable";
- } else if (this.weekTime == "thisWeek") {
- var weekday = Math.floor((columnIndex - 2) / 3 + 1);
- if (weekday < this.weekday) {
- if (
- row[column.property].patient_id > 0 &&
- row[column.property].patient_id == this.patient_id_hover
- ) {
- return "hover-td schedule-table-cell-disable";
- }
- // if(column.label == '晚'){
- // return 'evening_border schedule-table-cell-disable'
- // }
- return "schedule-table-cell-disable";
- } else {
- // if(column.label == '晚' ){
- // return 'evening_border'
- // }
- if (
- row[column.property].patient_id > 0 &&
- row[column.property].patient_id == this.patient_id_hover
- ) {
- return "hover-td";
- } else {
- return "";
- }
- }
- }else{
- // if(column.label == '晚' ){
- // return 'evening_border '
- // }
- if (
- row[column.property].patient_id > 0 &&
- row[column.property].patient_id == this.patient_id_hover
- ) {
- return "hover-td schedule-table-cell-disable";
- } else {
- return "";
- }
- }
- }
- return "";
- },
- // 单元格的患者名称的回调方法
- patientClass({row,column, rowIndex,columnIndex}){
- if(this.cur_info.patient_id == row.id){
- // console.log('patientClassrowIndex的数据',rowIndex);
- // console.log('row的数据',row);
- return 'highlight'
- }
- },
- // 单元格的透析模式的回调方法
- dialysis_patient({row,column, rowIndex,columnIndex}){
- if(this.cur_info.mode_id == row.id){
- return 'highlight'
- }
- },
- // 单击排班表格的空白单元格弹窗搜索
- SubmitSearch() {
- this.patientQuery.keywords = this.searchKey;
- this.getSchedulePatients();
- },
- // 单击排班表格的空白单元格弹窗选择传染病
- changeSearchContagion(id) {
- this.patientQuery.contagion = id;
- this.getSchedulePatients();
- },
- // 单击排班表格的空白单元格弹窗选择排班
- changeSearchSchedule(id) {
- this.patientQuery.schedule = id;
- this.getSchedulePatients();
- },
- // 计算总数
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0 || index === 25) {
- sums[index] = "总数";
- return;
- }
- if (index === 1 || index === 24) {
- sums[index] = data.length;
- return;
- }
- const values = data.map((item) => item[column.property]);
- if (index === 23) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- return;
- }
- sums[index] = values.reduce((prev, curr) => {
- if (typeof curr["mode_id"] === "undefined") {
- return prev;
- }
- const value = Number(curr["mode_id"]);
- if (!isNaN(value) && value > 0) {
- return prev + 1;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- });
- this.$nextTick(() => {
- this.$refs.table.doLayout();
- });
-
- // 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){
-
- //表格某列全部数据
- var Mon_M = []
- var Mon_A = []
- var Mon_N = []
-
- var Tue_M =[]
- var Tue_A = []
- var Tue_N = []
-
- var Wed_M = []
- var Wed_A = []
- var Wed_N = []
-
- var Thurs_M = []
- var Thurs_A = []
- var Thurs_N = []
-
- var Fri_M = []
- var Fri_A = []
- var Fri_N = []
-
- var Sat_M = []
- var Sat_A = []
- var Sat_N = []
-
- var Sun_M = []
- var Sun_A = []
- var Sun_N = []
-
- // 操作后数据
- var Mon_M_One= []
- var Mon_A_One = []
- var Mon_N_One = []
-
- var Tue_M_One =[]
- var Tue_A_One = []
- var Tue_N_One = []
-
- var Wed_M_One = []
- var Wed_A_One = []
- var Wed_N_One = []
-
- var Thurs_M_One = []
- var Thurs_A_One = []
- var Thurs_N_One = []
-
- var Fri_M_One = []
- var Fri_A_One = []
- var Fri_N_One = []
-
- var Sat_M_One = []
- var Sat_A_One = []
- var Sat_N_One = []
-
- var Sun_M_One = []
- var Sun_A_One = []
- var Sun_N_One= []
-
-
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Mon_A') == true){
- Mon_A.push(data[j].Mon_A.mode_name)
- Mon_A=Mon_A.filter(item=> item && item.trim())//去掉空字符串
- var countNum =Mon_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Mon_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Mon_A_One.length; i < len; i+=29) {
- var strObjcet = Mon_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[3]="总人数:"+ sums[3] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Mon_M') == true){
- Mon_M.push(data[j].Mon_M.mode_name)
- Mon_M=Mon_M.filter(item=> item && item.trim())
- var countNum =Mon_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Mon_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Mon_M_One.length; i < len; i+=29) {
- var strObjcet = Mon_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[2]="总人数:"+ sums[2] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Mon_N') == true){
- Mon_N.push(data[j].Mon_N.mode_name)
- Mon_N=Mon_N.filter(item=> item && item.trim())
- var countNum =Mon_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Mon_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Mon_N_One.length; i < len; i+=29) {
- var strObjcet = Mon_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[4]="总人数:"+ sums[4] +"\n"+result
- // 星期二
- for(let j in data){
- if(data[j].hasOwnProperty ('Tue_M') == true){
- Tue_M.push(data[j].Tue_M.mode_name)
- Tue_M=Tue_M.filter(item=> item && item.trim())
- var countNum =Tue_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Tue_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
- var strObjcet = Tue_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[5]="总人数:"+ sums[5] +"\n"+result
- // var newTue_A
- for(let j in data){
- if(data[j].hasOwnProperty ('Tue_A') == true){
- Tue_A.push(data[j].Tue_A.mode_name)
- Tue_A=Tue_A.filter(item=> item && item.trim())
- var countNum =Tue_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Tue_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
- var strObjcet = Tue_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[6]="总人数:"+ sums[6] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Tue_N') == true){
- Tue_N.push(data[j].Tue_N.mode_name)
- Tue_N=Tue_N.filter(item=> item && item.trim())
- var countNum =Tue_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Tue_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
- var strObjcet = Tue_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[7]="总人数:"+ sums[7] +"\n"+result
- // 星期三
- for(let j in data){
- if(data[j].hasOwnProperty ('Wed_M') == true){
- Wed_M.push(data[j].Wed_M.mode_name)
- Wed_M=Wed_M.filter(item=> item && item.trim())
- var countNum =Wed_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Wed_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Wed_M_One.length; i < len; i+=29) {
- var strObjcet = Wed_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[8]="总人数:"+ sums[8] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Wed_A') == true){
- Wed_A.push(data[j].Wed_A.mode_name)
- Wed_A=Wed_A.filter(item=> item && item.trim())
- var countNum =Wed_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Wed_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Wed_A_One.length; i < len; i+=29) {
- var strObjcet = Wed_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[9]="总人数:"+ sums[9] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Wed_N') == true){
- Wed_N.push(data[j].Wed_N.mode_name)
- Wed_N=Wed_N.filter(item=> item && item.trim())
- var countNum =Wed_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Wed_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Wed_N_One.length; i < len; i+=29) {
- var strObjcet = Wed_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[10]="总人数:"+ sums[10] +"\n"+result
- // 星期四
- for(let j in data){
- if(data[j].hasOwnProperty ('Thurs_M') == true){
- Thurs_M.push(data[j].Thurs_M.mode_name)
- Thurs_M=Thurs_M.filter(item=> item && item.trim())
- var countNum =Thurs_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Thurs_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Thurs_M_One.length; i < len; i+=29) {
- var strObjcet = Thurs_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[11]="总人数:"+ sums[11] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Thurs_A') == true){
- Thurs_A.push(data[j].Thurs_A.mode_name)
- Thurs_A=Thurs_A.filter(item=> item && item.trim())
- var countNum =Thurs_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Thurs_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Thurs_A_One.length; i < len; i+=29) {
- var strObjcet = Thurs_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[12]="总人数:"+ sums[12] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Thurs_N') == true){
- Thurs_N.push(data[j].Thurs_N.mode_name)
- Thurs_N=Thurs_N.filter(item=> item && item.trim())
- var countNum =Thurs_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Thurs_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Thurs_N_One.length; i < len; i+=29) {
- var strObjcet = Thurs_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[13]="总人数:"+ sums[13] +"\n"+result
- // 星期五
- for(let j in data){
- if(data[j].hasOwnProperty ('Fri_M') == true){
- Fri_M.push(data[j].Fri_M.mode_name)
- Fri_M=Fri_M.filter(item=> item && item.trim())
- var countNum =Fri_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Fri_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Fri_M_One.length; i < len; i+=29) {
- var strObjcet = Fri_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[14]="总人数:"+ sums[14] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Fri_A') == true){
- Fri_A.push(data[j].Fri_A.mode_name)
- Fri_A=Fri_A.filter(item=> item && item.trim())
- var countNum =Fri_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Fri_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Fri_A_One.length; i < len; i+=29) {
- var strObjcet = Fri_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[15]="总人数:"+ sums[15] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Fri_N') == true){
- Fri_N.push(data[j].Fri_N.mode_name)
- Fri_N=Fri_N.filter(item=> item && item.trim())
- var countNum =Fri_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Fri_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Fri_N_One.length; i < len; i+=29) {
- var strObjcet = Fri_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[16]="总人数:"+ sums[16] +"\n"+result
- // 星期六
- for(let j in data){
- if(data[j].hasOwnProperty ('Sat_M') == true){
- Sat_M.push(data[j].Sat_M.mode_name)
- Sat_M=Sat_M.filter(item=> item && item.trim())
- var countNum =Sat_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Sat_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sat_M_One.length; i < len; i+=29) {
- var strObjcet = Sat_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[17]="总人数:"+ sums[17] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Sat_A') == true){
- Sat_A.push(data[j].Sat_A.mode_name)
- Sat_A=Sat_A.filter(item=> item && item.trim())
- var countNum =Sat_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Sat_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sat_A_One.length; i < len; i+=29) {
- var strObjcet = Sat_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[18]="总人数:"+ sums[18] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Sat_N') == true){
- Sat_N.push(data[j].Sat_N.mode_name)
- Sat_N=Sat_N.filter(item=> item && item.trim())
- var countNum =Sat_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Sat_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sat_N_One.length; i < len; i+=29) {
- var strObjcet = Sat_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[19]="总人数:"+ sums[19] +"\n"+result
- // 星期天
- for(let j in data){
- if(data[j].hasOwnProperty ('Sun_M') == true){
- Sun_M.push(data[j].Sun_M.mode_name)
- Sun_M=Sun_M.filter(item=> item && item.trim())
- var countNum =Sun_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Sun_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sun_M_One.length; i < len; i+=29) {
- var strObjcet = Sun_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[20]="总人数:"+ sums[20] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Sun_A') == true){
- Sun_A.push(data[j].Sun_A.mode_name)
- Sun_A=Sun_A.filter(item=> item && item.trim())
- var countNum =Sun_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Sun_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sun_A_One.length; i < len; i+=29) {
- var strObjcet = Sun_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[21]="总人数:"+ sums[21] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('Sun_N') == true){
- Sun_N.push(data[j].Sun_N.mode_name)
- Sun_N=Sun_N.filter(item=> item && item.trim())
- var countNum =Sun_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Sun_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sun_N_One.length; i < len; i+=29) {
- var strObjcet = Sun_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[22]="总人数:"+ sums[22] +"\n"+result
- return sums;
- // }
-
- 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){
- return sums;
- }
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- var that = this;
- var rowNum = 0;
- rowNumber = 0;
- var rutrnData = {};
- if (columnIndex === 0 || columnIndex == 25) {
- var rowLen = this.scheduleZoneRow.length;
- if (rowLen > 0) {
- for (let index = 0; index < rowLen; index++) {
- rowNum = this.scheduleZoneRow[index];
- rowNumber += rowNum;
- var f = rowNumber - rowNum;
- if (f == rowIndex) {
- rutrnData = {
- rowspan: rowNum,
- colspan: 1,
- };
- break;
- } else if (rowIndex < rowNumber) {
- rutrnData = {
- rowspan: 0,
- colspan: 0,
- };
- break;
- }
- }
- return rutrnData;
- }
- }
- },
- handleCurrentChange(row) {
- if (typeof row === "undefined" || row == null) {
- this.currentData.patient_id = 0;
- this.currentData.contagions = [];
- } else {
- this.currentData.patient_id = row.id;
- this.currentData.contagions = row.contagions;
- }
- },
- // 数据源
- getSchedules() {
- var partionStr = this.partition_id;
- var arr = this.zoneIdList.join(",");
- var str = "";
- if (partionStr == 0) {
- str = arr;
- }
- if (partionStr != 0) {
- str = partionStr.join(",");
- }
- const params = {
- weekTime: this.theType,
- patitionid: str,
- schedule_type: this.schedule_type,
- };
-
- getSchedulesOne(params).then((response) => {
- if (response.data.state == 1) {
- this.weekTitle = response.data.data.weekTitle;
-
- this.weekDays = response.data.data.days;
- this.toDay = response.data.data.today;
- var theSchedules = response.data.data.schdules;
- this.newschedules= theSchedules
- var schedulesGroup = response.data.data.schedulesGroup
- this.schedulesGroup = schedulesGroup
- var that = this;
- this.scheduleZone.forEach(function (zone, index) {
- that.scheduleZone[index].Mon_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Mon_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Mon_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Tue_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Tue_A = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Tue_N = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Wed_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Wed_A = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Wed_N = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Thurs_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Thurs_A = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Thurs_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Fri_M = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Fri_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Fri_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Sat_M = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Sat_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
- patient: "",
- };
- that.scheduleZone[index].Sat_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Sun_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Sun_N = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Sun_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].total = 0;
-
- if (response.data.data.schdules.length > 0) {
- theSchedules.forEach(function (schedule, sindex) {
- if (zone.jihao_id == schedule.bed_id) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: schedule.patient,
- dialysis_machine_name: schedule.dialysis_machine_name,
- patient_contagions: schedule.patient_contagions,
- mode_name:
- typeof that.modeOptions[schedule.mode_id] ===
- "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name,
- };
- that.scheduleZone[index].total += 1;
- }
- }
- });
- }
- });
- } else {
- this.$message.error("网络错误");
- return false;
- }
- });
- },
-
- getSchedulePatients() {
- getSchedulePatients(this.patientQuery).then((response) => {
- if (response.data.state == 1) {
- this.patients = response.data.data.patients;
- }
- });
- },
-
- // 排班成功接口
- async CreateSchedule(id, data) {
- this.creating_schedule = true;
- let response =await CreateSchedule(id, data)
- this.dialogTableVisible=false
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- var that = this;
- var schedule = response.data.data.schedule;
- this.creating_schedule=false;
- this.dialogTableVisible=false
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: schedule.patient,
- dialysis_machine_name: schedule.dialysis_machine_name,
-
- patient_contagions: that.currentData.contagions,
- mode_name:
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name,
- };
- that.scheduleZone[index].total += 1;
- }
- }
- });
- }
- this.creating_schedule = false;
- },
- async CreateScheduleTwo(id, data,id_two) {
- this.loading =true
- this.creating_schedule = true;
- let response =await CreateScheduleTwo(id, data,id_two)
-
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- var that = this;
- var schedule = response.data.data.schedule;
- this.creating_schedule=false;
- this.dialogTableVisible=false
- // this.getSchedules()
- console.log('cccccc',this.cur_drag_info);
- const curdrag = this.cur_drag_info
- if(curdrag.bed_id!=''){
-
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- // console.log('111111',zone.zone_id,zone.jihao_id);
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- console.log('22222',weekPath);
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: schedule.patient,
- dialysis_machine_name: schedule.dialysis_machine_name,
- patient_contagions: that.currentData.contagions,
- mode_name:
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name,
- };
- // console.log('3333',that.scheduleZone[index][weekPathKey]);
- that.scheduleZone[index].total += 1;
- }
- }
-
- if(zone.zone_id == curdrag.partition_id &&
- zone.jihao_id == curdrag.bed_id
- ){
- // console.log('aaaaaa',curdrag);
- var weekPath = that.weekPath(
- curdrag.schedule_week,
- curdrag.schedule_type
- );
- console.log('aaaaaa',weekPath);
- if(weekPath.length == 2){
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] ={
- schedule_id: '',
- mode_id: '',
- patient_id: '',
- patient: '',
- dialysis_machine_name: '',
- patient_contagions: '',
- mode_name:''
- };
- that.scheduleZone[index].total += 1;
- }
- }
- });
- }else{
- this.getSchedules()
- }
- // return that.scheduleZone()
- // this.closePatientPanel();
- }
- this.creating_schedule = false;
- this.loading=false
- },
- // 单击选中患者
- clickThis(row, column, cell, event) {
- if (row[column.property].schedule_id > 0) {
- this.cur_info.patient_id=row[column.property].patient_id
- this.cur_info.mode_id=row[column.property].mode_id
- this.patient_id_hover = this.cur_info.patient_id;
- this.cur_info.patient_name = row[column.property].patient
- this.cur_info.mode_name = row[column.property].mode_name
- console.log('单击选中患者',row[column.property]);
-
- } else {
- var week = this.weekDay(column.property);
- if (week[0] == -1 || week[1] == -1) {
- return false;
- }
- if (this.toDay > this.weekDays[week[0] - 1]) {
- return false;
- }
- this.currentData.schedule_date = this.weekDays[week[0] - 1];
- this.currentData.schedule_type = week[1];
- this.currentData.bed_id = row.jihao_id;
- this.currentData.partition_id = row.zone_id;
- this.currentData.schedule_week = week[0];
- this.currentData.type_name = this.dayType(week[1]);
- this.currentData.zone_name = row.area;
- this.currentData.bed_name = row.cut;
- this.currentData.partition_type = row.zone_type;
- this.patient_id_hover = -1;
- this.currentData.mode_id = 1;
- this.currentData.id = 0;
- this.currentData.patient_id = 0;
- this.currentData.patient = "";
- this.currentData.contagions = [];
- this.getSchedulePatients();
- this.dialogTableVisible = true;
- }
- },
- // 双击有内容的单元格
- dblclickThis(row, column, cell, event){
-
- var week = this.weekDay(column.property);
- if (week[0] == -1 || week[1] == -1) {
- return false;
- }
- if (this.toDay > this.weekDays[week[0] - 1]) {
- return false;
- }else{
- this.currentData.schedule_date = this.weekDays[week[0] - 1];
- this.currentData.schedule_type = week[1];
- this.currentData.bed_id = row.jihao_id;
- this.currentData.partition_id = row.zone_id;
- this.currentData.schedule_week = week[0];
- this.currentData.type_name = this.dayType(week[1]);
- this.currentData.zone_name = row.area;
- this.currentData.bed_name = row.cut;
- this.currentData.partition_type = row.zone_type;
- if (row[column.property].schedule_id > 0) {
- this.currentData.mode_id = row[column.property].mode_id;
- this.currentData.id = row[column.property].schedule_id;
- this.currentData.patient_id = row[column.property].patient_id;
- this.currentData.patient = row[column.property].patient;
- this.currentData.contagions = row[column.property].patient_contagions;
- this.tiaoZhengType = 1;
- this.msDialogVisible=true
- }
- console.log("ROW22O2O2OWOOW",row)
- console.log("CHANGESHCUEL2O2O2O",this.changeSchedule)
- console.log("WOOWOWOWOWOW",this.zones)
- console.log("numberowowow",this.numberList)
- this.changeSchedule.mode_id = row[column.property].mode_id
- // var zone_names = ""
- // for(let i=0;i<this.zones.length;i++){
- // if(row.zone_id == this.zones[i].id){
- // zone_names = this.zones[i].name
- // }
- // }
- this.changeSchedule.partition_id = row.zone_id
- this.changeSchedule.schedule_type = week[1];
- this.changeSchedule.bed_id = row.jihao_id;
- console.log("床位id",this.changeSchedule.bed_id)
- this.changeSchedule.schedule_week = week[0];
- }
-
- },
-
- // 双击弹窗确认按钮
- submitMode(formName) {
- console.log("wowowoowow",this.changeSchedule)
- this.changing_mode = true;
- this.changeSchedule.change_action = "change_mode";
-
- ChangeSchedule(this.currentData.id, this.changeSchedule).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "修改成功!",
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.msDialogVisible = false
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey].dialysis_machine_name =
- schedule.dialysis_machine_name;
- that.scheduleZone[index][weekPathKey].mode_id =
- schedule.mode_id;
- that.scheduleZone[index][weekPathKey].mode_name = typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name;
- }
- }
- });
- // this.msDialogVisible = false;
- // this.getAllZones()
-
- }
- this.changing_mode = false;
- }).catch((err) => {
- this.$message.error(err);
- this.changing_mode = false;
- });
-
- },
-
- changePartition(value) {
- this.current_devices = this.zone_device_map[value];
- this.device_id = this.current_devices[0].id;
- },
- changePartitionOne(val){
- console.log("valwoowow",val)
-
- getNumberList(val).then(response=>{
- if(response.data.state==1){
- var number = response.data.data.number
- this.numberList = []
- this.numberList = number
- }
- })
- },
- // 选择下拉框方法
- changeScheduleType(schedule_type) {
- const params = {
- type: schedule_type,
- date: this.currentData.schedule_date,
- };
- getUrgentScheduleInitData(params)
- .then((rs) => {
- if (rs.data.state == 1) {
- this.origin_schedules = rs.data.data.schedules;
- this.origin_device_numbers = rs.data.data.device_numbers;
-
- var zone_device_map = {};
- for (
- let index = 0;
- index < this.origin_device_numbers.length;
- index++
- ) {
- const device_number = this.origin_device_numbers[index];
- if (
- zone_device_map[device_number.zone_name] == null ||
- zone_device_map[device_number.zone_name] == undefined
- ) {
- zone_device_map[device_number.zone_name] = [];
- }
- zone_device_map[device_number.zone_name].push(device_number);
- }
- this.zone_device_map = zone_device_map;
-
- this.zone_names = Object.keys(this.zone_device_map);
-
-
- if (this.zone_names.length > 0) {
- this.zone_name = this.zone_names[0];
- this.current_devices = this.zone_device_map[this.zone_name];
- this.device_id = this.current_devices[0].id;
- }
-
- this.zone_device_options = [
- { values: this.zone_names },
- // { values: this.getDeviceNumberNames(this.current_devices) },
- { values: this.current_devices },
- ];
- } else {
- }
- })
- .catch((err) => {
- this.loading = false;
- });
- },
- submitTiaoX() {
- if (this.tiaoZhengType==1) {
- this.$confirm('确定要取消当前排班?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.CancelSchedule(this.currentData.id);
- }).catch(() => {});
- }
-
- switch (this.tiaoZhengType) {
- case 1:
- this.CancelSchedule(this.currentData.id);
- break;
- case 2:
- this.changeSchedule = {
- mode_id: this.currentData.mode_id,
- schedule_type: this.currentData.schedule_type,
- partition_id: this.currentData.partition_id,
- bed_id: this.currentData.bed_id,
- schedule_week: this.currentData.schedule_week,
- partition_type: "",
- };
-
- if (
- typeof this.partitions[this.currentData.partition_id].jihaos !==
- "undefined"
- ) {
- this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
- } else {
- this.jihaos = [];
- }
-
- const params = {
- type: this.currentData.schedule_type,
- date: this.currentData.schedule_date,
- };
- getUrgentScheduleInitData(params)
- .then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- if (response.data.state == 1) {
- this.origin_schedules = response.data.data.schedules;
- this.origin_device_numbers =
- response.data.data.device_numbers;
-
- var zone_device_map = {};
- for (
- let index = 0;
- index < this.origin_device_numbers.length;
- index++
- ) {
- const device_number = this.origin_device_numbers[index];
- if (
- zone_device_map[device_number.zone_name] == null ||
- zone_device_map[device_number.zone_name] == undefined
- ) {
- zone_device_map[device_number.zone_name] = [];
- }
- zone_device_map[device_number.zone_name].push(
- device_number
- );
- }
- this.zone_device_map = zone_device_map;
- this.zone_names = Object.keys(this.zone_device_map);
- if (this.zone_names.length > 0) {
- this.zone_name = this.zone_names[0];
- this.current_devices = this.zone_device_map[this.zone_name];
- this.device_id = this.current_devices[0].id;
- }
- this.zone_device_options = [
- { values: this.zone_names },
- // { values: this.getDeviceNumberNames(this.current_devices) },
- { values: this.current_devices },
- ];
-
- //
- // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
- // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
- // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
- // this.origin_device_numbers.splice(y, 1)
- // }
- // }
- // }
- // // debugger
- // var zone_device_map = {}
- // for (let index = 0; index < this.origin_device_numbers.length; index++) {
- // const device_number = this.origin_device_numbers[index]
- // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
- // zone_device_map[device_number.zone.name] = []
- // }
- // zone_device_map[device_number.zone.name].push(device_number)
- // }
- // this.zone_device_map = zone_device_map
- //
- // this.zone_names = Object.keys(this.zone_device_map)
- // if (this.zone_names.length > 0) {
- // this.zone_name = this.zone_names[0]
- // this.current_devices = this.zone_device_map[this.zone_name]
- // this.device_id = this.current_devices[0].id
- // }
- //
- // this.zone_device_options = [
- // { values: this.zone_names },
- // // { values: this.getDeviceNumberNames(this.current_devices) },
- // { values: this.current_devices }
- // ]
- } else {
- }
- }
- })
- .catch((err) => {
- this.$message.error(err);
- });
-
- this.tzDialogVisible = false;
- this.jhDialogVisible = true;
- break;
- case 3:
- this.changeSchedule = {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: "",
- };
- this.tzDialogVisible = false;
- this.msDialogVisible = true;
- break;
-
- default:
- break;
- }
- },
- setScheduleTwo(id_two) {
- console.log("1112222222",this.currentData.contagions.length)
- var that = this;
- // var submitFlag = true;
- // if (this.currentData.patient_id <= 0) {
- // this.$message.error("请先选择患者");
- // return false;
- // }
- // if (
- // this.currentData.schedule_date.length == 0 ||
- // this.currentData.schedule_type < 1 ||
- // this.currentData.schedule_type > 3 ||
- // this.currentData.bed_id < 1 ||
- // this.currentData.partition_id < 1 ||
- // this.currentData.schedule_week < 1 ||
- // this.currentData.schedule_week > 7
- // ) {
- // this.$message.error("请先选择排班时间或机号");
- // return false;
- // }
- // 可能
- // 患者有传染病,与选择的机器类型(传染病)不匹配
- // 患者没有传染病,但机器是某个传染病的专用透析器
- // 机器的透析模式与患者不匹配
- if (this.currentData.contagions.length > 0) {
- var cflag = false;
- this.currentData.contagions.forEach(function (contagion) {
- if (contagion.disease_id == that.currentData.partition_type) {
- cflag = true;
- }
- });
- if (!cflag) {
- this.$confirm(
- "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }
- )
- .then(() => {
- this.CreateScheduleTwo(
- this.currentData.patient_id,
- this.currentData,
- id_two
- );
- this.dialogTableVisible=false
- })
- .catch(() => {
- this.dialogTableVisible=false
- });
- } else {
- this.CreateScheduleTwo(this.currentData.patient_id, this.currentData,id_two);
- }
- } else if (that.currentData.partition_type > 1) {
- this.$confirm(
- "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }
- )
- .then(() => {
- this.CreateScheduleTwo(this.currentData.patient_id, this.currentData,id_two);
- })
- .catch(() => {});
- } else {
- this.CreateScheduleTwo(this.currentData.patient_id, this.currentData,id_two);
- }
- },
- // 排班成功调用的方法
- setSchedule() {
- console.log("6666969696969699",this.currentData.contagions.length)
- var that = this;
- // var submitFlag = true;
- // if (this.currentData.patient_id <= 0) {
- // this.$message.error("请先选择患者");
- // return false;
- // }
- // if (
- // this.currentData.schedule_date.length == 0 ||
- // this.currentData.schedule_type < 1 ||
- // this.currentData.schedule_type > 3 ||
- // this.currentData.bed_id < 1 ||
- // this.currentData.partition_id < 1 ||
- // this.currentData.schedule_week < 1 ||
- // this.currentData.schedule_week > 7
- // ) {
- // this.$message.error("请先选择排班时间或机号");
- // return false;
- // }
- // 可能
- // 患者有传染病,与选择的机器类型(传染病)不匹配
- // 患者没有传染病,但机器是某个传染病的专用透析器
- // 机器的透析模式与患者不匹配
- if (this.currentData.contagions.length > 0) {
- var cflag = false;
- this.currentData.contagions.forEach(function (contagion) {
- console.log("woowowowowowow",that.currentData.partition_type)
- if (contagion.disease_id == that.currentData.partition_type) {
- cflag = true;
- }
- });
-
- if (!cflag) {
- this.$confirm(
- "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }
- )
- .then(() => {
- this.CreateSchedule(
- this.currentData.patient_id,
- this.currentData
- );
- this.dialogTableVisible=false
- })
- .catch(() => {
- this.dialogTableVisible=false
- });
- } else {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- }
-
- } else if (that.currentData.partition_type > 1) {
- this.$confirm(
- "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }
- )
- .then(() => {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
-
- })
- .catch(() => {
- this.dialogTableVisible=false
- });
- } else {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- }
- },
- // 选择周次
- weekType(weekTime) {
- var theType = 2;
- switch (weekTime) {
- case "lastWeek":
- theType = 1;
- break;
- case "thisWeek":
- theType = 2;
- break;
- case "nextWeek":
- theType = 3;
- break;
- case "nextTwoWeek":
- theType = 4;
- break;
- default:
- theType = 2;
- break;
- }
- return theType;
- },
- // 选择早中晚
- dayType(theType) {
- var jType = "";
- switch (theType) {
- case 1:
- jType = "上午";
- break;
- case 2:
- jType = "下午";
- break;
- case 3:
- jType = "晚上";
- break;
-
- default:
- break;
- }
- return jType;
- },
- weekPath(week, schedule_type) {
- var weekArr = {
- 1: "Mon",
- 2: "Tue",
- 3: "Wed",
- 4: "Thurs",
- 5: "Fri",
- 6: "Sat",
- 7: "Sun",
- };
- var typeArr = { 1: "M", 2: "A", 3: "N" };
- if (
- typeof weekArr[week] === "undefined" ||
- typeof typeArr[schedule_type] === "undefined"
- ) {
- return [];
- }
- return [weekArr[week], typeArr[schedule_type]];
- },
- weekDay(prop) {
- var week = prop.split("_");
- if (week.length != 2) {
- return [-1, -1];
- }
- var w = -1;
- var n = -1;
- switch (week[0]) {
- case "Mon":
- w = 1;
- break;
- case "Tue":
- w = 2;
- break;
- case "Wed":
- w = 3;
- break;
- case "Thurs":
- w = 4;
- break;
- case "Fri":
- w = 5;
- break;
- case "Sat":
- w = 6;
- break;
- case "Sun":
- w = 7;
- break;
- default:
- w = -1;
- break;
- }
- switch (week[1]) {
- case "M":
- n = 1;
- break;
- case "A":
- n = 2;
- break;
- case "N":
- n = 3;
- break;
- default:
- n = -1;
- break;
- }
- if (w == -1 || n == -1) {
- return [-1, -1];
- }
- return [w, n];
- },
- // 左侧搜索
- search: function () {
- if (this.keywords.length == 0) {
- this.patientList = this.all_patients;
- } else {
- this.patientList = [];
- console.log("this.all_patients",this.all_patients)
- for (let i = 0; i < this.all_patients.length; i++) {
- if (
- this.all_patients[i].name.indexOf(this.keywords) != -1 ||
- this.all_patients[i].dialysis_no.indexOf(this.keywords) != -1
- || this.all_patients[i].first_letter.indexOf(this.keywords) != -1
- ) {
- this.patientList.push(this.all_patients[i]);
- }
- }
-
- if (this.patientList.length > 0) {
- this.cur_info.patient_name = this.patientList[0].name;
- this.cur_info.mode_name = this.modes[0].name;
- this.cur_info.patient_id = this.patientList[0].id;
- this.cur_info.mode_id = this.modes[0].id;
- this.$refs.patient_table.setCurrentRow(this.patientList[0]);
- this.$refs.mode_table.setCurrentRow(this.modes[0]);
- }
- }
- },
-
- getDialysisDate: function (row) {
- let week = "";
- switch (row.schedule_week) {
- case 7:
- week = "周日";
- break;
- case 1:
- week = "周一";
- break;
- case 2:
- week = "周二";
-
- break;
- case 3:
- week = "周三";
-
- break;
- case 4:
- week = "周四";
-
- break;
- case 5:
- week = "周五";
- break;
- case 6:
- week = "周六";
- break;
- }
-
- return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
- },
- getSchedulesType: function (type) {
- let type_name = "";
- switch (type) {
- case 1:
- type_name = "上午";
- break;
- case 2:
- type_name = "下午";
-
- break;
- case 3:
- type_name = "晚上";
- break;
- }
- return type_name;
- },
- changeMode: function (index, row) {
- this.changeSchedule = {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: "",
- };
- this.currentData.id = row.id;
- this.searchTableVisible = false;
- this.msDialogVisible = true;
- },
- // 行的 className 的回调方法添加颜色
- tableRowClassName({ row, rowIndex}) {
- if (row.zone_type == 1) {
- return "table-row-new-class schedule-table-row ";
- } else {
- return "table-row-new-class schedule-table-row infectious";
- };
- //
- },
- // 分区接口
- getAllZones() {
- getAllZones().then((response) => {
- if (response.data.state == 1) {
- var zones = response.data.data.zones;
- for (let i = 0; i < zones.length; i++) {
- this.zoneIdList.push(zones[i].id);
- }
- this.zones.push(...zones);
- console.log("zoneswoowowow",this.zones)
- var strArr = this.zoneIdList.join(",");
-
- this.strArr = strArr;
- var device_number = response.data.data.devicenumber
- this.numberList = []
- this.numberList = device_number
- console.log("所有床位",device_number)
- this.getWeekPanels();
- }
- });
- },
- // 分区选择框
- changePartiton(val) {
- this.$emit("event1", val);
- this.partition_id = val;
- this.getWeekPanels();
- this.getSchedules();
- },
- changeSchedule_type(val) {
- this.$emit("event2", val);
- this.schedule_type = val;
- this.getSchedules();
- },
- changeWeekDay(val){
- this.$emit("event3", val);
- }
- },
- components: {
- ScheduleItem,
- draggable,
- },
- mounted() {
- this.tableContainHeight =
- window.innerHeight - this.$refs.table.$el.offsetTop - 100;
-
- var theType = this.weekType(this.weekTime);
- this.getSchedules(theType);
- const that = this;
- window.onresize = () => {
- return (() => {
- window.fullHeight = document.documentElement.clientHeight;
- if (window.fullHeight < 200) {
- that.tableHeight = 200;
- } else {
- that.tableHeight = window.fullHeight - 160;
- }
- })();
- };
- },
- created() {
- var date = new Date();
- this.time = date;
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- if (month < 10) {
- month = "0" + month;
- }
- var day = date.getDate();
- if (day < 10) {
- day = "0" + day;
- }
- var nowDate = year + "-" + month + "-" + day;
- this.systemDate=nowDate
- console.log('当前时间',nowDate);
- var date = new Date(nowDate + " 00:00:00");
-
- this.now_time = date.getTime() / 1000;
- this.getAllZones();
-
- this.changeScheduleType(1);
- rowNumber = 0;
- this.modeOptions = this.$store.getters.treatment_mode;
-
- this.partitions = this.partitionsProp;
-
- var contagions = this.$store.getters.contagions;
-
- if (contagions.length > 0) {
- var that = this;
- contagions.forEach(function (citem) {
- if (citem.type == 2) {
- that.diseasesArr.push({ value: citem.id, label: citem.name });
- }
- });
- }
-
- this.scheduleZoneRow = this.scheduleZoneRowProp;
- this.weekday = new Date().getDay();
- if (this.weekday == 0) {
- this.weekday = 7;
- }
- },
-
- };
- </script>
-
- <style rel="stylesheet/css" lang="scss">
- // 文字禁止选中
- *{
- -webkit-touch-callout:none; /*系统默认菜单被禁用*/
- -webkit-user-select:none; /*webkit浏览器*/
- -khtml-user-select:none; /*早期浏览器*/
- -moz-user-select:none;/*火狐*/
- -ms-user-select:none; /*IE10*/
- user-select:none;
- }
- input{
- -webkit-user-select:auto; /*webkit浏览器*/
- }
- textarea{
- -webkit-user-select:auto; /*webkit浏览器*/
- }
- .table_contain {
- display: flex;
- height: 90vh;
- // justify-content: space-between;
- .left_contain {
- width: 14%;
- margin-right: 15px;
- .patient_mode {
- display: flex;
- justify-content: space-between;
- .highlight{
- background-color: #ecf5ff !important;
- color: #3a8ee6;
- }
- .touxi_cishu{
- display: inline-block;
- border: 1px solid #409eff;
- width: 30px;
- text-align: center;
- border-radius: 10px;
- }
- }
- .el-table td .cell,.el-table th .cell {
- padding: 0 0px ;
-
- }
- .el-table {
- font-size: 12px !important;
- }
-
- }
- .right_contain {
- width: 86%;
-
- .el-table .cell{
- white-space: pre-wrap;
- padding: 0px 0px !important;
- }
- .schedule-table-row td .cell:hover {
- background: #3a8ee6 !important;
- }
- }
- .select_list {
- text-align: right;
- margin-bottom: 15px;
- .el-select {
- width: 13%;
- }
- }
- }
- .tiaozhengclass {
- display: block;
- margin: 0 auto;
- }
-
- .schedule-table-row {
- background: #fff !important;
- }
-
- .schedule-table-row:hover {
- background: #fff !important;
- }
-
- .schedule-table-row td:hover {
- background: #3a8ee6 !important;
- }
-
- .schedule-table-row td .cell {
- font-size: 12px;
- white-space: normal !important;
-
- }
- // .el-table--medium td, .el-table--medium th {
- // padding: 5px 0 !important;
- // }
- // 动态样式
- .schedule-table-cell-disable {
- background-color: rgb(245, 245, 245) !important;
- }
-
- #edit_table_data {
- // min-height: calc(100vh - 350px);
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- overflow: auto;
- margin: 0;
- background: #fff;
- padding: 20px;
- z-index:2000;
- height: 100%;
- }
-
- #edit_table_data ::-webkit-scrollbar {
- height: 15px;
- }
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- .el-table--border th {
- border-color: #d0d3da;
- }
- .el-table--border td {
- border-color: #d0d3da;
- }
- .el-table td {
- border-color: #d0d3da;
- // color: #3a8ee6;
- }
- #edit_table_data {
- // .el-table__body tr.current-row {
- // background-color: #ecf5ff !important;
- // color: #3a8ee6;
- // }
- .el-table__body tr > td:hover {
- background-color: #3a8ee6 !important;
- color: #fff;
- .del_table_btn {
- visibility: visible;
- }
- }
- .el-table__body tr .hover-td {
- background-color: #3a8ee6 !important;
- color: #fff;
- }
- }
- .infectious {
- color: red !important;
- }
- .border_bott{
- border-left: 1px solid aqua !important;
- border-right: 1px solid aqua !important;
- }
- .border_left{
- border-left: 1px solid aqua !important;
- }
-
- .evening_border{
- border-right: 1px solid aqua !important;
- }
- .Infectious_disease{
- background-color: red !important;
- color: white;
- }
- .del_table_btn {
- position: absolute;
- right: 0px;
- top: -3px;
- visibility: hidden;
- .el-button {
- width: 15px;
- height: 15px;
- padding: 0px;
- }
- }
-
- .mode_change {
- .el-dialog {
- .el-dialog__footer {
- text-align: center;
- }
- }
- }
-
- </style>
-
- <style scoped>
- .itxst {
- margin: 10px;
- text-align: left;
- }
- .col {
- width: 40%;
- flex: 1;
- padding: 10px;
- border: solid 1px #eee;
- border-radius: 5px;
- float: left;
- }
- .col + .col {
- margin-left: 10px;
- }
- .item_touz {
- width: 115px;
- padding: 6px 5px;
- margin: 0px 5px ;
- border: solid 1px #eee;
- background-color: #409eff;
- text-align: left;
- color: #fff;
- }
- .item_touz + .item_touz {
- border-top: none;
- margin-top: 6px;
- }
-
- .item_touz:hover {
- background-color: #5695d4;
- cursor: move;
- }
-
- .item2 {
- padding: 6px 12px;
- margin: 0px 10px 0px 10px;
- border: solid 1px #eee;
- background-color: pink;
- text-align: left;
- }
- .item2 + .item2 {
- border-top: none;
- margin-top: 6px;
- }
-
- .item2:hover {
- outline: solid 1px #ddd;
- cursor: move;
- }
-
- .select_list_arrage {
- width: 105px !important;
- }
-
- .checkSearch{
- position: absolute;
- top: 15px;
- right: 120px;
- }
-
- </style>
-
|