editTableData.vue 169KB

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