血透系统PC前端

dialysisRecord.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <div class="patient-container">
  3. <patient-sidebar :id="patientID" defaultActive="2-2" v-on:tran-patient="onTranPatient"></patient-sidebar>
  4. <div class="patient-app-container app-container">
  5. <div>
  6. <el-form ref="form" :model="queryParams" label-width="80px" :inline="true">
  7. <!-- <el-form-item label="患者时间 : " >
  8. <el-select v-model="form.date" >
  9. <el-option v-for="item in dateOptions " :label="item.label" :value="item.value" :key="item.value" ></el-option>
  10. </el-select>
  11. </el-form-item> -->
  12. <el-form-item label="患者时间 :" >
  13. <el-col :span="11">
  14. <el-date-picker type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间" style="width:150px" v-model="queryParams.start_time" @change="changeSearch" ></el-date-picker>
  15. </el-col>
  16. <el-col class="line" :span="2">-</el-col>
  17. <el-col :span="11">
  18. <el-date-picker type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择结束时间" style="width:150px" v-model="queryParams.end_time" @change="changeSearch" ></el-date-picker>
  19. </el-col>
  20. </el-form-item>
  21. <el-form-item label="透析模式 : " style="margin-left:15px;">
  22. <el-select v-model="queryParams.mode_id" @change="changeSearch" clearable style="width:150px" >
  23. <el-option v-for="item in modeOptions " :label="item.name" :value="item.id" :key="item.id" ></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="" >
  27. <el-button style="float:right;" @click="printThisInfo()" type="primary" icon="el-icon-printer" >打印</el-button>
  28. </el-form-item>
  29. </el-form>
  30. </div>
  31. <div>
  32. <!-- <span class="total">共0条记录</span> -->
  33. <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="recordData" border style="width: 100%" @current-change="clickCurrent">
  34. <el-table-column prop="dialysis_date" label="透析日期" align="center" min-width="50">
  35. <template slot-scope="scope"><span>{{scope.row.dialysis_date | parseTime('{y}-{m}-{d}')}}</span></template>
  36. </el-table-column>
  37. <el-table-column prop="schedule_type" label="班次" align="center" min-width="60">
  38. <template slot-scope="scope"><span>{{scheduleType(scope.row.schedule_type)}}</span></template>
  39. </el-table-column>
  40. <el-table-column prop="partition" min-width="60" align="center" label="分区 - 机号">
  41. <template slot-scope="scope"><span>{{scope.row.partition_name}}-{{scope.row.device_number}}</span></template>
  42. </el-table-column>
  43. <el-table-column prop="mode" min-width="60" align="center" label="透析模式">
  44. <template slot-scope="scope">{{modeName(scope.row.prescription.mode_id)}}</template>
  45. </el-table-column>
  46. <el-table-column prop="prescription.dialysis_duration" width="80" align="center" label="透析时长 h">
  47. </el-table-column>
  48. <el-table-column prop="prescription.dry_weight" width="70" align="center" label="干体重 kg">
  49. </el-table-column>
  50. <el-table-column prop="predialysis_evaluation.weight_before" width="80" align="center" label="透前体重 kg">
  51. </el-table-column>
  52. <el-table-column prop="assessment_after_dislysis.weight_after" width="80" align="center" label="透后体重 kg">
  53. </el-table-column>
  54. <el-table-column prop="predialysis_evaluation" width="80" align="center" label="透前血压 mmhg">
  55. <template slot-scope="scope"><span>{{scope.row.predialysis_evaluation.systolic_blood_pressure}}/{{scope.row.predialysis_evaluation.diastolic_blood_pressure}}</span></template>
  56. </el-table-column>
  57. <el-table-column prop="assessment_after_dislysis" width="80" align="center" label="透后血压 mmhg">
  58. <template slot-scope="scope"><span>{{scope.row.assessment_after_dislysis.systolic_blood_pressure}}/{{scope.row.assessment_after_dislysis.diastolic_blood_pressure}}</span></template>
  59. </el-table-column>
  60. <el-table-column prop="predialysis_evaluation.ultrafiltration_amount" width="80" align="center" label="超滤总量 L">
  61. </el-table-column>
  62. <el-table-column prop="access" min-width="60" align="center" label="血管通路">
  63. <template slot-scope="scope"><span>{{setVascularAccess(scope.row.prescription)}}</span></template>
  64. </el-table-column>
  65. <el-table-column prop="type" width="110" align="center" label="抗凝剂种类 首剂/维持/总量">
  66. <template slot-scope="scope">
  67. <span>{{setAnticoagulantsConfit(scope.row.prescription)}}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="model" min-width="60" align="center" label="透析器型号">
  71. <template slot-scope="scope"><span>{{setDialyzerModel(scope.row.prescription)}}</span></template>
  72. </el-table-column>
  73. <el-table-column prop="nurse" min-width="60" align="center" label="治疗护士">
  74. <template slot-scope="scope"><span>{{getNurseName(scope.row.treatment_summary)}}</span></template>
  75. </el-table-column>
  76. <el-table-column prop="doctor" min-width="60" align="center" label="治疗医生">
  77. <template slot-scope="scope"><span>{{getDoctorName(scope.row.treatment_summary)}}</span></template>
  78. </el-table-column>
  79. </el-table>
  80. <el-pagination
  81. align="right"
  82. @size-change="handleSizeChange"
  83. @current-change="handleCurrentChange"
  84. :current-page="queryParams.page"
  85. :page-sizes="[10, 20, 50, 100]"
  86. :page-size="10"
  87. background
  88. style="margin-top:20px;"
  89. layout="total, sizes, prev, pager, next, jumper"
  90. :total="total">
  91. </el-pagination>
  92. </div>
  93. <div style="display:none;">
  94. <div id="printRecord" class="record-order">
  95. <div class="rd-title">{{orgname}}</div>
  96. <div class="rd-name">
  97. <span>姓名:<span class="item-value">{{currentPatient.name}}</span></span>
  98. <span style="margin-left:10px;">透析号:<span class="item-value">{{currentPatient.dialysis_no}}</span></span>
  99. </div>
  100. <table cellspacing="0" cellpadding="0" border="1" class="el-table__body" style="width: 100%;">
  101. <thead>
  102. <th>透析日期</th>
  103. <th>班次</th>
  104. <th>分区机号</th>
  105. <th>透析模式</th>
  106. <th>透析时长(h)</th>
  107. <th>干体重(kg)</th>
  108. <th>透前体重(kg)</th>
  109. <th>透后体重(kg)</th>
  110. <th>透前血压(mmhg)</th>
  111. <th>透后血压(mmhg)</th>
  112. <th>超滤总量(L)</th>
  113. <th>血管通路</th>
  114. <th>抗凝剂种类 首剂/维持/总量</th>
  115. <th>透析器型号</th>
  116. <th>治疗护士</th>
  117. <th>治疗医生</th>
  118. </thead>
  119. <tbody>
  120. <tr v-for="item in recordData" :key="item.id">
  121. <td>{{item.dialysis_date | parseTime('{y}-{m}-{d}')}}</td>
  122. <td>{{scheduleType(item.schedule_type)}}</td>
  123. <td>{{item.partition_name}}-{{item.device_number}}</td>
  124. <td>{{modeName(item.prescription.mode_id)}}</td>
  125. <td>{{item.prescription.dialysis_duration}}</td>
  126. <td>{{item.predialysis_evaluation.dry_weight}}</td>
  127. <td>{{item.predialysis_evaluation.weight_before}}</td>
  128. <td>{{item.assessment_after_dislysis.weight_after}}</td>
  129. <td>{{item.predialysis_evaluation.systolic_blood_pressure}}/{{item.predialysis_evaluation.diastolic_blood_pressure}}</td>
  130. <td>{{item.assessment_after_dislysis.systolic_blood_pressure}}/{{item.assessment_after_dislysis.diastolic_blood_pressure}}</td>
  131. <td>{{item.predialysis_evaluation.ultrafiltration_amount}}</td>
  132. <td>{{setVascularAccess(item.prescription)}}</td>
  133. <td>{{setAnticoagulantsConfit(item.prescription)}}</td>
  134. <td>{{item.prescription.dialyzer_perfusion_apparatus}}</td>
  135. <td>{{getNurseName(item.treatment_summary)}}</td>
  136. <td>{{getDoctorName(item.treatment_summary)}}</td>
  137. </tr>
  138. </tbody>
  139. </table>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </template>
  145. <script>
  146. import PatientSidebar from './components/PatientSidebar'
  147. import { getPatientDialysisRecords } from '@/api/patient'
  148. import { uParseTime } from '@/utils/tools'
  149. import { fetchAllDoctorAndNurse } from '@/api/doctor'
  150. import print from 'print-js'
  151. export default {
  152. name: 'dialysisRecord',
  153. data() {
  154. return {
  155. orgname: '',
  156. currentPatient: {},
  157. patientID: 0,
  158. total: 0,
  159. queryParams: {
  160. // date: "",
  161. mode_id: '',
  162. start_time: '',
  163. end_time: '',
  164. page: 1,
  165. patient_id: 0,
  166. limit: 10
  167. },
  168. recordData: [],
  169. dateOptions: [
  170. { value: '0', label: '本月' },
  171. { value: '1', label: '本年' }
  172. ],
  173. modeOptions: [],
  174. anticoagulantsConfit: [],
  175. blood_filters: [],
  176. perfusion_apparatus: [],
  177. hemodialysis_machines: [],
  178. doctorOptions: [],
  179. nurseOptions: [],
  180. vascularAccess: [],
  181. vascularAccessDesc: []
  182. }
  183. },
  184. components: {
  185. PatientSidebar
  186. },
  187. methods: {
  188. changeSearch() {
  189. this.getPatientDialysisRecords()
  190. },
  191. handleSizeChange(val) {
  192. this.queryParams.limit = val
  193. this.getPatientDialysisRecords()
  194. },
  195. handleCurrentChange(val) {
  196. this.queryParams.page = val
  197. this.getPatientDialysisRecords()
  198. },
  199. getPatientDialysisRecords() {
  200. getPatientDialysisRecords(this.queryParams).then(response => {
  201. if (response.data.state == 1) {
  202. this.total = response.data.data.total
  203. this.recordData = response.data.data.records
  204. }
  205. })
  206. },
  207. fetchAllDoctorAndNurse() {
  208. fetchAllDoctorAndNurse().then(response => {
  209. if (response.data.state == 1) {
  210. this.doctorOptions = response.data.data.doctors === null ? [] : response.data.data.doctors
  211. this.nurseOptions = response.data.data.nursers === null ? [] : response.data.data.nursers
  212. }
  213. })
  214. },
  215. scheduleType(schedule_type) {
  216. var typeName = '未知'
  217. switch (schedule_type) {
  218. case 1:
  219. typeName = '上午'
  220. break
  221. case 2:
  222. typeName = '下午'
  223. break
  224. case 3:
  225. typeName = '晚上'
  226. break
  227. default:
  228. break
  229. }
  230. return typeName
  231. },
  232. modeName(mode_id) {
  233. return typeof (this.modeOptions[mode_id]) !== 'undefined' && typeof (this.modeOptions[mode_id].name) !== 'undefined' ? this.modeOptions[mode_id].name : ''
  234. },
  235. setAnticoagulantsConfit(prescription) {
  236. if (typeof (this.anticoagulantsConfit[prescription.anticoagulant]) === 'undefined') {
  237. return ''
  238. } else {
  239. if (this.anticoagulantsConfit[prescription.anticoagulant].shouji != 1) {
  240. return this.anticoagulantsConfit[prescription.anticoagulant].name
  241. } else {
  242. return this.anticoagulantsConfit[prescription.anticoagulant].name + '/' + prescription.anticoagulant_shouji + '/' + prescription.anticoagulant_weichi + '/' + prescription.anticoagulant_zongliang
  243. }
  244. }
  245. },
  246. setVascularAccess(prescription) {
  247. if (typeof (this.vascularAccess[prescription.vascular_access_mode]) === 'undefined') {
  248. return ''
  249. } else {
  250. if (typeof (this.vascularAccessDesc[prescription.vascular_access]) === 'undefined') {
  251. return this.vascularAccess[prescription.vascular_access_mode].name
  252. } else {
  253. return this.vascularAccess[prescription.vascular_access_mode].name + '-' + this.vascularAccessDesc[prescription.vascular_access].name
  254. }
  255. }
  256. },
  257. setDialyzerModel(prescription) {
  258. var models = []
  259. if (prescription.hemodialysis_machine > 0) {
  260. var ml = this.hemodialysis_machines.length
  261. if (ml > 0) {
  262. for (let index = 0; index < ml; index++) {
  263. if (this.hemodialysis_machines[index].id == prescription.hemodialysis_machine) {
  264. models.push(this.hemodialysis_machines[index].name)
  265. }
  266. }
  267. }
  268. }
  269. if (prescription.blood_filter > 0) {
  270. var ml = this.blood_filters.length
  271. if (ml > 0) {
  272. for (let index = 0; index < ml; index++) {
  273. if (this.blood_filters[index].id == prescription.blood_filter) {
  274. models.push(this.blood_filters[index].name)
  275. }
  276. }
  277. }
  278. }
  279. if (prescription.perfusion_apparatus > 0) {
  280. var ml = this.perfusion_apparatus.length
  281. if (ml > 0) {
  282. for (let index = 0; index < ml; index++) {
  283. if (this.perfusion_apparatus[index].id == prescription.perfusion_apparatus) {
  284. models.push(this.perfusion_apparatus[index].name)
  285. }
  286. }
  287. }
  288. }
  289. return models.join(',')
  290. },
  291. getDoctorName(summary) {
  292. var dl = this.doctorOptions.length
  293. if (dl > 0) {
  294. for (let index = 0; index < dl; index++) {
  295. if (this.doctorOptions[index].id = summary.zl_doctor) {
  296. return this.doctorOptions[index].name
  297. }
  298. }
  299. }
  300. return ''
  301. },
  302. getNurseName(summary) {
  303. var dl = this.nurseOptions.length
  304. if (dl > 0) {
  305. for (let index = 0; index < dl; index++) {
  306. if (this.nurseOptions[index].id = summary.zl_nurse) {
  307. return this.nurseOptions[index].name
  308. }
  309. }
  310. }
  311. return ''
  312. },
  313. onTranPatient: function(tranPatient) {
  314. this.currentPatient = tranPatient
  315. },
  316. printThisInfo() {
  317. const style = '@media print { .record-order .rd-title{ text-align: center; font-weight: 600; font-size: 30px; line-height: 80px; margin-bottom: 20px; } .record-order .rd-type{ text-align: center; margin-bottom: 20px; } .record-order .rd-name { align-items: center; justify-content: space-between; padding: 30px 2em; } .record-order .el-table__body{ border: 1px solid #333; } .record-order .el-table__body td{ border: 1px solid #333; } .record-order .item-value { border-bottom: 1px solid #333; padding: 0 20px;} .record-order th, .record-order td { padding: 5px 10px; }}'
  318. setTimeout(() => {
  319. printJS({
  320. printable: 'printRecord',
  321. type: 'html',
  322. style: style,
  323. scanStyles: false
  324. })
  325. }, 1)
  326. }, clickCurrent(val) {
  327. this.$router.push({ path: '/dialysis/details', query: { patient_id: val.patient_id, date: val.dialysis_date }})
  328. }
  329. },
  330. created() {
  331. const id = this.$route.params && this.$route.params.id
  332. this.patientID = parseInt(id)
  333. if (isNaN(this.patientID) || this.patientID <= 0) {
  334. this.$notify.error({
  335. title: '错误',
  336. message: '无效的id'
  337. })
  338. this.$router.back(-1)
  339. }
  340. this.queryParams.patient_id = this.patientID
  341. this.modeOptions = this.$store.getters.treatment_mode
  342. this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit
  343. this.blood_filters = this.$store.getters.blood_filters
  344. this.perfusion_apparatus = this.$store.getters.perfusion_apparatus
  345. this.hemodialysis_machines = this.$store.getters.hemodialysis_machines
  346. this.vascularAccess = this.$store.getters.vascular_access
  347. this.vascularAccessDesc = this.$store.getters.vascular_access_desc
  348. this.fetchAllDoctorAndNurse()
  349. this.getPatientDialysisRecords()
  350. var xtuser = this.$store.getters.xt_user
  351. this.orgname = xtuser.org.org_name
  352. }
  353. }
  354. </script>
  355. <style rel='stylesheet/scss' lang="scss" scoped >
  356. .total {
  357. font-size: 14px;
  358. line-height: 32px;
  359. height: 32px;
  360. color: #6caef7;
  361. }
  362. .record-order .rd-title{
  363. text-align: center;
  364. font-weight: 600;
  365. font-size: 30px;
  366. line-height: 80px;
  367. margin-bottom: 20px;
  368. }
  369. .record-order .rd-type{
  370. text-align: center;
  371. margin-bottom: 20px;
  372. }
  373. .record-order .rd-name {
  374. align-items: center;
  375. justify-content: space-between;
  376. padding: 30px 2em;
  377. }
  378. </style>
  379. <style>
  380. .record-order .el-table__body{
  381. border: 1px solid #333;
  382. }
  383. .record-order .el-table__body td{
  384. border: 1px solid #333;
  385. }
  386. .record-order .item-value { border-bottom: 1px solid #333; padding: 0 20px;}
  387. .record-order th, .record-order td {
  388. padding: 5px 10px;
  389. }
  390. </style>