dialysisParameters.vue 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <div class="page_consumables">
  3. <div class="cell clearfix">
  4. <label class="title"> <span class="name">排班班次</span> : </label>
  5. <div class="time">
  6. <ul class>
  7. <li
  8. :class="item.value == scheduleType ? 'active' : ''"
  9. @click="selectSchedulType(item.value)"
  10. v-for="item in schedulArr"
  11. :key="item.value"
  12. >
  13. {{ item.label }}
  14. </li>
  15. </ul>
  16. </div>
  17. <label class="title"><span class="name">日期查询</span> : </label>
  18. <el-date-picker size="small" v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 196px;margin-right:10px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
  19. <el-input size="small" style="width: 180px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
  20. <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  21. </div>
  22. <div class="cell clearfix" style="justify-content: space-between;">
  23. <div style="display:flex;">
  24. <label class="title"> <span class="name">分区</span> : </label>
  25. <div class="time">
  26. <ul class>
  27. <li
  28. :class="item.id == partitionType ? 'active' : ''"
  29. @click="selectPartitionType(item.id)"
  30. v-for="item in partitionArr"
  31. :key="item.id"
  32. >
  33. {{ item.name }}
  34. </li>
  35. </ul>
  36. </div>
  37. </div>
  38. <div>
  39. <el-button size="small" icon="el-icon-printer" type="primary" @click="toPrint">打印</el-button>
  40. <el-button size="small" type="primary" @click="statistics">统计表</el-button>
  41. </div>
  42. </div>
  43. <div>
  44. <el-table
  45. :data="tableData"
  46. border
  47. style="width: 100%"
  48. :row-style="{ color: '#303133' }"
  49. :header-cell-style="{
  50. backgroundColor: 'rgb(245, 247, 250)',
  51. color: '#606266'
  52. }"
  53. @selection-change="handleSelectionChange">
  54. <el-table-column align="center" type="selection" width="55">
  55. </el-table-column>
  56. <el-table-column align="center" fixed label="姓名" width="80">
  57. <template slot-scope="scope">
  58. {{scope.row.patient.name?scope.row.patient.name:""}}
  59. </template>
  60. </el-table-column>
  61. <el-table-column align="center" label="透析模式" width="100">
  62. <template slot-scope="scope">
  63. {{scope.row.treatment_mode.name?scope.row.treatment_mode.name:""}}
  64. </template>
  65. </el-table-column>
  66. <el-table-column align="center" label="上次透后体重(kg)" width="280">
  67. <template slot-scope="scope">
  68. {{getLastWeight(scope.row.patient.id)?getLastWeight(scope.row.patient.id):""}}
  69. </template>
  70. </el-table-column>
  71. <el-table-column align="center" label="透前体重(kg)" width="120">
  72. <template slot-scope="scope">
  73. {{getWeightBefor(scope.row.patient_id)?getWeightBefor(scope.row.patient_id):""}}
  74. </template>
  75. </el-table-column>
  76. <el-table-column align="center" label="干体重(kg)" width="140">
  77. <template slot-scope="scope">
  78. {{getDryWeight(scope.row.patient_id)?getDryWeight(scope.row.patient_id):""}}
  79. </template>
  80. </el-table-column>
  81. <el-table-column align="center" label="透前血压(mmhg)" width="180">
  82. <template slot-scope="scope">
  83. {{getSysBloodPressure(scope.row.patient_id)?getSysBloodPressure(scope.row.patient_id):""}}
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="center" label="目标超滤量" width="120">
  87. <template slot-scope="scope">
  88. {{getTargetUltrafiltration(scope.row.patient_id)?getTargetUltrafiltration(scope.row.patient_id):""}}
  89. </template>
  90. </el-table-column>
  91. <el-table-column align="center" label="血流量(ml/min)" width="180">
  92. <template slot-scope="scope">
  93. {{getBloodFlowVolume(scope.row.patient_id)?getBloodFlowVolume(scope.row.patient_id):""}}
  94. </template>
  95. </el-table-column>
  96. <el-table-column align="center" label="抗凝剂(首剂)(维持)(总量)" width="300">
  97. <template slot-scope="scope">
  98. <span v-if="getAnticoagulant(scope.row.patient_id) == 0"></span>
  99. <span v-if="getAnticoagulant(scope.row.patient_id) == 1">无肝素</span>
  100. <span v-if="getAnticoagulant(scope.row.patient_id) == 2">普通肝素</span>
  101. <span v-if="getAnticoagulant(scope.row.patient_id) == 3">低分子肝素</span>
  102. <span v-if="getAnticoagulant(scope.row.patient_id) == 4">阿加曲班</span>
  103. <span v-if="getAnticoagulant(scope.row.patient_id) == 5">枸橼酸钠</span>
  104. <span v-if="getAnticoagulant(scope.row.patient_id)== 6">低分子肝素钙</span>
  105. <span v-if="getAnticoagulant(scope.row.patient_id) == 7">低分子肝素钠</span>
  106. <span v-if="getAnticoagulant(scope.row.patient_id) == 8">依诺肝素</span>
  107. <span v-if="getAnticoagulant(scope.row.patient_id) == 9">达肝素</span>
  108. <span v-if="getAnticoagulant(scope.row.patient_id) == 10">体外抗凝</span>
  109. <span>
  110. {{getAnticoagulantShouji(scope.row.patient_id)?getAnticoagulantShouji(scope.row.patient_id):''}}
  111. <span v-if="getAnticoagulant(scope.row.patient_id) ==1 && getAnticoagulantShouji(scope.row.patient_id)!=''">mg)</span>
  112. <span v-if="getAnticoagulant(scope.row.patient_id) == 2 && getAnticoagulantShouji(scope.row.patient_id)!=''">iu/h)</span>
  113. <span v-if="getAnticoagulant(scope.row.patient_id) == 3 && getAnticoagulantShouji(scope.row.patient_id)!=''">iu)</span>
  114. <span v-if="getAnticoagulant(scope.row.patient_id) == 4 && getAnticoagulantShouji(scope.row.patient_id)!=''">mg)</span>
  115. <span v-if="getAnticoagulant(scope.row.patient_id) == 5 && getAnticoagulantShouji(scope.row.patient_id)!=''">mg)</span>
  116. <span v-if="getAnticoagulant(scope.row.patient_id) == 6 && getAnticoagulantShouji(scope.row.patient_id)!=''">iu)</span>
  117. <span v-if="getAnticoagulant(scope.row.patient_id) == 7 && getAnticoagulantShouji(scope.row.patient_id)!=''">iu)</span>
  118. <span v-if="getAnticoagulant(scope.row.patient_id)== 8 && getAnticoagulantShouji(scope.row.patient_id)!=''">iu)</span>
  119. <span v-if="getAnticoagulant(scope.row.patient_id) == 9 && getAnticoagulantShouji(scope.row.patient_id)!=''">iu)</span>
  120. <span v-if="getAnticoagulant(scope.row.patient_id)== 10 && getAnticoagulantShouji(scope.row.patient_id)!=''">mg)</span>
  121. </span>
  122. <span>
  123. {{getAnticoagulantWeichi(scope.row.patient_id)?getAnticoagulantWeichi(scope.row.patient_id):''}}
  124. <span v-if="getAnticoagulant(scope.row.patient_id) == 1 && getAnticoagulantWeichi(scope.row.patient_id)!=''">mg/h)</span>
  125. <span v-if="getAnticoagulant(scope.row.patient_id) == 2 && getAnticoagulantWeichi(scope.row.patient_id)!=''">iu/h)</span>
  126. <span v-if="getAnticoagulant(scope.row.patient_id) == 3 && getAnticoagulantWeichi(scope.row.patient_id)!=''">iu/h)</span>
  127. <span v-if="getAnticoagulant(scope.row.patient_id) == 4 && getAnticoagulantWeichi(scope.row.patient_id)!=''">mg/h)</span>
  128. <span v-if="getAnticoagulant(scope.row.patient_id) == 5 && getAnticoagulantWeichi(scope.row.patient_id)!=''">ml/h)</span>
  129. <span v-if="getAnticoagulant(scope.row.patient_id) == 6 && getAnticoagulantWeichi(scope.row.patient_id)!=''">iu/h)</span>
  130. <span v-if="getAnticoagulant(scope.row.patient_id) == 7 && getAnticoagulantWeichi(scope.row.patient_id)!=''">iu/h)</span>
  131. <span v-if="getAnticoagulant(scope.row.patient_id) == 8 && getAnticoagulantWeichi(scope.row.patient_id)!=''">iu/h)</span>
  132. <span v-if="getAnticoagulant(scope.row.patient_id) == 9 && getAnticoagulantWeichi(scope.row.patient_id)!=''">iu/h)</span>
  133. <span v-if="getAnticoagulant(scope.row.patient_id) == 10 && getAnticoagulantWeichi(scope.row.patient_id)!=''">mg)</span>
  134. </span>
  135. <span>
  136. {{getAnticoagulantZongliang(scope.row.patient_id)?getAnticoagulantZongliang(scope.row.patient_id):''}}
  137. <span v-if="getAnticoagulant(scope.row.patient_id) == 1 && getAnticoagulantZongliang(scope.row.patient_id)!=''">mg)</span>
  138. <span v-if="getAnticoagulant(scope.row.patient_id) == 2 && getAnticoagulantZongliang(scope.row.patient_id)!=''">iu)</span>
  139. <span v-if="getAnticoagulant(scope.row.patient_id) == 3 && getAnticoagulantZongliang(scope.row.patient_id)!=''">iu)</span>
  140. <span v-if="getAnticoagulant(scope.row.patient_id) == 4 && getAnticoagulantZongliang(scope.row.patient_id)!=''">mg)</span>
  141. <span v-if="getAnticoagulant(scope.row.patient_id) == 5 && getAnticoagulantZongliang(scope.row.patient_id)!=''">mg)</span>
  142. <span v-if="getAnticoagulant(scope.row.patient_id) == 6 && getAnticoagulantZongliang(scope.row.patient_id)!=''">iu/h)</span>
  143. <span v-if="getAnticoagulant(scope.row.patient_id) == 7 && getAnticoagulantZongliang(scope.row.patient_id)!=''">iu)</span>
  144. <span v-if="getAnticoagulant(scope.row.patient_id) == 8 && getAnticoagulantZongliang(scope.row.patient_id)!=''">iu)</span>
  145. <span v-if="getAnticoagulant(scope.row.patient_id) == 9 && getAnticoagulantZongliang(scope.row.patient_id)!=''">iu/h)</span>
  146. <span v-if="getAnticoagulant(scope.row.patient_id) == 10 && getAnticoagulantZongliang(scope.row.patient_id)!=''">mg)</span>
  147. </span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column align="center" label="透析器/灌流器" width="200">
  151. <template slot-scope="scope">
  152. {{getDialyzerPerfusionApparatus(scope.row.patient_id)?getDialyzerPerfusionApparatus(scope.row.patient_id):""}}
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <el-pagination
  157. align="right"
  158. @size-change="handleSizeChange"
  159. @current-change="handleCurrentChange"
  160. :page-sizes="[10, 20, 30, 50]"
  161. :page-size="10"
  162. background
  163. style="margin-top:20px;"
  164. layout="total, sizes, prev, pager, next, jumper"
  165. :total="total"
  166. ></el-pagination>
  167. </div>
  168. <!-- <consumables-dialog ref="consumables"></consumables-dialog> -->
  169. <dialysisParameters-dialog ref="dialysisParameters"></dialysisParameters-dialog>
  170. </div>
  171. </template>
  172. <script>
  173. import { GetAllZone } from "@/api/dialysis";
  174. import consumablesDialog from './consumablesDialog'
  175. import dialysisParametersDialog from './dialysisParametersDialog'
  176. import { parseTime } from "@/utils";
  177. import { getDialysisParameters } from "@/api/consumable"
  178. const moment = require('moment')
  179. export default {
  180. components:{
  181. consumablesDialog,
  182. dialysisParametersDialog
  183. },
  184. data(){
  185. return{
  186. scheduleType: 0,
  187. schedulArr: [
  188. { value: 0, label: "全部" },
  189. { value: 1, label: "上午" },
  190. { value: 2, label: "下午" },
  191. { value: 3, label: "晚上" }
  192. ],
  193. // selected_date:new Date(),
  194. selected_date:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  195. partitionArr:[],
  196. partitionType: 0,
  197. tableData: [],
  198. search_input:"",
  199. limit:10,
  200. page:1,
  201. total:0,
  202. start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  203. selecting_schs: [],
  204. prescriptionList:[],
  205. dialysisBefor:[]
  206. }
  207. },
  208. created(){
  209. //获取所有分区
  210. this.getAllZone()
  211. //获取透析参数
  212. this.getlist()
  213. },
  214. methods:{
  215. selectSchedulType(scheduleType) {
  216. this.scheduleType = scheduleType;
  217. this.getlist()
  218. },
  219. selectPartitionType(partitionType) {
  220. this.partitionType = partitionType;
  221. this.getlist()
  222. },
  223. getAllZone: function() {
  224. GetAllZone().then(response => {
  225. if (response.data.state == 0) {
  226. this.$message.error(response.data.msg);
  227. return false;
  228. } else {
  229. this.partitionArr = response.data.data.zone;
  230. this.partitionArr.unshift({ id: 0, name: "全部" });
  231. }
  232. });
  233. },
  234. statistics(){
  235. this.$refs.dialysisParameters.show();
  236. },
  237. search(){
  238. // if(this.selected_date==""){
  239. // this.start_time = moment(new Date()).add('year',0).format("YYYY-MM-DD")
  240. // }
  241. // if(this.selected_date!=''){
  242. // this.start_time = parseTime(this.selected_date, '{y}-{m}-{d}')
  243. // }
  244. const params ={
  245. start_time:this.start_time,
  246. keyword:this.search_input,
  247. scheduleType: this.scheduleType,
  248. partitionType:this.partitionType,
  249. limit:this.limit,
  250. page:this.page
  251. }
  252. getDialysisParameters(params).then(response=>{
  253. if(response.data.state == 1){
  254. var schedule = response.data.data.schedule
  255. // console.log("schedule",schedule)
  256. this.tableData = schedule
  257. var total = response.data.data.total
  258. this.total = total
  259. }
  260. })
  261. },
  262. handleScheduleDateChange(){
  263. var startime = parseTime(this.selected_date,'{y}-{m}-{d}')
  264. this.start_time = startime
  265. this.getlist()
  266. },
  267. getTimestamp(time) {
  268. // 把时间日期转成时间戳
  269. return new Date(time).getTime() / 1000;
  270. },
  271. getlist(){
  272. // if(this.selected_date==""){
  273. // this.start_time = moment(new Date()).add('year',0).format("YYYY-MM-DD")
  274. // }
  275. // if(this.selected_date!=''){
  276. // this.start_time = parseTime(this.selected_date, '{y}-{m}-{d}')
  277. // }
  278. const params ={
  279. start_time:this.start_time,
  280. keyword:this.search_input,
  281. scheduleType: this.scheduleType,
  282. partitionType:this.partitionType,
  283. limit:this.limit,
  284. page:this.page
  285. }
  286. getDialysisParameters(params).then(response=>{
  287. if(response.data.state == 1){
  288. var schedule = response.data.data.schedule
  289. console.log("schedule",schedule)
  290. this.tableData = schedule
  291. var total = response.data.data.total
  292. this.total = total
  293. var prescription = response.data.data.prescription
  294. this.prescriptionList = prescription
  295. var dialysbefor = response.data.data.dialysbefor
  296. this.dialysisBefor = dialysbefor
  297. console.log("dialysbefor",dialysbefor)
  298. }
  299. })
  300. },
  301. handleSelectionChange(val){
  302. this.selecting_schs = val;
  303. },
  304. toPrint(){
  305. if(this.selecting_schs.length === 0) {
  306. this.$message.error("请至少选择一条需要打印的内容");
  307. return false;
  308. }
  309. var sch_ids = [];
  310. for (let index = 0; index < this.selecting_schs.length; index++) {
  311. sch_ids.push(this.selecting_schs[index].id);
  312. }
  313. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  314. this.$router.push("/dialysis/dialysisParameters_print?startime="+this.start_time)
  315. },
  316. handleSizeChange(val) {
  317. this.limit = val;
  318. this.getlist();
  319. },
  320. handleCurrentChange(val) {
  321. this.page = val;
  322. this.getlist()
  323. },
  324. getLastWeight(id){
  325. var lastweight = ""
  326. for(let i=0;i<this.dialysisBefor.length;i++){
  327. if(this.dialysisBefor[i].patient_id == id){
  328. lastweight = this.dialysisBefor[i].weight_after_last_transparency
  329. }
  330. }
  331. return lastweight
  332. },
  333. getWeightBefor(id){
  334. var assessmentBeforWeight = ""
  335. for(let i=0;i<this.dialysisBefor.length;i++){
  336. if(this.dialysisBefor[i].patient_id == id){
  337. assessmentBeforWeight = this.dialysisBefor[i].weight_before
  338. }
  339. }
  340. return assessmentBeforWeight
  341. },
  342. getDryWeight(id){
  343. var dryWeight = ""
  344. for(let i=0;i<this.dialysisBefor.length;i++){
  345. if(this.dialysisBefor[i].patient_id == id){
  346. dryWeight = this.dialysisBefor[i].dry_weight
  347. }
  348. }
  349. return dryWeight
  350. },
  351. getSysBloodPressure(id){
  352. var sysBloodPressure = ""
  353. for(let i=0;i<this.dialysisBefor.length;i++){
  354. if(this.dialysisBefor[i].patient_id == id){
  355. sysBloodPressure = this.dialysisBefor[i].systolic_blood_pressure
  356. }
  357. }
  358. return sysBloodPressure
  359. },
  360. getTargetUltrafiltration(id){
  361. var targetUltrafiltration = ""
  362. for(let i=0;i<this.prescriptionList.length;i++){
  363. if(this.prescriptionList[i].patient_id == id){
  364. targetUltrafiltration = this.prescriptionList[i].target_ultrafiltration
  365. }
  366. }
  367. return targetUltrafiltration
  368. },
  369. getBloodFlowVolume(id){
  370. var bloodFlowVolume = ""
  371. for(let i=0;i<this.prescriptionList.length;i++){
  372. if(this.prescriptionList[i].patient_id == id){
  373. bloodFlowVolume = this.prescriptionList[i].blood_flow_volume
  374. }
  375. }
  376. return bloodFlowVolume
  377. },
  378. getDialyzerPerfusionApparatus(id){
  379. var dialyzerPerfusionApparatus = ""
  380. for(let i=0;i<this.prescriptionList.length;i++){
  381. if(this.prescriptionList[i].patient_id == id){
  382. dialyzerPerfusionApparatus = this.prescriptionList[i].dialyzer_perfusion_apparatus
  383. }
  384. }
  385. return dialyzerPerfusionApparatus
  386. },
  387. getAnticoagulant(id){
  388. var anticoagulant = ""
  389. for(let i=0;i<this.prescriptionList.length;i++){
  390. if(this.prescriptionList[i].patient_id == id){
  391. anticoagulant = this.prescriptionList[i].anticoagulant
  392. }
  393. }
  394. return anticoagulant
  395. },
  396. getAnticoagulantShouji(id){
  397. var shouji = ""
  398. for(let i=0;i<this.prescriptionList.length;i++){
  399. if(this.prescriptionList[i].patient_id == id){
  400. shouji = "("+this.prescriptionList[i].anticoagulant_shouji
  401. }
  402. }
  403. return shouji
  404. },
  405. getAnticoagulantWeichi(id){
  406. var weichi = ""
  407. for(let i=0;i<this.prescriptionList.length;i++){
  408. if(this.prescriptionList[i].patient_id == id){
  409. weichi = "("+this.prescriptionList[i].anticoagulant_weichi
  410. }
  411. return weichi
  412. }
  413. },
  414. getAnticoagulantZongliang(id){
  415. var zongliang = ""
  416. for(let i=0;i<this.prescriptionList.length;i++){
  417. if(this.prescriptionList[i].patient_id == id){
  418. zongliang = "("+this.prescriptionList[i].anticoagulant_zongliang
  419. }
  420. }
  421. return zongliang
  422. }
  423. }
  424. }
  425. </script>
  426. <style lang="scss" scoped>
  427. .page_consumables{
  428. .clearfix:after{
  429. content:none;
  430. }
  431. }
  432. </style>