血透系统PC前端

lapseto.vue 11KB

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