<template>
|
<el-dialog
|
:visible.sync="dialogVisible"
|
append-to-body
|
:close-on-click-modal="false"
|
width="80%"
|
center
|
>
|
<div class="table_cont">
|
|
<el-table
|
v-loading="listLoading"
|
:key="tableKey"
|
:data="checkList"
|
border
|
fit
|
highlight-current-row
|
style="width: 100%;"
|
>
|
|
<el-table-column type="index" label="序号" align="center" width="80"/>
|
<el-table-column label="检查出的隐患问题" prop="hiddendangerRemark" align="center" width="180"></el-table-column>
|
<el-table-column label="检查时间" prop="checkTime" align="center"></el-table-column>
|
<el-table-column label="最后整改期限" prop="rectifyDeadlineTime" align="center"></el-table-column>
|
<el-table-column label="整改资金(元)" prop="rectifyPrice" align="center"></el-table-column>
|
<el-table-column label="整改措施" prop="rectifyMeasure" width="130" align="center" sortable></el-table-column>
|
<el-table-column label="负责人" prop="chargePerson" align="center"></el-table-column>
|
<el-table-column label="整改状态" prop="rectifyStatus" align="center">
|
<template slot-scope="scope">
|
<span>{{ scope.row.rectifyStatus ==1?'已整改':'未整改' }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="完成整改时间" prop="completeRectifyTime" align="center"></el-table-column>
|
<el-table-column label="隐患等级" prop="hiddendangerLevel" align="center">
|
<template slot-scope="scope">
|
<span>{{ scope.row.hiddendangerLevel==1 ? '一般隐患' : '重大隐患' }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
<template slot-scope="scope">
|
<span v-if="scope.row.rectifyStatus==1">已整改</span>
|
<el-button v-else type="text" @click="toFix(scope.row)">整改填报</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<el-pagination
|
v-show="recordTotal>0"
|
:current-page="currentPage"
|
:page-sizes="[10, 20, 30, 50]"
|
:page-size="pageSize"
|
:total="recordTotal"
|
layout="total, sizes, prev, pager, next, jumper"
|
background
|
style="float:right;margin:3px"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button type="primary" @click="confirm()">确认</el-button>
|
</span>
|
<el-dialog
|
:visible.sync="dialogFix"
|
title="整改填报"
|
append-to-body
|
:close-on-click-modal="false"
|
width="40%"
|
center
|
@close="resetFix()"
|
>
|
<el-form ref="fixForm" :model="fixForm" :rules="fixRule" label-width="160px">
|
<el-form-item label="当前隐患:">
|
<el-input type="textarea" readonly v-model="fixForm.info"></el-input>
|
</el-form-item>
|
|
<el-form-item label="当前完成整改日期:" prop="completeRectifyTime">
|
<el-date-picker
|
v-model="fixForm.completeRectifyTime"
|
type="datetime"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
placeholder="请选择整改日期">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item label="整改资金:" prop="rectifyPrice">
|
<el-input v-model="fixForm.rectifyPrice" type="number" placeholder="请输入整改资金金额"></el-input>
|
</el-form-item>
|
<el-form-item label="整改措施:" prop="rectifyMeasure">
|
<el-input type="textarea" autosize v-model="fixForm.rectifyMeasure" placeholder="请输入整改措施"></el-input>
|
</el-form-item>
|
<el-form-item label="负责人:" prop="chargePerson">
|
<el-input v-model="fixForm.chargePerson" placeholder="请输入整改负责人"></el-input>
|
</el-form-item>
|
</el-form>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogFix = false">取消</el-button>
|
<el-button type="primary" v-stop-re-click @click="confirmFix('fixForm')">提交</el-button>
|
</span>
|
</el-dialog>
|
</el-dialog>
|
|
</template>
|
|
<script>
|
import {computePageCount} from "@/utils";
|
import { getSelfRectifyInfo, saveSelfRectifyInfo } from "@/api/selfCheck";
|
|
export default {
|
name: "repair",
|
data(){
|
return{
|
id: null,
|
listLoading: false,
|
dialogFix: false,
|
recordTotal: 0,
|
pageSize: 10,
|
currentPage: 1,
|
tableKey: 0,
|
dialogVisible:false,
|
checkList:[],
|
fixForm:{
|
id: null,
|
enterpriseSubmitId: null,
|
info: '',
|
completeRectifyTime: '',
|
rectifyPrice: null,
|
rectifyMeasure: '',
|
chargePerson: ''
|
},
|
fixRule:{
|
completeRectifyTime: [{ required: true, message: '请选择完成整改日期', trigger: 'blur' }],
|
rectifyPrice: [{ required: true, message: '请输入整改资金', trigger: 'blur' }],
|
rectifyMeasure: [{ required: true, message: '请输入整改措施', trigger: 'blur' }],
|
chargePerson: [{ required: true, message: '请输入负责人', trigger: 'blur' }]
|
}
|
}
|
},
|
created() {
|
// this.getSelfRectifyInfo()
|
},
|
watch: {
|
},
|
methods:{
|
handleSizeChange: function (val) {
|
this.pageSize = val
|
this.currentPage = 1
|
// this.getDataList()
|
},
|
handleCurrentChange: function (val) {
|
this.currentPage = val
|
// this.getDataList()
|
},
|
|
async getSelfRectifyInfo(){
|
const t = this
|
t.listLoading = true
|
let res = await getSelfRectifyInfo({id: t.id})
|
if(res.data.code === "200"){
|
t.checkList = res.data.result.hiddendangerBaseInfos
|
}else{
|
t.$message({
|
type:'warning',
|
message:res.data.message
|
})
|
}
|
t.listLoading = false
|
},
|
|
confirm(){
|
this.dialogVisible = false
|
this.$parent.getUncheckList()
|
},
|
|
toFix(row){
|
const t= this
|
t.fixForm.info = row.hiddendangerRemark
|
t.fixForm.id = row.id
|
t.dialogFix = true
|
},
|
|
async confirmFix(formName){
|
const t = this
|
t.$refs[formName].validate(async (valid) => {
|
if(valid){
|
t.fixForm.enterpriseSubmitId = t.id
|
let {info,...data} = t.fixForm
|
let res = await saveSelfRectifyInfo(data)
|
if(res.data.code === "200"){
|
t.$message({
|
type:'success',
|
message: '提交成功'
|
})
|
}else{
|
t.$message({
|
type:'warning',
|
message:res.data.message
|
})
|
}
|
t.dialogFix = false
|
t.getSelfRectifyInfo()
|
} else {
|
console.log('error submit!!');
|
return false;
|
}
|
})
|
},
|
resetFix(){
|
this.fixForm = {
|
id: null,
|
enterpriseSubmitId: null,
|
info: '',
|
completeRectifyTime: '',
|
rectifyPrice: null,
|
rectifyMeasure: '',
|
chargePerson: ''
|
}
|
}
|
},
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.input-with-select .el-select {
|
width: 120px;
|
}
|
|
.el-date-editor.el-input{
|
width: 100%;
|
}
|
|
.el-divider__text{
|
background-color: #fafafa;
|
color: #034EA2;
|
}
|
|
.table_cont{
|
width: 100%;
|
}
|
</style>
|