| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style=""> |
| | | <Titlename title="录入隐患单页面"></Titlename> |
| | | <Titlename title="录入举一反三页面"></Titlename> |
| | | <div class="whole-form"> |
| | | <el-form |
| | | :model="ruleForm" |
| | |
| | | ref="ruleForm" |
| | | label-width="150px" |
| | | class="demo-ruleForm" |
| | | style="margin: 0 14% 0 16%" |
| | | > |
| | | style="margin: 0 14% 0 16%"> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | | <el-form-item label="检查时间" prop="check_date"> |
| | |
| | | type="date" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="选择日期" |
| | | style="width: 100%" |
| | | > |
| | | style="width: 100%"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-row> |
| | | <el-col :span="9" > |
| | | <el-form-item label="检查单位" prop="check_main_branch"> |
| | | <el-select v-model="ruleForm.check_main_branch" placeholder="请选择" @change="changeJCDW" style="width: 100%"> |
| | | <el-option |
| | | v-for="item in JCDWList" |
| | | :key="item.label" |
| | | :label="item.label" |
| | | :value="item.label" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-model="ruleForm.check_main_branch" style="width:100%"></el-input> |
| | | <!-- <el-select v-model="ruleForm.check_main_branch" placeholder="请选择" @change="changeJCDW" style="width: 100%">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in JCDWList"--> |
| | | <!-- :key="item.label"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.label"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="9"> |
| | | <el-form-item label="检查人员" prop="check_man"> |
| | | <el-input v-model="ruleForm.check_man"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="9" :offset="4"> |
| | | <el-form-item label="陪检人员" prop="acc_man"> |
| | | <el-input v-model="ruleForm.acc_man"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> --> |
| | | |
| | | |
| | | <!-- <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item label="行走路线"> |
| | | <el-input v-model="ruleForm.route" rows="3" type="textarea" class="multiline"></el-input> |
| | | </el-form-item> |
| | | </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-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> |
| | | <!-- <el-table-column prop="ht_branch" align="center" label="隐患部门"></el-table-column> --> |
| | | <el-table-column prop="address" align="center" label="隐患地点"></el-table-column> |
| | | <el-table-column prop="ht_content" align="center" label="隐患内容"></el-table-column> |
| | | <!-- <el-table-column prop="measure" align="center" label="整改措施"></el-table-column> --> |
| | | <el-table-column prop="ht_typesub" align="center" label="隐患类别"></el-table-column> |
| | | <!-- <el-table-column prop="dangerousSource" align="center" label="关联危险源"></el-table-column> |
| | | <el-table-column prop="DTRisk_level" align="center" label="风险等级"></el-table-column> --> |
| | | <el-table-column prop="ht_level" align="center" label="隐患级别"></el-table-column> |
| | | <!-- <el-table-column prop="alter_time" align="center" label="限改时间"></el-table-column> |
| | | <el-table-column prop="duty_officer" align="center" label="责任人"></el-table-column> |
| | | <el-table-column prop="alter_status" align="center" label="整改情况"></el-table-column> |
| | | <el-table-column prop="Review" align="center" label="业务科室"></el-table-column> --> |
| | | <el-table-column prop="time" label="操作" align="center" width="140"> |
| | | <template slot-scope="scope"> |
| | | <div style="display: flex;align-items: center;flex-direction: row;"> |
| | | <el-button |
| | | size="mini" |
| | | @click="editDanger(scope.row, scope.$index)" |
| | | >添加 |
| | | <el-button size="mini" @click="editDanger(scope.row, scope.$index)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | v-if="addShow" |
| | | @click="deleteDanger(scope.row, scope.$index)" |
| | | >删除 |
| | | <el-button size="mini" @click="deleteDanger(scope.row, scope.$index)"> |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | |
| | | <el-row style="margin-top: 20px"> |
| | | <el-col :span="22"> |
| | | <el-form-item style="text-align: center"> |
| | | <el-button type="primary" class="btns" @click="submitForm('ruleForm')" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="returnIndex">关闭</el-button> |
| | | <el-button type="primary" class="btns" @click="submitForm('ruleForm')"> |
| | | 保存 |
| | | </el-button> |
| | | <el-button @click="closeShow">关闭</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-input v-model="dangerForm.address" rows="3" type="textarea" class="multiline"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="9" offset="4"> |
| | | <el-col :span="9" :offset="4"> |
| | | <el-form-item label="隐患内容" prop="ht_content"> |
| | | <el-input v-model="dangerForm.ht_content" rows="3" type="textarea" class="multiline"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | |
| | | |
| | | <el-col :span="9"> |
| | | <el-form-item label="隐患类别" prop="ht_typesub"> |
| | | <el-select v-model="dangerForm.ht_typesub" placeholder="请选择"> |
| | |
| | | <el-row> |
| | | <el-col :span="22"> |
| | | <el-form-item style="text-align: center"> |
| | | <el-button type="primary" class="btns" @click="submitDanger('form')" |
| | | >保存</el-button |
| | | > |
| | | <el-button type="primary" class="btns" @click="submitDanger('form')"> |
| | | 保存 |
| | | </el-button> |
| | | <el-button @click="dialogVisible=false">关闭</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <script> |
| | | import Titlename from "../../components/Titlename/index.vue"; |
| | | |
| | | import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr,initReformStatus,initYwks,initWxy} from "@/api/sgyhpczl/initSelect"; |
| | | import {initJCBM ,initYHLX,initJCLB,initYHJB,initReformStatus} from "@/api/sgyhpczl/initSelect"; |
| | | import {saveDanger,initDangerRebound,getDangerInfo,editDanger} from '@/api/sgyhpczl/hiddenDangerRegistration' |
| | | import { save } from '@/api/sgyhpczl/oneFromanotherN' |
| | | |
| | | import {deepClone} from '@/utils' |
| | | |
| | | export default { |
| | |
| | | name: "hiddenDangerList", |
| | | data() { |
| | | return { |
| | | addShow:true, |
| | | id:'', |
| | | rowIndex:-1, |
| | | dangerList:[], |
| | | dangerForm:{}, |
| | | dangerRules:{ |
| | | ht_branch: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | address: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | ht_content: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | ht_typesub: [{ 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' },], |
| | | alter_status: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | Review: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | duty_officer:[{ required: true, message: '不能为空', trigger: 'blur' },] |
| | | }, |
| | | title:'新增', |
| | | dialogVisible:false, |
| | | BCList:[], |
| | | JCLBList:[], |
| | | JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}], |
| | | YHBMList:[], |
| | | YHLXList:[], |
| | | YHJBList:[], |
| | | JCBMList:[], |
| | | llrList:[], |
| | | statusList:[], |
| | | YWKSList:[], |
| | | reboundList:[], |
| | | ruleForm: {}, |
| | | rules: { |
| | | ruleForm: {}, |
| | | rules: { |
| | | check_date: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | check_class: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | check_main_branch: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | check_branch: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | check_man: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | check_main_branch: [{ required: true, message: '不能为空', trigger: 'change' },], |
| | | checktype: [{ required: true, message: '不能为空', trigger: 'blur' },], |
| | | }, |
| | | tableData: [], |
| | | }, |
| | | tableData: [], |
| | | }; |
| | | }, |
| | | mounted(){ |
| | | this.initBC() |
| | | this.initJCLB() |
| | | this.initYHJB() |
| | | this.initYHLX() |
| | | //this.initLlr() |
| | | this.initReformStatus() |
| | | this.initYHBM() |
| | | 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){ |
| | | this.reboundList=res.data.data |
| | | } else{ |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | }, |
| | | submitDanger(formName){ |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | |
| | | }); |
| | | }, |
| | | deleteDanger(row, index) { |
| | | |
| | | |
| | | this.$confirm('确认删除吗', '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | |
| | | } |
| | | } |
| | | }, |
| | | initWXY(){ |
| | | var param={ |
| | | page: 1, |
| | | limit: 1000 |
| | | } |
| | | initWxy(param).then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.dangerList=res.data.data.items |
| | | } else{ |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | }, |
| | | initYWKS(){ |
| | | initYwks().then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.YWKSList=res.data.data |
| | | } else{ |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | }, |
| | | initYHBM(){ |
| | | initYHBM().then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.YHBMList=res.data.data |
| | | } else{ |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | }, |
| | | initLlr(){ |
| | | initLlr().then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.llrList=res.data.data |
| | | } else{ |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | }, |
| | | initReformStatus(){ |
| | | initReformStatus().then(res=>{ |
| | | if (res.data.ok==1){ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | initBC(){ |
| | | initBC().then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.BCList=res.data.data |
| | | } else{ |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | }, |
| | | initJCLB(){ |
| | | initJCLB().then(res=>{ |
| | | if (res.data.ok==1){ |
| | |
| | | }) |
| | | }, |
| | | |
| | | |
| | | returnIndex(){ |
| | | closeShow(){ |
| | | this.$router.push({ |
| | | path:"/hiddenDangerRegistration" |
| | | path:"/oneFromanotherN" |
| | | }) |
| | | }, |
| | | submitForm(formName) { |
| | |
| | | this.$message({type:'error', message:"请添加隐患", duration:2000}) |
| | | } |
| | | this.ruleForm.items=this.tableData |
| | | 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}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | save(this.ruleForm).then(res=>{ |
| | | if (res.data.ok==1){ |
| | | this.$message({type:'success', message:"新增成功", duration:3000}) |
| | | this.$router.push({ |
| | | path:"/oneFromanotherN" |
| | | }) |
| | | }else { |
| | | this.$message({type:'error', message:res.data.msg, duration:3000}) |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | console.log("error submit!!"); |