You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

640 lines
20 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 weeks ago
2 years ago
2 years ago
2 years ago
3 weeks ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 weeks ago
3 weeks ago
2 years ago
3 weeks ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 weeks ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 weeks ago
2 years ago
2 years ago
3 weeks ago
2 years ago
2 years ago
3 weeks ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="box">
  3. <div>
  4. <div class="middlebox">
  5. <div class="contenttitle">
  6. 客户报表 /
  7. <span class="contenttitleBold"
  8. >阳性结果人员</span
  9. >
  10. </div>
  11. </div>
  12. <div :style="'display: block;'">
  13. <div style="background-color: #fff; padding: 15px; border-radius: 8px;display: flex;flex-wrap: wrap; margin-bottom: 10px;height:35px;margin-top: 7px;">
  14. <div class="query">
  15. <span>体检单位</span>
  16. <el-input
  17. placeholder="请选择体检单位"
  18. v-model="patientRegister.query.cusOrgOCX"
  19. style="width: 240px"
  20. size="small"
  21. disabled
  22. >
  23. <el-button
  24. slot="append"
  25. icon="el-icon-search"
  26. @click="diagnosis.dialogCusOrgOCX = true"
  27. style="font-size: 20px"
  28. ></el-button>
  29. </el-input>
  30. </div>
  31. <div class="query">
  32. <span>诊断</span>
  33. <el-input
  34. placeholder="请选择诊断"
  35. v-model="patientRegister.query.StatisticsOCX"
  36. style="width: 200px"
  37. size="small"
  38. disabled
  39. >
  40. <el-button
  41. slot="append"
  42. icon="el-icon-search"
  43. @click="diagnosis.dialogAsbitemOCX = true"
  44. style="font-size: 20px"
  45. ></el-button>
  46. </el-input>
  47. </div>
  48. <div class="query">
  49. <span>检查状态</span>
  50. <el-select
  51. v-model="completeFlag"
  52. placeholder="请选择"
  53. clearable
  54. style="width: 80px"
  55. size="small"
  56. >
  57. <el-option label="预登记" value="0" />
  58. <el-option label="正式登记" value="1" />
  59. <el-option label="部份已检" value="2" />
  60. <el-option label="已总检" value="3" />
  61. </el-select>
  62. </div>
  63. <div class="query">
  64. <el-checkbox
  65. v-model="classification"
  66. true-label="Y"
  67. false-label="N"
  68. />
  69. <span style="margin-left: 5px">审核状态</span>
  70. </div>
  71. <div class="query">
  72. <span>报表格式</span>
  73. <el-select
  74. v-model="format"
  75. placeholder="请选择"
  76. style="width: 80px"
  77. size="small"
  78. @change="changeValue"
  79. >
  80. <el-option label="标准格式" value="0" />
  81. <el-option label="精简格式" value="1" />
  82. </el-select>
  83. </div>
  84. <div class="query">
  85. <el-button @click="btnQuery" size="small" class="commonbutton"
  86. >查询</el-button
  87. >
  88. </div>
  89. <div class="query">
  90. <el-button @click="handleExport" size="small" class="commonbutton"
  91. >导出excel</el-button
  92. >
  93. </div>
  94. <div class="query">
  95. <el-button @click="onPrint" size="small" class="commonbutton"
  96. >打印</el-button
  97. >
  98. </div>
  99. </div>
  100. <div v-show="format == 0" ref="imageDom0">
  101. <div style="background-color: #fff; padding: 15px; border-radius: 8px;">
  102. <el-table
  103. border
  104. :height="flag
  105. ? window.pageHeight < 600
  106. ? 415
  107. : window.pageHeight - 185 - 20: ''
  108. "
  109. :data="dataList"
  110. id="projectTableData"
  111. ref="projectTableData"
  112. style="width: 100%"
  113. show-summary
  114. :summary-method="getSummaries"
  115. >
  116. <el-table-column label="阳性结果人员清单">
  117. <el-table-column :label="`开始时间: ${summary.startDate || ''} 结束时间:${summary.endDate || ''} 男性: ${summary.maleCount} 女性: ${summary.femaleCount}`" align="left">
  118. <template slot-scope="scope">
  119. <el-table
  120. :data="scope.row.patientRegisters"
  121. border
  122. :span-method="objectProjectSpanMethod"
  123. show-summary
  124. :summary-method="summarizeRegisterCount"
  125. >
  126. <el-table-column :label="scope.row.diagnosisName">
  127. <el-table-column
  128. label="部门名称"
  129. prop="departmentName"
  130. width="300"
  131. ></el-table-column>
  132. <el-table-column
  133. label="姓名"
  134. prop="patientName"
  135. ></el-table-column>
  136. <el-table-column
  137. label="性别"
  138. prop="sexName"
  139. ></el-table-column>
  140. <el-table-column
  141. prop="age"
  142. label="年龄"
  143. >
  144. </el-table-column>
  145. <el-table-column prop="patientRegisterNo" label="条码号">
  146. </el-table-column>
  147. <el-table-column
  148. prop="patientNo"
  149. label="档案号"
  150. >
  151. </el-table-column>
  152. <el-table-column prop="medicalTimes" label="体检次数">
  153. </el-table-column>
  154. <el-table-column prop="telephone" label="电话">
  155. </el-table-column>
  156. <el-table-column prop="mobileTelephone" label="手机号">
  157. </el-table-column>
  158. </el-table-column>
  159. </el-table>
  160. </template>
  161. </el-table-column>
  162. </el-table-column>
  163. </el-table>
  164. </div>
  165. </div>
  166. <div v-show="format == 1" ref="imageDom1">
  167. <div style="background-color: #fff; padding: 15px; border-radius: 8px;">
  168. <el-table
  169. border
  170. :height="
  171. flag
  172. ? window.pageHeight < 600 ? 415 : window.pageHeight - 185-20: ''
  173. "
  174. :data="dataLists"
  175. id="standardTableData"
  176. ref="standardTableData"
  177. style="width: 100%"
  178. show-summary
  179. :summary-method="getSummaris"
  180. >
  181. <el-table-column label="阳性结果人员清单">
  182. <el-table-column :label="`开始时间: ${summary.startDate || ''} 结束时间:${summary.endDate || ''}体检人员共计: ${(summary.maleCount+summary.femaleCount)} 男性: ${summary.maleCount} 女性: ${summary.femaleCount}`" align="left">
  183. <el-table-column
  184. prop="diagnosisName"
  185. label="诊断名称"
  186. ></el-table-column>
  187. <el-table-column
  188. prop="patientNames"
  189. label="人员清单"
  190. ></el-table-column>
  191. <el-table-column
  192. prop="patientCount"
  193. label="人数"
  194. ></el-table-column>
  195. <el-table-column prop="percentage" label="占百分比">
  196. </el-table-column>
  197. </el-table-column>
  198. </el-table-column>
  199. </el-table>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. <!--通用选单位体检次数分组的控件-->
  205. <el-dialog
  206. title="体检单位选择"
  207. :visible.sync="diagnosis.dialogCusOrgOCX"
  208. :close-on-click-modal="false"
  209. width="880px"
  210. height="600px"
  211. >
  212. <CusOrgOCX :initDateType="'creationTime'" :useCustomerOrg="true" />
  213. </el-dialog>
  214. <!--通用选组合项目的控件-->
  215. <el-dialog
  216. title="诊断选择"
  217. :visible.sync="diagnosis.dialogAsbitemOCX"
  218. :close-on-click-modal="false"
  219. width="700px"
  220. height="600px"
  221. >
  222. <StatisticsOCX />
  223. </el-dialog>
  224. </div>
  225. </template>
  226. <script>
  227. import moment from "moment";
  228. import { mapState, mapActions } from "vuex";
  229. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  230. import { exportToExcel } from "../../utlis/Export2Excel";
  231. import html2canvas from "html2canvas";
  232. import printJs from "print-js";
  233. import {
  234. dddw,
  235. objCopy,
  236. arrayReduce,
  237. arrayExistObj,
  238. tcdate,
  239. } from "@/utlis/proFunc";
  240. import CusOrgOCX from "../../components/report/CusOrgOCX.vue";
  241. import StatisticsOCX from "../../components/report/StatisticsOCX.vue";
  242. export default {
  243. components: {
  244. CusOrgOCX,
  245. StatisticsOCX,
  246. },
  247. data() {
  248. return {
  249. dataList: [], //列表数据
  250. dataLists: [],
  251. completeFlag: "",
  252. classification: "Y",
  253. format: "0",
  254. mergedColumnes: ["departmentName"],
  255. spanMaps: {},
  256. flag: true,
  257. summary:{
  258. startDate:"",
  259. endDate:"",
  260. femaleCount:"",
  261. maleCount:""
  262. }
  263. };
  264. },
  265. created() {
  266. this.dictInit();
  267. },
  268. //挂载完成
  269. mounted() {
  270. // this.btnQuery();
  271. },
  272. computed: {
  273. ...mapState(["window", "dict", "patientRegister", "diagnosis"]),
  274. },
  275. methods: {
  276. moment,
  277. dddw,
  278. //数据初始化
  279. dictInit() {
  280. //体检中心
  281. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  282. (res) => {
  283. if (res.code == 1) {
  284. this.dict.organization = res.data;
  285. }
  286. }
  287. );
  288. //体检单位树
  289. getapi("/api/app/customerorg/getbycodeall").then((res) => {
  290. if (res.code == 1) {
  291. this.patientRegister.customerOrgTreeAll = res.data;
  292. tcdate(this.patientRegister.customerOrgTreeAll);
  293. }
  294. });
  295. //体检类别
  296. getapi("/api/app/medical-type/in-filter").then((res) => {
  297. if (res.code == 1) {
  298. this.dict.medicalType = res.data;
  299. }
  300. });
  301. //体检类别 树结构
  302. getapi("/api/app/item-type/by-code-all").then((res) => {
  303. if (res.code == 1) {
  304. this.dict.itemTypeTree = res.data;
  305. tcdate(this.dict.itemTypeTree);
  306. }
  307. });
  308. postapi("/api/app/Diagnosis/GetSimpleList").then((res) => {
  309. if (res.code == 1) {
  310. this.dict.asbItemAll = res.data;
  311. }
  312. });
  313. },
  314. changeValue(value) {
  315. if (value == 0) {
  316. this.$nextTick(() => {
  317. this.$refs.projectTableData.doLayout();
  318. });
  319. } else if (value == 1) {
  320. this.$nextTick(() => {
  321. this.$refs.standardTableData.doLayout();
  322. });
  323. }
  324. },
  325. tableRowClassName({ row, rowIndex }) {
  326. switch (row.isCharge) {
  327. case "N":
  328. return "danger";
  329. default:
  330. return "";
  331. }
  332. },
  333. getSummaris(param) {
  334. const { columns, data } = param;
  335. const sums = [];
  336. columns.forEach((column, index) => {
  337. if (index === 0) {
  338. sums[index] = "合计";
  339. return;
  340. }
  341. if (index === 1) {
  342. let num = 0;
  343. data.forEach((item, index) => {
  344. num += item.patientCount;
  345. });
  346. sums[index] = num + " 人";
  347. }
  348. });
  349. return sums;
  350. },
  351. getSummaries(param){
  352. const { columns, data } = param;
  353. const sums = [];
  354. columns.forEach((column, index) => {
  355. if(index === 0){
  356. let num=0
  357. data.forEach((item,index)=>{
  358. num+=item.patientRegisters.length
  359. })
  360. sums[index] = "合计:" + num + "人";
  361. }
  362. })
  363. return sums
  364. },
  365. summarizeRegisterCount(param) {
  366. const { columns, data } = param;
  367. const sums = [];
  368. columns.forEach((column, index) => {
  369. if (index === 0) {
  370. sums[index] = "小计";
  371. return;
  372. }
  373. const values = data.map((item) => Number(item[column.property]));
  374. if (index === 1) {
  375. sums[index] = values.reduce((prev, curr) => {
  376. const value = Number(curr);
  377. if (!isNaN(value)) {
  378. return prev + curr;
  379. } else {
  380. return prev;
  381. }
  382. }, 0);
  383. sums[index] = "共" + values.length + "人";
  384. } else {
  385. sums[index] = "";
  386. }
  387. });
  388. return sums;
  389. },
  390. setProjectdates(data) {
  391. for (var i = 0; i < data.length; i++) {
  392. if (i === 0) {
  393. this.mergedColumnes.forEach((column) => {
  394. this.spanMaps[column] = {
  395. spanArr: [1],
  396. pos: 0,
  397. // index:i
  398. };
  399. });
  400. } else {
  401. this.mergedColumnes.forEach((column) => {
  402. if (data[i][column] === data[i - 1][column]) {
  403. this.spanMaps[column].spanArr[this.spanMaps[column].pos] += 1;
  404. this.spanMaps[column].spanArr.push(0);
  405. } else {
  406. this.spanMaps[column].spanArr.push(1);
  407. this.spanMaps[column].pos = i;
  408. }
  409. // this.spanMap[column].index=i
  410. });
  411. }
  412. }
  413. },
  414. objectProjectSpanMethod({ row, column, rowIndex, columnIndex }) {
  415. let index = rowIndex;
  416. if (index === 0 && columnIndex === 0) {
  417. for (let i = 0; i < this.dataList.length; i++) {
  418. if (row.diagnosisName === this.dataList[i].diagnosisName) {
  419. this.setProjectdates(this.dataList[i].patientRegisters);
  420. }
  421. }
  422. }
  423. if (this.spanMaps[column.property]) {
  424. const _row = this.spanMaps[column.property].spanArr[rowIndex];
  425. const _col = _row > 0 ? 1 : 0;
  426. return {
  427. rowspan: _row,
  428. colspan: _col,
  429. };
  430. }
  431. },
  432. ForwardRanking(data){
  433. for (let i = 0; i < data.length; i++) {
  434. data[i].patientRegisters.sort(function (a, b) {
  435. return a.departmentName > b.departmentName ? -1 : 1; //根据名称属性进行排序
  436. });
  437. }
  438. for(let i = 0; i < data.length; i++){
  439. for(let k=0;k<data[i].patientRegisters.length;k++){
  440. let diagnosisName=data[i].diagnosisName
  441. data[i].patientRegisters[k].diagnosisName=diagnosisName
  442. }
  443. }
  444. this.dataList = data;
  445. },
  446. //查询
  447. btnQuery() {
  448. let body = {},
  449. customerOrgs = [],
  450. diagnosisIds = [];
  451. if (this.diagnosis.dataCusOrgOCX.length > 0) {
  452. this.diagnosis.dataCusOrgOCX.forEach((e) => {
  453. let rd = {
  454. startDate: moment(e.startDate).format("yyyy-MM-DD"),
  455. endDate: moment(e.endDate).format("yyyy-MM-DD"),
  456. dateType:
  457. e.dateType == "summaryDate"
  458. ? "3"
  459. : e.dateType == "medicalStartDate"
  460. ? "2"
  461. : "1",
  462. };
  463. if (e.customerOrgId) {
  464. rd.customerOrgId = e.customerOrgId;
  465. if (e.customerOrgId == this.dict.personOrgId) {
  466. rd.customerOrgRegisterId = null;
  467. rd.customerOrgGroupId = [];
  468. } else {
  469. rd.customerOrgRegisterId = e.customerOrgRegister.id;
  470. rd.customerOrgGroupId = e.customerOrgGroupIds;
  471. }
  472. }
  473. customerOrgs.push(rd);
  474. });
  475. }
  476. if (this.diagnosis.dataAsbitemOCX.length > 0) {
  477. this.diagnosis.dataAsbitemOCX.forEach((e) => {
  478. diagnosisIds.push(e.id);
  479. });
  480. }
  481. body.customerOrgs = customerOrgs;
  482. body.diagnosisIds = diagnosisIds;
  483. if (this.completeFlag) body.completeFlag = this.completeFlag;
  484. body.isAudit = this.classification;
  485. //console.log('/api/app/peisreport/getregisterasbitemchargestatus',body)
  486. if (this.format == 0) {
  487. postapi(
  488. "/api/customerreport/getpositivepatientregisterreportstandard",
  489. body
  490. ).then((res) => {
  491. if (res.code != -1) {
  492. this.ForwardRanking(res.data.details)
  493. this.summary.startDate=res.data.startDate;
  494. this.summary.endDate=res.data.endDate;
  495. this.summary.femaleCount=res.data.femaleCount;
  496. this.summary.maleCount=res.data.maleCount;
  497. this.$nextTick(() => {
  498. this.$refs.projectTableData.doLayout();
  499. });
  500. }
  501. });
  502. } else {
  503. postapi(
  504. "/api/customerreport/getpositivepatientregisterreportreduce",
  505. body
  506. ).then((res) => {
  507. if (res.code != -1) {
  508. this.dataLists = res.data.details;
  509. this.summary.startDate=res.data.startDate;
  510. this.summary.endDate=res.data.endDate;
  511. this.summary.femaleCount=res.data.femaleCount;
  512. this.summary.maleCount=res.data.maleCount;
  513. this.$nextTick(() => {
  514. this.$refs.standardTableData.doLayout();
  515. });
  516. }
  517. });
  518. }
  519. },
  520. onPrint() {
  521. this.flag = false;
  522. let index = "";
  523. if (this.format == 0) {
  524. index = "imageDom0";
  525. } else if (this.format == 1) {
  526. index = "imageDom1";
  527. }
  528. this.$nextTick(() => {
  529. let width = this.$refs[index].style.width;
  530. let cloneDom = this.$refs[index].cloneNode(true);
  531. let imageDom = this.$refs[index];
  532. cloneDom.style.position = "absolute";
  533. cloneDom.style.top = "0px";
  534. cloneDom.style.zIndex = "-1";
  535. cloneDom.style.width = width;
  536. console.log(cloneDom);
  537. imageDom.appendChild(cloneDom);
  538. html2canvas(cloneDom).then((canvas) => {
  539. // 转成图片,生成图片地址
  540. const url = canvas.toDataURL("image/png");
  541. printJs({
  542. printable: url,
  543. type: "image",
  544. documentTitle: "", // 标题
  545. style: `@media print { @page {size: auto; margin: 0 0 0 0; } body{margin:0 5px}canvas{page-break-after: always;page-break-inside: avoid;
  546. page-break-after: avoid;
  547. page-break-before: avoid;}}`, // 去除页眉页脚
  548. });
  549. });
  550. cloneDom.style.display = "none";
  551. this.flag = true;
  552. });
  553. },
  554. handleExport() {
  555. if (this.format == 0) {
  556. let index = 3;
  557. let list = [];
  558. list.push(index);
  559. for (let i = 0; i < this.dataList.length - 1; i++) {
  560. index += this.dataList[i].patientRegisters.length + 4;
  561. list.push(index);
  562. }
  563. exportToExcel("#projectTableData", "阳性结果人员清单", true,list);
  564. } else if (this.format == 1) {
  565. exportToExcel("#standardTableData", "阳性结果人员清单",false);
  566. }
  567. },
  568. },
  569. //监听事件
  570. watch: {
  571. //触发查询事件
  572. // "patientRegister.query.times"(newVal, oldVal) {
  573. // if (newVal != oldVal) {
  574. // //alert('触发查询事件')
  575. // this.query();
  576. // }
  577. // },
  578. },
  579. };
  580. </script>
  581. <style scoped>
  582. @import "../../assets/css/global_button.css";
  583. @import "../../assets/css/global_dialog.css";
  584. @import "../../assets/css/global_table.css";
  585. @import "../../assets/css/global_form.css";
  586. @import "../../assets/css/global_input.css";
  587. @import "../../assets/css/global.css";
  588. .query{
  589. margin-right: 10px;
  590. display: flex;
  591. justify-content: center;
  592. align-items: center;
  593. font-size: 14px;
  594. color: #232748;
  595. font-size: 400;
  596. font-family: "NotoSansSC-Regular";
  597. }
  598. .box {
  599. display: flex;
  600. flex-direction: column;
  601. }
  602. ::v-deep .el-input__inner {
  603. /*text-align: center;*/
  604. padding-left: 5px;
  605. padding-right: 15px;
  606. }
  607. ::v-deep .el-input__icon {
  608. width: 15px;
  609. /* 输入框下拉箭头或清除图标 默认 25 */
  610. }
  611. ::v-deep .el-input-group__append {
  612. padding: 0 5px;
  613. /* 控件默认 0 20px;*/
  614. }
  615. ::v-deep .el-icon-search:before {
  616. color: #00F;
  617. }
  618. .query:last-child{
  619. margin-right: 0;
  620. }
  621. </style>