| | |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row style="margin-bottom: 20px"> |
| | | <el-row style="margin-bottom: 20px" v-if="addShow"> |
| | | <el-col :span="9"> |
| | | <el-button type="primary" class="btns" @click="addDanger">新增隐患</el-button> |
| | | </el-col> |
| | |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | v-if="addShow" |
| | | @click="deleteDanger(scope.row, scope.$index)" |
| | | >删除 |
| | | </el-button> |
| | |
| | | <el-button type="primary" class="btns" @click="submitForm('ruleForm')" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="close()">关闭</el-button> |
| | | <el-button @click="returnIndex">关闭</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | import Titlename from "../../components/Titlename/index.vue"; |
| | | |
| | | import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr,initReformStatus,initYwks,initWxy} from "@/api/sgyhpczl/initSelect"; |
| | | import {saveDanger,initDangerRebound} from '@/api/sgyhpczl/hiddenDangerRegistration' |
| | | import {saveDanger,initDangerRebound,getDangerInfo,editDanger} from '@/api/sgyhpczl/hiddenDangerRegistration' |
| | | import {deepClone} from '@/utils' |
| | | |
| | | export default { |
| | |
| | | name: "hiddenDangerList", |
| | | data() { |
| | | return { |
| | | addShow:true, |
| | | id:'', |
| | | rowIndex:-1, |
| | | dangerList:[], |
| | | dangerForm:{}, |
| | |
| | | this.initYWKS() |
| | | this.initWXY() |
| | | this.initDangerRebound() |
| | | this.id = this.$route.query.id; |
| | | if( this.id!=null && this.id!=''){ |
| | | this.initInfo(); |
| | | this.addShow=false |
| | | } |
| | | }, |
| | | methods: { |
| | | async initInfo(){ |
| | | var res=await getDangerInfo(this.id) |
| | | if (res.data.ok==1){ |
| | | this.ruleForm=res.data.data |
| | | this.changeJCDW(res.data.data.check_main_branch) |
| | | var obj=deepClone(res.data.data) |
| | | this.tableData.push(obj) |
| | | |
| | | } |
| | | }, |
| | | initDangerRebound(){ |
| | | initDangerRebound().then(res=>{ |
| | | if (res.data.ok==1){ |
| | |
| | | }, |
| | | |
| | | |
| | | |
| | | returnIndex(){ |
| | | this.$router.push({ |
| | | path:"/hiddenDangerRegistration" |
| | | }) |
| | | }, |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | |
| | | this.$message({type:'error', message:"请添加隐患", duration:2000}) |
| | | } |
| | | this.ruleForm.items=this.tableData |
| | | saveDanger(this.ruleForm).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}) |
| | | } |
| | | }) |
| | | if(this.addShow){ |
| | | saveDanger(this.ruleForm).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}) |
| | | } |
| | | }) |
| | | }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}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | } else { |
| | | console.log("error submit!!"); |