Commit f654b080 authored by liuyuping's avatar liuyuping

'trainimg'

parent 45dae4ce
...@@ -22,4 +22,12 @@ export function dangerJobReportEnterprise(params) {//企业分页 ...@@ -22,4 +22,12 @@ export function dangerJobReportEnterprise(params) {//企业分页
method: 'get', method: 'get',
params params
}) })
}
export function postDangerJobReport(data) {
return requestFile({
url: '/api/dangerJobReport',
method: 'post',
data
})
} }
\ No newline at end of file
...@@ -26,7 +26,6 @@ export function postHwapproval(data) { ...@@ -26,7 +26,6 @@ export function postHwapproval(data) {
}) })
} }
<<<<<<< HEAD
export function findUploadEnterprise() { export function findUploadEnterprise() {
return request({ return request({
url: '/api/enterpriseCertificate/findUploadEnterprise', url: '/api/enterpriseCertificate/findUploadEnterprise',
...@@ -48,6 +47,4 @@ export function dangerJobReport(params) { ...@@ -48,6 +47,4 @@ export function dangerJobReport(params) {
params params
}) })
} }
=======
>>>>>>> 5d2f8010b5e0a42edca437d25d499712d91d7834
import request from '@/utils/request'
import requestFile from '@/utils/requestfile'
import qs from 'qs'
// 查询企业
/**
* @param {
* name: 企业名称
* page: 页码
* size: 每页显示的数目
* sort: 排序
* } params
*/
export function searchEnterprise(params) {
return request({
url: 'api/trainImage/pageEnterprise',
method: 'get',
params
})
}
// 查询影像
/**
* @param {
* enterpriseId: 企业id
* page: 页码
* size: 每页显示的数目
* sort: 排序
* } params
*/
export function searchTrainImage(params) {
return request({
url: 'api/trainImage/pageTrainImage',
method: 'get',
params
})
}
/**
* 培训影像管理统计分析
* @returns
*/
export function analyzeTrainImg() {
return request({
url: 'api/trainImage/analyze',
method: 'get'
})
}
/**
* department string
* endTime yyyy-MM-dd HH:mm:ss
* industry string
* page num
* size num
* sort
* startTime yyyy-MM-dd HH:mm:ss
* train false
* @param {*} params
*/
// 统计企业列表、每个企业的总参与人次 权限标识: trainImage:analyze
export function trainImageAnalyze1(params) {
return request({
url: 'api/trainImage/analyze1',
method: 'get',
params
})
}
/**
*
*/
// 统计参与培训企业总数量、总参与人次、未参与培训的企业数量 权限标识: trainImage:analyze
export function trainImageAnalyze2(params) {
return request({
url: 'api/trainImage/analyze2',
method: 'get',
params
})
}
/**
* page
* size
* 获取所有应急行业主管部门
*/
export function getThIndustryChargeDept(params) {
return request({
url: 'api/thIndustryChargeDept',
method: 'get',
params
})
}
/**
* page
* size
* 获取所有行业
*/
export function getAllIndustry(params) {
return request({
url: 'api/thIndustry',
method: 'get',
params
})
}
...@@ -68,6 +68,10 @@ const hwapprovalstatistics = () => import('../views/hwapproval/hwapprovalstatist ...@@ -68,6 +68,10 @@ const hwapprovalstatistics = () => import('../views/hwapproval/hwapprovalstatist
const hwapprovalsearch = () => import('../views/hwapproval/findapproval.vue') const hwapprovalsearch = () => import('../views/hwapproval/findapproval.vue')
const hwapprovals = () => import('../views/hwapproval/hwapprovals.vue') const hwapprovals = () => import('../views/hwapproval/hwapprovals.vue')
const trainimageenter = () => import('../views/trainimage/index.vue')
const trainimg = () => import('../views/trainimage/trainimg.vue')
const trainstatistics = () => import('../views/trainimage/statistics.vue')
Vue.use(Router) Vue.use(Router)
export const constantRouterMap = [ export const constantRouterMap = [
...@@ -511,7 +515,26 @@ export const constantRouterMap = [ ...@@ -511,7 +515,26 @@ export const constantRouterMap = [
component: hwapprovals, component: hwapprovals,
name: '危险作业备案列表', name: '危险作业备案列表',
meta: { title: '危险作业备案列表' } meta: { title: '危险作业备案列表' }
},
{
path: 'trainimage/trainimage',
component: trainimageenter,
name: '企业培训影像管理',
meta: { title: '企业培训影像管理' }
},
{
path: 'trainimage/trainimgstatic',
component: trainstatistics,
name: '培训影像统计',
meta: { title: '培训影像统计' }
},
{
path: 'trainimage/trainimg/:name',
component: trainimg,
name: '培训影像',
meta: { title: '培训影像' }
} }
] ]
}, },
{ {
......
<template> <template>
<div class="enter-safe-manage-wrapper"> <div class="enter-safe-manage-wrapper">
<div class="enter-safe-tools-wrapper"> <div class="enter-safe-tools-wrapper">
<!-- <el-select
v-model="queryEnter"
multiple
filterable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="item in enterList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
<el-input <el-input
v-model="searchEnterName" v-model="searchEnterName"
placeholder="请输入企业名称" placeholder="请输入企业名称"
......
...@@ -9,26 +9,36 @@ ...@@ -9,26 +9,36 @@
<el-input v-model="hdSearchInfo" placeholder="请输入隐患信息" /> <el-input v-model="hdSearchInfo" placeholder="请输入隐患信息" />
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-button type="success" size="medium" @click="searchLikeEnterInfo">搜索</el-button> <el-button type="success" size="medium" @click="searchLikeEnterInfo"
>搜索</el-button
>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-popover <el-popover placement="bottom" trigger="click">
placement="bottom"
trigger="click"
>
<el-date-picker <el-date-picker
v-model="hdAnalyzeChosenDateRange" v-model="hdAnalyzeChosenDateRange"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期"
>
</el-date-picker> </el-date-picker>
<br/> <br />
<div style="height: 10px;"></div> <div style="height: 10px;"></div>
<el-button type="info" @click="exportStatus">隐患整改</el-button> <el-button type="info" @click="exportStatus">隐患整改</el-button>
<el-button type="warning" @click="exportNoStatus">隐患未整改</el-button> <el-button type="warning" @click="exportNoStatus"
<el-button type="danger" @click="exportOvertime">超期未整改</el-button> >隐患未整改</el-button
<el-button type="primary" @click="exportHDAnalyze" :disabled="loadingHDAnalyzeExcel" v-loading="loadingHDAnalyzeExcel">导出隐患分析</el-button> >
<el-button type="danger" @click="exportOvertime"
>超期未整改</el-button
>
<el-button
type="primary"
@click="exportHDAnalyze"
:disabled="loadingHDAnalyzeExcel"
v-loading="loadingHDAnalyzeExcel"
>导出隐患分析</el-button
>
<el-button slot="reference" type="primary">导出</el-button> <el-button slot="reference" type="primary">导出</el-button>
</el-popover> </el-popover>
</el-col> </el-col>
...@@ -42,60 +52,39 @@ ...@@ -42,60 +52,39 @@
> >
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-table <el-table :data="props.row.hdlist">
:data="props.row.hdlist" <el-table-column label="序号" prop="hdOrder" width="60" />
> <el-table-column label="检查日期" prop="hdInspectDate" width="90" />
<el-table-column
label="序号"
prop="hdOrder"
width="60"
/>
<el-table-column
label="检查日期"
prop="hdInspectDate"
width="90"
/>
<el-table-column <el-table-column
label="检查专家" label="检查专家"
prop="hdInspectExpert" prop="hdInspectExpert"
width="70" width="70"
/> />
<el-table-column <el-table-column label="隐患名称" prop="hdName" width="360" />
label="隐患名称" <el-table-column label="隐患图片" width="80">
prop="hdName" <template slot-scope="scope1">
width="360"
/>
<el-table-column
label="隐患图片"
width="80"
>
<template
slot-scope="scope1"
>
<el-image <el-image
v-if="scope1.row.hdPic" v-if="scope1.row.hdPic"
style="width: 50px; height: 50px" style="width: 50px; height: 50px"
:src="'data:image/jpg;base64,' + scope1.row.hdPic" :src="'data:image/jpg;base64,' + scope1.row.hdPic"
:preview-src-list="['data:image/jpg;base64,' + scope1.row.hdPic]" :preview-src-list="[
'data:image/jpg;base64,' + scope1.row.hdPic
]"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="隐患等级" width="70">
label="隐患等级"
width="70"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.hdLevel === 1 ? '一般隐患' : '重大隐患' }}</div> <div>
{{ scope.row.hdLevel === 1 ? "一般隐患" : "重大隐患" }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="隐患描述" width="140">
label="隐患描述" <template slot-scope="scope1">
width="140" <span>{{
> scope1.row.hdDesc === "null" ? "" : scope1.row.hdDesc
<template }}</span>
slot-scope="scope1"
>
<span>{{ scope1.row.hdDesc === 'null' ? '' : scope1.row.hdDesc }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -115,37 +104,35 @@ ...@@ -115,37 +104,35 @@
prop="hdRectificationDate" prop="hdRectificationDate"
width="90" width="90"
/> />
<el-table-column <el-table-column label="验收人" width="70">
label="验收人"
width="70"
>
<template slot-scope="scope1"> <template slot-scope="scope1">
<span>{{ scope1.row.hdAcceptancePerson === 'null' ? '' : scope1.row.hdAcceptancePerson }}</span> <span>{{
scope1.row.hdAcceptancePerson === "null"
? ""
: scope1.row.hdAcceptancePerson
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="隐患状态" width="90">
label="隐患状态"
width="90"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.hdStatus === 0 ? '整改中' : '整改完成' }}</div> <div>
{{ scope.row.hdStatus === 0 ? "整改中" : "整改完成" }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="整改图片" width="80">
label="整改图片" <template slot-scope="scope1">
width="80"
>
<template
slot-scope="scope1"
>
<el-image <el-image
v-if="scope1.row.hdRectificationPic" v-if="scope1.row.hdRectificationPic"
style="width: 50px; height: 50px" style="width: 50px; height: 50px"
:src="'data:image/jpg;base64,' + scope1.row.hdRectificationPic" :src="
:preview-src-list="['data:image/jpg;base64,' + scope1.row.hdRectificationPic]" 'data:image/jpg;base64,' + scope1.row.hdRectificationPic
"
:preview-src-list="[
'data:image/jpg;base64,' + scope1.row.hdRectificationPic
]"
/> />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
label="整改照片" label="整改照片"
...@@ -160,40 +147,42 @@ ...@@ -160,40 +147,42 @@
size="mini" size="mini"
type="warning" type="warning"
@click="editdg($event, scope.$index, scope.row)" @click="editdg($event, scope.$index, scope.row)"
>编辑</el-button> >编辑</el-button
>
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
@click="deletedg($event, scope.$index, scope.row)" @click="deletedg($event, scope.$index, scope.row)"
>删除</el-button> >删除</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 label="企业名称" prop="companyName" />
label="企业名称" <el-table-column label="企业负责人" prop="companyChargePer" />
prop="companyName" <el-table-column label="操作">
/>
<el-table-column
label="企业负责人"
prop="companyChargePer"
/>
<el-table-column
label="操作"
>
<template slot-scope="scope1"> <template slot-scope="scope1">
<div class="operations-add-import-wrapper"> <div class="operations-add-import-wrapper">
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
@click="addDanger($event, scope1.$index, scope1.row)" @click="addDanger($event, scope1.$index, scope1.row)"
>新增</el-button> >新增</el-button
>
<!-- <el-input v-model="importFile" type="file">选择文件</el-input> --> <!-- <el-input v-model="importFile" type="file">选择文件</el-input> -->
<div class="import-file-dg-wrapper" @click="importDanger"> <div class="import-file-dg-wrapper" @click="importDanger">
<label class="import-file-dg"> <label class="import-file-dg">
导入 导入
<input :ref="`file${scope1.$index}`" multiple class="helloworld" type="file" hidden @change="realImportDanger(scope1.$index, scope1.row)"> <input
:ref="`file${scope1.$index}`"
multiple
class="helloworld"
type="file"
hidden
@change="realImportDanger(scope1.$index, scope1.row)"
/>
</label> </label>
</div> </div>
</div> </div>
...@@ -220,7 +209,7 @@ ...@@ -220,7 +209,7 @@
:visible.sync="adddialogform" :visible.sync="adddialogform"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-form :model="formInfo"> <el-form :model="formInfo" v-if="adddialogform">
<el-form-item label="序号"> <el-form-item label="序号">
<el-input v-model="formInfo.hdOrder" :disabled="true" /> <el-input v-model="formInfo.hdOrder" :disabled="true" />
</el-form-item> </el-form-item>
...@@ -250,16 +239,28 @@ ...@@ -250,16 +239,28 @@
<el-input v-model="formInfo.hdRectificationSug" type="textarea" /> <el-input v-model="formInfo.hdRectificationSug" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<img :src="uploadHdUrl" alt="暂未选择图片" style="width: 60%;"> <img :src="uploadHdUrl" alt="暂未选择图片" style="width: 60%;" />
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<label class="import-file-dg" style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"> <label
class="import-file-dg"
style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"
>
导入隐患图片 导入隐患图片
<input :ref="`addhdpic`" class="helloworld" type="file" hidden accept="image/jpeg" @change="addhdPicChange"> <input
:ref="`addhdpic`"
class="helloworld"
type="file"
hidden
accept="image/jpeg"
@change="addhdPicChange"
/>
</label> </label>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<div v-for="(item, index) in addEnterhdPics" :key="item.name + index">{{ item.name }}</div> <div v-for="(item, index) in addEnterhdPics" :key="item.name + index">
{{ item.name }}
</div>
</el-form-item> </el-form-item>
<el-form-item label="整改日期"> <el-form-item label="整改日期">
<el-date-picker <el-date-picker
...@@ -278,16 +279,31 @@ ...@@ -278,16 +279,31 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<img :src="uploadRectUrl" alt="暂未选择图片" style="width: 60%"> <img :src="uploadRectUrl" alt="暂未选择图片" style="width: 60%" />
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<label class="import-file-dg" style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"> <label
class="import-file-dg"
style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"
>
导入整改图片 导入整改图片
<input :ref="`addrectpic`" class="helloworld" type="file" hidden accept="image/jpeg" @change="addrectpicChange"> <input
:ref="`addrectpic`"
class="helloworld"
type="file"
hidden
accept="image/jpeg"
@change="addrectpicChange"
/>
</label> </label>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<div v-for="(item, index) in adEnterrectPics" :key="item.name + index">{{ item.name }}</div> <div
v-for="(item, index) in adEnterrectPics"
:key="item.name + index"
>
{{ item.name }}
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -303,7 +319,7 @@ ...@@ -303,7 +319,7 @@
:visible.sync="editdialogform" :visible.sync="editdialogform"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-form :model="formInfo"> <el-form :model="formInfo" v-if="editdialogform">
<el-form-item label="序号"> <el-form-item label="序号">
<el-input v-model="formInfo.hdOrder" :disabled="true" /> <el-input v-model="formInfo.hdOrder" :disabled="true" />
</el-form-item> </el-form-item>
...@@ -333,19 +349,49 @@ ...@@ -333,19 +349,49 @@
<el-input v-model="formInfo.hdRectificationSug" type="textarea" /> <el-input v-model="formInfo.hdRectificationSug" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item label="隐患图片"> <el-form-item label="隐患图片">
<img v-for="(item, index) in editEnterhdPics" v-show="typeof item === 'string'" :key="index" style="width: 60%;" :src="'data:image/jpg;base64,' + item" alt="alt"> <img
v-for="(item, index) in editEnterhdPics"
v-show="typeof item === 'string'"
:key="index"
style="width: 60%;"
:src="'data:image/jpg;base64,' + item"
alt="alt"
/>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<label class="import-file-dg" style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"> <label
class="import-file-dg"
style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"
>
导入隐患图片 导入隐患图片
<input :ref="`edithdpic`" class="helloworld" type="file" hidden accept="image/jpeg" @change="edithdPicChange"> <input
:ref="`edithdpic`"
class="helloworld"
type="file"
hidden
accept="image/jpeg"
@change="edithdPicChange"
/>
</label> </label>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<img v-show="editEnterhdPics.length > 0 && typeof editEnterhdPics[0] !== 'string'" :src="uploadEditHdUrl" alt="整改图片" style="width: 60%"> <img
v-show="
editEnterhdPics.length > 0 &&
typeof editEnterhdPics[0] !== 'string'
"
:src="uploadEditHdUrl"
alt="整改图片"
style="width: 60%"
/>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<div v-for="(item, index) in editEnterhdPics" :key="item.name + index">{{ item.name }}</div> <div
v-for="(item, index) in editEnterhdPics"
:key="item.name + index"
>
{{ item.name }}
</div>
</el-form-item> </el-form-item>
<el-form-item label="整改日期"> <el-form-item label="整改日期">
<el-date-picker <el-date-picker
...@@ -364,19 +410,49 @@ ...@@ -364,19 +410,49 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="整改图片"> <el-form-item label="整改图片">
<img v-for="(item, index) in editEnterrectPics" v-show="typeof item === 'string'" :key="index" style="width: 60%;" :src="'data:image/jpg;base64,' + item" alt="alt"> <img
v-for="(item, index) in editEnterrectPics"
v-show="typeof item === 'string'"
:key="index"
style="width: 60%;"
:src="'data:image/jpg;base64,' + item"
alt="alt"
/>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<label class="import-file-dg" style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"> <label
class="import-file-dg"
style="color: #1890ff;display:inline-block;border: 1px solid #1890ff;"
>
导入整改图片 导入整改图片
<input :ref="`editrectpic`" class="helloworld" type="file" hidden accept="image/jpeg" @change="editrectpicChange"> <input
:ref="`editrectpic`"
class="helloworld"
type="file"
hidden
accept="image/jpeg"
@change="editrectpicChange"
/>
</label> </label>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<img v-show="editEnterrectPics.length > 0 && typeof editEnterrectPics[0] !== 'string'" :src="uploadEditRectUrl" alt="整改图片" style="width: 60%"> <img
v-show="
editEnterrectPics.length > 0 &&
typeof editEnterrectPics[0] !== 'string'
"
:src="uploadEditRectUrl"
alt="整改图片"
style="width: 60%"
/>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<div v-for="(item, index) in editEnterrectPics" :key="item.name + index">{{ item.name }}</div> <div
v-for="(item, index) in editEnterrectPics"
:key="item.name + index"
>
{{ item.name }}
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -388,18 +464,25 @@ ...@@ -388,18 +464,25 @@
</template> </template>
<script> <script>
import axiosFile from '@/utils/requestfile.js' import axiosFile from "@/utils/requestfile.js";
import { getAllCompanyInfo, getHideDangeById, deletedgById, getHideDangerBychIds, getAllCompanyInfoByhdName, getHdByName } from '../../api/industry.js' import {
import axios from 'axios' getAllCompanyInfo,
import { parseTime } from '@/utils/index.js' getHideDangeById,
deletedgById,
getHideDangerBychIds,
getAllCompanyInfoByhdName,
getHdByName
} from "../../api/industry.js";
import axios from "axios";
import { parseTime } from "@/utils/index.js";
// import { Form } from 'element-ui' // import { Form } from 'element-ui'
export default { export default {
data() { data() {
return { return {
// 企业模糊搜索信息 // 企业模糊搜索信息
enterSearchInfo: '', enterSearchInfo: "",
// 搜索隐患信息 // 搜索隐患信息
hdSearchInfo: '', hdSearchInfo: "",
// 总的个数 // 总的个数
totalElement: 0, totalElement: 0,
// 当前页的条数 // 当前页的条数
...@@ -407,42 +490,41 @@ export default { ...@@ -407,42 +490,41 @@ export default {
// 当前页码 // 当前页码
currentPage: 1, currentPage: 1,
// 企业信息 // 企业信息
enterinfo: '', enterinfo: "",
formInfo: { formInfo: {
// 企业id // 企业id
companyId: 12, companyId: 12,
// 验收人 // 验收人
hdAcceptancePerson: '', hdAcceptancePerson: "",
// 隐患描述 // 隐患描述
hdDesc: '', hdDesc: "",
// 序号 // 序号
hdOrder: 1, hdOrder: 1,
// 隐患id // 隐患id
hdId: 1, hdId: 1,
// 检查日期 // 检查日期
hdInspectDate: '', hdInspectDate: "",
// 检查专家 // 检查专家
hdInspectExpert: '', hdInspectExpert: "",
// 隐患等级 // 隐患等级
hdLevel: '1', hdLevel: "1",
// 检查名称 // 检查名称
hdName: '', hdName: "",
// 整改日期 // 整改日期
hdRectificationDate: '', hdRectificationDate: "",
// 整改建议 // 整改建议
hdRectificationSug: '', hdRectificationSug: "",
// 隐患状态 // 隐患状态
hdStatus: '0' hdStatus: "0"
}, },
// 企业隐患总和 // 企业隐患总和
enterdanger: [ enterdanger: [],
],
// 新增隐患清单 // 新增隐患清单
adddialogform: false, adddialogform: false,
// 编辑隐患清单 // 编辑隐患清单
editdialogform: false, editdialogform: false,
// 导入的文件 // 导入的文件
importFile: '', importFile: "",
// 实现模态对话框的开关 // 实现模态对话框的开关
dialogonoff: false, dialogonoff: false,
// 新增企业信息隐患照片的名称数组 // 新增企业信息隐患照片的名称数组
...@@ -458,364 +540,435 @@ export default { ...@@ -458,364 +540,435 @@ export default {
// 开关 // 开关
onoff: false, onoff: false,
// 生成上传隐患图片的url // 生成上传隐患图片的url
uploadHdUrl: '', uploadHdUrl: "",
// 生成上传整改图片的url // 生成上传整改图片的url
uploadRectUrl: '', uploadRectUrl: "",
// 生成编辑隐患图片的url // 生成编辑隐患图片的url
uploadEditHdUrl: '', uploadEditHdUrl: "",
// 生成编辑整改图片的url // 生成编辑整改图片的url
uploadEditRectUrl: '', uploadEditRectUrl: "",
// 导出选择的隐患分析日期区间 // 导出选择的隐患分析日期区间
hdAnalyzeChosenDateRange: '', hdAnalyzeChosenDateRange: "",
// 正在加载 loading // 正在加载 loading
loadingHDAnalyzeExcel: false loadingHDAnalyzeExcel: false
} };
}, },
mounted() { mounted() {
this.initDangerInfo() this.initDangerInfo();
}, },
methods: { methods: {
// 初始化所有隐患信息 // 初始化所有隐患信息
async initDangerInfo(toPagination) { async initDangerInfo(toPagination) {
let replaceArray = [] let replaceArray = [];
await getAllCompanyInfo({ await getAllCompanyInfo({
page: toPagination === undefined ? (Number(this.currentPage) - 1) : 0, page: toPagination === undefined ? Number(this.currentPage) - 1 : 0,
size: this.currenetPageDegree, size: this.currenetPageDegree,
companyName: this.enterSearchInfo companyName: this.enterSearchInfo
}).then(res => { }).then(res => {
this.totalElement = res.totalElements this.totalElement = res.totalElements;
// this.enterdanger = [...res.content] // this.enterdanger = [...res.content]
replaceArray = [...res.content] replaceArray = [...res.content];
replaceArray = replaceArray.sort((a, b) => a.companyId - b.companyId) replaceArray = replaceArray.sort((a, b) => a.companyId - b.companyId);
for (let i = 0; i < replaceArray.length; i++) { for (let i = 0; i < replaceArray.length; i++) {
replaceArray[i].hdlist = [] replaceArray[i].hdlist = [];
} }
this.enterdanger = [...replaceArray] this.enterdanger = [...replaceArray];
}) });
this.isloading = false this.isloading = false;
}, },
async initDangerInfo2(toPagination) { async initDangerInfo2(toPagination) {
let replaceArray = [] let replaceArray = [];
await getAllCompanyInfoByhdName(this.enterSearchInfo, this.hdSearchInfo, toPagination === undefined ? (Number(this.currentPage) - 1) : 0, this.currenetPageDegree).then(res => { await getAllCompanyInfoByhdName(
this.enterSearchInfo,
this.hdSearchInfo,
toPagination === undefined ? Number(this.currentPage) - 1 : 0,
this.currenetPageDegree
).then(res => {
// console.log(res, 'woqunimalegebi') // console.log(res, 'woqunimalegebi')
console.log(res, '什么鬼啊') console.log(res, "什么鬼啊");
this.totalElement = res.totalElements this.totalElement = res.totalElements;
replaceArray = [...res.content] replaceArray = [...res.content];
replaceArray = replaceArray.sort((a, b) => a.companyId - b.companyId) replaceArray = replaceArray.sort((a, b) => a.companyId - b.companyId);
for (let i = 0; i < replaceArray.length; i++) { for (let i = 0; i < replaceArray.length; i++) {
replaceArray[i].hdlist = [] replaceArray[i].hdlist = [];
} }
this.enterdanger = [...replaceArray] this.enterdanger = [...replaceArray];
}) });
this.isloading = false this.isloading = false;
}, },
// 新增隐患清单 // 新增隐患清单
addDanger($event, index, scope1) { addDanger($event, index, scope1) {
// 唤起dialog // 唤起dialog
console.log($event, index, scope1) console.log($event, index, scope1);
// 设置this.form中的companyId // 设置this.form中的companyId
this.formInfo.companyId = scope1.companyId this.formInfo.companyId = scope1.companyId;
this.formInfo.hdOrder = scope1.hdlist.length + 1 this.formInfo.hdOrder = scope1.hdlist.length + 1;
this.adddialogform = true this.adddialogform = true;
}, },
// 导入隐患清单 // 导入隐患清单
importDanger($event, index, row) { importDanger($event, index, row) {
console.log($event, index, row, 'fsdfdsfsfdsfsdfdsfdsfds') console.log($event, index, row, "fsdfdsfsfdsfsdfdsfdsfds");
// this.$message.error('helloworld') // this.$message.error('helloworld')
// 模态对话框 // 模态对话框
if (this.dialogonoff === false) { if (this.dialogonoff === false) {
$event.stopPropagation() $event.stopPropagation();
$event.preventDefault() $event.preventDefault();
this.$alert('请先将文件另存为97-2003(xls)格式', '请注意', { this.$alert("请先将文件另存为97-2003(xls)格式", "请注意", {
confirmButtonText: '确定', confirmButtonText: "确定",
callback: action => { callback: action => {
console.log(action, 'helloworld') console.log(action, "helloworld");
// this.onoff = true // this.onoff = true
this.dialogonoff = true this.dialogonoff = true;
$event.target.click() $event.target.click();
setTimeout(() => { setTimeout(() => {
this.dialogonoff = false this.dialogonoff = false;
}, 0) }, 0);
} }
}) });
} }
}, },
// 格式化时间 // 格式化时间
toolformatTime(date1) { toolformatTime(date1) {
let year = 0 let year = 0;
let month = 0 let month = 0;
let day = 0 let day = 0;
let hour = 0 let hour = 0;
let minute = 0 let minute = 0;
let second = 0 let second = 0;
year = date1.getFullYear() year = date1.getFullYear();
month = (date1.getMonth() + 1) < 10 ? '0' + (date1.getMonth() + 1) : (date1.getMonth() + 1) month =
day = date1.getDate() < 10 ? '0' + date1.getDate() : date1.getDate() date1.getMonth() + 1 < 10
hour = date1.getHours() < 10 ? ('0' + date1.getHours()) : date1.getHours() ? "0" + (date1.getMonth() + 1)
minute = date1.getMinutes() < 10 ? ('0' + date1.getMinutes()) : date1.getMinutes() : date1.getMonth() + 1;
second = date1.getSeconds() < 10 ? ('0' + date1.getSeconds()) : date1.getSeconds() day = date1.getDate() < 10 ? "0" + date1.getDate() : date1.getDate();
return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second hour = date1.getHours() < 10 ? "0" + date1.getHours() : date1.getHours();
minute =
date1.getMinutes() < 10 ? "0" + date1.getMinutes() : date1.getMinutes();
second =
date1.getSeconds() < 10 ? "0" + date1.getSeconds() : date1.getSeconds();
return (
year +
"-" +
month +
"-" +
day +
" " +
hour +
":" +
minute +
":" +
second
);
}, },
// 新增隐患清单确定提交 // 新增隐患清单确定提交
confirmadddg($event) { confirmadddg($event) {
console.log($event, '新增隐患清单确认提交') console.log($event, "新增隐患清单确认提交");
console.log(this.formInfo.hdInspectDate, '检查日期') console.log(this.formInfo.hdInspectDate, "检查日期");
console.log(this.formInfo.hdRectificationDate, '整改日期') console.log(this.formInfo.hdRectificationDate, "整改日期");
let isToDeleteFormDate = false let isToDeleteFormDate = false;
if (!this.formInfo.hdInspectDate) { if (!this.formInfo.hdInspectDate) {
isToDeleteFormDate = true isToDeleteFormDate = true;
this.$confirm('没有添加检查日期', '提示', { this.$confirm("没有添加检查日期", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}) });
} }
if (this.formInfo.hdInspectDate) { if (this.formInfo.hdInspectDate) {
this.formInfo.hdInspectDate = this.toolformatTime(new Date(this.formInfo.hdInspectDate)) this.formInfo.hdInspectDate = this.toolformatTime(
new Date(this.formInfo.hdInspectDate)
);
} }
let isToDeleteDate = false let isToDeleteDate = false;
if (!this.formInfo.hdRectificationDate) { if (!this.formInfo.hdRectificationDate) {
isToDeleteDate = true isToDeleteDate = true;
} }
if (this.formInfo.hdRectificationDate) { if (this.formInfo.hdRectificationDate) {
this.formInfo.hdRectificationDate = this.toolformatTime(new Date(this.formInfo.hdRectificationDate)) this.formInfo.hdRectificationDate = this.toolformatTime(
new Date(this.formInfo.hdRectificationDate)
);
} }
const formData = new FormData() const formData = new FormData();
for (const key of Object.keys(this.formInfo)) { for (const key of Object.keys(this.formInfo)) {
formData.append(key, this.formInfo[key]) formData.append(key, this.formInfo[key]);
} }
if (isToDeleteDate) { if (isToDeleteDate) {
formData.delete('hdRectificationDate') formData.delete("hdRectificationDate");
} }
if (isToDeleteFormDate) { if (isToDeleteFormDate) {
formData.delete('hdInspectDate') formData.delete("hdInspectDate");
} }
for (let i = 0; i < this.addEnterhdPics.length; i++) { for (let i = 0; i < this.addEnterhdPics.length; i++) {
formData.append('hdPic', this.addEnterhdPics[i]) formData.append("hdPic", this.addEnterhdPics[i]);
} }
for (let i = 0; i < this.adEnterrectPics.length; i++) { for (let i = 0; i < this.adEnterrectPics.length; i++) {
formData.append('hdRectificationPic', this.adEnterrectPics[i]) formData.append("hdRectificationPic", this.adEnterrectPics[i]);
} }
if (this.addEnterhdPics.length === 0) { if (this.addEnterhdPics.length === 0) {
formData.delete('hdPic') formData.delete("hdPic");
} }
if (this.adEnterrectPics.length === 0) { if (this.adEnterrectPics.length === 0) {
formData.delete('hdRectificationPic') formData.delete("hdRectificationPic");
} }
formData.delete('hdId') formData.delete("hdId");
axiosFile({ axiosFile({
url: '/api/thHiddenDanger', url: "/api/thHiddenDanger",
method: 'POST', method: "POST",
data: formData data: formData
}).then(res => { }).then(
console.log(res) res => {
this.$message({ console.log(res);
message: '添加成功', this.$message({
type: 'success' message: "添加成功",
}) type: "success"
this.adddialogform = false });
this.isloading = true this.adddialogform = false;
this.initDangerInfo() this.isloading = true;
this.clearPics() this.initDangerInfo();
}, () => { this.clearPics();
this.$message.error('添加失败') },
}) () => {
this.$message.error("添加失败");
}
);
}, },
// 编辑隐患清单 // 编辑隐患清单
editdg($event, index, row) { editdg($event, index, row) {
// 编辑隐患清单 // 编辑隐患清单
console.log($event, '编辑隐患清单', index, row) console.log($event, "编辑隐患清单", index, row);
this.formInfo = { ...row } this.formInfo = { ...row };
this.formInfo.hdLevel = this.formInfo.hdLevel + '' this.formInfo.hdLevel = this.formInfo.hdLevel + "";
this.formInfo.hdStatus = this.formInfo.hdStatus + '' this.formInfo.hdStatus = this.formInfo.hdStatus + "";
if (this.formInfo.hdDesc === 'null') { if (this.formInfo.hdDesc === "null") {
this.formInfo.hdDesc = '' this.formInfo.hdDesc = "";
} }
if (this.formInfo.hdAcceptancePerson === 'null') { if (this.formInfo.hdAcceptancePerson === "null") {
this.formInfo.hdAcceptancePerson = '' this.formInfo.hdAcceptancePerson = "";
} }
getHideDangerBychIds(row.companyId, row.hdId).then(res => { getHideDangerBychIds(row.companyId, row.hdId).then(res => {
if (res && res.content && res.content.length > 0) { if (res && res.content && res.content.length > 0) {
this.formInfo = { ... res.content[0] } this.formInfo = { ...res.content[0] };
if (this.formInfo.hdDesc === 'null') { if (this.formInfo.hdDesc === "null") {
this.formInfo.hdDesc = '' this.formInfo.hdDesc = "";
} }
if (this.formInfo.hdAcceptancePerson === 'null') { if (this.formInfo.hdAcceptancePerson === "null") {
this.formInfo.hdAcceptancePerson = '' this.formInfo.hdAcceptancePerson = "";
} }
this.formInfo.hdLevel = this.formInfo.hdLevel + '' this.formInfo.hdLevel = this.formInfo.hdLevel + "";
this.formInfo.hdStatus = this.formInfo.hdStatus + '' this.formInfo.hdStatus = this.formInfo.hdStatus + "";
if (res.content[0].hdPic && res.content[0].hdPic.length && res.content[0].hdPic.length > 0) { if (
this.editEnterhdPics = [...res.content[0].hdPic] res.content[0].hdPic &&
res.content[0].hdPic.length &&
res.content[0].hdPic.length > 0
) {
this.editEnterhdPics = [...res.content[0].hdPic];
} else { } else {
this.editEnterhdPics = [] this.editEnterhdPics = [];
} }
if (res.content[0].hdRectificationPic && res.content[0].hdRectificationPic.length && res.content[0].hdRectificationPic.length > 0) { if (
this.editEnterrectPics = [...res.content[0].hdRectificationPic] res.content[0].hdRectificationPic &&
res.content[0].hdRectificationPic.length &&
res.content[0].hdRectificationPic.length > 0
) {
this.editEnterrectPics = [...res.content[0].hdRectificationPic];
} else { } else {
this.editEnterrectPics = [] this.editEnterrectPics = [];
} }
} }
}) });
this.editdialogform = true this.editdialogform = true;
}, },
// 编辑隐患清单确认提交 // 编辑隐患清单确认提交
confirmeditdg($event) { confirmeditdg($event) {
console.log($event, '编辑隐患清单确认提交') console.log($event, "编辑隐患清单确认提交");
this.formInfo.hdInspectDate = this.toolformatTime(new Date(this.formInfo.hdInspectDate)) this.formInfo.hdInspectDate = this.toolformatTime(
let isToDeleteDate = false new Date(this.formInfo.hdInspectDate)
);
let isToDeleteDate = false;
if (!this.formInfo.hdRectificationDate) { if (!this.formInfo.hdRectificationDate) {
isToDeleteDate = true isToDeleteDate = true;
} }
if (this.formInfo.hdRectificationDate) { if (this.formInfo.hdRectificationDate) {
this.formInfo.hdRectificationDate = this.toolformatTime(new Date(this.formInfo.hdRectificationDate)) this.formInfo.hdRectificationDate = this.toolformatTime(
new Date(this.formInfo.hdRectificationDate)
);
} }
const formData = new FormData() const formData = new FormData();
console.log(this.formInfo.hdStatus, '12332323323232113221321312321321') console.log(this.formInfo.hdStatus, "12332323323232113221321312321321");
for (const key of Object.keys(this.formInfo)) { for (const key of Object.keys(this.formInfo)) {
formData.append(key, this.formInfo[key]) formData.append(key, this.formInfo[key]);
} }
for (let i = 0; i < this.editEnterhdPics.length; i++) { for (let i = 0; i < this.editEnterhdPics.length; i++) {
console.log(typeof this.editEnterhdPics[i], 'helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworld') console.log(
typeof this.editEnterhdPics[i],
"helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworld"
);
if (typeof this.editEnterhdPics[i] === 'string') { if (typeof this.editEnterhdPics[i] === "string") {
const bstr = atob(this.editEnterhdPics[i]) const bstr = atob(this.editEnterhdPics[i]);
let l = bstr.length let l = bstr.length;
const u8Arr = new Uint8Array(l) const u8Arr = new Uint8Array(l);
while (l--) { while (l--) {
u8Arr[l] = bstr.charCodeAt(l) u8Arr[l] = bstr.charCodeAt(l);
} }
// const curBlob = new Blob([u8Arr], { // const curBlob = new Blob([u8Arr], {
// type: 'image/jpg;' // type: 'image/jpg;'
// }) // })
const name1 = '' + (Math.random() * 10) + (Math.random() * 10) + (Math.random() * 10) + (Math.random() * 10) + '.jpg' const name1 =
const curFile = new File([u8Arr], name1, { type: 'image/jpg' }) "" +
formData.append('hdPic', curFile) Math.random() * 10 +
Math.random() * 10 +
Math.random() * 10 +
Math.random() * 10 +
".jpg";
const curFile = new File([u8Arr], name1, { type: "image/jpg" });
formData.append("hdPic", curFile);
} else { } else {
formData.append('hdPic', this.editEnterhdPics[i]) formData.append("hdPic", this.editEnterhdPics[i]);
} }
} }
for (let i = 0; i < this.editEnterrectPics.length; i++) { for (let i = 0; i < this.editEnterrectPics.length; i++) {
if (typeof this.editEnterrectPics[i] === 'string') { if (typeof this.editEnterrectPics[i] === "string") {
const bstr = atob(this.editEnterrectPics[i]) const bstr = atob(this.editEnterrectPics[i]);
let l = bstr.length let l = bstr.length;
const u8Arr = new Uint8Array(l) const u8Arr = new Uint8Array(l);
while (l--) { while (l--) {
u8Arr[l] = bstr.charCodeAt(l) u8Arr[l] = bstr.charCodeAt(l);
} }
// const curBlob = new Blob([u8Arr], { // const curBlob = new Blob([u8Arr], {
// type: 'image/jpg;' // type: 'image/jpg;'
// }) // })
const name1 = '' + (Math.random() * 10) + (Math.random() * 10) + (Math.random() * 10) + (Math.random() * 10) + '.jpg' const name1 =
const curFile = new File([u8Arr], name1, { type: 'image/jpg' }) "" +
formData.append('hdRectificationPic', curFile) Math.random() * 10 +
Math.random() * 10 +
Math.random() * 10 +
Math.random() * 10 +
".jpg";
const curFile = new File([u8Arr], name1, { type: "image/jpg" });
formData.append("hdRectificationPic", curFile);
} else { } else {
formData.append('hdRectificationPic', this.editEnterrectPics[i]) formData.append("hdRectificationPic", this.editEnterrectPics[i]);
} }
} }
// if (this.formInfo.hdPic && this.formInfo.hdPic.length && this.formInfo.hdPic.length > 0) { // if (this.formInfo.hdPic && this.formInfo.hdPic.length && this.formInfo.hdPic.length > 0) {
// if (this.edit) // if (this.edit)
// } // }
if (isToDeleteDate) { if (isToDeleteDate) {
formData.delete('hdRectificationDate') formData.delete("hdRectificationDate");
} }
if (this.editEnterhdPics.length === 0) { if (this.editEnterhdPics.length === 0) {
formData.delete('hdPic') formData.delete("hdPic");
} }
if (this.editEnterrectPics.length === 0) { if (this.editEnterrectPics.length === 0) {
formData.delete('hdRectificationPic') formData.delete("hdRectificationPic");
} }
axiosFile({ axiosFile({
url: '/api/thHiddenDanger/update', url: "/api/thHiddenDanger/update",
method: 'POST', method: "POST",
data: formData data: formData
}).then(res => { }).then(
console.log(res) res => {
this.$message({ console.log(res);
message: '编辑成功', this.$message({
type: 'success' message: "编辑成功",
}) type: "success"
this.isloading = true });
this.initDangerInfo() this.isloading = true;
this.editdialogform = false this.initDangerInfo();
}, () => { this.editdialogform = false;
this.$message.error('编辑失败') },
}) () => {
this.$message.error("编辑失败");
}
);
}, },
// 删除隐患清单 // 删除隐患清单
deletedg($event, index, row) { deletedg($event, index, row) {
this.$confirm('此操作不可逆, 确认删除?', '提示', { this.$confirm("此操作不可逆, 确认删除?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}).then( }).then(() => {
() => { deletedgById(row.hdId).then(
deletedgById(row.hdId).then(res => { res => {
this.$message({ this.$message({
message: '删除成功', message: "删除成功",
type: 'success' type: "success"
}) });
this.isloading = true this.isloading = true;
this.initDangerInfo() this.initDangerInfo();
}, () => { },
this.$message.error('删除失败') () => {
}) this.$message.error("删除失败");
} }
) );
});
}, },
// 导入文件 // 导入文件
realImportDanger(index, row) { realImportDanger(index, row) {
// this.dialogonoff = false // this.dialogonoff = false
console.log(index, row, 'fuck the world') console.log(index, row, "fuck the world");
// 调用提交按钮 // 调用提交按钮
const formdata = new FormData() const formdata = new FormData();
formdata.append('companyId', row.companyId) formdata.append("companyId", row.companyId);
for (let i = 0; i < this.$refs['file' + index].files.length; i++) { for (let i = 0; i < this.$refs["file" + index].files.length; i++) {
formdata.append('files', this.$refs['file' + index].files[i]) formdata.append("files", this.$refs["file" + index].files[i]);
} }
if (this.$refs['file' + index].files.length === 0) { if (this.$refs["file" + index].files.length === 0) {
return return;
} }
axiosFile({ axiosFile({
url: '/api/thHiddenDanger/importExcel', url: "/api/thHiddenDanger/importExcel",
method: 'POST', method: "POST",
data: formdata data: formdata
}).then(res => { }).then(
this.$message({ res => {
message: '上传成功', this.$message({
type: 'success' message: "上传成功",
}) type: "success"
}, () => { });
this.$message.error('上传失败') },
}) () => {
this.$message.error("上传失败");
}
);
}, },
// 当前页的条数变化 // 当前页的条数变化
handleSizeChange(val) { handleSizeChange(val) {
this.currenetPageDegree = val this.currenetPageDegree = val;
this.initDangerInfo2() this.initDangerInfo2();
}, },
// 当前第几页 // 当前第几页
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentPage = val this.currentPage = val;
this.initDangerInfo2() this.initDangerInfo2();
}, },
// 模糊搜索 // 模糊搜索
searchLikeEnterInfo() { searchLikeEnterInfo() {
this.initDangerInfo2('a') this.initDangerInfo2("a");
}, },
// 新增隐患照片事件 // 新增隐患照片事件
addhdPicChange() { addhdPicChange() {
this.addEnterhdPics = this.$refs['addhdpic'].files this.addEnterhdPics = this.$refs["addhdpic"].files;
if (this.addEnterhdPics && this.addEnterhdPics.length && this.addEnterhdPics.length > 0) { if (
this.uploadHdUrl = URL.createObjectURL(this.addEnterhdPics[0]) this.addEnterhdPics &&
this.addEnterhdPics.length &&
this.addEnterhdPics.length > 0
) {
this.uploadHdUrl = URL.createObjectURL(this.addEnterhdPics[0]);
} }
}, },
// 新增导入照片事件 // 新增导入照片事件
addrectpicChange() { addrectpicChange() {
this.adEnterrectPics = this.$refs['addrectpic'].files this.adEnterrectPics = this.$refs["addrectpic"].files;
if (this.adEnterrectPics && this.adEnterrectPics.length && this.adEnterrectPics.length > 0) { if (
this.uploadRectUrl = URL.createObjectURL(this.adEnterrectPics[0]) this.adEnterrectPics &&
this.adEnterrectPics.length &&
this.adEnterrectPics.length > 0
) {
this.uploadRectUrl = URL.createObjectURL(this.adEnterrectPics[0]);
} }
}, },
// 生成URL // 生成URL
...@@ -824,81 +977,89 @@ export default { ...@@ -824,81 +977,89 @@ export default {
// for (let i = 0; i < item.length; i++) { // for (let i = 0; i < item.length; i++) {
// myarrayBuffer[i] = item[i] // myarrayBuffer[i] = item[i]
// } // }
return URL.createObjectURL(new Blob([item], { type: 'image/jpeg' })) return URL.createObjectURL(new Blob([item], { type: "image/jpeg" }));
}, },
// 编辑隐患照片事件 // 编辑隐患照片事件
edithdPicChange() { edithdPicChange() {
this.editEnterhdPics = this.$refs['edithdpic'].files this.editEnterhdPics = this.$refs["edithdpic"].files;
// console.log(this.editEnterhdPics, 'helloworldhelloworldhelloworldhelloworldhelloworld') // console.log(this.editEnterhdPics, 'helloworldhelloworldhelloworldhelloworldhelloworld')
// if (this.editEnterhdPics && this.editEnterhdPics.length && this.editEnterhdPics.length > 0) { // if (this.editEnterhdPics && this.editEnterhdPics.length && this.editEnterhdPics.length > 0) {
// console.log('进来了吗, 1111111') // console.log('进来了吗, 1111111')
// // uploadHdUrl 被设置 // // uploadHdUrl 被设置
// this.uploadHdUrl = URL.createObjectURL(this.editEnterhdPics[0]) // this.uploadHdUrl = URL.createObjectURL(this.editEnterhdPics[0])
// } // }
if (this.editEnterhdPics && this.editEnterhdPics.length && this.editEnterhdPics.length > 0) { if (
this.uploadEditHdUrl = URL.createObjectURL(this.editEnterhdPics[0]) this.editEnterhdPics &&
console.log('这边进来了吗,' + this.uploadEditHdUrl) this.editEnterhdPics.length &&
this.editEnterhdPics.length > 0
) {
this.uploadEditHdUrl = URL.createObjectURL(this.editEnterhdPics[0]);
console.log("这边进来了吗," + this.uploadEditHdUrl);
} }
}, },
// 编辑整改照片事件 // 编辑整改照片事件
editrectpicChange() { editrectpicChange() {
this.editEnterrectPics = this.$refs['editrectpic'].files this.editEnterrectPics = this.$refs["editrectpic"].files;
// console.log(this.editEnterrectPics, '') // console.log(this.editEnterrectPics, '')
// if (this.editEnterrectPics && this.editEnterrectPics.length && this.editEnterrectPics.length > 0) { // if (this.editEnterrectPics && this.editEnterrectPics.length && this.editEnterrectPics.length > 0) {
// console.log('进来了吗, 222222222') // console.log('进来了吗, 222222222')
// // upload\ // // upload\
// this.uploadRectUrl = URL.createObjectURL(this.editEnterrectPics[0]) // this.uploadRectUrl = URL.createObjectURL(this.editEnterrectPics[0])
// } // }
if (this.editEnterrectPics && this.editEnterrectPics.length && this.editEnterrectPics.length > 0) { if (
this.uploadEditRectUrl = URL.createObjectURL(this.editEnterrectPics[0]) this.editEnterrectPics &&
this.editEnterrectPics.length &&
this.editEnterrectPics.length > 0
) {
this.uploadEditRectUrl = URL.createObjectURL(this.editEnterrectPics[0]);
} }
}, },
// 清空全部 // 清空全部
clearAllFormInfo() { clearAllFormInfo() {
// 除了companyId 剩下的都置零 // 除了companyId 剩下的都置零
this.formInfo.hdAcceptancePerson = '' this.formInfo.hdAcceptancePerson = "";
// 隐患描述 // 隐患描述
this.formInfo.hdDesc = '' this.formInfo.hdDesc = "";
// 序号 // 序号
this.formInfo.hdOrder = this.formInfo.hdOrder++ this.formInfo.hdOrder = this.formInfo.hdOrder++;
// 隐患id // 隐患id
this.formInfo.hdId = this.formInfo.hdId this.formInfo.hdId = this.formInfo.hdId;
// 检查日期 // 检查日期
this.formInfo.hdInspectDate = '' this.formInfo.hdInspectDate = "";
// 检查专家 // 检查专家
this.formInfo.hdInspectExpert = '' this.formInfo.hdInspectExpert = "";
// 隐患等级 // 隐患等级
this.formInfo.hdLevel = '1' this.formInfo.hdLevel = "1";
// 检查名称 // 检查名称
this.formInfo.hdName = '' this.formInfo.hdName = "";
// 整改日期 // 整改日期
this.formInfo.hdRectificationDate = '' this.formInfo.hdRectificationDate = "";
// 整改建议 // 整改建议
this.formInfo.hdRectificationSug = '' this.formInfo.hdRectificationSug = "";
// 隐患状态 // 隐患状态
this.formInfo.hdStatus = '0' this.formInfo.hdStatus = "0";
}, },
// 清空图片 // 清空图片
clearPics() { clearPics() {
this.addEnterhdPics = [] this.addEnterhdPics = [];
this.adEnterrectPics = [] this.adEnterrectPics = [];
this.uploadHdUrl = '' this.uploadHdUrl = "";
this.uploadRectUrl = '' this.uploadRectUrl = "";
}, },
// 展开事件 // 展开事件
expandHdInfo(row, expanded) { expandHdInfo(row, expanded) {
console.log(row, expanded, '展开事件被触发') console.log(row, expanded, "展开事件被触发");
let isNotFount = false let isNotFount = false;
if (expanded && expanded.length && expanded.length > 0) { if (expanded && expanded.length && expanded.length > 0) {
expanded.forEach(item => { expanded.forEach(item => {
if (Number(item.companyId) === Number(row.companyId)) { if (Number(item.companyId) === Number(row.companyId)) {
isNotFount = true isNotFount = true;
} }
}) });
} }
// 如果是展开事件并且hdlist不存在 // 如果是展开事件并且hdlist不存在
if (isNotFount === true && row.hdlist.length === 0) { if (isNotFount === true && row.hdlist.length === 0) {
this.isloading = true this.isloading = true;
// getHideDangeById(Number(row.companyId)).then(resdg => { // getHideDangeById(Number(row.companyId)).then(resdg => {
// row.hdlist = [...resdg.content] // row.hdlist = [...resdg.content]
// row.hdlist = row.hdlist.sort((a, b) => a.hdId - b.hdId) // row.hdlist = row.hdlist.sort((a, b) => a.hdId - b.hdId)
...@@ -917,23 +1078,41 @@ export default { ...@@ -917,23 +1078,41 @@ export default {
// }, () => { // }, () => {
// this.isloading = false // this.isloading = false
// }) // })
getHdByName(Number(row.companyId), undefined, this.hdSearchInfo, 0, 9999, 'hdId,desc').then(res => { getHdByName(
row.hdlist = [...res.content] Number(row.companyId),
row.hdlist = row.hdlist.sort((a, b) => a.hdId - b.hdId) undefined,
for (let j = 0; j < row.hdlist.length; j++) { this.hdSearchInfo,
row.hdlist[j].hdOrder = j + 1 0,
row.hdlist[j].companyId = Number(row.companyId) 9999,
getHdByName(row.companyId, row.hdlist[j].hdId, this.hdSearchInfo, 0, 9999, 'hdId,desc').then(res1 => { "hdId,desc"
if (res1 && res1.content && res1.content.length > 0) { ).then(
row.hdlist[j].hdPic = res1.content[0].hdPic res => {
row.hdlist[j].hdRectificationPic = res1.content[0].hdRectificationPic row.hdlist = [...res.content];
} row.hdlist = row.hdlist.sort((a, b) => a.hdId - b.hdId);
}) for (let j = 0; j < row.hdlist.length; j++) {
row.hdlist[j].hdOrder = j + 1;
row.hdlist[j].companyId = Number(row.companyId);
getHdByName(
row.companyId,
row.hdlist[j].hdId,
this.hdSearchInfo,
0,
9999,
"hdId,desc"
).then(res1 => {
if (res1 && res1.content && res1.content.length > 0) {
row.hdlist[j].hdPic = res1.content[0].hdPic;
row.hdlist[j].hdRectificationPic =
res1.content[0].hdRectificationPic;
}
});
}
this.isloading = false;
},
() => {
this.isloading = false;
} }
this.isloading = false );
}, () => {
this.isloading = false
})
} }
// if (expanded) {} // if (expanded) {}
// if (row.hdlist.length > 0) { // if (row.hdlist.length > 0) {
...@@ -955,142 +1134,155 @@ export default { ...@@ -955,142 +1134,155 @@ export default {
}, },
exportStatus() { exportStatus() {
axios({ axios({
url: process.env.VUE_APP_BASE_API + '/api/thHiddenDanger/export', url: process.env.VUE_APP_BASE_API + "/api/thHiddenDanger/export",
method: 'get', method: "get",
responseType: 'blob', responseType: "blob",
params: { params: {
hdStatus: 1 hdStatus: 1
} }
}).then((response) => { }).then(response => {
const url = window.URL.createObjectURL(new Blob([response.data])) const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a') const link = document.createElement("a");
link.href = url link.href = url;
link.setAttribute('download', 'export.xls') link.setAttribute("download", "export.xls");
document.body.appendChild(link) document.body.appendChild(link);
link.click() link.click();
link.remove() link.remove();
window.URL.revokeObjectURL(link.href) window.URL.revokeObjectURL(link.href);
}) });
}, },
exportNoStatus() { exportNoStatus() {
axios({ axios({
url: process.env.VUE_APP_BASE_API + '/api/thHiddenDanger/export', url: process.env.VUE_APP_BASE_API + "/api/thHiddenDanger/export",
method: 'get', method: "get",
responseType: 'blob', responseType: "blob",
params: { params: {
hdStatus: 0 hdStatus: 0
} }
}).then((response) => { }).then(response => {
const url = window.URL.createObjectURL(new Blob([response.data])) const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a') const link = document.createElement("a");
link.href = url link.href = url;
link.setAttribute('download', 'export.xls') link.setAttribute("download", "export.xls");
document.body.appendChild(link) document.body.appendChild(link);
link.click() link.click();
link.remove() link.remove();
window.URL.revokeObjectURL(link.href) window.URL.revokeObjectURL(link.href);
}) });
}, },
exportOvertime() { exportOvertime() {
axios({ axios({
url: process.env.VUE_APP_BASE_API + '/api/thHiddenDanger/export', url: process.env.VUE_APP_BASE_API + "/api/thHiddenDanger/export",
method: 'get', method: "get",
responseType: 'blob', responseType: "blob",
params: { params: {
hdStatus: 2 hdStatus: 2
} }
}).then((response) => { }).then(response => {
const url = window.URL.createObjectURL(new Blob([response.data])) const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a') const link = document.createElement("a");
link.href = url link.href = url;
link.setAttribute('download', 'export.xls') link.setAttribute("download", "export.xls");
document.body.appendChild(link) document.body.appendChild(link);
link.click() link.click();
link.remove() link.remove();
window.URL.revokeObjectURL(link.href) window.URL.revokeObjectURL(link.href);
}) });
}, },
exportHDAnalyze() { exportHDAnalyze() {
if (this.hdAnalyzeChosenDateRange instanceof Array) { if (this.hdAnalyzeChosenDateRange instanceof Array) {
this.loadingHDAnalyzeExcel = true this.loadingHDAnalyzeExcel = true;
axios({ axios({
url: process.env.VUE_APP_BASE_API + '/api/thHiddenDanger/exportExcel', url: process.env.VUE_APP_BASE_API + "/api/thHiddenDanger/exportExcel",
method: 'get', method: "get",
responseType: 'blob', responseType: "blob",
onDownloadProgress: (ProgressEvent) => { onDownloadProgress: ProgressEvent => {
console.log(ProgressEvent, 'exportHDAnalyze exportHDAnalyze exportHDAnalyze') console.log(
this.loadingHDAnalyzeExcel = true ProgressEvent,
"exportHDAnalyze exportHDAnalyze exportHDAnalyze"
);
this.loadingHDAnalyzeExcel = true;
if (this.timerLoadingHDAnalyzeExcel) { if (this.timerLoadingHDAnalyzeExcel) {
clearTimeout(this.timerLoadingHDAnalyzeExcel) clearTimeout(this.timerLoadingHDAnalyzeExcel);
} else { } else {
this.timerLoadingHDAnalyzeExcel = setTimeout(() => { this.timerLoadingHDAnalyzeExcel = setTimeout(() => {
this.loadingHDAnalyzeExcel = false this.loadingHDAnalyzeExcel = false;
}, 500) }, 500);
} }
}, },
params: { params: {
startTime: parseTime(new Date(this.hdAnalyzeChosenDateRange[0]), '{y}-{m}-{d}'), startTime: parseTime(
endTime: parseTime(new Date(this.hdAnalyzeChosenDateRange[1]), '{y}-{m}-{d}') new Date(this.hdAnalyzeChosenDateRange[0]),
"{y}-{m}-{d}"
),
endTime: parseTime(
new Date(this.hdAnalyzeChosenDateRange[1]),
"{y}-{m}-{d}"
)
} }
}).then(res => { }).then(res => {
console.dir(res, 'console') console.dir(res, "console");
console.log(res, 'this.hdAnalyzeChosenDateRange this.hdAnalyzeChosenDateRange') console.log(
const url = window.URL.createObjectURL(new Blob([res.data])) res,
const link = document.createElement('a') "this.hdAnalyzeChosenDateRange this.hdAnalyzeChosenDateRange"
link.href = url );
link.setAttribute('download', decodeURI(res.headers['content-disposition'].split("''")[1])) const url = window.URL.createObjectURL(new Blob([res.data]));
document.body.appendChild(link) const link = document.createElement("a");
link.click() link.href = url;
link.remove() link.setAttribute(
window.URL.revokeObjectURL(link.href) "download",
}) decodeURI(res.headers["content-disposition"].split("''")[1])
);
document.body.appendChild(link);
link.click();
link.remove();
window.URL.revokeObjectURL(link.href);
});
} else { } else {
this.$message.error('请选择日期') this.$message.error("请选择日期");
} }
} }
} }
};
}
</script> </script>
<style lang="scss"> <style lang="scss">
.hidedanger-wrapper { .hidedanger-wrapper {
padding: 20px; padding: 20px;
} }
/* input[type="file"] { /* input[type="file"] {
color: lightblue; color: lightblue;
} */ } */
/* input { /* input {
color: lightblue !important; color: lightblue !important;
font-size: 16px; font-size: 16px;
} */ } */
/* label { /* label {
margin: 0 10px; margin: 0 10px;
} */ } */
.operations-add-import-wrapper { .operations-add-import-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
.import-file-dg-wrapper { .import-file-dg-wrapper {
display: inline-block; display: inline-block;
margin: 0 20px; margin: 0 20px;
.import-file-dg { .import-file-dg {
color: white; color: white;
border-radius: 3px; border-radius: 3px;
background-color: #1890ff; background-color: #1890ff;
/* display: inline-block; */ /* display: inline-block; */
text-align: center; text-align: center;
width: 56px; width: 56px;
height: 28px; height: 28px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&:hover { &:hover {
/* color: #46a6ff; */ /* color: #46a6ff; */
/* border-color: #badeff; */ /* border-color: #badeff; */
background-color: #46a6ff; background-color: #46a6ff;
}
} }
} }
} }
}
</style> </style>
...@@ -3677,13 +3677,13 @@ export default { ...@@ -3677,13 +3677,13 @@ export default {
console.log(result, 'result reuslt _____________') console.log(result, 'result reuslt _____________')
for (let i = 0; i < result.length;i++) { for (let i = 0; i < result.length;i++) {
if (result[i].dualSystemNum > 0) { if (result[i].dualSystemNum > 0) {
this.dualSystemEnters.push(result[i]) this.dualSystemEnters.push({...result[i]})
} }
if (result[i].emergencyPlanNum > 0) { if (result[i].emergencyPlanNum > 0) {
this.emergencyPlanEnters.push(result[i]) this.emergencyPlanEnters.push({...result[i]})
} }
if (result[i].standardizationNum > 0) { if (result[i].standardizationNum > 0) {
this.standardization.push(result[i]) this.standardization.push({...result[i]})
} }
} }
let proArr2 = [] let proArr2 = []
...@@ -3694,6 +3694,7 @@ export default { ...@@ -3694,6 +3694,7 @@ export default {
size: 999, size: 999,
page: 0 page: 0
}).then(res => { }).then(res => {
console.log(res, '双体系证书 双体系证书 双体系证书')
this.dualSystemEnters[i].certifies = [...res.content.map(item => { this.dualSystemEnters[i].certifies = [...res.content.map(item => {
const index1 = item.filePath.indexOf('\\') const index1 = item.filePath.indexOf('\\')
const index2 = item.filePath.indexOf('\\', index1 + 1) const index2 = item.filePath.indexOf('\\', index1 + 1)
...@@ -3711,6 +3712,7 @@ export default { ...@@ -3711,6 +3712,7 @@ export default {
size: 999, size: 999,
page: 0 page: 0
}).then(res => { }).then(res => {
console.log(res, '应急预案 应急预案 应急预案')
this.emergencyPlanEnters[i].certifies = [...res.content.map(item => { this.emergencyPlanEnters[i].certifies = [...res.content.map(item => {
const index1 = item.filePath.indexOf('\\') const index1 = item.filePath.indexOf('\\')
const index2 = item.filePath.indexOf('\\', index1 + 1) const index2 = item.filePath.indexOf('\\', index1 + 1)
...@@ -3721,14 +3723,15 @@ export default { ...@@ -3721,14 +3723,15 @@ export default {
}) })
proArr2.push(p1) proArr2.push(p1)
} }
for (let i = 0; i < this.standardizationNum.length; i++) { for (let i = 0; i < this.standardization.length; i++) {
const p1 = enterHwapproval({ const p1 = enterHwapproval({
companyId: this.standardizationNum[i].companyId, companyId: this.standardization[i].companyId,
category: '标准化', category: '标准化',
size: 999, size: 999,
page: 0 page: 0
}).then(res => { }).then(res => {
this.standardizationNum[i].certifies = [...res.content.map(item => { console.log(res, '标准化 标准化 标准化')
this.standardization[i].certifies = [...res.content.map(item => {
const index1 = item.filePath.indexOf('\\') const index1 = item.filePath.indexOf('\\')
const index2 = item.filePath.indexOf('\\', index1 + 1) const index2 = item.filePath.indexOf('\\', index1 + 1)
const index3 = item.filePath.indexOf('\\', index2 + 1) const index3 = item.filePath.indexOf('\\', index2 + 1)
...@@ -12018,146 +12021,6 @@ export default { ...@@ -12018,146 +12021,6 @@ export default {
if (this.isCurCertifyIndex === 3) { if (this.isCurCertifyIndex === 3) {
this.certifies = item.certifies this.certifies = item.certifies
} }
// 判断当前的企业
// if (this.isCurCertifyIndex === 1) {
// if (item.companyName === "威海大庆特种材料制品有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify1/威海大庆特种材料制作有限公司-双体系.pdf",
// },
// ];
// }
// if (item.companyName === "威海大宇电子有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify1/威海大宇电子有限公司-双体系.jpg",
// },
// ];
// }
// if (item.companyName === "威海海马地毯集团有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系1.pdf",
// },
// {
// filePath:
// "https://8.143.198.78/certify1/威海海马地毯集团有限公司-双体系2.pdf",
// },
// ];
// }
// if (item.companyName === "威海市金宇彩印有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify1/威海市金宇彩印有限公司-双体系1.jpg",
// },
// {
// filePath:
// "https://8.143.198.78/certify1/威海市金宇彩印有限公司-双体系2.jpg",
// },
// ];
// }
// }
// if (this.isCurCertifyIndex === 2) {
// if (item.companyName === "威海大庆特种材料制品有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify3/威海大庆特种材料制品有限公司-应急预案.pdf",
// },
// ];
// }
// if (item.companyName === "威海大宇电子有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify3/威海大宇电子有限公司-应急预案.jpg",
// },
// ];
// }
// if (item.companyName === "威海海马地毯集团有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify3/威海海马地毯集团有限公司-应急预案.pdf",
// },
// ];
// }
// if (item.companyName === "威海锦佳印刷有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify3/威海锦佳印刷有限公司-应急预案.jpg",
// },
// ];
// }
// if (item.companyName === "威海众恒医疗设备有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify3/威海众恒医疗设备有限公司-应急预案.jpg",
// },
// ];
// }
// }
// if (this.isCurCertifyIndex === 3) {
// if (item.companyName === "威海大庆特种材料制品有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify2/威海大庆特种材料制品有限公司-标准化.pdf",
// },
// ];
// }
// if (item.companyName === "威海大宇电子有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify2/威海大宇电子有限公司-标准化.jpg",
// },
// ];
// }
// if (item.companyName === "威海海马地毯集团有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify2/威海海马地毯集团有限公司-标准化.pdf",
// },
// ];
// }
// if (item.companyName === "威海锦佳印刷有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify2/威海锦佳印刷有限公司-标准化.jpg",
// },
// ];
// }
// if (item.companyName === "威海市金宇彩印有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify2/威海市金宇彩印有限公司-标准化.jpg",
// },
// ];
// }
// if (item.companyName === "威海众恒医疗设备有限公司") {
// this.certifies = [
// {
// filePath:
// "https://8.143.198.78/certify2/威海众恒医疗设备有限公司-标准化1.jpg",
// },
// {
// filePath:
// "https://8.143.198.78/certify2/威海众恒医疗设备有限公司-标准化2.jpg",
// },
// ];
// }
// }
return; return;
} }
const AMap = window.AMap || {}; const AMap = window.AMap || {};
......
<template> <template>
<div class="hwapproval-wrapper"> <div class="hwapproval-wrapper">
<div class="hwapproval-tools-wrapper"> <div class="hwapproval-tools-wrapper">
<el-select <!-- <el-select
v-model="searchEnter" v-model="searchEnter"
multiple multiple
filterable filterable
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
</el-select> </el-select> -->
<el-button type="success" @click="">查找</el-button> <el-input v-model="searchEnter" placeholder="请输入企业名称" style="width: 80%;"></el-input>
<el-button type="success" @click="clickToSearchEnter">查找</el-button>
</div> </div>
<div class="hwapproval-table-wrapper"> <div class="hwapproval-table-wrapper">
<el-table :data="approvalList" border> <el-table :data="approvalList" border>
...@@ -87,13 +88,13 @@ ...@@ -87,13 +88,13 @@
placeholder="选择日期时间" placeholder="选择日期时间"
/> />
</el-form-item> </el-form-item>
<el-form-item prop="uploadTime" label="上传时间"> <!-- <el-form-item prop="uploadTime" label="上传时间">
<el-date-picker <el-date-picker
v-model="addFormInfo.uploadTime" v-model="addFormInfo.uploadTime"
type="datetime" type="datetime"
placeholder="选择日期时间" placeholder="选择日期时间"
/> />
</el-form-item> </el-form-item> -->
<el-form-item prop="file" label="文件"> <el-form-item prop="file" label="文件">
<div> <div>
<label <label
...@@ -115,7 +116,8 @@ ...@@ -115,7 +116,8 @@
<script> <script>
import pdf from "vue-pdf"; import pdf from "vue-pdf";
import { dangerJobReportEnterprise } from "@/api/dangerjob.js"; import { dangerJobReportEnterprise, postDangerJobReport } from "@/api/dangerjob.js";
import { parseTime } from '../../utils';
export default { export default {
components: { components: {
pdf, pdf,
...@@ -173,13 +175,13 @@ export default { ...@@ -173,13 +175,13 @@ export default {
trigger: "change", trigger: "change",
}, },
], ],
uploadTime: [ // uploadTime: [
{ // {
required: true, // required: true,
message: "请选择上传时间", // message: "请选择上传时间",
trigger: "change", // trigger: "change",
}, // },
], // ],
file: [ file: [
{ {
required: true, required: true,
...@@ -220,8 +222,9 @@ export default { ...@@ -220,8 +222,9 @@ export default {
chooseFile() { chooseFile() {
this.addFormInfo.file = null; this.addFormInfo.file = null;
this.uploadFilePath = ""; this.uploadFilePath = "";
console.log(this.$refs.chosenfile.files, 'this.$refs.chosenfile.files this.$refs.chosenfile.files this.$refs.chosenfile.files')
if (this.$refs.chosenfile.files.length) { if (this.$refs.chosenfile.files.length) {
const filePath = this.$refs.chooseFile.files[0].name; const filePath = this.$refs.chosenfile.files[0].name;
if ( if (
!( !(
filePath.endsWith(".pdf") || filePath.endsWith(".pdf") ||
...@@ -234,7 +237,7 @@ export default { ...@@ -234,7 +237,7 @@ export default {
return; return;
} }
this.uploadFilePath = filePath; this.uploadFilePath = filePath;
this.addFormInfo.file = this.$refs.chooseFile.files[0]; this.addFormInfo.file = this.$refs.chosenfile.files[0];
} }
}, },
cancelHWapproval() { cancelHWapproval() {
...@@ -243,6 +246,21 @@ export default { ...@@ -243,6 +246,21 @@ export default {
submitHWapproval() { submitHWapproval() {
this.$refs.addform.validate((valid) => { this.$refs.addform.validate((valid) => {
if (valid) { if (valid) {
const formData = new FormData();
formData.append('companyId', this.addFormInfo.companyId);
formData.append('name', this.addFormInfo.name);
formData.append('file', this.addFormInfo.file);
formData.append('time', parseTime(this.workTime, '{y}-{m}-{d} {h}:{i}:{s}'))
postDangerJobReport(formData).then(res => {
console.log(res, 'postDanegrJobReport postDangerJobReport')
this.$message({
type: 'success',
message: '上传成功'
})
this.addDialogShow = false
}).catch(() => {
this.$message.error('上传失败')
})
} }
}); });
}, },
...@@ -258,6 +276,21 @@ export default { ...@@ -258,6 +276,21 @@ export default {
}, },
viewApproval(prow, childrow) {}, viewApproval(prow, childrow) {},
downloadApproval(prow, childrow) {}, downloadApproval(prow, childrow) {},
clickToSearchEnter() {
dangerJobReportEnterprise({
enterpriseName: this.searchEnter
}).then(res => {
this.approvalList = [
...res.content.map((item) => {
return {
companyName: item.enterpriseName,
companyId: item.enterpriseId,
};
}),
];
})
},
}, },
}; };
</script> </script>
......
...@@ -5,15 +5,6 @@ ...@@ -5,15 +5,6 @@
<h2>{{ companyName }}</h2> <h2>{{ companyName }}</h2>
<el-divider></el-divider> <el-divider></el-divider>
</div> </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-find-item">
<div class="hwapprovals-title">危险作业名称:</div> <div class="hwapprovals-title">危险作业名称:</div>
<div> <div>
...@@ -84,6 +75,35 @@ ...@@ -84,6 +75,35 @@
</el-table> </el-table>
</div> </div>
</div> </div>
<div
v-if="certifyShow && getFileType"
class="certify-item"
@click.stop=""
@mousewheel.stop.prevent=""
>
<div class="certify-inner-wrapper">
<div class="certify-innerw-wrapper" @mousewheel.stop="">
<pdf
v-for="i in pdfNumPage"
:key="i"
:page="i"
:src="loadingTask"
></pdf>
</div>
<div class="close-certify" @click="certifyShow = false"></div>
</div>
</div>
<div
v-if="certifyShow && !getFileType"
class="certify-item"
@click.stop=""
@mousewheel.stop.prevent=""
>
<div class="certify-inner-wrapper">
<img :src="curCertifyFilePath" class="certify-img" />
<div class="close-certify" @click="certifyShow = false"></div>
</div>
</div>
</div> </div>
</template> </template>
...@@ -97,6 +117,7 @@ export default { ...@@ -97,6 +117,7 @@ export default {
}, },
data() { data() {
return { return {
certifyShow: false,
hwapprovalsName: "", //企业名称 hwapprovalsName: "", //企业名称
dangerName: "", //危险作业名称 dangerName: "", //危险作业名称
uploadDate: "", //上传日期 uploadDate: "", //上传日期
...@@ -186,12 +207,14 @@ export default { ...@@ -186,12 +207,14 @@ export default {
}); });
}, },
viewHwapproval(row) { viewHwapproval(row) {
// this.certifyShow = true; this.certifyShow = true;
this.curHwapprovalFilePath = row.filePath; this.curHwapprovalFilePath = row.filePath;
const index1 = this.curHwapprovalFilePath.indexOf("\\"); const index1 = this.curHwapprovalFilePath.indexOf("\\");
const index2 = this.curHwapprovalFilePath.indexOf("\\", index1 + 1); const index2 = this.curHwapprovalFilePath.indexOf("\\", index1 + 1);
const index3 = this.curHwapprovalFilePath.indexOf("\\", index2 + 1); const index3 = this.curHwapprovalFilePath.indexOf("\\", index2 + 1);
this.curHwapprovalFilePath = this.curHwapprovalFilePath.substring(index3); this.curHwapprovalFilePath = this.curHwapprovalFilePath.substring(index3);
this.curCertifyFilePath = this.curHwapprovalFilePath
if (this.curHwapprovalFilePath.endsWith(".pdf")) { if (this.curHwapprovalFilePath.endsWith(".pdf")) {
// if (this.curHwapprovalFilePath.endsWith(".pdf")) { // if (this.curHwapprovalFilePath.endsWith(".pdf")) {
this.loadingTask = pdf.createLoadingTask(this.curHwapprovalFilePath); this.loadingTask = pdf.createLoadingTask(this.curHwapprovalFilePath);
...@@ -218,6 +241,14 @@ export default { ...@@ -218,6 +241,14 @@ export default {
window.URL.revokeObjectURL(link.href); window.URL.revokeObjectURL(link.href);
}, },
}, },
computed: {
getFileType() {
if (this.curCertifyFilePath.endsWith(".pdf")) {
return true;
}
return false;
},
},
mounted() { mounted() {
// console.log(this.$route.params.name); // console.log(this.$route.params.name);
this.companyId = this.$route.params.name.split("&")[0]; this.companyId = this.$route.params.name.split("&")[0];
...@@ -336,4 +367,49 @@ export default { ...@@ -336,4 +367,49 @@ export default {
background: #eee; background: #eee;
} }
} }
.certify-item {
display: block;
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 9999;
background: #808080;
.certify-inner-wrapper {
position: absolute;
width: 960px;
height: 620px;
left: 50%;
top: 50%;
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 {
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
<template>
<div class="train-image-wrapper">
<div class="train-image-tools-wrapper">
<el-input v-model="searchEntryName" style="width: 80%;" placeholder="请输入企业名称"></el-input>
<el-button type="primary" style="margin-left: 20px;" @click="searchEntry">查找</el-button>
</div>
<div class="train-image-list-wrapper">
<el-table
:data="enterList"
border
v-loading="isLoadingData"
>
<el-table-column
prop="name"
label="企业名称"
width="480"
></el-table-column>
<el-table-column
label="操作"
>
<template slot-scope="scope">
<el-button type="text" @click="enterDetail(scope.row)">详情</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="curPageSize"
layout="total, prev, pager, next, jumper"
:total="totalSize"
></el-pagination>
</div>
</div>
</template>
<script>
import { searchEnterprise } from '@/api/trainimage.js'
export default {
data() {
return {
searchEntryName: '',
enterList: [
{
name: '威海晶合数字矿山有限公司',
id: -1
},
{
name: '威海港盛船务有限公司',
id: -1
},
{
name: '山东港口威海港有限公司',
id: -1
},
{
name: '山东威海港国际客运有限公司',
id: -1
},
{
name: '威海兴茂置业有限公司'
}
],
currentPage: 1,
curPageSize: 10,
totalSize: 100,
isLoadingData: false
}
},
mounted() {
this.initData()
},
methods: {
initData() {
this.isLoadingData = true
const params = {
page: this.currentPage - 1,
size: this.curPageSize
}
if (this.searchEntryName) {
params.name = this.searchEntryName
}
searchEnterprise(params).then(res => {
this.enterList = [...res.content]
this.totalSize = res.totalElements
this.isLoadingData = false
}).catch(() => {
this.isLoadingData = false
})
},
enterDetail(row) {
console.log(row, 'enterDetail enterDetail enterDetail')
this.$router.push('/train/trainimage/trainimg/' + row.id)
},
handleSizeChange(val) {
this.curPageSize = val
this.initData()
},
handleCurrentChange(val) {
this.currentPage = val
this.initData()
},
searchEntry() {
this.initData()
}
}
}
</script>
<style lang="scss" scoped>
.train-image-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
box-shadow: 0 0 9px 1px #eee;
.train-image-tools-wrapper {
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
display: flex;
flex-direction: row;
justify-content: flex-start;
}
.train-image-list-wrapper {
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
display: flex;
flex-direction: column;
align-items: center;
}
}
</style>
<template>
<div class="trainimg-statistics-wrapper">
<div class="trainimg-statistics-tools-wrapper">
<div class="trainimg-statistics-tool">
<div class="trainimg-statistics-tool-title">行业-主管部门</div>
<div class="trainimg-statistics-tool-content">
<el-select
v-model="indus_manager"
placeholder="请选择行业-主管部门"
>
<el-option
v-for="item in industries"
:key="item.name"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</div>
</div>
<div class="trainimg-statistics-tool">
<div class="trainimg-statistics-tool-title">日期</div>
<div class="trainimg-statistics-tool-content">
<el-date-picker
v-model="trainDateTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</div>
<div class="trainimg-statistics-tool">
<div class="trainimg-statistics-tool-title">是否参加培训</div>
<div class="trainimg-statistics-tool-content">
<el-radio v-model="train" :label="true">参加培训</el-radio>
<el-radio v-model="train" :label="false">未参加培训</el-radio>
</div>
</div>
<div style="display: flex;flex-direction: row;justify-content: flex-end;padding: 10px;margin: 20px auto; width: 80%;">
<el-button type="primary" @click="findTrainImgStatistics">查找</el-button>
</div>
</div>
<div class="trainimg-statistics-table-wrapper">
<el-table
:data="tableData"
border
v-loading="isLoadingData"
>
<el-table-column
prop="enterpriseName"
label="企业名称"
></el-table-column>
<el-table-column
prop="peopleNum"
label="参与人数"
></el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="curPageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalElements">
</el-pagination>
</div>
<div class="trainimg-statistics-census-wrapper">
<div class="trainimg-statistics-census-item">参与培训企业总数量: <span class="fontColorStatistics">{{trainEnterpriseNum}}</span></div>
<div class="trainimg-statistics-census-item">总参与人次:<span class="fontColorStatistics">{{peopleNum}}</span></div>
<div class="trainimg-statistics-census-item">未参与培训的企业数量: <span class="fontColorStatistics">{{notTrainEnterpriseNum}}</span></div>
</div>
</div>
</template>
<script>
import { trainImageAnalyze1, trainImageAnalyze2, getThIndustryChargeDept, getAllIndustry } from '@/api/trainimage.js'
import { parseTime } from '@/utils/index.js'
export default {
data() {
return {
indus_manager: '',
trainDateTime: '',
startTime: '',
endTime: '',
industry: '',
manager: '',
train: false,
industries: [],
tableData: [],
currentPage: 1,
curPageSize: 10,
totalElements: 0,
// 未参与培训企业数量
notTrainEnterpriseNum: 0,
// 总参与人次
peopleNum: 0,
// 参与培训企业总数
trainEnterpriseNum: 0,
// 是否正在加载表格数据
isLoadingData: false
}
},
mounted() {
let params = {
page: 0,
size: 999
}
getAllIndustry(params).then(res => {
console.log(res, 'getAllIndustry getAllIndustry')
this.industries = [...res.content.map(item => {
return {
name: item.industryName + '-' + item.thIndustryChargeDept.icdName
}
})]
})
trainImageAnalyze2().then(res => {
this.notTrainEnterpriseNum = res.notTrainEnterpriseNum
this.peopleNum = res.peopleNum? res.peopleNum : 0
this.trainEnterpriseNum = res.trainEnterpriseNum
})
// console.log(this.$refs.statistics, 'this.$refs.statistics')
},
methods: {
handleSizeChange(val) {
this.curPageSize = val
},
handleCurrentChange(val) {
this.currentPage = val
},
findTrainImgStatistics() {
if (!(this.startTime || this.endTime)) {
this.$message.error('请选择日期范围')
return
}
if (!(this.industry || this.manager)) {
this.$message.error('请选择行业-主管部门')
return
}
let params = {
department: this.manager,
endtime: this.endTime,
industry: this.industry,
page: this.currentPage,
size: this.curPageSize,
startTime: this.startTime,
train: this.train
}
this.isLoadingData = true
trainImageAnalyze1(params).then(res => {
console.log(res ,'trainImageAnalyze1 trainImageAnalyze1')
this.totalElements = res.totalElements
this.tableData = [...res.content]
this.isLoadingData = false
}).catch(() => {
this.isLoadingData = false
})
}
},
watch: {
indus_manager(newVal, oldVal) {
/**
* industry: '',
manager: '',
*/
this.industry = newVal.split('-')[0]
this.manager = newVal.split('-')[1]
},
trainDateTime(newVal, oldVal) {
if (newVal instanceof Array) {
/**
* startTime: '',
* endTime: '',
*/
this.startTime = parseTime(newVal[0])
this.endTime = parseTime(newVal[1])
}
}
}
}
</script>
<style lang="scss" scoped>
.trainimg-statistics-wrapper {
width: 80%;
margin: 30px auto;
padding: 30px;
border-radius: 30px;
box-shadow: 0 0 9px 1px #eee;
}
.trainimg-statistics-tools-wrapper {
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
.trainimg-statistics-tool {
width: 80%;
margin: 20px auto;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding: 15px;
.trainimg-statistics-tool-title {
flex-basis: 30%;
flex-grow: 0;
flex-shrink: 0;
text-align: right;
margin-right: 13px;
}
.trainimg-statistics-tool-content {
flex-basis: 70%;
flex-grow: 0;
flex-shrink: 0;
}
}
}
.trainimg-statistics-table-wrapper {
width: 80%;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
margin: 30px auto;
}
.trainimg-statistics-census-wrapper {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 80%;
margin: 30px auto;
padding: 20px;
border-radius: 20px;
box-shadow: 0 0 9px 1px #eee;
.trainimg-statistics-census-item {
flex-basis: 33%;
.fontColorStatistics {
color: #090d9c;
}
}
}
</style>
<template>
<div class="trainimg-total-wrapper">
<el-table
:data="trainimgData"
border
v-loading="isLoadingData"
>
<el-table-column
prop="briefIntroduction"
label="培训简介"
></el-table-column>
<el-table-column
prop="location"
label="培训位置"
></el-table-column>
<el-table-column
prop="peopleNum"
label="培训人数"
></el-table-column>
<el-table-column
prop="time"
label="培训时间"
></el-table-column>
<el-table-column
prop="beforeImgPath"
label="培训前照片"
>
<template slot-scope="scope">
<el-image
style="width: 70px; height: 70px"
:src="scope.row.beforeImgPath"
:preview-src-list="[scope.row.beforeImgPath]">
</el-image>
</template>
</el-table-column>
<el-table-column
prop="trainingImgPath"
label="培训中照片"
>
<template slot-scope="scope">
<el-image
style="width: 70px; height: 70px"
:src="scope.row.trainingImgPath"
:preview-src-list="[scope.row.trainingImgPath]">
</el-image>
</template>
</el-table-column>
<el-table-column
prop="afterImgPath"
label="培训后照片"
>
<template slot-scope="scope">
<el-image
style="width: 70px; height: 70px"
:src="scope.row.afterImgPath"
:preview-src-list="[scope.row.afterImgPath]">
</el-image>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="curPageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalSize">
</el-pagination>
</div>
</template>
<script>
import { searchTrainImage } from '@/api/trainimage.js'
export default {
data() {
return {
companyId: '',
trainimgData: [
{
briefIntroduction: '',
location: '',
peopleNum: '',
time: '',
beforeImgPath: '',
trainingImgPath: '',
afterImgPath: ''
}
],
currentPage: 1,
curPageSize: 10,
totalSize: 100,
isLoadingData: false,
}
},
mounted() {
console.log(this.$route.params.name, 'this.$route.params.name this.$route.params.name')
this.companyId = this.$route.params.name
this.initData()
},
methods: {
handleSizeChange(val) {
this.curPageSize = val
this.initData()
},
handleCurrentChange(val) {
this.currentPage = val
this.initData()
},
initData() {
this.isLoadingData = true
let params = {
enterpriseId: this.companyId,
page: this.currentPage,
size: this.curPageSize,
sort: 'time,desc'
}
searchTrainImage(params).then(res => {
this.trainimgData = [...res.content.map(item => {
return {
briefIntroduction: item.briefIntroduction,
location: item.location,
peopleNum: item.peopleNum,
time: item.time,
beforeImgPath: item.beforeImgPath,
trainingImgPath: item.trainingImgPath,
afterImgPath: item.afterImgPath
}
})]
this.totalSize = res.totalElements
this.isLoadingData = false
}).catch(() => {
this.isLoadingData = false
})
}
}
}
</script>
<style lang="scss" scoped>
.trainimg-total-wrapper {
width: 80%;
padding: 30px;
border-radius: 30px;
margin: 30px auto;
box-shadow: 0 0 9px 1px #eee;
}
</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