血透系统PC前端

bloodPresssWatch.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. <template v-if="this.template_id == 1">
  6. <el-button size="small" icon="el-icon-printer" :disabled="selecting_schs.length == 0" @click="batchPrintAction" type="primary">打印</el-button>
  7. </template>
  8. <template v-if="this.template_id == 2 || this.template_id == 0">
  9. <div >
  10. <el-button :loading="loading" size="small" icon="el-icon-printer" @click="batchPrintAction" type="primary">打印全部</el-button>
  11. <el-button :loading="loading" size="small" icon="el-icon-printer" @click="batchPrintActionOne" type="primary" style="">打印纪录单</el-button>
  12. <el-button :loading="loading" size="small" icon="el-icon-printer" @click="batchPrintActionTwo" type="primary">打印医嘱单</el-button>
  13. </div>
  14. </template>
  15. <template v-if="this.template_id == 3">
  16. <el-button size="small" icon="el-icon-printer" :disabled="selecting_schs.length == 0" @click="batchPrintAction" type="primary">打印</el-button>
  17. </template>
  18. <template v-if="this.template_id == 4">
  19. <el-button size="small" icon="el-icon-printer" :disabled="selecting_schs.length == 0" @click="batchPrintAction" type="primary">打印</el-button>
  20. </template>
  21. <template v-if="this.template_id == 5">
  22. <div >
  23. <el-button :loading="loading" size="small" icon="el-icon-printer" @click="batchPrintAction" type="primary">打印全部</el-button>
  24. <el-button :loading="loading" size="small" icon="el-icon-printer" @click="batchPrintActionOne" type="primary" style="">打印纪录单</el-button>
  25. <el-button :loading="loading" size="small" icon="el-icon-printer" @click="batchPrintActionTwo" type="primary">打印医嘱单</el-button>
  26. </div>
  27. </template>
  28. <template v-if="this.template_id == 6">
  29. <el-button size="small" icon="el-icon-printer" :disabled="selecting_schs.length == 0" @click="batchPrintAction" type="primary">打印</el-button>
  30. </template>
  31. </div>
  32. <div class="app-container">
  33. <!-- <div class="filter-container">
  34. <el-input style="width: 400px;" v-model="searchKey" class="filter-item"/>
  35. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  36. </div>-->
  37. <div class="cell clearfix">
  38. <label class="title">
  39. <span class="name">{{ search_mode == 1 ? "日期查询" : "病人查询" }}</span> :
  40. </label>
  41. <el-date-picker
  42. v-show="search_mode == 1"
  43. v-model="time"
  44. prefix-icon="el-icon-date"
  45. @change="changeTime"
  46. :editable="false"
  47. style="width: 250px;"
  48. type="date"
  49. placeholder="选择日期时间"
  50. align="right"
  51. :picker-options="pickerOptions1"
  52. format="yyyy-MM-dd"
  53. value-format="timestamp"
  54. ></el-date-picker>
  55. <el-input
  56. v-show="search_mode == 2"
  57. v-model="patient_search_keyword"
  58. style="width: 250px;"
  59. placeholder="病人名字、透析号"
  60. >
  61. <el-button
  62. slot="append"
  63. style="background-color: #409EFF; color: white; border-radius: 0;"
  64. icon="el-icon-search"
  65. @click="searchPatientAction"
  66. ></el-button>
  67. </el-input>
  68. <el-button
  69. type="primary"
  70. @click="changeSearchMode"
  71. >{{ search_mode == 1 ? "改为病人查询" : "改为日期查询" }}</el-button>
  72. <!-- <el-button type="primary" :disabled="selecting_schs.length == 0" @click="batchPrintAction">打印</el-button> -->
  73. </div>
  74. <div class="cell clearfix">
  75. <label class="title">
  76. <span class="name">排班班次</span> :
  77. </label>
  78. <div class="time">
  79. <ul class>
  80. <li
  81. :class="item.value==schedulType?'active':''"
  82. @click="selectSchedulType(item.value)"
  83. v-for="item in schedulArr"
  84. :key="item.value"
  85. >{{item.label}}</li>
  86. </ul>
  87. </div>
  88. </div>
  89. <div class="cell clearfix">
  90. <label class="title">
  91. <span class="name">分区</span> :
  92. </label>
  93. <div class="time">
  94. <ul class>
  95. <li
  96. :class="item.id==partitionType?'active':''"
  97. @click="selectPartitionType(item.id)"
  98. v-for="item in partitionArr"
  99. :key="item.id"
  100. >{{item.name}}</li>
  101. </ul>
  102. </div>
  103. </div>
  104. <el-table
  105. :data="SchedualPatientsTableData"
  106. style="width: 100%"
  107. v-loading="loading"
  108. @current-change="clickCurrent"
  109. @selection-change="handleSelectionChange"
  110. >
  111. <el-table-column type="selection" width="45" align="center"></el-table-column>
  112. <el-table-column prop="number" label="机号" align="center"></el-table-column>
  113. <el-table-column label="排班日期" prop="sch_time" align="center" width="120"></el-table-column>
  114. <el-table-column prop="dialysis_no" label="透析号" align="center"></el-table-column>
  115. <el-table-column prop="name" label="姓名" align="center">
  116. <template slot-scope="scope">
  117. <span style="color: #579ef8">{{scope.row.name}}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="mode_name" label="透析模式" align="center" width="100"></el-table-column>
  121. <el-table-column prop="dialysis_before_weight" label="透前体重(kg)" align="center" width="120"></el-table-column>
  122. <el-table-column prop="dialysis_after_weight" label="透后体重(kg)" align="center" width="120"></el-table-column>
  123. <el-table-column label="透中血压(Hgmm)" align="center">
  124. <el-table-column v-for="(item, index) in labelArr" :key="index" :label="item" align="center">
  125. <!-- 数据的遍历 scope.row就代表数据的每一个对象-->
  126. <template slot-scope="scope" >
  127. <!--<span>{{scope.row.bp[index].value}}</span>-->
  128. <span>{{getValue(scope.row.bp[index])}}</span>
  129. </template>
  130. </el-table-column>
  131. </el-table-column>
  132. </el-table>
  133. <el-pagination
  134. align="right"
  135. @size-change="handleSizeChange"
  136. @current-change="handleCurrentChange"
  137. :page-sizes="[10,20,30,50]"
  138. :page-size="10"
  139. background
  140. style="margin-top:20px;"
  141. layout="total, sizes, prev, pager, next, jumper"
  142. :total="total"
  143. ></el-pagination>
  144. </div>
  145. </div>
  146. </template>
  147. <script>
  148. import { getSchedualPatient, GetAllZone } from "@/api/dialysis";
  149. import { parseTime } from "@/utils";
  150. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  151. import { getPrintTemplate } from '@/api/data'
  152. export default {
  153. name: "Patient",
  154. data() {
  155. return {
  156. crumbs:[
  157. {path:false, name:'透析管理'},
  158. {path:false, name:'透析监测'},
  159. ],
  160. loading: false,
  161. time: "",
  162. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  163. patient_search_keyword: "",
  164. SchedualPatientsTableData: [],
  165. active: true,
  166. schedulType: 0,
  167. schedulArr: [
  168. { value: 0, label: "全部" },
  169. { value: 1, label: "上午" },
  170. { value: 2, label: "下午" },
  171. { value: 3, label: "晚上" }
  172. ],
  173. template_id : 0,
  174. partitionType: 0,
  175. labelArr: ["第1次", "第2次", "第3次", "第4次", "第5次", "第6次", "第7次"],
  176. pickerOptions1: {
  177. shortcuts: [
  178. {
  179. text: "今天",
  180. onClick(picker) {
  181. picker.$emit("pick", new Date());
  182. }
  183. },
  184. {
  185. text: "昨天",
  186. onClick(picker) {
  187. const date = new Date();
  188. date.setTime(date.getTime() - 3600 * 1000 * 24);
  189. picker.$emit("pick", date);
  190. }
  191. },
  192. {
  193. text: "一周前",
  194. onClick(picker) {
  195. const date = new Date();
  196. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  197. picker.$emit("pick", date);
  198. }
  199. },
  200. {
  201. text: "清空",
  202. onClick(picker) {
  203. picker.$emit("pick");
  204. }
  205. }
  206. ]
  207. },
  208. total: 0,
  209. listQuery: {
  210. page: 1,
  211. limit: 10,
  212. schedul_type: 0,
  213. partition_type: 0,
  214. schedul_time: "",
  215. keywords: ""
  216. },
  217. selecting_schs: [],
  218. partitionArr: []
  219. };
  220. },
  221. created() {
  222. var date = new Date();
  223. this.time = date;
  224. var year = date.getFullYear();
  225. var month = date.getMonth() + 1;
  226. var day = date.getDate();
  227. if (month < 10) {
  228. month = "0" + month;
  229. }
  230. if (day < 10) {
  231. day = "0" + day;
  232. }
  233. var nowDate = year + "-" + month + "-" + day;
  234. var date = new Date(nowDate + " 00:00:00");
  235. this.listQuery.schedul_time = date.getTime();
  236. this.getAllZone();
  237. this.getSchedualPatientList();
  238. this.getTemplateInfo();
  239. // this.template_id = this.$store.getters.xt_user.template_info.template_id;
  240. },
  241. methods: {
  242. getTemplateInfo(){
  243. getPrintTemplate().then(response => {
  244. if (response.data.state == 0) {
  245. this.$message.error(response.data.msg)
  246. return false
  247. } else {
  248. var template = response.data.data.template
  249. this.template_id = template.template_id
  250. }
  251. })
  252. },
  253. clickCurrent(val) {
  254. console.log(val);
  255. this.$router.push({
  256. path: "/dialysis/details",
  257. query: { patient_id: val.patient_id, date: val.sch_time_int }
  258. });
  259. },
  260. handleSelectionChange(val) {
  261. this.selecting_schs = val;
  262. },
  263. selectSchedulType(scheduleType) {
  264. // alert(scheduleType);/
  265. this.schedulType = scheduleType;
  266. this.listQuery.schedul_type = scheduleType;
  267. this.getSchedualPatientList();
  268. },
  269. selectPartitionType(partitionType) {
  270. this.partitionType = partitionType;
  271. this.listQuery.partition_type = partitionType;
  272. this.getSchedualPatientList();
  273. },
  274. changeTime() {
  275. console.log(this.time);
  276. this.listQuery.schedul_time = this.time;
  277. this.getSchedualPatientList();
  278. },
  279. getAllZone: function() {
  280. GetAllZone().then(response => {
  281. if (response.data.state == 0) {
  282. this.$message.error(response.data.msg);
  283. return false;
  284. } else {
  285. this.partitionArr = response.data.data.zone;
  286. this.partitionArr.unshift({ id: 0, name: "全部" });
  287. }
  288. });
  289. },
  290. getSchedualPatientList: function() {
  291. this.loading = true;
  292. if (this.search_mode == 1) {
  293. this.listQuery.keywords = "";
  294. } else {
  295. this.listQuery.schedul_time = "";
  296. }
  297. this.SchedualPatientsTableData = [];
  298. getSchedualPatient(this.listQuery).then(response => {
  299. if (response.data.state == 0) {
  300. this.loading = false;
  301. this.$message.error(response.data.msg);
  302. return false;
  303. } else {
  304. this.loading = false;
  305. this.total = response.data.data.total;
  306. // console.log(response.data.data)
  307. for (let i = 0; i < response.data.data.schedule.length; i++) {
  308. if (response.data.data.schedule[i].patient.id > 0) {
  309. let SchedualPatientsTable = {
  310. bp: []
  311. };
  312. SchedualPatientsTable["sch_id"] = response.data.data.schedule[i].id
  313. SchedualPatientsTable["sch_time_int"] =
  314. response.data.data.schedule[i].schedule_date;
  315. SchedualPatientsTable["sch_time"] = parseTime(
  316. response.data.data.schedule[i].schedule_date,
  317. "{y}-{m}-{d}"
  318. );
  319. SchedualPatientsTable["dialysis_no"] =
  320. response.data.data.schedule[i].patient.dialysis_no;
  321. SchedualPatientsTable["name"] =
  322. response.data.data.schedule[i].patient.name;
  323. SchedualPatientsTable["number"] =
  324. response.data.data.schedule[i].device_number.number;
  325. SchedualPatientsTable["gender"] =
  326. response.data.data.schedule[i].patient.gender;
  327. SchedualPatientsTable["source"] =
  328. response.data.data.schedule[i].patient.source;
  329. SchedualPatientsTable["patient_id"] =
  330. response.data.data.schedule[i].patient_id;
  331. SchedualPatientsTable["mode_name"] =
  332. response.data.data.schedule[i].treatment_mode.name;
  333. if (
  334. response.data.data.schedule[i].assessment_before_dislysis.id > 0
  335. ) {
  336. SchedualPatientsTable["dialysis_before_weight"] =
  337. response.data.data.schedule[
  338. i
  339. ].assessment_before_dislysis.weight_before;
  340. }
  341. if (
  342. response.data.data.schedule[i].assessment_after_dislysis.id > 0
  343. ) {
  344. SchedualPatientsTable["dialysis_after_weight"] =
  345. response.data.data.schedule[
  346. i
  347. ].assessment_after_dislysis.weight_after;
  348. }
  349. SchedualPatientsTable.bp = [];
  350. for (
  351. let a = 0;
  352. a < response.data.data.schedule[i].monitoring_record.length;
  353. a++
  354. ) {
  355. let bp = {};
  356. bp["value"] =
  357. response.data.data.schedule[i].monitoring_record[
  358. a
  359. ].systolic_blood_pressure.toString() +
  360. "/" +
  361. response.data.data.schedule[i].monitoring_record[
  362. a
  363. ].diastolic_blood_pressure.toString();
  364. SchedualPatientsTable.bp.unshift(bp);
  365. }
  366. this.SchedualPatientsTableData.push(SchedualPatientsTable);
  367. }
  368. }
  369. }
  370. });
  371. },
  372. getValue: function(val) {
  373. if (val != undefined) {
  374. return val.value;
  375. } else {
  376. return "";
  377. }
  378. },
  379. handleCurrentChange(val) {
  380. this.listQuery.page = val;
  381. this.getSchedualPatientList();
  382. },
  383. changeSearchMode: function() {
  384. if (this.search_mode == 1) {
  385. this.search_mode = 2;
  386. } else {
  387. this.search_mode = 1;
  388. }
  389. },
  390. searchPatientAction: function() {
  391. this.listQuery.keywords = this.patient_search_keyword;
  392. console.log(this.patient_search_keyword);
  393. if (this.patient_search_keyword.length == 0) {
  394. return;
  395. }
  396. this.getSchedualPatientList();
  397. },
  398. handleSizeChange(val) {
  399. this.listQuery.limit = val
  400. this.getSchedualPatientList();
  401. },
  402. batchPrintAction: function() {
  403. var sch_ids = []
  404. for (let index = 0; index < this.selecting_schs.length; index++) {
  405. sch_ids.push(this.selecting_schs[index].sch_id)
  406. }
  407. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids)
  408. if (this.template_id == 2 ||this.template_id == 0 ){
  409. this.$router.push({ path: "/dialysis/print/batch/other" });
  410. } else if(this.template_id == 1) {
  411. this.$router.push({ path: "/dialysis/print/batch" });
  412. } else if(this.template_id == 3) {
  413. this.$router.push({ path: "/dialysis/print/batch/three" });
  414. } else if(this.template_id == 4) {
  415. this.$router.push({ path: "/dialysis/print/batch/four" });
  416. } else if (this.template_id == 5 ){
  417. this.$router.push({ path: "/dialysis/print/batch/five" });
  418. } else if (this.template_id == 6 ){
  419. this.$router.push({ path: "/dialysis/print/batch/six" });
  420. }
  421. },
  422. batchPrintActionOne: function() {
  423. var sch_ids = []
  424. for (let index = 0; index < this.selecting_schs.length; index++) {
  425. sch_ids.push(this.selecting_schs[index].sch_id)
  426. }
  427. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids)
  428. if (this.template_id == 2 ||this.template_id == 0){
  429. this.$router.push({ path: "/dialysis/print/batch/otherone" });
  430. }else if(this.template_id == 1) {
  431. this.$router.push({ path: "/dialysis/print/batch" });
  432. } else if (this.template_id == 5){
  433. this.$router.push({ path: "/dialysis/print/batch/fiveone" });
  434. }
  435. },
  436. batchPrintActionTwo: function() {
  437. var sch_ids = []
  438. for (let index = 0; index < this.selecting_schs.length; index++) {
  439. sch_ids.push(this.selecting_schs[index].sch_id)
  440. }
  441. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids)
  442. if (this.template_id == 2 ||this.template_id == 0 ){
  443. this.$router.push({ path: "/dialysis/print/batch/othertwo" });
  444. }else if(this.template_id == 1){
  445. this.$router.push({ path: "/dialysis/print/batch" });
  446. } else if (this.template_id == 5 ){
  447. this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
  448. }
  449. }
  450. },
  451. components: {
  452. BreadCrumb
  453. }
  454. };
  455. </script>
  456. <style rel="stylesheet/scss" lang="scss" scoped>
  457. .app-container {
  458. // margin: 20px;
  459. font-size: 15px;
  460. .filter-container {
  461. padding-bottom: 5px;
  462. }
  463. .cqd-dataTitle{
  464. color: #303133;
  465. font-size: 14px;
  466. border-bottom: 2px #E4E7ED solid;
  467. height: 36px;
  468. line-height: 36px;
  469. margin: 0 0 25px 0;
  470. position: relative;
  471. }
  472. .cqd-dataTitle::before {
  473. position: absolute;
  474. left: 0;
  475. bottom: -2px;
  476. content: "";
  477. width: 42px;
  478. height: 2px;
  479. background: #409eff;
  480. }
  481. .search-component {
  482. width: 500px;
  483. .searchBox {
  484. width: 300px;
  485. height: 36px;
  486. line-height: 36px;
  487. padding-left: 15px;
  488. border: 1px #dcdfe6 solid;
  489. border-right: none;
  490. outline: none;
  491. float: left;
  492. border-radius: 6px 0 0 6px;
  493. font-size: 14px;
  494. color: #333;
  495. background: #fff;
  496. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  497. }
  498. .searchBtn {
  499. background-color: #409eff;
  500. color: #fff;
  501. font-size: 15px;
  502. text-align: center;
  503. height: 36px;
  504. line-height: 36px;
  505. float: left;
  506. outline: none;
  507. width: 70px;
  508. border: none;
  509. border-radius: 0 6px 6px 0;
  510. font-family: "Microsoft Yahei";
  511. cursor: pointer;
  512. }
  513. }
  514. .amount {
  515. font-weight: normal;
  516. padding: 10px 0 0 0;
  517. color: #606266;
  518. font-size: 14px;
  519. span {
  520. color: #ef2525;
  521. font-family: "Arial";
  522. padding: 0 2px;
  523. }
  524. }
  525. }
  526. </style>