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

tableData.vue 73KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429
  1. <template>
  2. <div id="table_data">
  3. <div style="margin-bottom:-30px;margin-left:300px">
  4. <span>分区:</span>
  5. <el-select v-model="partition_id" multiple placeholder="请选择" @change="changePartiton">
  6. <el-option
  7. v-for="item in this.zones"
  8. :key="item.id"
  9. :label="item.name"
  10. :value="item.id">
  11. </el-option>
  12. </el-select>
  13. <!-- <span style="margin-left:100px">班次:</span>
  14. <el-select v-model="schedule_type" placeholder="请选择" @change="changeSchedule_type">
  15. <el-option
  16. v-for="item in options"
  17. :key="item.id"
  18. :label="item.name"
  19. :value="item.id">
  20. </el-option>
  21. </el-select> -->
  22. </div>
  23. <div class="cell clearfix" v-if="weekTime == 'thisWeek' || weekTime == 'nextWeek' || weekTime == 'nextTwoWeek' ">
  24. <el-input
  25. size="small"
  26. style="width: 200px;"
  27. class="filter-item"
  28. v-model.trim="keywords"
  29. placeholder="病人名称/透析号"
  30. @keyup.enter.native='search'
  31. />
  32. <el-button
  33. size="small"
  34. class="filter-item"
  35. type="primary"
  36. icon="el-icon-search"
  37. @click="search"
  38. >搜索</el-button
  39. >
  40. </div>
  41. <el-dialog :visible.sync="searchTableVisible" width="80%">
  42. <el-table
  43. :data="schedulePatients"
  44. :header-cell-style="{
  45. backgroundColor: 'rgb(245, 247, 250)',
  46. color: '#606266'
  47. }"
  48. :row-style="{ color: '#303133' }"
  49. style="width: 100%"
  50. border
  51. >
  52. <el-table-column label="姓名" width="120">
  53. <template slot-scope="scope">
  54. {{ scope.row.patient }}
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="透析日期" width="200">
  58. <template slot-scope="scope">
  59. {{ getDialysisDate(scope.row) }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="分区">
  63. <template slot-scope="scope">
  64. {{ scope.row.zone.name }}
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="班次" width="80">
  68. <template slot-scope="scope">
  69. {{ getSchedulesType(scope.row.schedule_type) }}
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="机号" width="80">
  73. <template slot-scope="scope">
  74. {{ scope.row.number.number }}
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="透析模式" width="100">
  78. <template slot-scope="scope">
  79. {{ scope.row.mode.name }}
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="操作" align="center" width="300">
  83. <template slot-scope="scope">
  84. <el-button
  85. size="mini"
  86. type="primary"
  87. @click="CancelSchedule(scope.row.id)"
  88. >
  89. 取消排班
  90. </el-button>
  91. <el-button
  92. size="mini"
  93. type="primary"
  94. @click="changeMachineNumber(scope.$index, scope.row)"
  95. >
  96. 调整机号
  97. </el-button>
  98. <el-button
  99. size="mini"
  100. type="primary"
  101. @click="changeMode(scope.$index, scope.row)"
  102. >
  103. 调整模式
  104. </el-button>
  105. </template>
  106. </el-table-column>
  107. </el-table>
  108. </el-dialog>
  109. <el-table
  110. :row-style="{ color: '#303133' }"
  111. :header-cell-style="{
  112. backgroundColor: 'rgb(245, 247, 250)',
  113. color: '#606266'
  114. }"
  115. :data="scheduleZone"
  116. :span-method="objectSpanMethod"
  117. @cell-click="clickThis"
  118. @cell-mouse-enter="hoverMouse"
  119. :summary-method="getSummaries"
  120. show-summary
  121. :row-class-name="tableRowClassName"
  122. :cell-class-name="cellClass"
  123. sum-text="总数"
  124. :height="tableContainHeight"
  125. ref="table"
  126. style="width: 100%;cursor: pointer;"
  127. >
  128. <el-table-column
  129. prop="area"
  130. label="分区"
  131. width="80"
  132. align="center"
  133. fixed
  134. ></el-table-column>
  135. <el-table-column
  136. prop="cut"
  137. label="机号"
  138. width="80"
  139. align="center"
  140. fixed
  141. ></el-table-column>
  142. <el-table-column
  143. :label="'周一 (' + weekTitle[0] + ')'"
  144. width="215"
  145. align="center"
  146. >
  147. <el-table-column prop="Mon_M" label="上" width="70" align="center">
  148. <schedule-item
  149. slot-scope="scope"
  150. :schedule-detail="scope.row.Mon_M"
  151. ></schedule-item>
  152. </el-table-column>
  153. <el-table-column prop="Mon_A" label="下" width="70" align="center">
  154. <schedule-item
  155. slot-scope="scope"
  156. :schedule-detail="scope.row.Mon_A"
  157. ></schedule-item>
  158. </el-table-column>
  159. <el-table-column prop="Mon_N" label="晚" width="70" align="center">
  160. <schedule-item
  161. slot-scope="scope"
  162. :schedule-detail="scope.row.Mon_N"
  163. ></schedule-item>
  164. </el-table-column>
  165. </el-table-column>
  166. <el-table-column
  167. :label="'周二 (' + weekTitle[1] + ')'"
  168. width="215"
  169. align="center"
  170. >
  171. <el-table-column prop="Tue_M" label="上" width="70" align="center">
  172. <schedule-item
  173. slot-scope="scope"
  174. :schedule-detail="scope.row.Tue_M"
  175. ></schedule-item>
  176. </el-table-column>
  177. <el-table-column prop="Tue_A" label="下" width="70" align="center">
  178. <schedule-item
  179. slot-scope="scope"
  180. :schedule-detail="scope.row.Tue_A"
  181. ></schedule-item>
  182. </el-table-column>
  183. <el-table-column prop="Tue_N" label="晚" width="70" align="center">
  184. <schedule-item
  185. slot-scope="scope"
  186. :schedule-detail="scope.row.Tue_N"
  187. ></schedule-item>
  188. </el-table-column>
  189. </el-table-column>
  190. <el-table-column
  191. :label="'周三 (' + weekTitle[2] + ')'"
  192. width="215"
  193. align="center"
  194. >
  195. <el-table-column prop="Wed_M" label="上" width="70" align="center">
  196. <schedule-item
  197. slot-scope="scope"
  198. :schedule-detail="scope.row.Wed_M"
  199. ></schedule-item>
  200. </el-table-column>
  201. <el-table-column prop="Wed_A" label="下" width="70" align="center">
  202. <schedule-item
  203. slot-scope="scope"
  204. :schedule-detail="scope.row.Wed_A"
  205. ></schedule-item>
  206. </el-table-column>
  207. <el-table-column prop="Wed_N" label="晚" width="70" align="center">
  208. <schedule-item
  209. slot-scope="scope"
  210. :schedule-detail="scope.row.Wed_N"
  211. ></schedule-item>
  212. </el-table-column>
  213. </el-table-column>
  214. <el-table-column
  215. :label="'周四 (' + weekTitle[3] + ')'"
  216. width="215"
  217. align="center"
  218. >
  219. <el-table-column prop="Thurs_M" label="上" width="70" align="center">
  220. <schedule-item
  221. slot-scope="scope"
  222. :schedule-detail="scope.row.Thurs_M"
  223. ></schedule-item>
  224. </el-table-column>
  225. <el-table-column prop="Thurs_A" label="下" width="70" align="center">
  226. <schedule-item
  227. slot-scope="scope"
  228. :schedule-detail="scope.row.Thurs_A"
  229. ></schedule-item>
  230. </el-table-column>
  231. <el-table-column prop="Thurs_N" label="晚" width="70" align="center">
  232. <schedule-item
  233. slot-scope="scope"
  234. :schedule-detail="scope.row.Thurs_N"
  235. ></schedule-item>
  236. </el-table-column>
  237. </el-table-column>
  238. <el-table-column
  239. :label="'周五 (' + weekTitle[4] + ')'"
  240. width="215"
  241. align="center"
  242. >
  243. <el-table-column prop="Fri_M" label="上" width="70" align="center">
  244. <schedule-item
  245. slot-scope="scope"
  246. :schedule-detail="scope.row.Fri_M"
  247. ></schedule-item>
  248. </el-table-column>
  249. <el-table-column prop="Fri_A" label="下" width="70" align="center">
  250. <schedule-item
  251. slot-scope="scope"
  252. :schedule-detail="scope.row.Fri_A"
  253. ></schedule-item>
  254. </el-table-column>
  255. <el-table-column prop="Fri_N" label="晚" width="70" align="center">
  256. <schedule-item
  257. slot-scope="scope"
  258. :schedule-detail="scope.row.Fri_N"
  259. ></schedule-item>
  260. </el-table-column>
  261. </el-table-column>
  262. <el-table-column
  263. :label="'周六 (' + weekTitle[5] + ')'"
  264. width="215"
  265. align="center"
  266. >
  267. <el-table-column prop="Sat_M" label="上" width="70" align="center">
  268. <schedule-item
  269. slot-scope="scope"
  270. :schedule-detail="scope.row.Sat_M"
  271. ></schedule-item>
  272. </el-table-column>
  273. <el-table-column prop="Sat_A" label="下" width="70" align="center">
  274. <schedule-item
  275. slot-scope="scope"
  276. :schedule-detail="scope.row.Sat_A"
  277. ></schedule-item>
  278. </el-table-column>
  279. <el-table-column prop="Sat_N" label="晚" width="70" align="center">
  280. <schedule-item
  281. slot-scope="scope"
  282. :schedule-detail="scope.row.Sat_N"
  283. ></schedule-item>
  284. </el-table-column>
  285. </el-table-column>
  286. <el-table-column
  287. :label="'周日 (' + weekTitle[6] + ')'"
  288. min-width="215"
  289. align="center"
  290. >
  291. <el-table-column prop="Sun_M" label="上" min-width="70" align="center">
  292. <schedule-item
  293. slot-scope="scope"
  294. :schedule-detail="scope.row.Sun_M"
  295. ></schedule-item>
  296. </el-table-column>
  297. <el-table-column prop="Sun_A" label="下" min-width="70" align="center">
  298. <schedule-item
  299. slot-scope="scope"
  300. :schedule-detail="scope.row.Sun_A"
  301. ></schedule-item>
  302. </el-table-column>
  303. <el-table-column prop="Sun_N" label="晚" min-width="70" align="center">
  304. <schedule-item
  305. slot-scope="scope"
  306. :schedule-detail="scope.row.Sun_N"
  307. ></schedule-item>
  308. </el-table-column>
  309. </el-table-column>
  310. <el-table-column
  311. prop="total"
  312. label="总数"
  313. width="60"
  314. align="center"
  315. fixed="right"
  316. ></el-table-column>
  317. </el-table>
  318. <el-dialog
  319. title="排班"
  320. :visible.sync="dialogTableVisible"
  321. width="1000px;"
  322. :v-model="dialog"
  323. v-loading="creating_schedule"
  324. >
  325. <div>
  326. <div class="cell clearfix">
  327. <label class="title"><span class="name">当前排班</span> : </label>
  328. <div class="time ">
  329. <ul class="">
  330. <span class="current"
  331. >日期 : {{ currentData.schedule_date }} &nbsp;&nbsp; 班次 :
  332. {{ currentData.type_name }} &nbsp;&nbsp; 病房 :
  333. {{ currentData.zone_name }} &nbsp;&nbsp; 透析机 :
  334. {{ currentData.bed_name }}
  335. </span>
  336. </ul>
  337. </div>
  338. </div>
  339. <div class="cell clearfix">
  340. <label class="title"><span class="name">患者搜索</span> : </label>
  341. <div class="time ">
  342. <ul class="">
  343. <el-input
  344. size="medium"
  345. v-model="searchKey"
  346. placeholder="请输入搜索的内容"
  347. style="width:260px"
  348. @keyup.enter.native='SubmitSearch'
  349. ></el-input>
  350. <el-button
  351. type="primary"
  352. icon="el-icon-search"
  353. @click="SubmitSearch"
  354. >搜索</el-button
  355. >
  356. </ul>
  357. </div>
  358. </div>
  359. <div class="cell clearfix">
  360. <label class="title"><span class="name">排班</span> : </label>
  361. <div class="time ">
  362. <ul class="">
  363. <li
  364. v-for="item in schedulArr"
  365. @click="changeSearchSchedule(item.value)"
  366. :key="item.value"
  367. :class="patientQuery.schedule == item.value ? 'active' : ''"
  368. >
  369. {{ item.label }}
  370. </li>
  371. </ul>
  372. </div>
  373. </div>
  374. <!-- <div class="cell clearfix">
  375. <label class="title"><span class="name">标签</span> : </label>
  376. <div class="time ">
  377. <ul class="">
  378. <li v-for="item in tagArr" :key="item.value" >{{item.label}}</li>
  379. </ul>
  380. </div>
  381. </div> -->
  382. <div class="cell clearfix">
  383. <label class="title"><span class="name">传染病</span> : </label>
  384. <div class="time ">
  385. <ul class="">
  386. <li
  387. v-for="item in diseasesArr"
  388. @click="changeSearchContagion(item.value)"
  389. :key="item.value"
  390. :class="patientQuery.contagion == item.value ? 'active' : ''"
  391. >
  392. {{ item.label }}
  393. </li>
  394. </ul>
  395. </div>
  396. </div>
  397. </div>
  398. <el-table
  399. ref="singleTable"
  400. :data="patients"
  401. border
  402. highlight-current-row
  403. @current-change="handleCurrentChange"
  404. :header-cell-style="{ backgroundColor: 'rgb(236, 245, 255)' }"
  405. >
  406. <el-table-column
  407. type="index"
  408. label="序号"
  409. width="89"
  410. align="center"
  411. ></el-table-column>
  412. <el-table-column
  413. property="dialysis_no"
  414. label="透析号"
  415. min-width="110"
  416. align="center"
  417. ></el-table-column>
  418. <el-table-column
  419. property="name"
  420. label="姓名"
  421. min-width="110"
  422. align="center"
  423. ></el-table-column>
  424. <el-table-column
  425. property="schedules"
  426. label="双周已排"
  427. min-width="80"
  428. align="center"
  429. >
  430. <template slot-scope="scope">
  431. <span>{{ scope.row.schedules.length }}次</span>
  432. </template>
  433. </el-table-column>
  434. <el-table-column
  435. property="solutions"
  436. label="治疗频率"
  437. min-width="200"
  438. align="center"
  439. >
  440. <template slot-scope="scope">
  441. <span v-for="solution in scope.row.solutions" :key="solution.id"
  442. >{{ solution.name }}({{ solution.period }}{{ solution.times }})
  443. </span>
  444. </template>
  445. </el-table-column>
  446. <el-table-column
  447. property="sch_remark"
  448. label="备注"
  449. min-width="200"
  450. align="center"
  451. >
  452. </el-table-column>
  453. </el-table>
  454. <div slot="footer" class="dialog-footer">
  455. <el-button @click="closePatientPanel()">取 消</el-button>
  456. <el-button
  457. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  458. type="primary"
  459. @click="setSchedule"
  460. >保 存
  461. </el-button>
  462. </div>
  463. </el-dialog>
  464. <el-dialog title="调整排班" :visible.sync="tzDialogVisible" width="500px">
  465. <div style="width:100%;margin:0 auto">
  466. <el-radio-group v-model="tiaoZhengType" :class="tiaozhengclass">
  467. <el-radio :label="1">取消排班</el-radio>
  468. <el-radio :label="2">调整机号</el-radio>
  469. <el-radio :label="3">调整模式</el-radio>
  470. </el-radio-group>
  471. </div>
  472. <span slot="footer" class="dialog-footer">
  473. <el-button
  474. @click="
  475. tzDialogVisible = false;
  476. tiaoZhengType = 1;
  477. "
  478. >取 消</el-button
  479. >
  480. <el-button
  481. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  482. type="primary"
  483. @click="submitTiaoX"
  484. >
  485. <span v-if='tiaoZhengType == 1'>保存</span>
  486. <span v-if='tiaoZhengType == 2'>下一步</span>
  487. <span v-if='tiaoZhengType == 3'>下一步</span>
  488. </el-button>
  489. </span>
  490. </el-dialog>
  491. <el-dialog
  492. title="调整模式"
  493. :visible.sync="msDialogVisible"
  494. width="500px"
  495. v-loading="changing_mode"
  496. >
  497. <div>
  498. <el-form
  499. :model="changeSchedule"
  500. ref="changeSchedule"
  501. :rules="changeRules"
  502. >
  503. <el-form-item label="" prop="mode_id">
  504. <el-select
  505. v-model="changeSchedule.mode_id"
  506. placeholder="请选择"
  507. style="width:100%"
  508. >
  509. <el-option
  510. :disabled="item.id == currentData.mode_id"
  511. v-for="item in modeOptions"
  512. :key="item.id"
  513. :label="item.name"
  514. :value="item.id"
  515. >
  516. </el-option>
  517. </el-select>
  518. </el-form-item>
  519. </el-form>
  520. </div>
  521. <span slot="footer" class="dialog-footer">
  522. <el-button @click="msDialogVisible = false">取 消</el-button>
  523. <el-button
  524. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  525. type="primary"
  526. @click="submitMode('changeSchedule')"
  527. >保 存</el-button
  528. >
  529. </span>
  530. </el-dialog>
  531. <el-dialog
  532. title="调整机号"
  533. :visible.sync="jhDialogVisible"
  534. width="500px"
  535. v-loading="changing_bed"
  536. >
  537. <div>
  538. <el-form
  539. :model="changeSchedule"
  540. ref="changeSchedule"
  541. :rules="changeRules"
  542. label-width="90px"
  543. >
  544. <el-form-item label="排班日期: ">
  545. <el-input v-model="currentData.schedule_date" disabled></el-input>
  546. </el-form-item>
  547. <el-form-item label="班次: " prop="schedule_type">
  548. <el-select
  549. v-model="changeSchedule.schedule_type"
  550. placeholder="请选择"
  551. style="width:100%"
  552. @change="changeScheduleType"
  553. >
  554. <el-option
  555. v-for="item in scheduleType"
  556. :key="item.id"
  557. :label="item.name"
  558. :value="item.id"
  559. >
  560. </el-option>
  561. </el-select>
  562. </el-form-item>
  563. <el-form-item label="病房: " prop="partition_id">
  564. <el-select
  565. v-model="zone_name"
  566. placeholder="请选择"
  567. style="width:100%"
  568. @change="changePartition"
  569. >
  570. <el-option
  571. v-for="(item, index) in zone_names"
  572. :key="index"
  573. :label="item"
  574. :value="item"
  575. >
  576. </el-option>
  577. </el-select>
  578. </el-form-item>
  579. <el-form-item label="透析机: " prop="bed_id">
  580. <el-select
  581. v-model="device_id"
  582. placeholder="请选择"
  583. style="width:100%"
  584. >
  585. <el-option
  586. v-for="item in current_devices"
  587. :key="item.id"
  588. :label="item.number"
  589. :value="item.id"
  590. >
  591. </el-option>
  592. </el-select>
  593. </el-form-item>
  594. </el-form>
  595. </div>
  596. <span slot="footer" class="dialog-footer">
  597. <el-button @click="jhDialogVisible = false">取 消</el-button>
  598. <el-button
  599. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  600. type="primary"
  601. @click="submitTiaoZJH('changeSchedule')"
  602. >保 存</el-button
  603. >
  604. </span>
  605. </el-dialog>
  606. </div>
  607. </template>
  608. <script>
  609. import { uParseTime } from "@/utils/tools";
  610. import print from 'print-js'
  611. const moment = require('moment')
  612. import {
  613. CancelSchedule,
  614. ChangeSchedule,
  615. CreateSchedule,
  616. getSchedulePatients,
  617. getSchedulesOne,
  618. getSearchResult,
  619. getUrgentScheduleInitData,
  620. getWeekPanelsOne,
  621. getAllZones,
  622. } from "@/api/schedule";
  623. import ScheduleItem from "./ScheduleItem";
  624. let rowNumber = 0;
  625. export default {
  626. name: "tableData",
  627. props: {
  628. weekTime: {
  629. type: String,
  630. default: "thisWeek"
  631. },
  632. scheduleZoneRowProp: {
  633. type: Array,
  634. dafault: []
  635. },
  636. // scheduleZoneProp: {
  637. // type: Array,
  638. // dafault: []
  639. // },
  640. partitionsProp: {
  641. type: Object,
  642. dafault: {}
  643. }
  644. },
  645. data() {
  646. return {
  647. // tableContainHeight:400,
  648. // tableHeight:'window.innerHeight - 0',
  649. // rowClass: "table-row-new-class schedule-table-row",
  650. searchKey: "",
  651. tiaoZhengType: 1,
  652. modeOptions: null,
  653. keywords: "",
  654. schedulePatients: [],
  655. searchTableVisible: false,
  656. dialog: {
  657. tag: ""
  658. },
  659. patients: [],
  660. toDay: "",
  661. schedulArr: [
  662. { value: 0, label: "不限" },
  663. { value: 2, label: "未排班" },
  664. { value: 1, label: "已排班" }
  665. ],
  666. tagArr: [
  667. { value: 1, label: "不限" },
  668. { value: 2, label: "透析记录" },
  669. { value: 3, label: "传染病" }
  670. ],
  671. diseasesArr: [{ value: 0, label: "不限" }],
  672. scheduleType: [
  673. { id: 1, name: "上午" },
  674. { id: 2, name: "下午" },
  675. { id: 3, name: "晚上" }
  676. ],
  677. dialogTableVisible: false,
  678. tzDialogVisible: false,
  679. msDialogVisible: false,
  680. jhDialogVisible: false,
  681. // scheduleZone: this.scheduleZoneProp,
  682. scheduleZoneRow: -1,
  683. partitions: [],
  684. jihaos: [],
  685. weekTitle: ["", "", "", "", "", "", ""],
  686. weekList: ["", "", "", "", "", "", ""],
  687. weekDays: ["", "", "", "", "", "", ""],
  688. currentData: {
  689. id: 0,
  690. schedule_date: "",
  691. schedule_type: 0,
  692. bed_id: 0,
  693. partition_id: 0,
  694. patient_id: 0,
  695. schedule_week: 0,
  696. mode_id: 0,
  697. type_name: "",
  698. bed_name: "",
  699. partition_type: 0,
  700. contagions: [],
  701. patient: ""
  702. },
  703. changeSchedule: {
  704. mode_id: "",
  705. schedule_type: "",
  706. partition_id: "",
  707. bed_id: "",
  708. schedule_week: "",
  709. partition_type: ""
  710. },
  711. patientQuery: {
  712. keywords: "",
  713. schedule: 0,
  714. contagion: 0
  715. },
  716. tiaozhengclass: "tiaozhengclass",
  717. changeRules: {
  718. mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
  719. schedule_type: [
  720. { required: true, message: "请选择班次", trigger: "blur" }
  721. ],
  722. partition_id: [
  723. { required: true, message: "请选择病房", trigger: "blur" }
  724. ],
  725. bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }]
  726. },
  727. weekday: 0,
  728. creating_schedule: false,
  729. changing_mode: false,
  730. changing_bed: false,
  731. tableHeight: document.documentElement.clientHeight,
  732. origin_schedules: [],
  733. origin_device_numbers: [],
  734. zone_device_map: {},
  735. device_id: 0,
  736. zone_name: "",
  737. current_devices: [],
  738. zone_names: [],
  739. zone_device_options: [],
  740. options:[
  741. {id:0,name:"全部"},
  742. {id:1,name:"上午"},
  743. {id:2,name:"下午"},
  744. {id:3,name:"晚上"},
  745. ],
  746. partition_id:0,
  747. schedule_type:"",
  748. zones:[],
  749. theType:"",
  750. scheduleZone:[],
  751. theWeek: {
  752. lastWeek: 0,
  753. thisWeek: 0,
  754. nextWeek: 0,
  755. nextTwoWeek: 0
  756. },
  757. zoneIdList:[],
  758. strArr:"",
  759. patient_id_hover:0
  760. };
  761. },
  762. watch: {
  763. weekTime: function() {
  764. var theType = this.weekType(this.weekTime);
  765. // console.log("999999999",theType)
  766. this.theType = theType
  767. this.getSchedules();
  768. },
  769. scheduleZoneRow: function() {
  770. var theType = this.weekType(this.weekTime);
  771. this.theType = theType
  772. this.getSchedules();
  773. },
  774. tableHeight(val) {
  775. if (!this.timer) {
  776. this.tableHeight = val;
  777. this.timer = true;
  778. const that = this;
  779. setTimeout(function() {
  780. that.timer = false;
  781. }, 400);
  782. }
  783. }
  784. },
  785. methods: {
  786. compare(p){ //这是比较函数
  787. return function(m,n){
  788. var a = m[p];
  789. var b = n[p];
  790. return a - b; //升序
  791. }
  792. },
  793. getWeekPanels() {
  794. this.scheduleZone=[]
  795. var partionStr = this.partition_id
  796. var arr = this.zoneIdList.join(',')
  797. var str = ""
  798. if(partionStr == 0){
  799. str = arr
  800. }
  801. if(partionStr != 0){
  802. str = partionStr.join(',')
  803. }
  804. getWeekPanelsOne(1,str).then(response => {
  805. if (response.data.state == 0) {
  806. return false
  807. }
  808. var partitions = response.data.data.partitions
  809. console.log("partitions",partitions)
  810. this.theWeek.thisWeek = response.data.data.theWeek
  811. console.log("这个周",response.data.data.theWeek)
  812. this.theWeek.lastWeek = this.theWeek.thisWeek - 1
  813. this.theWeek.nextWeek = this.theWeek.thisWeek + 1
  814. this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2
  815. var that = this
  816. if (partitions.length > 0) {
  817. partitions.forEach(function(partition) {
  818. if (partition.jihaos.length == 0) {
  819. return false
  820. }
  821. that.scheduleZoneRow.push(partition.jihaos.length)
  822. that.partitions[partition.id] = partition
  823. partition.jihaos.forEach(function(jihao) {
  824. var thisPa = {
  825. area: partition.name,
  826. zone_id: partition.id,
  827. zone_type: partition.type,
  828. cut: jihao.number,
  829. jihao_id: jihao.id,
  830. sort:jihao.sort,
  831. Mon_M: {
  832. schedule_id: 0,
  833. mode_id: 0,
  834. mode_name: '',
  835. patient_id: 0,
  836. patient: ''
  837. },
  838. Mon_A: {
  839. schedule_id: 0,
  840. mode_id: 0,
  841. mode_name: '',
  842. patient_id: 0,
  843. patient: ''
  844. },
  845. Mon_N: {
  846. schedule_id: 0,
  847. mode_id: 0,
  848. mode_name: '',
  849. patient_id: 0,
  850. patient: ''
  851. },
  852. Tue_M: {
  853. schedule_id: 0,
  854. mode_id: 0,
  855. mode_name: '',
  856. patient_id: 0,
  857. patient: ''
  858. },
  859. Tue_A: {
  860. schedule_id: 0,
  861. mode_id: 0,
  862. mode_name: '',
  863. patient_id: 0,
  864. patient: ''
  865. },
  866. Tue_N: {
  867. schedule_id: 0,
  868. mode_id: 0,
  869. mode_name: '',
  870. patient_id: 0,
  871. patient: ''
  872. },
  873. Wed_M: {
  874. schedule_id: 0,
  875. mode_id: 0,
  876. mode_name: '',
  877. patient_id: 0,
  878. patient: ''
  879. },
  880. Wed_A: {
  881. schedule_id: 0,
  882. mode_id: 0,
  883. mode_name: '',
  884. patient_id: 0,
  885. patient: ''
  886. },
  887. Wed_N: {
  888. schedule_id: 0,
  889. mode_id: 0,
  890. mode_name: '',
  891. patient_id: 0,
  892. patient: ''
  893. },
  894. Thurs_M: {
  895. schedule_id: 0,
  896. mode_id: 0,
  897. mode_name: '',
  898. patient_id: 0,
  899. patient: ''
  900. },
  901. Thurs_A: {
  902. schedule_id: 0,
  903. mode_id: 0,
  904. mode_name: '',
  905. patient_id: 0,
  906. patient: ''
  907. },
  908. Thurs_N: {
  909. schedule_id: 0,
  910. mode_id: 0,
  911. mode_name: '',
  912. patient_id: 0,
  913. patient: ''
  914. },
  915. Fri_M: {
  916. schedule_id: 0,
  917. mode_id: 0,
  918. mode_name: '',
  919. patient_id: 0,
  920. patient: ''
  921. },
  922. Fri_A: {
  923. schedule_id: 0,
  924. mode_id: 0,
  925. mode_name: '',
  926. patient_id: 0,
  927. patient: ''
  928. },
  929. Fri_N: {
  930. schedule_id: 0,
  931. mode_id: 0,
  932. mode_name: '',
  933. patient_id: 0,
  934. patient: ''
  935. },
  936. Sat_M: {
  937. schedule_id: 0,
  938. mode_id: 0,
  939. mode_name: '',
  940. patient_id: 0,
  941. patient: ''
  942. },
  943. Sat_A: {
  944. schedule_id: 0,
  945. mode_id: 0,
  946. mode_name: '',
  947. patient_id: 0,
  948. patient: ''
  949. },
  950. Sat_N: {
  951. schedule_id: 0,
  952. mode_id: 0,
  953. mode_name: '',
  954. patient_id: 0,
  955. patient: ''
  956. },
  957. Sun_A: {
  958. schedule_id: 0,
  959. mode_id: 0,
  960. mode_name: '',
  961. patient_id: 0,
  962. patient: ''
  963. },
  964. Sun_N: {
  965. schedule_id: 0,
  966. mode_id: 0,
  967. mode_name: '',
  968. patient_id: 0,
  969. patient: ''
  970. },
  971. Sun_M: {
  972. schedule_id: 0,
  973. mode_id: 0,
  974. mode_name: '',
  975. patient_id: 0,
  976. patient: ''
  977. },
  978. total: 0
  979. }
  980. that.scheduleZone.push(thisPa)
  981. })
  982. })
  983. }
  984. console.log("34455555566666",this.scheduleZone)
  985. this.scheduleZone.sort(this.compare('sort'))
  986. })
  987. },
  988. cellClass({ row, column, rowIndex, columnIndex }) {
  989. if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
  990. return "";
  991. } else {
  992. if (this.weekTime == "lastWeek") {
  993. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  994. return 'hover-td schedule-table-cell-disable'
  995. }else {
  996. return 'schedule-table-cell-disable'
  997. }
  998. // return "schedule-table-cell-disable";
  999. } else if (this.weekTime == "thisWeek") {
  1000. var weekday = Math.floor((columnIndex - 2) / 3 + 1);
  1001. if (weekday < this.weekday) {
  1002. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1003. return 'hover-td schedule-table-cell-disable'
  1004. }else {
  1005. return 'schedule-table-cell-disable'
  1006. }
  1007. // return "schedule-table-cell-disable";
  1008. }else {
  1009. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1010. return 'hover-td'
  1011. }else {
  1012. return ''
  1013. }
  1014. }
  1015. }
  1016. }
  1017. return "";
  1018. },
  1019. SubmitSearch() {
  1020. this.patientQuery.keywords = this.searchKey;
  1021. this.getSchedulePatients();
  1022. },
  1023. changeSearchContagion(id) {
  1024. this.patientQuery.contagion = id;
  1025. this.getSchedulePatients();
  1026. },
  1027. changeSearchSchedule(id) {
  1028. this.patientQuery.schedule = id;
  1029. this.getSchedulePatients();
  1030. },
  1031. getSummaries(param) {
  1032. const { columns, data } = param;
  1033. const sums = [];
  1034. columns.forEach((column, index) => {
  1035. if (index === 0 || index === 25) {
  1036. sums[index] = "总数";
  1037. return;
  1038. }
  1039. if (index === 1 || index === 24) {
  1040. sums[index] = data.length;
  1041. return;
  1042. }
  1043. const values = data.map(item => item[column.property]);
  1044. if (index === 23) {
  1045. sums[index] = values.reduce((prev, curr) => {
  1046. const value = Number(curr);
  1047. if (!isNaN(value)) {
  1048. return prev + curr;
  1049. } else {
  1050. return prev;
  1051. }
  1052. }, 0);
  1053. sums[index];
  1054. return;
  1055. }
  1056. sums[index] = values.reduce((prev, curr) => {
  1057. if (typeof curr["mode_id"] === "undefined") {
  1058. return prev;
  1059. }
  1060. const value = Number(curr["mode_id"]);
  1061. if (!isNaN(value) && value > 0) {
  1062. return prev + 1;
  1063. } else {
  1064. return prev;
  1065. }
  1066. }, 0);
  1067. sums[index];
  1068. });
  1069. this.$nextTick(() => {
  1070. this.$refs.table.doLayout();
  1071. });
  1072. return sums;
  1073. },
  1074. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1075. var that = this;
  1076. var rowNum = 0;
  1077. rowNumber = 0;
  1078. var rutrnData = {};
  1079. if (columnIndex === 0 || columnIndex == 25) {
  1080. var rowLen = this.scheduleZoneRow.length;
  1081. if (rowLen > 0) {
  1082. for (let index = 0; index < rowLen; index++) {
  1083. rowNum = this.scheduleZoneRow[index];
  1084. rowNumber += rowNum;
  1085. var f = rowNumber - rowNum;
  1086. if (f == rowIndex) {
  1087. rutrnData = {
  1088. rowspan: rowNum,
  1089. colspan: 1
  1090. };
  1091. break;
  1092. } else if (rowIndex < rowNumber) {
  1093. rutrnData = {
  1094. rowspan: 0,
  1095. colspan: 0
  1096. };
  1097. break;
  1098. }
  1099. }
  1100. return rutrnData;
  1101. }
  1102. }
  1103. },
  1104. handleCurrentChange(row) {
  1105. if (typeof row === "undefined" || row == null) {
  1106. this.currentData.patient_id = 0;
  1107. this.currentData.contagions = [];
  1108. } else {
  1109. this.currentData.patient_id = row.id;
  1110. this.currentData.contagions = row.contagions;
  1111. }
  1112. },
  1113. closePatientPanel(row) {
  1114. this.dialogTableVisible = false;
  1115. this.$refs.singleTable.setCurrentRow(row);
  1116. this.currentData.patient_id = 0;
  1117. },
  1118. getSchedules() {
  1119. var partionStr = this.partition_id
  1120. var arr = this.zoneIdList.join(',')
  1121. var str = ""
  1122. if(partionStr == 0){
  1123. str = arr
  1124. }
  1125. if(partionStr != 0){
  1126. str = partionStr.join(',')
  1127. }
  1128. const params = {
  1129. weekTime:this.theType,
  1130. patitionid:str,
  1131. schedule_type:this.schedule_type,
  1132. }
  1133. getSchedulesOne(params).then(response => {
  1134. if (response.data.state == 1) {
  1135. this.weekTitle = response.data.data.weekTitle;
  1136. this.weekDays = response.data.data.days;
  1137. this.toDay = response.data.data.today;
  1138. var theSchedules = response.data.data.schdules;
  1139. var that = this;
  1140. this.scheduleZone.forEach(function(zone, index) {
  1141. that.scheduleZone[index].Mon_M = {
  1142. mode_id: 0,
  1143. mode_name: "",
  1144. patient_id: 0,
  1145. patient: ""
  1146. };
  1147. that.scheduleZone[index].Mon_A = {
  1148. mode_id: 0,
  1149. mode_name: "",
  1150. patient_id: 0,
  1151. patient: ""
  1152. };
  1153. that.scheduleZone[index].Mon_N = {
  1154. mode_id: 0,
  1155. mode_name: "",
  1156. patient_id: 0,
  1157. patient: ""
  1158. };
  1159. that.scheduleZone[index].Tue_M = {
  1160. mode_id: 0,
  1161. mode_name: "",
  1162. patient_id: 0,
  1163. patient: ""
  1164. };
  1165. that.scheduleZone[index].Tue_A = {
  1166. mode_id: 0,
  1167. mode_name: "",
  1168. patient_id: 0,
  1169. patient: ""
  1170. };
  1171. that.scheduleZone[index].Tue_N = {
  1172. mode_id: 0,
  1173. mode_name: "",
  1174. patient_id: 0,
  1175. patient: ""
  1176. };
  1177. that.scheduleZone[index].Wed_M = {
  1178. mode_id: 0,
  1179. mode_name: "",
  1180. patient_id: 0,
  1181. patient: ""
  1182. };
  1183. that.scheduleZone[index].Wed_A = {
  1184. mode_id: 0,
  1185. mode_name: "",
  1186. patient_id: 0,
  1187. patient: ""
  1188. };
  1189. that.scheduleZone[index].Wed_N = {
  1190. mode_id: 0,
  1191. mode_name: "",
  1192. patient_id: 0,
  1193. patient: ""
  1194. };
  1195. that.scheduleZone[index].Thurs_M = {
  1196. mode_id: 0,
  1197. mode_name: "",
  1198. patient_id: 0,
  1199. patient: ""
  1200. };
  1201. that.scheduleZone[index].Thurs_A = {
  1202. mode_id: 0,
  1203. mode_name: "",
  1204. patient_id: 0,
  1205. patient: ""
  1206. };
  1207. that.scheduleZone[index].Thurs_N = {
  1208. mode_id: 0,
  1209. mode_name: "",
  1210. patient_id: 0,
  1211. patient: ""
  1212. };
  1213. that.scheduleZone[index].Fri_M = {
  1214. mode_id: 0,
  1215. mode_name: "",
  1216. patient_id: 0,
  1217. patient: ""
  1218. };
  1219. that.scheduleZone[index].Fri_A = {
  1220. mode_id: 0,
  1221. mode_name: "",
  1222. patient_id: 0,
  1223. patient: ""
  1224. };
  1225. that.scheduleZone[index].Fri_N = {
  1226. mode_id: 0,
  1227. mode_name: "",
  1228. patient_id: 0,
  1229. patient: ""
  1230. };
  1231. that.scheduleZone[index].Sat_M = {
  1232. mode_id: 0,
  1233. mode_name: "",
  1234. patient_id: 0,
  1235. patient: ""
  1236. };
  1237. that.scheduleZone[index].Sat_A = {
  1238. mode_id: 0,
  1239. mode_name: "",
  1240. patient_id: 0,
  1241. patient: ""
  1242. };
  1243. that.scheduleZone[index].Sat_N = {
  1244. mode_id: 0,
  1245. mode_name: "",
  1246. patient_id: 0,
  1247. patient: ""
  1248. };
  1249. that.scheduleZone[index].Sun_A = {
  1250. mode_id: 0,
  1251. mode_name: "",
  1252. patient_id: 0,
  1253. patient: ""
  1254. };
  1255. that.scheduleZone[index].Sun_N = {
  1256. mode_id: 0,
  1257. mode_name: "",
  1258. patient_id: 0,
  1259. patient: ""
  1260. };
  1261. that.scheduleZone[index].Sun_M = {
  1262. mode_id: 0,
  1263. mode_name: "",
  1264. patient_id: 0,
  1265. patient: ""
  1266. };
  1267. that.scheduleZone[index].total = 0;
  1268. if (response.data.data.schdules.length > 0) {
  1269. theSchedules.forEach(function(schedule, sindex) {
  1270. if (zone.jihao_id == schedule.bed_id) {
  1271. var weekPath = that.weekPath(
  1272. schedule.schedule_week,
  1273. schedule.schedule_type
  1274. );
  1275. if (weekPath.length == 2) {
  1276. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1277. that.scheduleZone[index][weekPathKey] = {
  1278. schedule_id: schedule.id,
  1279. mode_id: schedule.mode_id,
  1280. patient_id: schedule.patient_id,
  1281. patient: schedule.patient,
  1282. patient_contagions: schedule.patient_contagions,
  1283. mode_name:
  1284. typeof that.modeOptions[schedule.mode_id] ===
  1285. "undefined"
  1286. ? ""
  1287. : that.modeOptions[schedule.mode_id].name
  1288. };
  1289. that.scheduleZone[index].total += 1;
  1290. }
  1291. }
  1292. });
  1293. }
  1294. });
  1295. } else {
  1296. this.$message.error("网络错误");
  1297. return false;
  1298. }
  1299. });
  1300. },
  1301. getSchedulePatients() {
  1302. getSchedulePatients(this.patientQuery).then(response => {
  1303. if (response.data.state == 1) {
  1304. this.patients = response.data.data.patients;
  1305. }
  1306. });
  1307. },
  1308. CancelSchedule(id) {
  1309. this.$confirm("确定要取消当前排班?", "提示", {
  1310. confirmButtonText: "确定",
  1311. cancelButtonText: "取消",
  1312. type: "warning"
  1313. })
  1314. .then(() => {
  1315. CancelSchedule(id).then(response => {
  1316. if (response.data.state == 0) {
  1317. this.$message.error(response.data.msg);
  1318. } else {
  1319. this.$message({
  1320. type: "success",
  1321. message: "排班已取消!"
  1322. });
  1323. var that = this;
  1324. var schedule = response.data.data.schedule;
  1325. this.scheduleZone.forEach(function(zone, index) {
  1326. if (
  1327. zone.zone_id == schedule.partition_id &&
  1328. zone.jihao_id == schedule.bed_id
  1329. ) {
  1330. var weekPath = that.weekPath(
  1331. schedule.schedule_week,
  1332. schedule.schedule_type
  1333. );
  1334. if (weekPath.length == 2) {
  1335. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1336. that.scheduleZone[index][weekPathKey] = {
  1337. schedule_id: 0,
  1338. mode_id: 0,
  1339. patient_id: 0,
  1340. patient: "",
  1341. mode_name: ""
  1342. };
  1343. that.scheduleZone[index].total -= 1;
  1344. }
  1345. }
  1346. });
  1347. this.tzDialogVisible = false;
  1348. this.searchTableVisible = false;
  1349. }
  1350. });
  1351. })
  1352. .catch(() => {});
  1353. },
  1354. changeScheduleActon(formName) {
  1355. this.changing_bed = true;
  1356. ChangeSchedule(this.currentData.id, this.changeSchedule)
  1357. .then(response => {
  1358. if (response.data.state == 0) {
  1359. this.$message.error(response.data.msg);
  1360. } else {
  1361. this.$message({
  1362. type: "success",
  1363. message: "修改成功!"
  1364. });
  1365. var that = this;
  1366. var schedule = response.data.data.schedule;
  1367. this.scheduleZone.forEach(function(zone, index) {
  1368. if (
  1369. zone.zone_id == schedule.partition_id &&
  1370. zone.jihao_id == schedule.bed_id
  1371. ) {
  1372. var weekPath = that.weekPath(
  1373. schedule.schedule_week,
  1374. schedule.schedule_type
  1375. );
  1376. if (weekPath.length == 2) {
  1377. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1378. that.scheduleZone[index][weekPathKey] = {
  1379. schedule_id: schedule.id,
  1380. mode_id: schedule.mode_id,
  1381. patient_id: schedule.patient_id,
  1382. patient: that.currentData.patient,
  1383. patient_contagions: that.currentData.contagions,
  1384. mode_name:
  1385. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1386. ? ""
  1387. : that.modeOptions[schedule.mode_id].name
  1388. };
  1389. that.scheduleZone[index].total += 1;
  1390. }
  1391. }
  1392. if (
  1393. zone.zone_id == that.currentData.partition_id &&
  1394. zone.jihao_id == that.currentData.bed_id
  1395. ) {
  1396. var weekPath = that.weekPath(
  1397. that.currentData.schedule_week,
  1398. that.currentData.schedule_type
  1399. );
  1400. if (weekPath.length == 2) {
  1401. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1402. that.scheduleZone[index][weekPathKey] = {
  1403. schedule_id: 0,
  1404. mode_id: 0,
  1405. patient_id: 0,
  1406. patient: "",
  1407. mode_name: "",
  1408. patient_contagions: []
  1409. };
  1410. that.scheduleZone[index].total -= 1;
  1411. }
  1412. }
  1413. });
  1414. this.$refs[formName].resetFields();
  1415. this.jhDialogVisible = false;
  1416. }
  1417. this.changing_bed = false;
  1418. })
  1419. .catch(err => {
  1420. this.$message.error(err);
  1421. this.changing_bed = false;
  1422. });
  1423. },
  1424. CreateSchedule(id, data) {
  1425. this.creating_schedule = true;
  1426. CreateSchedule(id, data)
  1427. .then(response => {
  1428. if (response.data.state == 0) {
  1429. this.$message.error(response.data.msg);
  1430. } else {
  1431. this.$message({
  1432. type: "success",
  1433. message: "排班成功!"
  1434. });
  1435. var that = this;
  1436. var schedule = response.data.data.schedule;
  1437. this.scheduleZone.forEach(function(zone, index) {
  1438. if (
  1439. zone.zone_id == schedule.partition_id &&
  1440. zone.jihao_id == schedule.bed_id
  1441. ) {
  1442. var weekPath = that.weekPath(
  1443. schedule.schedule_week,
  1444. schedule.schedule_type
  1445. );
  1446. if (weekPath.length == 2) {
  1447. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1448. that.scheduleZone[index][weekPathKey] = {
  1449. schedule_id: schedule.id,
  1450. mode_id: schedule.mode_id,
  1451. patient_id: schedule.patient_id,
  1452. patient: schedule.patient,
  1453. patient_contagions: that.currentData.contagions,
  1454. mode_name:
  1455. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1456. ? ""
  1457. : that.modeOptions[schedule.mode_id].name
  1458. };
  1459. that.scheduleZone[index].total += 1;
  1460. }
  1461. }
  1462. });
  1463. this.closePatientPanel();
  1464. }
  1465. this.creating_schedule = false;
  1466. })
  1467. .catch(err => {
  1468. this.$message.error(err);
  1469. this.creating_schedule = false;
  1470. });
  1471. },
  1472. hoverMouse(row, column, cell, event){
  1473. if (row[column.property].schedule_id > 0) {
  1474. let patient_id = row[column.property].patient_id
  1475. this.patient_id_hover = patient_id
  1476. } else {
  1477. this.patient_id_hover = -1
  1478. }
  1479. },
  1480. clickThis(row, column, cell, event) {
  1481. // debugger
  1482. var week = this.weekDay(column.property);
  1483. if (week[0] == -1 || week[1] == -1) {
  1484. return false;
  1485. }
  1486. if (this.toDay > this.weekDays[week[0] - 1]) {
  1487. return false;
  1488. }
  1489. this.currentData.schedule_date = this.weekDays[week[0] - 1];
  1490. this.currentData.schedule_type = week[1];
  1491. this.currentData.bed_id = row.jihao_id;
  1492. this.currentData.partition_id = row.zone_id;
  1493. this.currentData.schedule_week = week[0];
  1494. this.currentData.type_name = this.dayType(week[1]);
  1495. this.currentData.zone_name = row.area;
  1496. this.currentData.bed_name = row.cut;
  1497. this.currentData.partition_type = row.zone_type;
  1498. if (row[column.property].schedule_id > 0) {
  1499. this.currentData.mode_id = row[column.property].mode_id;
  1500. this.currentData.id = row[column.property].schedule_id;
  1501. this.currentData.patient_id = row[column.property].patient_id;
  1502. this.currentData.patient = row[column.property].patient;
  1503. this.currentData.contagions = row[column.property].patient_contagions;
  1504. this.tiaoZhengType = 1;
  1505. this.tzDialogVisible = true;
  1506. } else {
  1507. this.currentData.mode_id = 1;
  1508. this.currentData.id = 0;
  1509. this.currentData.patient_id = 0;
  1510. this.currentData.patient = "";
  1511. this.currentData.contagions = [];
  1512. this.getSchedulePatients();
  1513. this.dialogTableVisible = true;
  1514. }
  1515. },
  1516. submitTiaoZJH(formName) {
  1517. this.$refs[formName].validate(valid => {
  1518. if (valid) {
  1519. var weekPath = this.weekPath(
  1520. this.changeSchedule.schedule_week,
  1521. this.changeSchedule.schedule_type
  1522. );
  1523. if (weekPath.length != 2) {
  1524. this.$message.error("数据异常");
  1525. return false;
  1526. }
  1527. this.changeSchedule.bed_id = this.device_id;
  1528. for (let i = 0; i < this.origin_device_numbers.length; i++) {
  1529. if (this.origin_device_numbers[i].id == this.device_id) {
  1530. this.changeSchedule.partition_id = this.origin_device_numbers[
  1531. i
  1532. ].zone_id;
  1533. }
  1534. }
  1535. this.changeSchedule.change_action = "change_device";
  1536. this.changeScheduleActon(formName);
  1537. // this.changeSchedule.spartition_type = this.scheduleZone[index].zone_type
  1538. // var weekPathKey = weekPath[0] + '_' + weekPath[1]
  1539. // for (var index in this.scheduleZone) {
  1540. // if (this.scheduleZone[index].jihao_id == this.changeSchedule.bed_id) {
  1541. // if (this.scheduleZone[index][weekPathKey].mode_id > 0) {
  1542. // this.$message.error('选中的区域已经存在排班,不能再排班!')
  1543. // return false
  1544. // }
  1545. // break
  1546. // }
  1547. // }
  1548. // 可能
  1549. // 患者有传染病,与选择的机器类型(传染病)不匹配
  1550. // 患者没有传染病,但机器是某个传染病的专用透析器
  1551. // 机器的透析模式与患者不匹配
  1552. // if (this.currentData.contagions.length > 0) {
  1553. // var cflag = false
  1554. // for (var index in this.currentData.contagions) {
  1555. // if (this.currentData.contagions[index].disease_id == this.changeSchedule.partition_type) {
  1556. // cflag = true
  1557. // }
  1558. // }
  1559. // if (!cflag) {
  1560. // this.$confirm('此患者有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
  1561. // .then(() => {
  1562. //
  1563. // }).catch(() => {
  1564. // })
  1565. // } else {
  1566. // this.changeSchedule.change_action = 'change_device'
  1567. // this.changeScheduleActon(formName)
  1568. // }
  1569. // } else if (this.changeSchedule.partition_type > 1) {
  1570. // this.$confirm('此患者没有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
  1571. // .then(() => {
  1572. // this.changeSchedule.change_action = 'change_device'
  1573. // this.changeScheduleActon(formName)
  1574. // }).catch(() => {
  1575. // })
  1576. // } else {
  1577. // this.changeSchedule.change_action = 'change_device'
  1578. // this.changeScheduleActon(formName)
  1579. // }
  1580. }
  1581. });
  1582. },
  1583. submitMode(formName) {
  1584. this.changing_mode = true;
  1585. this.changeSchedule.change_action = "change_mode";
  1586. ChangeSchedule(this.currentData.id, this.changeSchedule)
  1587. .then(response => {
  1588. if (response.data.state == 0) {
  1589. this.$message.error(response.data.msg);
  1590. } else {
  1591. this.$message({
  1592. type: "success",
  1593. message: "修改成功!"
  1594. });
  1595. var that = this;
  1596. var schedule = response.data.data.schedule;
  1597. this.scheduleZone.forEach(function(zone, index) {
  1598. if (
  1599. zone.zone_id == schedule.partition_id &&
  1600. zone.jihao_id == schedule.bed_id
  1601. ) {
  1602. var weekPath = that.weekPath(
  1603. schedule.schedule_week,
  1604. schedule.schedule_type
  1605. );
  1606. if (weekPath.length == 2) {
  1607. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1608. that.scheduleZone[index][weekPathKey].mode_id =
  1609. schedule.mode_id;
  1610. that.scheduleZone[index][weekPathKey].mode_name =
  1611. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1612. ? ""
  1613. : that.modeOptions[schedule.mode_id].name;
  1614. }
  1615. }
  1616. });
  1617. this.msDialogVisible = false;
  1618. }
  1619. this.changing_mode = false;
  1620. })
  1621. .catch(err => {
  1622. this.$message.error(err);
  1623. this.changing_mode = false;
  1624. });
  1625. },
  1626. submitTiaoZMS(formName) {
  1627. this.$refs[formName].validate(valid => {
  1628. if (valid) {
  1629. this.changing_mode = true;
  1630. this.changeSchedule.change_action = "change_mode";
  1631. ChangeSchedule(this.currentData.id, this.changeSchedule)
  1632. .then(response => {
  1633. if (response.data.state == 0) {
  1634. this.$message.error(response.data.msg);
  1635. } else {
  1636. this.$message({
  1637. type: "success",
  1638. message: "修改成功!"
  1639. });
  1640. var that = this;
  1641. var schedule = response.data.data.schedule;
  1642. this.scheduleZone.forEach(function(zone, index) {
  1643. if (
  1644. zone.zone_id == schedule.partition_id &&
  1645. zone.jihao_id == schedule.bed_id
  1646. ) {
  1647. var weekPath = that.weekPath(
  1648. schedule.schedule_week,
  1649. schedule.schedule_type
  1650. );
  1651. if (weekPath.length == 2) {
  1652. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1653. that.scheduleZone[index][weekPathKey].mode_id =
  1654. schedule.mode_id;
  1655. that.scheduleZone[index][weekPathKey].mode_name =
  1656. typeof that.modeOptions[schedule.mode_id] ===
  1657. "undefined"
  1658. ? ""
  1659. : that.modeOptions[schedule.mode_id].name;
  1660. }
  1661. }
  1662. });
  1663. this.$refs[formName].resetFields();
  1664. this.msDialogVisible = false;
  1665. }
  1666. this.changing_mode = false;
  1667. })
  1668. .catch(err => {
  1669. this.$message.error(err);
  1670. this.changing_mode = false;
  1671. });
  1672. }
  1673. });
  1674. },
  1675. changePartition(value) {
  1676. this.current_devices = this.zone_device_map[value];
  1677. this.device_id = this.current_devices[0].id;
  1678. },
  1679. changeScheduleType(schedule_type) {
  1680. const params = {
  1681. type: schedule_type,
  1682. date: this.currentData.schedule_date
  1683. };
  1684. getUrgentScheduleInitData(params)
  1685. .then(rs => {
  1686. if (rs.data.state == 1) {
  1687. this.origin_schedules = rs.data.data.schedules;
  1688. this.origin_device_numbers = rs.data.data.device_numbers;
  1689. var zone_device_map = {};
  1690. for (
  1691. let index = 0;
  1692. index < this.origin_device_numbers.length;
  1693. index++
  1694. ) {
  1695. const device_number = this.origin_device_numbers[index];
  1696. if (
  1697. zone_device_map[device_number.zone_name] == null ||
  1698. zone_device_map[device_number.zone_name] == undefined
  1699. ) {
  1700. zone_device_map[device_number.zone_name] = [];
  1701. }
  1702. zone_device_map[device_number.zone_name].push(device_number);
  1703. }
  1704. this.zone_device_map = zone_device_map;
  1705. this.zone_names = Object.keys(this.zone_device_map);
  1706. // console.log('8989898989898989',this.zone_names)
  1707. // console.log(this.current_devices);
  1708. if (this.zone_names.length > 0) {
  1709. this.zone_name = this.zone_names[0];
  1710. this.current_devices = this.zone_device_map[this.zone_name];
  1711. this.device_id = this.current_devices[0].id;
  1712. }
  1713. this.zone_device_options = [
  1714. { values: this.zone_names },
  1715. // { values: this.getDeviceNumberNames(this.current_devices) },
  1716. { values: this.current_devices }
  1717. ];
  1718. } else {
  1719. }
  1720. })
  1721. .catch(err => {
  1722. this.loading = false;
  1723. });
  1724. },
  1725. submitTiaoX() {
  1726. // if (this.tiaoZhengType==1) {
  1727. // this.$confirm('确定要取消当前排班?', '提示', {
  1728. // confirmButtonText: '确定',
  1729. // cancelButtonText: '取消',
  1730. // type: 'warning'
  1731. // }).then(() => {
  1732. // this.CancelSchedule(this.currentData.id);
  1733. // }).catch(() => {});
  1734. // }
  1735. switch (this.tiaoZhengType) {
  1736. case 1:
  1737. this.CancelSchedule(this.currentData.id);
  1738. break;
  1739. case 2:
  1740. this.changeSchedule = {
  1741. mode_id: this.currentData.mode_id,
  1742. schedule_type: this.currentData.schedule_type,
  1743. partition_id: this.currentData.partition_id,
  1744. bed_id: this.currentData.bed_id,
  1745. schedule_week: this.currentData.schedule_week,
  1746. partition_type: ""
  1747. };
  1748. if (
  1749. typeof this.partitions[this.currentData.partition_id].jihaos !==
  1750. "undefined"
  1751. ) {
  1752. this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
  1753. } else {
  1754. this.jihaos = [];
  1755. }
  1756. const params = {
  1757. type: this.currentData.schedule_type,
  1758. date: this.currentData.schedule_date
  1759. };
  1760. getUrgentScheduleInitData(params)
  1761. .then(response => {
  1762. if (response.data.state == 0) {
  1763. this.$message.error(response.data.msg);
  1764. } else {
  1765. if (response.data.state == 1) {
  1766. this.origin_schedules = response.data.data.schedules;
  1767. this.origin_device_numbers =
  1768. response.data.data.device_numbers;
  1769. var zone_device_map = {};
  1770. for (
  1771. let index = 0;
  1772. index < this.origin_device_numbers.length;
  1773. index++
  1774. ) {
  1775. const device_number = this.origin_device_numbers[index];
  1776. if (
  1777. zone_device_map[device_number.zone_name] == null ||
  1778. zone_device_map[device_number.zone_name] == undefined
  1779. ) {
  1780. zone_device_map[device_number.zone_name] = [];
  1781. }
  1782. zone_device_map[device_number.zone_name].push(
  1783. device_number
  1784. );
  1785. }
  1786. this.zone_device_map = zone_device_map;
  1787. this.zone_names = Object.keys(this.zone_device_map);
  1788. if (this.zone_names.length > 0) {
  1789. this.zone_name = this.zone_names[0];
  1790. this.current_devices = this.zone_device_map[this.zone_name];
  1791. this.device_id = this.current_devices[0].id;
  1792. }
  1793. this.zone_device_options = [
  1794. { values: this.zone_names },
  1795. // { values: this.getDeviceNumberNames(this.current_devices) },
  1796. { values: this.current_devices }
  1797. ];
  1798. //
  1799. // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
  1800. // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
  1801. // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
  1802. // this.origin_device_numbers.splice(y, 1)
  1803. // }
  1804. // }
  1805. // }
  1806. // // debugger
  1807. // var zone_device_map = {}
  1808. // for (let index = 0; index < this.origin_device_numbers.length; index++) {
  1809. // const device_number = this.origin_device_numbers[index]
  1810. // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
  1811. // zone_device_map[device_number.zone.name] = []
  1812. // }
  1813. // zone_device_map[device_number.zone.name].push(device_number)
  1814. // }
  1815. // this.zone_device_map = zone_device_map
  1816. //
  1817. // this.zone_names = Object.keys(this.zone_device_map)
  1818. // if (this.zone_names.length > 0) {
  1819. // this.zone_name = this.zone_names[0]
  1820. // this.current_devices = this.zone_device_map[this.zone_name]
  1821. // this.device_id = this.current_devices[0].id
  1822. // }
  1823. //
  1824. // this.zone_device_options = [
  1825. // { values: this.zone_names },
  1826. // // { values: this.getDeviceNumberNames(this.current_devices) },
  1827. // { values: this.current_devices }
  1828. // ]
  1829. } else {
  1830. }
  1831. }
  1832. })
  1833. .catch(err => {
  1834. this.$message.error(err);
  1835. });
  1836. this.tzDialogVisible = false;
  1837. this.jhDialogVisible = true;
  1838. break;
  1839. case 3:
  1840. this.changeSchedule = {
  1841. mode_id: "",
  1842. schedule_type: "",
  1843. partition_id: "",
  1844. bed_id: "",
  1845. schedule_week: "",
  1846. partition_type: ""
  1847. };
  1848. this.tzDialogVisible = false;
  1849. this.msDialogVisible = true;
  1850. break;
  1851. default:
  1852. break;
  1853. }
  1854. },
  1855. setSchedule() {
  1856. var that = this;
  1857. var submitFlag = true;
  1858. if (this.currentData.patient_id <= 0) {
  1859. this.$message.error("请先选择患者");
  1860. return false;
  1861. }
  1862. if (
  1863. this.currentData.schedule_date.length == 0 ||
  1864. this.currentData.schedule_type < 1 ||
  1865. this.currentData.schedule_type > 3 ||
  1866. this.currentData.bed_id < 1 ||
  1867. this.currentData.partition_id < 1 ||
  1868. this.currentData.schedule_week < 1 ||
  1869. this.currentData.schedule_week > 7
  1870. ) {
  1871. this.$message.error("请先选择排班时间或机号");
  1872. return false;
  1873. }
  1874. // 可能
  1875. // 患者有传染病,与选择的机器类型(传染病)不匹配
  1876. // 患者没有传染病,但机器是某个传染病的专用透析器
  1877. // 机器的透析模式与患者不匹配
  1878. if (this.currentData.contagions.length > 0) {
  1879. var cflag = false;
  1880. this.currentData.contagions.forEach(function(contagion) {
  1881. if (contagion.disease_id == that.currentData.partition_type) {
  1882. cflag = true;
  1883. }
  1884. });
  1885. if (!cflag) {
  1886. this.$confirm(
  1887. "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
  1888. "提示",
  1889. {
  1890. confirmButtonText: "确 定",
  1891. cancelButtonText: "取 消",
  1892. type: "warning"
  1893. }
  1894. )
  1895. .then(() => {
  1896. this.CreateSchedule(
  1897. this.currentData.patient_id,
  1898. this.currentData
  1899. );
  1900. })
  1901. .catch(() => {});
  1902. } else {
  1903. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  1904. }
  1905. } else if (that.currentData.partition_type > 1) {
  1906. this.$confirm(
  1907. "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
  1908. "提示",
  1909. {
  1910. confirmButtonText: "确 定",
  1911. cancelButtonText: "取 消",
  1912. type: "warning"
  1913. }
  1914. )
  1915. .then(() => {
  1916. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  1917. })
  1918. .catch(() => {});
  1919. } else {
  1920. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  1921. }
  1922. },
  1923. weekType(weekTime) {
  1924. var theType = 2;
  1925. switch (weekTime) {
  1926. case "lastWeek":
  1927. theType = 1;
  1928. break;
  1929. case "thisWeek":
  1930. theType = 2;
  1931. break;
  1932. case "nextWeek":
  1933. theType = 3;
  1934. break;
  1935. case "nextTwoWeek":
  1936. theType = 4;
  1937. break;
  1938. default:
  1939. theType = 2;
  1940. break;
  1941. }
  1942. return theType;
  1943. },
  1944. dayType(theType) {
  1945. var jType = "";
  1946. switch (theType) {
  1947. case 1:
  1948. jType = "上午";
  1949. break;
  1950. case 2:
  1951. jType = "下午";
  1952. break;
  1953. case 3:
  1954. jType = "晚上";
  1955. break;
  1956. default:
  1957. break;
  1958. }
  1959. return jType;
  1960. },
  1961. weekPath(week, schedule_type) {
  1962. var weekArr = {
  1963. 1: "Mon",
  1964. 2: "Tue",
  1965. 3: "Wed",
  1966. 4: "Thurs",
  1967. 5: "Fri",
  1968. 6: "Sat",
  1969. 7: "Sun"
  1970. };
  1971. var typeArr = { 1: "M", 2: "A", 3: "N" };
  1972. if (
  1973. typeof weekArr[week] === "undefined" ||
  1974. typeof typeArr[schedule_type] === "undefined"
  1975. ) {
  1976. return [];
  1977. }
  1978. return [weekArr[week], typeArr[schedule_type]];
  1979. },
  1980. weekDay(prop) {
  1981. var week = prop.split("_");
  1982. if (week.length != 2) {
  1983. return [-1, -1];
  1984. }
  1985. var w = -1;
  1986. var n = -1;
  1987. switch (week[0]) {
  1988. case "Mon":
  1989. w = 1;
  1990. break;
  1991. case "Tue":
  1992. w = 2;
  1993. break;
  1994. case "Wed":
  1995. w = 3;
  1996. break;
  1997. case "Thurs":
  1998. w = 4;
  1999. break;
  2000. case "Fri":
  2001. w = 5;
  2002. break;
  2003. case "Sat":
  2004. w = 6;
  2005. break;
  2006. case "Sun":
  2007. w = 7;
  2008. break;
  2009. default:
  2010. w = -1;
  2011. break;
  2012. }
  2013. switch (week[1]) {
  2014. case "M":
  2015. n = 1;
  2016. break;
  2017. case "A":
  2018. n = 2;
  2019. break;
  2020. case "N":
  2021. n = 3;
  2022. break;
  2023. default:
  2024. n = -1;
  2025. break;
  2026. }
  2027. if (w == -1 || n == -1) {
  2028. return [-1, -1];
  2029. }
  2030. return [w, n];
  2031. },
  2032. search: function() {
  2033. let week_type = 0
  2034. var weeklist = moment().format('E');//计算今天是这周第几天
  2035. var first_monday = moment().subtract(weeklist-1, 'days').format('YYYY-MM-DD');//周一日期
  2036. var end_monday = moment().add(7-weeklist, 'days').format('YYYY-MM-DD')
  2037. if (this.weekTime == 'thisWeek'){
  2038. week_type = 1
  2039. }else if(this.weekTime == 'nextWeek'){
  2040. week_type = 2
  2041. }else if(this.weekTime == 'nextTwoWeek'){
  2042. week_type = 3
  2043. }
  2044. const params = {
  2045. keywords: this.keywords,
  2046. week_type: week_type,
  2047. start_sch:first_monday,
  2048. end_sch:end_monday,
  2049. };
  2050. console.log("params",params)
  2051. getSearchResult(params).then(response => {
  2052. if (response.data.state == 1) {
  2053. this.schedulePatients = response.data.data.schdules;
  2054. this.searchTableVisible = true;
  2055. }
  2056. });
  2057. },
  2058. changeMachineNumber: function(index, row) {
  2059. this.currentData.schedule_type = row.schedule_type;
  2060. this.currentData.bed_id = row.bed_id;
  2061. this.currentData.partition_id = row.partition_id;
  2062. this.currentData.schedule_week = row.schedule_week;
  2063. switch (row.schedule_type) {
  2064. case 1:
  2065. this.currentData.type_name = "上午";
  2066. break;
  2067. case 2:
  2068. this.currentData.type_name = "下午";
  2069. break;
  2070. case 3:
  2071. this.currentData.type_name = "晚上";
  2072. break;
  2073. }
  2074. this.currentData.zone_name = row.zone.name;
  2075. this.currentData.bed_name = row.number.number;
  2076. this.currentData.partition_type = row.zone.type;
  2077. this.currentData.mode_id = row.mode_id;
  2078. this.currentData.patient_id = row.patient_id;
  2079. this.currentData.patient = row.patient;
  2080. this.currentData.contagions = row.patient_contagions;
  2081. this.currentData.id = row.id;
  2082. this.changeSchedule = {
  2083. mode_id: row.mode_id,
  2084. schedule_type: row.schedule_type,
  2085. partition_id: row.partition_id,
  2086. bed_id: row.bed_id,
  2087. schedule_week: row.schedule_week,
  2088. partition_type: ""
  2089. };
  2090. this.currentData.schedule_date = uParseTime(
  2091. row.schedule_date,
  2092. "{y}-{m}-{d}"
  2093. );
  2094. if (typeof this.partitions[row.partition_id].jihaos !== "undefined") {
  2095. this.jihaos = this.partitions[row.partition_id].jihaos;
  2096. } else {
  2097. this.jihaos = [];
  2098. }
  2099. this.searchTableVisible = false;
  2100. this.jhDialogVisible = true;
  2101. },
  2102. getDialysisDate: function(row) {
  2103. let week = "";
  2104. switch (row.schedule_week) {
  2105. case 7:
  2106. week = "周日";
  2107. break;
  2108. case 1:
  2109. week = "周一";
  2110. break;
  2111. case 2:
  2112. week = "周二";
  2113. break;
  2114. case 3:
  2115. week = "周三";
  2116. break;
  2117. case 4:
  2118. week = "周四";
  2119. break;
  2120. case 5:
  2121. week = "周五";
  2122. break;
  2123. case 6:
  2124. week = "周六";
  2125. break;
  2126. }
  2127. return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
  2128. },
  2129. getSchedulesType: function(type) {
  2130. let type_name = "";
  2131. switch (type) {
  2132. case 1:
  2133. type_name = "上午";
  2134. break;
  2135. case 2:
  2136. type_name = "下午";
  2137. break;
  2138. case 3:
  2139. type_name = "晚上";
  2140. break;
  2141. }
  2142. return type_name;
  2143. },
  2144. changeMode: function(index, row) {
  2145. this.changeSchedule = {
  2146. mode_id: "",
  2147. schedule_type: "",
  2148. partition_id: "",
  2149. bed_id: "",
  2150. schedule_week: "",
  2151. partition_type: ""
  2152. };
  2153. this.currentData.id = row.id;
  2154. this.searchTableVisible = false;
  2155. this.msDialogVisible = true;
  2156. },
  2157. tableRowClassName({row, rowIndex}) {
  2158. if(row.zone_type == 1){
  2159. return 'table-row-new-class schedule-table-row'
  2160. }else {
  2161. return 'table-row-new-class schedule-table-row backPurple'
  2162. }
  2163. },
  2164. getAllZones(){
  2165. getAllZones().then(response=>{
  2166. if(response.data.state == 1){
  2167. var zones = response.data.data.zones
  2168. for(let i=0;i<zones.length;i++){
  2169. this.zoneIdList.push(zones[i].id)
  2170. }
  2171. this.zones.push(...zones)
  2172. var strArr = this.zoneIdList.join(",")
  2173. this.strArr = strArr
  2174. this.getWeekPanels()
  2175. }
  2176. })
  2177. },
  2178. changePartiton(val){
  2179. this.$emit('event1', val)
  2180. this.partition_id = val
  2181. this.getWeekPanels()
  2182. this.getSchedules()
  2183. },
  2184. changeSchedule_type(val){
  2185. this.$emit('event2', val)
  2186. this.schedule_type = val
  2187. this.getSchedules()
  2188. },
  2189. },
  2190. components: {
  2191. ScheduleItem
  2192. },
  2193. mounted() {
  2194. this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 120;
  2195. // var theType = this.weekType(this.weekTime);
  2196. // this.getSchedules(theType);
  2197. const that = this;
  2198. window.onresize = () => {
  2199. return (() => {
  2200. window.fullHeight = document.documentElement.clientHeight;
  2201. if (window.fullHeight < 200) {
  2202. that.tableHeight = 200;
  2203. } else {
  2204. that.tableHeight = window.fullHeight - 160;
  2205. }
  2206. })();
  2207. };
  2208. },
  2209. // mounted:function(){
  2210. // this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
  2211. // },
  2212. created() {
  2213. this.getAllZones()
  2214. this.changeScheduleType(1)
  2215. rowNumber = 0;
  2216. this.modeOptions = this.$store.getters.treatment_mode;
  2217. this.partitions = this.partitionsProp;
  2218. var contagions = this.$store.getters.contagions;
  2219. if (contagions.length > 0) {
  2220. var that = this;
  2221. contagions.forEach(function(citem) {
  2222. if (citem.type == 2) {
  2223. that.diseasesArr.push({ value: citem.id, label: citem.name });
  2224. }
  2225. });
  2226. }
  2227. this.scheduleZoneRow = this.scheduleZoneRowProp;
  2228. this.weekday = new Date().getDay();
  2229. if (this.weekday == 0) {
  2230. this.weekday = 7;
  2231. }
  2232. }
  2233. };
  2234. </script>
  2235. <style rel="stylesheet/css" lang="scss">
  2236. .tiaozhengclass {
  2237. display: block;
  2238. margin: 0 auto;
  2239. }
  2240. // .el-table tr {
  2241. // background-color: #111 !important;
  2242. // }
  2243. .schedule-table-row {
  2244. background: #fff !important;
  2245. }
  2246. .schedule-table-row:hover {
  2247. background: #fff !important;
  2248. }
  2249. .schedule-table-row td:hover {
  2250. background: rgb(88, 162, 236) !important;
  2251. }
  2252. .schedule-table-row td .cell {
  2253. font-size: 12px;
  2254. white-space: nowrap !important;
  2255. }
  2256. .schedule-table-cell-disable {
  2257. background-color: rgb(245, 245, 245) !important;
  2258. }
  2259. #table_data {
  2260. min-height: calc(100vh - 350px);
  2261. }
  2262. #table_data ::-webkit-scrollbar {
  2263. height: 15px;
  2264. }
  2265. .el-table td,
  2266. .el-table th.is-leaf,
  2267. .el-table--border,
  2268. .el-table--group {
  2269. border-color: #d0d3da;
  2270. }
  2271. .el-table--border::after,
  2272. .el-table--group::after,
  2273. .el-table::before {
  2274. background-color: #d0d3da;
  2275. }
  2276. .el-table--border th {
  2277. border-color: #d0d3da;
  2278. }
  2279. .el-table--border td {
  2280. border-color: #d0d3da;
  2281. }
  2282. .el-table td {
  2283. border-color: #d0d3da;
  2284. }
  2285. // .hover-td{
  2286. // color: red;
  2287. // }
  2288. // .el-table__body tr.current-row > td {
  2289. // background-color: #409eff !important;
  2290. // color: #fff;
  2291. // }
  2292. // .el-table__body tr > td:hover {
  2293. // background-color: #409eff !important;
  2294. // }
  2295. #table_data {
  2296. .el-table__body tr.current-row > td {
  2297. background-color: #ecf5ff !important;
  2298. color: #3a8ee6;
  2299. }
  2300. .el-table__body tr > td:hover {
  2301. background-color: #409eff !important;
  2302. color: #fff;
  2303. }
  2304. .el-table__body tr .hover-td {
  2305. background-color: #409eff !important;
  2306. color: #fff;
  2307. }
  2308. }
  2309. .backPurple{
  2310. color: #08c3df !important;
  2311. }
  2312. </style>