Commit 45dae4ce authored by liuyuping's avatar liuyuping

'daping2'

parents 9b09ebfa 5d2f8010
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
...@@ -26,6 +26,7 @@ export function postHwapproval(data) { ...@@ -26,6 +26,7 @@ export function postHwapproval(data) {
}) })
} }
<<<<<<< HEAD
export function findUploadEnterprise() { export function findUploadEnterprise() {
return request({ return request({
url: '/api/enterpriseCertificate/findUploadEnterprise', url: '/api/enterpriseCertificate/findUploadEnterprise',
...@@ -47,3 +48,6 @@ export function dangerJobReport(params) { ...@@ -47,3 +48,6 @@ export function dangerJobReport(params) {
params params
}) })
} }
=======
>>>>>>> 5d2f8010b5e0a42edca437d25d499712d91d7834
...@@ -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>
......
<template> <template>
<div class="entercertifies-total-wrapper"> <div class="entercertifies-total-wrapper">
<div class="tools-wrapper"> <div class="tools-wrapper">
<el-button type="primary" @click="createUploadCertify">上传证书</el-button> <el-button type="primary" @click="createUploadCertify"
>上传证书</el-button
>
</div> </div>
<div class="certify-find-tools-wrapper"> <div class="certify-find-tools-wrapper">
<div class="certify-find-item"> <div class="certify-find-item">
<div class="certify-title">证书类别:</div> <div class="certify-title">证书类别:</div>
<div> <div>
<el-select v-model="certifyType" placeholder="请选择证书类型"> <el-select v-model="certifyType" placeholder="请选择证书类型">
<el-option v-for="item in certifyTypes" <el-option
:key="item.label" v-for="item in certifyTypes"
:label="item.label" :key="item.label"
:value="item.value"></el-option> :label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="certify-find-item"> <div class="certify-find-item">
<div class="certify-title">证书名称:</div> <div class="certify-title">证书名称:</div>
<div> <div>
<el-input v-model="certifyName" placeholder="请输入证书名称"></el-input> <el-input
v-model="certifyName"
placeholder="请输入证书名称"
></el-input>
</div> </div>
</div> </div>
<div class="certify-find-item"> <div class="certify-find-item">
...@@ -29,10 +36,11 @@ ...@@ -29,10 +36,11 @@
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="上传开始日期" start-placeholder="上传开始日期"
end-placeholder="上传结束日期"> end-placeholder="上传结束日期"
>
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
<div class="certify-find-item"> <div class="certify-find-item">
<div class="certify-title">有效日期:</div> <div class="certify-title">有效日期:</div>
<div> <div>
...@@ -41,7 +49,8 @@ ...@@ -41,7 +49,8 @@
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="有效开始日期" start-placeholder="有效开始日期"
end-placeholder="有效结束日期"> end-placeholder="有效结束日期"
>
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
...@@ -62,10 +71,7 @@ ...@@ -62,10 +71,7 @@
</div> </div>
</div> </div>
<div class="emergencyplan-table-wrapper" v-show="isShowEmergency"> <div class="emergencyplan-table-wrapper" v-show="isShowEmergency">
<el-table <el-table :data="emergencyplanTableData" border>
:data="emergencyplanTableData"
border
>
<el-table-column <el-table-column
prop="name" prop="name"
label="证书名称" label="证书名称"
...@@ -81,12 +87,14 @@ ...@@ -81,12 +87,14 @@
label="有效日期" label="有效日期"
width="180" width="180"
></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="success" @click="viewCertify(scope.row)">查看</el-button> <el-button type="success" @click="viewCertify(scope.row)"
<el-button type="primary" @click="downloadCertify(scope.row)">下载</el-button> >查看</el-button
>
<el-button type="primary" @click="downloadCertify(scope.row)"
>下载</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -105,10 +113,7 @@ ...@@ -105,10 +113,7 @@
</div> </div>
</div> </div>
<div class="dualsystem-table-wrapper" v-show="isShowDualsystem"> <div class="dualsystem-table-wrapper" v-show="isShowDualsystem">
<el-table <el-table :data="dualsystemTableData" border>
:data="dualsystemTableData"
border
>
<el-table-column <el-table-column
prop="name" prop="name"
label="证书名称" label="证书名称"
...@@ -124,12 +129,14 @@ ...@@ -124,12 +129,14 @@
label="有效日期" label="有效日期"
width="180" width="180"
></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="success" @click="viewCertify(scope.row)">查看</el-button> <el-button type="success" @click="viewCertify(scope.row)"
<el-button type="primary" @click="downloadCertify(scope.row)">下载</el-button> >查看</el-button
>
<el-button type="primary" @click="downloadCertify(scope.row)"
>下载</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -148,10 +155,7 @@ ...@@ -148,10 +155,7 @@
</div> </div>
</div> </div>
<div class="standardization-table-wrapper" v-show="isShowStandardization"> <div class="standardization-table-wrapper" v-show="isShowStandardization">
<el-table <el-table :data="standardizationTableData" border>
:data="standardizationTableData"
border
>
<el-table-column <el-table-column
prop="name" prop="name"
label="证书名称" label="证书名称"
...@@ -167,22 +171,20 @@ ...@@ -167,22 +171,20 @@
label="有效日期" label="有效日期"
width="180" width="180"
></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="success" @click="viewCertify(scope.row)">查看</el-button> <el-button type="success" @click="viewCertify(scope.row)"
<el-button type="primary" @click="downloadCertify(scope.row)">下载</el-button> >查看</el-button
>
<el-button type="primary" @click="downloadCertify(scope.row)"
>下载</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
<el-dialog <el-dialog title="上传证书" :visible.sync="uploadDialogShow" width="65%">
title="上传证书"
:visible.sync="uploadDialogShow"
width="65%"
>
<el-form <el-form
ref="uploadform" ref="uploadform"
:model="uploadFormInfo" :model="uploadFormInfo"
...@@ -190,19 +192,11 @@ ...@@ -190,19 +192,11 @@
:rules="uploadFormRules" :rules="uploadFormRules"
v-if="uploadDialogShow" v-if="uploadDialogShow"
> >
<el-form-item <el-form-item prop="name" label="证书名称">
prop="name"
label="证书名称"
>
<el-input v-model="uploadFormInfo.name"></el-input> <el-input v-model="uploadFormInfo.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="type" label="证书类型">
prop="type" <el-select v-model="uploadFormInfo.type">
label="证书类型"
>
<el-select
v-model="uploadFormInfo.type"
>
<el-option <el-option
v-for="item in options" v-for="item in options"
:label="item.label" :label="item.label"
...@@ -211,56 +205,72 @@ ...@@ -211,56 +205,72 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="uploadTime" label="上传日期">
prop="uploadTime"
label="上传日期"
>
<el-date-picker <el-date-picker
v-model="uploadFormInfo.uploadTime" v-model="uploadFormInfo.uploadTime"
type="date" type="date"
placeholder="选择日期时间"> placeholder="选择日期时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="validTime" label="有效日期">
prop="validTime"
label="有效日期"
>
<el-date-picker <el-date-picker
v-model="uploadFormInfo.validTime" v-model="uploadFormInfo.validTime"
type="date" type="date"
placeholder="选择日期时间"> placeholder="选择日期时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="file" label="证书文件">
prop="file"
label="证书文件"
>
<div class="uploadcertify-wrapper"> <div class="uploadcertify-wrapper">
<label>选择文件<input ref="uploadfile" type="file" hidden @change="chooseFile" /></label> <label
>选择文件<input
ref="uploadfile"
type="file"
hidden
@change="chooseFile"
/></label>
</div> </div>
<div style="color: #52BEED;">{{uploadFilePath}}</div> <div style="color: #52beed">{{ uploadFilePath }}</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button type="info" @click="cancelUploadFile">取消</el-button> <el-button type="info" @click="cancelUploadFile">取消</el-button>
<el-button type="primary" @click="submitUploadFile" :disabled="isUploading" v-loading="isUploading">提交</el-button> <el-button
type="primary"
@click="submitUploadFile"
:disabled="isUploading"
v-loading="isUploading"
>提交</el-button
>
</div> </div>
</el-dialog> </el-dialog>
<div v-if="certifyShow && getFileType" class="certify-item" @click.stop="" @mousewheel.stop.prevent=""> <div
v-if="certifyShow && getFileType"
class="certify-item"
@click.stop=""
@mousewheel.stop.prevent=""
>
<div class="certify-inner-wrapper"> <div class="certify-inner-wrapper">
<div class="certify-innerw-wrapper" @mousewheel.stop=""> <div class="certify-innerw-wrapper" @mousewheel.stop="">
<pdf <pdf
v-for="i in pdfNumPage" v-for="i in pdfNumPage"
:key="i" :key="i"
:page="i" :page="i"
:src="loadingTask"></pdf> :src="loadingTask"
></pdf>
</div> </div>
<div class="close-certify" @click="certifyShow = false"></div> <div class="close-certify" @click="certifyShow = false"></div>
</div> </div>
</div> </div>
<div v-if="certifyShow && !getFileType" class="certify-item" @click.stop="" @mousewheel.stop.prevent=""> <div
v-if="certifyShow && !getFileType"
class="certify-item"
@click.stop=""
@mousewheel.stop.prevent=""
>
<div class="certify-inner-wrapper"> <div class="certify-inner-wrapper">
<img :src="curCertifyFilePath" class="certify-img"/> <img :src="curCertifyFilePath" class="certify-img" />
<div class="close-certify" @click="certifyShow = false"></div> <div class="close-certify" @click="certifyShow = false"></div>
</div> </div>
</div> </div>
...@@ -268,76 +278,85 @@ ...@@ -268,76 +278,85 @@
</template> </template>
<script> <script>
import pdf from 'vue-pdf'; import pdf from "vue-pdf";
import { enterCertifies, postCertify } from '@/api/certify.js' import { enterCertifies, postCertify } from "@/api/certify.js";
// {y}-{m}-{d} {h}:{i}:{s} // {y}-{m}-{d} {h}:{i}:{s}
import { parseTime } from '@/utils/index.js' import { parseTime } from "@/utils/index.js";
export default { export default {
components: { components: {
pdf pdf,
}, },
data() { data() {
return { return {
isUploading: false, isUploading: false,
emergencyplanTableData: [ emergencyplanTableData: [
{ {
name: '安全生产标准化证书01', name: "安全生产标准化证书01",
uploadDate: '2021-01-11 12:36:25', uploadDate: "2021-01-11 12:36:25",
validDate: '2021-10-10 12:36:25', validDate: "2021-10-10 12:36:25",
filepath: 'https://8.143.198.78/certify1/威海大庆特种材料制作有限公司-双体系.pdf' filepath:
"https://8.143.198.78/certify1/威海大庆特种材料制作有限公司-双体系.pdf",
}, },
{ {
name: '安全生产标准化证书02', name: "安全生产标准化证书02",
uploadDate: '2021-01-13 12:11:25', uploadDate: "2021-01-13 12:11:25",
validDate: '2021-10-09 12:45:11', validDate: "2021-10-09 12:45:11",
filepath: 'https://8.143.198.78/certify1/威海大宇电子有限公司-双体系.jpg' filepath:
"https://8.143.198.78/certify1/威海大宇电子有限公司-双体系.jpg",
}, },
{ {
name: '安全生产标准化证书03', name: "安全生产标准化证书03",
uploadDate: '2021-01-15 12:25:23', uploadDate: "2021-01-15 12:25:23",
validDate: '2021-08-09 12:23:00', validDate: "2021-08-09 12:23:00",
filepath: 'https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系2.pdf' filepath:
} "https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系2.pdf",
},
], ],
dualsystemTableData: [ dualsystemTableData: [
{ {
name: '安全生产标准化证书01', name: "安全生产标准化证书01",
uploadDate: '2021-01-11 12:36:25', uploadDate: "2021-01-11 12:36:25",
validDate: '2021-10-10 12:36:25', validDate: "2021-10-10 12:36:25",
filepath: 'https://8.143.198.78/certify1/威海大庆特种材料制作有限公司-双体系.pdf' filepath:
"https://8.143.198.78/certify1/威海大庆特种材料制作有限公司-双体系.pdf",
}, },
{ {
name: '安全生产标准化证书02', name: "安全生产标准化证书02",
uploadDate: '2021-01-13 12:11:25', uploadDate: "2021-01-13 12:11:25",
validDate: '2021-10-09 12:45:11', validDate: "2021-10-09 12:45:11",
filepath: 'https://8.143.198.78/certify1/威海大宇电子有限公司-双体系.jpg' filepath:
"https://8.143.198.78/certify1/威海大宇电子有限公司-双体系.jpg",
}, },
{ {
name: '安全生产标准化证书03', name: "安全生产标准化证书03",
uploadDate: '2021-01-15 12:25:23', uploadDate: "2021-01-15 12:25:23",
validDate: '2021-08-09 12:23:00', validDate: "2021-08-09 12:23:00",
filepath: 'https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系2.pdf' filepath:
} "https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系2.pdf",
},
], ],
standardizationTableData: [ standardizationTableData: [
{ {
name: '安全生产标准化证书01', name: "安全生产标准化证书01",
uploadDate: '2021-01-11 12:36:25', uploadDate: "2021-01-11 12:36:25",
validDate: '2021-10-10 12:36:25', validDate: "2021-10-10 12:36:25",
filepath: 'https://8.143.198.78/certify1/威海大庆特种材料制作有限公司-双体系.pdf' filepath:
"https://8.143.198.78/certify1/威海大庆特种材料制作有限公司-双体系.pdf",
}, },
{ {
name: '安全生产标准化证书02', name: "安全生产标准化证书02",
uploadDate: '2021-01-13 12:11:25', uploadDate: "2021-01-13 12:11:25",
validDate: '2021-10-09 12:45:11', validDate: "2021-10-09 12:45:11",
filepath: 'https://8.143.198.78/certify1/威海大宇电子有限公司-双体系.jpg' filepath:
"https://8.143.198.78/certify1/威海大宇电子有限公司-双体系.jpg",
}, },
{ {
name: '安全生产标准化证书03', name: "安全生产标准化证书03",
uploadDate: '2021-01-15 12:25:23', uploadDate: "2021-01-15 12:25:23",
validDate: '2021-08-09 12:23:00', validDate: "2021-08-09 12:23:00",
filepath: 'https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系2.pdf' filepath:
} "https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系2.pdf",
},
], ],
// 显示应急 // 显示应急
isShowEmergency: false, isShowEmergency: false,
...@@ -347,478 +366,525 @@ export default { ...@@ -347,478 +366,525 @@ export default {
isShowStandardization: false, isShowStandardization: false,
uploadDialogShow: false, uploadDialogShow: false,
uploadFormInfo: { uploadFormInfo: {
name: '', name: "",
uploadTime: '', uploadTime: "",
type: '双体系证书', type: "双体系证书",
validTime: '', validTime: "",
file: null file: null,
}, },
uploadFilePath: '', uploadFilePath: "",
uploadFormRules: { uploadFormRules: {
name: [ name: [
{ {
required: true, required: true,
message: '请输入证书名称', message: "请输入证书名称",
trigger: 'blur' trigger: "blur",
} },
], ],
type: [ type: [
{ {
required: true, required: true,
message: '请输入证书类型', message: "请输入证书类型",
trigger: 'change' trigger: "change",
} },
], ],
uploadTime: [ uploadTime: [
{ {
required: true, required: true,
message: '请输入上传日期', message: "请输入上传日期",
trigger: 'change' trigger: "change",
} },
], ],
validTime: [ validTime: [
{ {
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",
} },
] ],
}, },
certifyShow: false, certifyShow: false,
curCertifyFilePath: '', curCertifyFilePath: "",
pdfNumPage: undefined, pdfNumPage: undefined,
loadingTask: undefined, loadingTask: undefined,
curCompanyId: -1, curCompanyId: -1,
options: [ options: [
{ {
label: '双体系证书', label: "双体系证书",
value: '双体系证书' value: "双体系证书",
}, },
{ {
label: '应急预案', label: "应急预案",
value: '应急预案' value: "应急预案",
}, },
{ {
label: '标准化', label: "标准化",
value: '标准化' value: "标准化",
} },
], ],
certifyTypes: [ certifyTypes: [
{ {
label: '双体系证书', label: "双体系证书",
value: '双体系证书' value: "双体系证书",
}, },
{ {
label: '应急预案', label: "应急预案",
value: '应急预案' value: "应急预案",
}, },
{ {
label: '标准化', label: "标准化",
value: '标准化' value: "标准化",
} },
], ],
certifyType: '', certifyType: "",
certifyName: '', certifyName: "",
uploadTime: '', uploadTime: "",
validTime: '', validTime: "",
} };
}, },
mounted() { mounted() {
this.curCompanyId = this.$route.params.name this.curCompanyId = this.$route.params.name;
this.initMethod() this.initMethod();
}, },
computed: { computed: {
getFileType() { getFileType() {
if (this.curCertifyFilePath.endsWith('.pdf')) { if (this.curCertifyFilePath.endsWith(".pdf")) {
return true return true;
} }
return false return false;
} },
}, },
methods: { methods: {
initMethod() { initMethod() {
this.initCertify('双体系证书') this.initCertify("双体系证书");
this.initCertify('应急预案') this.initCertify("应急预案");
this.initCertify('标准化') this.initCertify("标准化");
}, },
initCertify(category) { initCertify(category) {
let params = { let params = {
companyId: this.curCompanyId, companyId: this.curCompanyId,
category: category category: category,
} };
enterCertifies(params).then(res => { enterCertifies(params).then((res) => {
console.log(res, category, 'enterCertifies enterCertifies') console.log(res, category, "enterCertifies enterCertifies");
if (category === '双体系证书') { if (category === "双体系证书") {
this.dualsystemTableData = [...res.content.map(item => { this.dualsystemTableData = [
return { ...res.content.map((item) => {
name: item.name, return {
uploadDate: item.uploadDate, name: item.name,
validDate: item.expirationDate, uploadDate: item.uploadDate,
filepath: item.filePath, validDate: item.expirationDate,
id: item.id, filepath: item.filePath,
category: item.category id: item.id,
} category: item.category,
})] };
} else if (category === '应急预案') { }),
this.emergencyplanTableData = [...res.content.map(item => { ];
return { } else if (category === "应急预案") {
name: item.name, this.emergencyplanTableData = [
uploadDate: item.uploadDate, ...res.content.map((item) => {
validDate: item.expirationDate, return {
filepath: item.filePath, name: item.name,
id: item.id, uploadDate: item.uploadDate,
category: item.category validDate: item.expirationDate,
} filepath: item.filePath,
})] id: item.id,
} else if (category === '标准化') { category: item.category,
this.standardizationTableData = [...res.content.map(item => { };
return { }),
name: item.name, ];
uploadDate: item.uploadDate, } else if (category === "标准化") {
validDate: item.expirationDate, this.standardizationTableData = [
filepath: item.filePath, ...res.content.map((item) => {
id: item.id, return {
category: item.category name: item.name,
} uploadDate: item.uploadDate,
})] validDate: item.expirationDate,
filepath: item.filePath,
id: item.id,
category: item.category,
};
}),
];
} }
}) });
}, },
chooseFile() { chooseFile() {
this.uploadFormInfo.file = null this.uploadFormInfo.file = null;
this.uploadFilePath = '' this.uploadFilePath = "";
if(this.$refs.uploadfile.files.length) { if (this.$refs.uploadfile.files.length) {
const filename = this.$refs.uploadfile.files[0].name const filename = this.$refs.uploadfile.files[0].name;
if (!(filename.endsWith('.pdf')||filename.endsWith('.jpg')||filename.endsWith('.jpeg')||filename.endsWith('.png')||filename.endsWith('.gif'))) { if (
return !(
filename.endsWith(".pdf") ||
filename.endsWith(".jpg") ||
filename.endsWith(".jpeg") ||
filename.endsWith(".png") ||
filename.endsWith(".gif")
)
) {
return;
} }
this.uploadFilePath = this.$refs.uploadfile.files[0].name this.uploadFilePath = this.$refs.uploadfile.files[0].name;
this.uploadFormInfo.file = this.$refs.uploadfile.files[0] this.uploadFormInfo.file = this.$refs.uploadfile.files[0];
} }
}, },
createUploadCertify() { createUploadCertify() {
this.uploadDialogShow = true this.uploadDialogShow = true;
this.uploadFormInfo = { this.uploadFormInfo = {
name: '', name: "",
uploadTime: '', uploadTime: "",
type: '双体系证书', type: "双体系证书",
validTime: '', validTime: "",
file: null file: null,
} };
}, },
cancelUploadFile() { cancelUploadFile() {
this.uploadDialogShow = false this.uploadDialogShow = false;
}, },
submitUploadFile() { submitUploadFile() {
this.$refs.uploadform.validate((valid) => { this.$refs.uploadform.validate((valid) => {
if (valid) { if (valid) {
this.isUploading = true this.isUploading = true;
let params = { let params = {
companyId: this.curCompanyId, companyId: this.curCompanyId,
category: this.uploadFormInfo.type, category: this.uploadFormInfo.type,
expirationDate: parseTime(new Date(this.uploadFormInfo.validTime), '{y}-{m}-{d}'), expirationDate: parseTime(
new Date(this.uploadFormInfo.validTime),
"{y}-{m}-{d}"
),
file: this.uploadFormInfo.file, file: this.uploadFormInfo.file,
name: this.uploadFormInfo.name, name: this.uploadFormInfo.name,
uploadDate: parseTime(new Date(this.uploadFormInfo.uploadTime), '{y}-{m}-{d}') uploadDate: parseTime(
} new Date(this.uploadFormInfo.uploadTime),
"{y}-{m}-{d}"
),
};
let formData = new FormData(); let formData = new FormData();
for(const key in params) { for (const key in params) {
formData.append(key, params[key]) formData.append(key, params[key]);
} }
postCertify(formData).then(res => { postCertify(formData)
this.$message({ .then((res) => {
type: 'success', this.$message({
message: '添加证书成功' type: "success",
message: "添加证书成功",
});
this.uploadDialogShow = false;
this.isUploading = false;
this.initMethod();
}) })
this.uploadDialogShow = false .catch(() => {
this.isUploading = false this.$message.error("添加证书失败");
this.initMethod() this.isUploading = false;
}).catch(() => { });
this.$message.error('添加证书失败')
this.isUploading = false
})
} }
}) });
}, },
viewCertify(row) { viewCertify(row) {
this.certifyShow = true this.certifyShow = true;
this.curCertifyFilePath = row.filepath this.curCertifyFilePath = row.filepath;
const index1 = this.curCertifyFilePath.indexOf('\\') const index1 = this.curCertifyFilePath.indexOf("\\");
const index2 = this.curCertifyFilePath.indexOf('\\', index1 + 1) const index2 = this.curCertifyFilePath.indexOf("\\", index1 + 1);
const index3 = this.curCertifyFilePath.indexOf('\\', index2+ 1) const index3 = this.curCertifyFilePath.indexOf("\\", index2 + 1);
this.curCertifyFilePath = this.curCertifyFilePath.substring(index3) this.curCertifyFilePath = this.curCertifyFilePath.substring(index3);
if (this.curCertifyFilePath.endsWith('.pdf')) { if (this.curCertifyFilePath.endsWith(".pdf")) {
this.loadingTask = pdf.createLoadingTask(this.curCertifyFilePath) this.loadingTask = pdf.createLoadingTask(this.curCertifyFilePath);
this.loadingTask.promise.then(pdf => { this.loadingTask.promise.then((pdf) => {
this.pdfNumPage = pdf.numPages this.pdfNumPage = pdf.numPages;
}) });
} }
}, },
downloadCertify(row) { downloadCertify(row) {
const link = document.createElement('a') const link = document.createElement("a");
link.href = row.filepath let curCertifyFilePath = row.filepath;
link.setAttribute('download', row.filepath.substr(row.filepath.lastIndexOf('/')+1)) const index1 = this.curCertifyFilePath.indexOf("\\");
document.body.appendChild(link) const index2 = this.curCertifyFilePath.indexOf("\\", index1 + 1);
link.click() const index3 = this.curCertifyFilePath.indexOf("\\", index2 + 1);
link.remove() curCertifyFilePath = this.curCertifyFilePath.substring(index3);
window.URL.revokeObjectURL(link.href) link.href = curCertifyFilePath;
link.setAttribute(
"download",
row.filepath.substr(row.filepath.lastIndexOf("/") + 1)
);
document.body.appendChild(link);
link.click();
link.remove();
window.URL.revokeObjectURL(link.href);
}, },
findCertifies() { findCertifies() {
let params = {} let params = {};
params.companyId = this.curCompanyId params.companyId = this.curCompanyId;
if (this.certifyType) { if (this.certifyType) {
params.category = this.certifyType params.category = this.certifyType;
params.certificateCategory = this.certifyType params.certificateCategory = this.certifyType;
} else { } else {
this.$message.error('请输入证书类型') this.$message.error("请输入证书类型");
return return;
} }
if (this.certifyName) { if (this.certifyName) {
params.certificateName = this.certifyName params.certificateName = this.certifyName;
} }
if (this.validTime) { if (this.validTime) {
params.expirationStartDate = parseTime(new Date(this.validTime[0]), '{y}-{m}-{d}') params.expirationStartDate = parseTime(
params.expirationEndDate = parseTime(new Date(this.validTime[1]), '{y}-{m}-{d}') new Date(this.validTime[0]),
"{y}-{m}-{d}"
);
params.expirationEndDate = parseTime(
new Date(this.validTime[1]),
"{y}-{m}-{d}"
);
} }
if (this.uploadTime) { if (this.uploadTime) {
params.uploadStartDate = parseTime(new Date(this.uploadTime[0]), '{y}-{m}-{d}') params.uploadStartDate = parseTime(
params.uploadEndDate = parseTime(new Date(this.uploadTime[1]), '{y}-{m}-{d}') new Date(this.uploadTime[0]),
"{y}-{m}-{d}"
);
params.uploadEndDate = parseTime(
new Date(this.uploadTime[1]),
"{y}-{m}-{d}"
);
} }
enterCertifies(params).then(res => { enterCertifies(params).then((res) => {
console.log(res, 'certifyEnters certifyEnters') console.log(res, "certifyEnters certifyEnters");
if (this.certifyType === '双体系证书') { if (this.certifyType === "双体系证书") {
this.dualsystemTableData = [...res.content.map(item => { this.dualsystemTableData = [
return { ...res.content.map((item) => {
name: item.name, return {
uploadDate: item.uploadDate, name: item.name,
validDate: item.expirationDate, uploadDate: item.uploadDate,
filepath: item.filePath, validDate: item.expirationDate,
id: item.id, filepath: item.filePath,
category: item.category id: item.id,
} category: item.category,
})] };
} else if (this.certifyType === '应急预案') { }),
this.emergencyplanTableData = [...res.content.map(item => { ];
return { } else if (this.certifyType === "应急预案") {
name: item.name, this.emergencyplanTableData = [
uploadDate: item.uploadDate, ...res.content.map((item) => {
validDate: item.expirationDate, return {
filepath: item.filePath, name: item.name,
id: item.id, uploadDate: item.uploadDate,
category: item.category validDate: item.expirationDate,
} filepath: item.filePath,
})] id: item.id,
} else if (this.certifyType === '标准化') { category: item.category,
this.standardizationTableData = [...res.content.map(item => { };
return { }),
name: item.name, ];
uploadDate: item.uploadDate, } else if (this.certifyType === "标准化") {
validDate: item.expirationDate, this.standardizationTableData = [
filepath: item.filePath, ...res.content.map((item) => {
id: item.id, return {
category: item.category name: item.name,
} uploadDate: item.uploadDate,
})] validDate: item.expirationDate,
filepath: item.filePath,
id: item.id,
category: item.category,
};
}),
];
} }
}) });
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uploadcertify-wrapper { .uploadcertify-wrapper {
width: 160px; width: 160px;
height: 40px; height: 40px;
display: flex;
justify-content: center;
align-items: center;
background: #46a6ff;
color: white;
label {
display: flex; display: flex;
width: 100%;
height: 100%;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: #46A6FF; }
color: white; }
label { .downtriangle {
border-top: 20px solid #eee;
border-bottom: 20px solid transparent;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
position: relative;
transform: translateY(5px);
cursor: pointer;
}
.righttriangle {
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 20px solid #eee;
border-right: 20px solid transparent;
position: relative;
transform: translateX(5px);
cursor: pointer;
}
.entercertifies-total-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
box-shadow: 0 0 9px 1px #eee;
.certify-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;
.certify-find-item {
width: 80%;
margin: 10px auto;
padding: 10px;
border-radius: 10px;
box-shadow: 0 0 5px 1px #eee;
display: flex; display: flex;
width: 100%; justify-content: flex-start;
height: 100%; align-items: center;
justify-content: center; .certify-title {
width: 15%;
display: flex;
justify-content: flex-end;
margin-right: 20px;
}
}
.certify-find-btn {
width: 80%;
margin: 10px auto;
padding: 2px;
display: flex;
justify-content: flex-end;
align-items: center; align-items: center;
} }
} }
.downtriangle { .tools-wrapper {
border-top: 20px solid #eee; width: 80%;
border-bottom: 20px solid transparent; margin: 30px auto;
border-left: 20px solid transparent; padding: 20px;
border-right: 20px solid transparent; border-radius: 20px;
position: relative; box-shadow: 0 0 9px 1px #eee;
transform: translateY(5px);
cursor: pointer;
}
.righttriangle {
border-top: 20px solid transparent;
border-bottom: 20px solid transparent;
border-left: 20px solid #eee;
border-right: 20px solid transparent;
position: relative;
transform: translateX(5px);
cursor: pointer;
} }
.entercertifies-total-wrapper { .emergencyplan-wrapper {
width: 80%; width: 80%;
margin: 30px auto; margin: 30px auto;
padding: 30px; padding: 30px;
border-radius: 30px; border-radius: 20px;
box-shadow: 0 0 9px 1px #eee; box-shadow: 0 0 9px 1px #eee;
.certify-find-tools-wrapper { .emergencyplan-title {
display: flex; display: flex;
width: 80%; justify-content: space-between;
margin: 30px auto; padding: 10px;
align-items: center;
}
.emergencyplan-table-wrapper {
padding: 20px; padding: 20px;
border-radius: 20px; border-radius: 20px;
flex-wrap: wrap;
box-shadow: 0 0 9px 1px #eee; box-shadow: 0 0 9px 1px #eee;
.certify-find-item { margin-left: 40px;
width: 80%; background: #eee;
margin: 10px auto;
padding: 10px;
border-radius: 10px;;
box-shadow: 0 0 5px 1px #eee;
display: flex;
justify-content: flex-start;
align-items: center;
.certify-title {
width: 15%;
display: flex;
justify-content: flex-end;
margin-right: 20px;
}
}
.certify-find-btn {
width: 80%;
margin: 10px auto;
padding: 2px;
display: flex;
justify-content: flex-end;
align-items: center;
}
} }
.tools-wrapper { }
width: 80%; .dualsystem-wrapper {
margin: 30px auto; 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; padding: 20px;
border-radius: 20px; border-radius: 20px;
box-shadow: 0 0 9px 1px #eee; box-shadow: 0 0 9px 1px #eee;
margin-left: 40px;
background: #eee;
} }
.emergencyplan-wrapper { }
width: 80%; .standardization-wrapper {
margin: 30px auto; width: 80%;
padding: 30px; margin: 30px auto;
border-radius: 20px; padding: 30px;
box-shadow: 0 0 9px 1px #eee; border-radius: 20px;
.emergencyplan-title { box-shadow: 0 0 9px 1px #eee;
display: flex; .standardization-title {
justify-content: space-between; display: flex;
padding: 10px; justify-content: space-between;
align-items: center; padding: 10px;
} align-items: center;
.emergencyplan-table-wrapper {
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
margin-left: 40px;
background: #eee;
}
} }
.dualsystem-wrapper { .standardization-table-wrapper {
width: 80%; padding: 20px;
margin: 30px auto;
padding: 30px;
border-radius: 20px; border-radius: 20px;
box-shadow: 0 0 9px 1px #eee; box-shadow: 0 0 9px 1px #eee;
.dualsystem-title { margin-left: 40px;
display: flex; background: #eee;
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; .certify-item {
padding: 30px; display: block;
border-radius: 20px; position: fixed;
box-shadow: 0 0 9px 1px #eee; left: 0;
.standardization-title { top: 0;
display: flex; right: 0;
justify-content: space-between; bottom: 0;
padding: 10px; z-index: 9999;
align-items: center; background: #808080;
} .certify-inner-wrapper {
.standardization-table-wrapper { position: absolute;
padding: 20px; width: 960px;
border-radius: 20px; height: 620px;
box-shadow: 0 0 9px 1px #eee; left: 50%;
margin-left: 40px; top: 50%;
background: #eee; padding: 20px;
transform: translate(-50%, -50%);
display: flex;
justify-content: center;
align-items: center;
background: #eee;
.certify-innerw-wrapper {
width: 100%;
height: 100%;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
} }
} }
} .certify-img {
.certify-item { height: 100%;
display: block; }
position: fixed; .close-certify {
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 9999;
background: #808080;
.certify-inner-wrapper {
position: absolute; position: absolute;
width: 960px; right: 0;
height: 620px;
left: 0;
top: 0; top: 0;
padding: 20px; width: 30px;
transform: translate(50%, 50%); height: 30px;
display: flex; background-image: url("../../assets/home/certifyclose.png");
justify-content: center; background-size: 100% 100%;
align-items: center; background-position: center;
background: #eee; cursor: pointer;
.certify-innerw-wrapper {
width: 100%;
height: 100%;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
}
.certify-img {
height: 100%;
}
.close-certify {
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
background-image: url('../../assets/home/certifyclose.png');
background-size: 100% 100%;
background-position: center;
cursor: pointer;
}
} }
} }
}
</style> </style>
\ No newline at end of file
...@@ -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