Commit 5d2f8010 authored by lichunliang's avatar lichunliang

1-4

parent b4bc34af
import request from '@/utils/request'
import requestFile from '@/utils/requestfile'
import qs from 'qs'
export function dangerCriteria(params) {
return request({
url: '/api/dangerJobReport/criteria',
method: 'get',
params
})
}
export function dangerJobReport(params) {//报告分页
return request({
url: '/api/dangerJobReport/page',
method: 'get',
params
})
}
export function dangerJobReportEnterprise(params) {//企业分页
return request({
url: '/api/dangerJobReport/pageEnterprise',
method: 'get',
params
})
}
\ No newline at end of file
......@@ -25,3 +25,5 @@ export function postHwapproval(data) {
data
})
}
......@@ -30,7 +30,7 @@ const editlaw = () => import('../views/law/editlaw.vue')
const addadvice = () => import('../views/advice/addadvice.vue')
const eidtadvice = () => import('../views/advice/editadvice.vue')
const addwarn = () => import('../views/warn/index.vue')
const addwarntype = () => import ('../views/warn/warntype.vue')
const addwarntype = () => import('../views/warn/warntype.vue')
const live = () => import('../views/live/index.vue')
const teach = () => import('../views/teach/index.vue')
const addtype = () => import('../views/teach/addtype.vue')
......@@ -66,6 +66,7 @@ const entercertifies = () => import('../views/entercertifies/enterceritifies.vue
const hwapproval = () => import('../views/hwapproval/hwapproval.vue')
const hwapprovalstatistics = () => import('../views/hwapproval/hwapprovalstatistics.vue')
const hwapprovalsearch = () => import('../views/hwapproval/findapproval.vue')
const hwapprovals = () => import('../views/hwapproval/hwapprovals.vue')
Vue.use(Router)
......@@ -462,7 +463,7 @@ export const constantRouterMap = [
name: '手动组卷',
meta: { title: '手动组卷' }
},
{
path: 'entercertifymanage/entercer',
component: entercertify,
......@@ -504,6 +505,12 @@ export const constantRouterMap = [
component: hwapprovalsearch,
name: '危险作业备案查找',
meta: { title: '危险作业备案查找' }
},
{
path: 'hwapprovalmanage/:name',
component: hwapprovals,
name: '危险作业备案列表',
meta: { title: '危险作业备案列表' }
}
]
},
......
......@@ -15,90 +15,90 @@
</template>
<script>
import { analyzeCertify } from '@/api/certify.js'
import echarts from 'echarts'
import { parseTime } from '@/utils/index'
import { analyzeCertify } from "@/api/certify.js";
import echarts from "echarts";
import { parseTime } from "@/utils/index";
export default {
data() {
return {
certifySearchDate: ''
}
certifySearchDate: "",
};
},
watch: {
certifySearchDate(newVal, oldVal) {
// console.log(newVal, oldVal);
this.echartsdom.clear()
this.statisticsCertify()
}
this.echartsdom.clear();
this.statisticsCertify();
},
},
mounted() {
this.echartsdom = echarts.init(this.$refs.statistics)
this.statisticsCertify()
this.echartsdom = echarts.init(this.$refs.statistics);
this.statisticsCertify();
},
methods: {
statisticsCertify() {
// this.$refs.statistics
const params = {}
const params = {};
if (this.certifySearchDate instanceof Array) {
params.uploadEndDate = parseTime(new Date(), '{y}-{m}-{d}')
params.uploadStartDate = parseTime(new Date(), '{y}-{m}-{d}')
params.uploadEndDate = parseTime(new Date(), "{y}-{m}-{d}");
params.uploadStartDate = parseTime(new Date(), "{y}-{m}-{d}");
}
analyzeCertify(params).then((res) => {
const data1 = []
const data1 = [];
for (const key in res) {
data1.push({
name: key,
value: res[key]
})
value: res[key],
});
}
data1.map(function(val) {
if (val.name === 'stanEnterpriseNum') {
val.name = '标准化体系的企业数量'
} else if (val.name === 'stanAndEmerEnterpriseNum') {
val.name = '标准化+应急企业数量'
} else if (val.name === 'emerEnterpriseNum') {
val.name = '应急预案的企业数量'
} else if (val.name === 'dualEnterpriseNum') {
val.name = '双体系证书的企业数量'
} else if (val.name === 'dualAndStanEnterpriseNum') {
val.name = '双体系+标准化企业数量'
} else if (val.name === 'dualAndStanAndEmerEnterpriseNum') {
val.name = '双体系+标准化+应急企业数量'
} else if (val.name === 'dualAndEmerEnterpriseNum') {
val.name = '双体系+应急企业数量'
data1.map(function (val) {
if (val.name === "stanEnterpriseNum") {
val.name = "标准化体系的企业数量";
} else if (val.name === "stanAndEmerEnterpriseNum") {
val.name = "标准化+应急企业数量";
} else if (val.name === "emerEnterpriseNum") {
val.name = "应急预案的企业数量";
} else if (val.name === "dualEnterpriseNum") {
val.name = "双体系证书的企业数量";
} else if (val.name === "dualAndStanEnterpriseNum") {
val.name = "双体系+标准化企业数量";
} else if (val.name === "dualAndStanAndEmerEnterpriseNum") {
val.name = "双体系+标准化+应急企业数量";
} else if (val.name === "dualAndEmerEnterpriseNum") {
val.name = "双体系+应急企业数量";
}
})
console.log(res, 'analyzeCertify')
});
console.log(res, "analyzeCertify");
this.echartsdom.setOption({
title: {
text: '证书列表统计',
left: 'center'
text: "证书列表统计",
left: "center",
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
trigger: "item",
formatter: "{a} <br/>{b} : {c} ",
},
series: [
{
name: '证书列表',
type: 'pie',
radius: '50%',
name: "证书列表",
type: "pie",
radius: "50%",
data: data1,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
})
})
}
}
}
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
},
],
});
});
},
},
};
</script>
<style lang="scss" scoped>
......
......@@ -17,18 +17,16 @@
:value="item.value">
</el-option>
</el-select> -->
<el-input v-model="searchEnterName" placeholder="请输入企业名称" style="margin-right: 30px;width: 50%;" ></el-input>
<el-input
v-model="searchEnterName"
placeholder="请输入企业名称"
style="margin-right: 30px; width: 50%"
></el-input>
<el-button type="success" @click="searchEnters">查找</el-button>
</div>
<div class="enter-safe-enter-list-wrapper">
<el-table
:data="enterCertifyList"
border
>
<el-table-column
prop="companyName"
label="企业名称"
></el-table-column>
<el-table :data="enterCertifyList" border>
<el-table-column prop="companyName" label="企业名称"></el-table-column>
<el-table-column
prop="emergencyPlan"
label="应急预案证书数量"
......@@ -41,11 +39,11 @@
prop="standardization"
label="标准化证书数量"
></el-table-column>
<el-table-column
label="操作"
>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="toEnterCertifies(scope.row)">详情</el-button>
<el-button type="text" @click="toEnterCertifies(scope.row)"
>详情</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -56,66 +54,68 @@
:page-sizes="[10, 20, 30, 40]"
:page-size="currentPageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalElements">
:total="totalElements"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { certifyEnters } from '@/api/certify.js'
import { certifyEnters } from "@/api/certify.js";
export default {
data() {
return {
searchEnterName: '',
queryEnter: '',
searchEnterName: "",
queryEnter: "",
loading: false,
enterList: [],
enterCertifyList: [
{
companyName: '威海兴茂置业有限公司',
companyName: "威海兴茂置业有限公司",
companyId: 71522,
emergencyPlan: 20,
dualSystem: 10,
standardization: 10
standardization: 10,
},
{
companyName: '中国石油天然气股份有限公司山东威海销售分公司',
companyName: "中国石油天然气股份有限公司山东威海销售分公司",
companyId: 71520,
emergencyPlan: 20,
dualSystem: 10,
standardization: 10
standardization: 10,
},
{
companyName: '威海经济技术开发区洪氏家居生活馆',
companyName: "威海经济技术开发区洪氏家居生活馆",
companyId: 71519,
emergencyPlan: 15,
dualSystem: 12,
standardization: 11
standardization: 11,
},
{
companyName: '威海市教育局经济技术开发区教育服务中心',
companyName: "威海市教育局经济技术开发区教育服务中心",
companyId: 71517,
emergencyPlan: 8,
dualSystem: 3,
standardization: 1
}
standardization: 1,
},
],
currentPage: 1,
currentPageSize: 10,
totalElements: 10
}
totalElements: 10,
};
},
methods: {
initMethod() {
let params = {
page: this.currentPage - 1,
size: this.currentPageSize
}
size: this.currentPageSize,
};
if (this.searchEnterName) {
params.enterpriseName = this.searchEnterName
params.enterpriseName = this.searchEnterName;
}
certifyEnters(params).then(res => {
certifyEnters(params).then((res) => {
console.log(res.totalElements);
/**
* {
companyName: '威海市教育局经济技术开发区教育服务中心',
......@@ -125,71 +125,73 @@ export default {
standardization: 1
}
*/
this.enterCertifyList = [...res.content.map(item => {
return {
companyName: item.enterpriseName,
companyId: item.enterpriseId,
emergencyPlan: item.emergencyPlanNum,
dualSystem: item.dualSystemNum,
standardization: item.standardizationNum
}
})]
this.totalElements = res.totalElements
})
this.enterCertifyList = [
...res.content.map((item) => {
return {
companyName: item.enterpriseName,
companyId: item.enterpriseId,
emergencyPlan: item.emergencyPlanNum,
dualSystem: item.dualSystemNum,
standardization: item.standardizationNum,
};
}),
];
this.totalElements = res.totalElements;
});
},
remoteMethod(query) {
if (query !== '') {
if (query !== "") {
this.loading = true;
setTimeout(() => {
this.loading = false
this.enterList = []
})
this.loading = false;
this.enterList = [];
});
}
},
toEnterCertifies(row) {
this.$router.push('/train/entercertifymanage/' + row.companyId)
this.$router.push("/train/entercertifymanage/" + row.companyId);
},
handleSizeChange(val) {
this.currentPageSize = val
this.initMethod()
this.currentPageSize = val;
this.initMethod();
},
handleCurrentChange(val) {
this.currentPage = val
this.initMethod()
this.currentPage = val;
this.initMethod();
},
searchEnters() {
this.initMethod()
}
this.initMethod();
},
},
mounted() {
this.initMethod()
}
}
this.initMethod();
},
};
</script>
<style lang="scss" scoped>
.enter-safe-manage-wrapper {
.enter-safe-manage-wrapper {
width: 80%;
margin: 30px auto;
border-radius: 30px;
padding: 30px;
box-shadow: 0 0 9px 1px #eee;
.enter-safe-tools-wrapper {
width: 80%;
margin: 30px auto;
border-radius: 30px;
padding: 30px;
border-radius: 20px;
padding: 20px;
box-shadow: 0 0 9px 1px #eee;
.enter-safe-tools-wrapper {
width: 80%;
margin: 30px auto;
border-radius: 20px;
padding: 20px;
box-shadow: 0 0 9px 1px #eee;
display: flex;
align-items: center;
justify-content: flex-start;
}
.enter-safe-enter-list-wrapper {
width: 80%;
margin: 30px auto;
border-radius: 20px;
padding: 20px;
box-shadow: 0 0 9px 1px #eee;
}
display: flex;
align-items: center;
justify-content: flex-start;
}
.enter-safe-enter-list-wrapper {
width: 80%;
margin: 30px auto;
border-radius: 20px;
padding: 20px;
box-shadow: 0 0 9px 1px #eee;
}
}
</style>
\ No newline at end of file
......@@ -11,10 +11,7 @@
</div>
<div class="approval-item">
<div class="approval-item-title">作业时间:</div>
<el-date-picker
v-model="workTime"
type="date"
placeholder="选择日期">
<el-date-picker v-model="workTime" type="date" placeholder="选择日期">
</el-date-picker>
</div>
<div class="approval-item">
......@@ -24,34 +21,20 @@
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期"
>
</el-date-picker>
</div>
<div class="approval-item-btn">
<el-button type="primary">查找</el-button>
<el-button type="primary" @click="findapproval">查找</el-button>
</div>
</div>
<div class="find-approval-table-wrapper">
<el-table
:data="approvalList"
border
>
<el-table-column
prop="companyName"
label="公司名称"
></el-table-column>
<el-table-column
prop="approvalName"
label="备案名称"
></el-table-column>
<el-table-column
prop="workTime"
label="作业时间"
></el-table-column>
<el-table-column
prop="uploadTime"
label="上传日期"
></el-table-column>
<el-table :data="approvalList" border>
<el-table-column prop="companyName" label="公司名称"></el-table-column>
<el-table-column prop="approvalName" label="备案名称"></el-table-column>
<el-table-column prop="workTime" label="作业时间"></el-table-column>
<el-table-column prop="uploadTime" label="上传日期"></el-table-column>
<el-table-column>
<template slot-scope="scope">
<el-button type="success">查看</el-button>
......@@ -64,85 +47,95 @@
</template>
<script>
import { dangerJobReport } from "@/api/dangerjob.js";
import { parseTime } from "@/utils/index.js";
export default {
data() {
return {
companyName: '',
approvalName: '',
workTime: '',
uploadTime: '',
companyName: "", //企业名称
approvalName: "", //危险作业名称
workTime: "", //作业时间
uploadTime: "", //上传时间范围
approvalList: [
{
companyName: '威海兴茂置业有限公司',
companyName: "威海兴茂置业有限公司",
companyId: 1,
approvalName: '备案1',
workTime: '2021-08-21 12:21:23',
uploadTime: '2021-09-11 03:02:01',
filepath: ''
approvalName: "备案1",
workTime: "2021-08-21 12:21:23",
uploadTime: "2021-09-11 03:02:01",
filepath: "",
},
{
companyName: '威海大宇电子有限公司',
companyName: "威海大宇电子有限公司",
companyId: 2,
approvalName: '备案2',
workTime: '2021-09-21 11:11:11',
uploadTime: '2021-11:11 09:09:09',
filepath: ''
}
]
}
approvalName: "备案2",
workTime: "2021-09-21 11:11:11",
uploadTime: "2021-11:11 09:09:09",
filepath: "",
},
],
};
},
}
methods: {
findapproval() {
console.log(111);
const params = {
companyId: "",
};
dangerJobReport(params).then((res) => {
console.log(res, "1111 certifyEnters");
});
},
},
};
</script>
<style lang="scss" scoped>
.find-approval-wrapper {
.find-approval-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
box-shadow: 0 0 9px 1px #eee;
.find-approval-tools-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
.find-approval-tools-wrapper {
.approval-item {
display: flex;
justify-content: flex-start;
align-items: center;
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
.approval-item {
display: flex;
justify-content: flex-start;
align-items: center;
width: 80%;
margin: 10px auto;
padding: 10px;
border-radius: 10px;
box-shadow: 0 0 5px 1px #eee;
.approval-item-title {
width: 25%;
display: flex;
justify-content: flex-end;
flex-shrink: 0;
flex-grow: 0;
padding-right: 10px;
}
}
.approval-item-btn {
margin: 10px auto;
padding: 10px;
border-radius: 10px;
box-shadow: 0 0 5px 1px #eee;
.approval-item-title {
width: 25%;
display: flex;
justify-content: flex-end;
align-items: center;
width: 80%;
padding: 5px;
margin: 3px auto;
flex-shrink: 0;
flex-grow: 0;
padding-right: 10px;
}
}
.find-approval-table-wrapper {
.approval-item-btn {
display: flex;
justify-content: flex-end;
align-items: center;
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
padding: 5px;
margin: 3px auto;
}
}
.find-approval-table-wrapper {
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
}
}
</style>
\ No newline at end of file
......@@ -18,11 +18,11 @@
:value="item.value"
/>
</el-select>
<el-button type="success" @click="searchEnters">查找</el-button>
<el-button type="success" @click="">查找</el-button>
</div>
<div class="hwapproval-table-wrapper">
<el-table :data="approvalList" border>
<el-table-column type="expand">
<!-- <el-table-column type="expand">
<template slot-scope="scope">
<el-table :data="scope.row.approvals">
<el-table-column
......@@ -51,14 +51,16 @@
</el-table-column>
</el-table>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="companyName" label="企业名称" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
type="success"
@click="createHWapproval(scope.row)"
>上传危险作业备案</el-button>
<el-button type="primary" @click="listHwApprovals(scope.row)"
>查看</el-button
>
<el-button type="success" @click="createHWapproval(scope.row)"
>上传危险作业备案</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -94,8 +96,9 @@
</el-form-item>
<el-form-item prop="file" label="文件">
<div>
<label>选择文件
<input ref="chosenfile" type="file" hidden @change="chooseFile">
<label
>选择文件
<input ref="chosenfile" type="file" hidden @change="chooseFile" />
</label>
</div>
<div>{{ uploadFilePath }}</div>
......@@ -111,11 +114,11 @@
</template>
<script>
import pdf from 'vue-pdf'
import { hwapprovalEnters } from '@/api/hwapproval.js'
import pdf from "vue-pdf";
import { dangerJobReportEnterprise } from "@/api/dangerjob.js";
export default {
components: {
pdf
pdf,
},
data() {
return {
......@@ -123,118 +126,140 @@ export default {
loadingTask: undefined,
loading: false,
enters: [],
searchEnter: '',
searchEnter: "",
approvalList: [
{
companyName: '威海兴茂置业有限公司',
companyName: "威海兴茂置业有限公司",
companyId: -1,
approvals: [
{
uploadTime: '2021-09-21 11:11:11',
workTime: '2021-08-22 12:01:03',
approvalName: '备案1',
uploadTime: "2021-09-21 11:11:11",
workTime: "2021-08-22 12:01:03",
approvalName: "备案1",
approvalId: 1,
filepath: ''
filepath: "",
},
{
uploadTime: '2021-10-21 12:12:12',
workTime: '2021-08-22 12:01:01',
approvalName: '备案2',
uploadTime: "2021-10-21 12:12:12",
workTime: "2021-08-22 12:01:01",
approvalName: "备案2",
approvalId: 2,
filepath: ''
}
]
}
filepath: "",
},
],
},
],
addDialogShow: false,
addFormInfo: {
name: '',
workTime: '',
uploadTime: '',
name: "",
workTime: "",
uploadTime: "",
file: null,
companyId: -1
companyId: -1,
},
uploadFilePath: '',
uploadFilePath: "",
addFormRules: {
name: [
{
required: true,
message: '请输入危险作业备案名称',
trigger: 'blur'
}
message: "请输入危险作业备案名称",
trigger: "blur",
},
],
workTime: [
{
required: true,
message: '请选择作业时间',
trigger: 'change'
}
message: "请选择作业时间",
trigger: "change",
},
],
uploadTime: [
{
required: true,
message: '请选择上传时间',
trigger: 'change'
}
message: "请选择上传时间",
trigger: "change",
},
],
file: [
{
required: true,
message: '请选择文件(pdf、jpg、jpeg、png、gif)',
trigger: 'change'
}
]
message: "请选择文件(pdf、jpg、jpeg、png、gif)",
trigger: "change",
},
],
},
curApprovalFilePath: ''
}
curApprovalFilePath: "",
};
},
computed: {
getFileType() {
if (this.curApprovalFilePath.endsWith('.pdf')) {
return true
if (this.curApprovalFilePath.endsWith(".pdf")) {
return true;
}
return false
}
return false;
},
},
mounted() {
this.initMethod();
},
methods: {
initMethod() {
dangerJobReportEnterprise().then((res) => {
this.approvalList = [
...res.content.map((item) => {
return {
companyName: item.enterpriseName,
companyId: item.enterpriseId,
};
}),
];
console.log(res, "hwapprovalEnters hwapprovalEnters");
});
},
remoteMethod() {},
chooseFile() {
this.addFormInfo.file = null
this.uploadFilePath = ''
this.addFormInfo.file = null;
this.uploadFilePath = "";
if (this.$refs.chosenfile.files.length) {
const filePath = this.$refs.chooseFile.files[0].name
const filePath = this.$refs.chooseFile.files[0].name;
if (
!(
filePath.endsWith('.pdf') ||
filePath.endsWith('.jpg') ||
filePath.endsWith('.jpeg') ||
filePath.endsWith('.png') ||
filePath.endsWith('gif')
filePath.endsWith(".pdf") ||
filePath.endsWith(".jpg") ||
filePath.endsWith(".jpeg") ||
filePath.endsWith(".png") ||
filePath.endsWith("gif")
)
) {
return
return;
}
this.uploadFilePath = filePath
this.addFormInfo.file = this.$refs.chooseFile.files[0]
this.uploadFilePath = filePath;
this.addFormInfo.file = this.$refs.chooseFile.files[0];
}
},
cancelHWapproval() {
this.addDialogShow = false
this.addDialogShow = false;
},
submitHWapproval() {
this.$refs.addform.validate((valid) => {
if (valid) {
}
})
});
},
createHWapproval(row) {
this.addFormInfo.companyId = row.companyId
this.addDialogShow = true
this.addFormInfo.companyId = row.companyId;
this.addDialogShow = true;
},
listHwApprovals(row) {
console.log(row, "listHwApprovals");
this.$router.push(
"/train/hwapprovalmanage/" + row.companyId + "&" + row.companyName
);
},
viewApproval(prow, childrow) {},
downloadApproval(prow, childrow) {}
}
}
downloadApproval(prow, childrow) {},
},
};
</script>
<style lang="scss" scoped>
......
<template>
<div class="hwapprovals-wrapper">
<div class="hwapprovals-find-tools-wrapper">
<div class="hwapprovals-companyName">
<h2>{{ companyName }}</h2>
<el-divider></el-divider>
</div>
<!-- <div class="hwapprovals-find-item">
<div class="hwapprovals-title">企业名称:</div>
<div>
<el-input
v-model="hwapprovalsName"
placeholder="请输入企业名称"
></el-input>
</div>
</div> -->
<div class="hwapprovals-find-item">
<div class="hwapprovals-title">危险作业名称:</div>
<div>
<el-input
v-model="dangerName"
placeholder="请输入危险作业名称"
></el-input>
</div>
</div>
<div class="hwapprovals-find-item">
<div class="hwapprovals-title">上传日期:</div>
<div>
<el-date-picker
v-model="uploadDate"
type="daterange"
range-separator="至"
start-placeholder="上传开始日期"
end-placeholder="上传结束日期"
>
</el-date-picker>
</div>
</div>
<div class="hwapprovals-find-item">
<div class="hwapprovals-title">作业时间:</div>
<div>
<el-date-picker
v-model="validTime"
type="datetimerange"
range-separator="至"
start-placeholder="有效开始日期"
end-placeholder="有效结束日期"
>
</el-date-picker>
</div>
</div>
<div class="hwapprovals-find-btn">
<el-button @click="findDangerjobs" type="primary">查找</el-button>
</div>
</div>
<div class="hwapprovals-find-tools-wrapper hwapprovals-list">
<div class="hwapprovalslist-table-wrapper">
<el-table :data="hwapprovalslistTableData" border style="width: 100%">
<el-table-column
prop="jobName"
label="危险作业名称"
width="240"
></el-table-column>
<el-table-column
prop="uploadDate"
label="上传时间"
width="180"
></el-table-column>
<el-table-column
prop="time"
label="作业时间"
width="180"
></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="success" @click="viewHwapproval(scope.row)"
>查看</el-button
>
<el-button type="primary" @click="downloadHwapproval(scope.row)"
>下载</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
import pdf from "vue-pdf";
import { dangerJobReport, dangerJobReportEnterprise } from "@/api/dangerjob.js";
import { parseTime } from "@/utils/index.js";
export default {
components: {
pdf,
},
data() {
return {
hwapprovalsName: "", //企业名称
dangerName: "", //危险作业名称
uploadDate: "", //上传日期
validTime: "", //作业时间
filePath: "", //文件路径
curHwapprovalFilePath: "",
pdfNumPage: undefined,
loadingTask: undefined,
hwapprovalslistTableData: [
{
companyId: 71280,
filePath:
"D:\\gemho\\tianhong\\danger-job-report\\gfhmQkIjCGv2118f31720703a6ed72aa25319b2ac768_20220104101158.png",
id: 4,
name: "111",
time: "2021-09-09 01:01:01",
uploadDate: "2022-01-04",
},
],
companyId: "",
companyName: "",
};
},
methods: {
initJob() {
let params = {
companyId: this.$route.params.name.split("&")[0],
};
dangerJobReport(params).then((res) => {
// console.log(res.content, "所有");
this.hwapprovalslistTableData = [
...res.content.map((item) => {
console.log(item.name);
return {
jobName: item.name,
uploadDate: item.uploadDate,
time: item.time,
filePath: item.filePath,
id: item.id,
};
}),
];
});
},
findDangerjobs() {
// console.log(this.companyId);
let params = {};
params.companyId = this.companyId;
if (this.dangerName) {
params.jobName = this.dangerName;
}
if (this.validTime instanceof Array) {
params.jobStartTime = parseTime(
new Date(this.validTime[0]),
"{y}-{m}-{d} {h}:{i}:{s}"
);
params.jobEndTime = parseTime(
new Date(this.validTime[1]),
"{y}-{m}-{d} {h}:{i}:{s}"
);
}
if (this.uploadDate instanceof Array) {
params.uploadStartDate = parseTime(
new Date(this.uploadDate[0]),
"{y}-{m}-{d}"
);
params.uploadEndDate = parseTime(
new Date(this.uploadDate[1]),
"{y}-{m}-{d}"
);
}
dangerJobReport(params).then((res) => {
// console.log(res);
this.hwapprovalslistTableData = [
...res.content.map((item) => {
console.log(item.name);
return {
jobName: item.name,
uploadDate: item.uploadDate,
time: item.time,
filePath: item.filePath,
id: item.id,
};
}),
];
});
},
viewHwapproval(row) {
// this.certifyShow = true;
this.curHwapprovalFilePath = row.filePath;
const index1 = this.curHwapprovalFilePath.indexOf("\\");
const index2 = this.curHwapprovalFilePath.indexOf("\\", index1 + 1);
const index3 = this.curHwapprovalFilePath.indexOf("\\", index2 + 1);
this.curHwapprovalFilePath = this.curHwapprovalFilePath.substring(index3);
if (this.curHwapprovalFilePath.endsWith(".pdf")) {
// if (this.curHwapprovalFilePath.endsWith(".pdf")) {
this.loadingTask = pdf.createLoadingTask(this.curHwapprovalFilePath);
this.loadingTask.promise.then((pdf) => {
this.pdfNumPage = pdf.numPages;
});
}
},
downloadHwapproval(row) {
const link = document.createElement("a");
let curHwapprovalFilePath = row.filepath;
const index1 = this.curHwapprovalFilePath.indexOf("\\");
const index2 = this.curHwapprovalFilePath.indexOf("\\", index1 + 1);
const index3 = this.curHwapprovalFilePath.indexOf("\\", index2 + 1);
curHwapprovalFilePath = this.curHwapprovalFilePath.substring(index3);
link.href = curHwapprovalFilePath;
link.setAttribute(
"download",
row.filepath.substr(row.filepath.lastIndexOf("/") + 1)
);
document.body.appendChild(link);
link.click();
link.remove();
window.URL.revokeObjectURL(link.href);
},
},
mounted() {
// console.log(this.$route.params.name);
this.companyId = this.$route.params.name.split("&")[0];
this.companyName = this.$route.params.name.split("&")[1];
// console.log(this.companyName, "this.companyName this.companyName");
this.initJob();
},
};
</script>
<style lang="scss">
.hwapprovals-find-tools-wrapper {
display: flex;
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
flex-wrap: wrap;
box-shadow: 0 0 9px 1px #eee;
.hwapprovals-companyName {
width: 80%;
margin: 10px auto;
}
.hwapprovals-find-item {
width: 80%;
margin: 10px auto;
padding: 10px;
border-radius: 10px;
box-shadow: 0 0 5px 1px #eee;
display: flex;
justify-content: flex-start;
align-items: center;
.hwapprovals-title {
width: 15%;
display: flex;
justify-content: flex-end;
margin-right: 20px;
}
}
.hwapprovals-find-btn {
width: 80%;
margin: 10px auto;
padding: 2px;
display: flex;
justify-content: flex-end;
align-items: center;
}
}
.tools-wrapper {
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
}
.hwapprovalslist-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
.hwapprovalslist-title {
display: flex;
justify-content: space-between;
padding: 10px;
align-items: center;
}
}
.hwapprovalslist-table-wrapper {
width: 80%;
padding: 20px;
border-radius: 20px;
// box-shadow: 0 0 9px 1px #eee;
margin: 0 auto;
// background: #eee;
// display: flex;
// justify-content: center;
}
.dualsystem-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
.dualsystem-title {
display: flex;
justify-content: space-between;
padding: 10px;
align-items: center;
}
.dualsystem-table-wrapper {
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
margin-left: 40px;
background: #eee;
}
}
.standardization-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
.standardization-title {
display: flex;
justify-content: space-between;
padding: 10px;
align-items: center;
}
.standardization-table-wrapper {
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
margin-left: 40px;
background: #eee;
}
}
</style>
\ No newline at end of file
......@@ -6,42 +6,109 @@
type="datetimerange"
range-separator="至"
start-placeholder="备案上传开始日期"
end-placeholder="备案上传结束日期">
end-placeholder="备案上传结束日期"
>
</el-date-picker>
<el-button type="success">查找</el-button>
<el-button type="success" @click="statisticsApproval">查找</el-button>
</div>
<div class="hwapproval-statistics" ref="approvalstatistics"></div>
</div>
</template>
<script>
import { dangerCriteria } from "@/api/dangerjob.js";
import echarts from "echarts";
import { parseTime } from "@/utils/index";
export default {
data() {
return {
approvalUploadTime: ''
}
}
}
approvalUploadTime: "",
};
},
watch: {
approvalUploadTime(newVal, oldVal) {
console.log(newVal, oldVal);
this.echartsdom.clear();
this.statisticsApproval();
},
},
mounted() {
this.echartsdom = echarts.init(this.$refs.approvalstatistics);
this.statisticsApproval();
},
methods: {
statisticsApproval() {
const params = {};
if (this.approvalUploadTime instanceof Array) {
params.uploadEndDate = parseTime(new Date(), "{y}-{m}-{d}");
params.uploadStartDate = parseTime(new Date(), "{y}-{m}-{d}");
}
dangerCriteria(params).then((res) => {
const data1 = [];
for (const key in res) {
console.log(key);
data1.push({
name: key,
value: res[key],
});
}
data1.map(function (val) {
if (val.name === "dangerJobReportEnterpriseNum") {
val.name = "已上传危险作业备案企业数量";
} else if (val.name === "dangerJobReportFileNum") {
val.name = "已上传危险作业备案文件数量";
}
});
this.echartsdom.setOption({
title: {
text: "危险作业备案统计",
left: "center",
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ",
},
series: [
{
name: "危险作业备案",
type: "pie",
radius: "50%",
data: data1,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
},
],
});
});
},
},
};
</script>
<style lang="scss" scoped>
.hwapproval-statistics-wrapper {
.hwapproval-statistics-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
box-shadow: 0 0 9px 1px #eee;
.hwapproval-tools-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
box-shadow: 0 0 9px 1px #eee;
.hwapproval-tools-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
box-shadow: 0 0 9px 1px #eee;
}
.hwapproval-statistics {
margin: 30px auto;
width: 50vw;
height: 50vh;
}
}
.hwapproval-statistics {
margin: 30px auto;
width: 50vw;
height: 50vh;
}
}
</style>
\ No newline at end of file
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="二级菜单" />
<div class="test">
<el-row :gutter="20">
<el-col class="center" :span="22">
<el-card shadow="always"
>111
<el-row :gutter="22">
<el-col class="center" :span="22">
<el-card shadow="always">
<el-input
style="margin-right: 30px; width: 50%"
placeholder="请输入企业名称"
v-model="searchEnterName"
clearable
>
</el-input>
<el-button type="success" @click="searchEnters">查找</el-button>
</el-card>
</el-col>
</el-row>
<el-row :gutter="22">
<el-col class="center" :span="22">
<el-card shadow="always">
<el-table :data="enterCertifyList" border style="width: 100%">
<el-table-column prop="companyName" label="企业名称">
</el-table-column>
<el-table-column
prop="emergencyPlan"
label="应急预案证书数量"
>
</el-table-column>
<el-table-column
prop="dualSystem"
label="双体系证书数量"
></el-table-column>
<el-table-column
prop="standardization"
label="标准化证书数量"
></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
@click="handleClick(scope.row)"
type="text"
size="small"
>详情</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import { certifyEnters } from "@/api/certify.js";
export default {
data() {
return {
searchEnterName: "",
enterCertifyList: [
{
companyName: "威海兴茂置业有限公司",
companyId: 71522,
emergencyPlan: 20,
dualSystem: 10,
standardization: 10,
},
{
companyName: "中国石油天然气股份有限公司山东威海销售分公司",
companyId: 71520,
emergencyPlan: 20,
dualSystem: 10,
standardization: 10,
},
{
companyName: "威海经济技术开发区洪氏家居生活馆",
companyId: 71519,
emergencyPlan: 15,
dualSystem: 12,
standardization: 11,
},
{
companyName: "威海市教育局经济技术开发区教育服务中心",
companyId: 71517,
emergencyPlan: 8,
dualSystem: 3,
standardization: 1,
},
],
};
},
methods: {
searchEnters() {
console.log(1);
},
handleClick(row) {
console.log(row);
this.$router.push("/train/entercertifymanage/" + row.companyId);
},
},
};
</script>
<style scoped>
.center {
margin: 20px auto;
}
[class*="el-col-"] {
float: none;
}
</style>
\ No newline at end of file
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