oralMedicine.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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. <person-info :patient="patientInfo"></person-info>
  8. <person-nav activeName="oralmedicine" :patientID="patientID"></person-nav>
  9. <div class="cell clearfix">
  10. <label class="title">
  11. <span class="name">日期查询</span> :
  12. </label>
  13. <el-date-picker
  14. v-model="listQuery.start_time"
  15. prefix-icon="el-icon-date"
  16. @change="changeTime"
  17. :editable="false"
  18. style="width: 196px;"
  19. type="date"
  20. placeholder="选择日期时间"
  21. align="right"
  22. format="yyyy-MM-dd"
  23. value-format="yyyy-MM-dd"
  24. ></el-date-picker>
  25. <span class>-</span>
  26. <el-date-picker
  27. v-model="listQuery.end_time"
  28. prefix-icon="el-icon-date"
  29. @change="changeTime"
  30. :editable="false"
  31. style="width: 196px;"
  32. type="date"
  33. placeholder="选择日期时间"
  34. align="right"
  35. format="yyyy-MM-dd"
  36. value-format="yyyy-MM-dd"
  37. ></el-date-picker>
  38. </div>
  39. <div class="cell clearfix">
  40. <label class="title">
  41. <span class="name">医嘱类型</span> :
  42. </label>
  43. <div class="time">
  44. <ul class>
  45. <li
  46. :class="item.value==adviceType?'active':''"
  47. @click="selectAdviceType( item.value)"
  48. v-for="item in adviceTypeOptions"
  49. :key="item.value"
  50. >{{item.label}}</li>
  51. </ul>
  52. </div>
  53. </div>
  54. <!-- <div class="cell clearfix">
  55. <label class="title">
  56. <span class="name">药品类型</span> :
  57. </label>
  58. <el-select v-model="listQuery.advice_type" filterable clearable placeholder="请选择">
  59. <el-option
  60. v-for="item in medicalOptions"
  61. :key="item.id"
  62. :label="item.name"
  63. :value="item.id">
  64. </el-option>
  65. </el-select>
  66. </div> -->
  67. <!-- <div class="cqd-dataTitle">统计图</div>
  68. <el-row :gutter="32">
  69. <el-col :xs="24" :sm="24" :lg="24">
  70. <div class="chart-wrapper">
  71. <line-chart title="曲线图(Kg)" :options="CompletionOptions" />
  72. </div>
  73. </el-col>
  74. </el-row>
  75. <div style="height:20px">&nbsp;</div> -->
  76. <div class="cqd-dataTitle">统计表</div>
  77. <el-table
  78. ref="multipleTable"
  79. :data="tableData"
  80. border
  81. fit
  82. highlight-current-row
  83. :cell-style="cellstyle"
  84. style="width: 100%;margin-top: 10px;"
  85. id="qcd-person-oral-medical"
  86. :span-method="mergeSpan"
  87. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  88. >
  89. <el-table-column label="医嘱类型" width="80" property="advice_type" align="center" >
  90. <template slot-scope="scope">
  91. <span v-if="scope.row.advice_type==1">长期</span>
  92. <span v-else-if="scope.row.advice_type==2">临时</span>
  93. <span v-else></span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="医嘱内容" property="advice_name" min-width="180" align="center" >
  97. <template slot-scope="scope">
  98. {{scope.row.parent_id>0?'&nbsp;&nbsp;':''}} {{scope.row.advice_name }}
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="开始时间" width="180" property="start_time" align="center">
  102. <template slot-scope="scope">
  103. {{scope.row.start_time | parseTime("{y}-{m}-{d} {h}:{i}")}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="停止时间" width="180" property="stop_time" align="center">
  107. <template slot-scope="scope">
  108. <span v-if="scope.row.advice_type==2&&scope.row.execution_state==1"> {{scope.row.execution_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
  109. <span v-if="scope.row.advice_type==1&&scope.row.stop_state==1"> {{scope.row.stop_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="开嘱医生" width="180" property="advice_doctor" align="center">
  113. <template slot-scope="scope">
  114. {{getXuserName(scope.row.advice_doctor)}}
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="执行护士" width="180" property="execution_staff" align="center">
  118. <template slot-scope="scope">
  119. <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.execution_staff)}}</span>
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. <!-- <pagi-nation title="分页"></pagi-nation> -->
  124. <el-pagination
  125. align="right"
  126. @size-change="handleSizeChange"
  127. @current-change="handleCurrentChange"
  128. :current-page="listQuery.pate"
  129. :page-sizes="[10, 20, 50, 100]"
  130. :page-size="10"
  131. background
  132. style="margin-top:20px;"
  133. layout="total, sizes, prev, pager, next, jumper"
  134. :total="total"
  135. ></el-pagination>
  136. </div>
  137. </div>
  138. </template>
  139. <script>
  140. import { GetPersonAdviceData } from "@/api/qcd";
  141. import {jsGetAge, uParseTime} from "@/utils/tools";
  142. import personNav from './components/personNav'
  143. import personInfo from './components/personInfo'
  144. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  145. import LineChart from "../../components/LineChart";
  146. export default {
  147. name: "totalAnalysis",
  148. data() {
  149. return {
  150. crumbs:[
  151. {path:false, name:'科室质控'},
  152. {path:false, name:'患者分析'},
  153. {path:false, name:'统计'},
  154. {path:false, name:'口服药'},
  155. ],
  156. total: 0,
  157. patientMap:{},
  158. listQuery: {
  159. start_time: "",
  160. end_time: "",
  161. page: 1,
  162. limit: 10,
  163. },
  164. CompletionOptions:{
  165. xAxis:[],
  166. legend:[],
  167. series:[],
  168. },
  169. medicalOptions:[],
  170. tableData: [],
  171. pieData:[],
  172. patientInfo:null,
  173. patientID:0,
  174. adviceType:0,
  175. adviceTypeOptions: [
  176. { value: 0, label: "全部", },
  177. { value: 2, label: "临时医嘱", },
  178. { value: 1, label: "长期医嘱", },
  179. ],
  180. adminUserOptions: {},
  181. tableRow: [],
  182. };
  183. },
  184. created() {
  185. var patientID = this.$route.query && this.$route.query.id;
  186. if(typeof(patientID) == 'undefined' || !patientID || patientID<=0) {
  187. this.$message.error('参数错误,无法请求');
  188. return false;
  189. }
  190. patientID = parseInt(patientID);
  191. this.patientID = patientID;
  192. this.listQuery.patient_id = patientID;
  193. var nowDate = new Date();
  194. var nowYear = nowDate.getFullYear();
  195. var nowMonth = nowDate.getMonth() + 1;
  196. var nowDay = nowDate.getDate();
  197. this.listQuery.end_time =
  198. nowYear +
  199. "-" +
  200. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  201. "-" +
  202. (nowDay < 10 ? "0" + nowDay : nowDay);
  203. nowDate.setMonth(nowDate.getMonth() - 3);
  204. nowYear = nowDate.getFullYear();
  205. nowMonth = nowDate.getMonth() + 1;
  206. nowDay = nowDate.getDate();
  207. this.listQuery.start_time =
  208. nowYear +
  209. "-" +
  210. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  211. "-" +
  212. (nowDay < 10 ? "0" + nowDay : nowDay);
  213. this.getList();
  214. },
  215. methods: {
  216. getList() {
  217. GetPersonAdviceData(this.listQuery).then(response => {
  218. if (response.data.state == 0) {
  219. this.$message.error(response.data.msg);
  220. return false;
  221. } else {
  222. this.tableData = [];
  223. this.total = response.data.data.total;
  224. this.patientInfo = response.data.data.patient;
  225. var advices = response.data.data.advices;
  226. for (const index in advices) {
  227. this.tableData.push(advices[index]);
  228. }
  229. var adminUserOptions = response.data.data.users;
  230. for (const index in adminUserOptions) {
  231. this.adminUserOptions[adminUserOptions[index].id] = adminUserOptions[index];
  232. }
  233. // var pieData = response.data.data.pie;
  234. // for (const index in pieData) {
  235. // this.pieData.push(pieData[index]);
  236. // }
  237. }
  238. });
  239. },
  240. cellstyle(row){
  241. if (row.columnIndex == 1) {
  242. return 'text-align:left;';
  243. }
  244. return '';
  245. },
  246. handleTableRow() {
  247. this.tableRow = [];
  248. var pos = 0;
  249. for (const index in this.tableData) {
  250. if (index==0) {
  251. this.tableRow.push(1);
  252. pos = 0;
  253. }else {
  254. if (this.tableData[index].groupno === this.tableData[index-1].groupno) {
  255. this.tableRow[pos] += 1;
  256. this.tableRow.push(0);
  257. }else {
  258. this.tableRow.push(1);
  259. pos = index;
  260. }
  261. }
  262. }
  263. },
  264. mergeSpan({ row, column, rowIndex, columnIndex }) {
  265. if (columnIndex !== 1 ) {
  266. const _row = this.tableRow[rowIndex];
  267. const _col = _row > 0 ? 1 : 0;
  268. return {
  269. rowspan: _row,
  270. colspan: _col
  271. };
  272. }
  273. },
  274. changeTime() {
  275. this.getList();
  276. },
  277. onSearch(){
  278. this.getList();
  279. },
  280. changeModel() {
  281. this.getList();
  282. },
  283. handleSizeChange(val) {
  284. this.listQuery.limit = val;
  285. this.getList();
  286. },
  287. handleCurrentChange(val) {
  288. this.listQuery.page = val;
  289. this.getList();
  290. },
  291. getTime(value, temp) {
  292. if (value != undefined) {
  293. return uParseTime(value, temp)
  294. }
  295. return ""
  296. },
  297. getXuserName(id) {
  298. if (id <= 0) {
  299. return "";
  300. }
  301. if (id in this.adminUserOptions) {
  302. return this.adminUserOptions[id].name;
  303. }
  304. return ''
  305. },
  306. getProjectName(id) {
  307. return (id in this.projectOptions) ? this.projectOptions[id].project_name:'';
  308. },
  309. getPatientName(id) {
  310. return (id in this.patientMap) ? this.patientMap[id].name:'';
  311. },
  312. getPatientLapseto(lapseto) {
  313. if(lapseto==1) {
  314. return '留治';
  315. }else if(lapseto == 2) {
  316. return '转出';
  317. }
  318. return '--';
  319. },
  320. getPatientSource(srouce){
  321. if(srouce==1) {
  322. return '门诊';
  323. }else if(srouce == 2) {
  324. return '住院';
  325. }
  326. return '其他';
  327. },
  328. getPatientGender(gender) {
  329. if (gender == 1) {
  330. return '男';
  331. } else if(gender == 2) {
  332. return '女';
  333. }
  334. return '';
  335. },
  336. tranAge(birthday) {
  337. var birth = uParseTime(birthday, '{y}-{m}-{d}');
  338. return jsGetAge(birth, '-');
  339. },
  340. getPatientDialysisNo(id) {
  341. return (id in this.patientMap) ? this.patientMap[id].dialysis_no:'';
  342. },
  343. getItemVulue(project_id, item_id, row) {
  344. var key = project_id + '_' + item_id;
  345. return (typeof(row.items) !== 'undefined' && (key in row.items)) ? row.items[key].inspect_value:'';
  346. },
  347. renderheader(h, { column, $index }) {
  348. return h('span', {}, [
  349. h('span', {}, column.label.split('//')[0]),
  350. h('br'),
  351. h('span', {}, column.label.split('//')[1])
  352. ])
  353. },
  354. selectAdviceType(type) {
  355. this.adviceType = type;
  356. this.listQuery.advice_type = type;
  357. this.getList();
  358. },
  359. drawPie(){
  360. this.CompletionOptions = {
  361. xAxis:[],
  362. legend:[],
  363. series:[],
  364. };
  365. if(this.diagramType !== 1 && this.diagramType !== 2) {
  366. return false;
  367. }
  368. if (this.diagramType == 1) {
  369. this.CompletionOptions.legend = ['透前称重', '透后称重', '干体重'];
  370. this.CompletionOptions.series = [
  371. { name:'透前称重', type:'line', data:[] },
  372. { name:'透后称重', type:'line', data:[] },
  373. { name:'干体重', type:'line', data:[] },
  374. ];
  375. }else {
  376. this.CompletionOptions.legend = ['体重增加'];
  377. this.CompletionOptions.series = [
  378. // { name:'透前体重', type:'line', data:[] },
  379. { name:'体重增加', type:'line', data:[] },
  380. // { name:'干体重', type:'line', data:[] },
  381. ];
  382. }
  383. for (const index in this.pieData) {
  384. var dateDay = uParseTime(this.pieData[index].schedule_date, '{y}-{m}-{d}');
  385. if (this.diagramType == 1) {
  386. this.CompletionOptions.xAxis.push(dateDay);
  387. if (this.pieData[index].assessment_after_dislysis) {
  388. this.CompletionOptions.series[1].data.push(this.pieData[index].assessment_after_dislysis.weight_after);
  389. } else {
  390. this.CompletionOptions.series[1].data.push(0);
  391. }
  392. if (this.pieData[index].assessment_before_dislysis) {
  393. this.CompletionOptions.series[0].data.push(this.pieData[index].assessment_before_dislysis.weight_before);
  394. this.CompletionOptions.series[2].data.push(this.pieData[index].assessment_before_dislysis.dry_weight);
  395. } else {
  396. this.CompletionOptions.series[0].data.push(0);
  397. this.CompletionOptions.series[2].data.push(0);
  398. }
  399. } else {
  400. this.CompletionOptions.xAxis.push(dateDay);
  401. if (this.pieData[index].assessment_before_dislysis) {
  402. var weightTem = this.pieData[index].assessment_before_dislysis.weight_before - this.pieData[index].assessment_before_dislysis.dry_weight;
  403. // this.CompletionOptions.series[0].data.push(this.pieData[index].assessment_before_dislysis.weight_before);
  404. this.CompletionOptions.series[0].data.push(weightTem);
  405. // this.CompletionOptions.series[2].data.push(this.pieData[index].assessment_before_dislysis.dry_weight);
  406. } else {
  407. this.CompletionOptions.series[0].data.push(0);
  408. }
  409. }
  410. }
  411. },
  412. },
  413. components: {
  414. personNav,
  415. BreadCrumb,
  416. personInfo,
  417. LineChart
  418. },
  419. watch:{
  420. "diagramType":function(){
  421. this.drawPie();
  422. },
  423. "pieData":function (){
  424. this.drawPie();
  425. },
  426. 'tableData':function (){
  427. this.handleTableRow();
  428. }
  429. }
  430. };
  431. </script>
  432. <style>
  433. #oictable ::-webkit-scrollbar {
  434. height: 15px;
  435. }
  436. #outcome-indicators-query .el-form-item {
  437. margin-bottom: 0px !important;
  438. }
  439. </style>
  440. <style rel="stylesheet/scss" lang="scss" scoped>
  441. .app-container {
  442. // margin: 20px;
  443. font-size: 15px;
  444. .filter-container {
  445. padding-bottom: 5px;
  446. }
  447. .cqd-dataTitle{
  448. color: #303133;
  449. font-size: 14px;
  450. border-bottom: 2px #E4E7ED solid;
  451. height: 36px;
  452. line-height: 36px;
  453. margin: 0 0 25px 0;
  454. position: relative;
  455. }
  456. .cqd-dataTitle::before {
  457. position: absolute;
  458. left: 0;
  459. bottom: -2px;
  460. content: "";
  461. width: 42px;
  462. height: 2px;
  463. background: #409eff;
  464. }
  465. .search-component {
  466. width: 500px;
  467. .searchBox {
  468. width: 300px;
  469. height: 36px;
  470. line-height: 36px;
  471. padding-left: 15px;
  472. border: 1px #dcdfe6 solid;
  473. border-right: none;
  474. outline: none;
  475. float: left;
  476. border-radius: 6px 0 0 6px;
  477. font-size: 14px;
  478. color: #333;
  479. background: #fff;
  480. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  481. }
  482. .searchBtn {
  483. background-color: #409eff;
  484. color: #fff;
  485. font-size: 15px;
  486. text-align: center;
  487. height: 36px;
  488. line-height: 36px;
  489. float: left;
  490. outline: none;
  491. width: 70px;
  492. border: none;
  493. border-radius: 0 6px 6px 0;
  494. font-family: "Microsoft Yahei";
  495. cursor: pointer;
  496. }
  497. }
  498. .amount {
  499. font-weight: normal;
  500. padding: 10px 0 0 0;
  501. color: #606266;
  502. font-size: 14px;
  503. span {
  504. color: #ef2525;
  505. font-family: "Arial";
  506. padding: 0 2px;
  507. }
  508. }
  509. }
  510. </style>