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