| | |
| | | if (!permissionRoles) return true |
| | | return roles.some(role => permissionRoles.indexOf(role) >= 0) |
| | | } |
| | | const whiteList = ['/login', '/auth-redirect','/agreement','/register','/productionEquipment','/instrumentData','/oneFromanother','/hiddenDangerTroubleshootingList','/preview','/inspectionNotExist','/send','/Issuedbysuperiors','/oneFromanotherN','/summaryPotentialSafetyHzards','/safetyHazardAccount','/superiorsSend','/accountSend','/existN','/exist','/hazardSource','/safetyedit','/Dualbase','/supervision','/inferOtherThings']// no redirect whitelist |
| | | const whiteList = ['/login', '/auth-redirect','/agreement','/register','/productionEquipment','/instrumentData','/oneFromanother','/hiddenDangerTroubleshootingList','/preview','/inspectionNotExist','/send','/Issuedbysuperiors','/oneFromanotherN','/summaryPotentialSafetyHzards','/safetyHazardAccount','/superiorsSend','/accountSend','/existN','/exist','/hazardSource','/safetyedit','/Dualbase','/supervision','/inferOtherThings','/DualbaseLost']// no redirect whitelist |
| | | |
| | | router.beforeEach((to, from, next) => { |
| | | NProgress.start() // start progress bar |
| | |
| | | // meta: { title: '安全隐患台账-编辑', icon: '' } |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '/DualbaseLost', |
| | | // name: '安全隐患台账-双基考核', |
| | | component: () => import('@/views/safetyHazardAccount/DualbaseLost'), |
| | | // meta: { title: '安全隐患台账-编辑', icon: '' } |
| | | hidden: true |
| | | }, |
| | | { |
| | | path: '/supervision', |
| | | // name: '安全隐患台账-督查督办', |
| | |
| | | </el-row> |
| | | </el-col> |
| | | <el-col :span="4" style="text-align:right"> |
| | | <el-button type="primary" class="btns" @click="addDanger" |
| | | <el-button type="primary" class="btns" size="small" @click="addDanger" |
| | | >编辑</el-button |
| | | > |
| | | <el-button type="primary" class="btns" size="small" @click="jump()" |
| | | >本单位结果</el-button |
| | | > |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }); |
| | | }, |
| | | jump(){ |
| | | this.$router.push({ |
| | | path:"/DualbaseLost" |
| | | }) |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style=""> |
| | | <Titlename title="双基考核"></Titlename> |
| | | <div class="whole-form"> |
| | | <el-form |
| | | :model="ruleForm" |
| | | :rules="rules" |
| | | ref="ruleForm" |
| | | label-width="150px" |
| | | class="demo-ruleForm" |
| | | style="margin: 0 10% 0 10%" |
| | | > |
| | | <el-row class="title-center" style="margin-bottom: 20px" v-if="addShow"> |
| | | <el-col :span="14"> |
| | | <el-radio-group v-model="radio1"> |
| | | <el-radio-button label="2022年06月">2022年06月</el-radio-button> |
| | | <el-radio-button label="2022年05月">2022年05月</el-radio-button> |
| | | <el-radio-button label="2022年04月">2022年04月</el-radio-button> |
| | | <el-radio-button label="2022年03月">2022年03月</el-radio-button> |
| | | <el-radio-button label="2022年02月">2022年02月</el-radio-button> |
| | | <el-radio-button label="2022年01月">2022年01月</el-radio-button> |
| | | </el-radio-group> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-row> |
| | | <el-col :span="6"><span style="font-size:14px;font-weight: bold;line-height:36px;color:#606266;">请选择年月</span></el-col> |
| | | <el-col :span="18"> |
| | | <el-date-picker |
| | | v-model="ruleForm.check_date" |
| | | type="date" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="选择日期" |
| | | style="width: 100%" |
| | | > |
| | | </el-date-picker> |
| | | </el-col> |
| | | </el-row> |
| | | </el-col> |
| | | <!-- <el-col :span="4" style="text-align:right"> |
| | | <el-button type="primary" class="btns" size="small" @click="addDanger" |
| | | >编辑</el-button |
| | | > |
| | | <el-button type="primary" class="btns" size="small" @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="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> |
| | | <el-button |
| | | size="mini" |
| | | v-if="addShow" |
| | | @click="deleteDanger(scope.row, scope.$index)" |
| | | >删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | |
| | | <!-- <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-form-item> |
| | | </el-col> |
| | | </el-row> --> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | 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, |
| | | getDangerInfo, |
| | | editDanger, |
| | | } from "@/api/sgyhpczl/hiddenDangerRegistration"; |
| | | import { deepClone } from "@/utils"; |
| | | |
| | | export default { |
| | | components: { Titlename }, |
| | | name: "hiddenDangerList", |
| | | data() { |
| | | return { |
| | | radio1:"2022年06月", |
| | | 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: { |
| | | 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" }], |
| | | checktype: [{ required: true, message: "不能为空", trigger: "blur" }], |
| | | }, |
| | | 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) { |
| | | if (this.title == "新增") { |
| | | this.tableData.push(this.dangerForm); |
| | | } else { |
| | | var arr = this.tableData; |
| | | arr.splice(this.rowIndex, 1, this.dangerForm); |
| | | this.tableData = arr; |
| | | } |
| | | this.dialogVisible = false; |
| | | } else { |
| | | console.log("error submit!!"); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | deleteDanger(row, index) { |
| | | this.$confirm("确认删除吗", "提示", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | var arr = deepClone(this.tableData); |
| | | var brr = []; |
| | | for (var i = 0; i < arr.length; i++) { |
| | | if (i == index) { |
| | | } else { |
| | | brr.push(arr[i]); |
| | | } |
| | | } |
| | | this.tableData = deepClone(brr); |
| | | //this.tableData.splice(index) |
| | | }) |
| | | .catch((error) => {}); |
| | | }, |
| | | editDanger(row, index) { |
| | | this.dangerForm = deepClone(row); |
| | | this.rowIndex = index; |
| | | this.dialogVisible = true; |
| | | this.title = "编辑"; |
| | | }, |
| | | |
| | | addDanger() { |
| | | this.dangerForm = {}; |
| | | this.title = "新增"; |
| | | this.dialogVisible = true; |
| | | }, |
| | | changeWxy(e) { |
| | | for (var i = 0; i < this.dangerList.length; i++) { |
| | | if (e == this.dangerList[i].id) { |
| | | this.dangerForm.DTRisk_level = this.dangerList[i].mriskLevel; |
| | | this.dangerForm.dangerousSource = this.dangerList[i].mriskPoint; |
| | | } |
| | | } |
| | | }, |
| | | 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) { |
| | | this.statusList = res.data.data; |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.data.msg, |
| | | duration: 3000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | changeJCDW(val) { |
| | | initJCBM(val).then((res) => { |
| | | if (res.data.ok == 1) { |
| | | this.JCBMList = res.data.data; |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.data.msg, |
| | | duration: 3000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | initYHLX() { |
| | | initYHLX().then((res) => { |
| | | if (res.data.ok == 1) { |
| | | this.YHLXList = res.data.data; |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.data.msg, |
| | | duration: 3000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | initYHJB() { |
| | | initYHJB().then((res) => { |
| | | if (res.data.ok == 1) { |
| | | this.YHJBList = res.data.data; |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.data.msg, |
| | | duration: 3000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | 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) { |
| | | this.JCLBList = res.data.data; |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.data.msg, |
| | | duration: 3000, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | returnIndex() { |
| | | this.$router.push({ |
| | | path: "/hiddenDangerRegistration", |
| | | }); |
| | | }, |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | if (this.tableData == null || this.tableData.length == 0) { |
| | | 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, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | console.log("error submit!!"); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .app-container { |
| | | padding: 20px; |
| | | height: 850px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .app-container /deep/ .box { |
| | | padding-top: 0; |
| | | } |
| | | |
| | | /* /deep/ .multiline .el-input__inner { |
| | | height: 62px; |
| | | } */ |
| | | .btns { |
| | | background-color: #034ea2; |
| | | border: 1px solid #034ea2; |
| | | } |
| | | .title-center /deep/ .el-radio-button:first-child .el-radio-button__inner { |
| | | border: none; |
| | | } |
| | | |
| | | .title-center /deep/ .el-radio-button__inner { |
| | | border: none; |
| | | border-radius: 0px; |
| | | } |
| | | |
| | | .title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner { |
| | | background-color: #034ea2; |
| | | background-color: #034ea2; |
| | | } |
| | | .title-center /deep/ .el-radio-button--medium .el-radio-button__inner { |
| | | padding: 11px 20px; |
| | | } |
| | | </style> |