tableData.vue 136KB

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