editTableData.vue 187KB

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