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

tableData.vue 101KB

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