1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422 |
- <template>
- <div id="table_data">
- <div class="table_contain">
- <div class="left_contain">
- <div
- class="cell clearfix"
- v-if="
- weekTime == 'thisWeek' ||
- weekTime == 'nextWeek' ||
- weekTime == 'nextTwoWeek'
- "
- >
- <el-input
- size="small"
- style="width: 200px"
- class="filter-item"
- v-model.trim="keywords"
- placeholder="病人名称/透析号"
- @keyup.enter.native="search"
- />
- <el-button
- size="small"
- class="filter-item"
- type="primary"
- icon="el-icon-search"
- @click="search"
- >搜索</el-button
- >
- </div>
- <div style="margin-bottom: 10px; display: flex">
- <h3 style="line-height: 45px">
- <span
- style="margin-right: 30px; font-size: 16px; white-space: nowrap"
- >当前选择</span
- >
- </h3>
- <div style="line-height: 30px">
- <div
- draggable="true"
- class="item"
- @dragstart="curInfoDragStart"
- style="font-weight: bolder"
- >
- <span>{{ cur_info.patient_name }}</span>
-  
- <span>{{ cur_info.mode_name }}</span>
- </div>
- </div>
- </div>
- <div class="patient_mode">
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="patientList"
- height="550"
- border
- @row-click="patientClick"
- highlight-current-row
- ref="patient_table"
- style="width: 100%; margin-right: 14px"
- >
- <el-table-column
- prop="name"
- label="患者名称"
- width="104"
- align="center"
- >
- </el-table-column>
- </el-table>
-
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="modes"
- height="550"
- highlight-current-row
- ref="mode_table"
- @row-click="modeClick"
- border
- style="width: 100%"
- >
- <el-table-column
- prop="name"
- label="透析模式"
- width="104"
- align="center"
- ></el-table-column>
- </el-table>
- </div>
- </div>
-
- <div class="right_contain">
- <span>日期:</span>
- <el-select v-model="week_type" style="margin-bottom: 15px;" placeholder="请选择" multiple>
- <el-option
- @change="changeWeekDay"
- v-for="(item, index) in week_zhongwens"
- :key="index"
- :label="item"
- :value="item"
- >
- </el-option>
- </el-select>
-
- <span>分区:</span>
- <el-select
- v-model="partition_id"
- multiple
- placeholder="请选择"
- @change="changePartiton"
- >
- <el-option
- v-for="item in this.zones"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <!-- <div class="select_list">-->
- <!-- <span style="">班次:</span>-->
- <!-- <el-select-->
- <!-- v-model="schedule_type"-->
- <!-- placeholder="请选择"-->
- <!-- @change="changeSchedule_type"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in options"-->
- <!-- :key="item.id"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
-
- <!-- <span>日期:</span>-->
- <!-- <el-select-->
- <!-- v-model="schedule_type"-->
- <!-- placeholder="请选择"-->
- <!-- @change="changeSchedule_type"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in options"-->
- <!-- :key="item.id"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
-
- <!-- <span>分区:</span>-->
- <!-- <el-select-->
- <!-- v-model="partition_id"-->
- <!-- multiple-->
- <!-- placeholder="请选择"-->
- <!-- @change="changePartiton"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in this.zones"-->
- <!-- :key="item.id"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
-
- <!-- <span>周次:</span>-->
- <!-- <el-select-->
- <!-- v-model="schedule_type"-->
- <!-- placeholder="请选择"-->
- <!-- @change="changeSchedule_type"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in options"-->
- <!-- :key="item.id"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
- <!-- </div>-->
-
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="scheduleZone"
- :span-method="objectSpanMethod"
- @cell-click="clickThis"
- @cell-mouse-enter="hoverMouse"
- :summary-method="getSummaries"
- show-summary
- :row-class-name="tableRowClassName"
- :cell-class-name="cellClass"
- sum-text="总数"
- :height="tableContainHeight"
- ref="table"
- style="width: 100%; cursor: pointer"
- >
- <el-table-column
- prop="area"
- label="分区"
- width="50"
- align="center"
- fixed
- ></el-table-column>
- <el-table-column
- prop="cut"
- label="机号"
- width="100"
- align="center"
- fixed
- ></el-table-column>
- <el-table-column
- :label="'周一 (' + weekTitle[0] + ')'"
- width="335"
- v-if="isShowOne"
- align="center"
- >
- <el-table-column prop="Mon_M" label="上" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Mon_M)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Mon_M',
- scope.row.index,
- scope.row.Mon_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <schedule-item
- :schedule-detail="scope.row.Mon_M"
- :draggable="isEditForDate('Mon_M')&& scope.row.Mon_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Mon_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Mon_M',
- scope.row.index,
- scope.row.Mon_M,
- scope.row
- )
- "
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Mon_A" label="下" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Mon_A)"
- ></el-button>
- </div>
-
- <div
- @drop="
- drop(
- $event,
- 'Mon_A',
- scope.row.index,
- scope.row.Mon_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Mon_A"
- :draggable="isEditForDate('Mon_A')&&scope.row.Mon_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Mon_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Mon_A',
- scope.row.index,
- scope.row.Mon_A,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Mon_N" label="晚" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Mon_N)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Mon_N',
- scope.row.index,
- scope.row.Mon_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Mon_N"
- :draggable="isEditForDate('Mon_N') && scope.row.Mon_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Mon_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Mon_N',
- scope.row.index,
- scope.row.Mon_N,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周二 (' + weekTitle[1] + ')'"
- width="335"
- v-if="isShowTwo"
- align="center"
- >
- <el-table-column prop="Tue_M" label="上" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Tue_M)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Tue_M',
- scope.row.index,
- scope.row.Tue_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Tue_M"
- :draggable="isEditForDate('Tue_M')&&scope.row.Tue_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Tue_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Tue_M',
- scope.row.index,
- scope.row.Tue_M,
- scope.row
- )
- "
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Tue_A" label="下" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Tue_A)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Tue_A',
- scope.row.index,
- scope.row.Tue_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Tue_A"
- :draggable="isEditForDate('Tue_A')&&scope.row.Tue_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Tue_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Tue_A',
- scope.row.index,
- scope.row.Tue_A,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Tue_N" label="晚" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Tue_N)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Tue_N',
- scope.row.index,
- scope.row.Tue_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Tue_N"
- :draggable="isEditForDate('Tue_N')&&scope.row.Tue_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Tue_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Tue_N',
- scope.row.index,
- scope.row.Tue_N,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周三 (' + weekTitle[2] + ')'"
- width="335"
- v-if="isShowThree"
- align="center"
- >
- <el-table-column prop="Wed_M" label="上" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Wed_M)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Wed_M',
- scope.row.index,
- scope.row.Wed_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Wed_M"
- :draggable="isEditForDate('Wed_M')&&scope.row.Wed_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Wed_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Wed_M',
- scope.row.index,
- scope.row.Wed_M,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Wed_A" label="下" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Wed_A)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Wed_A',
- scope.row.index,
- scope.row.Wed_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Wed_A"
- :draggable="isEditForDate('Wed_A')&&scope.row.Wed_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Wed_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Wed_A',
- scope.row.index,
- scope.row.Wed_A,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Wed_N" label="晚" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Wed_N)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Wed_N',
- scope.row.index,
- scope.row.Wed_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Wed_N"
- :draggable="isEditForDate('Wed_N')&&scope.row.Wed_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Wed_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Wed_N',
- scope.row.index,
- scope.row.Wed_N,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周四 (' + weekTitle[3] + ')'"
- width="335"
- align="center"
- v-if="isShowFour"
- >
- <el-table-column
- prop="Thurs_M"
- label="上"
- width="110"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Thurs_M)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Thurs_M',
- scope.row.index,
- scope.row.Thurs_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Thurs_M"
- :draggable="isEditForDate('Thurs_M')&&scope.row.Thurs_M ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Thurs_M ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Thurs_M',
- scope.row.index,
- scope.row.Thurs_M,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Thurs_A"
- label="下"
- width="110"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Thurs_A)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Thurs_A',
- scope.row.index,
- scope.row.Thurs_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Thurs_A"
- :draggable="isEditForDate('Thurs_A')&&scope.row.Thurs_A ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Thurs_A ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Thurs_A',
- scope.row.index,
- scope.row.Thurs_A,
- scope.row
-
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Thurs_N"
- label="晚"
- width="110"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Thurs_N)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Thurs_N',
- scope.row.index,
- scope.row.Thurs_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Thurs_N"
- :draggable="isEditForDate('Thurs_N')&&scope.row.Thurs_N ? 'true' : 'false'"
- class="contitem"
- :style="{
- cursor: scope.row.Thurs_N ? 'move' : 'default',
- }"
- @mouseover.native="
- drag(
- $event,
- 'Thurs_N',
- scope.row.index,
- scope.row.Thurs_N,
- scope.row
- )
- "
- ></schedule-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周五 (' + weekTitle[4] + ')'"
- width="335"
- align="center"
- v-if="isShowFive"
- >
- <el-table-column prop="Fri_M" label="上" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Fri_M)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Fri_M',
- scope.row.index,
- scope.row.Fri_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Fri_M"
- :draggable="isEditForDate('Fri_M')&&scope.row.Fri_M ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Fri_M ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Fri_M',
- scope.row.index,
- scope.row.Fri_M,
- scope.row
- )
- "
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Fri_A" label="下" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Fri_A)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Fri_A',
- scope.row.index,
- scope.row.Fri_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Fri_A"
- :draggable="isEditForDate('Fri_A')&&scope.row.Fri_A ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Fri_A ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Fri_A',
- scope.row.index,
- scope.row.Fri_A,
- scope.row
- )
- "
- ></schedule-item
- >
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Fri_N" label="晚" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Fri_N)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Fri_N',
- scope.row.index,
- scope.row.Fri_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Fri_N"
- :draggable="isEditForDate('Fri_N')&&scope.row.Fri_N ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Fri_N ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Fri_N',
- scope.row.index,
- scope.row.Fri_N,
- scope.row
- )
- "
- >
- </schedule-item
- >
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周六 (' + weekTitle[5] + ')'"
- width="335"
- align="center"
- v-if="isShowSix"
- >
- <el-table-column prop="Sat_M" label="上" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sat_M)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sat_M',
- scope.row.index,
- scope.row.Sat_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sat_M"
- :draggable="isEditForDate('Sat_M')&&scope.row.Sat_M ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sat_M ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sat_M',
- scope.row.index,
- scope.row.Sat_M,
- scope.row
- )
- "
- >
- </schedule-item
- >
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Sat_A" label="下" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sat_A)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sat_A',
- scope.row.index,
- scope.row.Sat_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sat_A"
- :draggable="isEditForDate('Sat_A')&&scope.row.Sat_A ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sat_A ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sat_A',
- scope.row.index,
- scope.row.Sat_A,
- scope.row
- )
- "
- >
- </schedule-item
- >
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="Sat_N" label="晚" width="110" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sat_N)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sat_N',
- scope.row.index,
- scope.row.Sat_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sat_N"
- :draggable="isEditForDate('Sat_N')&&scope.row.Sat_N ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sat_N ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sat_N',
- scope.row.index,
- scope.row.Sat_N,
- scope.row
- )
- "
- >
- </schedule-item
- >
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周日 (' + weekTitle[6] + ')'"
- min-width="335"
- align="center"
- v-if="isShowSeven"
- >
- <el-table-column
- prop="Sun_M"
- label="上"
- min-width="110"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sun_M)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sun_M',
- scope.row.index,
- scope.row.Sun_M,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :draggable="true"
- @mouseover.native="
- drag(
- $event,
- 'Sun_M',
- scope.row.index,
- scope.row.Sun_M,
- scope.row
- )
- "
- :schedule-detail="scope.row.Sun_M"
- class="contitem"
- :style="{ cursor: scope.row.Sun_M ? 'move' : 'default' }"
-
- >
- </schedule-item
- >
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Sun_A"
- label="下"
- min-width="110"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sun_A)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sun_A',
- scope.row.index,
- scope.row.Sun_A,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sun_A"
- :draggable="isEditForDate('Sun_A')&&scope.row.Sun_A ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sun_A ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sun_A',
- scope.row.index,
- scope.row.Sun_A,
- scope.row
- )
- "
- >
- </schedule-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="Sun_N"
- label="晚"
- min-width="110"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="deletePatientMode(scope.row.Sun_N)"
- ></el-button>
- </div>
- <div
- @drop="
- drop(
- $event,
- 'Sun_N',
- scope.row.index,
- scope.row.Sun_N,
- scope.row
- )
- "
- @dragover="allowDrop"
- >
- <schedule-item
- :schedule-detail="scope.row.Sun_N"
- :draggable="isEditForDate('Sun_N')&&scope.row.Sun_N ? 'true' : 'false'"
- class="contitem"
- :style="{ cursor: scope.row.Sun_N ? 'move' : 'default' }"
- @mouseover.native="
- drag(
- $event,
- 'Sun_N',
- scope.row.index,
- scope.row.Sun_N,
- scope.row
- )
- "
- >
- </schedule-item
- >
- </div>
- </template>
- </el-table-column>
- </el-table-column>
-
- <!-- <el-table-column-->
- <!-- prop="total"-->
- <!-- label="总数"-->
- <!-- width="60"-->
- <!-- align="center"-->
- <!-- fixed="right"-->
- <!-- ></el-table-column>-->
- </el-table>
- </div>
- </div>
-
- <el-dialog :visible.sync="searchTableVisible" width="80%">
- <el-table
- :data="schedulePatients"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :row-style="{ color: '#303133' }"
- style="width: 100%"
- border
- >
- <el-table-column label="姓名" width="120">
- <template slot-scope="scope">
- {{ scope.row.patient }}
- </template>
- </el-table-column>
- <el-table-column label="透析日期" width="200">
- <template slot-scope="scope">
- {{ getDialysisDate(scope.row) }}
- </template>
- </el-table-column>
- <el-table-column label="分区">
- <template slot-scope="scope">
- {{ scope.row.zone.name }}
- </template>
- </el-table-column>
- <el-table-column label="班次" width="80">
- <template slot-scope="scope">
- {{ getSchedulesType(scope.row.schedule_type) }}
- </template>
- </el-table-column>
- <el-table-column label="机号" width="80">
- <template slot-scope="scope">
- {{ scope.row.number.number }}
- </template>
- </el-table-column>
- <el-table-column label="透析模式" width="100">
- <template slot-scope="scope">
- {{ scope.row.mode.name }}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="300">
- <template slot-scope="scope">
- <span v-if="now_time > scope.row.schedule_date">
- <el-button size="mini" type="primary" :disable="true">
- 取消排班
- </el-button>
- <el-button size="mini" type="primary" :disable="true">
- 调整机号
- </el-button>
- <el-button size="mini" type="primary" :disable="true">
- 调整模式
- </el-button>
- </span>
- </template>
-
- <template slot-scope="scope">
- <span v-if="now_time <= scope.row.schedule_date">
- <el-button
- size="mini"
- type="primary"
- @click="CancelSchedule(scope.row.id)"
- >
- 取消排班
- </el-button>
- <el-button
- size="mini"
- type="primary"
- @click="changeMachineNumber(scope.$index, scope.row)"
- >
- 调整机号
- </el-button>
- <el-button
- size="mini"
- type="primary"
- @click="changeMode(scope.$index, scope.row)"
- >
- 调整模式
- </el-button>
- </span>
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <el-dialog
- title="排班"
- :visible.sync="dialogTableVisible"
- width="1000px;"
- :v-model="dialog"
- v-loading="creating_schedule"
- >
- <div>
- <div class="cell clearfix">
- <label class="title"><span class="name">当前排班</span> : </label>
- <div class="time">
- <ul class="">
- <span class="current"
- >日期 : {{ currentData.schedule_date }} 班次 :
- {{ currentData.type_name }} 病房 :
- {{ currentData.zone_name }} 透析机 :
- {{ currentData.bed_name }}
- </span>
- </ul>
- </div>
- </div>
-
- <div class="cell clearfix">
- <label class="title"><span class="name">患者搜索</span> : </label>
- <div class="time">
- <ul class="">
- <el-input
- size="medium"
- v-model="searchKey"
- placeholder="请输入搜索的内容"
- style="width: 260px"
- @keyup.enter.native="SubmitSearch"
- ></el-input>
- <el-button
- type="primary"
- icon="el-icon-search"
- @click="SubmitSearch"
- >搜索</el-button
- >
- </ul>
- </div>
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">排班</span> : </label>
- <div class="time">
- <ul class="">
- <li
- v-for="item in schedulArr"
- @click="changeSearchSchedule(item.value)"
- :key="item.value"
- :class="patientQuery.schedule == item.value ? 'active' : ''"
- >
- {{ item.label }}
- </li>
- </ul>
- </div>
- </div>
- <!-- <div class="cell clearfix">
- <label class="title"><span class="name">标签</span> : </label>
- <div class="time ">
- <ul class="">
- <li v-for="item in tagArr" :key="item.value" >{{item.label}}</li>
- </ul>
- </div>
- </div> -->
- <div class="cell clearfix">
- <label class="title"><span class="name">传染病</span> : </label>
- <div class="time">
- <ul class="">
- <li
- v-for="item in diseasesArr"
- @click="changeSearchContagion(item.value)"
- :key="item.value"
- :class="patientQuery.contagion == item.value ? 'active' : ''"
- >
- {{ item.label }}
- </li>
- </ul>
- </div>
- </div>
- </div>
- <el-table
- ref="singleTable"
- :data="patients"
- border
- highlight-current-row
- @current-change="handleCurrentChange"
- :header-cell-style="{ backgroundColor: 'rgb(236, 245, 255)' }"
- >
- <el-table-column
- type="index"
- label="序号"
- width="89"
- align="center"
- ></el-table-column>
- <el-table-column
- property="dialysis_no"
- label="透析号"
- min-width="110"
- align="center"
- ></el-table-column>
- <el-table-column
- property="name"
- label="姓名"
- min-width="110"
- align="center"
- ></el-table-column>
- <el-table-column
- property="schedules"
- label="双周已排"
- min-width="80"
- align="center"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.schedules.length }}次</span>
- </template>
- </el-table-column>
- <el-table-column
- property="solutions"
- label="治疗频率"
- min-width="200"
- align="center"
- >
- <template slot-scope="scope">
- <span v-for="solution in scope.row.solutions" :key="solution.id"
- >{{ solution.name }}({{ solution.period }}{{ solution.times }})
- </span>
- </template>
- </el-table-column>
- <el-table-column
- property="sch_remark"
- label="备注"
- min-width="200"
- align="center"
- >
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button @click="closePatientPanel()">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="setSchedule"
- >保 存
- </el-button>
- </div>
- </el-dialog>
- <el-dialog
- title="调整排班"
- :visible.sync="tzDialogVisible"
- width="500px"
- class="mode_change"
- >
- <div style="width: 100%; margin: 0 auto; text-align: center">
- <!-- <el-radio-group v-model="tiaoZhengType" :class="tiaozhengclass">
- <el-radio :label="1">取消排班</el-radio>
- <el-radio :label="2">调整机号</el-radio>
- <el-radio :label="3">调整模式</el-radio>
- </el-radio-group> -->
-
- <span>调整模式:</span>
- <el-select v-model="value" placeholder="请选择">
- <el-option
- v-for="item in mode_select"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- <span slot="footer" class="dialog-footer" style="text-align: center">
- <el-button
- @click="
- tzDialogVisible = false;
- tiaoZhengType = 1;
- "
- >取 消</el-button
- >
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitTiaoX"
- >
- <span v-if="tiaoZhengType == 1">保存</span>
- <span v-if="tiaoZhengType == 2">下一步</span>
- <span v-if="tiaoZhengType == 3">下一步</span>
- </el-button>
- </span>
- </el-dialog>
- <el-dialog
- title="调整模式"
- :visible.sync="msDialogVisible"
- width="500px"
- v-loading="changing_mode"
- >
- <div>
- <el-form
- :model="changeSchedule"
- ref="changeSchedule"
- :rules="changeRules"
- >
- <el-form-item label="" prop="mode_id">
- <el-select
- v-model="changeSchedule.mode_id"
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- :disabled="item.id == currentData.mode_id"
- v-for="item in modeOptions"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="msDialogVisible = false">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitMode('changeSchedule')"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- title="调整机号"
- :visible.sync="jhDialogVisible"
- width="500px"
- v-loading="changing_bed"
- >
- <div>
- <el-form
- :model="changeSchedule"
- ref="changeSchedule"
- :rules="changeRules"
- label-width="90px"
-
- >
- <el-form-item label="排班日期: ">
- <el-input v-model="currentData.schedule_date" disabled></el-input>
- </el-form-item>
- <el-form-item label="班次: " prop="schedule_type">
- <el-select
- v-model="changeSchedule.schedule_type"
- placeholder="请选择"
- style="width: 100%"
- @change="changeScheduleType"
- >
- <el-option
- v-for="item in scheduleType"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="病房: " prop="partition_id">
- <el-select
- v-model="zone_name"
- placeholder="请选择"
- style="width: 100%"
- @change="changePartition"
- >
- <el-option
- v-for="(item, index) in zone_names"
- :key="index"
- :label="item"
- :value="item"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="透析机: " prop="bed_id">
- <el-select
- v-model="device_id"
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- v-for="item in current_devices"
- :key="item.id"
- :label="item.number"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="jhDialogVisible = false">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitTiaoZJH('changeSchedule')"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- class="samrt_arrage"
- :title="`智能排班 (姓名:${
- this.cur_smart_patient_name ? this.cur_smart_patient_name : ''
- } 透析号:${
- this.cur_smart_patient_no ? this.cur_smart_patient_no : ''
- })`"
- width="900px"
- :visible.sync="smartVisible"
- >
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model.trim="smart_keyword"
- :fetch-suggestions="querySearchAsync"
- placeholder="病人透析号/姓名"
- @select="handleSelect"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.name }}</div>
- </template>
- </el-autocomplete>
-
- <el-tabs v-model="editableTabsValue" type="card" @tab-click="handleClick">
- <el-tab-pane
- :key="item.name"
- v-for="(item, index) in editableTabs"
- :label="item.title"
- :name="item.name"
- >
- <el-table v-loading="dataloading" border :data="item.tableWeekArrage" style="width: 100%">
- <!-- 自定义表结构 -->
- <el-table-column
- label="星期"
- prop="week"
- align="center"
- width="100"
- >
- </el-table-column>
- <el-table-column align="left">
- <template slot="header" slot-scope="scope">
- <el-checkbox-group
- v-model="item.checkedWeek"
- @change="select_week"
- >
- <el-checkbox
- v-for="(i, index) in weeks"
- :label="i"
- :key="index"
- :value="i"
- :disabled="!i.is_edit"
- >
- {{ i.name }}
- </el-checkbox>
- </el-checkbox-group>
- </template>
- <template slot-scope="scope">
- <div>
- <span>模式:</span>
- <el-select
- v-model="scope.row.mode_id"
- placeholder="请选择"
- size="mini"
- :disabled="!scope.row.is_edit"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in modes"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>班次:</span
- ><el-select
- v-model="scope.row.sch_type"
- placeholder="请选择"
- :disabled="!scope.row.is_edit"
- @change="changeSch(scope.row)"
- size="mini"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in teem_sel"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>分区:</span
- ><el-select
- v-model="scope.row.zone_id"
- placeholder="请选择"
- :disabled="!scope.row.is_edit"
- @change="changeArea(scope.row)"
- size="mini"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in partitionsProp"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>机号:</span
- ><el-select
- v-model="scope.row.jihao_id"
- placeholder="请选择"
- :disabled="!scope.row.is_edit"
- size="mini"
- @click.native="blurclick(scope.row)"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in scope.row.jihaos"
- :key="index"
- :label="item.number"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!-- <el-table-->
- <!-- border-->
- <!-- :show-header="false"-->
- <!-- :data="item.week_info"-->
- <!-- style="width: 100%"-->
- <!-- >-->
- <!-- <el-table-column align="left">-->
- <!-- <template slot-scope="scope">-->
- <!-- <span style="width:150px">{{scope.row.week_name}}</span>-->
- <!-- <span>模式:</span>-->
- <!-- <el-select-->
- <!-- v-model="scope.row.mode_id"-->
- <!-- placeholder="请选择"-->
- <!-- size="mini"-->
- <!-- class="select_list_arrage"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in modes"-->
- <!-- :key="item"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
- <!-- <span>班次:</span-->
- <!-- ><el-select-->
- <!-- v-model="scope.row.sch_type"-->
- <!-- placeholder="请选择"-->
- <!-- size="mini"-->
- <!-- class="select_list_arrage"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in teem_sel"-->
- <!-- :key="item"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
- <!-- <span>分区:</span-->
- <!-- ><el-select-->
- <!-- v-model="scope.row.zone_id"-->
- <!-- placeholder="请选择"-->
- <!-- size="mini"-->
- <!-- class="select_list_arrage"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in zones"-->
- <!-- :key="item"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
- <!-- <span>机号:</span>-->
- <!-- <el-select-->
- <!-- v-model="scope.row.jihao_id"-->
- <!-- placeholder="请选择"-->
- <!-- e size="mini"-->
- <!-- class="select_list_arrage"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in smart_jihaos"-->
- <!-- :key="item"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- >-->
- <!-- </el-option>-->
- <!-- </el-select>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- </el-table>-->
- </el-tab-pane>
- </el-tabs>
- <span slot="footer" class="dialog-footer">
- <el-button @click="cancel">取 消</el-button>
- <el-button type="primary" v-loading="saveloading" @click="batchSetSch"
- >保 存</el-button
- >
- </span>
- </el-dialog>
-
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisible"
- width="300px"
- >
- <div>
- 所选位置已有排班,请选择操作
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="danger"
- @click="tipDialogVisibleTwo = true"
- >替换</el-button>
- <el-button
- type="primary"
- @click="tipDialogVisibleThree = true"
- >交换</el-button>
- <el-button @click="tipDialogVisible = false">取 消</el-button>
- </span>
- </el-dialog>
-
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisibleTwo"
- width="300px"
- >
- <div>
- 是否将此位置排班替换
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- @click="coverSch()"
- >确定</el-button>
-
- <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
- </span>
- </el-dialog>
-
-
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisibleThree"
- width="300px"
- >
- <div>
- 是否将此位置排班互换
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- @click="changeSchTwo()"
- >确定</el-button>
- <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
- </span>
- </el-dialog>
-
-
- </div>
- </template>
-
- <script>
- import { uParseTime } from "@/utils/tools";
- import print from "print-js";
- import draggable from "vuedraggable";
- const moment = require("moment");
- import {
- PostSearchSmartSchPatient,
- getSmartDevices,
- getSmartSchByPatient,
- CoverSch,
- ExchangeSch,
- getPatientSmartSch,
- BatchSmartSch,
- } from "@/api/schedule_template/sch_template";
- import {
- CancelScheduleTwo,
- CancelSchedule,
- ChangeSchedule,
- CreateSchedule,
- getSchedulePatients,
- getSchedulesOne,
- getSearchResult,
- getUrgentScheduleInitData,
- getWeekPanelsOne,
- getAllZones,
- } from "@/api/schedule";
- import ScheduleItem from "./ScheduleItem";
-
- const weekOptions = [
- {
- name: "周一",
- week_type: 1,
- is_edit: true,
- },
- {
- name: "周二",
- week_type: 2,
- is_edit: true,
- },
- {
- name: "周三",
- week_type: 3,
- is_edit: true,
- },
- {
- name: "周四",
- week_type: 4,
- is_edit: true,
- },
- {
- name: "周五",
- week_type: 5,
- is_edit: true,
- },
- {
- name: "周六",
- week_type: 6,
- is_edit: true,
- },
- {
- name: "周日",
- week_type: 7,
- is_edit: true,
- },
- ];
- let rowNumber = 0;
- export default {
- name: "editTableData",
- props: {
- weekTime: {
- type: String,
- default: "thisWeek",
- },
- scheduleZoneRowProp: {
- type: Array,
- dafault: [],
- },
- // scheduleZoneProp: {
- // type: Array,
- // dafault: []
- // },
- partitionsProp: {
- type: Object,
- dafault: {},
- },
- },
-
- data() {
- return {
- tipDialogVisibleTwo:false,
- tipDialogVisibleThree:false,
- cur_date:"",
- dataloading:false,
- current_patient_data:[],
- week_zhongwens: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
- week_type: "",
- saveloading: false,
- zones: [],
- weeks: weekOptions,
- first_weeks:[],
- smart_keyword: "",
- cur_smart_patient_id: 0,
- cur_smart_patient_name: "",
- cur_smart_patient_no: "",
- all_zones: [],
- editableTabs: [
- {
- checkedWeek: [],
- title: "本周",
- name: "1",
- tableWeekArrage: [],
- weeks:[],
- },
- {
- checkedWeek: [],
- title: "下周",
- name: "2",
- tableWeekArrage: [],
- weeks:[],
-
- },
- {
- checkedWeek: [],
- title: "下下周",
- name: "3",
- tableWeekArrage: [],
- weeks:[],
-
- },
- ],
-
- mode_sel: ["HDF"],
- teem_sel: [
- { name: "上午", id: 1 },
- { name: "下午", id: 2 },
- { name: "晚上", id: 3 },
- ],
- region_sel: ["A区"],
- equip_sel: ["1号"],
- checkedWeek: [], //默认选中那些星期,如不需要可去掉
- week: weekOptions,
- editableTabsValue: "1",
- smartVisible: false,
- cur_drag_obj:1, //當前拖拽對象,用來區分病人列表那的當前選擇和表格内的拖拽對象,1.病人列表,2.表格内的
- cur_drag_info: {
- patient_name: "",
- patient_id: "",
- mode_name: "",
- mode_id: "",
- schedule_date:"",
- schedule_type:"",
- bed_id:"",
- partition_id:"",
- schedule_week:"",
- type_name:"",
- zone_name:"",
- bed_name:"",
- id:"",
- },
- cur_info: {
- patient_name: "",
- patient_id: 0,
- mode_name: "",
- mode_id: 0,
- },
- modes: [],
- patientList: [],
- all_patients: [],
-
- mode_select: [
- {
- value: "1",
- label: "模式一",
- },
- {
- value: "选2",
- label: "模式二",
- },
- {
- value: "3",
- label: "模式三",
- },
- ],
- value: "",
- patient_pre: [],
- // tableContainHeight:400,
- // tableHeight:'window.innerHeight - 0',
- // rowClass: "table-row-new-class schedule-table-row",
- patient_data: [
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- {
- name: "王小虎",
- },
- ],
- searchKey: "",
- tiaoZhengType: 1,
- modeOptions: null,
- keywords: "",
- schedulePatients: [],
- searchTableVisible: false,
- tipDialogVisible:false,
- dialog: {
- tag: "",
- },
- patients: [],
- toDay: "",
- schedulArr: [
- { value: 0, label: "不限" },
- { value: 2, label: "未排班" },
- { value: 1, label: "已排班" },
- ],
- tagArr: [
- { value: 1, label: "不限" },
- { value: 2, label: "透析记录" },
- { value: 3, label: "传染病" },
- ],
- diseasesArr: [{ value: 0, label: "不限" }],
- scheduleType: [
- { id: 1, name: "上午" },
- { id: 2, name: "下午" },
- { id: 3, name: "晚上" },
- ],
- dialogTableVisible: false,
- tzDialogVisible: false,
- msDialogVisible: false,
- jhDialogVisible: false,
- // scheduleZone: this.scheduleZoneProp,
- scheduleZoneRow: -1,
- partitions: [],
- partitions_two: [],
- jihaos_two: [],
-
- jihaos: [],
- weekTitle: ["", "", "", "", "", "", ""],
- isShowOne: true,
- isShowTwo: true,
- isShowThree: true,
- isShowFour: true,
- isShowFive: true,
- isShowSix: true,
- isShowSeven: true,
- weekList: ["", "", "", "", "", "", ""],
- weekDays: ["", "", "", "", "", "", ""],
- currentData: {
- id: 0,
- schedule_date: "",
- schedule_type: 0,
- bed_id: 0,
- partition_id: 0,
- patient_id: 0,
- schedule_week: 0,
- mode_id: 0,
- type_name: "",
- bed_name: "",
-
- partition_type: 0,
- contagions: [],
- patient: "",
- },
- changeSchedule: {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: "",
- },
- patientQuery: {
- keywords: "",
- schedule: 0,
- contagion: 0,
- },
-
- tiaozhengclass: "tiaozhengclass",
- changeRules: {
- mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
- schedule_type: [
- { required: true, message: "请选择班次", trigger: "blur" },
- ],
- partition_id: [
- { required: true, message: "请选择病房", trigger: "blur" },
- ],
- bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }],
- },
-
- weekday: 0,
-
- creating_schedule: false,
- changing_mode: false,
- changing_bed: false,
- current_all_sch: [],
-
- delete_all_sch:[],
- src_all_sch:[],
-
- tableHeight: document.documentElement.clientHeight,
- patient_selc: {},
- origin_schedules: [],
- origin_device_numbers: [],
- zone_device_map: {},
- device_id: 0,
- zone_name: "",
- current_devices: [],
- zone_names: [],
- zone_device_options: [],
- options: [
- { id: 0, name: "全部" },
- { id: 1, name: "上午" },
- { id: 2, name: "下午" },
- { id: 3, name: "晚上" },
- ],
- partition_id: 0,
- schedule_type: "",
-
- smart_jihaos: [
- {
- name: "1号机",
- id: "1",
- },
- {
- name: "2号机",
- id: "2",
- },
- ],
- theType: "",
- scheduleZone: [],
- days: [],
- theWeek: {
- lastWeek: 0,
- thisWeek: 0,
- nextWeek: 0,
- nextTwoWeek: 0,
- },
- zoneIdList: [],
- strArr: "",
- patient_id_hover: 0,
- now_time: "",
- activeItem: {
- day: null,
- index: null,
- name: null,
- },
- cellflag: 0,
- };
- },
-
- watch: {
- week_type: function () {
- this.isShowOne = false;
- this.isShowTwo = false;
- this.isShowThree = false;
- this.isShowFour = false;
- this.isShowFive = false;
- this.isShowSix = false;
- this.isShowSeven = false;
- if (this.week_type.length > 0) {
- for (let i = 0; i < this.week_type.length; i++) {
- if (this.week_type[i] == "周一") {
- this.isShowOne = true;
- } else if (this.week_type[i] == "周二") {
- this.isShowTwo = true;
- } else if (this.week_type[i] == "周三") {
- this.isShowThree = true;
- } else if (this.week_type[i] == "周四") {
- this.isShowFour = true;
- } else if (this.week_type[i] == "周五") {
- this.isShowFive = true;
- } else if (this.week_type[i] == "周六") {
- this.isShowSix = true;
- } else if (this.week_type[i] == "周日") {
- this.isShowSeven = true;
- }
- }
- } else {
- this.isShowOne = true;
- this.isShowTwo = true;
- this.isShowThree = true;
- this.isShowFour = true;
- this.isShowFive = true;
- this.isShowSix = true;
- this.isShowSeven = true;
- }
- },
-
- weekTime: function () {
- var theType = this.weekType(this.weekTime);
-
- this.theType = theType;
- this.getSchedules();
- },
- scheduleZoneRow: function () {
- var theType = this.weekType(this.weekTime);
- this.theType = theType;
- this.getSchedules();
- },
- tableHeight(val) {
- if (!this.timer) {
- this.tableHeight = val;
- this.timer = true;
- const that = this;
- setTimeout(function () {
- that.timer = false;
- }, 400);
- }
- },
- },
- methods: {
- changeSch(row) {
-
- let params = {
- zone_id: row.zone_id,
- sch_type: row.sch_type,
- schedule_date: row.schedule_date,
- patient_id: this.cur_smart_patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.ihaos = [];
- row.jihaos = devices;
- if (devices && devices.length > 0) {
- row.jihao_id = devices[0].id;
- } else {
- row.jihao_id = "";
- }
- }
- });
- },
- blurclick(row) {
-
-
- let params = {
- zone_id: row.zone_id,
- sch_type: row.sch_type,
- schedule_date: row.schedule_date,
- patient_id: this.cur_smart_patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.jihaos = [];
- row.jihaos = devices;
- }
- });
-
- },
- changeArea(row) {
-
-
- let params = {
- zone_id: row.zone_id,
- sch_type: row.sch_type,
- schedule_date: row.schedule_date,
- patient_id: this.cur_smart_patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.jihaos = [];
- row.jihaos = devices;
- if (devices && devices.length > 0) {
- row.jihao_id = devices[0].id;
- } else {
- row.jihao_id = "";
- }
- }
- });
- },
- handleClick() {
- if (this.editableTabsValue == "1") {
-
- console.log(this.first_weeks)
- console.log(this.weeks)
-
-
- for (let i = 0; i < this.weeks.length; i++) {
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
- if (this.weeks[i].week_type >= day) {
- this.weeks[i].is_edit = true;
- } else {
- this.weeks[i].is_edit = false;
- }
- }
-
- for(let i = 0; i < this.weeks.length; i++){
- for(let b = 0; b < this.first_weeks.length; b++){
- if(this.weeks[i].week_type == this.first_weeks[b].week_type && this.first_weeks[b].order_id > 0){
- console.log(this.weeks[i].week_type)
- console.log(this.first_weeks[b].week_type)
- console.log(this.first_weeks[b].order_id)
-
- this.weeks[i].is_edit = false
- }
-
- }
- }
-
-
-
- } else {
- for (let i = 0; i < this.weeks.length; i++) {
- this.weeks[i].is_edit = true;
- }
- }
- },
- getWeekByzhongwen(week_str) {
- switch (week_str) {
- case "周一":
- return 1;
- break;
- case "周二":
- return 2;
- break;
- case "周三":
- return 3;
- break;
- case "周四":
- return 4;
- break;
- case "周五":
- return 5;
- break;
- case "周六":
- return 6;
- break;
- case "周日":
- return 7;
- break;
- }
- },
- cancel() {
- this.smartVisible = false;
- this.smart_keyword = "";
- },
- batchSetSch() {
- var saveOrEditTempData = [];
- var delTempData = [];
-
- var day = new Date().getDay();
- if (day == 0) {
- day = 7;
- }
-
- for (let b = 0; b < this.editableTabs[0].tableWeekArrage.length; b++) {
- //只有大于等于今天的数据才能保存和没有上机的
- if (
- this.getWeekByzhongwen(
- this.editableTabs[0].tableWeekArrage[b].week
- ) >= day &&
- this.editableTabs[0].tableWeekArrage[b].is_edit
- ) {
- let obj = {
- schedule_date:
- this.editableTabs[0].tableWeekArrage[b].schedule_date,
- schedule_type: this.editableTabs[0].tableWeekArrage[b].sch_type,
- bed_id: this.editableTabs[0].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.editableTabs[0].tableWeekArrage[b].week
- ),
- mode_id: this.editableTabs[0].tableWeekArrage[b].mode_id,
- sch_id: this.editableTabs[0].tableWeekArrage[b].sch_id,
- zone_id: this.editableTabs[0].tableWeekArrage[b].zone_id,
- week_type: "1",
- week_name: this.editableTabs[0].tableWeekArrage[b].week,
- };
- saveOrEditTempData.push(obj);
- }
- }
- for (let b = 0; b < this.editableTabs[1].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.editableTabs[1].tableWeekArrage[b].schedule_date,
- schedule_type: this.editableTabs[1].tableWeekArrage[b].sch_type,
- bed_id: this.editableTabs[1].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.editableTabs[1].tableWeekArrage[b].week
- ),
- mode_id: this.editableTabs[1].tableWeekArrage[b].mode_id,
- sch_id: this.editableTabs[1].tableWeekArrage[b].sch_id,
- zone_id: this.editableTabs[1].tableWeekArrage[b].zone_id,
- week_type: "2",
- week_name: this.editableTabs[1].tableWeekArrage[b].week,
- };
- saveOrEditTempData.push(obj);
- }
- for (let b = 0; b < this.editableTabs[2].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.editableTabs[2].tableWeekArrage[b].schedule_date,
- schedule_type: this.editableTabs[2].tableWeekArrage[b].sch_type,
- bed_id: this.editableTabs[2].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.editableTabs[2].tableWeekArrage[b].week
- ),
- mode_id: this.editableTabs[2].tableWeekArrage[b].mode_id,
- sch_id: this.editableTabs[2].tableWeekArrage[b].sch_id,
- zone_id: this.editableTabs[2].tableWeekArrage[b].zone_id,
- week_type: "3",
- week_name: this.editableTabs[2].tableWeekArrage[b].week,
- };
- saveOrEditTempData.push(obj);
- }
-
- //原始数据,用来与智能排版的数据进行比对,查出有排班记录,取消勾选的数据,作为删除的数据,提交给后端
-
- for (let b = 0; b < this.current_patient_data[0].tableWeekArrage.length; b++) {
- //只有大于等于今天的数据才能保存和没有上机的
- if (
- this.getWeekByzhongwen(
- this.current_patient_data[0].tableWeekArrage[b].week
- ) >= day &&
- this.current_patient_data[0].tableWeekArrage[b].is_edit
- ) {
- let obj = {
- schedule_date:
- this.current_patient_data[0].tableWeekArrage[b].schedule_date,
- schedule_type: this.current_patient_data[0].tableWeekArrage[b].sch_type,
- bed_id: this.current_patient_data[0].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.current_patient_data[0].tableWeekArrage[b].week
- ),
- mode_id: this.current_patient_data[0].tableWeekArrage[b].mode_id,
- sch_id: this.current_patient_data[0].tableWeekArrage[b].sch_id,
- zone_id: this.current_patient_data[0].tableWeekArrage[b].zone_id,
- week_type: "1",
- week_name: this.current_patient_data[0].tableWeekArrage[b].week,
- };
- delTempData.push(obj);
- }
- }
- for (let b = 0; b < this.current_patient_data[1].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.current_patient_data[1].tableWeekArrage[b].schedule_date,
- schedule_type: this.current_patient_data[1].tableWeekArrage[b].sch_type,
- bed_id: this.current_patient_data[1].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.current_patient_data[1].tableWeekArrage[b].week
- ),
- mode_id: this.current_patient_data[1].tableWeekArrage[b].mode_id,
- sch_id: this.current_patient_data[1].tableWeekArrage[b].sch_id,
- zone_id: this.current_patient_data[1].tableWeekArrage[b].zone_id,
- week_type: "2",
- week_name: this.current_patient_data[1].tableWeekArrage[b].week,
- };
- delTempData.push(obj);
- }
- for (let b = 0; b < this.current_patient_data[2].tableWeekArrage.length; b++) {
- let obj = {
- schedule_date: this.current_patient_data[2].tableWeekArrage[b].schedule_date,
- schedule_type: this.current_patient_data[2].tableWeekArrage[b].sch_type,
- bed_id: this.current_patient_data[2].tableWeekArrage[b].jihao_id,
- schedule_week: this.getWeekByzhongwen(
- this.current_patient_data[2].tableWeekArrage[b].week
- ),
- mode_id: this.current_patient_data[2].tableWeekArrage[b].mode_id,
- sch_id: this.current_patient_data[2].tableWeekArrage[b].sch_id,
- zone_id: this.current_patient_data[2].tableWeekArrage[b].zone_id,
- week_type: "3",
- week_name: this.current_patient_data[2].tableWeekArrage[b].week,
- };
- delTempData.push(obj);
- }
-
-
- console.log(saveOrEditTempData)
- console.log(delTempData)
-
-
- if(saveOrEditTempData.length > 0 ){
- for (let i = 0; i < delTempData.length; i++) {
- for (let b = 0; b < saveOrEditTempData.length; b++) {
- if(saveOrEditTempData[b].sch_id&&delTempData[i].sch_id&&delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
- delTempData.splice(i,1)
- }
- }
- }
-
- }
- for (let i = 0; i < saveOrEditTempData.length; i++) {
- if (saveOrEditTempData[i].bed_id == "" || saveOrEditTempData[i].zone_id == "") {
- this.$message.error("分区或者床位不能空");
- return;
- }
- }
-
-
- if (saveOrEditTempData.length > 0 || delTempData.length > 0) {
-
- let obj = {
- smart_schs: saveOrEditTempData,
- del_schs:delTempData,
- };
- if(!this.saveloading){
- this.saveloading = true;
- BatchSmartSch(obj, this.cur_smart_patient_id).then((response) => {
- if (response.data.state == 1) {
- this.saveloading = false;
-
- this.$message.success("保存成功");
- this.smartVisible = false;
- this.smart_keyword = "";
- this.getSchedules();
- } else {
- this.saveloading = false;
- this.smart_keyword = "";
-
- this.$message.error(response.data.msg);
- return;
- }
- });
-
-
- }
-
- } else {
- this.$message.success("保存成功");
- }
- var week = this.weekDay(day);
- if (week[0] == -1 || week[1] == -1) {
- return false;
- }
- if (this.toDay > this.weekDays[week[0] - 1]) {
- return false;
- }
- this.currentData.schedule_date = this.weekDays[week[0] - 1];
- this.currentData.schedule_type = week[1];
- this.currentData.bed_id = row.jihao_id;
- this.currentData.partition_id = row.zone_id;
- this.currentData.schedule_week = week[0];
- this.currentData.type_name = this.dayType(week[1]);
- this.currentData.zone_name = row.area;
- this.currentData.bed_name = row.cut;
- this.currentData.partition_type = row.zone_type;
- this.currentData.mode_id = this.cur_info.mode_id;
- this.currentData.id = 0;
- this.currentData.contagions = [];
- this.currentData.patient_id = this.cur_info.patient_id;
- this.currentData.patient = this.cur_info.patient_name;
- this.setSchedule()
- },
- querySearchAsync(keyword, cb) {
- let key = "";
- if (keyword != undefined) {
- key = keyword;
- }
- let searchArray = [];
- let obj = {
- keyword: key,
- };
- PostSearchSmartSchPatient(obj).then((response) => {
- if (response.data.state == 1) {
- searchArray = response.data.data.patient;
- cb(searchArray);
- } else {
- cb([]);
- }
- });
- },
- getTime(value, temp) {
- if (value != undefined) {
- return uParseTime(value, temp);
- }
- return "";
- },
- handleSelect(val) {
- this.first_weeks = []
- this.dataloading = true
- getSmartSchByPatient(val.id).then((response) => {
- this.dataloading = false
- var sch = response.data.data.sch
- this.editableTabsValue = "1";
- this.editableTabs[0].tableWeekArrage = [];
- this.editableTabs[1].tableWeekArrage = [];
- this.editableTabs[2].tableWeekArrage = [];
- this.editableTabs[0].checkedWeek = [];
- this.editableTabs[1].checkedWeek = [];
- this.editableTabs[2].checkedWeek = [];
-
- var tempDate = new Date();
- var day = tempDate.getDay();
-
- if (day == 0) {
- day = 7;
- }
- this.smart_keyword = val.name;
- this.cur_smart_patient_id = val.id;
- this.cur_smart_patient_name = val.name;
- this.cur_smart_patient_no = val.dialysis_no;
- //过滤出当前患者所有排班信息,填充对应的数据到智能排班列表
- //根据患者的排班日期判断属于本周还是下周还是下下周
- for (let i = 0; i < sch.length; i++) {
- var week_type = this.getWeekType(
- this.getTime(sch[i].schedule_date, "{y}-{m}-{d}")
- );
-
- switch (week_type) {
- case "1":
- var obj = {
- mode_id: sch[i].mode_id,
- sch_type: sch[i].schedule_type,
- zone_id: sch[i].partition_id,
- jihao_id:sch[i].bed_id,
- is_edit: false,
- week: this.getWeek(sch[i].schedule_week),
- jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
- schedule_date: this.getDate(sch[i].schedule_week),
- sch_id: sch[i].id,
- };
- let is_edit = true;
-
-
- if (sch[i].schedule_week < day || sch[i].order.id > 0) {
- is_edit = false;
- } else {
- is_edit = true;
- }
- obj.is_edit = is_edit;
-
- for (let b = 0; b < this.weeks.length; b++) {
-
- if (sch[i].schedule_week == this.weeks[b].week_type) {
- if (
- this.weeks[b].week_type >= day ||
- sch[i].order.id == 0
- ) {
- this.weeks[b].is_edit = true;
- } else {
- let obj = {
- week_type:this.weeks[b].week_type,
- order_id:sch[i].order.id,
- }
- this.first_weeks.push(obj)
- this.weeks[b].is_edit = false;
- }
- this.editableTabs[0].checkedWeek.push(this.weeks[b]);
- }
-
-
-
- }
-
- this.editableTabs[0].tableWeekArrage.push(obj);
- break;
- case "2":
- var obj2 = {
- mode_id: sch[i].mode_id,
- sch_type: sch[i].schedule_type,
- zone_id: sch[i].partition_id,
- jihao_id: sch[i].bed_id,
- is_edit: false,
- week: this.getWeek(sch[i].schedule_week),
- jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
- schedule_date: this.getDate(sch[i].schedule_week + 7),
- sch_id: sch[i].id,
- };
- let is_edit2 = true;
- obj2.is_edit = is_edit2;
-
- // let checkObj2={
- // name:this.getWeek(val.sch[i].schedule_week),
- // week_type:val.sch[i].schedule_week,
- // is_edit:is_edit2
- // }
-
- // this.editableTabs[1].checkedWeek.push(checkObj2)
-
- for (let b = 0; b < this.weeks.length; b++) {
- if (sch[i].schedule_week == this.weeks[b].week_type) {
- // this.weeks[b].is_edit = true;
- this.editableTabs[1].checkedWeek.push(this.weeks[b]);
- }
-
-
- }
-
- this.editableTabs[1].tableWeekArrage.push(obj2);
- break;
-
- case "3":
- let obj3 = {
- mode_id: sch[i].mode_id,
- sch_type: sch[i].schedule_type,
- zone_id: sch[i].partition_id,
- jihao_id: sch[i].bed_id,
- is_edit: false,
- week: this.getWeek(sch[i].schedule_week),
- jihaos: this.partitionsProp[sch[i].partition_id].jihaos,
- schedule_date: this.getDate(sch[i].schedule_week + 14),
- sch_id: sch[i].id,
- };
- let is_edit3 = true;
- obj3.is_edit = is_edit3;
- for (let b = 0; b < this.weeks.length; b++) {
- if (sch[i].schedule_week == this.weeks[b].week_type) {
- // this.weeks[b].is_edit = true;
- this.editableTabs[2].checkedWeek.push(this.weeks[b]);
-
- }
-
-
- }
-
- this.editableTabs[2].tableWeekArrage.push(obj3);
- break;
- }
- }
- if(this.editableTabsValue == "1") {
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
- for (let i = 0; i < this.weeks.length; i++) {
- if (this.weeks[i].week_type < day) {
- this.weeks[i].is_edit = false;
- }
- }
- }
-
- this.src_all_sch = this.editableTabs;
- this.current_patient_data = []
- this.current_patient_data = this.deepClone(this.src_all_sch)
-
- });
-
-
- },
- getDate(week_type) {
-
- switch (week_type) {
- case 1:
- return this.days[0];
- break;
- case 2:
- return this.days[1];
- break;
- case 3:
- return this.days[2];
- break;
- case 4:
- return this.days[3];
- break;
- case 5:
- return this.days[4];
- break;
- case 6:
- return this.days[5];
- break;
- case 7:
- return this.days[6];
- break;
- case 8:
- return this.days[7];
- break;
- case 9:
- return this.days[8];
- break;
- case 10:
- return this.days[9];
- break;
- case 11:
- return this.days[10];
- break;
- case 12:
- return this.days[11];
- break;
- case 13:
- return this.days[12];
- break;
- case 14:
- return this.days[13];
- break;
- case 15:
- return this.days[14];
- break;
- case 16:
- return this.days[15];
- break;
- case 17:
- return this.days[16];
- break;
- case 18:
- return this.days[17];
- break;
- case 19:
- return this.days[18];
- break;
- case 20:
- return this.days[19];
- break;
- case 21:
- return this.days[20];
- break;
- }
- },
- deepClone(source) {
- if (!source && typeof source !== 'object') {
- throw new Error('error arguments', 'shallowClone')
- }
- const targetObj = source.constructor === Array ? [] : {}
- Object.keys(source).forEach((keys) => {
- if (source[keys] && typeof source[keys] === 'object') {
- targetObj[keys] = this.deepClone(source[keys])
- } else {
- targetObj[keys] = source[keys]
- }
- })
- return targetObj
- },
- getWeek(week) {
- switch (week) {
- case 1:
- return "周一";
- break;
- case 2:
- return "周二";
-
- break;
- case 3:
- return "周三";
-
- break;
- case 4:
- return "周四";
-
- break;
- case 5:
- return "周五";
-
- break;
- case 6:
- return "周六";
-
- break;
- case 7:
- return "周日";
-
- break;
- }
- },
- getWeekType(date) {
-
-
- let index = 0;
- for (let i = 0; i < this.days.length; i++) {
- if (date == this.days[i]) {
- index = i;
-
- }
- }
-
- if (index >= 0 && index <= 6) {
- return "1";
- } else if (index > 6 && index <= 13) {
- return "2";
- } else if (index > 13 && index <= 20) {
- return "3";
- }
- },
- showSmartDialog() {
- this.dataloading = true
- this.editableTabsValue = "1";
- for (let i = 0; i < this.patientList.length; i++) {
- if (this.patientList[i].id == this.cur_info.patient_id) {
- this.cur_smart_patient_name = this.patientList[i].name;
- this.cur_smart_patient_no = this.patientList[i].dialysis_no;
- this.cur_smart_patient_id = this.patientList[i].id;
- }
- }
-
- let params = {
- patient_id: this.cur_info.patient_id,
- };
- let data = [
- {
- checkedWeek: [],
- title: "本周",
- name: "1",
- tableWeekArrage: [],
- },
- {
- checkedWeek: [],
- title: "下周",
- name: "2",
- tableWeekArrage: [],
- },
- {
- checkedWeek: [],
- title: "下下周",
- name: "3",
- tableWeekArrage: [],
- },
- ];
- this.first_weeks = []
- getPatientSmartSch(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- }
- var schedules = response.data.data.schedules;
- this.dataloading = false
- this.current_all_sch[0].tableWeekArrage = [];
- this.current_all_sch[1].tableWeekArrage = [];
- this.current_all_sch[2].tableWeekArrage = [];
- this.editableTabs[0].tableWeekArrage = [];
- this.editableTabs[0].checkedWeek = [];
- this.editableTabs[1].tableWeekArrage = [];
- this.editableTabs[1].checkedWeek = [];
- this.editableTabs[2].tableWeekArrage = [];
- this.editableTabs[2].checkedWeek = [];
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
-
- for (let i = 0; i < schedules.length; i++) {
-
-
- var week_type = this.getWeekType(
- this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
- ).toString();
-
- switch (week_type) {
- case "1":
- var obj = {
- mode_id: schedules[i].mode_id,
- sch_type: schedules[i].schedule_type,
- zone_id: schedules[i].partition_id,
- jihao_id: schedules[i].bed_id,
- is_edit: false,
- week: this.getWeek(schedules[i].schedule_week),
- schedule_date: this.getDate(schedules[i].schedule_week),
- jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
- sch_id: schedules[i].id,
- };
- let is_edit = true;
- if (
- schedules[i].schedule_week < day ||
- schedules[i].order.id > 0
- ) {
- is_edit = false;
- } else {
- is_edit = true;
- }
- obj.is_edit = is_edit;
- console.log("schedules[i].order.id")
-
- console.log(schedules[i].order.id)
-
- for (let b = 0; b < this.weeks.length; b++) {
- if (schedules[i].schedule_week == this.weeks[b].week_type) {
- if (
- this.weeks[b].week_type >= day &&
- schedules[i].order.id == 0
- ) {
- this.weeks[b].is_edit = true;
- } else {
- let obj = {
- week_type:this.weeks[b].week_type,
- order_id:schedules[i].order.id,
- }
- this.first_weeks.push(obj)
- this.weeks[b].is_edit = false;
- }
-
- this.editableTabs[0].checkedWeek.push(this.weeks[b]);
- }
- }
- data[0].tableWeekArrage.push(obj);
-
- this.editableTabs[0].tableWeekArrage.push(obj);
- break;
- case "2":
- var obj2 = {
- mode_id: schedules[i].mode_id,
- sch_type: schedules[i].schedule_type,
- zone_id: schedules[i].partition_id,
- jihao_id: schedules[i].bed_id,
- is_edit: true,
- week: this.getWeek(schedules[i].schedule_week),
- schedule_date: this.getDate(schedules[i].schedule_week + 7),
- jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
- sch_id: schedules[i].id,
- };
-
- for (let b = 0; b < this.weeks.length; b++) {
- if (schedules[i].schedule_week == this.weeks[b].week_type) {
- // this.weeks[b].is_edit = true;
- this.editableTabs[1].checkedWeek.push(this.weeks[b]);
- }
- }
- data[1].tableWeekArrage.push(obj2);
- this.editableTabs[1].tableWeekArrage.push(obj2);
- break;
-
- case "3":
- let obj3 = {
- mode_id: schedules[i].mode_id,
- sch_type: schedules[i].schedule_type,
- zone_id: schedules[i].partition_id,
- jihao_id: schedules[i].bed_id,
- is_edit: true,
- week: this.getWeek(schedules[i].schedule_week),
- schedule_date: this.getDate(schedules[i].schedule_week + 14),
- jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
- sch_id: schedules[i].id,
- };
- for (let b = 0; b < this.weeks.length; b++) {
- if (schedules[i].schedule_week == this.weeks[b].week_type) {
- // this.weeks[b].is_edit = true;
- this.editableTabs[2].checkedWeek.push(this.weeks[b]);
- }
- }
- data[2].tableWeekArrage.push(obj3);
-
- this.editableTabs[2].tableWeekArrage.push(obj3);
- break;
- }
- }
- });
-
- if(this.editableTabsValue == "1") {
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
- for (let i = 0; i < this.weeks.length; i++) {
- if (this.weeks[i].week_type < day) {
- this.weeks[i].is_edit = false;
- }
- }
- }
-
-
- for (let i = 0; i < this.editableTabs.length; i++) {
- for(let b = 0; b < this.editableTabs[i].tableWeekArrage.length;b++){
- data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
-
-
-
- }
- }
-
- data.sort(function (a, b) {
- return a.week_type - b.week_type;
- });
-
-
-
- this.current_patient_data = data
- console.log("current_patient_data")
- console.log(this.current_patient_data)
-
- this.smartVisible = true;
- this.current_all_sch = data;
- this.src_all_sch = data;
-
- },
-
- select_week(val) {
- this.current_all_sch = this.editableTabs
- var sch = [];
- for (let i = 0; i < this.current_all_sch.length; i++) {
- if (this.current_all_sch[i].name == this.editableTabsValue) {
- sch = this.current_all_sch[i];
- }
- }
- let data = [];
- for (let i = 0; i < val.length; i++) {
- let is_new = true;
- let week_name = val[i].name;
-
- let obj = {};
- for (let b = 0; b < sch.tableWeekArrage.length; b++) {
- if (week_name == sch.tableWeekArrage[b].week) {
- is_new = false;
- obj = sch.tableWeekArrage[b];
- }
- }
-
-
- let keyIndex = "";
- for (var key in this.partitionsProp) {
- keyIndex = key;
- }
-
- if (!is_new) {
- data.push(obj);
- } else {
- if (this.editableTabsValue == "2") {
- data.push({
- mode_id: 1,
- week: val[i].name,
- sch_type: 1,
- zone_id: "",
- jihao_id: "",
- is_edit: true,
- schedule_date: this.getDate(val[i].week_type + 7),
- jihaos: [],
- sch_id: 0,
- });
- } else if (this.editableTabsValue == "3") {
- data.push({
- mode_id: 1,
- week: val[i].name,
- sch_type: 1,
- zone_id: "",
- jihao_id: "",
- is_edit: true,
- schedule_date: this.getDate(val[i].week_type + 14),
- jihaos: [],
- sch_id: 0,
- });
- } else {
- data.push({
- mode_id: 1,
- week: val[i].name,
- sch_type: 1,
- zone_id: "",
- jihao_id: "",
- is_edit: true,
- schedule_date: this.getDate(val[i].week_type),
- jihaos: [],
- sch_id: 0,
- });
- }
- }
- }
-
- for (let i = 0; i < data.length; i++) {
- data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
- }
-
- data.sort(function (a, b) {
- return a.week_type - b.week_type;
- });
-
- for (let i = 0; i < this.editableTabs.length; i++) {
- if (this.editableTabs[i].name == this.editableTabsValue) {
- this.editableTabs[i].tableWeekArrage = data;
- }
- }
-
- this.current_all_sch = this.editableTabs
-
-
-
-
- },
- curInfoDragStart(){
- this.cur_drag_obj = 1
- this.cur_drag_info.patient_id = this.cur_info.patient_id
- this.cur_drag_info.patient_name = this.cur_info.patient_name
- this.cur_drag_info.mode_id = this.cur_info.mode_id
- this.cur_drag_info.mode_name = this.cur_info.mode_name
-
-
- },
- patientClick(row) {
-
- this.cur_info.patient_name = row.name;
- this.cur_info.patient_id = row.id;
- this.patient_id_hover = row.id
- },
- modeClick(row) {
-
- this.cur_info.mode_name = row.name;
- this.cur_info.mode_id = row.id;
- },
- setEditData(patients, modes, days, zones) {
- var date = new Date()
- this.time = date
- var year = date.getFullYear()
- var month = date.getMonth() + 1
- if (month < 10) {
- month = "0" + month
- }
- var day = date.getDate()
- if (day < 10) {
- day = "0" + day
- }
- var nowDate = year + "-" + month + "-" + day
- var date = new Date(nowDate + " 00:00:00")
- this.cur_date = date.getTime()/1000
-
-
- this.days = days;
- this.all_zones = zones;
- this.patientList = patients;
- this.all_patients = patients;
- for (var key in modes) {
- let obj = {
- id: modes[key].id,
- name: modes[key].name,
- };
- this.modes.push(obj);
- }
- this.cur_info["patient_name"] = this.patientList[0].name;
- this.cur_info["mode_name"] = this.modes[0].name;
- this.cur_info["patient_id"] = this.patientList[0].id;
- this.cur_info["mode_id"] = this.modes[0].id;
- this.patient_id_hover = this.patientList[0].id
- this.$refs.patient_table.setCurrentRow(this.patientList[0]);
- this.$refs.mode_table.setCurrentRow(this.modes[0]);
- for (let i = 0; i < this.weeks.length; i++) {
- var tempDate = new Date();
- var day = tempDate.getDay();
- if (day == 0) {
- day = 7;
- }
- if (this.weeks[i].week_type >= day) {
- this.weeks[i].is_edit = true;
- } else {
- this.weeks[i].is_edit = false;
- }
- }
-
-
- if (this.partitions_two.length > 0) {
- this.jihaos_two.push(this.partitions_two[0].jihaos);
- }
- },
- dragstartTwo(event, item) {},
- dragendTwo(event) {},
- isEditForDate(day){
- var week = this.weekDay(day);
- if( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 >= this.cur_date){
- return true
- }else{
- return false
- }
-
- },
- drag(e, day, index, name, row) {
- e.preventDefault();
- for (var key in row) {
- if (key == day) {
- console.log(row[key].patient_id)
-
- if(row[key].patient_id > 0 ) {
- this.cur_drag_obj = 2
- var week = this.weekDay(day);
- this.cur_drag_info.schedule_date = this.weekDays[week[0] - 1];
- this.cur_drag_info.schedule_type = week[1];
- this.cur_drag_info.bed_id = row.jihao_id;
- this.cur_drag_info.partition_id = row.zone_id;
- this.cur_drag_info.schedule_week = week[0];
- this.cur_drag_info.type_name = this.dayType(week[1]);
- this.cur_drag_info.zone_name = row.area;
- this.cur_drag_info.bed_name = row.cut;
- this.cur_drag_info.mode_id = row[key].mode_id;
- this.cur_drag_info.mode_name = row[key].mode_name;
- this.cur_drag_info.patient_name = row[key].patient;
- this.cur_drag_info.patient_id = row[key].patient_id;
- this.cur_drag_info.id = row[key].schedule_id;
-
- }
- }
- }
- },
- allowDrop(e) {
- e.preventDefault();
- },
- coverSch(){
- let params={
- id_one:this.cur_drag_info.id,
- id_two:this.currentData.id
-
- }
- CoverSch(params).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.tipDialogVisibleTwo = false
-
- } else {
- this.$message.success("替换成功");
- this.tipDialogVisible = false
- this.tipDialogVisibleTwo = false
- this.getSchedules();
- }
- });
- },
- changeSchTwo(){
- let params={
- id_one:this.cur_drag_info.id,
- id_two:this.currentData.id
-
- }
- ExchangeSch(params).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.tipDialogVisibleThree = false
- } else {
- this.$message.success("交换成功");
- this.tipDialogVisible = false
- this.tipDialogVisibleThree = false
- this.getSchedules();
-
- }
- });
- },
- // ----------------------------------
- // | !在html里面的chedule-item里绑定的|
- // | ":draggable"可控制该表格能否拖 |
- // | 动,根据实际情况进行修改 |
- // | |
- // -----------------------------------
- drop(e, day, index, name, row) {
-
- e.preventDefault();
- console.log("cnm")
- for (var key in row) {
- if (key == day) {
- console.log("cnm1111111")
- console.log(this.cur_drag_obj)
-
- var week = this.weekDay(day);
- this.currentData.schedule_date = this.weekDays[week[0] - 1];
- this.currentData.schedule_type = week[1];
- this.currentData.bed_id = row.jihao_id;
- this.currentData.partition_id = row.zone_id;
- this.currentData.schedule_week = week[0];
- this.currentData.type_name = this.dayType(week[1]);
- this.currentData.zone_name = row.area;
- this.currentData.bed_name = row.cut;
- this.currentData.id = row[key].schedule_id;
-
- this.currentData.partition_type = row.zone_type;
- if (row[key].patient.length > 0 || row[key].mode_name.length > 0 || row[key].mode_id > 0 || row[key].patient_id > 0) {
- if (this.cur_drag_obj == 2){
- this.tipDialogVisible = true
- }else{
- this.$message.error("当前机号已有排班");
- return;
- }
-
- } else {
- //當前類型是表格内的拖拽,如果是同一天内的表格拖拽到空床位則先刪除原先排版,后在將排班弄到空床位
- if(this.cur_drag_obj == 2 ){
- if(this.cur_drag_info.schedule_date == this.currentData.schedule_date){ //同一天
- if(row[key].patient_id == 0) { //空床位
- CancelScheduleTwo(this.cur_drag_info.id).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: 0,
- mode_id: 0,
- patient_id: 0,
- patient: "",
- mode_name: "",
- dialysis_machine_name: "",
- };
-
- that.scheduleZone[index].total -= 1;
- }
- }
- });
- //接口提交排班数据
- that.currentData.mode_id = that.cur_drag_info.mode_id;
- that.currentData.id = 0;
- that.currentData.contagions = [];
- that.currentData.patient_id = that.cur_drag_info.patient_id;
- that.currentData.patient = that.cur_drag_info.patient_name;
- that.setSchedule();
- }
- });
-
- }else{ //非空,替換或者交換位置
- this.tipDialogVisible = true
- }
-
- }else{ // 非同一天
- if(row[key].patient_id == 0) { //空床位
- this.currentData.mode_id = this.cur_drag_info.mode_id;
- this.currentData.id = 0;
- this.currentData.contagions = [];
- this.currentData.patient_id = this.cur_drag_info.patient_id;
- this.currentData.patient = this.cur_drag_info.patient_name;
- this.setSchedule();
- }else{ //非空,替換或者交換位置
-
- this.tipDialogVisible = true
-
-
- }
-
- }
- }else{
-
- //接口提交排班数据
- this.currentData.mode_id = this.cur_drag_info.mode_id;
- this.currentData.id = 0;
- this.currentData.contagions = [];
- this.currentData.patient_id = this.cur_drag_info.patient_id;
- this.currentData.patient = this.cur_drag_info.patient_name;
- this.setSchedule();
-
-
- }
-
-
- }
- }
- }
- },
-
-
- // 左边栏选中名字和模式拖动结束后
- taskDraggerEnd(e) {
-
- },
-
- //move回调方法
- onMove(e, originalEvent) {
- return true;
- },
-
- compare(p) {
- //这是比较函数
- return function (m, n) {
- var a = m[p];
- var b = n[p];
- return a - b; //升序
- };
- },
- getWeekPanels() {
- this.scheduleZone = [];
- var partionStr = this.partition_id;
- var arr = this.zoneIdList.join(",");
-
- var str = "";
- if (partionStr == 0) {
- str = arr;
- }
- if (partionStr != 0) {
- str = partionStr.join(",");
- }
-
- getWeekPanelsOne(1, str).then((response) => {
- if (response.data.state == 0) {
- return false;
- }
- var partitions = response.data.data.partitions;
-
- this.theWeek.thisWeek = response.data.data.theWeek;
-
- this.theWeek.lastWeek = this.theWeek.thisWeek - 1;
- this.theWeek.nextWeek = this.theWeek.thisWeek + 1;
- this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2;
- var that = this;
- if (partitions.length > 0) {
- partitions.forEach(function (partition) {
- if (partition.jihaos.length == 0) {
- return false;
- }
- that.scheduleZoneRow.push(partition.jihaos.length);
-
- that.partitions[partition.id] = partition;
-
- partition.jihaos.forEach(function (jihao) {
- var thisPa = {
- area: partition.name,
- zone_id: partition.id,
- zone_type: partition.type,
- cut: jihao.number,
- jihao_id: jihao.id,
- sort: jihao.sort,
- Mon_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Mon_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Mon_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Tue_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Tue_A: {
- schedule_id: 0,
- mode_id: 0,
- dialysis_machine_name: "",
-
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Tue_N: {
- schedule_id: 0,
- mode_id: 0,
- dialysis_machine_name: "",
-
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Wed_M: {
- schedule_id: 0,
- mode_id: 0,
- dialysis_machine_name: "",
-
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Wed_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- dialysis_machine_name: "",
-
- jihao_id: jihao.id,
- },
- Wed_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- dialysis_machine_name: "",
-
- jihao_id: jihao.id,
- },
- Thurs_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- dialysis_machine_name: "",
-
- jihao_id: jihao.id,
- },
- Thurs_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
-
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Thurs_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
-
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Fri_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Fri_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Fri_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sat_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sat_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sat_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- },
- Sun_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sun_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- Sun_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- zone_id: partition.id,
- jihao_id: jihao.id,
- },
- total: 0,
- };
-
- that.scheduleZone.push(thisPa);
- });
- });
- }
-
- this.scheduleZone.sort(this.compare("sort"));
- });
- },
-
- cellClass({ row, column, rowIndex, columnIndex }) {
- if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
- return "";
- } else {
- if (this.weekTime == "lastWeek") {
- if (
- row[column.property].patient_id > 0 &&
- row[column.property].patient_id == this.patient_id_hover
- ) {
- return "hover-td schedule-table-cell-disable";
- } else {
- return "schedule-table-cell-disable";
- }
- // return "schedule-table-cell-disable";
- } else if (this.weekTime == "thisWeek") {
- var weekday = Math.floor((columnIndex - 2) / 3 + 1);
- if (weekday < this.weekday) {
- if (
- row[column.property].patient_id > 0 &&
- row[column.property].patient_id == this.patient_id_hover
- ) {
- return "hover-td schedule-table-cell-disable";
- } else {
- return "schedule-table-cell-disable";
- }
- // return "schedule-table-cell-disable";
- } else {
- if (
- row[column.property].patient_id > 0 &&
- row[column.property].patient_id == this.patient_id_hover
- ) {
- return "hover-td";
- } else {
- return "";
- }
- }
- }
- }
- return "";
- },
- SubmitSearch() {
- this.patientQuery.keywords = this.searchKey;
- this.getSchedulePatients();
- },
- changeSearchContagion(id) {
- this.patientQuery.contagion = id;
- this.getSchedulePatients();
- },
- changeSearchSchedule(id) {
- this.patientQuery.schedule = id;
- this.getSchedulePatients();
- },
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0 || index === 25) {
- sums[index] = "总数";
- return;
- }
- if (index === 1 || index === 24) {
- sums[index] = data.length;
- return;
- }
-
- const values = data.map((item) => item[column.property]);
-
- if (index === 23) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- return;
- }
-
- sums[index] = values.reduce((prev, curr) => {
- if (typeof curr["mode_id"] === "undefined") {
- return prev;
- }
- const value = Number(curr["mode_id"]);
- if (!isNaN(value) && value > 0) {
- return prev + 1;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- });
- this.$nextTick(() => {
- this.$refs.table.doLayout();
- });
-
- return sums;
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- var that = this;
- var rowNum = 0;
- rowNumber = 0;
- var rutrnData = {};
- if (columnIndex === 0 || columnIndex == 25) {
- var rowLen = this.scheduleZoneRow.length;
- if (rowLen > 0) {
- for (let index = 0; index < rowLen; index++) {
- rowNum = this.scheduleZoneRow[index];
- rowNumber += rowNum;
- var f = rowNumber - rowNum;
- if (f == rowIndex) {
- rutrnData = {
- rowspan: rowNum,
- colspan: 1,
- };
- break;
- } else if (rowIndex < rowNumber) {
- rutrnData = {
- rowspan: 0,
- colspan: 0,
- };
- break;
- }
- }
- return rutrnData;
- }
- }
- },
- handleCurrentChange(row) {
- if (typeof row === "undefined" || row == null) {
- this.currentData.patient_id = 0;
- this.currentData.contagions = [];
- } else {
- this.currentData.patient_id = row.id;
- this.currentData.contagions = row.contagions;
- }
- },
- closePatientPanel(row) {
- this.dialogTableVisible = false;
- this.$refs.singleTable.setCurrentRow(row);
- this.currentData.patient_id = 0;
- },
- getSchedules() {
- var partionStr = this.partition_id;
- var arr = this.zoneIdList.join(",");
- var str = "";
- if (partionStr == 0) {
- str = arr;
- }
- if (partionStr != 0) {
- str = partionStr.join(",");
- }
- const params = {
- weekTime: this.theType,
- patitionid: str,
- schedule_type: this.schedule_type,
- };
-
- getSchedulesOne(params).then((response) => {
- if (response.data.state == 1) {
- this.weekTitle = response.data.data.weekTitle;
-
- this.weekDays = response.data.data.days;
- this.toDay = response.data.data.today;
- var theSchedules = response.data.data.schdules;
-
- var that = this;
-
- this.scheduleZone.forEach(function (zone, index) {
- that.scheduleZone[index].Mon_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Mon_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Mon_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Tue_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Tue_A = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Tue_N = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Wed_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Wed_A = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Wed_N = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Thurs_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Thurs_A = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Thurs_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Fri_M = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Fri_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Fri_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Sat_M = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Sat_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Sat_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- };
- that.scheduleZone[index].Sun_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].Sun_N = {
- mode_id: 0,
- mode_name: "",
- dialysis_machine_name: "",
-
- patient_id: 0,
- patient: "",
- };
- that.scheduleZone[index].Sun_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- dialysis_machine_name: "",
-
- patient: "",
- };
- that.scheduleZone[index].total = 0;
-
- if (response.data.data.schdules.length > 0) {
- theSchedules.forEach(function (schedule, sindex) {
- if (zone.jihao_id == schedule.bed_id) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
-
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: schedule.patient,
- dialysis_machine_name: schedule.dialysis_machine_name,
- patient_contagions: schedule.patient_contagions,
- mode_name:
- typeof that.modeOptions[schedule.mode_id] ===
- "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name,
- };
- that.scheduleZone[index].total += 1;
- }
- }
- });
- }
- });
- } else {
- this.$message.error("网络错误");
- return false;
- }
- });
- },
- getSchedulePatients() {
- getSchedulePatients(this.patientQuery).then((response) => {
- if (response.data.state == 1) {
- this.patients = response.data.data.patients;
- }
- });
- },
- CancelSchedule(id) {
- this.$confirm("确定要取消当前排班?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- CancelSchedule(id).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "排班已取消!",
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: 0,
- mode_id: 0,
- patient_id: 0,
- patient: "",
- mode_name: "",
- dialysis_machine_name: "",
- };
-
- that.scheduleZone[index].total -= 1;
- }
- }
- });
- }
- });
- })
- .catch(() => {});
- },
- changeScheduleActon(formName) {
- this.changing_bed = true;
- ChangeSchedule(this.currentData.id, this.changeSchedule)
- .then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "修改成功!",
- });
- var that = this;
- var schedule = response.data.data.schedule;
-
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: that.currentData.patient,
- patient_contagions: that.currentData.contagions,
- dialysis_machine_name: schedule.dialysis_machine_name,
-
- mode_name:
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name,
- };
-
- that.scheduleZone[index].total += 1;
- }
- }
- if (
- zone.zone_id == that.currentData.partition_id &&
- zone.jihao_id == that.currentData.bed_id
- ) {
- var weekPath = that.weekPath(
- that.currentData.schedule_week,
- that.currentData.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: 0,
- mode_id: 0,
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
-
- mode_name: "",
- patient_contagions: [],
- };
-
- that.scheduleZone[index].total -= 1;
- }
- }
- });
- this.$refs[formName].resetFields();
- this.jhDialogVisible = false;
- }
- this.changing_bed = false;
- })
- .catch((err) => {
- this.$message.error(err);
- this.changing_bed = false;
- });
- },
- CreateSchedule(id, data) {
- this.creating_schedule = true;
- CreateSchedule(id, data)
- .then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "排班成功!",
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: schedule.patient,
- dialysis_machine_name: schedule.dialysis_machine_name,
-
- patient_contagions: that.currentData.contagions,
- mode_name:
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name,
- };
- that.scheduleZone[index].total += 1;
- }
- }
- });
- this.closePatientPanel();
- }
- this.creating_schedule = false;
- })
- .catch((err) => {
- this.$message.error(err);
- this.creating_schedule = false;
- });
- },
- hoverMouse(row, column, cell, event) {
- if (row[column.property].schedule_id > 0) {
- let patient_id = row[column.property].patient_id;
- this.patient_id_hover = patient_id;
- } else {
- this.patient_id_hover = -1;
- }
- },
-
- // 删除某一单元格内的患者透析排班
- deletePatientMode(row) {
- console.log(row)
- if (row.schedule_id > 0) {
- this.CancelSchedule(row.schedule_id);
- }
- },
-
- clickThis(row, column, cell, event) {
-
- // debugger
- var week = this.weekDay(column.property);
-
- if (week[0] == -1 || week[1] == -1) {
- return false;
- }
- if (this.toDay > this.weekDays[week[0] - 1]) {
- return false;
- }
-
- this.currentData.schedule_date = this.weekDays[week[0] - 1];
- this.currentData.schedule_type = week[1];
- this.currentData.bed_id = row.jihao_id;
- this.currentData.partition_id = row.zone_id;
- this.currentData.schedule_week = week[0];
- this.currentData.type_name = this.dayType(week[1]);
- this.currentData.zone_name = row.area;
- this.currentData.bed_name = row.cut;
- this.currentData.partition_type = row.zone_type;
- if (row[column.property].schedule_id > 0) {
- this.currentData.mode_id = row[column.property].mode_id;
- this.currentData.id = row[column.property].schedule_id;
- this.currentData.patient_id = row[column.property].patient_id;
- this.currentData.patient = row[column.property].patient;
- this.currentData.contagions = row[column.property].patient_contagions;
- this.tiaoZhengType = 1;
- this.msDialogVisible = true;
- }
- },
- submitTiaoZJH(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- var weekPath = this.weekPath(
- this.changeSchedule.schedule_week,
- this.changeSchedule.schedule_type
- );
- if (weekPath.length != 2) {
- this.$message.error("数据异常");
- return false;
- }
-
- this.changeSchedule.bed_id = this.device_id;
- for (let i = 0; i < this.origin_device_numbers.length; i++) {
- if (this.origin_device_numbers[i].id == this.device_id) {
- this.changeSchedule.partition_id =
- this.origin_device_numbers[i].zone_id;
- }
- }
-
- this.changeSchedule.change_action = "change_device";
- this.changeScheduleActon(formName);
-
- // this.changeSchedule.spartition_type = this.scheduleZone[index].zone_type
- // var weekPathKey = weekPath[0] + '_' + weekPath[1]
- // for (var index in this.scheduleZone) {
- // if (this.scheduleZone[index].jihao_id == this.changeSchedule.bed_id) {
- // if (this.scheduleZone[index][weekPathKey].mode_id > 0) {
- // this.$message.error('选中的区域已经存在排班,不能再排班!')
- // return false
- // }
- // break
- // }
- // }
-
- // 可能
- // 患者有传染病,与选择的机器类型(传染病)不匹配
- // 患者没有传染病,但机器是某个传染病的专用透析器
- // 机器的透析模式与患者不匹配
-
- // if (this.currentData.contagions.length > 0) {
- // var cflag = false
- // for (var index in this.currentData.contagions) {
- // if (this.currentData.contagions[index].disease_id == this.changeSchedule.partition_type) {
- // cflag = true
- // }
- // }
- // if (!cflag) {
- // this.$confirm('此患者有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- // .then(() => {
- //
- // }).catch(() => {
- // })
- // } else {
- // this.changeSchedule.change_action = 'change_device'
- // this.changeScheduleActon(formName)
- // }
- // } else if (this.changeSchedule.partition_type > 1) {
- // this.$confirm('此患者没有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- // .then(() => {
- // this.changeSchedule.change_action = 'change_device'
- // this.changeScheduleActon(formName)
- // }).catch(() => {
- // })
- // } else {
- // this.changeSchedule.change_action = 'change_device'
- // this.changeScheduleActon(formName)
- // }
- }
- });
- },
- submitMode(formName) {
- this.changing_mode = true;
- this.changeSchedule.change_action = "change_mode";
- ChangeSchedule(this.currentData.id, this.changeSchedule)
- .then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "修改成功!",
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey].dialysis_machine_name =
- schedule.dialysis_machine_name;
- that.scheduleZone[index][weekPathKey].mode_id =
- schedule.mode_id;
- that.scheduleZone[index][weekPathKey].mode_name =
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name;
- }
- }
- });
- this.msDialogVisible = false;
- }
- this.changing_mode = false;
- })
- .catch((err) => {
- this.$message.error(err);
- this.changing_mode = false;
- });
- },
-
- submitTiaoZMS(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.changing_mode = true;
- this.changeSchedule.change_action = "change_mode";
- ChangeSchedule(this.currentData.id, this.changeSchedule)
- .then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "修改成功!",
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][
- weekPathKey
- ].dialysis_machine_name = schedule.dialysis_machine_name;
- that.scheduleZone[index][weekPathKey].mode_id =
- schedule.mode_id;
- that.scheduleZone[index][weekPathKey].mode_name =
- typeof that.modeOptions[schedule.mode_id] ===
- "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name;
- }
- }
- });
- this.$refs[formName].resetFields();
- this.msDialogVisible = false;
- }
- this.changing_mode = false;
- })
- .catch((err) => {
- this.$message.error(err);
- this.changing_mode = false;
- });
- }
- });
- },
-
- changePartition(value) {
- this.current_devices = this.zone_device_map[value];
- this.device_id = this.current_devices[0].id;
- },
- changeScheduleType(schedule_type) {
- const params = {
- type: schedule_type,
- date: this.currentData.schedule_date,
- };
- getUrgentScheduleInitData(params)
- .then((rs) => {
- if (rs.data.state == 1) {
- this.origin_schedules = rs.data.data.schedules;
- this.origin_device_numbers = rs.data.data.device_numbers;
-
- var zone_device_map = {};
- for (
- let index = 0;
- index < this.origin_device_numbers.length;
- index++
- ) {
- const device_number = this.origin_device_numbers[index];
- if (
- zone_device_map[device_number.zone_name] == null ||
- zone_device_map[device_number.zone_name] == undefined
- ) {
- zone_device_map[device_number.zone_name] = [];
- }
- zone_device_map[device_number.zone_name].push(device_number);
- }
- this.zone_device_map = zone_device_map;
-
- this.zone_names = Object.keys(this.zone_device_map);
-
-
- if (this.zone_names.length > 0) {
- this.zone_name = this.zone_names[0];
- this.current_devices = this.zone_device_map[this.zone_name];
- this.device_id = this.current_devices[0].id;
- }
-
- this.zone_device_options = [
- { values: this.zone_names },
- // { values: this.getDeviceNumberNames(this.current_devices) },
- { values: this.current_devices },
- ];
- } else {
- }
- })
- .catch((err) => {
- this.loading = false;
- });
- },
- submitTiaoX() {
- // if (this.tiaoZhengType==1) {
- // this.$confirm('确定要取消当前排班?', '提示', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning'
- // }).then(() => {
- // this.CancelSchedule(this.currentData.id);
- // }).catch(() => {});
- // }
-
- switch (this.tiaoZhengType) {
- case 1:
- this.CancelSchedule(this.currentData.id);
- break;
- case 2:
- this.changeSchedule = {
- mode_id: this.currentData.mode_id,
- schedule_type: this.currentData.schedule_type,
- partition_id: this.currentData.partition_id,
- bed_id: this.currentData.bed_id,
- schedule_week: this.currentData.schedule_week,
- partition_type: "",
- };
-
- if (
- typeof this.partitions[this.currentData.partition_id].jihaos !==
- "undefined"
- ) {
- this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
- } else {
- this.jihaos = [];
- }
-
- const params = {
- type: this.currentData.schedule_type,
- date: this.currentData.schedule_date,
- };
- getUrgentScheduleInitData(params)
- .then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- if (response.data.state == 1) {
- this.origin_schedules = response.data.data.schedules;
- this.origin_device_numbers =
- response.data.data.device_numbers;
-
- var zone_device_map = {};
- for (
- let index = 0;
- index < this.origin_device_numbers.length;
- index++
- ) {
- const device_number = this.origin_device_numbers[index];
- if (
- zone_device_map[device_number.zone_name] == null ||
- zone_device_map[device_number.zone_name] == undefined
- ) {
- zone_device_map[device_number.zone_name] = [];
- }
- zone_device_map[device_number.zone_name].push(
- device_number
- );
- }
- this.zone_device_map = zone_device_map;
- this.zone_names = Object.keys(this.zone_device_map);
- if (this.zone_names.length > 0) {
- this.zone_name = this.zone_names[0];
- this.current_devices = this.zone_device_map[this.zone_name];
- this.device_id = this.current_devices[0].id;
- }
- this.zone_device_options = [
- { values: this.zone_names },
- // { values: this.getDeviceNumberNames(this.current_devices) },
- { values: this.current_devices },
- ];
-
- //
- // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
- // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
- // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
- // this.origin_device_numbers.splice(y, 1)
- // }
- // }
- // }
- // // debugger
- // var zone_device_map = {}
- // for (let index = 0; index < this.origin_device_numbers.length; index++) {
- // const device_number = this.origin_device_numbers[index]
- // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
- // zone_device_map[device_number.zone.name] = []
- // }
- // zone_device_map[device_number.zone.name].push(device_number)
- // }
- // this.zone_device_map = zone_device_map
- //
- // this.zone_names = Object.keys(this.zone_device_map)
- // if (this.zone_names.length > 0) {
- // this.zone_name = this.zone_names[0]
- // this.current_devices = this.zone_device_map[this.zone_name]
- // this.device_id = this.current_devices[0].id
- // }
- //
- // this.zone_device_options = [
- // { values: this.zone_names },
- // // { values: this.getDeviceNumberNames(this.current_devices) },
- // { values: this.current_devices }
- // ]
- } else {
- }
- }
- })
- .catch((err) => {
- this.$message.error(err);
- });
-
- this.tzDialogVisible = false;
- this.jhDialogVisible = true;
- break;
- case 3:
- this.changeSchedule = {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: "",
- };
- this.tzDialogVisible = false;
- this.msDialogVisible = true;
- break;
-
- default:
- break;
- }
- },
- setSchedule() {
- var that = this;
- var submitFlag = true;
- if (this.currentData.patient_id <= 0) {
- this.$message.error("请先选择患者");
- return false;
- }
-
- if (
- this.currentData.schedule_date.length == 0 ||
- this.currentData.schedule_type < 1 ||
- this.currentData.schedule_type > 3 ||
- this.currentData.bed_id < 1 ||
- this.currentData.partition_id < 1 ||
- this.currentData.schedule_week < 1 ||
- this.currentData.schedule_week > 7
- ) {
- this.$message.error("请先选择排班时间或机号");
- return false;
- }
-
- // 可能
- // 患者有传染病,与选择的机器类型(传染病)不匹配
- // 患者没有传染病,但机器是某个传染病的专用透析器
- // 机器的透析模式与患者不匹配
-
- if (this.currentData.contagions.length > 0) {
- var cflag = false;
- this.currentData.contagions.forEach(function (contagion) {
- if (contagion.disease_id == that.currentData.partition_type) {
- cflag = true;
- }
- });
- if (!cflag) {
- this.$confirm(
- "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }
- )
- .then(() => {
- this.CreateSchedule(
- this.currentData.patient_id,
- this.currentData
- );
- })
- .catch(() => {});
- } else {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- }
- } else if (that.currentData.partition_type > 1) {
- this.$confirm(
- "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning",
- }
- )
- .then(() => {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- })
- .catch(() => {});
- } else {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- }
- },
- weekType(weekTime) {
- var theType = 2;
- switch (weekTime) {
- case "lastWeek":
- theType = 1;
- break;
- case "thisWeek":
- theType = 2;
- break;
- case "nextWeek":
- theType = 3;
- break;
- case "nextTwoWeek":
- theType = 4;
- break;
- default:
- theType = 2;
- break;
- }
- return theType;
- },
- dayType(theType) {
- var jType = "";
- switch (theType) {
- case 1:
- jType = "上午";
- break;
- case 2:
- jType = "下午";
- break;
- case 3:
- jType = "晚上";
- break;
-
- default:
- break;
- }
- return jType;
- },
- weekPath(week, schedule_type) {
- var weekArr = {
- 1: "Mon",
- 2: "Tue",
- 3: "Wed",
- 4: "Thurs",
- 5: "Fri",
- 6: "Sat",
- 7: "Sun",
- };
- var typeArr = { 1: "M", 2: "A", 3: "N" };
- if (
- typeof weekArr[week] === "undefined" ||
- typeof typeArr[schedule_type] === "undefined"
- ) {
- return [];
- }
- return [weekArr[week], typeArr[schedule_type]];
- },
- weekDay(prop) {
- var week = prop.split("_");
- if (week.length != 2) {
- return [-1, -1];
- }
- var w = -1;
- var n = -1;
- switch (week[0]) {
- case "Mon":
- w = 1;
- break;
- case "Tue":
- w = 2;
- break;
- case "Wed":
- w = 3;
- break;
- case "Thurs":
- w = 4;
- break;
- case "Fri":
- w = 5;
- break;
- case "Sat":
- w = 6;
- break;
- case "Sun":
- w = 7;
- break;
- default:
- w = -1;
- break;
- }
- switch (week[1]) {
- case "M":
- n = 1;
- break;
- case "A":
- n = 2;
- break;
- case "N":
- n = 3;
- break;
- default:
- n = -1;
- break;
- }
- if (w == -1 || n == -1) {
- return [-1, -1];
- }
- return [w, n];
- },
- search: function () {
- if (this.keywords.length == 0) {
- this.patientList = this.all_patients;
- } else {
- this.patientList = [];
- for (let i = 0; i < this.all_patients.length; i++) {
- if (
- this.all_patients[i].name.indexOf(this.keywords) != -1 ||
- this.all_patients[i].dialysis_no.indexOf(this.keywords) != -1
- ) {
- this.patientList.push(this.all_patients[i]);
- }
- }
-
- if (this.patientList.length > 0) {
- this.cur_info.patient_name = this.patientList[0].name;
- this.cur_info.mode_name = this.modes[0].name;
- this.cur_info.patient_id = this.patientList[0].id;
- this.cur_info.mode_id = this.modes[0].id;
- this.$refs.patient_table.setCurrentRow(this.patientList[0]);
- this.$refs.mode_table.setCurrentRow(this.modes[0]);
- }
- }
- },
- changeMachineNumber: function (index, row) {
- this.currentData.schedule_type = row.schedule_type;
- this.currentData.bed_id = row.bed_id;
- this.currentData.partition_id = row.partition_id;
- this.currentData.schedule_week = row.schedule_week;
-
- switch (row.schedule_type) {
- case 1:
- this.currentData.type_name = "上午";
- break;
- case 2:
- this.currentData.type_name = "下午";
- break;
- case 3:
- this.currentData.type_name = "晚上";
- break;
- }
-
- this.currentData.zone_name = row.zone.name;
- this.currentData.bed_name = row.number.number;
- this.currentData.partition_type = row.zone.type;
-
- this.currentData.mode_id = row.mode_id;
- this.currentData.patient_id = row.patient_id;
- this.currentData.patient = row.patient;
- this.currentData.contagions = row.patient_contagions;
-
- this.currentData.id = row.id;
- this.changeSchedule = {
- mode_id: row.mode_id,
- schedule_type: row.schedule_type,
- partition_id: row.partition_id,
- bed_id: row.bed_id,
- schedule_week: row.schedule_week,
- partition_type: "",
- };
- this.currentData.schedule_date = uParseTime(
- row.schedule_date,
- "{y}-{m}-{d}"
- );
-
- if (typeof this.partitions[row.partition_id].jihaos !== "undefined") {
- this.jihaos = this.partitions[row.partition_id].jihaos;
- } else {
- this.jihaos = [];
- }
-
- this.searchTableVisible = false;
- this.jhDialogVisible = true;
- },
- getDialysisDate: function (row) {
- let week = "";
- switch (row.schedule_week) {
- case 7:
- week = "周日";
- break;
- case 1:
- week = "周一";
- break;
- case 2:
- week = "周二";
-
- break;
- case 3:
- week = "周三";
-
- break;
- case 4:
- week = "周四";
-
- break;
- case 5:
- week = "周五";
- break;
- case 6:
- week = "周六";
- break;
- }
-
- return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
- },
- getSchedulesType: function (type) {
- let type_name = "";
- switch (type) {
- case 1:
- type_name = "上午";
- break;
- case 2:
- type_name = "下午";
-
- break;
- case 3:
- type_name = "晚上";
- break;
- }
- return type_name;
- },
- changeMode: function (index, row) {
- this.changeSchedule = {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: "",
- };
- this.currentData.id = row.id;
- this.searchTableVisible = false;
- this.msDialogVisible = true;
- },
- tableRowClassName({ row, rowIndex }) {
- if (row.zone_type == 1) {
- return "table-row-new-class schedule-table-row";
- } else {
- return "table-row-new-class schedule-table-row backPurple";
- }
- },
- getAllZones() {
- getAllZones().then((response) => {
- if (response.data.state == 1) {
- var zones = response.data.data.zones;
- for (let i = 0; i < zones.length; i++) {
- this.zoneIdList.push(zones[i].id);
- }
- this.zones.push(...zones);
- var strArr = this.zoneIdList.join(",");
-
- this.strArr = strArr;
- this.getWeekPanels();
- }
- });
- },
- changePartiton(val) {
-
- this.$emit("event1", val);
- this.partition_id = val;
- this.getWeekPanels();
- // this.getSchedules();
- },
- changeSchedule_type(val) {
- this.$emit("event2", val);
- this.schedule_type = val;
- this.getSchedules();
- },
- changeWeekDay(val){
- this.$emit("event3", val);
- }
- },
- components: {
- ScheduleItem,
- draggable,
- },
- mounted() {
- this.tableContainHeight =
- window.innerHeight - this.$refs.table.$el.offsetTop - 100;
-
- // var theType = this.weekType(this.weekTime);
- // this.getSchedules(theType);
- const that = this;
- window.onresize = () => {
- return (() => {
- window.fullHeight = document.documentElement.clientHeight;
- if (window.fullHeight < 200) {
- that.tableHeight = 200;
- } else {
- that.tableHeight = window.fullHeight - 160;
- }
- })();
- };
- },
- // mounted:function(){
- // this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
- // },
- created() {
- var date = new Date();
- this.time = date;
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- if (month < 10) {
- month = "0" + month;
- }
- var day = date.getDate();
- if (day < 10) {
- day = "0" + day;
- }
- var nowDate = year + "-" + month + "-" + day;
- var date = new Date(nowDate + " 00:00:00");
-
- this.now_time = date.getTime() / 1000;
- this.getAllZones();
-
- this.changeScheduleType(1);
- rowNumber = 0;
- this.modeOptions = this.$store.getters.treatment_mode;
-
- this.partitions = this.partitionsProp;
-
- var contagions = this.$store.getters.contagions;
- if (contagions.length > 0) {
- var that = this;
- contagions.forEach(function (citem) {
- if (citem.type == 2) {
- that.diseasesArr.push({ value: citem.id, label: citem.name });
- }
- });
- }
-
- this.scheduleZoneRow = this.scheduleZoneRowProp;
-
- this.weekday = new Date().getDay();
- if (this.weekday == 0) {
- this.weekday = 7;
- }
- },
- };
- </script>
-
- <style rel="stylesheet/css" lang="scss">
- .table_contain {
- display: flex;
- // justify-content: space-between;
- .left_contain {
- width: 16%;
- margin-right: 15px;
- .patient_mode {
- display: flex;
- justify-content: space-between;
- }
- }
- .right_contain {
- width: 84%;
- }
- .select_list {
- text-align: right;
- margin-bottom: 15px;
- .el-select {
- width: 13%;
- }
- }
- }
- .tiaozhengclass {
- display: block;
- margin: 0 auto;
- }
-
- // .el-table tr {
- // background-color: #111 !important;
- // }
-
- .schedule-table-row {
- background: #fff !important;
- }
-
- .schedule-table-row:hover {
- background: #fff !important;
- }
-
- .schedule-table-row td:hover {
- background: rgb(88, 162, 236) !important;
- }
-
- .schedule-table-row td .cell {
- font-size: 12px;
- white-space: nowrap !important;
- }
-
- .schedule-table-cell-disable {
- background-color: rgb(245, 245, 245) !important;
- }
-
- #table_data {
- min-height: calc(100vh - 350px);
- }
-
- #table_data ::-webkit-scrollbar {
- height: 15px;
- }
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
- .el-table--border th {
- border-color: #d0d3da;
- }
- .el-table--border td {
- border-color: #d0d3da;
- }
- .el-table td {
- border-color: #d0d3da;
- }
- // .hover-td{
- // color: red;
- // }
-
- // .el-table__body tr.current-row > td {
- // background-color: #409eff !important;
- // color: #fff;
- // }
- // .el-table__body tr > td:hover {
- // background-color: #409eff !important;
- // }
- #table_data {
- .el-table__body tr.current-row > td {
- background-color: #ecf5ff !important;
- color: #3a8ee6;
- }
- .el-table__body tr > td:hover {
- background-color: #409eff !important;
- color: #fff;
- .del_table_btn {
- visibility: visible;
- }
- }
- .el-table__body tr .hover-td {
- background-color: #409eff !important;
- color: #fff;
- }
- }
- .backPurple {
- color: #08c3df !important;
- }
-
- .del_table_btn {
- position: absolute;
- right: 0px;
- top: -3px;
- z-index: 999;
- visibility: hidden;
- .el-button {
- width: 15px;
- height: 15px;
- padding: 0px;
- }
- }
-
- .mode_change {
- .el-dialog {
- .el-dialog__footer {
- text-align: center;
- }
- }
- }
- </style>
-
- <style scoped>
- .itxst {
- margin: 10px;
- text-align: left;
- }
- .col {
- width: 40%;
- flex: 1;
- padding: 10px;
- border: solid 1px #eee;
- border-radius: 5px;
- float: left;
- }
- .col + .col {
- margin-left: 10px;
- }
- .item {
- padding: 6px 12px;
- margin: 0px 10px 0px 10px;
- border: solid 1px #eee;
- background-color: #409eff;
- text-align: left;
- color: #fff;
- }
- .item + .item {
- border-top: none;
- margin-top: 6px;
- }
-
- .item:hover {
- background-color: #5695d4;
- cursor: move;
- }
- .item2 {
- padding: 6px 12px;
- margin: 0px 10px 0px 10px;
- border: solid 1px #eee;
- background-color: pink;
- text-align: left;
- }
- .item2 + .item2 {
- border-top: none;
- margin-top: 6px;
- }
-
- .item2:hover {
- outline: solid 1px #ddd;
- cursor: move;
- }
-
- .select_list_arrage {
- width: 105px !important;
- }
-
-
- .checkSearch{
- position: absolute;
- top: 15px;
- right: 120px;
- }
- </style>
-
|