血透系统PC前端

bloodPresssWatch.vue 16KB

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