lct123456
2022-04-19 8b19ecdb7b8f688e88d680262edbb00908e531b0
巡检任务细节
已修改5个文件
209 ■■■■ 文件已修改
config/dev.env.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/inspectionTask.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePreventAction/hiddenDanger/inspectionTask/index.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/doublePreventAction/riskLevelManage/controlAction/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/dev.env.js
@@ -22,8 +22,8 @@
    // BASE_API: '"http://222.92.213.21:8006/zhongtai"',
    // IMG_API: '"http://222.92.213.21:8006/zhongtai/upload/"',
    BASE_API: '"http://112.86.23.127:8006"',
    IMG_API: '"http://112.86.23.127:8006/upload/"',
    BASE_API: '"http://112.86.23.91:8006"',
    IMG_API: '"http://112.86.23.91:8006/upload/"',
    // BASE_API: '"http://222.92.213.21:8006/zhongtai_demo"',
    // IMG_API: '"http://222.92.213.21:8006/zhongtai_demo/upload/"',
src/api/inspectionTask.js
@@ -29,7 +29,7 @@
        headers: {
            'Authorization': getToken()
        },
        url: process.env.BASE_API + '/riskAnaUnit/mod',
        url: process.env.BASE_API + '/safecheck/work/update',
        method: 'post',
        data:data
    })
@@ -57,3 +57,36 @@
        data
    });
}
export function addInspectionControlAction(data) {
    return request({
        headers: {
            'Authorization': getToken()
        },
        url: process.env.BASE_API + '/safecheck/work/content/add?workId=' + data.workId + '&measureId=' + data.measureId,
        method: 'post',
    })
}
export function deleteInspectionControlAction(data) {
    return request({
        headers: {
            'Authorization': getToken()
        },
        url: process.env.BASE_API + '/safecheck/work/content/del?workId=' + data.workId + '&measureId=' + data.measureId,
        method: 'post',
    })
}
export function getInspectionControlAction(id) {
    return request({
        headers:{
            'Authorization': getToken()
        },
        url: process.env.BASE_API+'/safecheck/work/get/id?workId=' + id,
        method: 'post',
    });
}
src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue
@@ -13,40 +13,43 @@
                highlight-current-row
                style="width: 100%;"
            >
                <el-table-column label="安全风险事件名称" prop="riskEventId" align="center">
                <el-table-column label="序号" type="index" width="150" align="center">
                </el-table-column>
                <el-table-column label="管控方式" prop="dataSrc" align="center">
                 <el-table-column label="管控方式描述" prop="content" align="center">
                </el-table-column>
                <el-table-column label="管控方式描述" prop="riskMeasureDesc" align="center">
                </el-table-column>
                <el-table-column label="管控措施分类1" prop="classify1" align="center">
                </el-table-column>
                <el-table-column label="管控措施分类2" prop="classify2" align="center">
                </el-table-column>
                <el-table-column label="管控措施分类3" prop="classify3" align="center">
                </el-table-column>
                <el-table-column label="隐患排查内容" prop="troubleshootContent" align="center">
                </el-table-column>
                <el-table-column label="检查类型" prop="hazardLiablePerson" align="center">
                   <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
                    <template slot-scope="scope">
                        <el-button type="text" @click="showMeasureDetail(scope.row)">详情</el-button>
                        <el-button type="text" style="color:red;" @click="deleteById(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <el-dialog :visible.sync="controlActionVisible"  append-to-body :close-on-click-modal="false" width="80%">
            <control-action ref="controlAction" @giveRiskControlId="receiveRiskControlId"></control-action>
            <control-action ref="controlAction" @closeDialog="closeDialog" @giveRiskControlId="receiveRiskControlId"></control-action>
        </el-dialog>
    </div>
