Patientshift.vue 40KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs" style="flex:1;"></bread-crumb>
  5. </div>
  6. <div class="app-container" style="background-color: white">
  7. <div id="print_content">
  8. <div style="margin: 20px 0;">
  9. <div class="content_top">日期:
  10. <el-date-picker
  11. @change="date_picker"
  12. v-model="date"
  13. type="date"
  14. placeholder="选择日期">
  15. </el-date-picker>
  16. </div>
  17. <div class="content_top">排班班次:
  18. <el-select v-model="classes" placeholder="请选择" @change="banci_select">
  19. <el-option
  20. v-for="item in schedulArr"
  21. :key="item.value"
  22. :label="item.label"
  23. :value="item.value">
  24. </el-option>
  25. </el-select>
  26. </div>
  27. <div class="content_top">病区选择:
  28. <el-select v-model="bingqu" placeholder="请选择" @change="bingqu_select">
  29. <el-option
  30. v-for="item in partitionArr"
  31. :key="item.value"
  32. :label="item.name"
  33. :value="item.id">
  34. </el-option>
  35. </el-select>
  36. </div>
  37. <div class="content_top">隐藏备注:
  38. <el-switch
  39. v-model="hidder"
  40. active-color="#13ce66"
  41. inactive-color="#ff4949"
  42. active-text="ON"
  43. inactive-text="OFF">
  44. </el-switch>
  45. </div>
  46. </div>
  47. <div class="table_panel" v-for="(item, index) in tableData" :key="index">
  48. <table class="table">
  49. <thead>
  50. <tr>
  51. <td :width="td_1_width">分区</td>
  52. <td :width="td_3_width">病人姓名</td>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. <tr v-for="(ite,index) in item.zones" :key="index">
  57. <td style="text-align: center;">{{ getZoneName(ite.partition_id) }}</td>
  58. <td>
  59. <div v-for="(it,index) in numberlist" style="display: inline-block;position: relative;" @dblclick="db_click($event,it)">
  60. <!-- <template> -->
  61. <div v-if="ite.partition_id==it.zone_id" class="huanzhekuais" style="" @drop="drop($event,item)" draggable="true" @dragover="allowDrop">
  62. <div class="huanzhekuai">
  63. <div v-for="(item2) in item.list" draggable="true" @dragstart.self="curInfoDragStart($event,item2)">
  64. <template >
  65. <div v-if="it.id==item2.bed_id" style="display: inline-block;">
  66. <div>
  67. <span>{{ item2.name }}({{ getmode(item2.mode_id) }})</span><br>
  68. <div v-if="hidder" >
  69. <span style="font-size: 14px;color: rgb(19, 241, 175);margin-bottom: 5px;">{{item2.order.DeviceNumber.zone.name}}-{{item2.order.DeviceNumber.number}}</span><br>
  70. <span style="font-size: 14px;color:orange;margin-bottom: 5px;">{{getBloodAccess(item2.order.blood_access_id)}}</span><br>
  71. <span style="font-size: 13px;color:rgb(102, 13, 161);margin-bottom: 5px;">{{item2.order.schedule_remark}}</span>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. </div>
  77. </div>
  78. <!-- <div v-if="ite.partition_id==it.partition_id" style="max-height: 110px; margin-top: 10px;margin-bottom: 5px;background: rgb(74 197 235);" >
  79. <span>{{ it.name }}({{ getmode(it.mode_id) }})</span><br>
  80. <div v-if="value" >
  81. <span style="font-size: 14px;color: rgb(12, 185, 50);margin-bottom: 5px;">{{it.order.DeviceNumber.zone.name}}-{{it.order.DeviceNumber.number}}</span><br>
  82. <span style="font-size: 14px;color:orange;margin-bottom: 5px;">{{getBloodAccess(it.order.blood_access_id)}}</span><br>
  83. <span style="font-size: 13px;color:rgb(102, 13, 161);margin-bottom: 5px;">{{it.order.schedule_remark}}</span>
  84. </div>
  85. </div> -->
  86. <!-- <div
  87. style="display: inline-block;width: 125px;text-align: center;position: absolute;">
  88. {{ it.number }}
  89. </div> -->
  90. </div>
  91. <div v-if="ite.partition_id==it.zone_id" style="display: inline-block;width: 125px;text-align: center;">
  92. {{ it.number }}
  93. </div>
  94. </div>
  95. </td>
  96. </tr>
  97. </tbody>
  98. </table>
  99. </div>
  100. <!-- 双击弹窗 -->
  101. <el-dialog
  102. title="提示"
  103. :visible.sync="centerDialogVisible"
  104. width="30%"
  105. center>
  106. <div>
  107. <div style="display: flex;">
  108. <div style="width:150px;margin-right: 10px;">
  109. <div style="margin: 10px 0;">分区
  110. <el-select v-model="fenqu_dialog" placeholder="请选择" @change="dialogfenqu">
  111. <el-option
  112. v-for="item in partitionArr"
  113. :key="item.value"
  114. :label="item.name"
  115. :value="item.id">
  116. </el-option>
  117. </el-select>
  118. </div>
  119. <div>床位
  120. <el-select v-model="chuangwei" placeholder="请选择" @change="dialogchuangwei">
  121. <el-option
  122. v-for="item in subzone"
  123. :key="item.value"
  124. :label="item.number"
  125. :value="item.id">
  126. </el-option>
  127. </el-select>
  128. </div>
  129. </div>
  130. <div style="width:350px">
  131. <div style="display: flex;">
  132. <div>
  133. <div style="margin: 10px 30px 10px 10px;background: rgb(74 197 235);height: 110px;width: 125px;text-align: center;">
  134. <span >{{ huanzhe.name }}({{getmode(huanzhe.mode_id)}})</span><br>
  135. <span style="font-size: 14px;color: rgb(12, 185, 50);margin-bottom: 5px;">
  136. {{ huanzhe.zeng_fenqu }}-{{ huanzhe.zeng_chuang }}
  137. </span><br>
  138. <span style="font-size: 14px;color:orange;margin-bottom: 5px;">{{getBloodAccess(huanzhe.boolen_id)}}</span><br>
  139. <span style="font-size: 13px;color:rgb(102, 13, 161);margin-bottom: 5px;">{{huanzhe.schedule_remark}}</span>
  140. </div>
  141. <div style="margin-left: 10px;">{{getZoneName(xian_fenqu.zone_id)}}-{{xian_fenqu.number}}</div>
  142. </div>
  143. <div>
  144. <div style="margin: 10px 30px 10px 10px;background: rgb(74 197 235);height: 110px;width: 125px;text-align: center;">
  145. <span >{{genghuan.name}}</span><span v-if="genghuan.mode_id !=''">({{genghuan.mode_id}})</span><br>
  146. <span style="font-size: 14px;color: rgb(12, 185, 50);margin-bottom: 5px;">
  147. {{ genghuan.genghuan_fenqu }}-{{ genghuan.genghuan_chuang }}
  148. <!-- A1区-6号床 -->
  149. </span><br>
  150. <span style="font-size: 14px;color:orange;margin-bottom: 5px;"></span>{{getBloodAccess(genghuan.g_boolen_id)}}<br>
  151. <span style="font-size: 13px;color:rgb(102, 13, 161);margin-bottom: 5px;">{{genghuan.genghuan_remark}}</span>
  152. </div>
  153. <div style="margin-left: 10px;">{{getZoneName(g_xian_fenqu.zone_id)}}-{{g_xian_fenqu.number}}</div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. <span slot="footer" class="dialog-footer">
  160. <el-button @click="centerDialogVisible = false">取 消</el-button>
  161. <el-button type="primary" @click="verify_dialog">确 定</el-button>
  162. </span>
  163. </el-dialog>
  164. <!-- 排班替换/交换提示弹窗 -->
  165. <el-dialog
  166. title="提示"
  167. :visible.sync="tipDialogVisible"
  168. width="300px"
  169. :modal-append-to-body='false'
  170. :close-on-click-modal="false"
  171. >
  172. <div>
  173. 所选位置已有排班,请选择操作
  174. </div>
  175. <span slot="footer" class="dialog-footer">
  176. <el-button
  177. type="danger"
  178. @click="tipDialogVisibleTwo = true"
  179. >替换</el-button>
  180. <el-button
  181. type="primary"
  182. @click="tipDialogVisibleThree = true"
  183. >交换</el-button>
  184. <el-button @click="tipDialogVisible = false">取 消</el-button>
  185. </span>
  186. </el-dialog>
  187. <!-- 排班替换 -->
  188. <el-dialog
  189. title="提示"
  190. :visible.sync="tipDialogVisibleTwo"
  191. width="300px"
  192. class="replace"
  193. :modal-append-to-body='false'
  194. :close-on-click-modal="false"
  195. >
  196. <div>
  197. 是否将此位置排班替换
  198. </div>
  199. <span slot="footer" class="dialog-footer">
  200. <el-button
  201. type="primary"
  202. @click="coverSch()"
  203. >确定</el-button>
  204. <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
  205. </span>
  206. </el-dialog>
  207. <!-- 将此位置排班互换 -->
  208. <el-dialog
  209. title="提示"
  210. :visible.sync="tipDialogVisibleThree"
  211. width="300px"
  212. class="exchange"
  213. :modal-append-to-body='false'
  214. :close-on-click-modal="false"
  215. >
  216. <div>
  217. 是否将此位置排班互换
  218. </div>
  219. <span slot="footer" class="dialog-footer">
  220. <el-button
  221. type="primary"
  222. @click="changeSchTwo()"
  223. >确定</el-button>
  224. <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
  225. </span>
  226. </el-dialog>
  227. </div>
  228. </div>
  229. </div>
  230. </template>
  231. <script>
  232. import { GetAllZone, getSchedualPrintList } from '@/api/dialysis'
  233. import { parseTime } from '@/utils'
  234. import { uParseTime } from '@/utils/tools'
  235. import { getDataConfig } from '@/utils/data'
  236. import {CreateScheduleTwo} from '@/api/schedule'
  237. import {CoverSch,ExchangeSch,} from "@/api/schedule_template/sch_template";
  238. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  239. import print from 'print-js'
  240. const moment = require('moment')
  241. // import {getAllZones} from "@/api/schedule"
  242. export default {
  243. name: 'SchedulePrint',
  244. data() {
  245. return {
  246. crumbs: [
  247. { path: false, name: '排班管理' },
  248. { path: false, name: '患者调班' }
  249. ],
  250. tipDialogVisible:false,
  251. tipDialogVisibleTwo:false,
  252. tipDialogVisibleThree:false,
  253. hidder: false,
  254. td_1_width: '8%',
  255. td_3_width: '90%',
  256. date:'',
  257. classes:1,
  258. bingqu:0,
  259. fenqu_dialog:0,
  260. chuangwei:519,
  261. options:[],
  262. centerDialogVisible:false,
  263. cur_drag_info:{
  264. id:'',
  265. name:'',
  266. quhao:'',
  267. chaung:'',
  268. patient_id:'',
  269. },
  270. currentData:{
  271. currentData_id:'',
  272. currentData_name:'',
  273. currentData_quhao:'',
  274. currentData_chaung:'',
  275. patient_id:'',
  276. },
  277. schedulArr: [
  278. { value: 1, label: "上午" },
  279. { value: 2, label: "下午" },
  280. { value: 3, label: "晚上" }
  281. ],
  282. zones:[],
  283. schedules: [
  284. {
  285. day: 1,
  286. weekday: '星期一',
  287. all: {
  288. am: {
  289. /* zone_name: [ schedule, ... ] */
  290. },
  291. pm: {
  292. /* zone_name: [ schedule, ... ] */
  293. },
  294. evening: {
  295. /* zone_name: [ schedule, ... ] */
  296. }
  297. },
  298. hdf: [
  299. /* schedule, ... */
  300. ],
  301. hd_hp: [
  302. /* schedule, ... */
  303. ],
  304. new_hdf: {
  305. am: {
  306. /* zone_name: [ schedule, ... ] */
  307. },
  308. pm: {
  309. /* zone_name: [ schedule, ... ] */
  310. },
  311. evening: {
  312. /* zone_name: [ schedule, ... ] */
  313. }
  314. },
  315. new_hd_hp: {
  316. am: {
  317. /* zone_name: [ schedule, ... ] */
  318. },
  319. pm: {
  320. /* zone_name: [ schedule, ... ] */
  321. },
  322. evening: {
  323. /* zone_name: [ schedule, ... ] */
  324. }
  325. }
  326. },
  327. {
  328. day: 2,
  329. weekday: '星期二',
  330. all: {
  331. am: {
  332. /* zone_name: [ schedule, ... ] */
  333. },
  334. pm: {
  335. /* zone_name: [ schedule, ... ] */
  336. },
  337. evening: {
  338. /* zone_name: [ schedule, ... ] */
  339. }
  340. },
  341. hdf: [
  342. /* schedule, ... */
  343. ],
  344. hd_hp: [
  345. /* schedule, ... */
  346. ],
  347. new_hdf: {
  348. am: {
  349. /* zone_name: [ schedule, ... ] */
  350. },
  351. pm: {
  352. /* zone_name: [ schedule, ... ] */
  353. },
  354. evening: {
  355. /* zone_name: [ schedule, ... ] */
  356. }
  357. },
  358. new_hd_hp: {
  359. am: {
  360. /* zone_name: [ schedule, ... ] */
  361. },
  362. pm: {
  363. /* zone_name: [ schedule, ... ] */
  364. },
  365. evening: {
  366. /* zone_name: [ schedule, ... ] */
  367. }
  368. }
  369. },
  370. {
  371. day: 3,
  372. weekday: '星期三',
  373. all: {
  374. am: {
  375. /* zone_name: [ schedule, ... ] */
  376. },
  377. pm: {
  378. /* zone_name: [ schedule, ... ] */
  379. },
  380. evening: {
  381. /* zone_name: [ schedule, ... ] */
  382. }
  383. },
  384. hdf: [
  385. /* schedule, ... */
  386. ],
  387. hd_hp: [
  388. /* schedule, ... */
  389. ],
  390. new_hdf: {
  391. am: {
  392. /* zone_name: [ schedule, ... ] */
  393. },
  394. pm: {
  395. /* zone_name: [ schedule, ... ] */
  396. },
  397. evening: {
  398. /* zone_name: [ schedule, ... ] */
  399. }
  400. },
  401. new_hd_hp: {
  402. am: {
  403. /* zone_name: [ schedule, ... ] */
  404. },
  405. pm: {
  406. /* zone_name: [ schedule, ... ] */
  407. },
  408. evening: {
  409. /* zone_name: [ schedule, ... ] */
  410. }
  411. }
  412. },
  413. {
  414. day: 4,
  415. weekday: '星期四',
  416. all: {
  417. am: {
  418. /* zone_name: [ schedule, ... ] */
  419. },
  420. pm: {
  421. /* zone_name: [ schedule, ... ] */
  422. },
  423. evening: {
  424. /* zone_name: [ schedule, ... ] */
  425. }
  426. },
  427. hdf: [
  428. /* schedule, ... */
  429. ],
  430. hd_hp: [
  431. /* schedule, ... */
  432. ],
  433. new_hdf: {
  434. am: {
  435. /* zone_name: [ schedule, ... ] */
  436. },
  437. pm: {
  438. /* zone_name: [ schedule, ... ] */
  439. },
  440. evening: {
  441. /* zone_name: [ schedule, ... ] */
  442. }
  443. },
  444. new_hd_hp: {
  445. am: {
  446. /* zone_name: [ schedule, ... ] */
  447. },
  448. pm: {
  449. /* zone_name: [ schedule, ... ] */
  450. },
  451. evening: {
  452. /* zone_name: [ schedule, ... ] */
  453. }
  454. }
  455. },
  456. {
  457. day: 5,
  458. weekday: '星期五',
  459. all: {
  460. am: {
  461. /* zone_name: [ schedule, ... ] */
  462. },
  463. pm: {
  464. /* zone_name: [ schedule, ... ] */
  465. },
  466. evening: {
  467. /* zone_name: [ schedule, ... ] */
  468. }
  469. },
  470. hdf: [
  471. /* schedule, ... */
  472. ],
  473. hd_hp: [
  474. /* schedule, ... */
  475. ],
  476. new_hdf: {
  477. am: {
  478. /* zone_name: [ schedule, ... ] */
  479. },
  480. pm: {
  481. /* zone_name: [ schedule, ... ] */
  482. },
  483. evening: {
  484. /* zone_name: [ schedule, ... ] */
  485. }
  486. },
  487. new_hd_hp: {
  488. am: {
  489. /* zone_name: [ schedule, ... ] */
  490. },
  491. pm: {
  492. /* zone_name: [ schedule, ... ] */
  493. },
  494. evening: {
  495. /* zone_name: [ schedule, ... ] */
  496. }
  497. }
  498. },
  499. {
  500. day: 6,
  501. weekday: '星期六',
  502. all: {
  503. am: {
  504. /* zone_name: [ schedule, ... ] */
  505. },
  506. pm: {
  507. /* zone_name: [ schedule, ... ] */
  508. },
  509. evening: {
  510. /* zone_name: [ schedule, ... ] */
  511. }
  512. },
  513. hdf: [
  514. /* schedule, ... */
  515. ],
  516. hd_hp: [
  517. /* schedule, ... */
  518. ],
  519. new_hdf: {
  520. am: {
  521. /* zone_name: [ schedule, ... ] */
  522. },
  523. pm: {
  524. /* zone_name: [ schedule, ... ] */
  525. },
  526. evening: {
  527. /* zone_name: [ schedule, ... ] */
  528. }
  529. },
  530. new_hd_hp: {
  531. am: {
  532. /* zone_name: [ schedule, ... ] */
  533. },
  534. pm: {
  535. /* zone_name: [ schedule, ... ] */
  536. },
  537. evening: {
  538. /* zone_name: [ schedule, ... ] */
  539. }
  540. }
  541. },
  542. {
  543. day: 7,
  544. weekday: '星期日',
  545. all: {
  546. am: {
  547. /* zone_name: [ schedule, ... ] */
  548. },
  549. pm: {
  550. /* zone_name: [ schedule, ... ] */
  551. },
  552. evening: {
  553. /* zone_name: [ schedule, ... ] */
  554. }
  555. },
  556. hdf: [
  557. /* schedule, ... */
  558. ],
  559. hd_hp: [
  560. /* schedule, ... */
  561. ],
  562. new_hdf: {
  563. am: {
  564. /* zone_name: [ schedule, ... ] */
  565. },
  566. pm: {
  567. /* zone_name: [ schedule, ... ] */
  568. },
  569. evening: {
  570. /* zone_name: [ schedule, ... ] */
  571. }
  572. },
  573. new_hd_hp: {
  574. am: {
  575. /* zone_name: [ schedule, ... ] */
  576. },
  577. pm: {
  578. /* zone_name: [ schedule, ... ] */
  579. },
  580. evening: {
  581. /* zone_name: [ schedule, ... ] */
  582. }
  583. }
  584. }
  585. ],
  586. total: [],
  587. list: [],
  588. loading: false,
  589. tableData: [],
  590. numberlist: [],
  591. partitionArr: [],
  592. listname:[],
  593. mode:[{id:1,name:'HD'},{id:2,name:'HDF'},{id:3,name:'HD+HP'},{id:4,name:'HP'},{id:5,name:'HF'},{id:6,name:'SCUF'},{id:7,name:'IUF'},{id:8,name:'HFHD'},
  594. {id:9,name:'HFHD+HP'},{id:10,name:'PHF'},{id:11,name:'HFR'},{id:12,name:'HDF+HP'},{id:13,name:'CRRT'},{id:14,name:'腹水回输'},{id:15,name:'IUF+HD'},{id:16,name:'UF'},
  595. {id:17,name:'HD+'},{id:18,name:'血浆胆红素吸附+HDF'},{id:19,name:'血浆胆红素吸附'},{id:20,name:'I-HDF'},{id:21,name:'HD高通'},{id:22,name:'CVVH'},{id:23,name:'CVVHD'},
  596. {id:24,name:'CVVHDF'},{id:25,name:'PE'},{id:26,name:'血浆胆红素吸附+HP'},{id:27,name:'HPD'},{id:28,name:'HDP'}],
  597. subzone:[],
  598. huanzhe:{
  599. id:null,
  600. name:'',
  601. mode_id:'',
  602. zeng_fenqu:'',
  603. zeng_chuang:'',
  604. boolen_id:'',
  605. schedule_remark:'',
  606. },
  607. xian_fenqu:'',
  608. g_xian_fenqu:'',
  609. genghuan:{
  610. id:null,
  611. name:'',
  612. mode_id:'',
  613. genghuan_fenqu:'',
  614. genghuan_chuang:'',
  615. g_boolen_id:'',
  616. genghuan_remark:'',
  617. },
  618. }
  619. },
  620. components: {
  621. BreadCrumb
  622. },
  623. created() {
  624. this.date= moment(new Date()).format("YYYY-MM-DD");
  625. console.log('dsafas',this.date);
  626. this.getAllZones()
  627. this.getlist()
  628. },
  629. mounted(){
  630. // console.log('8888',this.huanzhe.order.DeviceNumber.zone.name);
  631. },
  632. methods:{
  633. drop(e,val){
  634. this.allowDrop(e)
  635. console.log('6666',val);
  636. console.log('7777',this.numberlist);
  637. const inntext= e.target.innerText.split('(')[0]
  638. console.log('3333',inntext);
  639. for(let i=0;i<val.list.length;i++){
  640. if(inntext == val.list[i].name){
  641. this.tipDialogVisible=true
  642. this.currentData={
  643. currentData_id:val.list[i].id,
  644. currentData_name:val.list[i].name,
  645. currentData_quhao:val.list[i].order.DeviceNumber.zone.name,
  646. currentData_chaung:val.list[i].order.DeviceNumber.number,
  647. patient_id:val.list[i].patient_id
  648. }
  649. }
  650. }
  651. if(e.target.innerText == ''){
  652. this.currentData={
  653. currentData_id:0,
  654. currentData_name:this.cur_drag_info.name,
  655. currentData_quhao:this.cur_drag_info.quhao,
  656. currentData_chaung:this.cur_drag_info.chaung,
  657. patient_id:this.cur_drag_info.patient_id
  658. }
  659. console.log('8888',this.currentData.currentData_id);
  660. this.setScheduleTwo(this.cur_drag_info.id)
  661. // var params={
  662. // patient_id:this.currentData.patient_id,
  663. // id_two:this.currentData.currentData_id
  664. // }
  665. // CreateScheduleTwo(this.currentData.patient_id,this.currentData.currentData_id).then((response)=>{
  666. // if (response.data.state == 0) {
  667. // this.$message.error(response.data.msg);
  668. // } else {
  669. // var schedule = response.data.data.schedule;
  670. // this.getlist()
  671. // }
  672. // })
  673. // this.CreateScheduleTwo(this.currentData.patient_id,this.currentData,this.currentData.currentData_id)
  674. }
  675. // for(let i=0;i<this.numberlist.length;i++){
  676. // for(let j=0;j<val.list.length;j++){
  677. // if(this.numberlist[i].id==val.list[y].bed_id){
  678. // }
  679. // }
  680. // }
  681. // this.currentData={
  682. // currentData_id:val.id,
  683. // currentData_name:val.name,
  684. // currentData_quhao:val.order.DeviceNumber.zone.name,
  685. // currentData_chaung:val.order.DeviceNumber.number,
  686. // },
  687. // this.currentData={
  688. // currentData_id:this.cur_drag_info.id,
  689. // currentData_name:this.cur_drag_info.name,
  690. // currentData_quhao:this.cur_drag_info.quhao,
  691. // currentData_chaung:this.cur_drag_info.chaung,
  692. // },
  693. },
  694. allowDrop(e) {
  695. e.preventDefault();
  696. },
  697. // 替换
  698. coverSch(){
  699. this.tipDialogVisible=false
  700. let params={
  701. id_one:this.cur_drag_info.id,
  702. id_two:this.currentData.currentData_id
  703. }
  704. CoverSch(params).then((response) => {
  705. if (response.data.state == 0) {
  706. this.$message.error(response.data.msg);
  707. this.tipDialogVisibleTwo = false
  708. } else {
  709. console.log('888888888888',response.data);
  710. this.$message.success("替换成功");
  711. this.tipDialogVisible = false
  712. this.tipDialogVisibleTwo = false
  713. this.getlist();
  714. }
  715. });
  716. },
  717. // 交换
  718. changeSchTwo(){
  719. this.tipDialogVisible=false
  720. let params={
  721. id_one:this.cur_drag_info.id,
  722. id_two:this.currentData.currentData_id
  723. }
  724. ExchangeSch(params).then((response) => {
  725. if (response.data.state == 0) {
  726. this.$message.error(response.data.msg);
  727. this.tipDialogVisibleThree = false
  728. } else {
  729. console.log('22222222',response.data);
  730. this.$message.success("交换成功");
  731. this.tipDialogVisible = false
  732. this.tipDialogVisibleThree = false
  733. this.getlist();
  734. }
  735. });
  736. },
  737. // 交换空白
  738. setScheduleTwo(id_two){
  739. this.CreateScheduleTwo(this.currentData.patient_id, this.currentData,id_two);
  740. },
  741. async CreateScheduleTwo(id, data,id_two) {
  742. let response =await CreateScheduleTwo(id, data,id_two)
  743. if (response.data.state == 0) {
  744. this.$message.error(response.data.msg);
  745. } else {
  746. var schedule = response.data.data.schedule;
  747. this.getlist()
  748. }
  749. },
  750. // 需要拖动的
  751. curInfoDragStart(e,val){
  752. this.cur_drag_info={
  753. id:val.id,
  754. name:val.name,
  755. quhao:val.order.DeviceNumber.zone.name,
  756. chaung:val.order.DeviceNumber.number,
  757. patient_id:val.patient_id,
  758. }
  759. console.log('4444',val);
  760. console.log('5555',this.cur_drag_info);
  761. },
  762. // 选中日期
  763. date_picker(e){
  764. var time=moment(e).format("YYYY-MM-DD");
  765. console.log('sfddas',time);
  766. this.date=time
  767. this.getlist()
  768. },
  769. // 选择班次
  770. banci_select(e){
  771. console.log(e);
  772. for(let i=0;i<this.schedulArr.length;i++){
  773. if(e==this.schedulArr[i].value){
  774. this.classes = e
  775. }
  776. this.getlist()
  777. }
  778. },
  779. // 选择分区
  780. bingqu_select(e){
  781. console.log('1234546',e);
  782. for (let i = 0; i < this.partitionArr.length; i++) {
  783. if(e==this.partitionArr[i].id){
  784. this.bingqu=e
  785. }
  786. }
  787. this.getlist()
  788. },
  789. // 分区
  790. getAllZones() {
  791. GetAllZone().then(response => {
  792. if (response.data.state == 0) {
  793. this.$message.error(response.data.msg);
  794. return false;
  795. } else {
  796. this.partitionArr = response.data.data.zone;
  797. this.partitionArr.unshift({ id: 0, name: "全部" });
  798. console.log('asfasdfsadfa',response.data.data);
  799. }
  800. });
  801. },
  802. getlist() {
  803. var params = {
  804. schedule_date: this.date,
  805. schedule_type: this.classes,
  806. partition_type: this.bingqu,
  807. keywords: '',
  808. page: 1,
  809. limit: 5000
  810. }
  811. this.loading = true
  812. this.tableData = []
  813. console.log('111111111',params);
  814. getSchedualPrintList(params).then((response) => {
  815. if (response.data.state == 1) {
  816. this.loading = false
  817. console.log('111111',response.data.data);
  818. var list = response.data.data.list
  819. this.list = list
  820. var listOne = response.data.data.listOne
  821. this.zones =listOne
  822. var numberlist=response.data.data.numberList
  823. this.numberlist= numberlist
  824. this.subzone = numberlist
  825. if (list != null && list.length > 0) {
  826. const dataInfo = {}
  827. list.forEach((item, index) => {
  828. const { schedule_type } = item
  829. if (!dataInfo[schedule_type]) {
  830. dataInfo[schedule_type] = {
  831. schedule_type: item.schedule_type,
  832. schedule_date: item.schedule_date,
  833. zones: [],
  834. list:[],
  835. }
  836. }
  837. })
  838. const arr = Object.values(dataInfo)
  839. // console.log('arr222', arr)
  840. if (arr != null && arr.length > 0) {
  841. for (let i = 0; i < arr.length; i++) {
  842. for (let j = 0; j < listOne.length; j++) {
  843. if (arr[i].schedule_type == listOne[j].schedule_type) {
  844. arr[i].zones.push(listOne[j])
  845. }
  846. }
  847. for(let x=0;x<list.length;x++){
  848. arr[i].list.push(list[x])
  849. }
  850. }
  851. }
  852. // console.log('排班数据------------------', arr)
  853. this.tableData = arr
  854. console.log('22222222',this.tableData);
  855. }
  856. this.numberList = response.data.data.numberList
  857. // console.log('list2332233232wo', list)
  858. // console.log('numberList', this.numberList)
  859. }
  860. })
  861. },
  862. getTimeOne(val) {
  863. if (val == '') {
  864. return ''
  865. } else {
  866. return uParseTime(val, '{y}-{m}-{d}')
  867. }
  868. },
  869. getPatientName(schedule_type, partition_id) {
  870. var str = ''
  871. var arr = []
  872. if (this.list != null && this.list.length > 0) {
  873. for (let i = 0; i < this.list.length; i++) {
  874. if (this.list[i].schedule_type == schedule_type && this.list[i].partition_id == partition_id) {
  875. arr.push(this.list[i])
  876. }
  877. }
  878. }
  879. if (arr.length > 0) {
  880. for (let i = 0; i < arr.length; i++) {
  881. arr[i].name = this.nameSplit(arr[i].name)
  882. console.log('666666',arr[i].name);
  883. if (this.hiddenFlag) {
  884. str+= arr[i].name + '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp '
  885. } else {
  886. str+=arr[i].name
  887. }
  888. }
  889. }
  890. // console.log(str, 'strstrstr')
  891. return str
  892. },
  893. // 透析模式
  894. getmode(id){
  895. for(let i=0;i<this.mode.length;i++){
  896. if(id=this.mode[i].id){
  897. return this.mode[i].name
  898. }
  899. }
  900. },
  901. // 切割患者姓名
  902. nameSplit(val) {
  903. var reg = /[\u4e00-\u9fa5]/g
  904. let name = val
  905. name = name.substr(-4)
  906. var names = name.match(reg)
  907. name = names.join('')
  908. if (name.includes('区')) {
  909. name = name.replace('区', '')
  910. }
  911. if (name.includes('号')) {
  912. name = name.replace('号', '')
  913. }
  914. return name
  915. },
  916. // 分区
  917. getZoneName(id) {
  918. var name = ''
  919. for (let i = 0; i < this.partitionArr.length; i++) {
  920. if (id == this.partitionArr[i].id) {
  921. name = this.partitionArr[i].name
  922. }
  923. }
  924. return name
  925. },
  926. // 血管通路
  927. getBloodAccess(id) {
  928. var name = ''
  929. var list = getDataConfig(
  930. 'hemodialysis',
  931. 'vascular_access_desc'
  932. )
  933. for (let i = 0; i < list.length; i++) {
  934. if (id == list[i].id) {
  935. name = list[i].name
  936. }
  937. }
  938. return name
  939. },
  940. // 双击打开弹窗
  941. db_click(e,val){
  942. if(e.target.innerText !=''){
  943. this.centerDialogVisible=true
  944. this.xian_fenqu=val
  945. for(let i=0;i<this.list.length;i++){
  946. // 双击弹窗的右侧第一个数据
  947. if(val.id==this.list[i].bed_id){
  948. this.huanzhe.id=this.list[i].id
  949. this.huanzhe.name=this.list[i].name
  950. this.huanzhe.mode_id=this.list[i].mode_id
  951. this.huanzhe.zeng_fenqu=this.list[i].order.DeviceNumber.zone.name
  952. this.huanzhe.zeng_chuang = this.list[i].order.DeviceNumber.number
  953. this.huanzhe.boolen_id = this.list[i].order.blood_access_id
  954. this.huanzhe.schedule_remark = this.list[i].order.schedule_remark
  955. console.log('55555',this.huanzhe);
  956. }
  957. // 双击弹窗的右侧第二个默认数据
  958. if(this.chuangwei==this.list[i].bed_id){
  959. this.genghuan.id = this.list[i].id
  960. this.genghuan.name=this.list[i].name
  961. this.genghuan.mode_id=this.list[i].mode_id
  962. this.genghuan.genghuan_fenqu=this.list[i].order.DeviceNumber.zone.name
  963. this.genghuan.genghuan_chuang = this.list[i].order.DeviceNumber.number
  964. this.genghuan.g_boolen_id = this.list[i].order.blood_access_id
  965. this.genghuan.genghuan_remark = this.list[i].order.schedule_remark
  966. console.log('99999',this.genghuan);
  967. console.log('000000',this.list[i].bed_id);
  968. return this.genghuan
  969. }else{
  970. this.genghuan.id = null
  971. this.genghuan.name=''
  972. this.genghuan.mode_id=''
  973. this.genghuan.genghuan_fenqu=''
  974. this.genghuan.genghuan_chuang = ''
  975. this.genghuan.g_boolen_id = ''
  976. this.genghuan.genghuan_remark =''
  977. }
  978. }
  979. // 第二的床位
  980. for(let y=0;y<this.numberlist.length;y++){
  981. if(this.chuangwei==this.numberlist[y].id){
  982. this.g_xian_fenqu=this.numberlist[y]
  983. }
  984. }
  985. }else{
  986. this.centerDialogVisible=false
  987. }
  988. console.log('双击弹窗',this.zeng_fenqu);
  989. console.log('双击弹窗33',e);
  990. // console.log('双击弹窗333',value);
  991. },
  992. // 双击弹窗分区
  993. dialogfenqu(e){
  994. for (let i = 0; i < this.partitionArr.length; i++) {
  995. if(e==this.partitionArr[i].id){
  996. this.fenqu_dialog=e
  997. }
  998. }
  999. // if(this.fenqu_dialog==0){
  1000. // this.chuangwei=519
  1001. // }else if(this.fenqu_dialog==375){
  1002. // this.chuangwei=519
  1003. // }else if(this.fenqu_dialog==376){
  1004. // this.chuangwei=520
  1005. // }else if(this.fenqu_dialog==384){
  1006. // this.chuangwei=556
  1007. // }else if(this.fenqu_dialog==424){
  1008. // this.chuangwei=672
  1009. // }else if(this.fenqu_dialog==425){
  1010. // this.chuangwei=521
  1011. // }
  1012. var params = {
  1013. schedule_date: this.date,
  1014. schedule_type: this.classes,
  1015. partition_type: this.fenqu_dialog,
  1016. keywords: '',
  1017. page: 1,
  1018. limit: 5000
  1019. }
  1020. getSchedualPrintList(params).then((response)=>{
  1021. if (response.data.state == 1) {
  1022. var list = response.data.data.list
  1023. this.list = list
  1024. var listOne = response.data.data.listOne
  1025. this.zones =listOne
  1026. var numberlist=response.data.data.numberList
  1027. console.log('00000',this.list);
  1028. this.subzone=[]
  1029. for(let i=0;i<numberlist.length;i++){
  1030. if(this.fenqu_dialog==0){
  1031. this.subzone = numberlist
  1032. this.chuangwei = numberlist[0].id
  1033. this.g_xian_fenqu = numberlist[0]
  1034. }
  1035. if(this.fenqu_dialog==numberlist[i].zone_id){
  1036. const obj={id:null,number:'',zone_id:null}
  1037. obj.id=numberlist[i].id
  1038. obj.number=numberlist[i].number
  1039. obj.zone_id=numberlist[i].zone_id
  1040. this.subzone.push(obj)
  1041. this.chuangwei = this.subzone[0].id
  1042. this.g_xian_fenqu=this.subzone[0]
  1043. }
  1044. }
  1045. console.log('22222',this.g_xian_fenqu);
  1046. // 默认的患者
  1047. for(let i=0;i<this.list.length;i++){
  1048. if(this.chuangwei==this.list[i].bed_id){
  1049. this.genghuan.name=this.list[i].name
  1050. this.genghuan.mode_id=this.list[i].mode_id
  1051. this.genghuan.genghuan_fenqu=this.list[i].order.DeviceNumber.zone.name
  1052. this.genghuan.genghuan_chuang = this.list[i].order.DeviceNumber.number
  1053. this.genghuan.g_boolen_id =this.list[i].order.blood_access_id
  1054. this.genghuan.genghuan_remark = this.list[i].order.schedule_remark
  1055. console.log('99999',this.genghuan);
  1056. console.log('000000',this.list[i].bed_id);
  1057. return this.genghuan
  1058. }else{
  1059. console.log('eeeeee');
  1060. this.genghuan.name=''
  1061. this.genghuan.mode_id=''
  1062. this.genghuan.genghuan_fenqu=''
  1063. this.genghuan.genghuan_chuang = ''
  1064. this.genghuan.g_boolen_id = ''
  1065. this.genghuan.genghuan_remark =''
  1066. // return this.genghuan
  1067. // console.log('qqqqqq',this.list[i].bed_id);
  1068. }
  1069. }
  1070. // this.numberlist= numberlist
  1071. }
  1072. })
  1073. // console.log('77777',this.chuangwei);
  1074. // for(let i=0;i<list.length;i++){
  1075. // if(this.chuangwei==list[i].bed_id){
  1076. // this.genghuan.name=list[i].name
  1077. // this.genghuan.mode_id=list[i].mode_id
  1078. // this.genghuan.genghuan_fenqu=list[i].order.DeviceNumber.zone.name
  1079. // this.genghuan.genghuan_chuang = list[i].order.DeviceNumber.number
  1080. // this.genghuan.g_boolen_id =list[i].order.blood_access_id
  1081. // this.genghuan.genghuan_remark = list[i].order.schedule_remark
  1082. // console.log('99999',this.genghuan);
  1083. // console.log('000000',list[i].bed_id);
  1084. // return this.genghuan
  1085. // }else{
  1086. // console.log('eeeeee');
  1087. // this.genghuan.name=''
  1088. // this.genghuan.mode_id=''
  1089. // this.genghuan.genghuan_fenqu=''
  1090. // this.genghuan.genghuan_chuang = ''
  1091. // this.genghuan.g_boolen_id = ''
  1092. // this.genghuan.genghuan_remark =''
  1093. // // return this.genghuan
  1094. // // console.log('qqqqqq',this.list[i].bed_id);
  1095. // }
  1096. // }
  1097. },
  1098. // 双击弹窗床位
  1099. dialogchuangwei(e){
  1100. console.log('333333',e);
  1101. for (let i = 0; i < this.subzone.length; i++) {
  1102. if(e==this.subzone[i].id){
  1103. this.chuangwei=e
  1104. console.log('77777',this.chuangwei);
  1105. }
  1106. }
  1107. for(let i=0;i<this.list.length;i++){
  1108. if(this.chuangwei==this.list[i].bed_id){
  1109. this.genghuan.id = this.list[i].id
  1110. this.genghuan.name=this.list[i].name
  1111. this.genghuan.mode_id=this.list[i].mode_id
  1112. this.genghuan.genghuan_fenqu=this.list[i].order.DeviceNumber.zone.name
  1113. this.genghuan.genghuan_chuang = this.list[i].order.DeviceNumber.number
  1114. this.genghuan.g_boolen_id = this.list[i].order.blood_access_id
  1115. this.genghuan.genghuan_remark = this.list[i].order.schedule_remark
  1116. console.log('99999',this.genghuan);
  1117. console.log('000000',this.list[i].bed_id);
  1118. return this.genghuan
  1119. }
  1120. if(this.chuangwei!=this.list[i].bed_id){
  1121. console.log('eeeeee');
  1122. this.genghuan.id = null
  1123. this.genghuan.name=''
  1124. this.genghuan.mode_id=''
  1125. this.genghuan.genghuan_fenqu=''
  1126. this.genghuan.genghuan_chuang = ''
  1127. this.genghuan.g_boolen_id = ''
  1128. this.genghuan.genghuan_remark =''
  1129. // return this.genghuan
  1130. // console.log('qqqqqq',this.list[i].bed_id);
  1131. }
  1132. }
  1133. // 更换的床位置
  1134. for(let y=0;y<this.subzone.length;y++){
  1135. if(this.chuangwei==this.subzone[y].id){
  1136. this.g_xian_fenqu=this.subzone[y]
  1137. }
  1138. }
  1139. },
  1140. verify_dialog(){
  1141. this.centerDialogVisible=false
  1142. console.log('444444444',this.huanzhe.id,this.genghuan.id);
  1143. let params={
  1144. id_one:this.huanzhe.id,
  1145. id_two:this.genghuan.id
  1146. }
  1147. ExchangeSch(params).then((response) => {
  1148. if (response.data.state == 0) {
  1149. this.$message.error(response.data.msg);
  1150. this.tipDialogVisibleThree = false
  1151. } else {
  1152. console.log('22222222',response.data);
  1153. this.$message.success("交换成功");
  1154. this.tipDialogVisible = false
  1155. this.tipDialogVisibleThree = false
  1156. this.getlist();
  1157. }
  1158. });
  1159. }
  1160. }
  1161. }
  1162. </script>
  1163. <style rel="stylesheet/scss" lang="scss" scoped>
  1164. #print_content {
  1165. background-color: white;
  1166. padding: 0 0 20px 0;
  1167. .content_top{
  1168. display: inline-block;
  1169. }
  1170. .order_title_panl {
  1171. text-align: center;
  1172. .main_title {
  1173. font-size: 18px;
  1174. line-height: 40px;
  1175. font-weight: 500;
  1176. }
  1177. }
  1178. .table_panel {
  1179. .table {
  1180. width: 100%;
  1181. border: 1px solid;
  1182. border-collapse: collapse;
  1183. padding: 2px;
  1184. thead {
  1185. tr {
  1186. td {
  1187. border: 1px solid;
  1188. text-align: center;
  1189. font-size: 20px;
  1190. padding: 15px 5px;
  1191. }
  1192. }
  1193. }
  1194. tbody {
  1195. tr {
  1196. td {
  1197. border: 1px solid;
  1198. // text-align: center;
  1199. font-size: 18px;
  1200. padding: 5px 5px;
  1201. .huanzhekuai{
  1202. width: 125px;
  1203. display: inline-block;
  1204. text-align: center;
  1205. // margin:0 10px;
  1206. }
  1207. .huanzhekuais{
  1208. width: 125px;
  1209. // display: inline-block;
  1210. text-align: center;
  1211. margin:0 10px;
  1212. // line-height: 110px;
  1213. background: #30b8e3;
  1214. }
  1215. }
  1216. }
  1217. }
  1218. }
  1219. }
  1220. }
  1221. </style>