dialysisParams.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <template>
  2. <div class="page_dialysisParams">
  3. <div class="cell clearfix" style="margin-top:40px;margin-left:70px;">
  4. <!-- <label class="title">
  5. <span class="name">治疗日期</span> :
  6. </label>
  7. <div class="time">
  8. <ul class>
  9. <li
  10. :class="item.state == dayType ? 'active' : ''"
  11. @click="chooseDay(item.state)"
  12. v-for="item in day"
  13. :key="item.value"
  14. >{{ item.label }}</li>
  15. </ul>
  16. </div>
  17. <el-date-picker
  18. v-model="time"
  19. prefix-icon="el-icon-date"
  20. @change="changeTime"
  21. :editable="false"
  22. style="width: 150px;"
  23. type="date"
  24. placeholder="选择日期时间"
  25. align="right"
  26. format="yyyy-MM-dd"
  27. value-format="yyyy-MM-dd"
  28. ></el-date-picker> -->
  29. <label class="title" style="margin-left:10px;">
  30. <span class="name">患者信息</span> :
  31. </label>
  32. <div class="infoBox">
  33. <span>姓名:{{ patient.name }}</span>&nbsp;|&nbsp;<span>透析编号:{{ patient.dialysis_no }}</span>
  34. </div>
  35. </div>
  36. <div style="margin-left:70px;">
  37. <el-table :data="monitor_records" style="width: 100%" border :span-method='objectSpanMethod'>
  38. <el-table-column fixed prop="date" label="时间" width="140">
  39. <template slot-scope="scope">
  40. <p>{{ scope.row.created_time ? uParseTime(scope.row.created_time, '{y}-{m}-{d} {h}:{i}') : '' }}</p>
  41. <el-button size="mini" type="primary" v-clipboard:copy="uParseTime(scope.row.created_time, '{y}-{m}-{d} {h}:{i}')" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="name" :label="'静脉压\nmmHg'" width="120">
  45. <template slot-scope="scope">
  46. <p>{{ scope.row.venous_pressure }}</p>
  47. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.venous_pressure" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="province" :label="'动脉压\nmmHg'" width="120">
  51. <template slot-scope="scope">
  52. <p>{{ scope.row.arterial_pressure }}</p>
  53. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.arterial_pressure" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="city" :label="'电导度\nms/cm'" width="120">
  57. <template slot-scope="scope">
  58. <p>{{ scope.row.conductivity }}</p>
  59. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.conductivity" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="address" :label="'血流量\nml/min'" width="120">
  63. <template slot-scope="scope">
  64. <p>{{ scope.row.blood_flow_volume }}</p>
  65. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.blood_flow_volume" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  66. </template>
  67. </el-table-column>
  68. <el-table-column prop="zip" :label="'透析液流量\nml/min'" width="120">
  69. <template slot-scope="scope">
  70. <p>{{ scope.row.dialysate_flow }}</p>
  71. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.dialysate_flow" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  72. </template>
  73. </el-table-column>
  74. <el-table-column prop="zip" :label="'超滤率\nml/h'" width="120">
  75. <template slot-scope="scope">
  76. <p>{{ scope.row.ultrafiltration_rate }}</p>
  77. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.ultrafiltration_rate" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  78. </template>
  79. </el-table-column>
  80. <el-table-column prop="zip" :label="'抗凝剂\n单位/h'" width="120">
  81. </el-table-column>
  82. <el-table-column prop="zip" :label="'体温\n℃'" width="120">
  83. <template slot-scope="scope">
  84. <p>{{ scope.row.temperature }}</p>
  85. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.temperature" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  86. </template>
  87. </el-table-column>
  88. <el-table-column prop="zip" :label="'脉搏\n次/分'" width="120">
  89. <template slot-scope="scope">
  90. <p>{{ scope.row.pulse_frequency }}</p>
  91. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.pulse_frequency" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="zip" :label="'收缩压\nmmHg'" width="120">
  95. <template slot-scope="scope">
  96. <p>{{ scope.row.systolic_blood_pressure }}</p>
  97. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.systolic_blood_pressure" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  98. </template>
  99. </el-table-column>
  100. <el-table-column prop="zip" :label="'舒张压\nmmHg'" width="120">
  101. <template slot-scope="scope">
  102. <p>{{ scope.row.diastolic_blood_pressure }}</p>
  103. <el-button size="mini" type="primary" v-clipboard:copy="scope.row.diastolic_blood_pressure" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  104. </template>
  105. </el-table-column>
  106. <el-table-column prop="zip" label="症状及处理" width="300">
  107. <template slot-scope="scope">
  108. <div v-if="scope.$index == 1">
  109. <div v-for="item in doctor" :key="item">
  110. <p>{{ item }}</p>
  111. <el-button size="mini" type="primary" v-clipboard:copy="item" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</el-button>
  112. </div>
  113. </div>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <!-- <div class="table">
  118. <table class="fixedTable" border="1">
  119. <tr>
  120. <td style="height:60px;line-height:60px;border:none;border-bottom:1px solid #d0d3da;">时间</td>
  121. <td class="fixedColumn"></td>
  122. <td >静脉压<br />mmHg</td>
  123. <td >动脉压<br />mmHg</td>
  124. <td >电导度<br />ms/cm</td>
  125. <td >血流量<br />ml/min</td>
  126. <td >透析液流量<br />ml/min</td>
  127. <td >超滤率<br />ml/h</td>
  128. <td >抗凝剂<br />单位/h</td>
  129. <td >体温<br />℃</td>
  130. <td >脉搏<br />次/分</td>
  131. <td >收缩压<br />mmHg</td>
  132. <td >舒张压<br />mmHg</td>
  133. <td :rowspan="monitor_records.length + 1" style="width:300px;height:100%">
  134. <div>
  135. <div style="height:60px;line-height:60px;border-bottom:1px solid #d0d3da;">症状及处理</div>
  136. <div :style="{height: height}">
  137. <div v-for="item in doctor" :key="item">
  138. <p>{{ item }}</p>
  139. </div>
  140. </div>
  141. </div>
  142. </td>
  143. </tr>
  144. <tr v-for="(item,index) in monitor_records" :key="index">
  145. <td style="border:none">{{ uParseTime(item.created_time, '{y}-{m}-{d} {h}:{i}') }}</td>
  146. <td class="fixedColumn"></td>
  147. <td>{{ item.venous_pressure }}</td>
  148. <td>{{ item.arterial_pressure }}</td>
  149. <td>{{ item.conductivity }}</td>
  150. <td>{{ item.blood_flow_volume }}</td>
  151. <td>{{ item.dialysate_flow }}</td>
  152. <td>{{ item.ultrafiltration_rate }}</td>
  153. <td></td>
  154. <td>{{ item.temperature }}</td>
  155. <td>{{ item.pulse_frequency }}</td>
  156. <td>{{ item.systolic_blood_pressure }}</td>
  157. <td>{{ item.diastolic_blood_pressure }}</td>
  158. </tr>
  159. </table>
  160. </div> -->
  161. </div>
  162. </div>
  163. </template>
  164. <script>
  165. import { parseTime } from "@/utils";
  166. export default {
  167. props:{
  168. monitor_records:Array,
  169. patient:Object,
  170. doctor_advices:Array,
  171. prescription:Object,
  172. },
  173. data(){
  174. return{
  175. tableData: [
  176. {
  177. date: "2016",
  178. name: "王小虎"
  179. },
  180. {
  181. date: "2016",
  182. name: "王小虎"
  183. },
  184. {
  185. date: "2016",
  186. name: "王小虎"
  187. },
  188. {
  189. date: "2016",
  190. name: "王小虎"
  191. },
  192. {
  193. date: "2016",
  194. name: "王小虎"
  195. },
  196. {
  197. date: "2016",
  198. name: "王小虎"
  199. },
  200. {
  201. date: "2016",
  202. name: "王小虎"
  203. },
  204. {
  205. date: "2016",
  206. name: "王小虎"
  207. },
  208. {
  209. date: "2016",
  210. name: "王小虎"
  211. },
  212. {
  213. date: "2016",
  214. name: "王小虎"
  215. },
  216. {
  217. date: "2016",
  218. name: "王小虎"
  219. },
  220. {
  221. date: "2016",
  222. name: "王小虎"
  223. }
  224. ],
  225. tableData1: [
  226. {
  227. date: "2016-05-03",
  228. name: "王小虎",
  229. province: "上海",
  230. city: "普陀区",
  231. address: "上海市普陀区金沙江路 1518 弄",
  232. zip: 200333
  233. },
  234. {
  235. date: "2016-05-02",
  236. name: "王小虎",
  237. province: "上海",
  238. city: "普陀区",
  239. address: "上海市普陀区金沙江路 1518 弄",
  240. zip: 200333
  241. },
  242. {
  243. date: "2016-05-04",
  244. name: "王小虎",
  245. province: "上海",
  246. city: "普陀区",
  247. address: "上海市普陀区金沙江路 1518 弄",
  248. zip: 200333
  249. },
  250. {
  251. date: "2016-05-01",
  252. name: "王小虎",
  253. province: "上海",
  254. city: "普陀区",
  255. address: "上海市普陀区金沙江路 1518 弄",
  256. zip: 200333
  257. },
  258. {
  259. date: "2016-05-08",
  260. name: "王小虎",
  261. province: "上海",
  262. city: "普陀区",
  263. address: "上海市普陀区金沙江路 1518 弄",
  264. zip: 200333
  265. },
  266. {
  267. date: "2016-05-06",
  268. name: "王小虎",
  269. province: "上海",
  270. city: "普陀区",
  271. address: "上海市普陀区金沙江路 1518 弄",
  272. zip: 200333
  273. },
  274. {
  275. date: "2016-05-07",
  276. name: "王小虎",
  277. province: "上海",
  278. city: "普陀区",
  279. address: "上海市普陀区金沙江路 1518 弄",
  280. zip: 200333
  281. },
  282. {
  283. date: "2016-05-08",
  284. name: "王小虎",
  285. province: "上海",
  286. city: "普陀区",
  287. address: "上海市普陀区金沙江路 1518 弄",
  288. zip: 200333
  289. },
  290. {
  291. date: "2016-05-06",
  292. name: "王小虎",
  293. province: "上海",
  294. city: "普陀区",
  295. address: "上海市普陀区金沙江路 1518 弄",
  296. zip: 200333
  297. },
  298. {
  299. date: "2016-05-07",
  300. name: "王小虎",
  301. province: "上海",
  302. city: "普陀区",
  303. address: "上海市普陀区金沙江路 1518 弄",
  304. zip: 200333
  305. }
  306. ],
  307. day: [
  308. { value: 0, label: "今天", state: 0 },
  309. { value: 1, label: "昨天", state: 1 },
  310. { value: 2, label: "前天", state: 2 },
  311. ],
  312. dayType: 0,
  313. time:'',
  314. textarea:'',
  315. modeId:'',
  316. advices:[],
  317. height:''
  318. }
  319. },
  320. created(){
  321. if(this.monitor_records.length > 5){
  322. this.monitor_records = this.monitor_records
  323. }else{
  324. let num = 5 - this.monitor_records.length
  325. for(let i = 0; i<num;i++){
  326. this.monitor_records.push({id:0})
  327. }
  328. console.log(22222222222222222,this.monitor_records)
  329. }
  330. if(this.prescription.mode_id){
  331. this.modeId = this.getMode(this.prescription.mode_id)
  332. }
  333. if(this.doctor_advices.length > 0){
  334. let str = ''
  335. let arr = []
  336. this.advices = this.doctor_advices
  337. this.advices.map(item => {
  338. str = item.advice_name + (item.advice_desc ? ('(' + item.advice_desc + item.drug_spec_unit + ')') : '' ) + ' ' + item.prescribing_number + item.prescribing_number_unit + ' ' +
  339. item.single_dose + item.single_dose_unit + ' ' + item.delivery_way + item.execution_frequency + item.remark
  340. arr.push(str)
  341. })
  342. this.doctor = arr
  343. // this.textarea = ''
  344. // arr.map(item => {
  345. // this.textarea += item + "\n"
  346. // })
  347. }else if(this.doctor_advices.length == 0){
  348. this.textarea = ''
  349. this.textarea = '1.开始' + this.modeId + '治疗' + '\n' +
  350. '2.结束' + this.modeId + '治疗' + '\n' +
  351. '3.患者离开血透室'
  352. }
  353. },
  354. methods:{
  355. chooseDay(day) {
  356. this.dayType = day;
  357. },
  358. uParseTime(time, cFormat) {
  359. if (time === 0) {
  360. return ''
  361. }
  362. if (arguments.length === 0) {
  363. return null
  364. }
  365. const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
  366. let date
  367. if (typeof time === 'object') {
  368. date = time
  369. } else {
  370. if (('' + time).length !== 13) time = parseInt(time) * 1000
  371. date = new Date(time)
  372. }
  373. const formatObj = {
  374. y: date.getFullYear(),
  375. m: date.getMonth() + 1,
  376. d: date.getDate(),
  377. h: date.getHours(),
  378. i: date.getMinutes(),
  379. s: date.getSeconds(),
  380. a: date.getDay()
  381. }
  382. const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
  383. let value = formatObj[key]
  384. if (key === 'a') {
  385. return ['一', '二', '三', '四', '五', '六', '日'][value - 1]
  386. }
  387. if (result.length > 0 && value < 10) {
  388. value = '0' + value
  389. }
  390. return value || 0
  391. })
  392. return time_str
  393. },
  394. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  395. // console.log('rowIndex',rowIndex)
  396. // console.log('columnIndex',columnIndex)
  397. console.log('this.monitor_records.length',this.monitor_records.length)
  398. if (columnIndex === 12) {
  399. if (rowIndex > 0) {
  400. return {
  401. rowspan: this.monitor_records.length - 1 ,
  402. colspan: 1
  403. };
  404. }else{
  405. return {
  406. rowspan: 0 ,
  407. colspan: 0
  408. };
  409. }
  410. }
  411. },
  412. getMode(id){
  413. let name = ''
  414. this.treatment_mode = Object.values(this.$store.getters.treatment_mode)
  415. this.treatment_mode.map(item => {
  416. if(item.id == id){
  417. name = item.name
  418. }
  419. })
  420. return name
  421. },
  422. onCopy() {
  423. this.$message.success("复制成功");
  424. },
  425. onError() {
  426. this.$message.success("复制失败,请重试");
  427. }
  428. },
  429. watch:{
  430. monitor_records:{
  431. handler:function(val) {
  432. if(this.monitor_records.length > 5){
  433. this.monitor_records = this.monitor_records
  434. }else{
  435. let num = 5 - this.monitor_records.length
  436. for(let i =0; i<num;i++){
  437. this.monitor_records.push({id:1})
  438. }
  439. console.log(333333333333,this.monitor_records)
  440. }
  441. }
  442. },
  443. patient:{
  444. handler:function(val) {
  445. }
  446. },
  447. doctor_advices:{
  448. handler:function(val) {
  449. if(this.doctor_advices.length > 0){
  450. let str = ''
  451. let arr = []
  452. this.advices = this.doctor_advices
  453. this.advices.map(item => {
  454. str = item.advice_name + (item.advice_desc ? ('(' + item.advice_desc + item.drug_spec_unit + ')') : '' ) + ' ' + item.prescribing_number + item.prescribing_number_unit + ' ' +
  455. item.single_dose + item.single_dose_unit + ' ' + item.delivery_way + item.execution_frequency + item.remark
  456. arr.push(str)
  457. })
  458. this.textarea = ''
  459. arr.map(item => {
  460. this.textarea += item + "\n"
  461. })
  462. }else if(this.doctor_advices.length == 0){
  463. this.textarea = ''
  464. this.textarea = '1.开始' + this.modeId + '治疗' + '\n' +
  465. '2.结束' + this.modeId + '治疗' + '\n' +
  466. '3.患者离开血透室'
  467. }
  468. }
  469. },
  470. prescription:{
  471. handler:function(val) {
  472. if(this.prescription.mode_id){
  473. this.modeId = this.getMode(this.prescription.mode_id)
  474. }
  475. }
  476. },
  477. deep:true,
  478. }
  479. }
  480. </script>
  481. <style lang="scss" scoped>
  482. .tableTitle {
  483. font-size: 16px;
  484. color: #000;
  485. font-weight: bold;
  486. line-height: 40px;
  487. }
  488. .page_dialysisParams{
  489. // width: 76%;
  490. padding-right: 10px;
  491. .infoBox{
  492. padding: 10px 20px;
  493. border-radius: 20px;
  494. border:1px solid #DCDFE6;
  495. font-size: 14px;
  496. color: #606266;
  497. display: flex;
  498. align-items: center;
  499. }
  500. .paramsTable{
  501. // width: 1600px;
  502. width:160%;
  503. border: 1px solid #000;
  504. border-spacing: 0px;
  505. border-collapse: collapse;
  506. }
  507. .paramsTable td{
  508. border:1px solid #000;
  509. padding:5px;
  510. }
  511. .paramsTable th{
  512. border:1px solid #000;
  513. padding:5px;
  514. }
  515. // .paramsTable td:first-child{
  516. // position:absolute
  517. // }
  518. // .paramsTable th:first-child{
  519. // position:absolute
  520. // }
  521. .table{width:100%;overflow-x: scroll;}
  522. .fixedTable{width:160%;text-align: center;color:#000;font-size:14px; border-collapse:collapse;background: #fff;}
  523. .fixedTable tr{line-height: 30px;border:1px solid #d0d3da;}
  524. // .fixedTable tr:first-child{height:40px;line-height: 40px;}
  525. .fixedTable td:first-child{position:absolute;width:140px;margin:0px 0px 0px 0px;background: #fff;}
  526. .fixedColumn{width:140px;}
  527. }
  528. </style>
  529. <style lang="scss">
  530. .page_dialysisParams{
  531. .el-table td, .el-table th{
  532. text-align: center;
  533. }
  534. .el-table .cell{
  535. display: flex;
  536. align-items: center;
  537. flex-direction: column;
  538. white-space: pre-line;
  539. text-align: center;
  540. }
  541. ::-webkit-scrollbar{
  542. height: 15px !important;
  543. }
  544. }
  545. html, body {
  546. width: 100% !important;
  547. height: 100% !important;
  548. }
  549. </style>