Commit 7b5403d1 authored by yaqizhang's avatar yaqizhang

隐患危险源修改按钮

parent 8fdf29f9
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
</el-form> </el-form>
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="tableData.pageData" stripe show-summary :summary-method="getTotal" border style="width:100%;" :loading="loading"> <el-table :data="tableData.pageData" stripe show-summary border style="width:100%;" :loading="loading">
<el-table-column prop="unitName" label="企业名称"></el-table-column> <el-table-column prop="unitName" label="企业名称"></el-table-column>
<el-table-column prop="dangerNum" label="危险源数量"></el-table-column> <el-table-column prop="unitName" label="危险源"></el-table-column>
<el-table-column prop="cameraNum" label="设备监控数量"></el-table-column> <el-table-column prop="legalPerson" label="设备监控"></el-table-column>
<el-table-column prop="troubleNum" label="隐患数量"></el-table-column> <el-table-column prop="orgCode" label="职业危害场所"></el-table-column>
<el-table-column prop="legalPersonEmail" label="隐患数量""></el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
background background
...@@ -68,7 +69,7 @@ ...@@ -68,7 +69,7 @@
that.loading = true; that.loading = true;
METHOD.axiosPost( METHOD.axiosPost(
that, that,
`/dataStatistics/getDataStatistics`, `/enterpriseInfo/queryEnterpriseInfo`,
param, param,
function(res: any) { function(res: any) {
that.loading = false; that.loading = false;
...@@ -78,52 +79,6 @@ ...@@ -78,52 +79,6 @@
} }
); );
} }
getTotal(param: any) {
const { columns, data } = param;
const sums: any[] = [];
columns.forEach((column: any, index: any) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map((item: { [x: string]: any; }) => Number(item[column.property]));
if (column.property === 'dangerNum') {
sums[index] = values.reduce((prev: any, curr: any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
} else if (column.property === 'troubleNum') {
sums[index] = values.reduce((prev: any, curr: any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
} else if (column.property === 'cameraNum') {
sums[index] = values.reduce((prev: any, curr: any) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index];
} else {
sums[index] = '--';
}
});
return sums;
}
searchFun() { searchFun() {
this.PAGE = { page: 1, size: 10 }; this.PAGE = { page: 1, size: 10 };
this.getTableData(); this.getTableData();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment