Merge remote-tracking branch 'origin/pet' into pet

pet
huangyuxuan 2024-10-23 14:45:15 +08:00
commit 80a3a92e7d
12 changed files with 253 additions and 32 deletions

View File

@ -20,6 +20,9 @@
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset"> <el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置 重置
</el-button> </el-button>
<el-button v-waves class="filter-item" type="info" icon="el-icon-download" @click="exportExcel">
导出
</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -34,10 +37,13 @@
'color': '#000' 'color': '#000'
}" }"
tooltip-effect="dark" tooltip-effect="dark"
highlight-current-row
border border
fit fit
highlight-current-row @current-change="handleCurrentChange"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="40"/>
<el-table-column type="index" label="序号" width="50" align="center" /> <el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="CORP_NAME" label="公司名称" show-overflow-tooltip /> <el-table-column prop="CORP_NAME" label="公司名称" show-overflow-tooltip />
<!-- <el-table-column prop="STARTTIME" label="属地" show-overflow-tooltip> <!-- <el-table-column prop="STARTTIME" label="属地" show-overflow-tooltip>
@ -89,7 +95,8 @@
<script> <script>
import Pagination from '@/components/Pagination' // el-pagination import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive import waves from '@/directive/waves'
import axios from 'axios'
export default { export default {
name: 'IndexVue', name: 'IndexVue',
components: { Pagination }, components: { Pagination },
@ -115,7 +122,10 @@ export default {
total: 0, total: 0,
OUTSOURCED_NAME: '', OUTSOURCED_NAME: '',
CORP_NAME: '', CORP_NAME: '',
varList: [] varList: [],
row: null,
/** 当前选中行 */
multipleSelection: []
} }
}, },
created() { created() {
@ -155,6 +165,69 @@ export default {
goDetail(ID) { goDetail(ID) {
this.$parent.CORPINFO_ID = ID this.$parent.CORPINFO_ID = ID
this.$parent.activeName = this.activeName this.$parent.activeName = this.activeName
},
handleCurrentChange(row) {
this.row = row
},
/**
* 表格行选择器处理
*/
handleSelectionChange(val) {
console.log('表格行选择器处理')
this.multipleSelection = val
},
exportExcel() {
const selectedRows = this.multipleSelection
//
if (selectedRows === [] || selectedRows.length === 0) {
this.$message.warning('请选择要导出的公司')
return
}
this.$confirm('确定要下载' + selectedRows[0].CORP_NAME + '等的检查数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = false
const loading = this.$loading({
lock: true,
text: '加载中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
let ids = ''
selectedRows.forEach(row => {
ids += row.CORPINFO_ID + ','
})
axios.get(config.httpurl + '/keyprojectcheck/export/excel/' + ids, {
responseType: 'blob'
}).then(res => {
setTimeout(() => {
const blob = new Blob([res.data], { type: res.headers['content-type'] })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
downloadElement.style.display = 'none'
downloadElement.href = href
downloadElement.download = '导出数据'
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href)
this.$emit('getResult', '')
loading.close()
this.close()
}, 2000)
}).catch((e) => {
console.log(e)
loading.close()
this.$message.error('导出失败,或未查询到隐患')
})
}).catch(() => {
this.listLoading = false
})
} }
} }
} }

View File

@ -91,7 +91,7 @@
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import waves from '@/directive/waves' import waves from '@/directive/waves'
import formatDate from '../../../../utils/dateformat' import formatDate from '../../../../utils/dateformat'
import { requestFN } from '../../../../utils/request' import { requestFN } from '@/utils/request'
export default { export default {
components: { Pagination }, components: { Pagination },

View File

@ -19,6 +19,20 @@
<el-input v-model="searchForm.KEYWORDS" placeholder="请输入关键字"/> <el-input v-model="searchForm.KEYWORDS" placeholder="请输入关键字"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5">
<el-form-item label="考评时间" prop="incidentDates">
<el-date-picker
v-model="searchForm.incidentDates"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd"
style="width: 100%"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期" />
</el-form-item>
</el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label-width="10px"> <el-form-item label-width="10px">
<el-button v-waves type="primary" icon="el-icon-search" @click="getList"> <el-button v-waves type="primary" icon="el-icon-search" @click="getList">
@ -101,6 +115,9 @@ export default {
searchForm: { searchForm: {
KEYWORDS: '', KEYWORDS: '',
TYPE: '', TYPE: '',
incidentDates: [],
START_TIME: '',
END_TIME: '',
DEPARTMENT_ID: null DEPARTMENT_ID: null
} }
} }
@ -129,6 +146,11 @@ export default {
// //
getList() { getList() {
this.listLoading = true this.listLoading = true
const dates = this.searchForm.incidentDates
if (dates != null && dates.length === 2) {
this.searchForm.START_TIME = dates[0]
this.searchForm.END_TIME = dates[1]
}
requestFN( requestFN(
'/keyProject/evaluationscore/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page, '/keyProject/evaluationscore/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ {

View File

@ -67,12 +67,8 @@
border border
fit fit
highlight-current-row highlight-current-row
> >
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" /> <el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="OUTSOURCED_NAME" label="重点工程名称" show-overflow-tooltip> <el-table-column prop="OUTSOURCED_NAME" label="重点工程名称" show-overflow-tooltip>
<template slot-scope="{row}"> <template slot-scope="{row}">
@ -105,9 +101,12 @@
{{ row.ISPUNISH === "1" ? "是" : row.ISPUNISH === "2" ?"否":"处罚人未处理" }} {{ row.ISPUNISH === "1" ? "是" : row.ISPUNISH === "2" ?"否":"处罚人未处理" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作" align="center" width="170">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button type="success" icon="el-icon-view" size="mini" @click="goDetail(row.HIDDEN_ID)"></el-button> <div style="display: flex; justify-content: space-between;">
<el-button type="success" icon="el-icon-view" size="mini" @click="goDetail(row.HIDDEN_ID)"></el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleBatchDel(row.HIDDEN_ID)"></el-button>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -226,6 +225,33 @@ export default {
goDetail(ID) { goDetail(ID) {
this.$parent.HIDDEN_ID = ID this.$parent.HIDDEN_ID = ID
this.$parent.activeName = 'Info' this.$parent.activeName = 'Info'
},
/**
* 删除
*/
handleBatchDel(HIDDEN_ID) {
//
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
const url = '/keyprojectcheck/delete/hidden/id/' + HIDDEN_ID
requestFN(url).then((response) => {
//
this.$message.success('删除成功')
this.getList()
// eslint-disable-next-line handle-callback-err
}).catch(() => {
this.$message.error('删除失败')
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
} }
} }
} }

View File

@ -9,18 +9,28 @@
<!-- <el-input v-model="KEYWORDS" placeholder="搜索关键字" />--> <!-- <el-input v-model="KEYWORDS" placeholder="搜索关键字" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="5"> <el-col :span="4">
<el-form-item label="重点工程名称"> <el-form-item label="重点工程名称">
<el-input v-model="KEYWORDS" placeholder="搜索重点工程名称" /> <el-input v-model="KEYWORDS" placeholder="搜索重点工程名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="4">
<el-form-item label="状态" label-width="50px"> <el-form-item label="状态" label-width="50px">
<el-select ref="SELECT_STATE" v-model="STATE" style="width: 100%;"> <el-select ref="SELECT_STATE" v-model="STATE" style="width: 100%;">
<el-option v-for="item in stateList" :key="item.ID" :label="item.NAME" :value="item.ID" /> <el-option v-for="item in stateList" :key="item.ID" :label="item.NAME" :value="item.ID" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4">
<el-form-item label="负责人姓名">
<el-input v-model="UNITS_PIC_NAME" placeholder="搜索负责人姓名" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="负责人手机号">
<el-input v-model="UNITS_PHONE" placeholder="搜索负责人手机号" />
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="10px"> <el-form-item label-width="10px">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery"> <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
@ -93,6 +103,8 @@ export default {
}, },
STATE: '', STATE: '',
total: 0, total: 0,
UNITS_PIC_NAME: '',
UNITS_PHONE: '',
KEYWORDS: '', KEYWORDS: '',
OUTSOURCED_NAME: '', OUTSOURCED_NAME: '',
stateList: [ stateList: [
@ -125,6 +137,8 @@ export default {
this.KEYWORDS = '' this.KEYWORDS = ''
this.STATE = '' this.STATE = ''
this.OUTSOURCED_NAME = '' this.OUTSOURCED_NAME = ''
this.UNITS_PIC_NAME = ''
this.UNITS_PHONE = ''
this.getQuery() this.getQuery()
}, },
// //
@ -134,6 +148,8 @@ export default {
'/outsourced/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page, '/outsourced/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ {
KEYWORDS: this.KEYWORDS, KEYWORDS: this.KEYWORDS,
UNITS_PIC_NAME: this.UNITS_PIC_NAME,
UNITS_PHONE: this.UNITS_PHONE,
CORPINFO_ID: this.$parent.CORPINFO_ID, CORPINFO_ID: this.$parent.CORPINFO_ID,
STATE: this.STATE STATE: this.STATE
} }

View File

@ -1,6 +1,8 @@
<template> <template>
<div> <div>
<component :is="activeName"/> <keep-alive exclude="meteorologicalList,meteorologicalHistory">
<component :is="activeName"/>
</keep-alive>
</div> </div>
</template> </template>
@ -13,13 +15,14 @@ export default {
components: { components: {
List: List, List: List,
meteorologicalList: meteorologicalList, meteorologicalList: meteorologicalList,
meteorologicalHistory: meteorologicalHistory, meteorologicalHistory: meteorologicalHistory
}, },
data() { data() {
return { return {
activeName: 'List', activeName: 'List',
CORPINFO_ID: '', CORPINFO_ID: '',
CODE: '' CODE: '',
KEYWORDS: ''
} }
} }
} }

View File

@ -1,6 +1,8 @@
<template> <template>
<div> <div>
<component :is="activeName"/> <keep-alive exclude="meteorologicalinfoList">
<component :is="activeName"/>
</keep-alive>
</div> </div>
</template> </template>

View File

@ -1,5 +1,7 @@
<template> <template>
<component :is="activeName" /> <keep-alive exclude="CorpUserList,CorpUserDetail">
<component :is="activeName" />
</keep-alive>
</template> </template>
<script> <script>

View File

@ -220,10 +220,11 @@ export default {
} }
}, },
created() { created() {
// this.ROLE_ID console.log(this.$data)
this.getList() this.getList()
this.getDict() this.getDict()
this.getTreeList() this.getTreeList()
// this.ROLE_ID
}, },
methods: { methods: {
onChange(value) { onChange(value) {

View File

@ -5,9 +5,9 @@
<el-form-item label="检查人意见" prop="INSPECTION_USER_OPINION"> <el-form-item label="检查人意见" prop="INSPECTION_USER_OPINION">
<el-input v-model="form.INSPECTION_USER_OPINION" :autosize="{ minRows: 1}" type="textarea" maxlength="2000" placeholder="这里输入检查人意见(有异议时必填)..." title="检查人意见(有异议时必填)"/> <el-input v-model="form.INSPECTION_USER_OPINION" :autosize="{ minRows: 1}" type="textarea" maxlength="2000" placeholder="这里输入检查人意见(有异议时必填)..." title="检查人意见(有异议时必填)"/>
</el-form-item> </el-form-item>
<el-form-item label="检查人"> <!-- <el-form-item label="检查人">-->
<el-button data-target="Modal" type="primary" @click="showModal"></el-button> <!-- <el-button data-target="Modal" type="primary" @click="showModal"></el-button>-->
</el-form-item> <!-- </el-form-item>-->
<div v-show="form.INSPECTION_USER_SIGN_IMG != ''" class="demo-image__preview"> <div v-show="form.INSPECTION_USER_SIGN_IMG != ''" class="demo-image__preview">
<el-image <el-image
:src="form.INSPECTION_USER_SIGN_IMG" :src="form.INSPECTION_USER_SIGN_IMG"
@ -112,10 +112,10 @@ export default {
if (!this.form.INSPECTION_USER_OPINION) { if (!this.form.INSPECTION_USER_OPINION) {
this.$message.error('您还未填写意见') this.$message.error('您还未填写意见')
} }
if (!this.form.INSPECTION_USER_SIGN_IMG) { // if (!this.form.INSPECTION_USER_SIGN_IMG) {
this.$message.error('您还未签字') // this.$message.error('')
return // return
} // }
this.$emit('getProposal', this.form) this.$emit('getProposal', this.form)
this.dialogVisible = false this.dialogVisible = false
}, },

View File

@ -56,7 +56,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="检查状态"> <el-form-item label="检查状态">
<el-select v-model="search.INSPECTION_STATUS" placeholder="隐患状态" clearable style="width: 100%"> <el-select v-model="search.INSPECTION_STATUS" placeholder="请选择" clearable style="width: 100%">
<el-option v-for="item in statusList" :key="item.ID" :label="item.NAME" :value="item.ID" /> <el-option v-for="item in statusList" :key="item.ID" :label="item.NAME" :value="item.ID" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -73,14 +73,19 @@
<el-input v-model="search.INSPECTION_CASE" placeholder="检查情况" /> <el-input v-model="search.INSPECTION_CASE" placeholder="检查情况" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> </el-row>
<el-form-item label-width="10px"> <el-row>
<el-col>
<el-form-item label-width="20px">
<el-button v-waves type="primary" icon="el-icon-search" @click="getQuery"> <el-button v-waves type="primary" icon="el-icon-search" @click="getQuery">
搜索 搜索
</el-button> </el-button>
<el-button v-waves type="success" icon="el-icon-refresh" @click="goKeyReset"> <el-button v-waves type="success" icon="el-icon-refresh" @click="goKeyReset">
重置 重置
</el-button> </el-button>
<el-button v-waves class="filter-item" type="info" icon="el-icon-download" @click="exportExcel">
导出
</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -230,6 +235,7 @@ import waves from '@/directive/waves' // waves directive
import WriteSign from '@/components/WriteSign' import WriteSign from '@/components/WriteSign'
import safetyFlowChart from '../../../hiddenUtil/safetyFlowChart' import safetyFlowChart from '../../../hiddenUtil/safetyFlowChart'
import SelectTree from '@/components/SelectTree' import SelectTree from '@/components/SelectTree'
import axios from 'axios'
export default { export default {
components: { Pagination, WriteSign, safetyFlowChart, SelectTree }, components: { Pagination, WriteSign, safetyFlowChart, SelectTree },
directives: { waves }, directives: { waves },
@ -258,10 +264,10 @@ export default {
INSPECTION_TIME: ['', ''], // INSPECTION_TIME: ['', ''], //
INSPECTION_STATUS: '', // INSPECTION_STATUS: '', //
INSPECTION_SUBJECT: '', // INSPECTION_SUBJECT: '', //
INSPECTION_CASE:'' // INSPECTION_CASE: '' //
}, },
statusList: [ statusList: [
{ ID: '', NAME: '请选择' }, // { ID: '', NAME: '' },
{ ID: '0', NAME: '待检查人核实' }, { ID: '0', NAME: '待检查人核实' },
{ ID: '1', NAME: '检查人核实中' }, { ID: '1', NAME: '检查人核实中' },
{ ID: '2', NAME: '待被检查人确认' }, { ID: '2', NAME: '待被检查人确认' },
@ -557,6 +563,74 @@ export default {
INSPECTION_ORIGINATOR_SIGN_IMG: '' // INSPECTION_ORIGINATOR_SIGN_IMG: '' //
// INSPECTION_ORIGINATOR_SIGN_TIME: '', // // INSPECTION_ORIGINATOR_SIGN_TIME: '', //
} }
},
exportExcel() {
this.$confirm('确定要下载检查记录吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: '加载中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.search.INSPECTION_TYPE = this.search.INSPECTION_TYPE == null ? '' : this.search.INSPECTION_TYPE
const object = {
...this.search,
INSPECTION_TIME_START: this.search.INSPECTION_TIME[0],
INSPECTION_TIME_END: this.search.INSPECTION_TIME[1]
}
const formData = new FormData()
Object.keys({
...this.search,
INSPECTION_TIME_START: this.search.INSPECTION_TIME[0],
INSPECTION_TIME_END: this.search.INSPECTION_TIME[1]
}).forEach(key => {
const value = object[key]
if (Array.isArray(value)) {
value.forEach((subValue, i) => {
formData.append(key + `[${i}]`, subValue)
})
} else {
formData.append(key, object[key])
}
})
console.log(formData)
axios({
url: config.httpurl + 'safetyenvironmental/export/excel',
method: 'post',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
data: formData
}).then(res => {
console.log('+++++++++++++++++++++++++++++')
const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
downloadElement.style.display = 'none'
downloadElement.href = href
downloadElement.download = '检查记录'
// DOM
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)
window.URL.revokeObjectURL(href)
loading.close()
}).catch((e) => {
console.error(e)
loading.close()
if (e.response && e.response.status === 404) {
this.$message.error('未查询到数据')
} else {
this.$message.error('导出失败,请稍后再试')
}
})
}).catch(() => {
this.$message.warning('取消导出')
})
} }
} }
} }

View File

@ -1,5 +1,7 @@
<template> <template>
<component :is="activeName" /> <keep-alive exclude="CorpUserList">
<component :is="activeName" />
</keep-alive>
</template> </template>
<script> <script>