tableData.vue 137KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333
  1. <template>
  2. <div id="table_data">
  3. <div style="position: relative;height: 48px;padding-bottom:12px ">
  4. <div style="position: fixed;z-index: 100;background: #fff;width: 80%;">
  5. <div class="cell clearfix" v-if="weekTime == 'thisWeek' || weekTime == 'nextWeek' || weekTime == 'nextTwoWeek' ">
  6. <div class="select_list">
  7. <span>日期:</span>
  8. <el-select
  9. v-model="week_type"
  10. placeholder="请选择"
  11. multiple
  12. @change="changeWeekDay"
  13. style="width: 120px;"
  14. >
  15. <el-option
  16. v-for="(item,index) in weeks"
  17. :key="index"
  18. :label="item"
  19. :value="item"
  20. >
  21. </el-option>
  22. </el-select>
  23. <span>分区:</span>
  24. <el-select
  25. v-model="partition_id"
  26. multiple
  27. placeholder="请选择"
  28. @change="changePartiton"
  29. style="width: 120px;"
  30. >
  31. <el-option
  32. v-for="item in this.zones"
  33. :key="item.id"
  34. :label="item.name"
  35. :value="item.id"
  36. >
  37. </el-option>
  38. </el-select>
  39. <span>班次:</span>
  40. <el-select
  41. v-model="scheduleType_val"
  42. clearable
  43. placeholder="请选择"
  44. @change="scheduleType_change"
  45. style="width: 120px;"
  46. >
  47. <!-- <el-option value=0 label="请选择"></el-option> multiple-->
  48. <el-option
  49. v-for="item in this.scheduleType"
  50. :key="item.id"
  51. :label="item.name"
  52. :value="item.id"
  53. >
  54. </el-option>
  55. </el-select>
  56. </div>
  57. <el-input
  58. size="small"
  59. style="width: 120px;margin-left: 20px"
  60. class="filter-item"
  61. v-model.trim="keywords"
  62. placeholder="病人名称/透析号"
  63. @keyup.enter.native='search'
  64. />
  65. <el-button
  66. size="small"
  67. class="filter-item"
  68. type="primary"
  69. icon="el-icon-search"
  70. @click="search"
  71. >搜索</el-button>
  72. <div class="switch">
  73. <el-switch
  74. v-model="value1"
  75. :active-value=true
  76. active-text="显示透析器/灌流器"
  77. @change="switchThis(value1)">
  78. </el-switch>
  79. </div>
  80. <div class="switch">
  81. <el-switch
  82. v-model="modename_value"
  83. :active-value=true
  84. active-text="显示透析模式"
  85. @change="switchMode(modename_value)">
  86. </el-switch>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <!-- <el-dialog :visible.sync="searchTableVisible" width="80%" class="eldialog">
  92. <div style="position: relative;">
  93. <el-table
  94. :data="schedulePatients"
  95. :header-cell-style="{
  96. backgroundColor: 'rgb(245, 247, 250)',
  97. color: '#606266'
  98. }"
  99. :row-style="{ color: '#303133' }"
  100. style="width: 100%"
  101. border
  102. >
  103. <el-table-column label="姓名" width="120">
  104. <template slot-scope="scope">
  105. {{ scope.row.patient }}
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="透析日期" width="200">
  109. <template slot-scope="scope">
  110. {{ getDialysisDate(scope.row) }}
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="分区">
  114. <template slot-scope="scope">
  115. {{ scope.row.zone.name }}
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="班次" width="80">
  119. <template slot-scope="scope">
  120. {{ getSchedulesType(scope.row.schedule_type,scope.row) }}
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="机号" width="80">
  124. <template slot-scope="scope">
  125. {{ scope.row.number.number }}
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="透析模式" width="100">
  129. <template slot-scope="scope">
  130. {{ scope.row.mode.name }}
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="操作" align="center" width="300">
  134. <template slot-scope="scope">
  135. <span v-if="now_time <=scope.row.schedule_date">
  136. <el-button
  137. size="mini"
  138. type="primary"
  139. @click="CancelSchedule(scope.row.id)"
  140. >
  141. 取消排班
  142. </el-button>
  143. <el-button
  144. size="mini"
  145. type="primary"
  146. @click="changeMachineNumber(scope.$index, scope.row)"
  147. >
  148. 调整机号
  149. </el-button>
  150. <el-button
  151. size="mini"
  152. type="primary"
  153. @click="changeMode(scope.$index, scope.row)"
  154. >
  155. 调整模式
  156. </el-button>
  157. </span>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. </div>
  162. </el-dialog> -->
  163. <el-dialog
  164. title="提示"
  165. :visible.sync="searchTableVisible"
  166. width="80%"
  167. class="eldialog">
  168. <div style="position: relative;">
  169. <el-table
  170. :data="schedulePatients"
  171. :header-cell-style="{
  172. backgroundColor: 'rgb(245, 247, 250)',
  173. color: '#606266'
  174. }"
  175. :row-style="{ color: '#303133' }"
  176. style="width: 100%"
  177. border
  178. >
  179. <el-table-column label="姓名" width="120">
  180. <template slot-scope="scope">
  181. {{ scope.row.patient }}
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="透析日期" width="200">
  185. <template slot-scope="scope">
  186. {{ getDialysisDate(scope.row) }}
  187. </template>
  188. </el-table-column>
  189. <el-table-column label="分区">
  190. <template slot-scope="scope">
  191. {{ scope.row.zone.name }}
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="班次" width="80">
  195. <template slot-scope="scope">
  196. {{ getSchedulesType(scope.row.schedule_type,scope.row) }}
  197. </template>
  198. </el-table-column>
  199. <el-table-column label="机号" width="80">
  200. <template slot-scope="scope">
  201. {{ scope.row.number.number }}
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="透析模式" width="100">
  205. <template slot-scope="scope">
  206. {{ scope.row.mode.name }}
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="操作" align="center" width="300">
  210. <template slot-scope="scope">
  211. <span v-if="now_time <=scope.row.schedule_date">
  212. <el-button
  213. size="mini"
  214. type="primary"
  215. @click="CancelSchedule(scope.row.id)"
  216. >
  217. 取消排班
  218. </el-button>
  219. <el-button
  220. size="mini"
  221. type="primary"
  222. @click="changeMachineNumber(scope.$index, scope.row)"
  223. >
  224. 调整机号
  225. </el-button>
  226. <el-button
  227. size="mini"
  228. type="primary"
  229. @click="changeMode(scope.$index, scope.row)"
  230. >
  231. 调整模式
  232. </el-button>
  233. </span>
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. </div>
  238. </el-dialog>
  239. <div class="center-tab" style="position: relative;height: 70vh;overflow: overlay;">
  240. <el-table class="eltables"
  241. :row-style="{ color: '#303133' }"
  242. :header-cell-style="{
  243. backgroundColor: 'rgb(245, 247, 250)',
  244. color: '#606266',
  245. }"
  246. :fit="true"
  247. :data="scheduleZone"
  248. :span-method="objectSpanMethod"
  249. @cell-click="clickThis"
  250. @cell-mouse-enter="hoverMouse"
  251. :cell-style ='cellstyle'
  252. :summary-method="getSummaries"
  253. show-summary
  254. :cell-class-name="cellClass"
  255. sum-text="总数"
  256. ref="table"
  257. style="table-layout: fixed;"
  258. >
  259. <!-- :height="tableContainHeight" height="calc(100vh - 200px)"-->
  260. <el-table-column
  261. prop="area"
  262. label="分区"
  263. width="50"
  264. align="center"
  265. >
  266. </el-table-column>
  267. <el-table-column
  268. prop="cut"
  269. label="机号"
  270. align="center"
  271. min-width="40"
  272. ></el-table-column>
  273. <el-table-column
  274. :label="' 周一(' + weekTitle[0] + ')'"
  275. v-if="isShowOne"
  276. align="center"
  277. >
  278. <el-table-column prop="Mon_M" label="上" min-width="40" align="center" v-if="isShowShangWu" >
  279. <schedule-item
  280. slot-scope="scope"
  281. :schedule-detail="scope.row.Mon_M"
  282. :config="config"
  283. :schedulFlag="value1"
  284. :schedulMode="modename_value"
  285. ></schedule-item>
  286. </el-table-column>
  287. <el-table-column prop="Mon_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  288. <schedule-item
  289. slot-scope="scope"
  290. :schedule-detail="scope.row.Mon_A"
  291. :config="config"
  292. :schedulFlag="value1"
  293. :schedulMode="modename_value"
  294. ></schedule-item>
  295. </el-table-column>
  296. <el-table-column prop="Mon_N" label="晚" min-width="40" align="center" v-if="isShowWanShang" >
  297. <schedule-item
  298. slot-scope="scope"
  299. :schedule-detail="scope.row.Mon_N"
  300. :config="config"
  301. :schedulFlag="value1"
  302. :schedulMode="modename_value"
  303. ></schedule-item>
  304. </el-table-column>
  305. </el-table-column>
  306. <el-table-column
  307. :label="'周二 (' + weekTitle[1] + ')'"
  308. min-width="120"
  309. v-if="isShowTwo"
  310. align="center"
  311. :fit="true"
  312. >
  313. <el-table-column prop="Tue_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  314. <schedule-item
  315. slot-scope="scope"
  316. :schedule-detail="scope.row.Tue_M"
  317. :config="config"
  318. :schedulFlag="value1"
  319. :schedulMode="modename_value"
  320. ></schedule-item>
  321. </el-table-column>
  322. <el-table-column prop="Tue_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  323. <schedule-item
  324. slot-scope="scope"
  325. :schedule-detail="scope.row.Tue_A"
  326. :config="config"
  327. :schedulFlag="value1"
  328. :schedulMode="modename_value"
  329. ></schedule-item>
  330. </el-table-column>
  331. <el-table-column prop="Tue_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  332. <schedule-item
  333. slot-scope="scope"
  334. :schedule-detail="scope.row.Tue_N"
  335. :config="config"
  336. :schedulFlag="value1"
  337. :schedulMode="modename_value"
  338. ></schedule-item>
  339. </el-table-column>
  340. </el-table-column>
  341. <el-table-column
  342. :label="'周三 (' + weekTitle[2] + ')'"
  343. v-if="isShowThree"
  344. align="center"
  345. >
  346. <el-table-column prop="Wed_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  347. <schedule-item
  348. slot-scope="scope"
  349. :schedule-detail="scope.row.Wed_M"
  350. :config="config"
  351. :schedulFlag="value1"
  352. :schedulMode="modename_value"
  353. ></schedule-item>
  354. </el-table-column>
  355. <el-table-column prop="Wed_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  356. <schedule-item
  357. slot-scope="scope"
  358. :schedule-detail="scope.row.Wed_A"
  359. :config="config"
  360. :schedulFlag="value1"
  361. :schedulMode="modename_value"
  362. ></schedule-item>
  363. </el-table-column>
  364. <el-table-column prop="Wed_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  365. <schedule-item
  366. slot-scope="scope"
  367. :config="config"
  368. :schedulFlag="value1"
  369. :schedule-detail="scope.row.Wed_N"
  370. :schedulMode="modename_value"
  371. ></schedule-item>
  372. </el-table-column>
  373. </el-table-column>
  374. <el-table-column
  375. :label="'周四 (' + weekTitle[3] + ')'"
  376. align="center"
  377. v-if="isShowFour"
  378. >
  379. <el-table-column prop="Thurs_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  380. <schedule-item
  381. slot-scope="scope"
  382. :config="config"
  383. :schedule-detail="scope.row.Thurs_M"
  384. :schedulFlag="value1"
  385. :schedulMode="modename_value"
  386. ></schedule-item>
  387. </el-table-column>
  388. <el-table-column prop="Thurs_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  389. <schedule-item
  390. slot-scope="scope"
  391. :schedule-detail="scope.row.Thurs_A"
  392. :config="config"
  393. :schedulFlag="value1"
  394. :schedulMode="modename_value"
  395. ></schedule-item>
  396. </el-table-column>
  397. <el-table-column prop="Thurs_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  398. <schedule-item
  399. slot-scope="scope"
  400. :schedule-detail="scope.row.Thurs_N"
  401. :config="config"
  402. :schedulFlag="value1"
  403. :schedulMode="modename_value"
  404. ></schedule-item>
  405. </el-table-column>
  406. </el-table-column>
  407. <el-table-column
  408. :label="'周五 (' + weekTitle[4] + ')'"
  409. align="center"
  410. v-if="isShowFive"
  411. >
  412. <el-table-column prop="Fri_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  413. <schedule-item
  414. slot-scope="scope"
  415. :schedule-detail="scope.row.Fri_M"
  416. :config="config"
  417. :schedulFlag="value1"
  418. :schedulMode="modename_value"
  419. ></schedule-item>
  420. </el-table-column>
  421. <el-table-column prop="Fri_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  422. <schedule-item
  423. slot-scope="scope"
  424. :schedule-detail="scope.row.Fri_A"
  425. :config="config"
  426. :schedulFlag="value1"
  427. :schedulMode="modename_value"
  428. ></schedule-item>
  429. </el-table-column>
  430. <el-table-column prop="Fri_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  431. <schedule-item
  432. slot-scope="scope"
  433. :schedule-detail="scope.row.Fri_N"
  434. :config="config"
  435. :schedulFlag="value1"
  436. :schedulMode="modename_value"
  437. ></schedule-item>
  438. </el-table-column>
  439. </el-table-column>
  440. <el-table-column
  441. :label="'周六 (' + weekTitle[5] + ')'"
  442. align="center"
  443. v-if="isShowSix"
  444. >
  445. <el-table-column prop="Sat_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  446. <schedule-item
  447. slot-scope="scope"
  448. :schedule-detail="scope.row.Sat_M"
  449. :config="config"
  450. :schedulFlag="value1"
  451. :schedulMode="modename_value"
  452. ></schedule-item>
  453. </el-table-column>
  454. <el-table-column prop="Sat_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  455. <schedule-item
  456. slot-scope="scope"
  457. :schedule-detail="scope.row.Sat_A"
  458. :config="config"
  459. :schedulFlag="value1"
  460. :schedulMode="modename_value"
  461. ></schedule-item>
  462. </el-table-column>
  463. <el-table-column prop="Sat_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  464. <schedule-item
  465. slot-scope="scope"
  466. :schedule-detail="scope.row.Sat_N"
  467. :config="config"
  468. :schedulFlag="value1"
  469. :schedulMode="modename_value"
  470. ></schedule-item>
  471. </el-table-column>
  472. </el-table-column>
  473. <el-table-column
  474. :label="'周日 (' + weekTitle[6] + ')'"
  475. align="center"
  476. v-if="isShowSeven"
  477. >
  478. <el-table-column prop="Sun_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  479. <schedule-item
  480. slot-scope="scope"
  481. :schedule-detail="scope.row.Sun_M"
  482. :config="config"
  483. :schedulFlag="value1"
  484. :schedulMode="modename_value"
  485. ></schedule-item>
  486. </el-table-column>
  487. <el-table-column prop="Sun_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  488. <schedule-item
  489. slot-scope="scope"
  490. :schedule-detail="scope.row.Sun_A"
  491. :config="config"
  492. :schedulFlag="value1"
  493. :schedulMode="modename_value"
  494. ></schedule-item>
  495. </el-table-column>
  496. <el-table-column prop="Sun_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  497. <schedule-item
  498. slot-scope="scope"
  499. :schedule-detail="scope.row.Sun_N"
  500. :config="config"
  501. :schedulFlag="value1"
  502. :schedulMode="modename_value"
  503. >
  504. </schedule-item>
  505. </el-table-column>
  506. </el-table-column>
  507. <el-table-column
  508. prop="total"
  509. label="合计"
  510. width="30"
  511. align="center"
  512. >
  513. </el-table-column>
  514. </el-table>
  515. </div>
  516. <!-- 调整模式 -->
  517. <el-dialog
  518. title="调整模式"
  519. :visible.sync="msDialogVisible"
  520. width="500px"
  521. v-loading="changing_mode"
  522. :modal-append-to-body='false'
  523. :close-on-click-modal="false"
  524. >
  525. <div>
  526. <el-form
  527. :model="changeSchedule"
  528. ref="changeSchedule"
  529. :rules="changeRules"
  530. >
  531. <el-form-item label="" prop="mode_id">
  532. <el-select
  533. v-model="changeSchedule.mode_id"
  534. placeholder="请选择"
  535. style="width: 100%"
  536. >
  537. <el-option
  538. :disabled="item.id == currentData.mode_id"
  539. v-for="item in modeOptions"
  540. :key="item.id"
  541. :label="item.name"
  542. :value="item.id"
  543. >
  544. </el-option>
  545. </el-select>
  546. </el-form-item>
  547. </el-form>
  548. </div>
  549. <span slot="footer" class="dialog-footer">
  550. <el-button @click="msDialogVisible = false">取 消</el-button>
  551. <el-button
  552. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  553. type="primary"
  554. @click="submitMode('changeSchedule')"
  555. >保 存</el-button
  556. >
  557. </span>
  558. </el-dialog>
  559. <!--调整机号 -->
  560. <el-dialog
  561. title="调整机号"
  562. :visible.sync="jhDialogVisible"
  563. width="500px"
  564. v-loading="changing_bed"
  565. :modal-append-to-body='false'
  566. :close-on-click-modal="false"
  567. >
  568. <div>
  569. <el-form
  570. :model="changeSchedule"
  571. ref="changeSchedule"
  572. :rules="changeRules"
  573. label-width="90px"
  574. >
  575. <el-form-item label="排班日期: ">
  576. <el-input v-model="currentData.schedule_date" disabled></el-input>
  577. </el-form-item>
  578. <el-form-item label="班次: " prop="schedule_type">
  579. <el-select
  580. v-model="changeSchedule.schedule_type"
  581. placeholder="请选择"
  582. style="width: 100%"
  583. @change="changeScheduleType"
  584. >
  585. <el-option
  586. v-for="item in scheduleType"
  587. :key="item.id"
  588. :label="item.name"
  589. :value="item.id"
  590. >
  591. </el-option>
  592. </el-select>
  593. </el-form-item>
  594. <el-form-item label="分区: " prop="partition_id">
  595. <el-select
  596. v-model="changeSchedule.partition_id"
  597. placeholder="请选择"
  598. style="width: 100%"
  599. @change="changePartition"
  600. >
  601. <el-option
  602. v-for="(item, index) in zones"
  603. :key="index"
  604. :label="item.name"
  605. :value="item.id"
  606. >
  607. </el-option>
  608. </el-select>
  609. </el-form-item>
  610. <el-form-item label="透析机: " prop="bed_id">
  611. <el-select
  612. v-model="changeSchedule.bed_id"
  613. placeholder="请选择"
  614. style="width: 100%"
  615. >
  616. <!-- @change="changeScheduledialyzer" -->
  617. <el-option
  618. v-for="item in current_devices"
  619. :key="item.id"
  620. :label="item.number"
  621. :value="item.id"
  622. >
  623. </el-option>
  624. </el-select>
  625. </el-form-item>
  626. </el-form>
  627. </div>
  628. <span slot="footer" class="dialog-footer">
  629. <el-button @click="jhDialogVisible = false">取 消</el-button>
  630. <el-button
  631. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  632. type="primary"
  633. @click="submitTiaoZJH('changeSchedule')"
  634. >保 存</el-button>
  635. <!-- -->
  636. </span>
  637. </el-dialog>
  638. <!-- <el-dialog
  639. title="排班"
  640. :visible.sync="dialogTableVisible"
  641. width="1000px;"
  642. :v-model="dialog"
  643. v-loading="creating_schedule"
  644. >
  645. <div>
  646. <div class="cell clearfix">
  647. <label class="title"><span class="name">当前排班</span> : </label>
  648. <div class="time ">
  649. <ul class="">
  650. <span class="current"
  651. >日期 : {{ currentData.schedule_date }} &nbsp;&nbsp; 班次 :
  652. {{ currentData.type_name }} &nbsp;&nbsp; 病房 :
  653. {{ currentData.zone_name }} &nbsp;&nbsp; 透析机 :
  654. {{ currentData.bed_name }}
  655. </span>
  656. </ul>
  657. </div>
  658. </div>
  659. <div class="cell clearfix">
  660. <label class="title"><span class="name">患者搜索</span> : </label>
  661. <div class="time ">
  662. <ul class="">
  663. <el-input
  664. size="medium"
  665. v-model="searchKey"
  666. placeholder="请输入搜索的内容"
  667. style="width:260px"
  668. @keyup.enter.native='SubmitSearch'
  669. ></el-input>
  670. <el-button
  671. type="primary"
  672. icon="el-icon-search"
  673. @click="SubmitSearch"
  674. >搜索</el-button
  675. >
  676. </ul>
  677. </div>
  678. </div>
  679. <div class="cell clearfix">
  680. <label class="title"><span class="name">排班</span> : </label>
  681. <div class="time ">
  682. <ul class="">
  683. <li
  684. v-for="item in schedulArr"
  685. @click="changeSearchSchedule(item.value)"
  686. :key="item.value"
  687. :class="patientQuery.schedule == item.value ? 'active' : ''"
  688. >
  689. {{ item.label }}
  690. </li>
  691. </ul>
  692. </div>
  693. </div>-->
  694. <!-- <div class="cell clearfix">
  695. <label class="title"><span class="name">标签</span> : </label>
  696. <div class="time ">
  697. <ul class="">
  698. <li v-for="item in tagArr" :key="item.value" >{{item.label}}</li>
  699. </ul>
  700. </div>
  701. </div> -->
  702. </div>
  703. </template>
  704. <script>
  705. // import Drag from '@/utils/move.js';
  706. import { uParseTime } from "@/utils/tools";
  707. import print from 'print-js'
  708. const moment = require('moment')
  709. import {
  710. CancelSchedule,
  711. ChangeSchedule,
  712. CreateSchedule,
  713. getSchedulePatients,
  714. getSchedulesOne,
  715. getSearchResult,
  716. getUrgentScheduleInitData,
  717. getWeekPanelsOne,
  718. getAllZones,
  719. } from "@/api/schedule";
  720. import {
  721. getSmartDevices
  722. } from "@/api/schedule_template/sch_template";
  723. import ScheduleItem from "./ScheduleItem";
  724. const weekOptions = ['周一','周二','周三','周四','周五','周六','周日'];
  725. let rowNumber = 0;
  726. export default {
  727. name: "tableData",
  728. props: {
  729. is_edit:{
  730. type: Boolean,
  731. default: false,
  732. },
  733. weekTime: {
  734. type: String,
  735. default: "thisWeek"
  736. },
  737. // 机号数
  738. scheduleZoneRowProp: {
  739. type: Array,
  740. dafault: []
  741. },
  742. // scheduleZoneProp: {
  743. // type: Array,
  744. // dafault: []
  745. // },
  746. // 分区
  747. partitionsProp: {
  748. type: Object,
  749. dafault: {}
  750. },
  751. config: {
  752. type: Object,
  753. dafault: {}
  754. },
  755. },
  756. data() {
  757. return {
  758. tableContainHeight:null,
  759. value1:false,
  760. modename_value:true,
  761. weeks:weekOptions,
  762. searchKey: "",
  763. tiaoZhengType: 1,
  764. modeOptions: null,
  765. keywords: "",
  766. schedulePatients: [],
  767. searchTableVisible: false,
  768. weektypes:'',
  769. // dialog: {
  770. // tag: ""
  771. // },
  772. patients: [],
  773. toDay: "",
  774. schedulArr: [
  775. { value: 0, label: "不限" },
  776. { value: 2, label: "未排班" },
  777. { value: 1, label: "已排班" }
  778. ],
  779. tagArr: [
  780. { value: 1, label: "不限" },
  781. { value: 2, label: "透析记录" },
  782. { value: 3, label: "传染病" }
  783. ],
  784. diseasesArr: [{ value: 0, label: "不限" }],
  785. scheduleType: [
  786. { id: 1, name: "上午" },
  787. { id: 2, name: "下午" },
  788. { id: 3, name: "晚上" }
  789. ],
  790. // dialogTableVisible: false,
  791. tzDialogVisible: false,
  792. msDialogVisible: false,
  793. jhDialogVisible: false,
  794. // scheduleZone: this.scheduleZoneProp,
  795. scheduleZoneRow: -1,
  796. partitions: [],
  797. subzone:[],
  798. jihaos: [],
  799. weekTitle: ["", "", "", "", "", "", ""],
  800. weekList: ["", "", "", "", "", "", ""],
  801. weekDays: ["", "", "", "", "", "", ""],
  802. currentData: {
  803. id: 0,
  804. schedule_date: "",
  805. schedule_type: 0,
  806. bed_id: 0,
  807. partition_id: 0,
  808. patient_id: 0,
  809. schedule_week: 0,
  810. mode_id: 0,
  811. type_name: "",
  812. bed_name: "",
  813. partition_type: 0,
  814. contagions: [],
  815. patient: ""
  816. },
  817. changeSchedule: {
  818. mode_id: "",
  819. schedule_type: "",
  820. partition_id: "",
  821. bed_id: "",
  822. schedule_week: "",
  823. partition_type: ""
  824. },
  825. patientQuery: {
  826. keywords: "",
  827. schedule: 0,
  828. contagion: 0
  829. },
  830. tiaozhengclass: "tiaozhengclass",
  831. // 调整机号表单验证
  832. changeRules: {
  833. mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
  834. schedule_type: [
  835. { required: true, message: "请选择班次", trigger: "blur" }
  836. ],
  837. partition_id: [
  838. { required: true, message: "请选择分区", trigger: "blur" }
  839. ],
  840. bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }]
  841. },
  842. weekday: 0,
  843. creating_schedule: false,
  844. changing_mode: false,
  845. changing_bed: false,
  846. tableHeight: document.documentElement.clientHeight,
  847. origin_schedules: [],
  848. origin_device_numbers: [],
  849. zone_device_map: {},
  850. device_id: 0,
  851. zone_name: "",
  852. current_devices: [],
  853. zone_names: [],
  854. zone_device_options: [],
  855. options:[
  856. {id:1,name:"上午"},
  857. {id:2,name:"下午"},
  858. {id:3,name:"晚上"},
  859. ],
  860. partition_id:0,
  861. schedule_type:[],
  862. week_type:[],
  863. zones:[],
  864. theType:"",
  865. scheduleZone:[],
  866. source_scheduleZone:[],
  867. theWeek: {
  868. historyWeek:0,
  869. lastWeek: 0,
  870. thisWeek: 0,
  871. nextWeek: 0,
  872. nextTwoWeek: 0
  873. },
  874. zoneIdList:[],
  875. strArr:"",
  876. patient_id_hover:0,
  877. now_time:"",
  878. scheduleType_val:'',
  879. isShowOne:true,
  880. isShowTwo:true,
  881. isShowThree:true,
  882. isShowFour:true,
  883. isShowFive:true,
  884. isShowSix:true,
  885. isShowSeven:true,
  886. isShowShangWu:true,
  887. isShowXiaWu:true,
  888. isShowWanShang:true,
  889. schedulesGroup:[],
  890. count_num:null,
  891. schedule_type:0,
  892. org_id:0,
  893. };
  894. },
  895. watch: {
  896. schedule_type:function (){
  897. this.isShowShangWu = false
  898. this.isShowXiaWu = false
  899. this.isShowWanShang = false
  900. if(this.schedule_type.length > 0) {
  901. for (let i = 0; i < this.schedule_type.length; i++) {
  902. if (this.schedule_type[i] == 1) {
  903. this.isShowShangWu = true
  904. } else if (this.schedule_type[i] == 2) {
  905. this.isShowXiaWu = true
  906. } else if (this.schedule_type[i] == 3) {
  907. this.isShowWanShang = true
  908. }
  909. }
  910. }else{
  911. this.isShowShangWu = true
  912. this.isShowXiaWu = true
  913. this.isShowWanShang = true
  914. }
  915. },
  916. week_type:function () {
  917. // console.log(this.week_type)
  918. // console.log(this.schedule_type)
  919. // console.log(this.scheduleZone)
  920. this.isShowOne = false
  921. this.isShowTwo = false
  922. this.isShowThree = false
  923. this.isShowFour = false
  924. this.isShowFive = false
  925. this.isShowSix = false
  926. this.isShowSeven = false
  927. if(this.week_type.length > 0) {
  928. for (let i = 0; i < this.week_type.length; i++) {
  929. if (this.week_type[i] == "周一") {
  930. this.isShowOne = true
  931. } else if (this.week_type[i] == "周二") {
  932. this.isShowTwo = true
  933. } else if (this.week_type[i] == "周三") {
  934. this.isShowThree = true
  935. } else if (this.week_type[i] == "周四") {
  936. this.isShowFour = true
  937. } else if (this.week_type[i] == "周五") {
  938. this.isShowFive = true
  939. } else if (this.week_type[i] == "周六") {
  940. this.isShowSix = true
  941. } else if (this.week_type[i] == "周日") {
  942. this.isShowSeven = true
  943. }
  944. }
  945. }else{
  946. this.isShowOne = true
  947. this.isShowTwo = true
  948. this.isShowThree = true
  949. this.isShowFour = true
  950. this.isShowFive = true
  951. this.isShowSix = true
  952. this.isShowSeven = true
  953. }
  954. },
  955. weekTime: function() {
  956. //
  957. if(this.weekTime != 'historyWeek'){
  958. console.log('12343455',this.weekTime);
  959. var theType = this.weekType(this.weekTime);
  960. this.theType = theType
  961. this.getSchedules();
  962. }
  963. },
  964. scheduleZoneRow: function() {
  965. var theType = this.weekType(this.weekTime);
  966. this.theType = theType
  967. this.getSchedules();
  968. },
  969. tableHeight(val) {
  970. if (!this.timer) {
  971. this.tableHeight = val;
  972. this.timer = true;
  973. const that = this;
  974. setTimeout(function() {
  975. that.timer = false;
  976. }, 400);
  977. }
  978. }
  979. },
  980. created() {
  981. this.org_id = this.$store.getters.xt_user.org.id
  982. // sessionStorage.setItem('value1',!this.value1);
  983. sessionStorage.removeItem('value1')
  984. var date = new Date()
  985. this.time = date
  986. var year = date.getFullYear()
  987. var month = date.getMonth() + 1
  988. if (month < 10) {
  989. month = "0" + month
  990. }
  991. var day = date.getDate()
  992. if (day < 10) {
  993. day = "0" + day
  994. }
  995. var nowDate = year + "-" + month + "-" + day
  996. var date = new Date(nowDate + " 00:00:00")
  997. this.now_time = date.getTime()/1000
  998. this.getAllZones()
  999. this.changeScheduleType(1)
  1000. rowNumber = 0;
  1001. this.modeOptions = this.$store.getters.treatment_mode;
  1002. this.partitions = this.partitionsProp;
  1003. console.log("分区oowowoow",this.partitions)
  1004. var contagions = this.$store.getters.contagions;
  1005. if (contagions.length > 0) {
  1006. var that = this;
  1007. contagions.forEach(function(citem) {
  1008. if (citem.type == 2) {
  1009. that.diseasesArr.push({ value: citem.id, label: citem.name });
  1010. }
  1011. });
  1012. }
  1013. this.scheduleZoneRow = this.scheduleZoneRowProp;
  1014. this.weekday = new Date().getDay();
  1015. if (this.weekday == 0) {
  1016. this.weekday = 7;
  1017. }
  1018. // this.getnum()
  1019. // console.log('22222');
  1020. },
  1021. methods: {
  1022. // 班次选择
  1023. scheduleType_change(val){
  1024. // console.log('vvvvvv',val);
  1025. this.$emit('event2', val)
  1026. if(val==1){
  1027. this.isShowShangWu = true
  1028. this.isShowXiaWu = false
  1029. this.isShowWanShang = false
  1030. }else if (val ==2){
  1031. this.isShowShangWu = false
  1032. this.isShowXiaWu = true
  1033. this.isShowWanShang = false
  1034. }else if (val == 3){
  1035. this.isShowShangWu = false
  1036. this.isShowXiaWu = false
  1037. this.isShowWanShang = true
  1038. }else {
  1039. this.isShowShangWu = true
  1040. this.isShowXiaWu = true
  1041. this.isShowWanShang = true
  1042. }
  1043. this.schedule_type =val
  1044. this.$emit('event6', val)
  1045. },
  1046. switchThis(flag){
  1047. if(this.value1==false){
  1048. sessionStorage.removeItem('value1')
  1049. }else{
  1050. sessionStorage.setItem('value1',this.value1)
  1051. }
  1052. this.$emit('guanliu_show',this.value1)
  1053. console.log('this.value1',this.value1);
  1054. console.log('flag',flag);
  1055. },
  1056. switchMode(flag){
  1057. this.modename_value=flag
  1058. this.$emit('mode_name',this.modename_value)
  1059. console.log('ddd',this.modename_value);
  1060. },
  1061. getData(){
  1062. return this.scheduleZone
  1063. },
  1064. compare(p){ //这是比较函数
  1065. return function(m,n){
  1066. var a = m[p];
  1067. var b = n[p];
  1068. return a - b; //升序
  1069. }
  1070. },
  1071. // 表格所有数据
  1072. getWeekPanels() {
  1073. console.log("触发232332323232")
  1074. this.scheduleZone=[]
  1075. var partionStr = this.partition_id
  1076. var arr = this.zoneIdList.join(',')
  1077. var str = ""
  1078. if(partionStr == 0){
  1079. str = arr
  1080. }
  1081. if(partionStr != 0){
  1082. str = partionStr.join(',')
  1083. }
  1084. getWeekPanelsOne(1,str).then(response => {
  1085. if (response.data.state == 0) {
  1086. return false
  1087. }
  1088. console.log("触发232332323232",response.data.data)
  1089. var partitions = response.data.data.partitions
  1090. this.subzone = response.data.data.partitions
  1091. // this.subzone.push(response.data.data.partitions)
  1092. console.log("partitions",partitions)
  1093. this.theWeek.thisWeek = response.data.data.theWeek
  1094. // this.theWeek.historyWeek=this.theWeek.thisWeek - 2
  1095. this.theWeek.lastWeek = this.theWeek.thisWeek - 1
  1096. this.theWeek.nextWeek = this.theWeek.thisWeek + 1
  1097. this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2
  1098. var that = this
  1099. if (partitions.length > 0) {
  1100. partitions.forEach(function(partition) {
  1101. if (partition.jihaos.length == 0) {
  1102. return false
  1103. }
  1104. that.scheduleZoneRow.push(partition.jihaos.length)
  1105. that.partitions[partition.id] = partition
  1106. partition.jihaos.forEach(function(jihao) {
  1107. var thisPa = {
  1108. area: partition.name,
  1109. zone_id: partition.id,
  1110. zone_type: partition.type,
  1111. cut: jihao.number,
  1112. jihao_id: jihao.id,
  1113. sort:jihao.sort,
  1114. Mon_M: {
  1115. schedule_id: 0,
  1116. mode_id: 0,
  1117. mode_name: '',
  1118. patient_id: 0,
  1119. patient: '',
  1120. dialysis_machine_name:'',
  1121. schedule_date:"",
  1122. Count:0,
  1123. },
  1124. Mon_A: {
  1125. schedule_id: 0,
  1126. mode_id: 0,
  1127. mode_name: '',
  1128. patient_id: 0,
  1129. patient: '',
  1130. dialysis_machine_name:'',
  1131. schedule_date:"",
  1132. Count:0,
  1133. },
  1134. Mon_N: {
  1135. schedule_id: 0,
  1136. mode_id: 0,
  1137. mode_name: '',
  1138. patient_id: 0,
  1139. patient: '',
  1140. dialysis_machine_name:'',
  1141. schedule_date:"",
  1142. Count:0,
  1143. },
  1144. Tue_M: {
  1145. schedule_id: 0,
  1146. mode_id: 0,
  1147. mode_name: '',
  1148. patient_id: 0,
  1149. patient: '',
  1150. dialysis_machine_name:'',
  1151. schedule_date:"",
  1152. Count:0,
  1153. },
  1154. Tue_A: {
  1155. schedule_id: 0,
  1156. mode_id: 0,
  1157. mode_name: '',
  1158. patient_id: 0,
  1159. patient: '',
  1160. dialysis_machine_name:'',
  1161. schedule_date:"",
  1162. Count:0,
  1163. },
  1164. Tue_N: {
  1165. schedule_id: 0,
  1166. mode_id: 0,
  1167. mode_name: '',
  1168. patient_id: 0,
  1169. patient: '',
  1170. dialysis_machine_name:'',
  1171. schedule_date:"",
  1172. Count:0,
  1173. },
  1174. Wed_M: {
  1175. schedule_id: 0,
  1176. mode_id: 0,
  1177. mode_name: '',
  1178. patient_id: 0,
  1179. patient: '',
  1180. dialysis_machine_name:'',
  1181. schedule_date:"",
  1182. Count:0,
  1183. },
  1184. Wed_A: {
  1185. schedule_id: 0,
  1186. mode_id: 0,
  1187. mode_name: '',
  1188. patient_id: 0,
  1189. patient: '',
  1190. dialysis_machine_name:'',
  1191. schedule_date:"",
  1192. Count:0,
  1193. },
  1194. Wed_N: {
  1195. schedule_id: 0,
  1196. mode_id: 0,
  1197. mode_name: '',
  1198. patient_id: 0,
  1199. patient: '',
  1200. dialysis_machine_name:'',
  1201. schedule_date:"",
  1202. Count:0,
  1203. },
  1204. Thurs_M: {
  1205. schedule_id: 0,
  1206. mode_id: 0,
  1207. mode_name: '',
  1208. patient_id: 0,
  1209. patient: '',
  1210. dialysis_machine_name:'',
  1211. schedule_date:"",
  1212. Count:0,
  1213. },
  1214. Thurs_A: {
  1215. schedule_id: 0,
  1216. mode_id: 0,
  1217. mode_name: '',
  1218. patient_id: 0,
  1219. patient: '',
  1220. dialysis_machine_name:'',
  1221. schedule_date:"",
  1222. Count:0,
  1223. },
  1224. Thurs_N: {
  1225. schedule_id: 0,
  1226. mode_id: 0,
  1227. mode_name: '',
  1228. patient_id: 0,
  1229. patient: '',
  1230. dialysis_machine_name:'',
  1231. schedule_date:"",
  1232. Count:0,
  1233. },
  1234. Fri_M: {
  1235. schedule_id: 0,
  1236. mode_id: 0,
  1237. mode_name: '',
  1238. patient_id: 0,
  1239. patient: '',
  1240. dialysis_machine_name:'',
  1241. schedule_date:"",
  1242. Count:0,
  1243. },
  1244. Fri_A: {
  1245. schedule_id: 0,
  1246. mode_id: 0,
  1247. mode_name: '',
  1248. patient_id: 0,
  1249. patient: '',
  1250. dialysis_machine_name:'',
  1251. schedule_date:"",
  1252. Count:0,
  1253. },
  1254. Fri_N: {
  1255. schedule_id: 0,
  1256. mode_id: 0,
  1257. mode_name: '',
  1258. patient_id: 0,
  1259. patient: '',
  1260. dialysis_machine_name:'',
  1261. schedule_date:"",
  1262. Count:0,
  1263. },
  1264. Sat_M: {
  1265. schedule_id: 0,
  1266. mode_id: 0,
  1267. mode_name: '',
  1268. patient_id: 0,
  1269. patient: '',
  1270. dialysis_machine_name:'',
  1271. schedule_date:"",
  1272. Count:0,
  1273. },
  1274. Sat_A: {
  1275. schedule_id: 0,
  1276. mode_id: 0,
  1277. mode_name: '',
  1278. patient_id: 0,
  1279. patient: '',
  1280. dialysis_machine_name:'',
  1281. schedule_date:"",
  1282. Count:0,
  1283. },
  1284. Sat_N: {
  1285. schedule_id: 0,
  1286. mode_id: 0,
  1287. mode_name: '',
  1288. patient_id: 0,
  1289. patient: '',
  1290. dialysis_machine_name:'',
  1291. schedule_date:"",
  1292. Count:0,
  1293. },
  1294. Sun_A: {
  1295. schedule_id: 0,
  1296. mode_id: 0,
  1297. mode_name: '',
  1298. patient_id: 0,
  1299. patient: '',
  1300. dialysis_machine_name:'',
  1301. schedule_date:"",
  1302. Count:0,
  1303. },
  1304. Sun_N: {
  1305. schedule_id: 0,
  1306. mode_id: 0,
  1307. mode_name: '',
  1308. patient_id: 0,
  1309. patient: '',
  1310. dialysis_machine_name:'',
  1311. schedule_date:"",
  1312. Count:0,
  1313. },
  1314. Sun_M: {
  1315. schedule_id: 0,
  1316. mode_id: 0,
  1317. mode_name: '',
  1318. patient_id: 0,
  1319. patient: '',
  1320. dialysis_machine_name:'',
  1321. schedule_date:"",
  1322. Count:0,
  1323. },
  1324. total: 0
  1325. }
  1326. that.scheduleZone.push(thisPa)
  1327. })
  1328. })
  1329. }
  1330. this.scheduleZone.sort(this.compare('sort'))
  1331. this.source_scheduleZone = this.scheduleZone
  1332. console.log("34455555566666",this.scheduleZone)
  1333. })
  1334. },
  1335. // 单元格样式的回调
  1336. cellClass({ row, column, rowIndex, columnIndex }) {
  1337. // if(row[column.property].patient_id>0){
  1338. // console.log('qqqqq',row[column.property])
  1339. // }
  1340. // console.log('wwwww',column)
  1341. // console.log('eeeee',rowIndex)
  1342. // console.log('rrrrr',columnIndex)
  1343. if(columnIndex==1&&row.zone_type!=1){
  1344. return "table-row-new-class schedule-table-row Infectious_disease";
  1345. }
  1346. // 机号蓝线
  1347. // if(columnIndex==1 ){
  1348. // return 'border_bott '
  1349. // }
  1350. // if(columnIndex==0){
  1351. // return 'border_left'
  1352. // }
  1353. if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
  1354. return "";
  1355. } else {
  1356. if (this.weekTime == "lastWeek") {
  1357. // if(column.label == '晚' ){
  1358. // return 'evening_border schedule-table-cell-disable'
  1359. // }
  1360. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover ){
  1361. return 'hover-td schedule-table-cell-disable'
  1362. }else {
  1363. return 'schedule-table-cell-disable'
  1364. }
  1365. // return "schedule-table-cell-disable";
  1366. } else if (this.weekTime == "thisWeek") {
  1367. var weekday = Math.floor((columnIndex - 2) / 3 + 1);
  1368. // 判断日期
  1369. if (weekday < this.weekday) {
  1370. // console.log('这是row',row);
  1371. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover ){
  1372. return 'hover-td schedule-table-cell-disable'
  1373. }
  1374. // if(column.label == '晚'){
  1375. // return 'evening_border schedule-table-cell-disable'
  1376. // }
  1377. return "schedule-table-cell-disable";
  1378. }else{
  1379. // 分日期
  1380. // if(column.label == '晚' ){
  1381. // return 'evening_border'
  1382. // }
  1383. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1384. return 'hover-td '
  1385. }else {
  1386. return ''
  1387. }
  1388. }
  1389. } else {
  1390. // if(column.label == '晚' ){
  1391. // return 'evening_border'
  1392. // }
  1393. }
  1394. }
  1395. return "";
  1396. },
  1397. cellstyle({ row, column, rowIndex, columnIndex }){
  1398. // return 'border-bottom: 1px solid #707174;'
  1399. // console.log('555555',this.subzone);
  1400. if(this.org_id!=10503 && this.org_id!=10447 && this.org_id!=0 && this.org_id !=10471){
  1401. return 'border: 1px solid #707174;border-collapse: collapse;'
  1402. }
  1403. // 分区蓝线
  1404. // for(let i=0;i<this.subzone.length;i++){
  1405. // var subslice=this.subzone[i].jihaos.slice(-1)
  1406. // // console.log('这是row',subslice);
  1407. // // if(row.zone_id==subslice[0].zone_id && row.jihao_id == subslice[0].id ){
  1408. // // // console.log('33333333333',subslice);
  1409. // // return 'border-bottom: 1px solid #707174;'
  1410. // // }
  1411. // }
  1412. // for(let j in subslice){
  1413. // if(row.zone_id==subslice[j].zone_id && row.jihao_id == subslice[j].id ){
  1414. // return 'border-bottom: 1px solid #707174;'
  1415. // }
  1416. // }
  1417. // if(columnIndex==0){
  1418. // return 'border-bottom: 1px solid #707174;'
  1419. // }
  1420. },
  1421. changeSearchContagion(id) {
  1422. this.patientQuery.contagion = id;
  1423. this.getSchedulePatients();
  1424. },
  1425. // 合计
  1426. getSummaries(param) {
  1427. const { columns, data } = param;
  1428. // console.log('hhhhhh',columns);
  1429. // console.log('vvvvvv',data);
  1430. const sums = [];
  1431. console.log();
  1432. columns.forEach((column, index) => {
  1433. if (index === 0 ) {
  1434. sums[index] = "总数";
  1435. return;
  1436. }
  1437. if (index === 1 ) {
  1438. sums[index] = data.length;
  1439. return;
  1440. }
  1441. if(index ===23){
  1442. sums[index]= this.count_num
  1443. return
  1444. }
  1445. const values = data.map(item => item[column.property]);
  1446. sums[index] = values.reduce((prev, curr) => {
  1447. if (typeof curr["mode_id"] === "undefined") {
  1448. return prev;
  1449. }
  1450. const value = Number(curr["mode_id"]);
  1451. // console.log('hhhhhh',curr);
  1452. if (!isNaN(value) && value > 0) {
  1453. return prev + 1;
  1454. } else {
  1455. return prev;
  1456. }
  1457. }, 0);
  1458. sums[index];
  1459. // const nameObj = values.reduce((pre,cur) => {
  1460. // if(cur in pre){
  1461. // pre[cur]++
  1462. // }else{
  1463. // pre[cur] = 1
  1464. // }
  1465. // },{})
  1466. // console.log('ffffff',nameObj);
  1467. });
  1468. this.$nextTick(() => {
  1469. this.$refs.table.doLayout();
  1470. });
  1471. //表格某列全部数据
  1472. var Mon_M = []
  1473. var Mon_A = []
  1474. var Mon_N = []
  1475. var Tue_M =[]
  1476. var Tue_A = []
  1477. var Tue_N = []
  1478. var Wed_M = []
  1479. var Wed_A = []
  1480. var Wed_N = []
  1481. var Thurs_M = []
  1482. var Thurs_A = []
  1483. var Thurs_N = []
  1484. var Fri_M = []
  1485. var Fri_A = []
  1486. var Fri_N = []
  1487. var Sat_M = []
  1488. var Sat_A = []
  1489. var Sat_N = []
  1490. var Sun_M = []
  1491. var Sun_A = []
  1492. var Sun_N = []
  1493. // 操作后数据
  1494. var Mon_M_One= []
  1495. var Mon_A_One = []
  1496. var Mon_N_One = []
  1497. var Tue_M_One =[]
  1498. var Tue_A_One = []
  1499. var Tue_N_One = []
  1500. var Wed_M_One = []
  1501. var Wed_A_One = []
  1502. var Wed_N_One = []
  1503. var Thurs_M_One = []
  1504. var Thurs_A_One = []
  1505. var Thurs_N_One = []
  1506. var Fri_M_One = []
  1507. var Fri_A_One = []
  1508. var Fri_N_One = []
  1509. var Sat_M_One = []
  1510. var Sat_A_One = []
  1511. var Sat_N_One = []
  1512. var Sun_M_One = []
  1513. var Sun_A_One = []
  1514. var Sun_N_One= []
  1515. // console.log('xxxxxxxx',data);
  1516. if(this.weektypes ==''){
  1517. for(let j in data){
  1518. if(data[j].hasOwnProperty ('Mon_A') == true){
  1519. Mon_A.push(data[j].Mon_A.mode_name)
  1520. Mon_A=Mon_A.filter(item=> item && item.trim())//去掉空字符串
  1521. var countNum =Mon_A.reduce((obj,name)=>{
  1522. if(name in obj){
  1523. obj[name]++
  1524. }else{
  1525. obj[name]=1
  1526. }
  1527. return obj
  1528. },{})
  1529. }
  1530. }
  1531. for(let x in countNum){
  1532. Mon_A_One.push(x + ':' + countNum[x]+"\n")
  1533. }
  1534. var result = [];
  1535. for (var i = 0,len = Mon_A_One.length; i < len; i+=29) {
  1536. var strObjcet = Mon_A_One.slice(i, i+29);
  1537. var str = strObjcet.toString();
  1538. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1539. result.push(str);
  1540. }
  1541. sums[3]="总人数:"+ sums[3] +"\n"+result
  1542. for(let j in data){
  1543. if(data[j].hasOwnProperty ('Mon_M') == true){
  1544. Mon_M.push(data[j].Mon_M.mode_name)
  1545. Mon_M=Mon_M.filter(item=> item && item.trim())
  1546. var countNum =Mon_M.reduce((obj,name)=>{
  1547. if(name in obj){
  1548. obj[name]++
  1549. }else{
  1550. obj[name]=1
  1551. }
  1552. return obj
  1553. },{})
  1554. }
  1555. }
  1556. for(let x in countNum){
  1557. Mon_M_One.push(x + ':' + countNum[x]+"\n")
  1558. }
  1559. var result = [];
  1560. for (var i = 0,len = Mon_M_One.length; i < len; i+=29) {
  1561. var strObjcet = Mon_M_One.slice(i, i+29);
  1562. var str = strObjcet.toString();
  1563. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1564. result.push(str);
  1565. }
  1566. sums[2]="总人数:"+ sums[2] +"\n"+result
  1567. for(let j in data){
  1568. if(data[j].hasOwnProperty ('Mon_N') == true){
  1569. Mon_N.push(data[j].Mon_N.mode_name)
  1570. Mon_N=Mon_N.filter(item=> item && item.trim())
  1571. var countNum =Mon_N.reduce((obj,name)=>{
  1572. if(name in obj){
  1573. obj[name]++
  1574. }else{
  1575. obj[name]=1
  1576. }
  1577. return obj
  1578. },{})
  1579. }
  1580. }
  1581. for(let x in countNum){
  1582. Mon_N_One.push(x + ':' + countNum[x]+"\n")
  1583. }
  1584. var result = [];
  1585. for (var i = 0,len = Mon_N_One.length; i < len; i+=29) {
  1586. var strObjcet = Mon_N_One.slice(i, i+29);
  1587. var str = strObjcet.toString();
  1588. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1589. result.push(str);
  1590. }
  1591. sums[4]="总人数:"+ sums[4] +"\n"+result
  1592. // 星期二
  1593. for(let j in data){
  1594. if(data[j].hasOwnProperty ('Tue_M') == true){
  1595. Tue_M.push(data[j].Tue_M.mode_name)
  1596. Tue_M=Tue_M.filter(item=> item && item.trim())
  1597. var countNum =Tue_M.reduce((obj,name)=>{
  1598. if(name in obj){
  1599. obj[name]++
  1600. }else{
  1601. obj[name]=1
  1602. }
  1603. return obj
  1604. },{})
  1605. }
  1606. }
  1607. for(let x in countNum){
  1608. Tue_M_One.push(x + ':' + countNum[x]+"\n")
  1609. }
  1610. var result = [];
  1611. for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
  1612. var strObjcet = Tue_M_One.slice(i, i+29);
  1613. var str = strObjcet.toString();
  1614. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1615. result.push(str);
  1616. }
  1617. sums[5]="总人数:"+ sums[5] +"\n"+result
  1618. for(let j in data){
  1619. if(data[j].hasOwnProperty ('Tue_A') == true){
  1620. Tue_A.push(data[j].Tue_A.mode_name)
  1621. Tue_A=Tue_A.filter(item=> item && item.trim())
  1622. var countNum =Tue_A.reduce((obj,name)=>{
  1623. if(name in obj){
  1624. obj[name]++
  1625. }else{
  1626. obj[name]=1
  1627. }
  1628. return obj
  1629. },{})
  1630. }
  1631. }
  1632. for(let x in countNum){
  1633. Tue_A_One.push(x + ':' + countNum[x]+"\n")
  1634. }
  1635. var result = [];
  1636. for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
  1637. var strObjcet = Tue_A_One.slice(i, i+29);
  1638. var str = strObjcet.toString();
  1639. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1640. result.push(str);
  1641. }
  1642. sums[6]="总人数:"+ sums[6] +"\n"+result
  1643. for(let j in data){
  1644. if(data[j].hasOwnProperty ('Tue_N') == true){
  1645. Tue_N.push(data[j].Tue_N.mode_name)
  1646. Tue_N=Tue_N.filter(item=> item && item.trim())
  1647. var countNum =Tue_N.reduce((obj,name)=>{
  1648. if(name in obj){
  1649. obj[name]++
  1650. }else{
  1651. obj[name]=1
  1652. }
  1653. return obj
  1654. },{})
  1655. }
  1656. }
  1657. for(let x in countNum){
  1658. Tue_N_One.push(x + ':' + countNum[x]+"\n")
  1659. }
  1660. var result = [];
  1661. for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
  1662. var strObjcet = Tue_N_One.slice(i, i+29);
  1663. var str = strObjcet.toString();
  1664. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1665. result.push(str);
  1666. }
  1667. sums[7]="总人数:"+ sums[7] +"\n"+result
  1668. // 星期三
  1669. for(let j in data){
  1670. if(data[j].hasOwnProperty ('Wed_M') == true){
  1671. Wed_M.push(data[j].Wed_M.mode_name)
  1672. Wed_M=Wed_M.filter(item=> item && item.trim())
  1673. var countNum =Wed_M.reduce((obj,name)=>{
  1674. if(name in obj){
  1675. obj[name]++
  1676. }else{
  1677. obj[name]=1
  1678. }
  1679. return obj
  1680. },{})
  1681. }
  1682. }
  1683. for(let x in countNum){
  1684. Wed_M_One.push(x + ':' + countNum[x]+"\n")
  1685. }
  1686. var result = [];
  1687. for (var i = 0,len = Wed_M_One.length; i < len; i+=29) {
  1688. var strObjcet = Wed_M_One.slice(i, i+29);
  1689. var str = strObjcet.toString();
  1690. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1691. result.push(str);
  1692. }
  1693. sums[8]="总人数:"+ sums[8] +"\n"+result
  1694. for(let j in data){
  1695. if(data[j].hasOwnProperty ('Wed_A') == true){
  1696. Wed_A.push(data[j].Wed_A.mode_name)
  1697. Wed_A=Wed_A.filter(item=> item && item.trim())
  1698. var countNum =Wed_A.reduce((obj,name)=>{
  1699. if(name in obj){
  1700. obj[name]++
  1701. }else{
  1702. obj[name]=1
  1703. }
  1704. return obj
  1705. },{})
  1706. }
  1707. }
  1708. for(let x in countNum){
  1709. Wed_A_One.push(x + ':' + countNum[x]+"\n")
  1710. }
  1711. var result = [];
  1712. for (var i = 0,len = Wed_A_One.length; i < len; i+=29) {
  1713. var strObjcet = Wed_A_One.slice(i, i+29);
  1714. var str = strObjcet.toString();
  1715. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1716. result.push(str);
  1717. }
  1718. sums[9]="总人数:"+ sums[9] +"\n"+result
  1719. for(let j in data){
  1720. if(data[j].hasOwnProperty ('Wed_N') == true){
  1721. Wed_N.push(data[j].Wed_N.mode_name)
  1722. Wed_N=Wed_N.filter(item=> item && item.trim())
  1723. var countNum =Wed_N.reduce((obj,name)=>{
  1724. if(name in obj){
  1725. obj[name]++
  1726. }else{
  1727. obj[name]=1
  1728. }
  1729. return obj
  1730. },{})
  1731. }
  1732. }
  1733. for(let x in countNum){
  1734. Wed_N_One.push(x + ':' + countNum[x]+"\n")
  1735. }
  1736. var result = [];
  1737. for (var i = 0,len = Wed_N_One.length; i < len; i+=29) {
  1738. var strObjcet = Wed_N_One.slice(i, i+29);
  1739. var str = strObjcet.toString();
  1740. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1741. result.push(str);
  1742. }
  1743. sums[10]="总人数:"+ sums[10] +"\n"+result
  1744. // 星期四
  1745. for(let j in data){
  1746. if(data[j].hasOwnProperty ('Thurs_M') == true){
  1747. Thurs_M.push(data[j].Thurs_M.mode_name)
  1748. Thurs_M=Thurs_M.filter(item=> item && item.trim())
  1749. var countNum =Thurs_M.reduce((obj,name)=>{
  1750. if(name in obj){
  1751. obj[name]++
  1752. }else{
  1753. obj[name]=1
  1754. }
  1755. return obj
  1756. },{})
  1757. }
  1758. }
  1759. for(let x in countNum){
  1760. Thurs_M_One.push(x + ':' + countNum[x]+"\n")
  1761. }
  1762. var result = [];
  1763. for (var i = 0,len = Thurs_M_One.length; i < len; i+=29) {
  1764. var strObjcet = Thurs_M_One.slice(i, i+29);
  1765. var str = strObjcet.toString();
  1766. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1767. result.push(str);
  1768. }
  1769. sums[11]="总人数:"+ sums[11] +"\n"+result
  1770. for(let j in data){
  1771. if(data[j].hasOwnProperty ('Thurs_A') == true){
  1772. Thurs_A.push(data[j].Thurs_A.mode_name)
  1773. Thurs_A=Thurs_A.filter(item=> item && item.trim())
  1774. var countNum =Thurs_A.reduce((obj,name)=>{
  1775. if(name in obj){
  1776. obj[name]++
  1777. }else{
  1778. obj[name]=1
  1779. }
  1780. return obj
  1781. },{})
  1782. }
  1783. }
  1784. for(let x in countNum){
  1785. Thurs_A_One.push(x + ':' + countNum[x]+"\n")
  1786. }
  1787. var result = [];
  1788. for (var i = 0,len = Thurs_A_One.length; i < len; i+=29) {
  1789. var strObjcet = Thurs_A_One.slice(i, i+29);
  1790. var str = strObjcet.toString();
  1791. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1792. result.push(str);
  1793. }
  1794. sums[12]="总人数:"+ sums[12] +"\n"+result
  1795. for(let j in data){
  1796. if(data[j].hasOwnProperty ('Thurs_N') == true){
  1797. Thurs_N.push(data[j].Thurs_N.mode_name)
  1798. Thurs_N=Thurs_N.filter(item=> item && item.trim())
  1799. var countNum =Thurs_N.reduce((obj,name)=>{
  1800. if(name in obj){
  1801. obj[name]++
  1802. }else{
  1803. obj[name]=1
  1804. }
  1805. return obj
  1806. },{})
  1807. }
  1808. }
  1809. for(let x in countNum){
  1810. Thurs_N_One.push(x + ':' + countNum[x]+"\n")
  1811. }
  1812. var result = [];
  1813. for (var i = 0,len = Thurs_N_One.length; i < len; i+=29) {
  1814. var strObjcet = Thurs_N_One.slice(i, i+29);
  1815. var str = strObjcet.toString();
  1816. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1817. result.push(str);
  1818. }
  1819. sums[13]="总人数:"+ sums[13] +"\n"+result
  1820. // 星期五
  1821. for(let j in data){
  1822. if(data[j].hasOwnProperty ('Fri_M') == true){
  1823. Fri_M.push(data[j].Fri_M.mode_name)
  1824. Fri_M=Fri_M.filter(item=> item && item.trim())
  1825. var countNum =Fri_M.reduce((obj,name)=>{
  1826. if(name in obj){
  1827. obj[name]++
  1828. }else{
  1829. obj[name]=1
  1830. }
  1831. return obj
  1832. },{})
  1833. }
  1834. }
  1835. for(let x in countNum){
  1836. Fri_M_One.push(x + ':' + countNum[x]+"\n")
  1837. }
  1838. var result = [];
  1839. for (var i = 0,len = Fri_M_One.length; i < len; i+=29) {
  1840. var strObjcet = Fri_M_One.slice(i, i+29);
  1841. var str = strObjcet.toString();
  1842. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1843. result.push(str);
  1844. }
  1845. sums[14]="总人数:"+ sums[14] +"\n"+result
  1846. for(let j in data){
  1847. if(data[j].hasOwnProperty ('Fri_A') == true){
  1848. Fri_A.push(data[j].Fri_A.mode_name)
  1849. Fri_A=Fri_A.filter(item=> item && item.trim())
  1850. var countNum =Fri_A.reduce((obj,name)=>{
  1851. if(name in obj){
  1852. obj[name]++
  1853. }else{
  1854. obj[name]=1
  1855. }
  1856. return obj
  1857. },{})
  1858. }
  1859. }
  1860. for(let x in countNum){
  1861. Fri_A_One.push(x + ':' + countNum[x]+"\n")
  1862. }
  1863. var result = [];
  1864. for (var i = 0,len = Fri_A_One.length; i < len; i+=29) {
  1865. var strObjcet = Fri_A_One.slice(i, i+29);
  1866. var str = strObjcet.toString();
  1867. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1868. result.push(str);
  1869. }
  1870. sums[15]="总人数:"+ sums[15] +"\n"+result
  1871. for(let j in data){
  1872. if(data[j].hasOwnProperty ('Fri_N') == true){
  1873. Fri_N.push(data[j].Fri_N.mode_name)
  1874. Fri_N=Fri_N.filter(item=> item && item.trim())
  1875. var countNum =Fri_N.reduce((obj,name)=>{
  1876. if(name in obj){
  1877. obj[name]++
  1878. }else{
  1879. obj[name]=1
  1880. }
  1881. return obj
  1882. },{})
  1883. }
  1884. }
  1885. for(let x in countNum){
  1886. Fri_N_One.push(x + ':' + countNum[x]+"\n")
  1887. }
  1888. var result = [];
  1889. for (var i = 0,len = Fri_N_One.length; i < len; i+=29) {
  1890. var strObjcet = Fri_N_One.slice(i, i+29);
  1891. var str = strObjcet.toString();
  1892. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1893. result.push(str);
  1894. }
  1895. sums[16]="总人数:"+ sums[16] +"\n"+result
  1896. // 星期六
  1897. for(let j in data){
  1898. if(data[j].hasOwnProperty ('Sat_M') == true){
  1899. Sat_M.push(data[j].Sat_M.mode_name)
  1900. Sat_M=Sat_M.filter(item=> item && item.trim())
  1901. var countNum =Sat_M.reduce((obj,name)=>{
  1902. if(name in obj){
  1903. obj[name]++
  1904. }else{
  1905. obj[name]=1
  1906. }
  1907. return obj
  1908. },{})
  1909. }
  1910. }
  1911. for(let x in countNum){
  1912. Sat_M_One.push(x + ':' + countNum[x]+"\n")
  1913. }
  1914. var result = [];
  1915. for (var i = 0,len = Sat_M_One.length; i < len; i+=29) {
  1916. var strObjcet = Sat_M_One.slice(i, i+29);
  1917. var str = strObjcet.toString();
  1918. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1919. result.push(str);
  1920. }
  1921. sums[17]="总人数:"+ sums[17] +"\n"+result
  1922. for(let j in data){
  1923. if(data[j].hasOwnProperty ('Sat_A') == true){
  1924. Sat_A.push(data[j].Sat_A.mode_name)
  1925. Sat_A=Sat_A.filter(item=> item && item.trim())
  1926. var countNum =Sat_A.reduce((obj,name)=>{
  1927. if(name in obj){
  1928. obj[name]++
  1929. }else{
  1930. obj[name]=1
  1931. }
  1932. return obj
  1933. },{})
  1934. }
  1935. }
  1936. for(let x in countNum){
  1937. Sat_A_One.push(x + ':' + countNum[x]+"\n")
  1938. }
  1939. var result = [];
  1940. for (var i = 0,len = Sat_A_One.length; i < len; i+=29) {
  1941. var strObjcet = Sat_A_One.slice(i, i+29);
  1942. var str = strObjcet.toString();
  1943. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1944. result.push(str);
  1945. }
  1946. sums[18]="总人数:"+ sums[18] +"\n"+result
  1947. for(let j in data){
  1948. if(data[j].hasOwnProperty ('Sat_N') == true){
  1949. Sat_N.push(data[j].Sat_N.mode_name)
  1950. Sat_N=Sat_N.filter(item=> item && item.trim())
  1951. var countNum =Sat_N.reduce((obj,name)=>{
  1952. if(name in obj){
  1953. obj[name]++
  1954. }else{
  1955. obj[name]=1
  1956. }
  1957. return obj
  1958. },{})
  1959. }
  1960. }
  1961. for(let x in countNum){
  1962. Sat_N_One.push(x + ':' + countNum[x]+"\n")
  1963. }
  1964. var result = [];
  1965. for (var i = 0,len = Sat_N_One.length; i < len; i+=29) {
  1966. var strObjcet = Sat_N_One.slice(i, i+29);
  1967. var str = strObjcet.toString();
  1968. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1969. result.push(str);
  1970. }
  1971. sums[19]="总人数:"+ sums[19] +"\n"+result
  1972. // 星期天
  1973. for(let j in data){
  1974. if(data[j].hasOwnProperty ('Sun_M') == true){
  1975. Sun_M.push(data[j].Sun_M.mode_name)
  1976. Sun_M=Sun_M.filter(item=> item && item.trim())
  1977. var countNum =Sun_M.reduce((obj,name)=>{
  1978. if(name in obj){
  1979. obj[name]++
  1980. }else{
  1981. obj[name]=1
  1982. }
  1983. return obj
  1984. },{})
  1985. }
  1986. }
  1987. for(let x in countNum){
  1988. Sun_M_One.push(x + ':' + countNum[x]+"\n")
  1989. }
  1990. var result = [];
  1991. for (var i = 0,len = Sun_M_One.length; i < len; i+=29) {
  1992. var strObjcet = Sun_M_One.slice(i, i+29);
  1993. var str = strObjcet.toString();
  1994. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1995. result.push(str);
  1996. }
  1997. sums[20]="总人数:"+ sums[20] +"\n"+result
  1998. for(let j in data){
  1999. if(data[j].hasOwnProperty ('Sun_A') == true){
  2000. Sun_A.push(data[j].Sun_A.mode_name)
  2001. Sun_A=Sun_A.filter(item=> item && item.trim())
  2002. var countNum =Sun_A.reduce((obj,name)=>{
  2003. if(name in obj){
  2004. obj[name]++
  2005. }else{
  2006. obj[name]=1
  2007. }
  2008. return obj
  2009. },{})
  2010. }
  2011. }
  2012. for(let x in countNum){
  2013. Sun_A_One.push(x + ':' + countNum[x]+"\n")
  2014. }
  2015. var result = [];
  2016. for (var i = 0,len = Sun_A_One.length; i < len; i+=29) {
  2017. var strObjcet = Sun_A_One.slice(i, i+29);
  2018. var str = strObjcet.toString();
  2019. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2020. result.push(str);
  2021. }
  2022. sums[21]="总人数:"+ sums[21] +"\n"+result
  2023. for(let j in data){
  2024. if(data[j].hasOwnProperty ('Sun_N') == true){
  2025. Sun_N.push(data[j].Sun_N.mode_name)
  2026. Sun_N=Sun_N.filter(item=> item && item.trim())
  2027. var countNum =Sun_N.reduce((obj,name)=>{
  2028. if(name in obj){
  2029. obj[name]++
  2030. }else{
  2031. obj[name]=1
  2032. }
  2033. return obj
  2034. },{})
  2035. }
  2036. }
  2037. for(let x in countNum){
  2038. Sun_N_One.push(x + ':' + countNum[x]+"\n")
  2039. }
  2040. var result = [];
  2041. for (var i = 0,len = Sun_N_One.length; i < len; i+=29) {
  2042. var strObjcet = Sun_N_One.slice(i, i+29);
  2043. var str = strObjcet.toString();
  2044. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2045. result.push(str);
  2046. }
  2047. sums[22]="总人数:"+ sums[22] +"\n"+result
  2048. }else{
  2049. if(this.weektypes == '周一'){
  2050. for(let j in data){
  2051. if(data[j].hasOwnProperty ('Mon_A') == true){
  2052. Mon_A.push(data[j].Mon_A.mode_name)
  2053. Mon_A=Mon_A.filter(item=> item && item.trim())//去掉空字符串
  2054. var countNum =Mon_A.reduce((obj,name)=>{
  2055. if(name in obj){
  2056. obj[name]++
  2057. }else{
  2058. obj[name]=1
  2059. }
  2060. return obj
  2061. },{})
  2062. }
  2063. }
  2064. for(let x in countNum){
  2065. Mon_A_One.push(x + ':' + countNum[x]+"\n")
  2066. }
  2067. var result = [];
  2068. for (var i = 0,len = Mon_A_One.length; i < len; i+=29) {
  2069. var strObjcet = Mon_A_One.slice(i, i+29);
  2070. var str = strObjcet.toString();
  2071. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2072. result.push(str);
  2073. }
  2074. sums[3]="总人数:"+ sums[3] +"\n"+result
  2075. for(let j in data){
  2076. if(data[j].hasOwnProperty ('Mon_M') == true){
  2077. Mon_M.push(data[j].Mon_M.mode_name)
  2078. Mon_M=Mon_M.filter(item=> item && item.trim())
  2079. var countNum =Mon_M.reduce((obj,name)=>{
  2080. if(name in obj){
  2081. obj[name]++
  2082. }else{
  2083. obj[name]=1
  2084. }
  2085. return obj
  2086. },{})
  2087. }
  2088. }
  2089. for(let x in countNum){
  2090. Mon_M_One.push(x + ':' + countNum[x]+"\n")
  2091. }
  2092. var result = [];
  2093. for (var i = 0,len = Mon_M_One.length; i < len; i+=29) {
  2094. var strObjcet = Mon_M_One.slice(i, i+29);
  2095. var str = strObjcet.toString();
  2096. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2097. result.push(str);
  2098. }
  2099. sums[2]="总人数:"+ sums[2] +"\n"+result
  2100. for(let j in data){
  2101. if(data[j].hasOwnProperty ('Mon_N') == true){
  2102. Mon_N.push(data[j].Mon_N.mode_name)
  2103. Mon_N=Mon_N.filter(item=> item && item.trim())
  2104. var countNum =Mon_N.reduce((obj,name)=>{
  2105. if(name in obj){
  2106. obj[name]++
  2107. }else{
  2108. obj[name]=1
  2109. }
  2110. return obj
  2111. },{})
  2112. }
  2113. }
  2114. for(let x in countNum){
  2115. Mon_N_One.push(x + ':' + countNum[x]+"\n")
  2116. }
  2117. var result = [];
  2118. for (var i = 0,len = Mon_N_One.length; i < len; i+=29) {
  2119. var strObjcet = Mon_N_One.slice(i, i+29);
  2120. var str = strObjcet.toString();
  2121. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2122. result.push(str);
  2123. }
  2124. sums[4]="总人数:"+ sums[4] +"\n"+result
  2125. }
  2126. if(this.weektypes == '周二'){
  2127. for(let j in data){
  2128. if(data[j].hasOwnProperty ('Tue_M') == true){
  2129. Tue_M.push(data[j].Tue_M.mode_name)
  2130. Tue_M=Tue_M.filter(item=> item && item.trim())
  2131. var countNum =Tue_M.reduce((obj,name)=>{
  2132. if(name in obj){
  2133. obj[name]++
  2134. }else{
  2135. obj[name]=1
  2136. }
  2137. return obj
  2138. },{})
  2139. }
  2140. }
  2141. for(let x in countNum){
  2142. Tue_M_One.push(x + ':' + countNum[x]+"\n")
  2143. }
  2144. var result = [];
  2145. for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
  2146. var strObjcet = Tue_M_One.slice(i, i+29);
  2147. var str = strObjcet.toString();
  2148. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2149. result.push(str);
  2150. }
  2151. // console.log('mmmmm',result);
  2152. sums[2]="总人数:"+ sums[2] +"\n"+result
  2153. for(let j in data){
  2154. if(data[j].hasOwnProperty ('Tue_M') == true){
  2155. Tue_A.push(data[j].Tue_A.mode_name)
  2156. Tue_A=Tue_A.filter(item=> item && item.trim())
  2157. var countNum =Tue_A.reduce((obj,name)=>{
  2158. if(name in obj){
  2159. obj[name]++
  2160. }else{
  2161. obj[name]=1
  2162. }
  2163. return obj
  2164. },{})
  2165. }
  2166. }
  2167. for(let x in countNum){
  2168. Tue_A_One.push(x + ':' + countNum[x]+"\n")
  2169. }
  2170. var result = [];
  2171. for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
  2172. var strObjcet = Tue_A_One.slice(i, i+29);
  2173. var str = strObjcet.toString();
  2174. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2175. result.push(str);
  2176. }
  2177. // console.log('mmmmm',result);
  2178. sums[3]="总人数:"+ sums[3] +"\n"+result
  2179. for(let j in data){
  2180. if(data[j].hasOwnProperty ('Tue_M') == true){
  2181. Tue_N.push(data[j].Tue_N.mode_name)
  2182. Tue_N=Tue_N.filter(item=> item && item.trim())
  2183. var countNum =Tue_N.reduce((obj,name)=>{
  2184. if(name in obj){
  2185. obj[name]++
  2186. }else{
  2187. obj[name]=1
  2188. }
  2189. return obj
  2190. },{})
  2191. }
  2192. }
  2193. for(let x in countNum){
  2194. Tue_N_One.push(x + ':' + countNum[x]+"\n")
  2195. }
  2196. var result = [];
  2197. for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
  2198. var strObjcet = Tue_N_One.slice(i, i+29);
  2199. var str = strObjcet.toString();
  2200. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2201. result.push(str);
  2202. }
  2203. // console.log('mmmmm',result);
  2204. sums[4]="总人数:"+ sums[4] +"\n"+result
  2205. // console.log('sums[22]="总人数:"',this.weeks[item],this.weektype);
  2206. }
  2207. if(this.weektypes == '周三'){
  2208. for(let j in data){
  2209. if(data[j].hasOwnProperty ('Wed_M') == true){
  2210. Wed_M.push(data[j].Wed_M.mode_name)
  2211. Wed_M=Wed_M.filter(item=> item && item.trim())
  2212. var countNum =Wed_M.reduce((obj,name)=>{
  2213. if(name in obj){
  2214. obj[name]++
  2215. }else{
  2216. obj[name]=1
  2217. }
  2218. return obj
  2219. },{})
  2220. }
  2221. }
  2222. for(let x in countNum){
  2223. Wed_M_One.push(x + ':' + countNum[x]+"\n")
  2224. }
  2225. var result = [];
  2226. for (var i = 0,len = Wed_M_One.length; i < len; i+=29) {
  2227. var strObjcet = Wed_M_One.slice(i, i+29);
  2228. var str = strObjcet.toString();
  2229. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2230. result.push(str);
  2231. }
  2232. // console.log('mmmmm',result);
  2233. sums[2]="总人数:"+ sums[2] +"\n"+result
  2234. for(let j in data){
  2235. if(data[j].hasOwnProperty ('Wed_A') == true){
  2236. Wed_A.push(data[j].Wed_A.mode_name)
  2237. Wed_A=Wed_A.filter(item=> item && item.trim())
  2238. var countNum =Wed_A.reduce((obj,name)=>{
  2239. if(name in obj){
  2240. obj[name]++
  2241. }else{
  2242. obj[name]=1
  2243. }
  2244. return obj
  2245. },{})
  2246. }
  2247. }
  2248. for(let x in countNum){
  2249. Wed_A_One.push(x + ':' + countNum[x]+"\n")
  2250. }
  2251. var result = [];
  2252. for (var i = 0,len = Wed_A_One.length; i < len; i+=29) {
  2253. var strObjcet = Wed_A_One.slice(i, i+29);
  2254. var str = strObjcet.toString();
  2255. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2256. result.push(str);
  2257. }
  2258. // console.log('mmmmm',result);
  2259. sums[3]="总人数:"+ sums[3] +"\n"+result
  2260. for(let j in data){
  2261. if(data[j].hasOwnProperty ('Wed_N') == true){
  2262. Wed_N.push(data[j].Wed_N.mode_name)
  2263. Wed_N=Wed_N.filter(item=> item && item.trim())
  2264. var countNum =Wed_N.reduce((obj,name)=>{
  2265. if(name in obj){
  2266. obj[name]++
  2267. }else{
  2268. obj[name]=1
  2269. }
  2270. return obj
  2271. },{})
  2272. }
  2273. }
  2274. for(let x in countNum){
  2275. Wed_N_One.push(x + ':' + countNum[x]+"\n")
  2276. }
  2277. var result = [];
  2278. for (var i = 0,len = Wed_N_One.length; i < len; i+=29) {
  2279. var strObjcet = Wed_N_One.slice(i, i+29);
  2280. var str = strObjcet.toString();
  2281. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2282. result.push(str);
  2283. }
  2284. // console.log('mmmmm',result);
  2285. sums[4]="总人数:"+ sums[4] +"\n"+result
  2286. // console.log('sums[22]="总人数:"',this.weeks[item],this.weektype);
  2287. }
  2288. if(this.weektypes == '周四'){
  2289. for(let j in data){
  2290. if(data[j].hasOwnProperty ('Thurs_M') == true){
  2291. Thurs_M.push(data[j].Thurs_M.mode_name)
  2292. Thurs_M=Thurs_M.filter(item=> item && item.trim())
  2293. var countNum =Thurs_M.reduce((obj,name)=>{
  2294. if(name in obj){
  2295. obj[name]++
  2296. }else{
  2297. obj[name]=1
  2298. }
  2299. return obj
  2300. },{})
  2301. }
  2302. }
  2303. for(let x in countNum){
  2304. Thurs_M_One.push(x + ':' + countNum[x]+"\n")
  2305. }
  2306. var result = [];
  2307. for (var i = 0,len = Thurs_M_One.length; i < len; i+=29) {
  2308. var strObjcet = Thurs_M_One.slice(i, i+29);
  2309. var str = strObjcet.toString();
  2310. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2311. result.push(str);
  2312. }
  2313. sums[2]="总人数:"+ sums[2] +"\n"+result
  2314. for(let j in data){
  2315. if(data[j].hasOwnProperty ('Thurs_A') == true){
  2316. Thurs_A.push(data[j].Thurs_A.mode_name)
  2317. Thurs_A=Thurs_A.filter(item=> item && item.trim())
  2318. var countNum =Thurs_A.reduce((obj,name)=>{
  2319. if(name in obj){
  2320. obj[name]++
  2321. }else{
  2322. obj[name]=1
  2323. }
  2324. return obj
  2325. },{})
  2326. }
  2327. }
  2328. for(let x in countNum){
  2329. Thurs_A_One.push(x + ':' + countNum[x]+"\n")
  2330. }
  2331. var result = [];
  2332. for (var i = 0,len = Thurs_A_One.length; i < len; i+=29) {
  2333. var strObjcet = Thurs_A_One.slice(i, i+29);
  2334. var str = strObjcet.toString();
  2335. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2336. result.push(str);
  2337. }
  2338. sums[3]="总人数:"+ sums[3] +"\n"+result
  2339. for(let j in data){
  2340. if(data[j].hasOwnProperty ('Thurs_N') == true){
  2341. Thurs_N.push(data[j].Thurs_N.mode_name)
  2342. Thurs_N=Thurs_N.filter(item=> item && item.trim())
  2343. var countNum =Thurs_N.reduce((obj,name)=>{
  2344. if(name in obj){
  2345. obj[name]++
  2346. }else{
  2347. obj[name]=1
  2348. }
  2349. return obj
  2350. },{})
  2351. }
  2352. }
  2353. for(let x in countNum){
  2354. Thurs_N_One.push(x + ':' + countNum[x]+"\n")
  2355. }
  2356. var result = [];
  2357. for (var i = 0,len = Thurs_N_One.length; i < len; i+=29) {
  2358. var strObjcet = Thurs_N_One.slice(i, i+29);
  2359. var str = strObjcet.toString();
  2360. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2361. result.push(str);
  2362. }
  2363. sums[4]="总人数:"+ sums[4] +"\n"+result
  2364. }
  2365. if(this.weektypes == '周五'){
  2366. for(let j in data){
  2367. if(data[j].hasOwnProperty ('Fri_M') == true){
  2368. Fri_M.push(data[j].Fri_M.mode_name)
  2369. Fri_M=Fri_M.filter(item=> item && item.trim())
  2370. var countNum =Fri_M.reduce((obj,name)=>{
  2371. if(name in obj){
  2372. obj[name]++
  2373. }else{
  2374. obj[name]=1
  2375. }
  2376. return obj
  2377. },{})
  2378. }
  2379. }
  2380. for(let x in countNum){
  2381. Fri_M_One.push(x + ':' + countNum[x]+"\n")
  2382. }
  2383. var result = [];
  2384. for (var i = 0,len = Fri_M_One.length; i < len; i+=29) {
  2385. var strObjcet = Fri_M_One.slice(i, i+29);
  2386. var str = strObjcet.toString();
  2387. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2388. result.push(str);
  2389. }
  2390. sums[2]="总人数:"+ sums[2] +"\n"+result
  2391. for(let j in data){
  2392. if(data[j].hasOwnProperty ('Fri_A') == true){
  2393. Fri_A.push(data[j].Fri_A.mode_name)
  2394. Fri_A=Fri_A.filter(item=> item && item.trim())
  2395. var countNum =Fri_A.reduce((obj,name)=>{
  2396. if(name in obj){
  2397. obj[name]++
  2398. }else{
  2399. obj[name]=1
  2400. }
  2401. return obj
  2402. },{})
  2403. }
  2404. }
  2405. for(let x in countNum){
  2406. Fri_A_One.push(x + ':' + countNum[x]+"\n")
  2407. }
  2408. var result = [];
  2409. for (var i = 0,len = Fri_A_One.length; i < len; i+=29) {
  2410. var strObjcet = Fri_A_One.slice(i, i+29);
  2411. var str = strObjcet.toString();
  2412. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2413. result.push(str);
  2414. }
  2415. sums[3]="总人数:"+ sums[3] +"\n"+result
  2416. for(let j in data){
  2417. if(data[j].hasOwnProperty ('Fri_N') == true){
  2418. Fri_N.push(data[j].Fri_N.mode_name)
  2419. Fri_N=Fri_N.filter(item=> item && item.trim())
  2420. var countNum =Fri_N.reduce((obj,name)=>{
  2421. if(name in obj){
  2422. obj[name]++
  2423. }else{
  2424. obj[name]=1
  2425. }
  2426. return obj
  2427. },{})
  2428. }
  2429. }
  2430. for(let x in countNum){
  2431. Fri_N_One.push(x + ':' + countNum[x]+"\n")
  2432. }
  2433. var result = [];
  2434. for (var i = 0,len = Fri_N_One.length; i < len; i+=29) {
  2435. var strObjcet = Fri_N_One.slice(i, i+29);
  2436. var str = strObjcet.toString();
  2437. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2438. result.push(str);
  2439. }
  2440. sums[4]="总人数:"+ sums[4] +"\n"+result
  2441. }
  2442. if(this.weektypes == '周六'){
  2443. for(let j in data){
  2444. if(data[j].hasOwnProperty ('Sat_M') == true){
  2445. Sat_M.push(data[j].Sat_M.mode_name)
  2446. Sat_M=Sat_M.filter(item=> item && item.trim())
  2447. var countNum =Sat_M.reduce((obj,name)=>{
  2448. if(name in obj){
  2449. obj[name]++
  2450. }else{
  2451. obj[name]=1
  2452. }
  2453. return obj
  2454. },{})
  2455. }
  2456. }
  2457. for(let x in countNum){
  2458. Sat_M_One.push(x + ':' + countNum[x]+"\n")
  2459. }
  2460. var result = [];
  2461. for (var i = 0,len = Sat_M_One.length; i < len; i+=29) {
  2462. var strObjcet = Sat_M_One.slice(i, i+29);
  2463. var str = strObjcet.toString();
  2464. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2465. result.push(str);
  2466. }
  2467. // console.log('mmmmm',result);
  2468. sums[2]="总人数:"+ sums[2] +"\n"+result
  2469. for(let j in data){
  2470. if(data[j].hasOwnProperty ('Sat_A') == true){
  2471. Sat_A.push(data[j].Sat_A.mode_name)
  2472. Sat_A=Sat_A.filter(item=> item && item.trim())
  2473. var countNum =Sat_A.reduce((obj,name)=>{
  2474. if(name in obj){
  2475. obj[name]++
  2476. }else{
  2477. obj[name]=1
  2478. }
  2479. return obj
  2480. },{})
  2481. }
  2482. }
  2483. for(let x in countNum){
  2484. Sat_A_One.push(x + ':' + countNum[x]+"\n")
  2485. }
  2486. var result = [];
  2487. for (var i = 0,len = Sat_A_One.length; i < len; i+=29) {
  2488. var strObjcet = Sat_A_One.slice(i, i+29);
  2489. var str = strObjcet.toString();
  2490. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2491. result.push(str);
  2492. }
  2493. // console.log('mmmmm',result);
  2494. sums[3]="总人数:"+ sums[3] +"\n"+result
  2495. for(let j in data){
  2496. if(data[j].hasOwnProperty ('Sat_N') == true){
  2497. Sat_N.push(data[j].Sat_N.mode_name)
  2498. Sat_N=Tue_N.filter(item=> item && item.trim())
  2499. var countNum =Sat_N.reduce((obj,name)=>{
  2500. if(name in obj){
  2501. obj[name]++
  2502. }else{
  2503. obj[name]=1
  2504. }
  2505. return obj
  2506. },{})
  2507. }
  2508. }
  2509. for(let x in countNum){
  2510. Sat_N_One.push(x + ':' + countNum[x]+"\n")
  2511. }
  2512. var result = [];
  2513. for (var i = 0,len = Sat_N_One.length; i < len; i+=29) {
  2514. var strObjcet = Sat_N_One.slice(i, i+29);
  2515. var str = strObjcet.toString();
  2516. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2517. result.push(str);
  2518. }
  2519. // console.log('mmmmm',result);
  2520. sums[4]="总人数:"+ sums[4] +"\n"+result
  2521. // console.log('sums[22]="总人数:"',this.weeks[item],this.weektype);
  2522. }
  2523. if(this.weektypes == '周日'){
  2524. for(let j in data){
  2525. if(data[j].hasOwnProperty ('Sun_M') == true){
  2526. Sun_M.push(data[j].Sun_M.mode_name)
  2527. Sun_M=Sun_M.filter(item=> item && item.trim())
  2528. var countNum =Sun_M.reduce((obj,name)=>{
  2529. if(name in obj){
  2530. obj[name]++
  2531. }else{
  2532. obj[name]=1
  2533. }
  2534. return obj
  2535. },{})
  2536. }
  2537. }
  2538. for(let x in countNum){
  2539. Sun_M_One.push(x + ':' + countNum[x]+"\n")
  2540. }
  2541. var result = [];
  2542. for (var i = 0,len = Sun_M_One.length; i < len; i+=29) {
  2543. var strObjcet = Sun_M_One.slice(i, i+29);
  2544. var str = strObjcet.toString();
  2545. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2546. result.push(str);
  2547. }
  2548. // console.log('mmmmm',result);
  2549. sums[2]="总人数:"+ sums[2] +"\n"+result
  2550. for(let j in data){
  2551. if(data[j].hasOwnProperty ('Sun_A') == true){
  2552. Sun_A.push(data[j].Sun_A.mode_name)
  2553. Sun_A=Sun_A.filter(item=> item && item.trim())
  2554. var countNum =Sun_A.reduce((obj,name)=>{
  2555. if(name in obj){
  2556. obj[name]++
  2557. }else{
  2558. obj[name]=1
  2559. }
  2560. return obj
  2561. },{})
  2562. }
  2563. }
  2564. for(let x in countNum){
  2565. Sun_A_One.push(x + ':' + countNum[x]+"\n")
  2566. }
  2567. var result = [];
  2568. for (var i = 0,len = Sun_A_One.length; i < len; i+=29) {
  2569. var strObjcet = Sun_A_One.slice(i, i+29);
  2570. var str = strObjcet.toString();
  2571. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2572. result.push(str);
  2573. }
  2574. // console.log('mmmmm',result);
  2575. sums[3]="总人数:"+ sums[3] +"\n"+result
  2576. for(let j in data){
  2577. if(data[j].hasOwnProperty ('Sun_N') == true){
  2578. Sun_N.push(data[j].Sun_N.mode_name)
  2579. Sun_N=Sun_N.filter(item=> item && item.trim())
  2580. var countNum =Sun_N.reduce((obj,name)=>{
  2581. if(name in obj){
  2582. obj[name]++
  2583. }else{
  2584. obj[name]=1
  2585. }
  2586. return obj
  2587. },{})
  2588. }
  2589. }
  2590. for(let x in countNum){
  2591. Sun_N_One.push(x + ':' + countNum[x]+"\n")
  2592. }
  2593. var result = [];
  2594. for (var i = 0,len = Sun_N_One.length; i < len; i+=29) {
  2595. var strObjcet = Sun_N_One.slice(i, i+29);
  2596. var str = strObjcet.toString();
  2597. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2598. result.push(str);
  2599. }
  2600. // console.log('mmmmm',result);
  2601. sums[4]="总人数:"+ sums[4] +"\n"+result
  2602. // console.log('sums[22]="总人数:"',this.weeks[item],this.weektype);
  2603. }
  2604. }
  2605. // for(let i=0;i<this.weeks.length;i++){
  2606. // if(this.weeks[i]==this.weektype){
  2607. // // if(this.weektype == '周二'){
  2608. // for(let j in data){
  2609. // if(data[j].hasOwnProperty ('Tue_M') == true){
  2610. // Tue_M.push(data[j].Tue_M.mode_name)
  2611. // Tue_M=Tue_M.filter(item=> item && item.trim())
  2612. // var countNum =Tue_M.reduce((obj,name)=>{
  2613. // if(name in obj){
  2614. // obj[name]++
  2615. // }else{
  2616. // obj[name]=1
  2617. // }
  2618. // return obj
  2619. // },{})
  2620. // }
  2621. // }
  2622. // for(let x in countNum){
  2623. // Tue_M_One.push(x + ':' + countNum[x]+"\n")
  2624. // }
  2625. // var result = [];
  2626. // for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
  2627. // var strObjcet = Tue_M_One.slice(i, i+29);
  2628. // var str = strObjcet.toString();
  2629. // str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2630. // result.push(str);
  2631. // }
  2632. // console.log('mmmmm',result);
  2633. // sums[2]="总人数:"+ sums[2] +"\n"+result
  2634. // for(let j in data){
  2635. // if(data[j].hasOwnProperty ('Tue_M') == true){
  2636. // Tue_A.push(data[j].Tue_A.mode_name)
  2637. // Tue_A=Tue_A.filter(item=> item && item.trim())
  2638. // var countNum =Tue_A.reduce((obj,name)=>{
  2639. // if(name in obj){
  2640. // obj[name]++
  2641. // }else{
  2642. // obj[name]=1
  2643. // }
  2644. // return obj
  2645. // },{})
  2646. // }
  2647. // }
  2648. // for(let x in countNum){
  2649. // Tue_A_One.push(x + ':' + countNum[x]+"\n")
  2650. // }
  2651. // var result = [];
  2652. // for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
  2653. // var strObjcet = Tue_A_One.slice(i, i+29);
  2654. // var str = strObjcet.toString();
  2655. // str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2656. // result.push(str);
  2657. // }
  2658. // console.log('mmmmm',result);
  2659. // sums[3]="总人数:"+ sums[3] +"\n"+result
  2660. // for(let j in data){
  2661. // if(data[j].hasOwnProperty ('Tue_M') == true){
  2662. // Tue_N.push(data[j].Tue_N.mode_name)
  2663. // Tue_N=Tue_N.filter(item=> item && item.trim())
  2664. // var countNum =Tue_N.reduce((obj,name)=>{
  2665. // if(name in obj){
  2666. // obj[name]++
  2667. // }else{
  2668. // obj[name]=1
  2669. // }
  2670. // return obj
  2671. // },{})
  2672. // }
  2673. // }
  2674. // for(let x in countNum){
  2675. // Tue_N_One.push(x + ':' + countNum[x]+"\n")
  2676. // }
  2677. // var result = [];
  2678. // for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
  2679. // var strObjcet = Tue_N_One.slice(i, i+29);
  2680. // var str = strObjcet.toString();
  2681. // str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2682. // result.push(str);
  2683. // }
  2684. // console.log('mmmmm',result);
  2685. // sums[4]="总人数:"+ sums[4] +"\n"+result
  2686. // // console.log('sums[22]="总人数:"',this.weeks[item],this.weektype);
  2687. // // }
  2688. // }
  2689. // }
  2690. // if(this.weektype == '周二'){
  2691. // for(let j in data){
  2692. // if(data[j].hasOwnProperty ('Tue_M') == true){
  2693. // Tue_M.push(data[j].Tue_M.mode_name)
  2694. // Tue_M=Tue_M.filter(item=> item && item.trim())
  2695. // var countNum =Tue_M.reduce((obj,name)=>{
  2696. // if(name in obj){
  2697. // obj[name]++
  2698. // }else{
  2699. // obj[name]=1
  2700. // }
  2701. // return obj
  2702. // },{})
  2703. // }
  2704. // }
  2705. // for(let x in countNum){
  2706. // Tue_M_One.push(x + ':' + countNum[x]+"\n")
  2707. // }
  2708. // var result = [];
  2709. // for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
  2710. // var strObjcet = Tue_M_One.slice(i, i+29);
  2711. // var str = strObjcet.toString();
  2712. // str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2713. // result.push(str);
  2714. // }
  2715. // console.log('mmmmm',result);
  2716. // sums[2]="总人数:"+ sums[2] +"\n"+result
  2717. // for(let j in data){
  2718. // if(data[j].hasOwnProperty ('Tue_M') == true){
  2719. // Tue_A.push(data[j].Tue_A.mode_name)
  2720. // Tue_A=Tue_A.filter(item=> item && item.trim())
  2721. // var countNum =Tue_A.reduce((obj,name)=>{
  2722. // if(name in obj){
  2723. // obj[name]++
  2724. // }else{
  2725. // obj[name]=1
  2726. // }
  2727. // return obj
  2728. // },{})
  2729. // }
  2730. // }
  2731. // for(let x in countNum){
  2732. // Tue_A_One.push(x + ':' + countNum[x]+"\n")
  2733. // }
  2734. // var result = [];
  2735. // for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
  2736. // var strObjcet = Tue_A_One.slice(i, i+29);
  2737. // var str = strObjcet.toString();
  2738. // str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2739. // result.push(str);
  2740. // }
  2741. // console.log('mmmmm',result);
  2742. // sums[3]="总人数:"+ sums[3] +"\n"+result
  2743. // for(let j in data){
  2744. // if(data[j].hasOwnProperty ('Tue_M') == true){
  2745. // Tue_N.push(data[j].Tue_N.mode_name)
  2746. // Tue_N=Tue_N.filter(item=> item && item.trim())
  2747. // var countNum =Tue_N.reduce((obj,name)=>{
  2748. // if(name in obj){
  2749. // obj[name]++
  2750. // }else{
  2751. // obj[name]=1
  2752. // }
  2753. // return obj
  2754. // },{})
  2755. // }
  2756. // }
  2757. // for(let x in countNum){
  2758. // Tue_N_One.push(x + ':' + countNum[x]+"\n")
  2759. // }
  2760. // var result = [];
  2761. // for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
  2762. // var strObjcet = Tue_N_One.slice(i, i+29);
  2763. // var str = strObjcet.toString();
  2764. // str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  2765. // result.push(str);
  2766. // }
  2767. // console.log('mmmmm',result);
  2768. // sums[4]="总人数:"+ sums[4] +"\n"+result
  2769. // // console.log('sums[22]="总人数:"',this.weeks[item],this.weektype);
  2770. // }
  2771. // }
  2772. return sums;
  2773. },
  2774. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  2775. var that = this;
  2776. var rowNum = 0;
  2777. rowNumber = 0;
  2778. var rutrnData = {};
  2779. if (columnIndex === 0) {
  2780. var rowLen = this.scheduleZoneRow.length;
  2781. if (rowLen > 0) {
  2782. for (let index = 0; index < rowLen; index++) {
  2783. rowNum = this.scheduleZoneRow[index];
  2784. rowNumber += rowNum;
  2785. var f = rowNumber - rowNum;
  2786. if (f == rowIndex) {
  2787. rutrnData = {
  2788. rowspan: rowNum,
  2789. colspan: 1
  2790. };
  2791. break;
  2792. } else if (rowIndex < rowNumber) {
  2793. rutrnData = {
  2794. rowspan: 0,
  2795. colspan: 0
  2796. };
  2797. break;
  2798. }
  2799. }
  2800. return rutrnData;
  2801. }
  2802. }
  2803. },
  2804. handleCurrentChange(row) {
  2805. if (typeof row === "undefined" || row == null) {
  2806. this.currentData.patient_id = 0;
  2807. this.currentData.contagions = [];
  2808. } else {
  2809. this.currentData.patient_id = row.id;
  2810. this.currentData.contagions = row.contagions;
  2811. }
  2812. },
  2813. closePatientPanel(row) {
  2814. this.dialogTableVisible = false;
  2815. this.$refs.singleTable.setCurrentRow(row);
  2816. this.currentData.patient_id = 0;
  2817. },
  2818. // 渲染内容
  2819. getSchedules() {
  2820. var partionStr = this.partition_id
  2821. var arr = this.zoneIdList.join(',')
  2822. var str = ""
  2823. if (partionStr == 0) {
  2824. str = arr
  2825. }
  2826. if (partionStr != 0) {
  2827. str = partionStr.join(',')
  2828. }
  2829. const params = {
  2830. weekTime: this.theType,
  2831. patitionid: str,
  2832. schedule_type: this.schedule_type,
  2833. }
  2834. getSchedulesOne(params).then(response => {
  2835. if (response.data.state == 1) {
  2836. this.weekTitle = response.data.data.weekTitle;
  2837. console.log('ffffff',response.data.data.schdules.length);
  2838. this.weekDays = response.data.data.days;
  2839. this.toDay = response.data.data.today;
  2840. var theSchedules = response.data.data.schdules;
  2841. this.count_num=response.data.data.schdules.length
  2842. var schedulesGroup = response.data.data.schedulesGroup
  2843. this.schedulesGroup = schedulesGroup
  2844. var that = this;
  2845. this.scheduleZone.forEach(function (zone, index) {
  2846. that.scheduleZone[index].Mon_M = {
  2847. mode_id: 0,
  2848. mode_name: "",
  2849. patient_id: 0,
  2850. patient: "",
  2851. dialysis_machine_name: "",
  2852. schedule_date: "",
  2853. Count: 0,
  2854. };
  2855. that.scheduleZone[index].Mon_A = {
  2856. mode_id: 0,
  2857. mode_name: "",
  2858. patient_id: 0,
  2859. patient: "",
  2860. dialysis_machine_name: "",
  2861. schedule_date: "",
  2862. Count: 0,
  2863. };
  2864. that.scheduleZone[index].Mon_N = {
  2865. mode_id: 0,
  2866. mode_name: "",
  2867. patient_id: 0,
  2868. patient: "",
  2869. dialysis_machine_name: "",
  2870. schedule_date: "",
  2871. Count: 0,
  2872. };
  2873. that.scheduleZone[index].Tue_M = {
  2874. mode_id: 0,
  2875. mode_name: "",
  2876. patient_id: 0,
  2877. patient: "",
  2878. dialysis_machine_name: "",
  2879. schedule_date: "",
  2880. Count: 0,
  2881. };
  2882. that.scheduleZone[index].Tue_A = {
  2883. mode_id: 0,
  2884. mode_name: "",
  2885. patient_id: 0,
  2886. patient: "",
  2887. dialysis_machine_name: "",
  2888. schedule_date: "",
  2889. Count: 0,
  2890. };
  2891. that.scheduleZone[index].Tue_N = {
  2892. mode_id: 0,
  2893. mode_name: "",
  2894. patient_id: 0,
  2895. patient: "",
  2896. dialysis_machine_name: "",
  2897. schedule_date: "",
  2898. Count: 0,
  2899. };
  2900. that.scheduleZone[index].Wed_M = {
  2901. mode_id: 0,
  2902. mode_name: "",
  2903. patient_id: 0,
  2904. patient: "",
  2905. dialysis_machine_name: "",
  2906. schedule_date: "",
  2907. Count: 0,
  2908. };
  2909. that.scheduleZone[index].Wed_A = {
  2910. mode_id: 0,
  2911. mode_name: "",
  2912. patient_id: 0,
  2913. patient: "",
  2914. dialysis_machine_name: "",
  2915. schedule_date: "",
  2916. Count: 0,
  2917. };
  2918. that.scheduleZone[index].Wed_N = {
  2919. mode_id: 0,
  2920. mode_name: "",
  2921. patient_id: 0,
  2922. patient: "",
  2923. dialysis_machine_name: "",
  2924. schedule_date: "",
  2925. Count: 0,
  2926. };
  2927. that.scheduleZone[index].Thurs_M = {
  2928. mode_id: 0,
  2929. mode_name: "",
  2930. patient_id: 0,
  2931. patient: "",
  2932. dialysis_machine_name: "",
  2933. schedule_date: "",
  2934. Count: 0,
  2935. };
  2936. that.scheduleZone[index].Thurs_A = {
  2937. mode_id: 0,
  2938. mode_name: "",
  2939. patient_id: 0,
  2940. patient: "",
  2941. dialysis_machine_name: "",
  2942. schedule_date: "",
  2943. Count: 0,
  2944. };
  2945. that.scheduleZone[index].Thurs_N = {
  2946. mode_id: 0,
  2947. mode_name: "",
  2948. patient_id: 0,
  2949. patient: "",
  2950. dialysis_machine_name: "",
  2951. schedule_date: "",
  2952. Count: 0,
  2953. };
  2954. that.scheduleZone[index].Fri_M = {
  2955. mode_id: 0,
  2956. mode_name: "",
  2957. patient_id: 0,
  2958. patient: "",
  2959. dialysis_machine_name: "",
  2960. schedule_date: "",
  2961. Count: 0,
  2962. };
  2963. that.scheduleZone[index].Fri_A = {
  2964. mode_id: 0,
  2965. mode_name: "",
  2966. patient_id: 0,
  2967. patient: "",
  2968. dialysis_machine_name: "",
  2969. schedule_date: "",
  2970. Count: 0,
  2971. };
  2972. that.scheduleZone[index].Fri_N = {
  2973. mode_id: 0,
  2974. mode_name: "",
  2975. patient_id: 0,
  2976. patient: "",
  2977. dialysis_machine_name: "",
  2978. schedule_date: "",
  2979. Count: 0,
  2980. };
  2981. that.scheduleZone[index].Sat_M = {
  2982. mode_id: 0,
  2983. mode_name: "",
  2984. patient_id: 0,
  2985. patient: "",
  2986. dialysis_machine_name: "",
  2987. schedule_date: "",
  2988. Count: 0,
  2989. };
  2990. that.scheduleZone[index].Sat_A = {
  2991. mode_id: 0,
  2992. mode_name: "",
  2993. patient_id: 0,
  2994. patient: "",
  2995. dialysis_machine_name: "",
  2996. schedule_date: "",
  2997. Count: 0,
  2998. };
  2999. that.scheduleZone[index].Sat_N = {
  3000. mode_id: 0,
  3001. mode_name: "",
  3002. patient_id: 0,
  3003. patient: "",
  3004. dialysis_machine_name: "",
  3005. schedule_date: "",
  3006. Count: 0,
  3007. };
  3008. that.scheduleZone[index].Sun_A = {
  3009. mode_id: 0,
  3010. mode_name: "",
  3011. patient_id: 0,
  3012. patient: "",
  3013. dialysis_machine_name: "",
  3014. schedule_date: "",
  3015. Count: 0,
  3016. };
  3017. that.scheduleZone[index].Sun_N = {
  3018. mode_id: 0,
  3019. mode_name: "",
  3020. patient_id: 0,
  3021. patient: "",
  3022. dialysis_machine_name: "",
  3023. schedule_date: "",
  3024. Count: 0,
  3025. };
  3026. that.scheduleZone[index].Sun_M = {
  3027. mode_id: 0,
  3028. mode_name: "",
  3029. patient_id: 0,
  3030. patient: "",
  3031. dialysis_machine_name: "",
  3032. schedule_date: "",
  3033. Count: 0,
  3034. };
  3035. that.scheduleZone[index].total = 0;
  3036. if (response.data.data.schdules.length > 0) {
  3037. theSchedules.forEach(function (schedule, sindex) {
  3038. if (zone.jihao_id == schedule.bed_id) {
  3039. var weekPath = that.weekPath(
  3040. schedule.schedule_week,
  3041. schedule.schedule_type
  3042. );
  3043. if (weekPath.length == 2) {
  3044. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3045. that.scheduleZone[index][weekPathKey] = {
  3046. schedule_id: schedule.id,
  3047. mode_id: schedule.mode_id,
  3048. patient_id: schedule.patient_id,
  3049. patient: schedule.patient,
  3050. dialysis_machine_name: schedule.dialysis_machine_name,
  3051. patient_contagions: schedule.patient_contagions,
  3052. schedule_date: schedule.schedule_date,
  3053. mode_name: typeof that.modeOptions[schedule.mode_id] === "undefined" ? "" : that.modeOptions[schedule.mode_id].name
  3054. };
  3055. that.scheduleZone[index].total += 1;
  3056. }
  3057. }
  3058. });
  3059. }
  3060. });
  3061. this.source_scheduleZone = this.scheduleZone
  3062. } else {
  3063. this.$message.error("网络错误");
  3064. return false;
  3065. }
  3066. });
  3067. },
  3068. getSchedulePatients() {
  3069. getSchedulePatients(this.patientQuery).then(response => {
  3070. if (response.data.state == 1) {
  3071. this.patients = response.data.data.patients;
  3072. }
  3073. });
  3074. },
  3075. // 搜索弹窗操作取消排班
  3076. CancelSchedule(id) {
  3077. this.$confirm("确定要取消当前排班?", "提示", {
  3078. confirmButtonText: "确定",
  3079. cancelButtonText: "取消",
  3080. type: "warning"
  3081. })
  3082. .then(() => {
  3083. CancelSchedule(id).then(response => {
  3084. if (response.data.state == 0) {
  3085. this.$message.error(response.data.msg);
  3086. } else {
  3087. this.$message({
  3088. type: "success",
  3089. message: "排班已取消!"
  3090. });
  3091. var that = this;
  3092. var schedule = response.data.data.schedule;
  3093. this.scheduleZone.forEach(function (zone, index) {
  3094. if (
  3095. zone.zone_id == schedule.partition_id &&
  3096. zone.jihao_id == schedule.bed_id
  3097. ) {
  3098. var weekPath = that.weekPath(
  3099. schedule.schedule_week,
  3100. schedule.schedule_type
  3101. );
  3102. if (weekPath.length == 2) {
  3103. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3104. that.scheduleZone[index][weekPathKey] = {
  3105. schedule_id: 0,
  3106. mode_id: 0,
  3107. patient_id: 0,
  3108. patient: "",
  3109. mode_name: "",
  3110. dialysis_machine_name: '',
  3111. };
  3112. that.scheduleZone[index].total -= 1;
  3113. }
  3114. }
  3115. });
  3116. this.tzDialogVisible = false;
  3117. this.searchTableVisible = false;
  3118. }
  3119. });
  3120. })
  3121. .catch(() => { });
  3122. },
  3123. // 搜索修改机号成功
  3124. changeScheduleActon(formName) {
  3125. this.changing_bed = true;
  3126. ChangeSchedule(this.currentData.id, this.changeSchedule)
  3127. .then(response => {
  3128. if (response.data.state == 0) {
  3129. this.$message.error(response.data.msg);
  3130. } else {
  3131. this.$message({
  3132. type: "success",
  3133. message: "修改成功!"
  3134. });
  3135. // var that = this;
  3136. this.getSchedules()
  3137. // var schedule = response.data.data.schedule;
  3138. // this.scheduleZone.forEach(function (zone, index) {
  3139. // if (
  3140. // zone.zone_id == schedule.partition_id &&
  3141. // zone.jihao_id == schedule.bed_id
  3142. // ) {
  3143. // var weekPath = that.weekPath(
  3144. // schedule.schedule_week,
  3145. // schedule.schedule_type
  3146. // );
  3147. // if (weekPath.length == 2) {
  3148. // var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3149. // that.scheduleZone[index][weekPathKey] = {
  3150. // schedule_id: schedule.id,
  3151. // mode_id: schedule.mode_id,
  3152. // patient_id: schedule.patient_id,
  3153. // patient: that.currentData.patient,
  3154. //
  3155. //
  3156. // dialysis_machine_name: schedule.dialysis_machine_name,
  3157. //
  3158. // patient_contagions: that.currentData.contagions,
  3159. // mode_name:
  3160. // typeof that.modeOptions[schedule.mode_id] === "undefined"
  3161. // ? ""
  3162. // : that.modeOptions[schedule.mode_id].name
  3163. // };
  3164. //
  3165. // that.scheduleZone[index].total += 1;
  3166. // }
  3167. // }
  3168. // if (
  3169. // zone.zone_id == that.currentData.partition_id &&
  3170. // zone.jihao_id == that.currentData.bed_id
  3171. // ) {
  3172. // var weekPath = that.weekPath(
  3173. // that.currentData.schedule_week,
  3174. // that.currentData.schedule_type
  3175. // );
  3176. // if (weekPath.length == 2) {
  3177. // var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3178. // that.scheduleZone[index][weekPathKey] = {
  3179. // schedule_id: 0,
  3180. // mode_id: 0,
  3181. // patient_id: 0,
  3182. // patient: "",
  3183. // mode_name: "",
  3184. // dialysis_machine_name: "",
  3185. // patient_contagions: []
  3186. // };
  3187. //
  3188. // that.scheduleZone[index].total -= 1;
  3189. // }
  3190. // }
  3191. // });
  3192. this.$refs[formName].resetFields();
  3193. this.jhDialogVisible = false;
  3194. }
  3195. this.changing_bed = false;
  3196. })
  3197. .catch(err => {
  3198. this.$message.error(err);
  3199. this.changing_bed = false;
  3200. });
  3201. },
  3202. CreateSchedule(id, data) {
  3203. this.creating_schedule = true;
  3204. CreateSchedule(id, data)
  3205. .then(response => {
  3206. if (response.data.state == 0) {
  3207. this.$message.error(response.data.msg);
  3208. } else {
  3209. this.$message({
  3210. type: "success",
  3211. message: "排班成功!"
  3212. });
  3213. var that = this;
  3214. var schedule = response.data.data.schedule;
  3215. this.scheduleZone.forEach(function (zone, index) {
  3216. if (
  3217. zone.zone_id == schedule.partition_id &&
  3218. zone.jihao_id == schedule.bed_id
  3219. ) {
  3220. var weekPath = that.weekPath(
  3221. schedule.schedule_week,
  3222. schedule.schedule_type
  3223. );
  3224. if (weekPath.length == 2) {
  3225. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3226. that.scheduleZone[index][weekPathKey] = {
  3227. schedule_id: schedule.id,
  3228. mode_id: schedule.mode_id,
  3229. patient_id: schedule.patient_id,
  3230. patient: schedule.patient,
  3231. dialysis_machine_name: schedule.dialysis_machine_name,
  3232. patient_contagions: that.currentData.contagions,
  3233. mode_name:
  3234. typeof that.modeOptions[schedule.mode_id] === "undefined"
  3235. ? ""
  3236. : that.modeOptions[schedule.mode_id].name
  3237. };
  3238. that.scheduleZone[index].total += 1;
  3239. }
  3240. }
  3241. });
  3242. this.closePatientPanel();
  3243. }
  3244. this.creating_schedule = false;
  3245. })
  3246. .catch(err => {
  3247. this.$message.error(err);
  3248. this.creating_schedule = false;
  3249. });
  3250. },
  3251. hoverMouse(row, column, cell, event) {
  3252. // console.log('sdf12344565');
  3253. if (row[column.property].schedule_id > 0) {
  3254. let patient_id = row[column.property].patient_id
  3255. this.patient_id_hover = patient_id
  3256. } else {
  3257. this.patient_id_hover = -1
  3258. }
  3259. },
  3260. clickThis(row, column, cell, event) {
  3261. if (!this.is_edit) {
  3262. this.$message.error("当前页面不可编辑");
  3263. return
  3264. }
  3265. // debugger
  3266. var week = this.weekDay(column.property);
  3267. if (week[0] == -1 || week[1] == -1) {
  3268. return false;
  3269. }
  3270. if (this.toDay > this.weekDays[week[0] - 1]) {
  3271. return false;
  3272. }
  3273. this.currentData.schedule_date = this.weekDays[week[0] - 1];
  3274. this.currentData.schedule_type = week[1];
  3275. this.currentData.bed_id = row.jihao_id;
  3276. this.currentData.partition_id = row.zone_id;
  3277. this.currentData.schedule_week = week[0];
  3278. this.currentData.type_name = this.dayType(week[1]);
  3279. this.currentData.zone_name = row.area;
  3280. this.currentData.bed_name = row.cut;
  3281. this.currentData.partition_type = row.zone_type;
  3282. if (row[column.property].schedule_id > 0) {
  3283. this.currentData.mode_id = row[column.property].mode_id;
  3284. this.currentData.id = row[column.property].schedule_id;
  3285. this.currentData.patient_id = row[column.property].patient_id;
  3286. this.currentData.patient = row[column.property].patient;
  3287. this.currentData.contagions = row[column.property].patient_contagions;
  3288. this.tiaoZhengType = 1;
  3289. this.tzDialogVisible = true;
  3290. } else {
  3291. this.currentData.mode_id = 1;
  3292. this.currentData.id = 0;
  3293. this.currentData.patient_id = 0;
  3294. this.currentData.patient = "";
  3295. this.currentData.contagions = [];
  3296. this.getSchedulePatients();
  3297. this.dialogTableVisible = true;
  3298. }
  3299. },
  3300. // 调整机号的确认按钮
  3301. submitTiaoZJH(formName) {
  3302. this.$refs[formName].validate(valid => {
  3303. if (valid) {
  3304. var weekPath = this.weekPath(
  3305. this.changeSchedule.schedule_week,
  3306. this.changeSchedule.schedule_type
  3307. );
  3308. if (weekPath.length != 2) {
  3309. this.$message.error("数据异常");
  3310. return false;
  3311. }
  3312. for (let i = 0; i < this.origin_device_numbers.length; i++) {
  3313. if (this.origin_device_numbers[i].id == this.device_id) {
  3314. this.changeSchedule.partition_id = this.origin_device_numbers[
  3315. i
  3316. ].zone_id;
  3317. }
  3318. }
  3319. this.changeSchedule.change_action = "change_device";
  3320. this.changeScheduleActon(formName);
  3321. // this.changeSchedule.spartition_type = this.scheduleZone[index].zone_type
  3322. var weekPathKey = weekPath[0] + '_' + weekPath[1]
  3323. for (var index in this.scheduleZone) {
  3324. if (this.scheduleZone[index].jihao_id == this.changeSchedule.bed_id) {
  3325. if (this.scheduleZone[index][weekPathKey].mode_id > 0) {
  3326. this.$message.error('选中的区域已经存在排班,不能再排班!')
  3327. return false
  3328. }
  3329. break
  3330. }
  3331. }
  3332. }
  3333. })
  3334. // this.$refs.changeSchedule.resetFields()
  3335. },
  3336. // 搜索弹窗操作调整模式确认按钮
  3337. submitMode(formName) {
  3338. this.changing_mode = true;
  3339. this.changeSchedule.change_action = "change_mode";
  3340. ChangeSchedule(this.currentData.id, this.changeSchedule).then(response => {
  3341. if (response.data.state == 0) {
  3342. this.$message.error(response.data.msg);
  3343. } else {
  3344. this.$message({
  3345. type: "success",
  3346. message: "修改成功!"
  3347. });
  3348. var that = this;
  3349. var schedule = response.data.data.schedule;
  3350. this.scheduleZone.forEach(function (zone, index) {
  3351. if (
  3352. zone.zone_id == schedule.partition_id &&
  3353. zone.jihao_id == schedule.bed_id
  3354. ) {
  3355. var weekPath = that.weekPath(
  3356. schedule.schedule_week,
  3357. schedule.schedule_type
  3358. );
  3359. if (weekPath.length == 2) {
  3360. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3361. that.scheduleZone[index][weekPathKey].mode_id =
  3362. schedule.mode_id;
  3363. that.scheduleZone[index][weekPathKey].mode_name =
  3364. typeof that.modeOptions[schedule.mode_id] === "undefined"
  3365. ? ""
  3366. : that.modeOptions[schedule.mode_id].name;
  3367. }
  3368. }
  3369. });
  3370. this.msDialogVisible = false;
  3371. }
  3372. this.changing_mode = false;
  3373. })
  3374. .catch(err => {
  3375. this.$message.error(err);
  3376. this.changing_mode = false;
  3377. });
  3378. },
  3379. submitTiaoZMS(formName) {
  3380. this.$refs[formName].validate(valid => {
  3381. if (valid) {
  3382. this.changing_mode = true;
  3383. this.changeSchedule.change_action = "change_mode";
  3384. ChangeSchedule(this.currentData.id, this.changeSchedule)
  3385. .then(response => {
  3386. if (response.data.state == 0) {
  3387. this.$message.error(response.data.msg);
  3388. } else {
  3389. this.$message({
  3390. type: "success",
  3391. message: "修改成功!"
  3392. });
  3393. var that = this;
  3394. var schedule = response.data.data.schedule;
  3395. this.scheduleZone.forEach(function (zone, index) {
  3396. if (
  3397. zone.zone_id == schedule.partition_id &&
  3398. zone.jihao_id == schedule.bed_id
  3399. ) {
  3400. var weekPath = that.weekPath(
  3401. schedule.schedule_week,
  3402. schedule.schedule_type
  3403. );
  3404. if (weekPath.length == 2) {
  3405. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  3406. that.scheduleZone[index][weekPathKey].mode_id =
  3407. schedule.mode_id;
  3408. that.scheduleZone[index][weekPathKey].mode_name =
  3409. typeof that.modeOptions[schedule.mode_id] ===
  3410. "undefined"
  3411. ? ""
  3412. : that.modeOptions[schedule.mode_id].name;
  3413. }
  3414. }
  3415. });
  3416. this.$refs[formName].resetFields();
  3417. this.msDialogVisible = false;
  3418. }
  3419. this.changing_mode = false;
  3420. })
  3421. .catch(err => {
  3422. this.$message.error(err);
  3423. this.changing_mode = false;
  3424. });
  3425. }
  3426. });
  3427. },
  3428. // 调整机号/选择分区
  3429. changePartition(value) {
  3430. let params = {
  3431. zone_id: value,
  3432. sch_type: this.currentData.schedule_type,
  3433. schedule_date: this.currentData.schedule_date,
  3434. patient_id: this.currentData.patient_id,
  3435. };
  3436. //进行网络请求,获取空排班机位
  3437. getSmartDevices(params).then((response) => {
  3438. console.log('getSmartDevices',response.data.data);
  3439. if (response.data.state == 0) {
  3440. return false;
  3441. } else {
  3442. var devices = response.data.data.devices;
  3443. this.current_devices = [];
  3444. this.current_devices = devices;
  3445. this.zone_names = devices;
  3446. this.device_id = devices[0].id
  3447. this.changeSchedule.bed_id = devices[0].id
  3448. }
  3449. });
  3450. },
  3451. // 调整机号/选择班次
  3452. changeScheduleType(schedule_type) {
  3453. this.currentData.schedule_type = schedule_type
  3454. let params = {
  3455. zone_id: this.currentData.partition_id,
  3456. sch_type: schedule_type,
  3457. schedule_date: this.currentData.schedule_date,
  3458. patient_id: this.currentData.patient_id,
  3459. };
  3460. //进行网络请求,获取空排班机位
  3461. getSmartDevices(params).then((response) => {
  3462. if (response.data.state == 0) {
  3463. return false;
  3464. } else {
  3465. var devices = response.data.data.devices;
  3466. this.current_devices = [];
  3467. this.current_devices = devices;
  3468. this.changeSchedule.bed_id = ""
  3469. this.changeSchedule.partition_id = this.currentData.partition_id
  3470. }
  3471. });
  3472. },
  3473. submitTiaoX() {
  3474. if (this.tiaoZhengType == 1) {
  3475. this.$confirm('确定要取消当前排班?', '提示', {
  3476. confirmButtonText: '确定',
  3477. cancelButtonText: '取消',
  3478. type: 'warning'
  3479. }).then(() => {
  3480. this.CancelSchedule(this.currentData.id);
  3481. }).catch(() => { });
  3482. }
  3483. switch (this.tiaoZhengType) {
  3484. case 1:
  3485. this.CancelSchedule(this.currentData.id);
  3486. break;
  3487. case 2:
  3488. this.changeSchedule = {
  3489. mode_id: this.currentData.mode_id,
  3490. schedule_type: this.currentData.schedule_type,
  3491. partition_id: this.currentData.partition_id,
  3492. bed_id: this.currentData.bed_id,
  3493. schedule_week: this.currentData.schedule_week,
  3494. partition_type: ""
  3495. };
  3496. if (
  3497. typeof this.partitions[this.currentData.partition_id].jihaos !==
  3498. "undefined"
  3499. ) {
  3500. this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
  3501. } else {
  3502. this.jihaos = [];
  3503. }
  3504. const params = {
  3505. type: this.currentData.schedule_type,
  3506. date: this.currentData.schedule_date
  3507. };
  3508. getUrgentScheduleInitData(params)
  3509. .then(response => {
  3510. if (response.data.state == 0) {
  3511. this.$message.error(response.data.msg);
  3512. } else {
  3513. if (response.data.state == 1) {
  3514. this.origin_schedules = response.data.data.schedules;
  3515. this.origin_device_numbers =
  3516. response.data.data.device_numbers;
  3517. var zone_device_map = {};
  3518. for (
  3519. let index = 0;
  3520. index < this.origin_device_numbers.length;
  3521. index++
  3522. ) {
  3523. const device_number = this.origin_device_numbers[index];
  3524. if (
  3525. zone_device_map[device_number.zone_name] == null ||
  3526. zone_device_map[device_number.zone_name] == undefined
  3527. ) {
  3528. zone_device_map[device_number.zone_name] = [];
  3529. }
  3530. zone_device_map[device_number.zone_name].push(
  3531. device_number
  3532. );
  3533. }
  3534. this.zone_device_map = zone_device_map;
  3535. this.zone_names = Object.keys(this.zone_device_map);
  3536. if (this.zone_names.length > 0) {
  3537. this.zone_name = this.zone_names[0];
  3538. this.current_devices = this.zone_device_map[this.zone_name];
  3539. this.device_id = this.current_devices[0].id;
  3540. }
  3541. this.zone_device_options = [
  3542. { values: this.zone_names },
  3543. { values: this.current_devices }
  3544. ];
  3545. //
  3546. // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
  3547. // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
  3548. // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
  3549. // this.origin_device_numbers.splice(y, 1)
  3550. // }
  3551. // }
  3552. // }
  3553. // // debugger
  3554. // var zone_device_map = {}
  3555. // for (let index = 0; index < this.origin_device_numbers.length; index++) {
  3556. // const device_number = this.origin_device_numbers[index]
  3557. // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
  3558. // zone_device_map[device_number.zone.name] = []
  3559. // }
  3560. // zone_device_map[device_number.zone.name].push(device_number)
  3561. // }
  3562. // this.zone_device_map = zone_device_map
  3563. //
  3564. // this.zone_names = Object.keys(this.zone_device_map)
  3565. // if (this.zone_names.length > 0) {
  3566. // this.zone_name = this.zone_names[0]
  3567. // this.current_devices = this.zone_device_map[this.zone_name]
  3568. // this.device_id = this.current_devices[0].id
  3569. // }
  3570. //
  3571. // this.zone_device_options = [
  3572. // { values: this.zone_names },
  3573. // // { values: this.getDeviceNumberNames(this.current_devices) },
  3574. // { values: this.current_devices }
  3575. // ]
  3576. } else {
  3577. }
  3578. }
  3579. })
  3580. .catch(err => {
  3581. this.$message.error(err);
  3582. });
  3583. this.tzDialogVisible = false;
  3584. this.jhDialogVisible = true;
  3585. break;
  3586. case 3:
  3587. this.changeSchedule = {
  3588. mode_id: "",
  3589. schedule_type: "",
  3590. partition_id: "",
  3591. bed_id: "",
  3592. schedule_week: "",
  3593. partition_type: ""
  3594. };
  3595. this.tzDialogVisible = false;
  3596. this.msDialogVisible = true;
  3597. break;
  3598. default:
  3599. break;
  3600. }
  3601. },
  3602. setSchedule() {
  3603. var that = this;
  3604. var submitFlag = true;
  3605. if (this.currentData.patient_id <= 0) {
  3606. this.$message.error("请先选择患者");
  3607. return false;
  3608. }
  3609. if (
  3610. this.currentData.schedule_date.length == 0 ||
  3611. this.currentData.schedule_type < 1 ||
  3612. this.currentData.schedule_type > 3 ||
  3613. this.currentData.bed_id < 1 ||
  3614. this.currentData.partition_id < 1 ||
  3615. this.currentData.schedule_week < 1 ||
  3616. this.currentData.schedule_week > 7
  3617. ) {
  3618. this.$message.error("请先选择排班时间或机号");
  3619. return false;
  3620. }
  3621. // 可能
  3622. // 患者有传染病,与选择的机器类型(传染病)不匹配
  3623. // 患者没有传染病,但机器是某个传染病的专用透析器
  3624. // 机器的透析模式与患者不匹配
  3625. if (this.currentData.contagions.length > 0) {
  3626. var cflag = false;
  3627. this.currentData.contagions.forEach(function (contagion) {
  3628. if (contagion.disease_id == that.currentData.partition_type) {
  3629. cflag = true;
  3630. }
  3631. });
  3632. if (!cflag) {
  3633. this.$confirm(
  3634. "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
  3635. "提示",
  3636. {
  3637. confirmButtonText: "确 定",
  3638. cancelButtonText: "取 消",
  3639. type: "warning"
  3640. }
  3641. )
  3642. .then(() => {
  3643. this.CreateSchedule(
  3644. this.currentData.patient_id,
  3645. this.currentData
  3646. );
  3647. })
  3648. .catch(() => { });
  3649. } else {
  3650. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  3651. }
  3652. } else if (that.currentData.partition_type > 1) {
  3653. this.$confirm(
  3654. "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
  3655. "提示",
  3656. {
  3657. confirmButtonText: "确 定",
  3658. cancelButtonText: "取 消",
  3659. type: "warning"
  3660. }
  3661. )
  3662. .then(() => {
  3663. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  3664. })
  3665. .catch(() => { });
  3666. } else {
  3667. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  3668. }
  3669. },
  3670. weekType(weekTime) {
  3671. var theType = 2;
  3672. switch (weekTime) {
  3673. // case "historyWeek":
  3674. // theType = 0;
  3675. // break;
  3676. case "lastWeek":
  3677. theType = 1;
  3678. break;
  3679. case "thisWeek":
  3680. theType = 2;
  3681. break;
  3682. case "nextWeek":
  3683. theType = 3;
  3684. break;
  3685. case "nextTwoWeek":
  3686. theType = 4;
  3687. break;
  3688. default:
  3689. theType = 2;
  3690. break;
  3691. }
  3692. return theType;
  3693. },
  3694. dayType(theType) {
  3695. var jType = "";
  3696. switch (theType) {
  3697. case 1:
  3698. jType = "上午";
  3699. break;
  3700. case 2:
  3701. jType = "下午";
  3702. break;
  3703. case 3:
  3704. jType = "晚上";
  3705. break;
  3706. default:
  3707. break;
  3708. }
  3709. return jType;
  3710. },
  3711. weekPath(week, schedule_type) {
  3712. var weekArr = {
  3713. 1: "Mon",
  3714. 2: "Tue",
  3715. 3: "Wed",
  3716. 4: "Thurs",
  3717. 5: "Fri",
  3718. 6: "Sat",
  3719. 7: "Sun"
  3720. };
  3721. var typeArr = { 1: "M", 2: "A", 3: "N" };
  3722. if (
  3723. typeof weekArr[week] === "undefined" ||
  3724. typeof typeArr[schedule_type] === "undefined"
  3725. ) {
  3726. return [];
  3727. }
  3728. return [weekArr[week], typeArr[schedule_type]];
  3729. },
  3730. weekDay(prop) {
  3731. var week = prop.split("_");
  3732. if (week.length != 2) {
  3733. return [-1, -1];
  3734. }
  3735. var w = -1;
  3736. var n = -1;
  3737. switch (week[0]) {
  3738. case "Mon":
  3739. w = 1;
  3740. break;
  3741. case "Tue":
  3742. w = 2;
  3743. break;
  3744. case "Wed":
  3745. w = 3;
  3746. break;
  3747. case "Thurs":
  3748. w = 4;
  3749. break;
  3750. case "Fri":
  3751. w = 5;
  3752. break;
  3753. case "Sat":
  3754. w = 6;
  3755. break;
  3756. case "Sun":
  3757. w = 7;
  3758. break;
  3759. default:
  3760. w = -1;
  3761. break;
  3762. }
  3763. switch (week[1]) {
  3764. case "M":
  3765. n = 1;
  3766. break;
  3767. case "A":
  3768. n = 2;
  3769. break;
  3770. case "N":
  3771. n = 3;
  3772. break;
  3773. default:
  3774. n = -1;
  3775. break;
  3776. }
  3777. if (w == -1 || n == -1) {
  3778. return [-1, -1];
  3779. }
  3780. return [w, n];
  3781. },
  3782. // 搜索
  3783. search: function () {
  3784. let week_type = 0
  3785. var weeklist = moment().format('E');//计算今天是这周第几天
  3786. var first_monday = moment().subtract(weeklist - 1, 'days').format('YYYY-MM-DD');//周一日期
  3787. var end_monday = moment().add(7 - weeklist, 'days').format('YYYY-MM-DD')
  3788. if (this.weekTime == 'thisWeek') {
  3789. week_type = 1
  3790. } else if (this.weekTime == 'nextWeek') {
  3791. week_type = 2
  3792. } else if (this.weekTime == 'nextTwoWeek') {
  3793. week_type = 3
  3794. }
  3795. const params = {
  3796. keywords: this.keywords,
  3797. week_type: week_type,
  3798. start_sch: first_monday,
  3799. end_sch: end_monday,
  3800. };
  3801. // console.log("params",params)
  3802. getSearchResult(params).then(response => {
  3803. if (response.data.state == 1) {
  3804. this.schedulePatients = response.data.data.schdules;
  3805. this.searchTableVisible = true;
  3806. }
  3807. });
  3808. },
  3809. // 搜索弹窗调整机号按钮
  3810. changeMachineNumber: function (index, row) {
  3811. this.currentData.schedule_type = row.schedule_type;
  3812. this.currentData.bed_id = row.bed_id;
  3813. this.currentData.partition_id = row.partition_id;
  3814. this.currentData.schedule_week = row.schedule_week;
  3815. switch (row.schedule_type) {
  3816. case 1:
  3817. this.currentData.type_name = "上午";
  3818. break;
  3819. case 2:
  3820. this.currentData.type_name = "下午";
  3821. break;
  3822. case 3:
  3823. this.currentData.type_name = "晚上";
  3824. break;
  3825. }
  3826. this.currentData.zone_name = row.zone.name;
  3827. this.currentData.bed_name = row.number.number;
  3828. this.currentData.partition_type = row.zone.type;
  3829. this.currentData.mode_id = row.mode_id;
  3830. this.currentData.patient_id = row.patient_id;
  3831. this.currentData.patient = row.patient;
  3832. this.currentData.contagions = row.patient_contagions;
  3833. this.currentData.id = row.id;
  3834. this.currentData.schedule_date = uParseTime(
  3835. row.schedule_date,
  3836. "{y}-{m}-{d}"
  3837. );
  3838. this.zone_name = row.partition_id;
  3839. this.device_id = row.bed_id;
  3840. // this.current_devices = this.partitions[row.partition_id].jihaos
  3841. let params = {
  3842. zone_id: row.partition_id,
  3843. sch_type: row.schedule_type,
  3844. schedule_date: this.currentData.schedule_date,
  3845. patient_id: this.currentData.patient_id,
  3846. };
  3847. //进行网络请求,获取空排班机位
  3848. getSmartDevices(params).then((response) => {
  3849. if (response.data.state == 0) {
  3850. return false;
  3851. } else {
  3852. var devices = response.data.data.devices;
  3853. this.current_devices = [];
  3854. this.current_devices = devices;
  3855. this.device_id = devices[0].id
  3856. }
  3857. });
  3858. this.changeSchedule = {
  3859. mode_id: row.mode_id,
  3860. schedule_type: row.schedule_type,
  3861. partition_id: row.partition_id,
  3862. bed_id: row.bed_id,
  3863. schedule_week: row.schedule_week,
  3864. partition_type: ""
  3865. };
  3866. if (typeof this.partitions[row.partition_id].jihaos !== "undefined") {
  3867. this.jihaos = this.partitions[row.partition_id].jihaos;
  3868. } else {
  3869. this.jihaos = [];
  3870. }
  3871. this.searchTableVisible = false;
  3872. this.jhDialogVisible = true;
  3873. },
  3874. getDialysisDate: function (row) {
  3875. let week = "";
  3876. switch (row.schedule_week) {
  3877. case 7:
  3878. week = "周日";
  3879. break;
  3880. case 1:
  3881. week = "周一";
  3882. break;
  3883. case 2:
  3884. week = "周二";
  3885. break;
  3886. case 3:
  3887. week = "周三";
  3888. break;
  3889. case 4:
  3890. week = "周四";
  3891. break;
  3892. case 5:
  3893. week = "周五";
  3894. break;
  3895. case 6:
  3896. week = "周六";
  3897. break;
  3898. }
  3899. return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
  3900. },
  3901. getSchedulesType: function (type, row) {
  3902. let type_name = "";
  3903. switch (type) {
  3904. case 1:
  3905. type_name = "上午";
  3906. break;
  3907. case 2:
  3908. type_name = "下午";
  3909. break;
  3910. case 3:
  3911. type_name = "晚上";
  3912. break;
  3913. }
  3914. return type_name;
  3915. },
  3916. // 搜索弹窗调整模式按钮
  3917. changeMode: function (index, row) {
  3918. this.changeSchedule = {
  3919. mode_id: "",
  3920. schedule_type: "",
  3921. partition_id: "",
  3922. bed_id: "",
  3923. schedule_week: "",
  3924. partition_type: ""
  3925. };
  3926. this.currentData.id = row.id;
  3927. this.searchTableVisible = false;
  3928. this.msDialogVisible = true;
  3929. },
  3930. // 分区
  3931. getAllZones() {
  3932. getAllZones().then(response => {
  3933. console.log('getAllZones',response.data.data);
  3934. if (response.data.state == 1) {
  3935. var zones = response.data.data.zones
  3936. for (let i = 0; i < zones.length; i++) {
  3937. this.zoneIdList.push(zones[i].id)
  3938. }
  3939. this.zones.push(...zones)
  3940. var strArr = this.zoneIdList.join(",")
  3941. this.strArr = strArr
  3942. this.getWeekPanels()
  3943. }
  3944. })
  3945. },
  3946. changePartiton(val) {
  3947. this.$emit('event1', val)
  3948. this.partition_id = val
  3949. this.getWeekPanels()
  3950. this.getSchedules()
  3951. },
  3952. changeSchedule_type(val) {
  3953. this.$emit('event2', val)
  3954. console.log('yyyyy',val);
  3955. this.schedule_type = val
  3956. this.getSchedules()
  3957. },
  3958. changeWeekDay(val) {
  3959. console.log('event3',);
  3960. this.weektypes=val
  3961. this.$emit('event3', val)
  3962. }
  3963. },
  3964. components: {
  3965. ScheduleItem
  3966. },
  3967. mounted() {
  3968. // new Drag(this.$refs.main);
  3969. this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 120;
  3970. // var theType = this.weekType(this.weekTime);
  3971. // this.getSchedules(theType);
  3972. const that = this;
  3973. window.onresize = () => {
  3974. return (() => {
  3975. window.fullHeight = document.documentElement.clientHeight;
  3976. if (window.fullHeight < 200) {
  3977. that.tableHeight = 200;
  3978. } else {
  3979. that.tableHeight = window.fullHeight - 160;
  3980. }
  3981. })();
  3982. };
  3983. },
  3984. computed: {
  3985. // 计算属性,为最后一项数据添加边框样式
  3986. lastItemStyle() {
  3987. return {
  3988. border: '1px solid red', // 边框样式
  3989. };
  3990. },
  3991. },
  3992. };
  3993. </script>
  3994. <style rel="stylesheet/css" lang="scss">
  3995. *{
  3996. -webkit-touch-callout:none; /*系统默认菜单被禁用*/
  3997. -webkit-user-select:none; /*webkit浏览器*/
  3998. -khtml-user-select:none; /*早期浏览器*/
  3999. -moz-user-select:none;/*火狐*/
  4000. -ms-user-select:none; /*IE10*/
  4001. user-select:none;
  4002. }
  4003. input{
  4004. -webkit-user-select:auto; /*webkit浏览器*/
  4005. }
  4006. textarea{
  4007. -webkit-user-select:auto; /*webkit浏览器*/
  4008. }
  4009. .tiaozhengclass {
  4010. display: block;
  4011. margin: 0 auto;
  4012. }
  4013. .center-tab{
  4014. .el-table .cell{
  4015. padding: 0px 0px !important;
  4016. white-space: pre-wrap;
  4017. }
  4018. }
  4019. .el-table--medium td, .el-table--medium th {
  4020. padding: 5px 0 !important;
  4021. }
  4022. .schedule-table-row {
  4023. background: #fff !important;
  4024. }
  4025. .schedule-table-row:hover {
  4026. background: #fff !important;
  4027. }
  4028. .schedule-table-row td:hover {
  4029. background: rgb(88, 162, 236) !important;
  4030. }
  4031. .el-table {
  4032. font-size: 12px !important;
  4033. }
  4034. .schedule-table-row td .cell {
  4035. font-size: 10px;
  4036. white-space:normal !important;
  4037. // normal
  4038. }
  4039. .schedule-table-cell-disable {
  4040. background-color: rgb(248, 241, 241) !important;
  4041. }
  4042. #table_data {
  4043. //min-height: calc(100vh - 350px);
  4044. .switch{
  4045. margin-left: 10px;
  4046. }
  4047. }
  4048. #table_data ::-webkit-scrollbar {
  4049. height: 15px;
  4050. }
  4051. .el-table td,
  4052. .el-table th.is-leaf,
  4053. .el-table--border,
  4054. .el-table--group {
  4055. border-color: #d0d3da;
  4056. }
  4057. .el-table--border::after,
  4058. .el-table--group::after,
  4059. .el-table::before {
  4060. background-color: #d0d3da;
  4061. }
  4062. .el-table--border th {
  4063. border-color: #d0d3da;
  4064. }
  4065. .el-table--border td {
  4066. border-color: #d0d3da;
  4067. }
  4068. .el-table td {
  4069. border-color: #d0d3da;
  4070. }
  4071. #table_data {
  4072. .el-table__body tr.current-row > td {
  4073. background-color: #ecf5ff !important;
  4074. color: #3a8ee6;
  4075. }
  4076. .el-table__body tr > td:hover {
  4077. background-color: #409eff !important;
  4078. color: #fff;
  4079. }
  4080. .el-table__body tr .hover-td {
  4081. background-color: #409eff !important;
  4082. color: #fff;
  4083. }
  4084. // .Infectious_disease{
  4085. // background-color: red !important;
  4086. // color: white;
  4087. // border-left: 1px solid aqua;
  4088. // border-right: 1px solid aqua;
  4089. // }
  4090. // .border_bott{
  4091. // border-left: 1px solid aqua;
  4092. // border-right: 1px solid aqua;
  4093. // }
  4094. // .border_left{
  4095. // // border-left: 1px solid aqua;
  4096. // }
  4097. // .evening_border{
  4098. // border-right: 1px solid rgb(236, 41, 41);
  4099. // }
  4100. }
  4101. .backPurple{
  4102. color: #f32424 !important;
  4103. }
  4104. .eldialog{
  4105. .el-dialog__headerbtn {
  4106. // position: absolute;
  4107. // top: 20px;
  4108. // right: 20px;
  4109. // padding: 0;
  4110. // background: 0 0;
  4111. // border: none;
  4112. // outline: 0;
  4113. // cursor: pointer;
  4114. // font-size: 16px;
  4115. z-index: 3 !important;
  4116. }
  4117. }
  4118. .eltables{
  4119. .el-table__header-wrapper{
  4120. position: relative;
  4121. height: 68px;
  4122. .el-table__header{
  4123. position: fixed;
  4124. z-index: 100;
  4125. }
  4126. }
  4127. }
  4128. // .el-table td .cell{
  4129. // padding: 0px 0px !important;
  4130. // }
  4131. </style>