</template>
<script>
    import controlAction from '../../../riskLevelManage/controlAction/index'
    import { addInspectionControlAction, deleteInspectionControlAction ,getInspectionControlAction } from '../../../../../api/inspectionTask'
    export default {
        props:['title','inspectionTaskForm'],
        name: "inpectionPoint",
        data(){
            return{
                tableKey:'',
                listLoading:false,
                ifShowControl:true,
                controlActionVisible:false,
                riskControlMeasureVisible:false,
                riskControlMeasureForm:[],
                inspectionPointData:[],
                controlActionForm:{
                    workId:'',
                    measureId:'',
                }
            }
        },
        components:{
@@ -59,10 +62,72 @@
                    this.$refs.controlAction.ifShowButton()
                })
            },
            receiveRiskControlId(value) {
            showMeasureDetail(val){
                this.controlActionVisible = true
                setTimeout( () => {
                    this.$refs.controlAction.showMeasureDetail(val)
                })
            },
            closeDialog(){
                this.controlActionVisible  = false
                this.inspectionPointData = JSON.parse(JSON.stringify(value))
            },
            async receiveRiskControlId(value) {
                this.controlActionVisible  = false
                if(this.title === '新建巡检计划设定'){
                    if(value){
                        //     this.inspectionPointData = JSON.parse(JSON.stringify(value.map( item => {
                        //     return {
                        //         id:item.id,
                        //         content:item.riskMeasureDesc
                        //     }
                        // })))
                        this.inspectionPointData.push({id:value.id,content:value.riskMeasureDesc})
                this.$emit('giveToForm',this.inspectionPointData)
                        }
                }else{
                    this.controlActionForm.workId = JSON.stringify(this.inspectionTaskForm.workId)
                    this.controlActionForm.measureId =JSON.stringify(value.id)
                    let res = await addInspectionControlAction(this.controlActionForm)
                    if(res.data.code === '200'){
                        this.getControlActionList()
                        this.$message({
                            type:'success',
                            duretion:2000,
                            message:'新增管控措施成功',
                            title:'成功'
                        })
                    }else{
                        this.$message({
                            type:'warning',
                            message:res.data.message
                        })
                    }
                }
            },
            deleteById(value){
                this.$confirm('删除此条措施,是否继续','提示',{
                    confirmButtonText:'确定',
                    cancelButtonText:'取消',
                    type:'warning',
                }).then(()=> {
                    deleteInspectionControlAction({workId:value.workId,measureId:value.measureId}).then( (res)=>{
                        if(res.data.code === '200'){
                            this.getControlActionList()
                            this.$notify({
                            title:'成功',
                            message:'删除成功',
                            type:'success',
                            duration:2000,
                            })
                        }
                    })
                })
            },
            async getControlActionList(){
                let res = await getInspectionControlAction(this.inspectionTaskForm.workId)
                this.inspectionPointData = res.data.result.checkContents
            }
        }
    }
@@ -72,4 +137,7 @@
/deep/.filter-container{
    padding-left: 0px !important;
}
    .analyseUnit_input{
        width:200px;
    }
</style>
src/views/doublePreventAction/hiddenDanger/inspectionTask/index.vue
@@ -143,7 +143,7 @@
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="巡检任务类型" prop="type">
                                <el-select v-model="inspectionTaskForm.type" class="analyseUnit_input">
                                <el-select v-model="inspectionTaskForm.type" class="analyseUnit_input" :disabled="ifShow">
                                    <el-option
                                        v-for="item in typeList"
                                        :key="item.id"
@@ -263,7 +263,7 @@
            <div class="inspectionTask_point">
                <el-tabs class="active" v-model="activeName">
                    <el-tab-pane label="巡检点信息" name="inspectionPoint">
                        <inspection-point @giveToForm="receiveToForm" ref="inspectionPoint"></inspection-point>
                        <inspection-point @giveToForm="receiveToForm" ref="inspectionPoint" :title="title" :inspectionTaskForm="inspectionTaskForm"></inspection-point>
                    </el-tab-pane>
                </el-tabs>
            </div>
