Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

processIndicators.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  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">
  7. <div class="cell clearfix">
  8. <label class="title"> <span class="name">日期查询</span> : </label>
  9. <el-date-picker
  10. v-model="listQuery.start_time"
  11. prefix-icon="el-icon-date"
  12. @change="changeTime"
  13. :editable="false"
  14. style="width: 196px;"
  15. type="date"
  16. placeholder="选择日期时间"
  17. align="right"
  18. format="yyyy-MM-dd"
  19. value-format="yyyy-MM-dd"
  20. ></el-date-picker>
  21. <span class>-</span>
  22. <el-date-picker
  23. v-model="listQuery.end_time"
  24. prefix-icon="el-icon-date"
  25. @change="changeEndTime"
  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. </div>
  35. <div class="cell clearfix">
  36. <label class="title"> <span class="name">透析龄</span> : </label>
  37. <div class="time">
  38. <ul class>
  39. <li
  40. :class="item.value == dialysisAge ? 'active' : ''"
  41. @click="selectdialysisAges(item.value)"
  42. v-for="item in dialysisAgeOptions"
  43. :key="item.value"
  44. >
  45. {{ item.label }}
  46. </li>
  47. </ul>
  48. </div>
  49. </div>
  50. <div class="cell clearfix">
  51. <label class="title"> <span class="name">转归状态</span> : </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. >
  60. {{ item.label }}
  61. </li>
  62. </ul>
  63. </div>
  64. </div>
  65. <div class="cell clearfix">
  66. <label class="title"> <span class="name">检验项目</span> : </label>
  67. <el-select
  68. v-model="listQuery.project_id"
  69. placeholder="请选择"
  70. @change="changeModel()"
  71. >
  72. <el-option label="全部" value=""></el-option>
  73. <el-option
  74. v-for="item in projectOptions"
  75. :key="item.project_id"
  76. :label="item.project_name"
  77. :value="item.project_id"
  78. ></el-option>
  79. </el-select>
  80. </div>
  81. <div class="cqd-dataTitle">统计图</div>
  82. <el-row :gutter="32">
  83. <el-col :xs="24" :sm="24" :lg="24">
  84. <div class="chart-wrapper">
  85. <pie-chart title="" :options="CompletionOptions" />
  86. </div>
  87. </el-col>
  88. </el-row>
  89. <div style="height:20px">&nbsp;</div>
  90. <div class="cqd-dataTitle">统计表</div>
  91. <el-table
  92. ref="multipleTable"
  93. :data="tableData"
  94. :span-method="mergeSpan"
  95. border
  96. fit
  97. highlight-current-row
  98. style="width: 100%;margin-top: 10px;"
  99. :row-style="{ color: '#303133' }"
  100. :header-cell-style="{
  101. backgroundColor: 'rgb(245, 247, 250)',
  102. color: '#606266'
  103. }"
  104. >
  105. <el-table-column
  106. label="透析号"
  107. min-width="80"
  108. property="patient_id"
  109. align="center"
  110. >
  111. <template slot-scope="scope"
  112. ><span>{{
  113. getPatientDialysisNo(scope.row.patient_id)
  114. }}</span></template
  115. >
  116. </el-table-column>
  117. <el-table-column
  118. label="姓名"
  119. min-width="80"
  120. property="patient_id"
  121. align="center"
  122. >
  123. <template slot-scope="scope"
  124. ><span>{{ getPatientName(scope.row.patient_id) }}</span></template
  125. >
  126. </el-table-column>
  127. <el-table-column
  128. label="检查项目"
  129. min-width="80"
  130. property="project_id"
  131. align="center"
  132. >
  133. <template slot-scope="scope"
  134. ><span>{{ getProjectName(scope.row.project_id) }}</span></template
  135. >
  136. </el-table-column>
  137. <el-table-column
  138. label="检查日期"
  139. min-width="80"
  140. property="inspect_date"
  141. align="center"
  142. >
  143. <template slot-scope="scope"
  144. ><span>{{
  145. getTime(scope.row.inspect_date, "{y}{m}{d}")
  146. }}</span></template
  147. >
  148. </el-table-column>
  149. </el-table>
  150. <!-- <pagi-nation title="分页"></pagi-nation> -->
  151. <el-pagination
  152. align="right"
  153. @size-change="handleSizeChange"
  154. @current-change="handleCurrentChange"
  155. :current-page="listQuery.pate"
  156. :page-sizes="[10, 20, 50, 100]"
  157. :page-size="10"
  158. background
  159. style="margin-top:20px;"
  160. layout="total, sizes, prev, pager, next, jumper"
  161. :total="total"
  162. ></el-pagination>
  163. </div>
  164. </div>
  165. </template>
  166. <script>
  167. import { GetProcessIndicatorsData } from "@/api/qcd";
  168. import PieChart from "./components/PieChart";
  169. import { uParseTime } from "@/utils/tools";
  170. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  171. export default {
  172. name: "dialysisTotal",
  173. data() {
  174. return {
  175. crumbs: [
  176. { path: false, name: "科室质控" },
  177. { path: "/qcd/processindicators", name: "过程指标" }
  178. ],
  179. total: 0,
  180. projectOptions: {},
  181. patientMap: {},
  182. CompletionOptions: {
  183. legend: [],
  184. series: []
  185. },
  186. listQuery: {
  187. start_time: "",
  188. end_time: "",
  189. page: 1,
  190. limit: 10,
  191. lapseto: 0,
  192. project_id: "",
  193. dialysis_age: 0
  194. },
  195. tableData: [],
  196. tableRowData: [],
  197. lapsetoType: 0,
  198. lapsetoState: [
  199. { value: 0, label: "全部", source: 0, lapseto: 0 },
  200. { value: 1, label: "转出", source: 0, lapseto: 2 },
  201. { value: 2, label: "留治", source: 0, lapseto: 1 }
  202. ],
  203. dialysisAge: 0,
  204. dialysisAgeOptions: [
  205. { value: 0, label: "全部" },
  206. { value: 1, label: "大于三个月" },
  207. { value: 2, label: "小于三个月" }
  208. ]
  209. };
  210. },
  211. created() {
  212. var nowDate = new Date();
  213. var nowYear = nowDate.getFullYear();
  214. var nowMonth = nowDate.getMonth() + 1;
  215. var nowDay = nowDate.getDate();
  216. this.listQuery.end_time =
  217. nowYear +
  218. "-" +
  219. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  220. "-" +
  221. (nowDay < 10 ? "0" + nowDay : nowDay);
  222. nowDate.setMonth(nowDate.getMonth() - 3);
  223. nowYear = nowDate.getFullYear();
  224. nowMonth = nowDate.getMonth() + 1;
  225. nowDay = nowDate.getDate();
  226. this.listQuery.start_time =
  227. nowYear +
  228. "-" +
  229. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  230. "-" +
  231. (nowDay < 10 ? "0" + nowDay : nowDay);
  232. this.getList();
  233. },
  234. methods: {
  235. getList() {
  236. GetProcessIndicatorsData(this.listQuery).then(response => {
  237. if (response.data.state == 0) {
  238. this.$message.error(response.data.msg);
  239. return false;
  240. } else {
  241. this.tableData = [];
  242. this.tableRowData = [];
  243. this.total = response.data.data.total;
  244. var unfinishedcount = response.data.data.unfinishedcount;
  245. var finishedcount = this.total - unfinishedcount;
  246. this.CompletionOptions = {
  247. legend: [],
  248. series: []
  249. };
  250. this.CompletionOptions.legend.push("定时完成人次");
  251. this.CompletionOptions.series.push({
  252. value: finishedcount,
  253. name: "定时完成人次"
  254. });
  255. this.CompletionOptions.legend.push("未时完成人次");
  256. this.CompletionOptions.series.push({
  257. value: unfinishedcount,
  258. name: "未时完成人次"
  259. });
  260. var references = response.data.data.references;
  261. for (const index in references) {
  262. if (references[index].project_id in this.projectOptions) {
  263. continue;
  264. }
  265. this.$set(
  266. this.projectOptions,
  267. references[index].project_id,
  268. references[index]
  269. );
  270. }
  271. var patients = response.data.data.patients;
  272. for (const index in patients) {
  273. if (patients[index].id in this.patientMap) {
  274. continue;
  275. }
  276. this.$set(this.patientMap, patients[index].id, patients[index]);
  277. }
  278. var temInspections = {};
  279. var inspections = response.data.data.inspections;
  280. for (const index in inspections) {
  281. var key =
  282. inspections[index].inspect_date +
  283. "_" +
  284. inspections[index].patient_id;
  285. if (!(key in temInspections)) {
  286. temInspections[key] = {};
  287. }
  288. if (inspections[index].project_id in temInspections[key]) {
  289. continue;
  290. }
  291. temInspections[key][inspections[index].project_id] =
  292. inspections[index];
  293. }
  294. var rowIndex = 0;
  295. var childIndex = 0;
  296. for (const key in temInspections) {
  297. this.tableRowData.push(1);
  298. var parentIndex = rowIndex;
  299. childIndex = 0;
  300. for (const child in temInspections[key]) {
  301. this.tableData.push(temInspections[key][child]);
  302. if (childIndex > 0) {
  303. this.tableRowData[parentIndex] += 1;
  304. this.tableRowData.push(0);
  305. }
  306. childIndex++;
  307. rowIndex++;
  308. }
  309. }
  310. }
  311. });
  312. },
  313. changeTime(val) {
  314. var time =
  315. this.getTimestamp(val) - this.getTimestamp(this.listQuery.end_time);
  316. if (time > 0) {
  317. this.$message.error("结束时间不能小于开始时间");
  318. this.listQuery.start_time = "";
  319. } else {
  320. this.getList();
  321. }
  322. },
  323. changeEndTime(val) {
  324. var time =
  325. this.getTimestamp(val) - this.getTimestamp(this.listQuery.start_time);
  326. if (time < 0) {
  327. this.$message.error("结束时间不能小于开始时间");
  328. this.listQuery.end_time = "";
  329. } else {
  330. this.getList();
  331. }
  332. },
  333. getTimestamp(time) {
  334. // 把时间日期转成时间戳
  335. return new Date(time).getTime() / 1000;
  336. },
  337. selectLapseTo(lapseto) {
  338. this.lapsetoType = lapseto;
  339. this.listQuery.lapseto = lapseto;
  340. this.getList();
  341. },
  342. selectdialysisAges(type) {
  343. this.dialysisAge = type;
  344. this.listQuery.dialysis_age = type;
  345. this.getList();
  346. },
  347. changeModel() {
  348. this.getList();
  349. },
  350. handleSizeChange(val) {
  351. this.listQuery.limit = val;
  352. this.getList();
  353. },
  354. handleCurrentChange(val) {
  355. this.listQuery.page = val;
  356. this.getList();
  357. },
  358. getTime(value, temp) {
  359. if (value != undefined) {
  360. return uParseTime(value, temp);
  361. }
  362. return "";
  363. },
  364. getProjectName(id) {
  365. return id in this.projectOptions
  366. ? this.projectOptions[id].project_name
  367. : "";
  368. },
  369. getPatientName(id) {
  370. return id in this.patientMap ? this.patientMap[id].name : "";
  371. },
  372. getPatientDialysisNo(id) {
  373. return id in this.patientMap ? this.patientMap[id].dialysis_no : "";
  374. },
  375. mergeSpan({ row, column, rowIndex, columnIndex }) {
  376. if (columnIndex === 0 || columnIndex === 1 || columnIndex === 3) {
  377. const _row = this.tableRowData[rowIndex];
  378. const _col = _row > 0 ? 1 : 0;
  379. return {
  380. rowspan: _row,
  381. colspan: _col
  382. };
  383. }
  384. }
  385. },
  386. components: {
  387. PieChart,
  388. BreadCrumb
  389. }
  390. };
  391. </script>
  392. <style rel="stylesheet/scss" lang="scss" scoped>
  393. .app-container {
  394. // margin: 20px;
  395. font-size: 15px;
  396. .filter-container {
  397. padding-bottom: 5px;
  398. }
  399. .cqd-dataTitle {
  400. color: #303133;
  401. font-size: 14px;
  402. border-bottom: 2px #e4e7ed solid;
  403. height: 36px;
  404. line-height: 36px;
  405. margin: 0 0 25px 0;
  406. position: relative;
  407. }
  408. .cqd-dataTitle::before {
  409. position: absolute;
  410. left: 0;
  411. bottom: -2px;
  412. content: "";
  413. width: 42px;
  414. height: 2px;
  415. background: #409eff;
  416. }
  417. .search-component {
  418. width: 500px;
  419. .searchBox {
  420. width: 300px;
  421. height: 36px;
  422. line-height: 36px;
  423. padding-left: 15px;
  424. border: 1px #dcdfe6 solid;
  425. border-right: none;
  426. outline: none;
  427. float: left;
  428. border-radius: 6px 0 0 6px;
  429. font-size: 14px;
  430. color: #333;
  431. background: #fff;
  432. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  433. }
  434. .searchBtn {
  435. background-color: #409eff;
  436. color: #fff;
  437. font-size: 15px;
  438. text-align: center;
  439. height: 36px;
  440. line-height: 36px;
  441. float: left;
  442. outline: none;
  443. width: 70px;
  444. border: none;
  445. border-radius: 0 6px 6px 0;
  446. font-family: "Microsoft Yahei";
  447. cursor: pointer;
  448. }
  449. }
  450. .amount {
  451. font-weight: normal;
  452. padding: 10px 0 0 0;
  453. color: #606266;
  454. font-size: 14px;
  455. span {
  456. color: #ef2525;
  457. font-family: "Arial";
  458. padding: 0 2px;
  459. }
  460. }
  461. }
  462. </style>
  463. <style>
  464. .el-table td,
  465. .el-table th.is-leaf,
  466. .el-table--border,
  467. .el-table--group {
  468. border-color: #d0d3da;
  469. }
  470. .el-table--border::after,
  471. .el-table--group::after,
  472. .el-table::before {
  473. background-color: #d0d3da;
  474. }
  475. </style>