血透系统PC前端

schedualPatient2.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <el-input style="width: 400px;" v-model="searchKey" class="filter-item"/>
  5. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  6. </div>
  7. <div class="cell">
  8. <label class="title"><span class="name">日期查询</span> : </label>
  9. <el-date-picker v-model="time" prefix-icon="el-icon-date" @change="changeTime" :editable="false"
  10. style="width: 196px;" type="date" placeholder="选择日期时间" align="right"
  11. :picker-options="pickerOptions1" format="yyyy-MM-dd"
  12. value-format="timestamp"></el-date-picker>
  13. </div>
  14. <div class="cell clearfix">
  15. <label class="title"><span class="name">排班班次</span> : </label>
  16. <div class="time ">
  17. <ul class="">
  18. <li :class="item.value==schedulType?'active':''" @click='selectSchedulType(item.value)'
  19. v-for="item in schedulArr" :key="item.value">{{item.label}}
  20. </li>
  21. </ul>
  22. </div>
  23. </div>
  24. <div class="cell clearfix">
  25. <label class="title"><span class="name">分区</span> : </label>
  26. <div class="time ">
  27. <ul class="">
  28. <li :class="item.id==partitionType?'active':''" @click='selectPartitionType(item.id)'
  29. v-for="item in partitionArr" :key="item.id">{{item.name}}
  30. </li>
  31. </ul>
  32. </div>
  33. </div>
  34. <el-table
  35. ref="multipleTable" :data="SchedualPatientsTableData" border fit highlight-current-row style="width: 100%;margin-top: 10px;"
  36. @selection-change="handleSelectionChange">
  37. <el-table-column property="number" label="机号" width="60px" align="center"></el-table-column>
  38. <el-table-column label="透析号" min-width="80" property="dialysis_no" align="center"></el-table-column>
  39. <el-table-column property="name" label="姓名" min-width="80" align="center">
  40. <template slot-scope="scope">
  41. <router-link :to="'/dialysis/record/'+scope.row.patient_id" style="color:#409eff">{{scope.row.name}}</router-link>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="性别" min-width="80" align="center">
  45. <template slot-scope="scope">
  46. <span v-if="scope.row.gender==1">男</span>
  47. <span v-else-if="scope.row.gender==2">女</span>
  48. <span v-else>未知</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="来源" min-width="80" align="center">
  52. <template slot-scope="scope">
  53. <span v-if="scope.row.source==1">住院</span>
  54. <span v-else-if="scope.row.source==2">门诊</span>
  55. <span v-else>未知</span>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <!--@current-change="handleCurrentChange"-->
  60. <el-pagination
  61. :current-page="listQuery.pate"
  62. :page-sizes="[10, 20, 50, 100]"
  63. :page-size="10"
  64. background
  65. style="margin-top:20px;"
  66. layout="total, sizes, prev, pager, next, jumper"
  67. :total="total">
  68. </el-pagination>
  69. <!-- 病人 -->
  70. <!-- <div class="PatientArea">
  71. <div class="list clearfix">
  72. <h3 class="title">A区</h3>
  73. <patient-box></patient-box>
  74. </div>
  75. <div class="list clearfix">
  76. <h3 class="title">B区</h3>
  77. <patient-box></patient-box>
  78. </div>
  79. <div class="list clearfix">
  80. <h3 class="title">C区</h3>
  81. <patient-box></patient-box>
  82. </div>
  83. </div> -->
  84. </div>
  85. </template>
  86. <script>
  87. // import pagiNation from '@/components/pagimg/pagiNation'
  88. import PatientBox from './PatientBox';
  89. import {
  90. getSchedualPatient,
  91. GetAllZone,
  92. } from "@/api/dialysis"
  93. export default {
  94. name: "Patient",
  95. data() {
  96. return {
  97. time : '',
  98. checkAll: false,
  99. isIndeterminate: true,
  100. wechatbindimg: "",
  101. SchedualPatientsTableData: [],
  102. active: true,
  103. schedulType: 0,
  104. schedulArr: [
  105. {value: 0, label: "全部"},
  106. {value: 1, label: "上午"},
  107. {value: 2, label: "下午"},
  108. {value: 3, label: "晚上"}
  109. ],
  110. partitionType: 0,
  111. sourceType: 0,
  112. sourceID: 0,
  113. lapsetoType: 0,
  114. sourceArr: [
  115. {value: 0, label: "全部", source: 0, lapseto: 0},
  116. {value: 1, label: "门诊", source: 0, lapseto: 0},
  117. {value: 2, label: "住院", source: 0, lapseto: 0}
  118. ],
  119. tableData: null,
  120. pickerOptions1: {
  121. shortcuts: [
  122. {
  123. text: "今天",
  124. onClick(picker) {
  125. picker.$emit("pick", new Date());
  126. }
  127. },
  128. {
  129. text: "昨天",
  130. onClick(picker) {
  131. const date = new Date();
  132. date.setTime(date.getTime() - 3600 * 1000 * 24);
  133. picker.$emit("pick", date);
  134. }
  135. },
  136. {
  137. text: "一周前",
  138. onClick(picker) {
  139. const date = new Date();
  140. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  141. picker.$emit("pick", date);
  142. }
  143. },
  144. {
  145. text: "清空",
  146. onClick(picker) {
  147. picker.$emit("pick");
  148. }
  149. }
  150. ]
  151. },
  152. searchKey: "",
  153. total: 0,
  154. pageTotal: 0,
  155. pageSelect: 0,
  156. listQuery: {
  157. page: 1,
  158. limit: 10,
  159. schedul_type: 0,
  160. partition_type: 0,
  161. schedul_time: "",
  162. keywords: "",
  163. },
  164. multipleSelection: [],
  165. partitionArr: [],
  166. };
  167. },
  168. created() {
  169. var date = new Date()
  170. this.time = date
  171. var year = date.getFullYear()
  172. var month = date.getMonth() + 1
  173. var day = date.getDate()
  174. if (month < 10) {
  175. month = "0" + month
  176. }
  177. if (day < 10) {
  178. day = "0" + day
  179. }
  180. var nowDate = year + "-" + month + "-" + day
  181. var date = new Date(nowDate + " 00:00:00")
  182. this.listQuery.schedul_time = date.getTime()
  183. this.getAllZone()
  184. this.getSchedualPatientList();
  185. },
  186. methods: {
  187. handleSelectionChange(val) {
  188. this.multipleSelection = val;
  189. this.pageSelect = this.multipleSelection.length;
  190. },
  191. selectSchedulType(scheduleType) {
  192. // alert(scheduleType);/
  193. this.schedulType = scheduleType;
  194. this.listQuery.schedul_type = scheduleType;
  195. this.getSchedualPatientList();
  196. },
  197. selectPartitionType(partitionType) {
  198. this.partitionType = partitionType;
  199. this.listQuery.partition_type = partitionType;
  200. this.getSchedualPatientList();
  201. },
  202. changeTime() {
  203. console.log(this.time)
  204. this.listQuery.schedul_time = this.time;
  205. this.getSchedualPatientList();
  206. },
  207. search() {
  208. this.listQuery.keywords = this.searchKey;
  209. this.getSchedualPatientList();
  210. },
  211. changeOtherSearch() {
  212. this.getList();
  213. }, getAllZone: function () {
  214. GetAllZone().then(response => {
  215. if (response.data.state == 0) {
  216. this.$message.error(response.data.msg);
  217. return false;
  218. } else {
  219. this.partitionArr = response.data.data.zone
  220. this.partitionArr.unshift({"id": 0, "name": '全部'})
  221. }
  222. });
  223. }, getSchedualPatientList: function () {
  224. this.SchedualPatientsTableData = []
  225. getSchedualPatient(this.listQuery).then(response => {
  226. if (response.data.state == 0) {
  227. this.$message.error(response.data.msg);
  228. return false;
  229. } else {
  230. for (let i = 0; i < response.data.data.schedule.length; i++) {
  231. if(response.data.data.schedule[i].SchedualPatient.id > 0) {
  232. let SchedualPatientsTable = {}
  233. SchedualPatientsTable['dialysis_no'] = response.data.data.schedule[i].SchedualPatient.dialysis_no
  234. SchedualPatientsTable['name'] = response.data.data.schedule[i].SchedualPatient.name
  235. SchedualPatientsTable['number'] = response.data.data.schedule[i].DeviceNumber.number
  236. SchedualPatientsTable['gender'] = response.data.data.schedule[i].SchedualPatient.gender
  237. SchedualPatientsTable['source'] = response.data.data.schedule[i].SchedualPatient.source
  238. SchedualPatientsTable['patient_id'] = response.data.data.schedule[i].patient_id
  239. this.SchedualPatientsTableData.unshift(SchedualPatientsTable)
  240. }
  241. }
  242. }
  243. });
  244. this.total = this.SchedualPatientsTableData.length
  245. }
  246. // components:{
  247. // pagiNation
  248. // }
  249. },
  250. components:{
  251. PatientBox
  252. }
  253. }
  254. </script>
  255. <style rel="stylesheet/scss" lang="scss" scoped>
  256. .app-container {
  257. // margin: 20px;
  258. font-size: 15px;
  259. .filter-container {
  260. padding-bottom: 5px;
  261. }
  262. .search-component {
  263. width: 500px;
  264. .searchBox {
  265. width: 300px;
  266. height: 36px;
  267. line-height: 36px;
  268. padding-left: 15px;
  269. border: 1px #dcdfe6 solid;
  270. border-right: none;
  271. outline: none;
  272. float: left;
  273. border-radius: 6px 0 0 6px;
  274. font-size: 14px;
  275. color: #333;
  276. background: #fff;
  277. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  278. }
  279. .searchBtn {
  280. background-color: #409eff;
  281. color: #fff;
  282. font-size: 15px;
  283. text-align: center;
  284. height: 36px;
  285. line-height: 36px;
  286. float: left;
  287. outline: none;
  288. width: 70px;
  289. border: none;
  290. border-radius: 0 6px 6px 0;
  291. font-family: "Microsoft Yahei";
  292. cursor: pointer;
  293. }
  294. }
  295. .cell {
  296. margin: 0px 0 15px 0;
  297. -moz-box-sizing: border-box;
  298. -webkit-box-sizing: border-box;
  299. -o-box-sizing: border-box;
  300. -ms-box-sizing: border-box;
  301. box-sizing: border-box;
  302. display: -webkit-box;
  303. display: -ms-flexbox;
  304. // display: flex;
  305. -webkit-box-align: flex-start;
  306. -ms-flex-align: flex-start;
  307. align-items: flex-start;
  308. text-align: left;
  309. justify-content: flex-start;
  310. color: #333;
  311. .title {
  312. width: 80px;
  313. display: inline-block;
  314. font-weight: normal;
  315. color: #909399;
  316. padding: 6px 0;
  317. font-weight: 700;
  318. .name {
  319. width: 60px;
  320. text-align: justify;
  321. text-justify: distribute-all-lines;
  322. text-align-last: justify;
  323. -moz-text-align-last: justify;
  324. -webkit-text-align-last: justify;
  325. display: inline-block;
  326. }
  327. }
  328. .time {
  329. -webkit-box-flex: 1;
  330. -ms-flex: 1;
  331. flex: 1;
  332. ul {
  333. padding: 0;
  334. margin: 0;
  335. li {
  336. float: left;
  337. list-style: none;
  338. cursor: pointer;
  339. padding: 3px 0;
  340. width: 70px;
  341. color: #606266;
  342. border-radius: 4px;
  343. margin: 0 10px 0 0;
  344. color: #409eff;
  345. border: 1px #409eff solid;
  346. text-align: center;
  347. &:hover {
  348. background: #409eff;
  349. color: #fff;
  350. }
  351. }
  352. .active {
  353. background: #409eff;
  354. color: #fff;
  355. }
  356. }
  357. }
  358. }
  359. .amount {
  360. font-weight: normal;
  361. padding: 10px 0 0 0;
  362. color: #606266;
  363. font-size: 14px;
  364. span {
  365. color: #ef2525;
  366. font-family: "Arial";
  367. padding: 0 2px;
  368. }
  369. }
  370. }
  371. .PatientArea{
  372. .list{
  373. .title{
  374. font-size: 16px;
  375. color: #34495e;
  376. height:50px ;
  377. line-height: 50px;
  378. font-weight: bold;
  379. }
  380. }
  381. }
  382. </style>