@@ -319,6 +319,7 @@
        data() {
            return {
                tableKey: 0,
                ifShow:true,
                activeName:'inspectionPoint',
                inspectionTaskData: [],
                departmentList:[],
@@ -436,13 +437,15 @@
                }
            },
            showAnalyseUnitForm(value,type){
                debugger
                this.inspectionTaskVisible = true
                this.$nextTick(() =>{
                    this.$refs["inspectionTaskForm"].clearValidate()
                })
                if(type === '新增'){
                    this.ifShow = false
                    this.title = '新建巡检计划设定'
                    this.noticeDepartment = ''
                    this.execDepartment = ''
                    this.inspectionTaskForm = {
                        type:null,
                        createUid: parseInt(Cookies.get('userId')),
@@ -460,16 +463,44 @@
                        this.$refs.inspectionPoint.inspectionPointData = []
                    });
           }else{
                    this.ifShow = true
                    this.title = '编辑巡检计划设定'
                    this.noticeDepartment = this.handleDepartment(JSON.parse(JSON.stringify(value)).noticeUid)
                    this.changeNotice()
                    this.execDepartment = this.handleDepartment(JSON.parse(JSON.stringify(value)).execUid)
                     this.changeExec()
                    this.inspectionTaskForm = JSON.parse(JSON.stringify(value))
                    // this.inspectionTaskForm.execUid = value.execUname
                    // this.inspectionTaskForm.noticeUid = value.noticeUname
                     setTimeout(() => {
                        this.$refs.inspectionPoint.inspectionPointData =  this.inspectionTaskForm.checkContents
                    });
                }
            },
            handleDepartment(value){
                let department = ''
                for(let i in this.userList){
                    if(this.userList[i].id === value){
                        department = this.userList[i].department
                    }
                }
                department = this.departmentList.find(item => item.department === department)
                return department.department
            },
            submitAnalyseUnit(){
                this.$refs["inspectionTaskForm"].validate((valid) =>{
                    if(valid){
                        if(this.inspectionTaskForm.noticeSeconds >= this.inspectionTaskForm.intervalSeconds){
                            this.$message({
                                type:'warning',
                                 message:'提前通知时间不能大于检查频次'
                            })
                        }else if(this.inspectionTaskForm.intervalSeconds <= this.inspectionTaskForm.effectSeconds){
                                this.$message({
                                type:'warning',
                                 message:'任务持续时间不能大于检查频次'
                            })
                        }else{
                        if(this.title === '新建巡检计划设定'){
                            addInspectionTask(this.inspectionTaskForm).then((res)=>{
                                if(res.data.code === '200'){
@@ -489,7 +520,16 @@
                                }
                            })
                        }else{
                            updateInspectionTask(this.inspectionTaskForm).then((res)=>{
                                updateInspectionTask({
                                    effectSeconds: this.inspectionTaskForm.effectSeconds,
                                    execUid: this.inspectionTaskForm.execUid,
                                    intervalSeconds: this.inspectionTaskForm.intervalSeconds,
                                    noticeSeconds: this.inspectionTaskForm.noticeSeconds,
                                    noticeUid: this.inspectionTaskForm.noticeUid,
                                    startTime: this.inspectionTaskForm.startTime,
                                    status: this.inspectionTaskForm.status,
                                    workId: this.inspectionTaskForm.workId
                                    }).then((res)=>{
                                if(res.data.code === '200'){
                                    this.inspectionTaskVisible = false
                                    this.getInspectionTaskData()
@@ -507,6 +547,8 @@
                                }
                            })
                        }
                        }
                    }else{
                        this.$message({
                            type:'warning',
@@ -534,7 +576,6 @@
                })
            },
            receiveToForm(value) {
                debugger
                this.inspectionTaskForm.riskControlMeasureIdList = []
                this.inspectionTaskForm.riskControlMeasureIdList = value.map( item => {
                    return item.id
src/views/doublePreventAction/riskLevelManage/controlAction/index.vue
@@ -20,7 +20,7 @@
                highlight-current-row
                style="width: 100%;"
            >
                <el-table-column type="selection" width="55"></el-table-column>
                <!-- <el-table-column type="selection" width="55"></el-table-column> -->
                <el-table-column label="安全风险事件名称" prop="riskEventId" align="center">
                </el-table-column>
                <el-table-column label="管控方式" prop="dataSrc" align="center">
@@ -68,7 +68,7 @@
            />
            <br>
        </div>
        <el-dialog :title="title" :visible.sync="riskControlMeasureVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px">
        <el-dialog :title="title" :visible.sync="riskControlMeasureVisible" append-to-body :close-on-click-modal="false" width="600px">
            <el-form ref="riskControlMeasureForm" :rules="riskControlMeasureFormRules" :model="riskControlMeasureForm" label-position="right" label-width="160px">
                <el-form-item label="安全风险事件名称" prop="riskEventId">
                <el-select v-model="riskControlMeasureForm.riskEventId" class="analyseUnit_input">
@@ -399,8 +399,19 @@
                this.riskControlMeasureIdList = val
            },
            giveValue(){
                this.$emit('giveRiskControlId',this.riskControlMeasureIdList)
            giveValue(value){
                // this.$emit('giveRiskControlId',this.riskControlMeasureIdList)
                this.$emit('giveRiskControlId',value)
            },
            showMeasureDetail(value){
                this.riskControlMeasureVisible = true
                this.getRiskControlMeasureData().then( ()=>{
                    let riskControlMeasureForm = this.riskControlMeasureData.find(item => item.id === value.measureId)
                    this.riskControlMeasureForm = riskControlMeasureForm
                    this.$emit('closeDialog')
                })
            }
        }
    }