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

tableData.vue 100KB

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