editTableData.vue 187KB

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