Commit d591fb25 authored by lichunliang's avatar lichunliang

ceshi

parent e1c15733
...@@ -25,3 +25,11 @@ export function postCertify(data) { ...@@ -25,3 +25,11 @@ export function postCertify(data) {
data data
}) })
} }
export function analyzeCertify(params) {
return request({
url: '/api/enterpriseCertificate/analyze',
method: 'get',
params
})
}
import request from '@/utils/request'
import requestFile from '@/utils/requestfile'
import qs from 'qs'
export function hwapprovalEnters(params) {
return request({
url: '/api/enterpriseCertificate/pageEnterprise',
method: 'get',
params
})
}
export function enterHwapproval(params) {
return request({
url: '/api/enterpriseCertificate/page',
method: 'get',
params
})
}
export function postHwapproval(data) {
return requestFile({
url: '/api/enterpriseCertificate',
method: 'post',
data
})
}
...@@ -3,34 +3,106 @@ ...@@ -3,34 +3,106 @@
<div class="certify-statistics-wrapper"> <div class="certify-statistics-wrapper">
<el-date-picker <el-date-picker
v-model="certifySearchDate" v-model="certifySearchDate"
type="datetimerange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="证书上传开始日期" start-placeholder="证书上传开始日期"
end-placeholder="证书上传结束日期"> end-placeholder="证书上传结束日期"
</el-date-picker> />
<el-button type="success" @click="statisticsCertify">查找</el-button> <el-button type="success" @click="statisticsCertify">查找</el-button>
</div> </div>
<div class="certify-statistics" ref="statistics"></div> <div ref="statistics" class="certify-statistics" />
</div> </div>
</template> </template>
<script> <script>
import { analyzeCertify } from '@/api/certify.js'
import echarts from 'echarts'
import { parseTime } from '@/utils/index'
export default { export default {
data() { data() {
return { return {
certifySearchDate: '' certifySearchDate: ''
} }
}, },
watch: {
certifySearchDate(newVal, oldVal) {
// console.log(newVal, oldVal);
this.echartsdom.clear()
this.statisticsCertify()
}
},
mounted() {
this.echartsdom = echarts.init(this.$refs.statistics)
this.statisticsCertify()
},
methods: { methods: {
statisticsCertify() { statisticsCertify() {
// this.$refs.statistics // this.$refs.statistics
const params = {}
if (this.certifySearchDate instanceof Array) {
params.uploadEndDate = parseTime(new Date(), '{y}-{m}-{d}')
params.uploadStartDate = parseTime(new Date(), '{y}-{m}-{d}')
}
analyzeCertify(params).then((res) => {
const data1 = []
for (const key in res) {
data1.push({
name: key,
value: res[key]
})
}
data1.map(function(val) {
if (val.name === 'stanEnterpriseNum') {
val.name = '标准化体系的企业数量'
} else if (val.name === 'stanAndEmerEnterpriseNum') {
val.name = '标准化+应急企业数量'
} else if (val.name === 'emerEnterpriseNum') {
val.name = '应急预案的企业数量'
} else if (val.name === 'dualEnterpriseNum') {
val.name = '双体系证书的企业数量'
} else if (val.name === 'dualAndStanEnterpriseNum') {
val.name = '双体系+标准化企业数量'
} else if (val.name === 'dualAndStanAndEmerEnterpriseNum') {
val.name = '双体系+标准化+应急企业数量'
} else if (val.name === 'dualAndEmerEnterpriseNum') {
val.name = '双体系+应急企业数量'
}
})
console.log(res, 'analyzeCertify')
this.echartsdom.setOption({
title: {
text: '证书列表统计',
left: 'center'
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
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>
.certify-statistics-wrapper { .certify-statistics-wrapper {
width: 80%; width: 80%;
margin: 30px auto; margin: 30px auto;
padding: 30px; padding: 30px;
...@@ -48,5 +120,5 @@ export default { ...@@ -48,5 +120,5 @@ export default {
height: 60vh; height: 60vh;
margin: 30px auto; margin: 30px auto;
} }
} }
</style> </style>
This diff is collapsed.
...@@ -9,59 +9,56 @@ ...@@ -9,59 +9,56 @@
reserve-keyword reserve-keyword
placeholder="请输入企业" placeholder="请输入企业"
:remote-method="remoteMethod" :remote-method="remoteMethod"
:loading="loading"> :loading="loading"
>
<el-option <el-option
v-for="item in enters" v-for="item in enters"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
</el-option> />
</el-select> </el-select>
<el-button type="success" @click="searchEnters">查找</el-button>
</div> </div>
<div class="hwapproval-table-wrapper"> <div class="hwapproval-table-wrapper">
<el-table <el-table :data="approvalList" border>
:data="approvalList" <el-table-column type="expand">
border
>
<el-table-column
type="expand"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-table <el-table :data="scope.row.approvals">
:data="scope.row.approvals"
>
<el-table-column <el-table-column
prop="approvalName" prop="approvalName"
label="备案名称" label="备案名称"
></el-table-column> />
<el-table-column <el-table-column
prop="workTime" prop="workTime"
label="作业时间" label="作业时间"
></el-table-column> />
<el-table-column <el-table-column
prop="uploadTime" prop="uploadTime"
label="上传时间" label="上传时间"
></el-table-column> />
<el-table-column <el-table-column label="操作">
label="操作"
>
<template slot-scope="props"> <template slot-scope="props">
<el-button type="success" @click="viewApproval(scope.row, props.row)">查看</el-button> <el-button
<el-button type="primary" @click="downloadApproval(scope.row, props.row)">下载</el-button> type="success"
@click="viewApproval(scope.row, props.row)"
>查看</el-button>
<el-button
type="primary"
@click="downloadApproval(scope.row, props.row)"
>下载</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="companyName" label="企业名称" />
prop="companyName" <el-table-column label="操作">
label="企业名称"
></el-table-column>
<el-table-column
label="操作"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="success" @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>
...@@ -72,48 +69,36 @@ ...@@ -72,48 +69,36 @@
width="50%" width="50%"
> >
<el-form <el-form
v-if="addDialogShow"
ref="addform" ref="addform"
:model="addFormInfo" :model="addFormInfo"
:rules="addFormRules" :rules="addFormRules"
label-width="80px" label-width="80px"
v-if="addDialogShow"
>
<el-form-item
prop="name"
label="危险作业备案名称"
> >
<el-input v-model="addFormInfo.name"></el-input> <el-form-item prop="name" label="危险作业备案名称">
<el-input v-model="addFormInfo.name" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="workTime" label="作业时间">
prop="workTime"
label="作业时间"
>
<el-date-picker <el-date-picker
v-model="addFormInfo.workTime" v-model="addFormInfo.workTime"
type="datetime" type="datetime"
placeholder="选择日期时间"> placeholder="选择日期时间"
</el-date-picker> />
</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="addFormInfo.uploadTime" v-model="addFormInfo.uploadTime"
type="datetime" type="datetime"
placeholder="选择日期时间"> placeholder="选择日期时间"
</el-date-picker> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="file" label="文件">
prop="file"
label="文件"
>
<div> <div>
<label>选择文件 <label>选择文件
<input type="file" hidden ref="chosenfile" @change="chooseFile" /> <input ref="chosenfile" type="file" hidden @change="chooseFile">
</label> </label>
</div> </div>
<div>{{uploadFilePath}}</div> <div>{{ uploadFilePath }}</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
...@@ -121,14 +106,13 @@ ...@@ -121,14 +106,13 @@
<el-button type="primary" @click="submitHWapproval">提交</el-button> <el-button type="primary" @click="submitHWapproval">提交</el-button>
</div> </div>
</el-dialog> </el-dialog>
<div class="approval-pdf"> <div class="approval-pdf" />
</div>
</div> </div>
</template> </template>
<script> <script>
import pdf from 'vue-pdf'; import pdf from 'vue-pdf'
import { hwapprovalEnters } from '@/api/hwapproval.js'
export default { export default {
components: { components: {
pdf pdf
...@@ -219,7 +203,15 @@ export default { ...@@ -219,7 +203,15 @@ export default {
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 (!(filePath.endsWith('.pdf')||filePath.endsWith('.jpg')||filePath.endsWith('.jpeg')||filePath.endsWith('.png')||filePath.endsWith('gif'))) { if (
!(
filePath.endsWith('.pdf') ||
filePath.endsWith('.jpg') ||
filePath.endsWith('.jpeg') ||
filePath.endsWith('.png') ||
filePath.endsWith('gif')
)
) {
return return
} }
this.uploadFilePath = filePath this.uploadFilePath = filePath
...@@ -231,7 +223,8 @@ export default { ...@@ -231,7 +223,8 @@ export default {
}, },
submitHWapproval() { submitHWapproval() {
this.$refs.addform.validate((valid) => { this.$refs.addform.validate((valid) => {
if(valid) {} if (valid) {
}
}) })
}, },
createHWapproval(row) { createHWapproval(row) {
...@@ -245,7 +238,7 @@ export default { ...@@ -245,7 +238,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.hwapproval-wrapper { .hwapproval-wrapper {
width: 80%; width: 80%;
margin: 30px auto; margin: 30px auto;
border-radius: 30px; border-radius: 30px;
...@@ -265,5 +258,5 @@ export default { ...@@ -265,5 +258,5 @@ export default {
border-radius: 20px; border-radius: 20px;
box-shadow: 0 0 9px 1px #eee; box-shadow: 0 0 9px 1px #eee;
} }
} }
</style> </style>
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