tableData.vue 101KB

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