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

editTableData.vue 186KB

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