| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- <el-row style="margin-bottom: 20px" v-if="addShow"> |
| | | <el-row style="margin-bottom: 20px"> |
| | | <el-col :span="9"> |
| | | <el-button type="primary" class="btns" @click="addDanger">新增隐患</el-button> |
| | | </el-col> |
| | | </el-row> --> |
| | | </el-row> |
| | | |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column type="index" width="55" align="center" label="序号"></el-table-column> |
| | |
| | | initYHLX, |
| | | initYwks |
| | | } from "@/api/sgyhpczl/initSelect"; |
| | | import {getPageList,initDangerRebound} from '@/api/sgyhpczl/hiddenDangerRegistration' |
| | | import {getPageList,initDangerRebound,saveDanger} from '@/api/sgyhpczl/hiddenDangerRegistration' |
| | | import {deepClone} from '@/utils' |
| | | |
| | | export default { |
| | |
| | | address: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | ht_content: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | ht_typesub: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | measure: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | DTRisk_bankId: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | ht_level: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | alter_time: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | |
| | | pageSize: 10, |
| | | recordTotal: 0, |
| | | detailTableData:[],//隐患详情列表 |
| | | beforeData:{}, //上个页面信息 |
| | | beforeFlag:true,//上个页面信息保存标志 |
| | | }; |
| | | }, |
| | | |
| | |
| | | initInfo(data){ |
| | | this.paramsData = this.$route.query.data; |
| | | this.ruleForm.jyfsId = data.id; |
| | | this.tableData[0] = { |
| | | address: data.address, |
| | | ht_content: data.ht_content, |
| | | ht_level: data.ht_level, |
| | | }; |
| | | this.dangerForm.address = data.address; |
| | | this.dangerForm.ht_content = data.ht_content; |
| | | // this.tableData[0] = { |
| | | // address: data.address, |
| | | // ht_content: data.ht_content, |
| | | // ht_level: data.ht_level, |
| | | // }; |
| | | }, |
| | | |
| | | // async initInfo(){ |
| | |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | if(this.title=='新增'){ |
| | | this.beforeFlag = false; |
| | | this.tableData.push(this.dangerForm) |
| | | console.log(this.tableData) |
| | | }else { |
| | | var arr = this.tableData; |
| | | arr.splice(this.rowIndex, 1, this.dangerForm); |
| | |
| | | }, |
| | | |
| | | addDanger(){ |
| | | this.dangerForm={} |
| | | if (!this.beforeFlag){ |
| | | this.dangerForm={} |
| | | } |
| | | this.title="新增" |
| | | this.dialogVisible=true |
| | | }, |
| | |
| | | }, |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | |
| | | if (valid) { |
| | | this.ruleForm.items=this.tableData |
| | | if(this.judge(this.tableData[0])){ |
| | | this.$message({type:'error', message:"请完整录入隐患", duration:2000}) |
| | | } |
| | | // if(this.addShow){ |
| | | console.log(this.ruleForm) |
| | | saveDanger(this.ruleForm).then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.$message({type:'success', message:"保存成功", duration:3000}) |
| | | this.$router.push({ |
| | | path:"/oneFromanother" |
| | | }) |
| | | }else { |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | console.log(this.ruleForm) |
| | | saveDanger(this.ruleForm).then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.$message({type:'success', message:"保存成功", duration:3000}) |
| | | this.$router.push({ |
| | | path:"/oneFromanother" |
| | | }) |
| | | }else { |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | // }else { |
| | | // var param=deepClone(this.ruleForm) |
| | | // var obj=deepClone(this.tableData[0]) |
| | | // param.ht_branch=obj.ht_branch |
| | | // param.address=obj.address |
| | | // param.ht_content=obj.ht_content |
| | | // param.measure=obj.measure |
| | | // param.ht_typesub=obj.ht_typesub |
| | | // param.DTRisk_bankId=obj.DTRisk_bankId |
| | | // param.DTRisk_level=obj.mriskLevel |
| | | // param.dangerousSource=obj.mriskPoint |
| | | // param.ht_level=obj.ht_level |
| | | // param.alter_time=obj.alter_time |
| | | // param.duty_officer=obj.duty_officer |
| | | // param.alter_status=obj.alter_status |
| | | // param.Review=obj.Review |
| | | // param.repeatId=obj.repeatId |
| | | // editDanger(param).then(res=>{ |
| | | // if (res.data.ok==1){ |
| | | // this.$message({type:'success', message:"编辑成功", duration:3000}) |
| | | // this.$router.push({ |
| | | // path:"/hiddenDangerRegistration" |
| | | // }) |
| | | // }else { |
| | | // this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | // } |
| | | // }) |
| | | // var param=deepClone(this.ruleForm) |
| | | // var obj=deepClone(this.tableData[0]) |
| | | // param.ht_branch=obj.ht_branch |
| | | // param.address=obj.address |
| | | // param.ht_content=obj.ht_content |
| | | // param.measure=obj.measure |
| | | // param.ht_typesub=obj.ht_typesub |
| | | // param.DTRisk_bankId=obj.DTRisk_bankId |
| | | // param.DTRisk_level=obj.mriskLevel |
| | | // param.dangerousSource=obj.mriskPoint |
| | | // param.ht_level=obj.ht_level |
| | | // param.alter_time=obj.alter_time |
| | | // param.duty_officer=obj.duty_officer |
| | | // param.alter_status=obj.alter_status |
| | | // param.Review=obj.Review |
| | | // param.repeatId=obj.repeatId |
| | | // editDanger(param).then(res=>{ |
| | | // if (res.data.ok==1){ |
| | | // this.$message({type:'success', message:"编辑成功", duration:3000}) |
| | | // this.$router.push({ |
| | | // path:"/hiddenDangerRegistration" |
| | | // }) |
| | | // }else { |
| | | // this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | |