Commit d591fb25 authored by lichunliang's avatar lichunliang

ceshi

parent e1c15733
......@@ -25,3 +25,11 @@ export function postCertify(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 @@
<div class="certify-statistics-wrapper">
<el-date-picker
v-model="certifySearchDate"
type="datetimerange"
type="daterange"
range-separator="至"
start-placeholder="证书上传开始日期"
end-placeholder="证书上传结束日期">
</el-date-picker>
end-placeholder="证书上传结束日期"
/>
<el-button type="success" @click="statisticsCertify">查找</el-button>
</div>
<div class="certify-statistics" ref="statistics"></div>
<div ref="statistics" class="certify-statistics" />
</div>
</template>
<script>
import { analyzeCertify } from '@/api/certify.js'
import echarts from 'echarts'
import { parseTime } from '@/utils/index'
export default {
data() {
return {
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: {
statisticsCertify() {
// 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>
<style lang="scss" scoped>
.certify-statistics-wrapper {
.certify-statistics-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
......@@ -48,5 +120,5 @@ export default {
height: 60vh;
margin: 30px auto;
}
}
}
</style>
This diff is collapsed.
......@@ -9,59 +9,56 @@
reserve-keyword
placeholder="请输入企业"
:remote-method="remoteMethod"
:loading="loading">
:loading="loading"
>
<el-option
v-for="item in enters"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
:value="item.value"
/>
</el-select>
<el-button type="success" @click="searchEnters">查找</el-button>
</div>
<div class="hwapproval-table-wrapper">
<el-table
:data="approvalList"
border
>
<el-table-column
type="expand"
>
<el-table :data="approvalList" border>
<el-table-column type="expand">
<template slot-scope="scope">
<el-table
:data="scope.row.approvals"
>
<el-table :data="scope.row.approvals">
<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
label="操作"
>
/>
<el-table-column label="操作">
<template slot-scope="props">
<el-button type="success" @click="viewApproval(scope.row, props.row)">查看</el-button>
<el-button type="primary" @click="downloadApproval(scope.row, props.row)">下载</el-button>
<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>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column
prop="companyName"
label="企业名称"
></el-table-column>
<el-table-column
label="操作"
>
<el-table-column prop="companyName" label="企业名称" />
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="success" @click="createHWapproval(scope.row)">上传危险作业备案</el-button>
<el-button
type="success"
@click="createHWapproval(scope.row)"
>上传危险作业备案</el-button>
</template>
</el-table-column>
</el-table>
......@@ -72,48 +69,36 @@
width="50%"
>
<el-form
v-if="addDialogShow"
ref="addform"
:model="addFormInfo"
:rules="addFormRules"
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
prop="workTime"
label="作业时间"
>
<el-form-item prop="workTime" label="作业时间">
<el-date-picker
v-model="addFormInfo.workTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
placeholder="选择日期时间"
/>
</el-form-item>
<el-form-item
prop="uploadTime"
label="上传时间"
>
<el-form-item prop="uploadTime" label="上传时间">
<el-date-picker
v-model="addFormInfo.uploadTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
placeholder="选择日期时间"
/>
</el-form-item>
<el-form-item
prop="file"
label="文件"
>
<el-form-item prop="file" label="文件">
<div>
<label>选择文件
<input type="file" hidden ref="chosenfile" @change="chooseFile" />
<input ref="chosenfile" type="file" hidden @change="chooseFile">
</label>
</div>
<div>{{uploadFilePath}}</div>
<div>{{ uploadFilePath }}</div>
</el-form-item>
</el-form>
<div slot="footer">
......@@ -121,14 +106,13 @@
<el-button type="primary" @click="submitHWapproval">提交</el-button>
</div>
</el-dialog>
<div class="approval-pdf">
</div>
<div class="approval-pdf" />
</div>
</template>
<script>
import pdf from 'vue-pdf';
import pdf from 'vue-pdf'
import { hwapprovalEnters } from '@/api/hwapproval.js'
export default {
components: {
pdf
......@@ -219,7 +203,15 @@ export default {
this.uploadFilePath = ''
if (this.$refs.chosenfile.files.length) {
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
}
this.uploadFilePath = filePath
......@@ -231,7 +223,8 @@ export default {
},
submitHWapproval() {
this.$refs.addform.validate((valid) => {
if(valid) {}
if (valid) {
}
})
},
createHWapproval(row) {
......@@ -245,7 +238,7 @@ export default {
</script>
<style lang="scss" scoped>
.hwapproval-wrapper {
.hwapproval-wrapper {
width: 80%;
margin: 30px auto;
border-radius: 30px;
......@@ -265,5 +258,5 @@ export default {
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
}
}
}
</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