0) {
+ this.report.dataCusOrgOCX.forEach((e) => {
+ let rd = {
+ startDate: moment(e.startDate).format("yyyy-MM-DD"),
+ endDate: moment(e.endDate).format("yyyy-MM-DD"),
+ dateType:
+ e.dateType == "summaryDate"
+ ? "3"
+ : e.dateType == "medicalStartDate"
+ ? "2"
+ : "1",
+ };
+
+ if (e.customerOrgId) {
+ rd.customerOrgId = e.customerOrgId;
+ if (e.customerOrgId == this.dict.personOrgId) {
+ rd.customerOrgRegisterId = null;
+ rd.customerOrgGroupId = [];
+ } else {
+ rd.customerOrgRegisterId = e.customerOrgRegister.id;
+ rd.customerOrgGroupId = e.customerOrgGroupIds;
+ }
+ }
+ customerOrgs.push(rd);
+ });
+ }
+
+ body.customerOrgs = customerOrgs;
+ if (this.completeFlag) body.completeFlag = this.completeFlag;
+ body.isAudit = this.classification;
+ postapi(
+ "/api/app/OccupationalDiseaseReport/GetCompanyOccupationalDiseaseDataExcel",
+ body
+ ).then((res) => {
+ if (res.code != -1) {
+ this.tableData = res.data;
+ }
+ });
+ },
btnQuery(isPreview) {
let customerOrgs = [];
if (this.report.dataCusOrgOCX.length > 0) {
@@ -438,115 +281,27 @@ export default {
});
}
},
-
- summarizeRegisterCounts(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "合计";
- return;
- }
- if (index === 1) {
- sums[index] = data.length + "人";
- return;
- }
- });
-
- return sums;
- },
- summarizeRegisterCount(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "合计";
- return;
- }
- const values = data.map((item) => Number(item[column.property]));
- if (index === 2) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- sums[index] += " 人";
- }
- });
-
- return sums;
- },
- headerStyle({ row, column, rowIndex, columnIndex }) {
- if (rowIndex === 1) {
- return "left-align";
- }
- },
changeValue(value) {
- if (value == 0) {
+ if (value == 2) {
this.$nextTick(() => {
this.$refs.standardTableData.doLayout();
});
- } else if (value == 1) {
- this.$nextTick(() => {
- this.$refs.reducetableData.doLayout();
- });
}
},
handleExport() {
- if (this.format == 0) {
- let name = "北京神豚软件开发有限公司体检报告";
- if (this.reportTitle != "") {
- name = this.reportTitle;
- }
- let index = 3;
- let list = [];
- list.push(index);
- index += this.tableData[0].patientRegisterPositiveReports.length + 7;
- list.push(index);
- for (
- let i = 0;
- i <
- this.tableData[0].positivePatientRegisterReportStandards.length - 1;
- i++
- ) {
- index +=
- this.tableData[0].positivePatientRegisterReportStandards[i]
- .patientRegisters.length + 4;
- list.push(index);
- }
- exportToExcel("#standardTableData", name, true, list);
- } else if (this.format == 1) {
- let name = "北京神豚软件开发有限公司体检报告";
- if (this.reducereportTitle != "") {
- name = this.reducereportTitle;
- }
- let index = 3;
- let list = [];
- list.push(index);
- exportToExcel("#reducetableData", name, true, list);
- }
+ exportToExcel("#standardTableData", "单位职业病汇总", false);
},
onPrint() {
this.flag = false;
- let index = "";
- if (this.format == 0) {
- index = "imageDom0";
- } else if (this.format == 1) {
- index = "imageDom1";
- } else {
- index = "imageDom2";
- }
this.$nextTick(() => {
- let width = this.$refs[index].style.width;
- let cloneDom = this.$refs[index].cloneNode(true);
- let imageDom = this.$refs[index];
+ let width = this.$refs.imageDom2.style.width;
+ let cloneDom = this.$refs.imageDom2.cloneNode(true);
+ let imageDom = this.$refs.imageDom2;
cloneDom.style.position = "absolute";
cloneDom.style.top = "0px";
cloneDom.style.zIndex = "-1";
cloneDom.style.width = width;
+ console.log(cloneDom);
imageDom.appendChild(cloneDom);
html2canvas(cloneDom).then((canvas) => {
// 转成图片,生成图片地址