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

historyWeekTable.vue 102KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335
  1. <template>
  2. <div id="table_data">
  3. <div class="cell clearfix" >
  4. <span>选择周次:</span>
  5. <el-date-picker
  6. v-model="weekTime"
  7. type="week"
  8. format="第 WW 周"
  9. placeholder="选择周"
  10. :picker-options="{'firstDayOfWeek': 1}"
  11. @change="changeWeek"
  12. :clearable="false"
  13. >
  14. <!-- "{'firstDayOfWeek': 1}" -->
  15. </el-date-picker>
  16. </div>
  17. <!-- -->
  18. <el-dialog :visible.sync="searchTableVisible" width="80%">
  19. <el-table
  20. :data="schedulePatients"
  21. :header-cell-style="{
  22. backgroundColor: 'rgb(245, 247, 250)',
  23. color: '#606266'
  24. }"
  25. :row-style="{ color: '#303133' }"
  26. style="width: 100%"
  27. border
  28. >
  29. <el-table-column label="姓名" width="120">
  30. <template slot-scope="scope">
  31. {{ scope.row.patient }}
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="透析日期" width="200">
  35. <template slot-scope="scope">
  36. {{ getDialysisDate(scope.row) }}
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="分区">
  40. <template slot-scope="scope">
  41. {{ scope.row.zone.name }}
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="班次" width="80">
  45. <template slot-scope="scope">
  46. {{ getSchedulesType(scope.row.schedule_type,scope.row) }}
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="机号" width="80">
  50. <template slot-scope="scope">
  51. {{ scope.row.number.number }}
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="透析模式" width="100">
  55. <template slot-scope="scope">
  56. {{ scope.row.mode.name }}
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="操作" align="center" width="300">
  60. <template slot-scope="scope">
  61. <span v-if="now_time <=scope.row.schedule_date">
  62. <el-button
  63. size="mini"
  64. type="primary"
  65. @click="CancelSchedule(scope.row.id)"
  66. >
  67. 取消排班
  68. </el-button>
  69. <el-button
  70. size="mini"
  71. type="primary"
  72. @click="changeMachineNumber(scope.$index, scope.row)"
  73. >
  74. 调整机号
  75. </el-button>
  76. <el-button
  77. size="mini"
  78. type="primary"
  79. @click="changeMode(scope.$index, scope.row)"
  80. >
  81. 调整模式
  82. </el-button>
  83. </span>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. </el-dialog>
  88. <div class="center-tab">
  89. <el-table
  90. :row-style="{ color: '#303133' }"
  91. :header-cell-style="{
  92. backgroundColor: 'rgb(245, 247, 250)',
  93. color: '#606266'
  94. }"
  95. :fit="true"
  96. :data="scheduleZone"
  97. :span-method="objectSpanMethod"
  98. @cell-click="clickThis"
  99. :summary-method="getSummaries"
  100. show-summary
  101. :row-class-name="tableRowClassName"
  102. :cell-class-name="cellClass"
  103. sum-text="总数"
  104. :height="tableContainHeight"
  105. ref="table"
  106. style="table-layout: fixed;"
  107. >
  108. <!-- @cell-mouse-enter="hoverMouse" -->
  109. <el-table-column
  110. prop="area"
  111. label="分区"
  112. width="50"
  113. align="center"
  114. fixed
  115. ></el-table-column>
  116. <el-table-column
  117. prop="cut"
  118. label="机号"
  119. align="center"
  120. min-width="40"
  121. fixed
  122. ></el-table-column>
  123. <el-table-column
  124. :label="' 周一(' + weekTitle[0] + ')'"
  125. v-if="isShowOne"
  126. align="center"
  127. >
  128. <el-table-column prop="Mon_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  129. <schedule-item
  130. slot-scope="scope"
  131. :schedule-detail="scope.row.Mon_M"
  132. :config="config"
  133. :schedulFlag="value1"
  134. :schedulMode="modename_value"
  135. ></schedule-item>
  136. </el-table-column>
  137. <el-table-column prop="Mon_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  138. <schedule-item
  139. slot-scope="scope"
  140. :schedule-detail="scope.row.Mon_A"
  141. :config="config"
  142. :schedulFlag="value1"
  143. :schedulMode="modename_value"
  144. ></schedule-item>
  145. </el-table-column>
  146. <el-table-column prop="Mon_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  147. <schedule-item
  148. slot-scope="scope"
  149. :schedule-detail="scope.row.Mon_N"
  150. :config="config"
  151. :schedulFlag="value1"
  152. :schedulMode="modename_value"
  153. ></schedule-item>
  154. </el-table-column>
  155. </el-table-column>
  156. <el-table-column
  157. :label="'周二 (' + weekTitle[1] + ')'"
  158. min-width="120"
  159. v-if="isShowTwo"
  160. align="center"
  161. :fit="true"
  162. >
  163. <el-table-column prop="Tue_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  164. <schedule-item
  165. slot-scope="scope"
  166. :schedule-detail="scope.row.Tue_M"
  167. :config="config"
  168. :schedulFlag="value1"
  169. :schedulMode="modename_value"
  170. ></schedule-item>
  171. </el-table-column>
  172. <el-table-column prop="Tue_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  173. <schedule-item
  174. slot-scope="scope"
  175. :schedule-detail="scope.row.Tue_A"
  176. :config="config"
  177. :schedulFlag="value1"
  178. :schedulMode="modename_value"
  179. ></schedule-item>
  180. </el-table-column>
  181. <el-table-column prop="Tue_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  182. <schedule-item
  183. slot-scope="scope"
  184. :schedule-detail="scope.row.Tue_N"
  185. :config="config"
  186. :schedulFlag="value1"
  187. :schedulMode="modename_value"
  188. ></schedule-item>
  189. </el-table-column>
  190. </el-table-column>
  191. <el-table-column
  192. :label="'周三 (' + weekTitle[2] + ')'"
  193. v-if="isShowThree"
  194. align="center"
  195. >
  196. <el-table-column prop="Wed_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  197. <schedule-item
  198. slot-scope="scope"
  199. :schedule-detail="scope.row.Wed_M"
  200. :config="config"
  201. :schedulFlag="value1"
  202. :schedulMode="modename_value"
  203. ></schedule-item>
  204. </el-table-column>
  205. <el-table-column prop="Wed_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  206. <schedule-item
  207. slot-scope="scope"
  208. :schedule-detail="scope.row.Wed_A"
  209. :config="config"
  210. :schedulFlag="value1"
  211. :schedulMode="modename_value"
  212. ></schedule-item>
  213. </el-table-column>
  214. <el-table-column prop="Wed_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  215. <schedule-item
  216. slot-scope="scope"
  217. :config="config"
  218. :schedulFlag="value1"
  219. :schedule-detail="scope.row.Wed_N"
  220. :schedulMode="modename_value"
  221. ></schedule-item>
  222. </el-table-column>
  223. </el-table-column>
  224. <el-table-column
  225. :label="'周四 (' + weekTitle[3] + ')'"
  226. align="center"
  227. v-if="isShowFour"
  228. >
  229. <el-table-column prop="Thurs_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  230. <schedule-item
  231. slot-scope="scope"
  232. :config="config"
  233. :schedule-detail="scope.row.Thurs_M"
  234. :schedulFlag="value1"
  235. :schedulMode="modename_value"
  236. ></schedule-item>
  237. </el-table-column>
  238. <el-table-column prop="Thurs_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  239. <schedule-item
  240. slot-scope="scope"
  241. :schedule-detail="scope.row.Thurs_A"
  242. :config="config"
  243. :schedulFlag="value1"
  244. :schedulMode="modename_value"
  245. ></schedule-item>
  246. </el-table-column>
  247. <el-table-column prop="Thurs_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  248. <schedule-item
  249. slot-scope="scope"
  250. :schedule-detail="scope.row.Thurs_N"
  251. :config="config"
  252. :schedulFlag="value1"
  253. :schedulMode="modename_value"
  254. ></schedule-item>
  255. </el-table-column>
  256. </el-table-column>
  257. <el-table-column
  258. :label="'周五 (' + weekTitle[4] + ')'"
  259. align="center"
  260. v-if="isShowFive"
  261. >
  262. <el-table-column prop="Fri_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  263. <schedule-item
  264. slot-scope="scope"
  265. :schedule-detail="scope.row.Fri_M"
  266. :config="config"
  267. :schedulFlag="value1"
  268. :schedulMode="modename_value"
  269. ></schedule-item>
  270. </el-table-column>
  271. <el-table-column prop="Fri_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  272. <schedule-item
  273. slot-scope="scope"
  274. :schedule-detail="scope.row.Fri_A"
  275. :config="config"
  276. :schedulFlag="value1"
  277. :schedulMode="modename_value"
  278. ></schedule-item>
  279. </el-table-column>
  280. <el-table-column prop="Fri_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  281. <schedule-item
  282. slot-scope="scope"
  283. :schedule-detail="scope.row.Fri_N"
  284. :config="config"
  285. :schedulFlag="value1"
  286. :schedulMode="modename_value"
  287. ></schedule-item>
  288. </el-table-column>
  289. </el-table-column>
  290. <el-table-column
  291. :label="'周六 (' + weekTitle[5] + ')'"
  292. align="center"
  293. v-if="isShowSix"
  294. >
  295. <el-table-column prop="Sat_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  296. <schedule-item
  297. slot-scope="scope"
  298. :schedule-detail="scope.row.Sat_M"
  299. :config="config"
  300. :schedulFlag="value1"
  301. :schedulMode="modename_value"
  302. ></schedule-item>
  303. </el-table-column>
  304. <el-table-column prop="Sat_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  305. <schedule-item
  306. slot-scope="scope"
  307. :schedule-detail="scope.row.Sat_A"
  308. :config="config"
  309. :schedulFlag="value1"
  310. :schedulMode="modename_value"
  311. ></schedule-item>
  312. </el-table-column>
  313. <el-table-column prop="Sat_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  314. <schedule-item
  315. slot-scope="scope"
  316. :schedule-detail="scope.row.Sat_N"
  317. :config="config"
  318. :schedulFlag="value1"
  319. :schedulMode="modename_value"
  320. ></schedule-item>
  321. </el-table-column>
  322. </el-table-column>
  323. <el-table-column
  324. :label="'周日 (' + weekTitle[6] + ')'"
  325. align="center"
  326. v-if="isShowSeven"
  327. >
  328. <el-table-column prop="Sun_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
  329. <schedule-item
  330. slot-scope="scope"
  331. :schedule-detail="scope.row.Sun_M"
  332. :config="config"
  333. :schedulFlag="value1"
  334. :schedulMode="modename_value"
  335. ></schedule-item>
  336. </el-table-column>
  337. <el-table-column prop="Sun_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
  338. <schedule-item
  339. slot-scope="scope"
  340. :schedule-detail="scope.row.Sun_A"
  341. :config="config"
  342. :schedulFlag="value1"
  343. :schedulMode="modename_value"
  344. ></schedule-item>
  345. </el-table-column>
  346. <el-table-column prop="Sun_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
  347. <schedule-item
  348. slot-scope="scope"
  349. :schedule-detail="scope.row.Sun_N"
  350. :config="config"
  351. :schedulFlag="value1"
  352. :schedulMode="modename_value"
  353. >
  354. <!-- -->
  355. </schedule-item>
  356. </el-table-column>
  357. </el-table-column>
  358. </el-table>
  359. </div>
  360. <!-- 调整模式 -->
  361. <el-dialog
  362. title="调整模式"
  363. :visible.sync="msDialogVisible"
  364. width="500px"
  365. v-loading="changing_mode"
  366. :modal-append-to-body='false'
  367. :close-on-click-modal="false"
  368. >
  369. <div>
  370. <el-form
  371. :model="changeSchedule"
  372. ref="changeSchedule"
  373. :rules="changeRules"
  374. >
  375. <el-form-item label="" prop="mode_id">
  376. <el-select
  377. v-model="changeSchedule.mode_id"
  378. placeholder="请选择"
  379. style="width: 100%"
  380. >
  381. <el-option
  382. :disabled="item.id == currentData.mode_id"
  383. v-for="item in modeOptions"
  384. :key="item.id"
  385. :label="item.name"
  386. :value="item.id"
  387. >
  388. </el-option>
  389. </el-select>
  390. </el-form-item>
  391. </el-form>
  392. </div>
  393. <span slot="footer" class="dialog-footer">
  394. <el-button @click="msDialogVisible = false">取 消</el-button>
  395. <el-button
  396. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  397. type="primary"
  398. @click="submitMode('changeSchedule')"
  399. >保 存</el-button
  400. >
  401. </span>
  402. </el-dialog>
  403. <!--调整机号 -->
  404. <el-dialog
  405. title="调整机号"
  406. :visible.sync="jhDialogVisible"
  407. width="500px"
  408. v-loading="changing_bed"
  409. :modal-append-to-body='false'
  410. :close-on-click-modal="false"
  411. >
  412. <div>
  413. <el-form
  414. :model="changeSchedule"
  415. ref="changeSchedule"
  416. :rules="changeRules"
  417. label-width="90px"
  418. >
  419. <el-form-item label="排班日期: ">
  420. <el-input v-model="currentData.schedule_date" disabled></el-input>
  421. </el-form-item>
  422. <el-form-item label="班次: " prop="schedule_type">
  423. <el-select
  424. v-model="changeSchedule.schedule_type"
  425. placeholder="请选择"
  426. style="width: 100%"
  427. @change="changeScheduleType"
  428. >
  429. <el-option
  430. v-for="item in scheduleType"
  431. :key="item.id"
  432. :label="item.name"
  433. :value="item.id"
  434. >
  435. </el-option>
  436. </el-select>
  437. </el-form-item>
  438. <el-form-item label="分区: " prop="partition_id">
  439. <el-select
  440. v-model="changeSchedule.partition_id"
  441. placeholder="请选择"
  442. style="width: 100%"
  443. @change="changePartition"
  444. >
  445. <el-option
  446. v-for="(item, index) in zones"
  447. :key="index"
  448. :label="item.name"
  449. :value="item.id"
  450. >
  451. </el-option>
  452. </el-select>
  453. </el-form-item>
  454. <el-form-item label="透析机: " prop="bed_id">
  455. <el-select
  456. v-model="device_id"
  457. placeholder="请选择"
  458. style="width: 100%"
  459. >
  460. <el-option
  461. v-for="item in current_devices"
  462. :key="item.id"
  463. :label="item.number"
  464. :value="item.id"
  465. >
  466. </el-option>
  467. </el-select>
  468. </el-form-item>
  469. </el-form>
  470. </div>
  471. <span slot="footer" class="dialog-footer">
  472. <el-button @click="jhDialogVisible = false">取 消</el-button>
  473. <el-button
  474. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  475. type="primary"
  476. @click="submitTiaoZJH('changeSchedule')"
  477. >保 存</el-button>
  478. <!-- -->
  479. </span>
  480. </el-dialog>
  481. </div>
  482. </template>
  483. <script>
  484. import { uParseTime } from "@/utils/tools";
  485. import print from 'print-js'
  486. const moment = require('moment')
  487. import {
  488. CancelSchedule,
  489. ChangeSchedule,
  490. CreateSchedule,
  491. getSchedulePatients,
  492. getSchedulesOne,
  493. getSearchResult,
  494. getUrgentScheduleInitData,
  495. getWeekPanelsOne,
  496. getAllZones,
  497. getSchedules
  498. } from "@/api/schedule";
  499. import {
  500. getSmartDevices
  501. } from "@/api/schedule_template/sch_template";
  502. import ScheduleItem from "./ScheduleItem";
  503. const weekOptions = ['周一','周二','周三','周四','周五','周六','周日'];
  504. let rowNumber = 0;
  505. export default {
  506. name: "tableData",
  507. props: {
  508. is_edit:{
  509. type: Boolean,
  510. default: false,
  511. },
  512. // weekTime: {
  513. // type: String,
  514. // default: "thisWeek"
  515. // },
  516. // 机号数
  517. scheduleZoneRowProp: {
  518. type: Array,
  519. dafault: []
  520. },
  521. // 分区
  522. // partitionsProp: {
  523. // type: Object,
  524. // dafault: {}
  525. // },
  526. config: {
  527. type: Object,
  528. dafault: {}
  529. },
  530. },
  531. data() {
  532. return {
  533. // 禁选当前之后的日期
  534. // pickerBeginDateBefore: {
  535. // disabledDate(time) {
  536. // return time.getTime() > Date.now();
  537. // }
  538. // },
  539. tableContainHeight:null,
  540. value1:false,
  541. modename_value:true,
  542. weeks:weekOptions,
  543. searchKey: "",
  544. tiaoZhengType: 1,
  545. weekTime:"historyWeek",
  546. modeOptions: null,
  547. keywords: "",
  548. schedulePatients: [],
  549. searchTableVisible: false,
  550. patients: [],
  551. toDay: "",
  552. schedulArr: [
  553. { value: 0, label: "不限" },
  554. { value: 2, label: "未排班" },
  555. { value: 1, label: "已排班" }
  556. ],
  557. tagArr: [
  558. { value: 1, label: "不限" },
  559. { value: 2, label: "透析记录" },
  560. { value: 3, label: "传染病" }
  561. ],
  562. diseasesArr: [{ value: 0, label: "不限" }],
  563. scheduleType: [
  564. { id: 1, name: "上午" },
  565. { id: 2, name: "下午" },
  566. { id: 3, name: "晚上" }
  567. ],
  568. // dialogTableVisible: false,
  569. tzDialogVisible: false,
  570. msDialogVisible: false,
  571. jhDialogVisible: false,
  572. // scheduleZone: this.scheduleZoneProp,
  573. scheduleZoneRow: -1,
  574. partitions: [],
  575. jihaos: [],
  576. weekTitle: ["", "", "", "", "", "", ""],
  577. weekList: ["", "", "", "", "", "", ""],
  578. weekDays: ["", "", "", "", "", "", ""],
  579. currentData: {
  580. id: 0,
  581. schedule_date: "",
  582. schedule_type: 0,
  583. bed_id: 0,
  584. partition_id: 0,
  585. patient_id: 0,
  586. schedule_week: 0,
  587. mode_id: 0,
  588. type_name: "",
  589. bed_name: "",
  590. partition_type: 0,
  591. contagions: [],
  592. patient: ""
  593. },
  594. changeSchedule: {
  595. mode_id: "",
  596. schedule_type: "",
  597. partition_id: "",
  598. bed_id: "",
  599. schedule_week: "",
  600. partition_type: ""
  601. },
  602. patientQuery: {
  603. keywords: "",
  604. schedule: 0,
  605. contagion: 0
  606. },
  607. start_time:'',//开始时间
  608. end_time:'',//结束时间
  609. lastweek:{},//上两周的第一天和最后一天
  610. tiaozhengclass: "tiaozhengclass",
  611. changeRules: {
  612. mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
  613. schedule_type: [
  614. { required: true, message: "请选择班次", trigger: "blur" }
  615. ],
  616. partition_id: [
  617. { required: true, message: "请选择病房", trigger: "blur" }
  618. ],
  619. bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }]
  620. },
  621. weekday: 0,
  622. creating_schedule: false,
  623. changing_mode: false,
  624. changing_bed: false,
  625. tableHeight: document.documentElement.clientHeight,
  626. origin_schedules: [],
  627. origin_device_numbers: [],
  628. zone_device_map: {},
  629. device_id: 0,
  630. zone_name: "",
  631. current_devices: [],
  632. zone_names: [],
  633. zone_device_options: [],
  634. options:[
  635. {id:1,name:"上午"},
  636. {id:2,name:"下午"},
  637. {id:3,name:"晚上"},
  638. ],
  639. partition_id:0,
  640. schedule_type:[],
  641. week_type:[],
  642. zones:[],
  643. theType:"",
  644. scheduleZone:[],
  645. source_scheduleZone:[],
  646. theWeek: {
  647. historyWeek:0,
  648. lastWeek: 0,
  649. thisWeek: 0,
  650. nextWeek: 0,
  651. nextTwoWeek: 0
  652. },
  653. zoneIdList:[],
  654. strArr:"",
  655. patient_id_hover:0,
  656. now_time:"",
  657. isShowOne:true,
  658. isShowTwo:true,
  659. isShowThree:true,
  660. isShowFour:true,
  661. isShowFive:true,
  662. isShowSix:true,
  663. isShowSeven:true,
  664. isShowShangWu:true,
  665. isShowXiaWu:true,
  666. isShowWanShang:true,
  667. // schedulesGroup:[]
  668. };
  669. },
  670. watch: {
  671. schedule_type:function (){
  672. this.isShowShangWu = false
  673. this.isShowXiaWu = false
  674. this.isShowWanShang = false
  675. if(this.schedule_type.length > 0) {
  676. for (let i = 0; i < this.schedule_type.length; i++) {
  677. if (this.schedule_type[i] == 1) {
  678. this.isShowShangWu = true
  679. } else if (this.schedule_type[i] == 2) {
  680. this.isShowXiaWu = true
  681. } else if (this.schedule_type[i] == 3) {
  682. this.isShowWanShang = true
  683. }
  684. }
  685. }else{
  686. this.isShowShangWu = true
  687. this.isShowXiaWu = true
  688. this.isShowWanShang = true
  689. }
  690. },
  691. week_type:function () {
  692. this.isShowOne = false
  693. this.isShowTwo = false
  694. this.isShowThree = false
  695. this.isShowFour = false
  696. this.isShowFive = false
  697. this.isShowSix = false
  698. this.isShowSeven = false
  699. if(this.week_type.length > 0) {
  700. for (let i = 0; i < this.week_type.length; i++) {
  701. if (this.week_type[i] == "周一") {
  702. this.isShowOne = true
  703. } else if (this.week_type[i] == "周二") {
  704. this.isShowTwo = true
  705. } else if (this.week_type[i] == "周三") {
  706. this.isShowThree = true
  707. } else if (this.week_type[i] == "周四") {
  708. this.isShowFour = true
  709. } else if (this.week_type[i] == "周五") {
  710. this.isShowFive = true
  711. } else if (this.week_type[i] == "周六") {
  712. this.isShowSix = true
  713. } else if (this.week_type[i] == "周日") {
  714. this.isShowSeven = true
  715. }
  716. }
  717. }else{
  718. this.isShowOne = true
  719. this.isShowTwo = true
  720. this.isShowThree = true
  721. this.isShowFour = true
  722. this.isShowFive = true
  723. this.isShowSix = true
  724. this.isShowSeven = true
  725. }
  726. },
  727. weekTime: function() {
  728. var theType = this.weekType(this.weekTime);
  729. // console.log("999999999",theType)
  730. this.theType = theType
  731. this.getSchedules()
  732. },
  733. scheduleZoneRow: function() {
  734. var theType = this.weekType(this.weekTime);
  735. this.theType = theType
  736. this.getSchedules()
  737. },
  738. tableHeight(val) {
  739. if (!this.timer) {
  740. this.tableHeight = val;
  741. this.timer = true;
  742. const that = this;
  743. setTimeout(function() {
  744. that.timer = false;
  745. }, 400);
  746. }
  747. }
  748. },
  749. created() {
  750. // sessionStorage.setItem('value1',!this.value1);
  751. sessionStorage.removeItem('value1')
  752. var date = new Date()
  753. this.time = date
  754. var year = date.getFullYear()
  755. var month = date.getMonth() + 1
  756. if (month < 10) {
  757. month = "0" + month
  758. }
  759. var day = date.getDate()
  760. if (day < 10) {
  761. day = "0" + day
  762. }
  763. var nowDate = year + "-" + month + "-" + day
  764. var date = new Date(nowDate + " 00:00:00")
  765. this.now_time = date.getTime()/1000
  766. this.getAllZones()
  767. this.changeScheduleType(1)
  768. rowNumber = 0;
  769. this.modeOptions = this.$store.getters.treatment_mode;
  770. // this.partitions = this.partitionsProp;
  771. var contagions = this.$store.getters.contagions;
  772. if (contagions.length > 0) {
  773. var that = this;
  774. contagions.forEach(function(citem) {
  775. if (citem.type == 2) {
  776. that.diseasesArr.push({ value: citem.id, label: citem.name });
  777. }
  778. });
  779. }
  780. this.scheduleZoneRow = this.scheduleZoneRowProp;
  781. this.weekday = new Date().getDay();
  782. if (this.weekday == 0) {
  783. this.weekday = 7;
  784. }
  785. },
  786. methods: {
  787. getData(){
  788. return this.scheduleZone
  789. },
  790. compare(p){ //这是比较函数
  791. return function(m,n){
  792. var a = m[p];
  793. var b = n[p];
  794. return a - b; //升序
  795. }
  796. },
  797. getWeekPanels() {
  798. this.scheduleZone=[]
  799. var partionStr = this.partition_id
  800. var arr = this.zoneIdList.join(',')
  801. var str = ""
  802. if(partionStr == 0){
  803. str = arr
  804. }
  805. if(partionStr != 0){
  806. str = partionStr.join(',')
  807. }
  808. // 第几周,星期几
  809. getWeekPanelsOne(1,str).then(response => {
  810. // console.log('wertwetr',response.data.data);
  811. if (response.data.state == 0) {
  812. return false
  813. }
  814. var partitions = response.data.data.partitions
  815. this.theWeek.thisWeek = response.data.data.theWeek
  816. this.theWeek.historyWeek = this.theWeek.thisWeek -2
  817. this.theWeek.lastWeek = this.theWeek.thisWeek - 1
  818. this.theWeek.nextWeek = this.theWeek.thisWeek + 1
  819. this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2
  820. var that = this
  821. if (partitions.length > 0) {
  822. partitions.forEach(function(partition) {
  823. if (partition.jihaos.length == 0) {
  824. return false
  825. }
  826. that.scheduleZoneRow.push(partition.jihaos.length)
  827. that.partitions[partition.id] = partition
  828. partition.jihaos.forEach(function(jihao) {
  829. var thisPa = {
  830. area: partition.name,
  831. zone_id: partition.id,
  832. zone_type: partition.type,
  833. cut: jihao.number,
  834. jihao_id: jihao.id,
  835. sort:jihao.sort,
  836. Mon_M: {
  837. schedule_id: 0,
  838. mode_id: 0,
  839. mode_name: '',
  840. patient_id: 0,
  841. patient: '',
  842. dialysis_machine_name:'',
  843. schedule_date:"",
  844. Count:0,
  845. },
  846. Mon_A: {
  847. schedule_id: 0,
  848. mode_id: 0,
  849. mode_name: '',
  850. patient_id: 0,
  851. patient: '',
  852. dialysis_machine_name:'',
  853. schedule_date:"",
  854. Count:0,
  855. },
  856. Mon_N: {
  857. schedule_id: 0,
  858. mode_id: 0,
  859. mode_name: '',
  860. patient_id: 0,
  861. patient: '',
  862. dialysis_machine_name:'',
  863. schedule_date:"",
  864. Count:0,
  865. },
  866. Tue_M: {
  867. schedule_id: 0,
  868. mode_id: 0,
  869. mode_name: '',
  870. patient_id: 0,
  871. patient: '',
  872. dialysis_machine_name:'',
  873. schedule_date:"",
  874. Count:0,
  875. },
  876. Tue_A: {
  877. schedule_id: 0,
  878. mode_id: 0,
  879. mode_name: '',
  880. patient_id: 0,
  881. patient: '',
  882. dialysis_machine_name:'',
  883. schedule_date:"",
  884. Count:0,
  885. },
  886. Tue_N: {
  887. schedule_id: 0,
  888. mode_id: 0,
  889. mode_name: '',
  890. patient_id: 0,
  891. patient: '',
  892. dialysis_machine_name:'',
  893. schedule_date:"",
  894. Count:0,
  895. },
  896. Wed_M: {
  897. schedule_id: 0,
  898. mode_id: 0,
  899. mode_name: '',
  900. patient_id: 0,
  901. patient: '',
  902. dialysis_machine_name:'',
  903. schedule_date:"",
  904. Count:0,
  905. },
  906. Wed_A: {
  907. schedule_id: 0,
  908. mode_id: 0,
  909. mode_name: '',
  910. patient_id: 0,
  911. patient: '',
  912. dialysis_machine_name:'',
  913. schedule_date:"",
  914. Count:0,
  915. },
  916. Wed_N: {
  917. schedule_id: 0,
  918. mode_id: 0,
  919. mode_name: '',
  920. patient_id: 0,
  921. patient: '',
  922. dialysis_machine_name:'',
  923. schedule_date:"",
  924. Count:0,
  925. },
  926. Thurs_M: {
  927. schedule_id: 0,
  928. mode_id: 0,
  929. mode_name: '',
  930. patient_id: 0,
  931. patient: '',
  932. dialysis_machine_name:'',
  933. schedule_date:"",
  934. Count:0,
  935. },
  936. Thurs_A: {
  937. schedule_id: 0,
  938. mode_id: 0,
  939. mode_name: '',
  940. patient_id: 0,
  941. patient: '',
  942. dialysis_machine_name:'',
  943. schedule_date:"",
  944. Count:0,
  945. },
  946. Thurs_N: {
  947. schedule_id: 0,
  948. mode_id: 0,
  949. mode_name: '',
  950. patient_id: 0,
  951. patient: '',
  952. dialysis_machine_name:'',
  953. schedule_date:"",
  954. Count:0,
  955. },
  956. Fri_M: {
  957. schedule_id: 0,
  958. mode_id: 0,
  959. mode_name: '',
  960. patient_id: 0,
  961. patient: '',
  962. dialysis_machine_name:'',
  963. schedule_date:"",
  964. Count:0,
  965. },
  966. Fri_A: {
  967. schedule_id: 0,
  968. mode_id: 0,
  969. mode_name: '',
  970. patient_id: 0,
  971. patient: '',
  972. dialysis_machine_name:'',
  973. schedule_date:"",
  974. Count:0,
  975. },
  976. Fri_N: {
  977. schedule_id: 0,
  978. mode_id: 0,
  979. mode_name: '',
  980. patient_id: 0,
  981. patient: '',
  982. dialysis_machine_name:'',
  983. schedule_date:"",
  984. Count:0,
  985. },
  986. Sat_M: {
  987. schedule_id: 0,
  988. mode_id: 0,
  989. mode_name: '',
  990. patient_id: 0,
  991. patient: '',
  992. dialysis_machine_name:'',
  993. schedule_date:"",
  994. Count:0,
  995. },
  996. Sat_A: {
  997. schedule_id: 0,
  998. mode_id: 0,
  999. mode_name: '',
  1000. patient_id: 0,
  1001. patient: '',
  1002. dialysis_machine_name:'',
  1003. schedule_date:"",
  1004. Count:0,
  1005. },
  1006. Sat_N: {
  1007. schedule_id: 0,
  1008. mode_id: 0,
  1009. mode_name: '',
  1010. patient_id: 0,
  1011. patient: '',
  1012. dialysis_machine_name:'',
  1013. schedule_date:"",
  1014. Count:0,
  1015. },
  1016. Sun_A: {
  1017. schedule_id: 0,
  1018. mode_id: 0,
  1019. mode_name: '',
  1020. patient_id: 0,
  1021. patient: '',
  1022. dialysis_machine_name:'',
  1023. schedule_date:"",
  1024. Count:0,
  1025. },
  1026. Sun_N: {
  1027. schedule_id: 0,
  1028. mode_id: 0,
  1029. mode_name: '',
  1030. patient_id: 0,
  1031. patient: '',
  1032. dialysis_machine_name:'',
  1033. schedule_date:"",
  1034. Count:0,
  1035. },
  1036. Sun_M: {
  1037. schedule_id: 0,
  1038. mode_id: 0,
  1039. mode_name: '',
  1040. patient_id: 0,
  1041. patient: '',
  1042. dialysis_machine_name:'',
  1043. schedule_date:"",
  1044. Count:0,
  1045. },
  1046. total: 0
  1047. }
  1048. that.scheduleZone.push(thisPa)
  1049. })
  1050. })
  1051. }
  1052. this.scheduleZone.sort(this.compare('sort'))
  1053. this.source_scheduleZone = this.scheduleZone
  1054. // console.log("34455555566666",this.source_scheduleZone)
  1055. this.getSchedules()
  1056. })
  1057. },
  1058. cellClass({ row, column, rowIndex, columnIndex }) {
  1059. if(columnIndex==1&&row.zone_type!=1){
  1060. // console.log(columnIndex,row.zone_type);
  1061. return "table-row-new-class schedule-table-row Infectious_disease";
  1062. }
  1063. if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
  1064. return "";
  1065. } else {
  1066. if (this.weekTime == "lastWeek") {
  1067. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1068. return 'hover-td schedule-table-cell-disable'
  1069. }else {
  1070. return 'schedule-table-cell-disable'
  1071. }
  1072. // return "schedule-table-cell-disable";
  1073. } else if (this.weekTime == "thisWeek") {
  1074. var weekday = Math.floor((columnIndex - 2) / 3 + 1);
  1075. if (weekday < this.weekday) {
  1076. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1077. return 'hover-td schedule-table-cell-disable'
  1078. }else {
  1079. return 'schedule-table-cell-disable'
  1080. }
  1081. // return "schedule-table-cell-disable";
  1082. }else {
  1083. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1084. return 'hover-td '
  1085. }else {
  1086. return ''
  1087. }
  1088. }
  1089. }else if(this.weekTime == "historyWeek"){
  1090. return 'schedule-table-cell-disable'
  1091. }
  1092. }
  1093. return "";
  1094. },
  1095. // SubmitSearch() {
  1096. // this.patientQuery.keywords = this.searchKey;
  1097. // this.getSchedulePatients();
  1098. // },
  1099. changeSearchContagion(id) {
  1100. this.patientQuery.contagion = id;
  1101. this.getSchedulePatients();
  1102. },
  1103. // changeSearchSchedule(id) {
  1104. // this.patientQuery.schedule = id;
  1105. // this.getSchedulePatients();
  1106. // },
  1107. getSummaries(param) {
  1108. const { columns, data } = param;
  1109. const sums = [];
  1110. columns.forEach((column, index) => {
  1111. if (index === 0 ) {
  1112. sums[index] = "总数";
  1113. return;
  1114. }
  1115. if (index === 1 ) {
  1116. sums[index] = data.length;
  1117. return;
  1118. }
  1119. const values = data.map(item => item[column.property]);
  1120. sums[index] = values.reduce((prev, curr) => {
  1121. if (typeof curr["mode_id"] === "undefined") {
  1122. return prev;
  1123. }
  1124. const value = Number(curr["mode_id"]);
  1125. if (!isNaN(value) && value > 0) {
  1126. return prev + 1;
  1127. } else {
  1128. return prev;
  1129. }
  1130. }, 0);
  1131. sums[index];
  1132. });
  1133. this.$nextTick(() => {
  1134. this.$refs.table.doLayout();
  1135. });
  1136. //表格某列全部数据
  1137. var Mon_M = []
  1138. var Mon_A = []
  1139. var Mon_N = []
  1140. var Tue_M =[]
  1141. var Tue_A = []
  1142. var Tue_N = []
  1143. var Wed_M = []
  1144. var Wed_A = []
  1145. var Wed_N = []
  1146. var Thurs_M = []
  1147. var Thurs_A = []
  1148. var Thurs_N = []
  1149. var Fri_M = []
  1150. var Fri_A = []
  1151. var Fri_N = []
  1152. var Sat_M = []
  1153. var Sat_A = []
  1154. var Sat_N = []
  1155. var Sun_M = []
  1156. var Sun_A = []
  1157. var Sun_N = []
  1158. // 操作后数据
  1159. var Mon_M_One= []
  1160. var Mon_A_One = []
  1161. var Mon_N_One = []
  1162. var Tue_M_One =[]
  1163. var Tue_A_One = []
  1164. var Tue_N_One = []
  1165. var Wed_M_One = []
  1166. var Wed_A_One = []
  1167. var Wed_N_One = []
  1168. var Thurs_M_One = []
  1169. var Thurs_A_One = []
  1170. var Thurs_N_One = []
  1171. var Fri_M_One = []
  1172. var Fri_A_One = []
  1173. var Fri_N_One = []
  1174. var Sat_M_One = []
  1175. var Sat_A_One = []
  1176. var Sat_N_One = []
  1177. var Sun_M_One = []
  1178. var Sun_A_One = []
  1179. var Sun_N_One= []
  1180. for(let j in data){
  1181. if(data[j].hasOwnProperty ('Mon_A') == true){
  1182. Mon_A.push(data[j].Mon_A.mode_name)
  1183. Mon_A=Mon_A.filter(item=> item && item.trim())//去掉空字符串
  1184. var countNum =Mon_A.reduce((obj,name)=>{
  1185. if(name in obj){
  1186. obj[name]++
  1187. }else{
  1188. obj[name]=1
  1189. }
  1190. return obj
  1191. },{})
  1192. }
  1193. }
  1194. for(let x in countNum){
  1195. Mon_A_One.push(x + ':' + countNum[x]+"\n")
  1196. }
  1197. var result = [];
  1198. for (var i = 0,len = Mon_A_One.length; i < len; i+=29) {
  1199. var strObjcet = Mon_A_One.slice(i, i+29);
  1200. var str = strObjcet.toString();
  1201. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1202. result.push(str);
  1203. }
  1204. sums[3]="总人数:"+ sums[3] +"\n"+result
  1205. for(let j in data){
  1206. if(data[j].hasOwnProperty ('Mon_M') == true){
  1207. Mon_M.push(data[j].Mon_M.mode_name)
  1208. Mon_M=Mon_M.filter(item=> item && item.trim())
  1209. var countNum =Mon_M.reduce((obj,name)=>{
  1210. if(name in obj){
  1211. obj[name]++
  1212. }else{
  1213. obj[name]=1
  1214. }
  1215. return obj
  1216. },{})
  1217. }
  1218. }
  1219. for(let x in countNum){
  1220. // console.log(x);
  1221. Mon_M_One.push(x + ':' + countNum[x]+"\n")
  1222. }
  1223. var result = [];
  1224. for (var i = 0,len = Mon_M_One.length; i < len; i+=29) {
  1225. var strObjcet = Mon_M_One.slice(i, i+29);
  1226. var str = strObjcet.toString();
  1227. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1228. result.push(str);
  1229. }
  1230. sums[2]="总人数:"+ sums[2] +"\n"+result
  1231. for(let j in data){
  1232. if(data[j].hasOwnProperty ('Mon_N') == true){
  1233. Mon_N.push(data[j].Mon_N.mode_name)
  1234. Mon_N=Mon_N.filter(item=> item && item.trim())
  1235. var countNum =Mon_N.reduce((obj,name)=>{
  1236. if(name in obj){
  1237. obj[name]++
  1238. }else{
  1239. obj[name]=1
  1240. }
  1241. return obj
  1242. },{})
  1243. }
  1244. }
  1245. for(let x in countNum){
  1246. Mon_N_One.push(x + ':' + countNum[x]+"\n")
  1247. }
  1248. var result = [];
  1249. for (var i = 0,len = Mon_N_One.length; i < len; i+=29) {
  1250. var strObjcet = Mon_N_One.slice(i, i+29);
  1251. var str = strObjcet.toString();
  1252. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1253. result.push(str);
  1254. }
  1255. sums[4]="总人数:"+ sums[4] +"\n"+result
  1256. // 星期二
  1257. for(let j in data){
  1258. if(data[j].hasOwnProperty ('Tue_M') == true){
  1259. Tue_M.push(data[j].Tue_M.mode_name)
  1260. Tue_M=Tue_M.filter(item=> item && item.trim())
  1261. var countNum =Tue_M.reduce((obj,name)=>{
  1262. if(name in obj){
  1263. obj[name]++
  1264. }else{
  1265. obj[name]=1
  1266. }
  1267. return obj
  1268. },{})
  1269. }
  1270. }
  1271. for(let x in countNum){
  1272. Tue_M_One.push(x + ':' + countNum[x]+"\n")
  1273. }
  1274. var result = [];
  1275. for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
  1276. var strObjcet = Tue_M_One.slice(i, i+29);
  1277. var str = strObjcet.toString();
  1278. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1279. result.push(str);
  1280. }
  1281. sums[5]="总人数:"+ sums[5] +"\n"+result
  1282. // var newTue_A
  1283. for(let j in data){
  1284. if(data[j].hasOwnProperty ('Tue_A') == true){
  1285. Tue_A.push(data[j].Tue_A.mode_name)
  1286. Tue_A=Tue_A.filter(item=> item && item.trim())
  1287. var countNum =Tue_A.reduce((obj,name)=>{
  1288. if(name in obj){
  1289. obj[name]++
  1290. }else{
  1291. obj[name]=1
  1292. }
  1293. return obj
  1294. },{})
  1295. }
  1296. }
  1297. for(let x in countNum){
  1298. Tue_A_One.push(x + ':' + countNum[x]+"\n")
  1299. }
  1300. var result = [];
  1301. for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
  1302. var strObjcet = Tue_A_One.slice(i, i+29);
  1303. var str = strObjcet.toString();
  1304. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1305. result.push(str);
  1306. }
  1307. sums[6]="总人数:"+ sums[6] +"\n"+result
  1308. for(let j in data){
  1309. if(data[j].hasOwnProperty ('Tue_N') == true){
  1310. Tue_N.push(data[j].Tue_N.mode_name)
  1311. Tue_N=Tue_N.filter(item=> item && item.trim())
  1312. var countNum =Tue_N.reduce((obj,name)=>{
  1313. if(name in obj){
  1314. obj[name]++
  1315. }else{
  1316. obj[name]=1
  1317. }
  1318. return obj
  1319. },{})
  1320. }
  1321. }
  1322. for(let x in countNum){
  1323. Tue_N_One.push(x + ':' + countNum[x]+"\n")
  1324. }
  1325. var result = [];
  1326. for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
  1327. var strObjcet = Tue_N_One.slice(i, i+29);
  1328. var str = strObjcet.toString();
  1329. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1330. result.push(str);
  1331. }
  1332. sums[7]="总人数:"+ sums[7] +"\n"+result
  1333. // 星期三
  1334. for(let j in data){
  1335. if(data[j].hasOwnProperty ('Wed_M') == true){
  1336. Wed_M.push(data[j].Wed_M.mode_name)
  1337. Wed_M=Wed_M.filter(item=> item && item.trim())
  1338. var countNum =Wed_M.reduce((obj,name)=>{
  1339. if(name in obj){
  1340. obj[name]++
  1341. }else{
  1342. obj[name]=1
  1343. }
  1344. return obj
  1345. },{})
  1346. }
  1347. }
  1348. for(let x in countNum){
  1349. Wed_M_One.push(x + ':' + countNum[x]+"\n")
  1350. }
  1351. var result = [];
  1352. for (var i = 0,len = Wed_M_One.length; i < len; i+=29) {
  1353. var strObjcet = Wed_M_One.slice(i, i+29);
  1354. var str = strObjcet.toString();
  1355. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1356. result.push(str);
  1357. }
  1358. sums[8]="总人数:"+ sums[8] +"\n"+result
  1359. for(let j in data){
  1360. if(data[j].hasOwnProperty ('Wed_A') == true){
  1361. Wed_A.push(data[j].Wed_A.mode_name)
  1362. Wed_A=Wed_A.filter(item=> item && item.trim())
  1363. var countNum =Wed_A.reduce((obj,name)=>{
  1364. if(name in obj){
  1365. obj[name]++
  1366. }else{
  1367. obj[name]=1
  1368. }
  1369. return obj
  1370. },{})
  1371. }
  1372. }
  1373. for(let x in countNum){
  1374. Wed_A_One.push(x + ':' + countNum[x]+"\n")
  1375. }
  1376. var result = [];
  1377. for (var i = 0,len = Wed_A_One.length; i < len; i+=29) {
  1378. var strObjcet = Wed_A_One.slice(i, i+29);
  1379. var str = strObjcet.toString();
  1380. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1381. result.push(str);
  1382. }
  1383. sums[9]="总人数:"+ sums[9] +"\n"+result
  1384. for(let j in data){
  1385. if(data[j].hasOwnProperty ('Wed_N') == true){
  1386. Wed_N.push(data[j].Wed_N.mode_name)
  1387. Wed_N=Wed_N.filter(item=> item && item.trim())
  1388. var countNum =Wed_N.reduce((obj,name)=>{
  1389. if(name in obj){
  1390. obj[name]++
  1391. }else{
  1392. obj[name]=1
  1393. }
  1394. return obj
  1395. },{})
  1396. }
  1397. }
  1398. for(let x in countNum){
  1399. Wed_N_One.push(x + ':' + countNum[x]+"\n")
  1400. }
  1401. var result = [];
  1402. for (var i = 0,len = Wed_N_One.length; i < len; i+=29) {
  1403. var strObjcet = Wed_N_One.slice(i, i+29);
  1404. var str = strObjcet.toString();
  1405. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1406. result.push(str);
  1407. }
  1408. sums[10]="总人数:"+ sums[10] +"\n"+result
  1409. // 星期四
  1410. for(let j in data){
  1411. if(data[j].hasOwnProperty ('Thurs_M') == true){
  1412. Thurs_M.push(data[j].Thurs_M.mode_name)
  1413. Thurs_M=Thurs_M.filter(item=> item && item.trim())
  1414. var countNum =Thurs_M.reduce((obj,name)=>{
  1415. if(name in obj){
  1416. obj[name]++
  1417. }else{
  1418. obj[name]=1
  1419. }
  1420. return obj
  1421. },{})
  1422. }
  1423. }
  1424. for(let x in countNum){
  1425. Thurs_M_One.push(x + ':' + countNum[x]+"\n")
  1426. }
  1427. var result = [];
  1428. for (var i = 0,len = Thurs_M_One.length; i < len; i+=29) {
  1429. var strObjcet = Thurs_M_One.slice(i, i+29);
  1430. var str = strObjcet.toString();
  1431. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1432. result.push(str);
  1433. }
  1434. sums[11]="总人数:"+ sums[11] +"\n"+result
  1435. for(let j in data){
  1436. if(data[j].hasOwnProperty ('Thurs_A') == true){
  1437. Thurs_A.push(data[j].Thurs_A.mode_name)
  1438. Thurs_A=Thurs_A.filter(item=> item && item.trim())
  1439. var countNum =Thurs_A.reduce((obj,name)=>{
  1440. if(name in obj){
  1441. obj[name]++
  1442. }else{
  1443. obj[name]=1
  1444. }
  1445. return obj
  1446. },{})
  1447. }
  1448. }
  1449. for(let x in countNum){
  1450. Thurs_A_One.push(x + ':' + countNum[x]+"\n")
  1451. }
  1452. var result = [];
  1453. for (var i = 0,len = Thurs_A_One.length; i < len; i+=29) {
  1454. var strObjcet = Thurs_A_One.slice(i, i+29);
  1455. var str = strObjcet.toString();
  1456. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1457. result.push(str);
  1458. }
  1459. sums[12]="总人数:"+ sums[12] +"\n"+result
  1460. for(let j in data){
  1461. if(data[j].hasOwnProperty ('Thurs_N') == true){
  1462. Thurs_N.push(data[j].Thurs_N.mode_name)
  1463. Thurs_N=Thurs_N.filter(item=> item && item.trim())
  1464. var countNum =Thurs_N.reduce((obj,name)=>{
  1465. if(name in obj){
  1466. obj[name]++
  1467. }else{
  1468. obj[name]=1
  1469. }
  1470. return obj
  1471. },{})
  1472. }
  1473. }
  1474. for(let x in countNum){
  1475. Thurs_N_One.push(x + ':' + countNum[x]+"\n")
  1476. }
  1477. var result = [];
  1478. for (var i = 0,len = Thurs_N_One.length; i < len; i+=29) {
  1479. var strObjcet = Thurs_N_One.slice(i, i+29);
  1480. var str = strObjcet.toString();
  1481. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1482. result.push(str);
  1483. }
  1484. sums[13]="总人数:"+ sums[13] +"\n"+result
  1485. // 星期五
  1486. for(let j in data){
  1487. if(data[j].hasOwnProperty ('Fri_M') == true){
  1488. Fri_M.push(data[j].Fri_M.mode_name)
  1489. Fri_M=Fri_M.filter(item=> item && item.trim())
  1490. var countNum =Fri_M.reduce((obj,name)=>{
  1491. if(name in obj){
  1492. obj[name]++
  1493. }else{
  1494. obj[name]=1
  1495. }
  1496. return obj
  1497. },{})
  1498. }
  1499. }
  1500. for(let x in countNum){
  1501. Fri_M_One.push(x + ':' + countNum[x]+"\n")
  1502. }
  1503. var result = [];
  1504. for (var i = 0,len = Fri_M_One.length; i < len; i+=29) {
  1505. var strObjcet = Fri_M_One.slice(i, i+29);
  1506. var str = strObjcet.toString();
  1507. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1508. result.push(str);
  1509. }
  1510. sums[14]="总人数:"+ sums[14] +"\n"+result
  1511. for(let j in data){
  1512. if(data[j].hasOwnProperty ('Fri_A') == true){
  1513. Fri_A.push(data[j].Fri_A.mode_name)
  1514. Fri_A=Fri_A.filter(item=> item && item.trim())
  1515. var countNum =Fri_A.reduce((obj,name)=>{
  1516. if(name in obj){
  1517. obj[name]++
  1518. }else{
  1519. obj[name]=1
  1520. }
  1521. return obj
  1522. },{})
  1523. }
  1524. }
  1525. for(let x in countNum){
  1526. Fri_A_One.push(x + ':' + countNum[x]+"\n")
  1527. }
  1528. var result = [];
  1529. for (var i = 0,len = Fri_A_One.length; i < len; i+=29) {
  1530. var strObjcet = Fri_A_One.slice(i, i+29);
  1531. var str = strObjcet.toString();
  1532. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1533. result.push(str);
  1534. }
  1535. sums[15]="总人数:"+ sums[15] +"\n"+result
  1536. for(let j in data){
  1537. if(data[j].hasOwnProperty ('Fri_N') == true){
  1538. Fri_N.push(data[j].Fri_N.mode_name)
  1539. Fri_N=Fri_N.filter(item=> item && item.trim())
  1540. var countNum =Fri_N.reduce((obj,name)=>{
  1541. if(name in obj){
  1542. obj[name]++
  1543. }else{
  1544. obj[name]=1
  1545. }
  1546. return obj
  1547. },{})
  1548. }
  1549. }
  1550. for(let x in countNum){
  1551. Fri_N_One.push(x + ':' + countNum[x]+"\n")
  1552. }
  1553. var result = [];
  1554. for (var i = 0,len = Fri_N_One.length; i < len; i+=29) {
  1555. var strObjcet = Fri_N_One.slice(i, i+29);
  1556. var str = strObjcet.toString();
  1557. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1558. result.push(str);
  1559. }
  1560. sums[16]="总人数:"+ sums[16] +"\n"+result
  1561. // 星期六
  1562. for(let j in data){
  1563. if(data[j].hasOwnProperty ('Sat_M') == true){
  1564. Sat_M.push(data[j].Sat_M.mode_name)
  1565. Sat_M=Sat_M.filter(item=> item && item.trim())
  1566. var countNum =Sat_M.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. Sat_M_One.push(x + ':' + countNum[x]+"\n")
  1578. }
  1579. var result = [];
  1580. for (var i = 0,len = Sat_M_One.length; i < len; i+=29) {
  1581. var strObjcet = Sat_M_One.slice(i, i+29);
  1582. var str = strObjcet.toString();
  1583. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1584. result.push(str);
  1585. }
  1586. sums[17]="总人数:"+ sums[17] +"\n"+result
  1587. for(let j in data){
  1588. if(data[j].hasOwnProperty ('Sat_A') == true){
  1589. Sat_A.push(data[j].Sat_A.mode_name)
  1590. Sat_A=Sat_A.filter(item=> item && item.trim())
  1591. var countNum =Sat_A.reduce((obj,name)=>{
  1592. if(name in obj){
  1593. obj[name]++
  1594. }else{
  1595. obj[name]=1
  1596. }
  1597. return obj
  1598. },{})
  1599. }
  1600. }
  1601. for(let x in countNum){
  1602. Sat_A_One.push(x + ':' + countNum[x]+"\n")
  1603. }
  1604. var result = [];
  1605. for (var i = 0,len = Sat_A_One.length; i < len; i+=29) {
  1606. var strObjcet = Sat_A_One.slice(i, i+29);
  1607. var str = strObjcet.toString();
  1608. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1609. result.push(str);
  1610. }
  1611. sums[18]="总人数:"+ sums[18] +"\n"+result
  1612. for(let j in data){
  1613. if(data[j].hasOwnProperty ('Sat_N') == true){
  1614. Sat_N.push(data[j].Sat_N.mode_name)
  1615. Sat_N=Sat_N.filter(item=> item && item.trim())
  1616. var countNum =Sat_N.reduce((obj,name)=>{
  1617. if(name in obj){
  1618. obj[name]++
  1619. }else{
  1620. obj[name]=1
  1621. }
  1622. return obj
  1623. },{})
  1624. }
  1625. }
  1626. for(let x in countNum){
  1627. Sat_N_One.push(x + ':' + countNum[x]+"\n")
  1628. }
  1629. var result = [];
  1630. for (var i = 0,len = Sat_N_One.length; i < len; i+=29) {
  1631. var strObjcet = Sat_N_One.slice(i, i+29);
  1632. var str = strObjcet.toString();
  1633. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1634. result.push(str);
  1635. }
  1636. sums[19]="总人数:"+ sums[19] +"\n"+result
  1637. // 星期天
  1638. for(let j in data){
  1639. if(data[j].hasOwnProperty ('Sun_M') == true){
  1640. Sun_M.push(data[j].Sun_M.mode_name)
  1641. Sun_M=Sun_M.filter(item=> item && item.trim())
  1642. var countNum =Sun_M.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. Sun_M_One.push(x + ':' + countNum[x]+"\n")
  1654. }
  1655. var result = [];
  1656. for (var i = 0,len = Sun_M_One.length; i < len; i+=29) {
  1657. var strObjcet = Sun_M_One.slice(i, i+29);
  1658. var str = strObjcet.toString();
  1659. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1660. result.push(str);
  1661. }
  1662. sums[20]="总人数:"+ sums[20] +"\n"+result
  1663. for(let j in data){
  1664. if(data[j].hasOwnProperty ('Sun_A') == true){
  1665. Sun_A.push(data[j].Sun_A.mode_name)
  1666. Sun_A=Sun_A.filter(item=> item && item.trim())
  1667. var countNum =Sun_A.reduce((obj,name)=>{
  1668. if(name in obj){
  1669. obj[name]++
  1670. }else{
  1671. obj[name]=1
  1672. }
  1673. return obj
  1674. },{})
  1675. }
  1676. }
  1677. for(let x in countNum){
  1678. Sun_A_One.push(x + ':' + countNum[x]+"\n")
  1679. }
  1680. var result = [];
  1681. for (var i = 0,len = Sun_A_One.length; i < len; i+=29) {
  1682. var strObjcet = Sun_A_One.slice(i, i+29);
  1683. var str = strObjcet.toString();
  1684. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1685. result.push(str);
  1686. }
  1687. sums[21]="总人数:"+ sums[21] +"\n"+result
  1688. for(let j in data){
  1689. if(data[j].hasOwnProperty ('Sun_N') == true){
  1690. Sun_N.push(data[j].Sun_N.mode_name)
  1691. Sun_N=Sun_N.filter(item=> item && item.trim())
  1692. var countNum =Sun_N.reduce((obj,name)=>{
  1693. if(name in obj){
  1694. obj[name]++
  1695. }else{
  1696. obj[name]=1
  1697. }
  1698. return obj
  1699. },{})
  1700. }
  1701. }
  1702. for(let x in countNum){
  1703. Sun_N_One.push(x + ':' + countNum[x]+"\n")
  1704. }
  1705. var result = [];
  1706. for (var i = 0,len = Sun_N_One.length; i < len; i+=29) {
  1707. var strObjcet = Sun_N_One.slice(i, i+29);
  1708. var str = strObjcet.toString();
  1709. str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
  1710. result.push(str);
  1711. }
  1712. sums[22]="总人数:"+ sums[22] +"\n"+result
  1713. return sums;
  1714. },
  1715. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1716. var that = this;
  1717. var rowNum = 0;
  1718. rowNumber = 0;
  1719. var rutrnData = {};
  1720. if (columnIndex === 0) {
  1721. var rowLen = this.scheduleZoneRow.length;
  1722. if (rowLen > 0) {
  1723. for (let index = 0; index < rowLen; index++) {
  1724. rowNum = this.scheduleZoneRow[index];
  1725. rowNumber += rowNum;
  1726. var f = rowNumber - rowNum;
  1727. if (f == rowIndex) {
  1728. rutrnData = {
  1729. rowspan: rowNum,
  1730. colspan: 1
  1731. };
  1732. break;
  1733. } else if (rowIndex < rowNumber) {
  1734. rutrnData = {
  1735. rowspan: 0,
  1736. colspan: 0
  1737. };
  1738. break;
  1739. }
  1740. }
  1741. return rutrnData;
  1742. }
  1743. }
  1744. },
  1745. handleCurrentChange(row) {
  1746. if (typeof row === "undefined" || row == null) {
  1747. this.currentData.patient_id = 0;
  1748. this.currentData.contagions = [];
  1749. } else {
  1750. this.currentData.patient_id = row.id;
  1751. this.currentData.contagions = row.contagions;
  1752. }
  1753. },
  1754. closePatientPanel(row) {
  1755. this.dialogTableVisible = false;
  1756. this.$refs.singleTable.setCurrentRow(row);
  1757. this.currentData.patient_id = 0;
  1758. },
  1759. getSchedulePatients() {
  1760. getSchedulePatients(this.patientQuery).then(response => {
  1761. if (response.data.state == 1) {
  1762. this.patients = response.data.data.patients;
  1763. }
  1764. });
  1765. },
  1766. // 搜索弹窗操作取消排班
  1767. CancelSchedule(id) {
  1768. this.$confirm("确定要取消当前排班?", "提示", {
  1769. confirmButtonText: "确定",
  1770. cancelButtonText: "取消",
  1771. type: "warning"
  1772. })
  1773. .then(() => {
  1774. CancelSchedule(id).then(response => {
  1775. if (response.data.state == 0) {
  1776. this.$message.error(response.data.msg);
  1777. } else {
  1778. this.$message({
  1779. type: "success",
  1780. message: "排班已取消!"
  1781. });
  1782. var that = this;
  1783. var schedule = response.data.data.schedule;
  1784. this.scheduleZone.forEach(function (zone, index) {
  1785. if (
  1786. zone.zone_id == schedule.partition_id &&
  1787. zone.jihao_id == schedule.bed_id
  1788. ) {
  1789. var weekPath = that.weekPath(
  1790. schedule.schedule_week,
  1791. schedule.schedule_type
  1792. );
  1793. if (weekPath.length == 2) {
  1794. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1795. that.scheduleZone[index][weekPathKey] = {
  1796. schedule_id: 0,
  1797. mode_id: 0,
  1798. patient_id: 0,
  1799. patient: "",
  1800. mode_name: "",
  1801. dialysis_machine_name: '',
  1802. };
  1803. that.scheduleZone[index].total -= 1;
  1804. }
  1805. }
  1806. });
  1807. this.tzDialogVisible = false;
  1808. this.searchTableVisible = false;
  1809. }
  1810. });
  1811. })
  1812. .catch(() => { });
  1813. },
  1814. // 搜索修改机号成功
  1815. changeScheduleActon(formName) {
  1816. this.changing_bed = true;
  1817. ChangeSchedule(this.currentData.id, this.changeSchedule)
  1818. .then(response => {
  1819. if (response.data.state == 0) {
  1820. this.$message.error(response.data.msg);
  1821. } else {
  1822. this.$message({
  1823. type: "success",
  1824. message: "修改成功!"
  1825. });
  1826. var that = this;
  1827. var schedule = response.data.data.schedule;
  1828. this.scheduleZone.forEach(function (zone, index) {
  1829. if (
  1830. zone.zone_id == schedule.partition_id &&
  1831. zone.jihao_id == schedule.bed_id
  1832. ) {
  1833. var weekPath = that.weekPath(
  1834. schedule.schedule_week,
  1835. schedule.schedule_type
  1836. );
  1837. if (weekPath.length == 2) {
  1838. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1839. that.scheduleZone[index][weekPathKey] = {
  1840. schedule_id: schedule.id,
  1841. mode_id: schedule.mode_id,
  1842. patient_id: schedule.patient_id,
  1843. patient: that.currentData.patient,
  1844. dialysis_machine_name: schedule.dialysis_machine_name,
  1845. patient_contagions: that.currentData.contagions,
  1846. mode_name:
  1847. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1848. ? ""
  1849. : that.modeOptions[schedule.mode_id].name
  1850. };
  1851. that.scheduleZone[index].total += 1;
  1852. }
  1853. }
  1854. if (
  1855. zone.zone_id == that.currentData.partition_id &&
  1856. zone.jihao_id == that.currentData.bed_id
  1857. ) {
  1858. var weekPath = that.weekPath(
  1859. that.currentData.schedule_week,
  1860. that.currentData.schedule_type
  1861. );
  1862. if (weekPath.length == 2) {
  1863. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1864. that.scheduleZone[index][weekPathKey] = {
  1865. schedule_id: 0,
  1866. mode_id: 0,
  1867. patient_id: 0,
  1868. patient: "",
  1869. mode_name: "",
  1870. dialysis_machine_name: "",
  1871. patient_contagions: []
  1872. };
  1873. that.scheduleZone[index].total -= 1;
  1874. }
  1875. }
  1876. });
  1877. this.$refs[formName].resetFields();
  1878. this.jhDialogVisible = false;
  1879. }
  1880. this.changing_bed = false;
  1881. })
  1882. .catch(err => {
  1883. this.$message.error(err);
  1884. this.changing_bed = false;
  1885. });
  1886. },
  1887. CreateSchedule(id, data) {
  1888. this.creating_schedule = true;
  1889. CreateSchedule(id, data)
  1890. .then(response => {
  1891. if (response.data.state == 0) {
  1892. this.$message.error(response.data.msg);
  1893. } else {
  1894. this.$message({
  1895. type: "success",
  1896. message: "排班成功!"
  1897. });
  1898. var that = this;
  1899. var schedule = response.data.data.schedule;
  1900. this.scheduleZone.forEach(function (zone, index) {
  1901. if (
  1902. zone.zone_id == schedule.partition_id &&
  1903. zone.jihao_id == schedule.bed_id
  1904. ) {
  1905. var weekPath = that.weekPath(
  1906. schedule.schedule_week,
  1907. schedule.schedule_type
  1908. );
  1909. if (weekPath.length == 2) {
  1910. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1911. that.scheduleZone[index][weekPathKey] = {
  1912. schedule_id: schedule.id,
  1913. mode_id: schedule.mode_id,
  1914. patient_id: schedule.patient_id,
  1915. patient: schedule.patient,
  1916. dialysis_machine_name: schedule.dialysis_machine_name,
  1917. patient_contagions: that.currentData.contagions,
  1918. mode_name:
  1919. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1920. ? ""
  1921. : that.modeOptions[schedule.mode_id].name
  1922. };
  1923. that.scheduleZone[index].total += 1;
  1924. }
  1925. }
  1926. });
  1927. this.closePatientPanel();
  1928. }
  1929. this.creating_schedule = false;
  1930. })
  1931. .catch(err => {
  1932. this.$message.error(err);
  1933. this.creating_schedule = false;
  1934. });
  1935. },
  1936. // hoverMouse(row, column, cell, event) {
  1937. // if (row[column.property].schedule_id > 0) {
  1938. // let patient_id = row[column.property].patient_id
  1939. // this.patient_id_hover = patient_id
  1940. // } else {
  1941. // this.patient_id_hover = -1
  1942. // }
  1943. // },
  1944. clickThis(row, column, cell, event) {
  1945. if (!this.is_edit) {
  1946. this.$message.error("当前页面不可编辑");
  1947. return
  1948. }
  1949. // debugger
  1950. var week = this.weekDay(column.property);
  1951. if (week[0] == -1 || week[1] == -1) {
  1952. return false;
  1953. }
  1954. if (this.toDay > this.weekDays[week[0] - 1]) {
  1955. return false;
  1956. }
  1957. this.currentData.schedule_date = this.weekDays[week[0] - 1];
  1958. this.currentData.schedule_type = week[1];
  1959. this.currentData.bed_id = row.jihao_id;
  1960. this.currentData.partition_id = row.zone_id;
  1961. this.currentData.schedule_week = week[0];
  1962. this.currentData.type_name = this.dayType(week[1]);
  1963. this.currentData.zone_name = row.area;
  1964. this.currentData.bed_name = row.cut;
  1965. this.currentData.partition_type = row.zone_type;
  1966. if (row[column.property].schedule_id > 0) {
  1967. this.currentData.mode_id = row[column.property].mode_id;
  1968. this.currentData.id = row[column.property].schedule_id;
  1969. this.currentData.patient_id = row[column.property].patient_id;
  1970. this.currentData.patient = row[column.property].patient;
  1971. this.currentData.contagions = row[column.property].patient_contagions;
  1972. this.tiaoZhengType = 1;
  1973. this.tzDialogVisible = true;
  1974. } else {
  1975. this.currentData.mode_id = 1;
  1976. this.currentData.id = 0;
  1977. this.currentData.patient_id = 0;
  1978. this.currentData.patient = "";
  1979. this.currentData.contagions = [];
  1980. this.getSchedulePatients();
  1981. this.dialogTableVisible = true;
  1982. }
  1983. },
  1984. // 调整机号的确认按钮
  1985. submitTiaoZJH(formName) {
  1986. this.$refs[formName].validate(valid => {
  1987. if (valid) {
  1988. var weekPath = this.weekPath(
  1989. this.changeSchedule.schedule_week,
  1990. this.changeSchedule.schedule_type
  1991. );
  1992. if (weekPath.length != 2) {
  1993. this.$message.error("数据异常");
  1994. return false;
  1995. }
  1996. this.changeSchedule.bed_id = this.device_id;
  1997. for (let i = 0; i < this.origin_device_numbers.length; i++) {
  1998. if (this.origin_device_numbers[i].id == this.device_id) {
  1999. this.changeSchedule.partition_id = this.origin_device_numbers[
  2000. i
  2001. ].zone_id;
  2002. }
  2003. }
  2004. this.changeSchedule.partition_id = this.zone_name
  2005. this.changeSchedule.change_action = "change_device";
  2006. this.changeScheduleActon(formName);
  2007. // this.changeSchedule.spartition_type = this.scheduleZone[index].zone_type
  2008. var weekPathKey = weekPath[0] + '_' + weekPath[1]
  2009. for (var index in this.scheduleZone) {
  2010. if (this.scheduleZone[index].jihao_id == this.changeSchedule.bed_id) {
  2011. if (this.scheduleZone[index][weekPathKey].mode_id > 0) {
  2012. this.$message.error('选中的区域已经存在排班,不能再排班!')
  2013. return false
  2014. }
  2015. break
  2016. }
  2017. }
  2018. // 可能
  2019. // 患者有传染病,与选择的机器类型(传染病)不匹配
  2020. // 患者没有传染病,但机器是某个传染病的专用透析器
  2021. // 机器的透析模式与患者不匹配
  2022. // if (this.currentData.contagions.length > 0) {
  2023. // var cflag = false
  2024. // for (var index in this.currentData.contagions) {
  2025. // if (this.currentData.contagions[index].disease_id == this.changeSchedule.partition_type) {
  2026. // cflag = true
  2027. // }
  2028. // }
  2029. // if (!cflag) {
  2030. // this.$confirm('此患者有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
  2031. // .then(() => {
  2032. //
  2033. // }).catch(() => {
  2034. // })
  2035. // } else {
  2036. // this.changeSchedule.change_action = 'change_device'
  2037. // this.changeScheduleActon(formName)
  2038. // }
  2039. // } else if (this.changeSchedule.partition_type > 1) {
  2040. // this.$confirm('此患者没有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
  2041. // .then(() => {
  2042. // this.changeSchedule.change_action = 'change_device'
  2043. // this.changeScheduleActon(formName)
  2044. // }).catch(() => {
  2045. // })
  2046. // } else {
  2047. // this.changeSchedule.change_action = 'change_device'
  2048. // this.changeScheduleActon(formName)
  2049. // }
  2050. }
  2051. })
  2052. },
  2053. // 搜索弹窗操作调整模式确认按钮
  2054. submitMode(formName) {
  2055. this.changing_mode = true;
  2056. this.changeSchedule.change_action = "change_mode";
  2057. ChangeSchedule(this.currentData.id, this.changeSchedule)
  2058. .then(response => {
  2059. if (response.data.state == 0) {
  2060. this.$message.error(response.data.msg);
  2061. } else {
  2062. this.$message({
  2063. type: "success",
  2064. message: "修改成功!"
  2065. });
  2066. var that = this;
  2067. var schedule = response.data.data.schedule;
  2068. this.scheduleZone.forEach(function (zone, index) {
  2069. if (
  2070. zone.zone_id == schedule.partition_id &&
  2071. zone.jihao_id == schedule.bed_id
  2072. ) {
  2073. var weekPath = that.weekPath(
  2074. schedule.schedule_week,
  2075. schedule.schedule_type
  2076. );
  2077. if (weekPath.length == 2) {
  2078. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  2079. that.scheduleZone[index][weekPathKey].mode_id =
  2080. schedule.mode_id;
  2081. that.scheduleZone[index][weekPathKey].mode_name =
  2082. typeof that.modeOptions[schedule.mode_id] === "undefined"
  2083. ? ""
  2084. : that.modeOptions[schedule.mode_id].name;
  2085. }
  2086. }
  2087. });
  2088. this.msDialogVisible = false;
  2089. }
  2090. this.changing_mode = false;
  2091. })
  2092. .catch(err => {
  2093. this.$message.error(err);
  2094. this.changing_mode = false;
  2095. });
  2096. },
  2097. submitTiaoZMS(formName) {
  2098. this.$refs[formName].validate(valid => {
  2099. if (valid) {
  2100. this.changing_mode = true;
  2101. this.changeSchedule.change_action = "change_mode";
  2102. ChangeSchedule(this.currentData.id, this.changeSchedule)
  2103. .then(response => {
  2104. if (response.data.state == 0) {
  2105. this.$message.error(response.data.msg);
  2106. } else {
  2107. this.$message({
  2108. type: "success",
  2109. message: "修改成功!"
  2110. });
  2111. var that = this;
  2112. var schedule = response.data.data.schedule;
  2113. this.scheduleZone.forEach(function (zone, index) {
  2114. if (
  2115. zone.zone_id == schedule.partition_id &&
  2116. zone.jihao_id == schedule.bed_id
  2117. ) {
  2118. var weekPath = that.weekPath(
  2119. schedule.schedule_week,
  2120. schedule.schedule_type
  2121. );
  2122. if (weekPath.length == 2) {
  2123. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  2124. that.scheduleZone[index][weekPathKey].mode_id =
  2125. schedule.mode_id;
  2126. that.scheduleZone[index][weekPathKey].mode_name =
  2127. typeof that.modeOptions[schedule.mode_id] ===
  2128. "undefined"
  2129. ? ""
  2130. : that.modeOptions[schedule.mode_id].name;
  2131. }
  2132. }
  2133. });
  2134. this.$refs[formName].resetFields();
  2135. this.msDialogVisible = false;
  2136. }
  2137. this.changing_mode = false;
  2138. })
  2139. .catch(err => {
  2140. this.$message.error(err);
  2141. this.changing_mode = false;
  2142. });
  2143. }
  2144. });
  2145. },
  2146. changePartition(value) {
  2147. let params = {
  2148. zone_id: value,
  2149. sch_type: this.currentData.schedule_type,
  2150. schedule_date: this.currentData.schedule_date,
  2151. patient_id: this.currentData.patient_id,
  2152. };
  2153. //进行网络请求,获取空排班机位
  2154. getSmartDevices(params).then((response) => {
  2155. if (response.data.state == 0) {
  2156. return false;
  2157. } else {
  2158. var devices = response.data.data.devices;
  2159. this.current_devices = [];
  2160. this.current_devices = devices;
  2161. this.zone_names = devices;
  2162. this.device_id = devices[0].id
  2163. this.changeSchedule.bed_id = devices[0].id
  2164. }
  2165. });
  2166. },
  2167. changeScheduleType(schedule_type) {
  2168. this.currentData.schedule_type = schedule_type
  2169. let params = {
  2170. zone_id: this.currentData.partition_id,
  2171. sch_type: schedule_type,
  2172. schedule_date: this.currentData.schedule_date,
  2173. patient_id: this.currentData.patient_id,
  2174. };
  2175. //进行网络请求,获取空排班机位
  2176. getSmartDevices(params).then((response) => {
  2177. if (response.data.state == 0) {
  2178. return false;
  2179. } else {
  2180. var devices = response.data.data.devices;
  2181. this.current_devices = [];
  2182. this.current_devices = devices;
  2183. this.changeSchedule.bed_id = ""
  2184. this.changeSchedule.partition_id = this.currentData.partition_id
  2185. }
  2186. });
  2187. },
  2188. submitTiaoX() {
  2189. if (this.tiaoZhengType == 1) {
  2190. this.$confirm('确定要取消当前排班?', '提示', {
  2191. confirmButtonText: '确定',
  2192. cancelButtonText: '取消',
  2193. type: 'warning'
  2194. }).then(() => {
  2195. this.CancelSchedule(this.currentData.id);
  2196. }).catch(() => { });
  2197. }
  2198. switch (this.tiaoZhengType) {
  2199. case 1:
  2200. this.CancelSchedule(this.currentData.id);
  2201. break;
  2202. case 2:
  2203. this.changeSchedule = {
  2204. mode_id: this.currentData.mode_id,
  2205. schedule_type: this.currentData.schedule_type,
  2206. partition_id: this.currentData.partition_id,
  2207. bed_id: this.currentData.bed_id,
  2208. schedule_week: this.currentData.schedule_week,
  2209. partition_type: ""
  2210. };
  2211. if (
  2212. typeof this.partitions[this.currentData.partition_id].jihaos !==
  2213. "undefined"
  2214. ) {
  2215. this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
  2216. } else {
  2217. this.jihaos = [];
  2218. }
  2219. const params = {
  2220. type: this.currentData.schedule_type,
  2221. date: this.currentData.schedule_date
  2222. };
  2223. getUrgentScheduleInitData(params)
  2224. .then(response => {
  2225. if (response.data.state == 0) {
  2226. this.$message.error(response.data.msg);
  2227. } else {
  2228. if (response.data.state == 1) {
  2229. this.origin_schedules = response.data.data.schedules;
  2230. this.origin_device_numbers =
  2231. response.data.data.device_numbers;
  2232. var zone_device_map = {};
  2233. for (
  2234. let index = 0;
  2235. index < this.origin_device_numbers.length;
  2236. index++
  2237. ) {
  2238. const device_number = this.origin_device_numbers[index];
  2239. if (
  2240. zone_device_map[device_number.zone_name] == null ||
  2241. zone_device_map[device_number.zone_name] == undefined
  2242. ) {
  2243. zone_device_map[device_number.zone_name] = [];
  2244. }
  2245. zone_device_map[device_number.zone_name].push(
  2246. device_number
  2247. );
  2248. }
  2249. this.zone_device_map = zone_device_map;
  2250. this.zone_names = Object.keys(this.zone_device_map);
  2251. if (this.zone_names.length > 0) {
  2252. this.zone_name = this.zone_names[0];
  2253. this.current_devices = this.zone_device_map[this.zone_name];
  2254. this.device_id = this.current_devices[0].id;
  2255. }
  2256. this.zone_device_options = [
  2257. { values: this.zone_names },
  2258. // { values: this.getDeviceNumberNames(this.current_devices) },
  2259. { values: this.current_devices }
  2260. ];
  2261. //
  2262. // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
  2263. // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
  2264. // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
  2265. // this.origin_device_numbers.splice(y, 1)
  2266. // }
  2267. // }
  2268. // }
  2269. // // debugger
  2270. // var zone_device_map = {}
  2271. // for (let index = 0; index < this.origin_device_numbers.length; index++) {
  2272. // const device_number = this.origin_device_numbers[index]
  2273. // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
  2274. // zone_device_map[device_number.zone.name] = []
  2275. // }
  2276. // zone_device_map[device_number.zone.name].push(device_number)
  2277. // }
  2278. // this.zone_device_map = zone_device_map
  2279. //
  2280. // this.zone_names = Object.keys(this.zone_device_map)
  2281. // if (this.zone_names.length > 0) {
  2282. // this.zone_name = this.zone_names[0]
  2283. // this.current_devices = this.zone_device_map[this.zone_name]
  2284. // this.device_id = this.current_devices[0].id
  2285. // }
  2286. //
  2287. // this.zone_device_options = [
  2288. // { values: this.zone_names },
  2289. // // { values: this.getDeviceNumberNames(this.current_devices) },
  2290. // { values: this.current_devices }
  2291. // ]
  2292. } else {
  2293. }
  2294. }
  2295. })
  2296. .catch(err => {
  2297. this.$message.error(err);
  2298. });
  2299. this.tzDialogVisible = false;
  2300. this.jhDialogVisible = true;
  2301. break;
  2302. case 3:
  2303. this.changeSchedule = {
  2304. mode_id: "",
  2305. schedule_type: "",
  2306. partition_id: "",
  2307. bed_id: "",
  2308. schedule_week: "",
  2309. partition_type: ""
  2310. };
  2311. this.tzDialogVisible = false;
  2312. this.msDialogVisible = true;
  2313. break;
  2314. default:
  2315. break;
  2316. }
  2317. },
  2318. setSchedule() {
  2319. var that = this;
  2320. var submitFlag = true;
  2321. if (this.currentData.patient_id <= 0) {
  2322. this.$message.error("请先选择患者");
  2323. return false;
  2324. }
  2325. if (
  2326. this.currentData.schedule_date.length == 0 ||
  2327. this.currentData.schedule_type < 1 ||
  2328. this.currentData.schedule_type > 3 ||
  2329. this.currentData.bed_id < 1 ||
  2330. this.currentData.partition_id < 1 ||
  2331. this.currentData.schedule_week < 1 ||
  2332. this.currentData.schedule_week > 7
  2333. ) {
  2334. this.$message.error("请先选择排班时间或机号");
  2335. return false;
  2336. }
  2337. // 可能
  2338. // 患者有传染病,与选择的机器类型(传染病)不匹配
  2339. // 患者没有传染病,但机器是某个传染病的专用透析器
  2340. // 机器的透析模式与患者不匹配
  2341. if (this.currentData.contagions.length > 0) {
  2342. var cflag = false;
  2343. this.currentData.contagions.forEach(function (contagion) {
  2344. if (contagion.disease_id == that.currentData.partition_type) {
  2345. cflag = true;
  2346. }
  2347. });
  2348. if (!cflag) {
  2349. this.$confirm(
  2350. "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
  2351. "提示",
  2352. {
  2353. confirmButtonText: "确 定",
  2354. cancelButtonText: "取 消",
  2355. type: "warning"
  2356. }
  2357. )
  2358. .then(() => {
  2359. this.CreateSchedule(
  2360. this.currentData.patient_id,
  2361. this.currentData
  2362. );
  2363. })
  2364. .catch(() => { });
  2365. } else {
  2366. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  2367. }
  2368. } else if (that.currentData.partition_type > 1) {
  2369. this.$confirm(
  2370. "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
  2371. "提示",
  2372. {
  2373. confirmButtonText: "确 定",
  2374. cancelButtonText: "取 消",
  2375. type: "warning"
  2376. }
  2377. )
  2378. .then(() => {
  2379. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  2380. })
  2381. .catch(() => { });
  2382. } else {
  2383. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  2384. }
  2385. },
  2386. weekType(weekTime) {
  2387. var theType = 2;
  2388. switch (weekTime) {
  2389. case "historyWeek":
  2390. theType = 0;
  2391. break;
  2392. case "lastWeek":
  2393. theType = 1;
  2394. break;
  2395. case "thisWeek":
  2396. theType = 2;
  2397. break;
  2398. case "nextWeek":
  2399. theType = 3;
  2400. break;
  2401. case "nextTwoWeek":
  2402. theType = 4;
  2403. break;
  2404. default:
  2405. theType = 2;
  2406. break;
  2407. }
  2408. return theType;
  2409. },
  2410. dayType(theType) {
  2411. var jType = "";
  2412. switch (theType) {
  2413. case 1:
  2414. jType = "上午";
  2415. break;
  2416. case 2:
  2417. jType = "下午";
  2418. break;
  2419. case 3:
  2420. jType = "晚上";
  2421. break;
  2422. default:
  2423. break;
  2424. }
  2425. return jType;
  2426. },
  2427. weekPath(week, schedule_type) {
  2428. var weekArr = {
  2429. 1: "Mon",
  2430. 2: "Tue",
  2431. 3: "Wed",
  2432. 4: "Thurs",
  2433. 5: "Fri",
  2434. 6: "Sat",
  2435. 7: "Sun"
  2436. };
  2437. var typeArr = { 1: "M", 2: "A", 3: "N" };
  2438. if (
  2439. typeof weekArr[week] === "undefined" ||
  2440. typeof typeArr[schedule_type] === "undefined"
  2441. ) {
  2442. return [];
  2443. }
  2444. return [weekArr[week], typeArr[schedule_type]];
  2445. },
  2446. weekDay(prop) {
  2447. var week = prop.split("_");
  2448. if (week.length != 2) {
  2449. return [-1, -1];
  2450. }
  2451. var w = -1;
  2452. var n = -1;
  2453. switch (week[0]) {
  2454. case "Mon":
  2455. w = 1;
  2456. break;
  2457. case "Tue":
  2458. w = 2;
  2459. break;
  2460. case "Wed":
  2461. w = 3;
  2462. break;
  2463. case "Thurs":
  2464. w = 4;
  2465. break;
  2466. case "Fri":
  2467. w = 5;
  2468. break;
  2469. case "Sat":
  2470. w = 6;
  2471. break;
  2472. case "Sun":
  2473. w = 7;
  2474. break;
  2475. default:
  2476. w = -1;
  2477. break;
  2478. }
  2479. switch (week[1]) {
  2480. case "M":
  2481. n = 1;
  2482. break;
  2483. case "A":
  2484. n = 2;
  2485. break;
  2486. case "N":
  2487. n = 3;
  2488. break;
  2489. default:
  2490. n = -1;
  2491. break;
  2492. }
  2493. if (w == -1 || n == -1) {
  2494. return [-1, -1];
  2495. }
  2496. return [w, n];
  2497. },
  2498. // 搜索
  2499. search: function () {
  2500. let week_type = 0
  2501. var weeklist = moment().format('E');//计算今天是这周第几天
  2502. var first_monday = moment().subtract(weeklist - 1, 'days').format('YYYY-MM-DD');//周一日期
  2503. var end_monday = moment().add(7 - weeklist, 'days').format('YYYY-MM-DD')
  2504. if (this.weekTime == 'thisWeek') {
  2505. week_type = 1
  2506. } else if (this.weekTime == 'nextWeek') {
  2507. week_type = 2
  2508. } else if (this.weekTime == 'nextTwoWeek') {
  2509. week_type = 3
  2510. }
  2511. const params = {
  2512. keywords: this.keywords,
  2513. week_type: week_type,
  2514. start_sch: first_monday,
  2515. end_sch: end_monday,
  2516. };
  2517. // console.log("params",params)
  2518. getSearchResult(params).then(response => {
  2519. if (response.data.state == 1) {
  2520. this.schedulePatients = response.data.data.schdules;
  2521. this.searchTableVisible = true;
  2522. }
  2523. });
  2524. },
  2525. // 搜索弹窗调整机号按钮
  2526. changeMachineNumber: function (index, row) {
  2527. this.currentData.schedule_type = row.schedule_type;
  2528. this.currentData.bed_id = row.bed_id;
  2529. this.currentData.partition_id = row.partition_id;
  2530. this.currentData.schedule_week = row.schedule_week;
  2531. switch (row.schedule_type) {
  2532. case 1:
  2533. this.currentData.type_name = "上午";
  2534. break;
  2535. case 2:
  2536. this.currentData.type_name = "下午";
  2537. break;
  2538. case 3:
  2539. this.currentData.type_name = "晚上";
  2540. break;
  2541. }
  2542. this.currentData.zone_name = row.zone.name;
  2543. this.currentData.bed_name = row.number.number;
  2544. this.currentData.partition_type = row.zone.type;
  2545. this.currentData.mode_id = row.mode_id;
  2546. this.currentData.patient_id = row.patient_id;
  2547. this.currentData.patient = row.patient;
  2548. this.currentData.contagions = row.patient_contagions;
  2549. this.currentData.id = row.id;
  2550. this.currentData.schedule_date = uParseTime(
  2551. row.schedule_date,
  2552. "{y}-{m}-{d}"
  2553. );
  2554. this.zone_name = row.partition_id;
  2555. this.device_id = row.bed_id;
  2556. // this.current_devices = this.partitions[row.partition_id].jihaos
  2557. let params = {
  2558. zone_id: row.partition_id,
  2559. sch_type: row.schedule_type,
  2560. schedule_date: this.currentData.schedule_date,
  2561. patient_id: this.currentData.patient_id,
  2562. };
  2563. //进行网络请求,获取空排班机位
  2564. getSmartDevices(params).then((response) => {
  2565. if (response.data.state == 0) {
  2566. return false;
  2567. } else {
  2568. var devices = response.data.data.devices;
  2569. this.current_devices = [];
  2570. this.current_devices = devices;
  2571. this.device_id = devices[0].id
  2572. }
  2573. });
  2574. this.changeSchedule = {
  2575. mode_id: row.mode_id,
  2576. schedule_type: row.schedule_type,
  2577. partition_id: row.partition_id,
  2578. bed_id: row.bed_id,
  2579. schedule_week: row.schedule_week,
  2580. partition_type: ""
  2581. };
  2582. if (typeof this.partitions[row.partition_id].jihaos !== "undefined") {
  2583. this.jihaos = this.partitions[row.partition_id].jihaos;
  2584. } else {
  2585. this.jihaos = [];
  2586. }
  2587. this.searchTableVisible = false;
  2588. this.jhDialogVisible = true;
  2589. },
  2590. getDialysisDate: function (row) {
  2591. let week = "";
  2592. switch (row.schedule_week) {
  2593. case 7:
  2594. week = "周日";
  2595. break;
  2596. case 1:
  2597. week = "周一";
  2598. break;
  2599. case 2:
  2600. week = "周二";
  2601. break;
  2602. case 3:
  2603. week = "周三";
  2604. break;
  2605. case 4:
  2606. week = "周四";
  2607. break;
  2608. case 5:
  2609. week = "周五";
  2610. break;
  2611. case 6:
  2612. week = "周六";
  2613. break;
  2614. }
  2615. return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
  2616. },
  2617. getSchedulesType: function (type, row) {
  2618. let type_name = "";
  2619. switch (type) {
  2620. case 1:
  2621. type_name = "上午";
  2622. break;
  2623. case 2:
  2624. type_name = "下午";
  2625. break;
  2626. case 3:
  2627. type_name = "晚上";
  2628. break;
  2629. }
  2630. return type_name;
  2631. },
  2632. // 搜索弹窗调整模式按钮
  2633. changeMode: function (index, row) {
  2634. this.changeSchedule = {
  2635. mode_id: "",
  2636. schedule_type: "",
  2637. partition_id: "",
  2638. bed_id: "",
  2639. schedule_week: "",
  2640. partition_type: ""
  2641. };
  2642. this.currentData.id = row.id;
  2643. this.searchTableVisible = false;
  2644. this.msDialogVisible = true;
  2645. },
  2646. tableRowClassName({ row, rowIndex }) {
  2647. if (row.zone_type == 1) {
  2648. return 'table-row-new-class schedule-table-row'
  2649. } else {
  2650. return 'table-row-new-class schedule-table-row backPurple'
  2651. }
  2652. },
  2653. getAllZones() {
  2654. getAllZones().then(response => {
  2655. if (response.data.state == 1) {
  2656. // console.log('getAllZones的数据',response.data.data);
  2657. var zones = response.data.data.zones
  2658. for (let i = 0; i < zones.length; i++) {
  2659. this.zoneIdList.push(zones[i].id)
  2660. }
  2661. this.zones.push(...zones)
  2662. var strArr = this.zoneIdList.join(",")
  2663. this.strArr = strArr
  2664. this.getWeekPanels()
  2665. }
  2666. })
  2667. },
  2668. changePartiton(val) {
  2669. this.$emit('event1', val)
  2670. this.partition_id = val
  2671. this.getWeekPanels()
  2672. // this.getSchedules()
  2673. // this.getWeekPanels()
  2674. },
  2675. changeSchedule_type(val) {
  2676. this.$emit('event2', val)
  2677. this.schedule_type = val
  2678. this.getSchedules()
  2679. },
  2680. changeWeekDay(val) {
  2681. this.$emit('event3', val)
  2682. },
  2683. getTimestamp(time) { //把时间日期转成时间戳
  2684. return (new Date(time)).getTime() / 1000
  2685. },
  2686. getTime(val) {
  2687. return uParseTime(val, '{y}-{m}-{d}')
  2688. },
  2689. changeWeek(val) {
  2690. console.log('效果国233232',val)
  2691. this.newDay = []
  2692. var start = this.getTimestamp(val) - 86400
  2693. var end = start + 518400
  2694. this.start_time = this.getTime(start)
  2695. this.end_time = this.getTime(end)
  2696. this.newDay.push(this.start_time)
  2697. this.newDay.push(this.end_time)
  2698. console.log("sart323232我的",this.start_time)
  2699. console.log("end_timewowowo",this.end_time)
  2700. this.scheduleZone=[]
  2701. // this.$nextTick(() => {
  2702. this.getAllZones()
  2703. // this.getSchedules()
  2704. // this.source_scheduleZone=[]
  2705. // })
  2706. },
  2707. // 选择周次
  2708. start(){
  2709. var thisweek = {};
  2710. var date = new Date();
  2711. // 本周一的日期
  2712. date.setDate(date.getDate() - date.getDay() + 1);
  2713. thisweek.start_day = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
  2714. // 本周日的日期
  2715. date.setDate(date.getDate() + 6);
  2716. thisweek.end_day = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
  2717. // console.log('asdfgdsafg',thisweek.start_day,thisweek.end_day);
  2718. var date = new Date();
  2719. // 上上周一的日期
  2720. date.setDate(date.getDate()-14 - date.getDay() + 1);
  2721. var month=(date.getMonth() + 1)<10 ? "0"+(date.getMonth()+1):(date.getMonth()+1)
  2722. var day=(date.getDate())<10 ? "0"+(date.getDate()):(date.getDate())
  2723. this.start_time = date.getFullYear() + "-" + month + "-" + day + " 00:00:00";
  2724. // 上上周日的日期
  2725. date.setDate(date.getDate() + 6);
  2726. var month=(date.getMonth() + 1)<10 ? "0"+(date.getMonth()+1):(date.getMonth()+1)
  2727. var day=(date.getDate())<10 ? "0"+(date.getDate()):(date.getDate())
  2728. this.end_time = date.getFullYear() + "-" + month + "-" + day + ' 23:59:59';
  2729. // console.log('1234566',this.lastweek.start_day,this.lastweek.end_day) ;
  2730. // this.getAllZones()
  2731. this.getSchedules()
  2732. },
  2733. getSchedules(){
  2734. var partionStr = this.partition_id
  2735. var arr = this.zoneIdList.join(',')
  2736. var str = ""
  2737. if (partionStr == 0) {
  2738. str = arr
  2739. }
  2740. if (partionStr != 0) {
  2741. str = partionStr.join(',')
  2742. }
  2743. const params = {
  2744. is_before:1,
  2745. start_time: this.start_time ,
  2746. end_time:this.end_time ,
  2747. weekTime: this.theType,
  2748. patitionid: str,
  2749. schedule_type: this.schedule_type,
  2750. }
  2751. console.log("params232323232",params)
  2752. getSchedulesOne(params).then(response => {
  2753. // console.log('getSchedulesOne',response.data.data);
  2754. if (response.data.state == 1) {
  2755. this.weekTitle = response.data.data.weekTitle;
  2756. this.weekTitle = []
  2757. console.log("first_day23333333333333",this.start_time)
  2758. var first = this.getTimestamp(this.start_time)
  2759. var first_day = this.getTime(first, "{y}-{m}-{d}")
  2760. console.log("first_day23333333333333",first_day)
  2761. this.weekTitle.push(first_day)
  2762. var second = this.getTimestamp(this.start_time) + 86400
  2763. var soncond_day = this.getTime(second, "{y}-{m}-{d}")
  2764. this.weekTitle.push(soncond_day)
  2765. var three = this.getTimestamp(this.start_time) + 172800
  2766. var three_day = this.getTime(three, "{y}-{m}-{d}")
  2767. this.weekTitle.push(three_day)
  2768. var four = this.getTimestamp(this.start_time) + 259200
  2769. var four_day = this.getTime(four, "{y}-{m}-{d}")
  2770. this.weekTitle.push(four_day)
  2771. var five = this.getTimestamp(this.start_time) + 345600
  2772. var five_day = this.getTime(five, "{y}-{m}-{d}")
  2773. this.weekTitle.push(five_day)
  2774. var six = this.getTimestamp(this.start_time) + 432000
  2775. var six_day = this.getTime(six, "{y}-{m}-{d}")
  2776. this.weekTitle.push(six_day)
  2777. var seven = this.getTimestamp(this.start_time) + 518400
  2778. var seven_day = this.getTime(seven, "{y}-{m}-{d}")
  2779. this.weekTitle.push(seven_day)
  2780. // console.log("this.weekTitle",this.weekTitle)
  2781. this.weekDays = response.data.data.days;
  2782. this.toDay = response.data.data.today;
  2783. var theSchedules = response.data.data.schdules;
  2784. var schedulesGroup = response.data.data.schedulesGroup
  2785. this.schedulesGroup = schedulesGroup
  2786. var that = this;
  2787. this.scheduleZone.forEach(function (zone, index) {
  2788. that.scheduleZone[index].Mon_M = {
  2789. mode_id: 0,
  2790. mode_name: "",
  2791. patient_id: 0,
  2792. patient: "",
  2793. dialysis_machine_name: "",
  2794. schedule_date: "",
  2795. Count: 0,
  2796. };
  2797. that.scheduleZone[index].Mon_A = {
  2798. mode_id: 0,
  2799. mode_name: "",
  2800. patient_id: 0,
  2801. patient: "",
  2802. dialysis_machine_name: "",
  2803. schedule_date: "",
  2804. Count: 0,
  2805. };
  2806. that.scheduleZone[index].Mon_N = {
  2807. mode_id: 0,
  2808. mode_name: "",
  2809. patient_id: 0,
  2810. patient: "",
  2811. dialysis_machine_name: "",
  2812. schedule_date: "",
  2813. Count: 0,
  2814. };
  2815. that.scheduleZone[index].Tue_M = {
  2816. mode_id: 0,
  2817. mode_name: "",
  2818. patient_id: 0,
  2819. patient: "",
  2820. dialysis_machine_name: "",
  2821. schedule_date: "",
  2822. Count: 0,
  2823. };
  2824. that.scheduleZone[index].Tue_A = {
  2825. mode_id: 0,
  2826. mode_name: "",
  2827. patient_id: 0,
  2828. patient: "",
  2829. dialysis_machine_name: "",
  2830. schedule_date: "",
  2831. Count: 0,
  2832. };
  2833. that.scheduleZone[index].Tue_N = {
  2834. mode_id: 0,
  2835. mode_name: "",
  2836. patient_id: 0,
  2837. patient: "",
  2838. dialysis_machine_name: "",
  2839. schedule_date: "",
  2840. Count: 0,
  2841. };
  2842. that.scheduleZone[index].Wed_M = {
  2843. mode_id: 0,
  2844. mode_name: "",
  2845. patient_id: 0,
  2846. patient: "",
  2847. dialysis_machine_name: "",
  2848. schedule_date: "",
  2849. Count: 0,
  2850. };
  2851. that.scheduleZone[index].Wed_A = {
  2852. mode_id: 0,
  2853. mode_name: "",
  2854. patient_id: 0,
  2855. patient: "",
  2856. dialysis_machine_name: "",
  2857. schedule_date: "",
  2858. Count: 0,
  2859. };
  2860. that.scheduleZone[index].Wed_N = {
  2861. mode_id: 0,
  2862. mode_name: "",
  2863. patient_id: 0,
  2864. patient: "",
  2865. dialysis_machine_name: "",
  2866. schedule_date: "",
  2867. Count: 0,
  2868. };
  2869. that.scheduleZone[index].Thurs_M = {
  2870. mode_id: 0,
  2871. mode_name: "",
  2872. patient_id: 0,
  2873. patient: "",
  2874. dialysis_machine_name: "",
  2875. schedule_date: "",
  2876. Count: 0,
  2877. };
  2878. that.scheduleZone[index].Thurs_A = {
  2879. mode_id: 0,
  2880. mode_name: "",
  2881. patient_id: 0,
  2882. patient: "",
  2883. dialysis_machine_name: "",
  2884. schedule_date: "",
  2885. Count: 0,
  2886. };
  2887. that.scheduleZone[index].Thurs_N = {
  2888. mode_id: 0,
  2889. mode_name: "",
  2890. patient_id: 0,
  2891. patient: "",
  2892. dialysis_machine_name: "",
  2893. schedule_date: "",
  2894. Count: 0,
  2895. };
  2896. that.scheduleZone[index].Fri_M = {
  2897. mode_id: 0,
  2898. mode_name: "",
  2899. patient_id: 0,
  2900. patient: "",
  2901. dialysis_machine_name: "",
  2902. schedule_date: "",
  2903. Count: 0,
  2904. };
  2905. that.scheduleZone[index].Fri_A = {
  2906. mode_id: 0,
  2907. mode_name: "",
  2908. patient_id: 0,
  2909. patient: "",
  2910. dialysis_machine_name: "",
  2911. schedule_date: "",
  2912. Count: 0,
  2913. };
  2914. that.scheduleZone[index].Fri_N = {
  2915. mode_id: 0,
  2916. mode_name: "",
  2917. patient_id: 0,
  2918. patient: "",
  2919. dialysis_machine_name: "",
  2920. schedule_date: "",
  2921. Count: 0,
  2922. };
  2923. that.scheduleZone[index].Sat_M = {
  2924. mode_id: 0,
  2925. mode_name: "",
  2926. patient_id: 0,
  2927. patient: "",
  2928. dialysis_machine_name: "",
  2929. schedule_date: "",
  2930. Count: 0,
  2931. };
  2932. that.scheduleZone[index].Sat_A = {
  2933. mode_id: 0,
  2934. mode_name: "",
  2935. patient_id: 0,
  2936. patient: "",
  2937. dialysis_machine_name: "",
  2938. schedule_date: "",
  2939. Count: 0,
  2940. };
  2941. that.scheduleZone[index].Sat_N = {
  2942. mode_id: 0,
  2943. mode_name: "",
  2944. patient_id: 0,
  2945. patient: "",
  2946. dialysis_machine_name: "",
  2947. schedule_date: "",
  2948. Count: 0,
  2949. };
  2950. that.scheduleZone[index].Sun_A = {
  2951. mode_id: 0,
  2952. mode_name: "",
  2953. patient_id: 0,
  2954. patient: "",
  2955. dialysis_machine_name: "",
  2956. schedule_date: "",
  2957. Count: 0,
  2958. };
  2959. that.scheduleZone[index].Sun_N = {
  2960. mode_id: 0,
  2961. mode_name: "",
  2962. patient_id: 0,
  2963. patient: "",
  2964. dialysis_machine_name: "",
  2965. schedule_date: "",
  2966. Count: 0,
  2967. };
  2968. that.scheduleZone[index].Sun_M = {
  2969. mode_id: 0,
  2970. mode_name: "",
  2971. patient_id: 0,
  2972. patient: "",
  2973. dialysis_machine_name: "",
  2974. schedule_date: "",
  2975. Count: 0,
  2976. };
  2977. that.scheduleZone[index].total = 0;
  2978. if (response.data.data.schdules.length > 0) {
  2979. theSchedules.forEach(function (schedule, sindex) {
  2980. if (zone.jihao_id == schedule.bed_id) {
  2981. var weekPath = that.weekPath(
  2982. schedule.schedule_week,
  2983. schedule.schedule_type
  2984. );
  2985. if (weekPath.length == 2) {
  2986. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  2987. that.scheduleZone[index][weekPathKey] = {
  2988. schedule_id: schedule.id,
  2989. mode_id: schedule.mode_id,
  2990. patient_id: schedule.patient_id,
  2991. patient: schedule.patient,
  2992. dialysis_machine_name: schedule.dialysis_machine_name,
  2993. patient_contagions: schedule.patient_contagions,
  2994. schedule_date: schedule.schedule_date,
  2995. mode_name: typeof that.modeOptions[schedule.mode_id] === "undefined" ? "" : that.modeOptions[schedule.mode_id].name
  2996. };
  2997. that.scheduleZone[index].total += 1;
  2998. }
  2999. }
  3000. });
  3001. }
  3002. });
  3003. this.source_scheduleZone = this.scheduleZone
  3004. // console.log("历史aaaa", this.scheduleZone)
  3005. } else {
  3006. this.$message.error("网络错误");
  3007. return false;
  3008. }
  3009. });
  3010. },
  3011. getTimestamp(time) {
  3012. //把时间日期转成时间戳
  3013. // console.log("日期", new Date(time));
  3014. return new Date(time).getTime() / 1000;
  3015. },
  3016. getTimestampToTime (timestamp) {
  3017. let date = new Date(timestamp)
  3018. let Y = date.getFullYear() + '-'
  3019. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
  3020. let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate())
  3021. let time = Y + M + D
  3022. return time
  3023. },
  3024. getTime(value, temp) {
  3025. if (value != undefined) {
  3026. return uParseTime(value, temp)
  3027. }
  3028. return ''
  3029. },
  3030. },
  3031. components: {
  3032. ScheduleItem
  3033. },
  3034. mounted() {
  3035. this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 120;
  3036. // var theType = this.weekType(this.weekTime);
  3037. // this.getSchedules(theType);
  3038. const that = this;
  3039. window.onresize = () => {
  3040. return (() => {
  3041. window.fullHeight = document.documentElement.clientHeight;
  3042. if (window.fullHeight < 200) {
  3043. that.tableHeight = 200;
  3044. } else {
  3045. that.tableHeight = window.fullHeight - 160;
  3046. }
  3047. })();
  3048. };
  3049. },
  3050. };
  3051. </script>
  3052. <style rel="stylesheet/css" lang="scss">
  3053. *{
  3054. -webkit-touch-callout:none; /*系统默认菜单被禁用*/
  3055. -webkit-user-select:none; /*webkit浏览器*/
  3056. -khtml-user-select:none; /*早期浏览器*/
  3057. -moz-user-select:none;/*火狐*/
  3058. -ms-user-select:none; /*IE10*/
  3059. user-select:none;
  3060. }
  3061. input{
  3062. -webkit-user-select:auto; /*webkit浏览器*/
  3063. }
  3064. textarea{
  3065. -webkit-user-select:auto; /*webkit浏览器*/
  3066. }
  3067. .tiaozhengclass {
  3068. display: block;
  3069. margin: 0 auto;
  3070. }
  3071. .center-tab{
  3072. .el-table .cell{
  3073. padding: 0px 0px !important;
  3074. white-space: pre-wrap;
  3075. }
  3076. }
  3077. .el-table--medium td, .el-table--medium th {
  3078. padding: 5px 0 !important;
  3079. }
  3080. .schedule-table-row {
  3081. background: #fff !important;
  3082. }
  3083. .schedule-table-row:hover {
  3084. background: #fff !important;
  3085. }
  3086. .schedule-table-row td:hover {
  3087. background: rgb(88, 162, 236) !important;
  3088. }
  3089. .schedule-table-row td .cell {
  3090. font-size: 12px;
  3091. white-space:normal !important;
  3092. // normal
  3093. }
  3094. .schedule-table-cell-disable {
  3095. background-color: rgb(245, 245, 245) !important;
  3096. }
  3097. #table_data {
  3098. min-height: calc(100vh - 350px);
  3099. .switch{
  3100. margin-left: 10px;
  3101. }
  3102. }
  3103. #table_data ::-webkit-scrollbar {
  3104. height: 15px;
  3105. }
  3106. .el-table td,
  3107. .el-table th.is-leaf,
  3108. .el-table--border,
  3109. .el-table--group {
  3110. border-color: #d0d3da;
  3111. }
  3112. .el-table--border::after,
  3113. .el-table--group::after,
  3114. .el-table::before {
  3115. background-color: #d0d3da;
  3116. }
  3117. .el-table--border th {
  3118. border-color: #d0d3da;
  3119. }
  3120. .el-table--border td {
  3121. border-color: #d0d3da;
  3122. }
  3123. .el-table td {
  3124. border-color: #d0d3da;
  3125. }
  3126. #table_data {
  3127. .el-table__body tr.current-row > td {
  3128. background-color: #ecf5ff !important;
  3129. color: #3a8ee6;
  3130. }
  3131. .el-table__body tr > td:hover {
  3132. background-color: #409eff !important;
  3133. color: #fff;
  3134. }
  3135. .el-table__body tr .hover-td {
  3136. background-color: #409eff !important;
  3137. color: #fff;
  3138. }
  3139. .Infectious_disease{
  3140. background-color: red !important;
  3141. color: white;
  3142. }
  3143. }
  3144. .backPurple{
  3145. color: #f32424 !important;
  3146. }
  3147. // .el-table td .cell{
  3148. // padding: 0px 0px !important;
  3149. // }
  3150. </style>