血透系统PC前端

total.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container" id="outcome-indicators-query">
  7. <analysis-nav activeName="total"></analysis-nav>
  8. <div class="cell clearfix">
  9. <el-form :inline="true" :model="listQuery" >
  10. <el-form-item label="">
  11. <el-input v-model="listQuery.search" placeholder="姓名/透析号"></el-input>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="primary" @click="onSearch">搜索</el-button>
  15. </el-form-item>
  16. </el-form>
  17. </div>
  18. <div class="cell clearfix">
  19. <label class="title">
  20. <span class="name">日期查询</span> :
  21. </label>
  22. <el-date-picker
  23. v-model="listQuery.start_time"
  24. prefix-icon="el-icon-date"
  25. @change="changeTime"
  26. :editable="false"
  27. style="width: 196px;"
  28. type="date"
  29. placeholder="选择日期时间"
  30. align="right"
  31. format="yyyy-MM-dd"
  32. value-format="yyyy-MM-dd"
  33. ></el-date-picker>
  34. <span class>-</span>
  35. <el-date-picker
  36. v-model="listQuery.end_time"
  37. prefix-icon="el-icon-date"
  38. @change="changeTime"
  39. :editable="false"
  40. style="width: 196px;"
  41. type="date"
  42. placeholder="选择日期时间"
  43. align="right"
  44. format="yyyy-MM-dd"
  45. value-format="yyyy-MM-dd"
  46. ></el-date-picker>
  47. </div>
  48. <div class="cell clearfix">
  49. <label class="title">
  50. <span class="name">转归状态</span> :
  51. </label>
  52. <div class="time">
  53. <ul class>
  54. <li
  55. :class="item.lapseto==lapsetoType?'active':''"
  56. @click="selectLapseTo( item.lapseto)"
  57. v-for="item in lapsetoState"
  58. :key="item.value"
  59. >{{item.label}}</li>
  60. </ul>
  61. </div>
  62. </div>
  63. <div class="cell clearfix">
  64. <label class="title">
  65. <span class="name">年龄</span> :
  66. </label>
  67. <div class="time">
  68. <ul class>
  69. <li
  70. :class="item.age==ageType?'active':''"
  71. @click="selectAge( item.age)"
  72. v-for="item in ageOptions"
  73. :key="item.value"
  74. >{{item.label}}</li>
  75. </ul>
  76. </div>
  77. </div>
  78. <div class="cqd-dataTitle">统计图</div>
  79. <el-row :gutter="32">
  80. <el-col :xs="24" :sm="24" :lg="24">
  81. <div class="chart-wrapper">
  82. <pie-chart title="" :options="CompletionOptions"/>
  83. </div>
  84. </el-col>
  85. </el-row>
  86. <div style="height:20px">&nbsp;</div>
  87. <div class="cqd-dataTitle">统计表</div>
  88. <el-table
  89. ref="multipleTable"
  90. :data="tableData"
  91. border
  92. fit
  93. highlight-current-row
  94. style="width: 100%;margin-top: 10px;"
  95. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  96. >
  97. <el-table-column label="透析号" min-width="100" property="dialysis_no" align="center">
  98. </el-table-column>
  99. <el-table-column label="患者姓名" min-width="100" property="name" align="center">
  100. </el-table-column>
  101. <el-table-column label="性别" min-width="80" property="gender" align="center">
  102. <template slot-scope="scope"><span>{{getPatientGender(scope.row.gender)}}</span></template>
  103. </el-table-column>
  104. <el-table-column label="年龄" min-width="80" property="birthday" align="center">
  105. <template slot-scope="scope"><span>{{tranAge(scope.row.birthday)}}</span></template>
  106. </el-table-column>
  107. </el-table>
  108. <!-- <pagi-nation title="分页"></pagi-nation> -->
  109. <el-pagination
  110. align='right'
  111. @size-change="handleSizeChange"
  112. @current-change="handleCurrentChange"
  113. :current-page="listQuery.pate"
  114. :page-sizes="[10, 20, 50, 100]"
  115. :page-size="10"
  116. background
  117. style="margin-top:20px;"
  118. layout="total, sizes, prev, pager, next, jumper"
  119. :total="total"
  120. ></el-pagination>
  121. </div>
  122. </div>
  123. </template>
  124. <script>
  125. import { GetPATotalData } from "@/api/qcd";
  126. import PieChart from '../components/PieChart'
  127. import {jsGetAge, uParseTime} from "@/utils/tools";
  128. import analysisNav from './components/analysisNav'
  129. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  130. export default {
  131. name: "totalAnalysis",
  132. data() {
  133. return {
  134. crumbs:[
  135. {path:false, name:'科室质控'},
  136. {path:false, name:'患者分析'},
  137. {path:false, name:'总量分析'},
  138. ],
  139. total: 0,
  140. patientMap:{},
  141. listQuery: {
  142. start_time: "",
  143. end_time: "",
  144. page: 1,
  145. limit: 10,
  146. },
  147. CompletionOptions:{
  148. legend:[],
  149. series:[],
  150. },
  151. tableData: [],
  152. lapsetoType: 0,
  153. lapsetoState: [
  154. { value: 0, label: "全部", source: 0, lapseto: 0 },
  155. { value: 1, label: "转出", source: 0, lapseto: 2 },
  156. { value: 2, label: "留治", source: 0, lapseto: 1 }
  157. ],
  158. ageType: 0,
  159. ageOptions: [
  160. { value: 0, label: "全部", age: 0 },
  161. { value: 1, label: "20~30", age: 1 },
  162. { value: 2, label: "30~40", age: 2 },
  163. { value: 3, label: "40~50", age: 3 },
  164. { value: 4, label: "其他", age: 4 },
  165. ],
  166. };
  167. },
  168. created() {
  169. var nowDate = new Date();
  170. var nowYear = nowDate.getFullYear();
  171. var nowMonth = nowDate.getMonth() + 1;
  172. var nowDay = nowDate.getDate();
  173. this.listQuery.end_time =
  174. nowYear +
  175. "-" +
  176. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  177. "-" +
  178. (nowDay < 10 ? "0" + nowDay : nowDay);
  179. nowDate.setMonth(nowDate.getMonth() - 3);
  180. nowYear = nowDate.getFullYear();
  181. nowMonth = nowDate.getMonth() + 1;
  182. nowDay = nowDate.getDate();
  183. this.listQuery.start_time =
  184. nowYear +
  185. "-" +
  186. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  187. "-" +
  188. (nowDay < 10 ? "0" + nowDay : nowDay);
  189. this.getList();
  190. },
  191. methods: {
  192. getList() {
  193. GetPATotalData(this.listQuery).then(response => {
  194. if (response.data.state == 0) {
  195. this.$message.error(response.data.msg);
  196. return false;
  197. } else {
  198. this.tableData = [];
  199. this.total = response.data.data.total;
  200. var patients = response.data.data.patients;
  201. for (const index in patients) {
  202. this.tableData.push(patients[index]);
  203. }
  204. var lapsetoIn = response.data.data.lapsetoIn;
  205. var lapsetoOut = response.data.data.lapsetoOut;
  206. this.CompletionOptions = {
  207. legend:[],
  208. series:[],
  209. };
  210. this.CompletionOptions.legend.push('留治病人');
  211. this.CompletionOptions.series.push({
  212. value:lapsetoIn,name:'留治病人'
  213. });
  214. this.CompletionOptions.legend.push('转出病人');
  215. this.CompletionOptions.series.push({
  216. value:lapsetoOut,name:'转出病人'
  217. });
  218. }
  219. });
  220. },
  221. changeTime() {
  222. this.getList();
  223. },
  224. onSearch(){
  225. this.getList();
  226. },
  227. changeModel() {
  228. this.getList();
  229. },
  230. handleSizeChange(val) {
  231. this.listQuery.limit = val;
  232. this.getList();
  233. },
  234. handleCurrentChange(val) {
  235. this.listQuery.page = val;
  236. this.getList();
  237. },
  238. selectLapseTo(lapseto) {
  239. this.lapsetoType = lapseto;
  240. this.listQuery.lapseto = lapseto;
  241. this.getList();
  242. },
  243. selectAge(age) {
  244. this.ageType = age;
  245. this.listQuery.age = age;
  246. this.getList();
  247. },
  248. getTime(value, temp) {
  249. if (value != undefined) {
  250. return uParseTime(value, temp)
  251. }
  252. return ""
  253. },
  254. getProjectName(id) {
  255. return (id in this.projectOptions) ? this.projectOptions[id].project_name:'';
  256. },
  257. getPatientName(id) {
  258. return (id in this.patientMap) ? this.patientMap[id].name:'';
  259. },
  260. getPatientGender(gender) {
  261. if (gender == 1) {
  262. return '男';
  263. } else if(gender == 2) {
  264. return '女';
  265. }
  266. return '';
  267. },
  268. tranAge(birthday) {
  269. var birth = uParseTime(birthday, '{y}-{m}-{d}');
  270. return jsGetAge(birth, '-');
  271. },
  272. getPatientDialysisNo(id) {
  273. return (id in this.patientMap) ? this.patientMap[id].dialysis_no:'';
  274. },
  275. getItemVulue(project_id, item_id, row) {
  276. var key = project_id + '_' + item_id;
  277. return (typeof(row.items) !== 'undefined' && (key in row.items)) ? row.items[key].inspect_value:'';
  278. },
  279. renderheader(h, { column, $index }) {
  280. return h('span', {}, [
  281. h('span', {}, column.label.split('//')[0]),
  282. h('br'),
  283. h('span', {}, column.label.split('//')[1])
  284. ])
  285. },
  286. },
  287. components: {
  288. analysisNav,
  289. PieChart,
  290. BreadCrumb
  291. }
  292. };
  293. </script>
  294. <style>
  295. #oictable ::-webkit-scrollbar {
  296. height: 15px;
  297. }
  298. #outcome-indicators-query .el-form-item {
  299. margin-bottom: 0px !important;
  300. }
  301. </style>
  302. <style rel="stylesheet/scss" lang="scss" scoped>
  303. .app-container {
  304. // margin: 20px;
  305. font-size: 15px;
  306. .filter-container {
  307. padding-bottom: 5px;
  308. }
  309. .cqd-dataTitle{
  310. color: #303133;
  311. font-size: 14px;
  312. border-bottom: 2px #E4E7ED solid;
  313. height: 36px;
  314. line-height: 36px;
  315. margin: 0 0 25px 0;
  316. position: relative;
  317. }
  318. .cqd-dataTitle::before {
  319. position: absolute;
  320. left: 0;
  321. bottom: -2px;
  322. content: "";
  323. width: 42px;
  324. height: 2px;
  325. background: #409eff;
  326. }
  327. .search-component {
  328. width: 500px;
  329. .searchBox {
  330. width: 300px;
  331. height: 36px;
  332. line-height: 36px;
  333. padding-left: 15px;
  334. border: 1px #dcdfe6 solid;
  335. border-right: none;
  336. outline: none;
  337. float: left;
  338. border-radius: 6px 0 0 6px;
  339. font-size: 14px;
  340. color: #333;
  341. background: #fff;
  342. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  343. }
  344. .searchBtn {
  345. background-color: #409eff;
  346. color: #fff;
  347. font-size: 15px;
  348. text-align: center;
  349. height: 36px;
  350. line-height: 36px;
  351. float: left;
  352. outline: none;
  353. width: 70px;
  354. border: none;
  355. border-radius: 0 6px 6px 0;
  356. font-family: "Microsoft Yahei";
  357. cursor: pointer;
  358. }
  359. }
  360. .amount {
  361. font-weight: normal;
  362. padding: 10px 0 0 0;
  363. color: #606266;
  364. font-size: 14px;
  365. span {
  366. color: #ef2525;
  367. font-family: "Arial";
  368. padding: 0 2px;
  369. }
  370. }
  371. }
  372. </style>