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

editTableData.vue 186KB

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