Your Name
2022-05-20 cbf6a875ede774c577c3ab21aa0a1cd9faa63a59
src/views/doublePreventAction/hiddenDanger/inspectionRecord/components/detail.vue
@@ -84,6 +84,20 @@
                <div v-if="ifNormal">
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="异常通知部门" prop="execDepartment">
                                <el-select v-model="inspectionRecordDetailForm.noticeDepId" filterable clearable class="analyseUnit_input" @change="changeExec">
                                    <el-option
                                        v-for="item in departmentList"
                                        :key="item.id"
                                        :value="item.id"
                                        :label="item.department"
                                    ></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="异常通知人员" prop="noticeUid">
                                <el-select v-model="inspectionRecordDetailForm.noticeUid" clearable filterable :disabled="ifShow" class="input">
                                    <el-option
@@ -100,6 +114,20 @@
                        <el-col :span="24">
                            <el-form-item label="整改时间" prop="fixTime">
                                <el-date-picker placeholder="选择时间" v-model="inspectionRecordDetailForm.fixTime" class="input" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" :disabled="ifShow"></el-date-picker>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="异常整改部门" prop="execDepartment">
                                <el-select v-model="inspectionRecordDetailForm.fixDepId" filterable clearable class="analyseUnit_input" @change="changeExec">
                                    <el-option
                                        v-for="item in departmentList"
                                        :key="item.id"
                                        :value="item.id"
                                        :label="item.department"
                                    ></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
@@ -136,8 +164,8 @@
                                    :headers="header"
                                    :data="uploadForm"
                                    list-type="picture-card"
                                    :file-list="fileList"
                                    v-model="inspectionRecordDetailForm.img"
                                    :file-list="inspectionRecordDetailForm.imgInfoList"
                                    v-model="inspectionRecordDetailForm.imgInfoList"
                                    :on-change="handleChangeFile"
                                    :on-success="onFileSuccess"
                                    :multiple="false"
@@ -212,12 +240,14 @@
                    execUid: null,
                    fixTime: null,
                    fixUid: null,
                    img: null,
                    imgInfoList: [],
                    info: null,
                    noticeUid: null,
                    result: 1,
                    taskId: null,
                    unitId: null
                    unitId: null,
                    fixDepId:null,
                    noticeDepId:null,
                },
                inspectionRecordDetailFormRules:{
                    img: [{ required: true, validator: validateImg, trigger: 'blur' }],
@@ -232,7 +262,7 @@
                ifNormal:false,
                userList:[],
                fileList:[],
                resultList:[{id:1,name:'正常'},{id:2,name:'异常'}],
                resultList:[{id:0,name:'未操作'},{id:1,name:'正常'},{id:2,name:'异常'}],
                typeList:[{id:1,name:'日常检查'},{id:2,name:'周期检查'}],
                statusList:[{id:1,name:'待巡检'},{id:2,name:'巡检中'},{id:3,name:'已完成'},{id:4,name:'超时未巡检'},{id:5,name:'已取消'}],
            }
@@ -252,10 +282,10 @@
                    this.titleDetail = '巡检单元查看'
                    this.ifShow = true
                    this.inspectionRecordDetailForm = JSON.parse(JSON.stringify(value))
                    if(value.result === 2){
                    if(value.result !== 1){
                        this.ifNormal = true
                        this.fileList = []
                        this.fileList.push({url:process.env.IMG_API + value.img})
                        this.fileList =(value.img === null ? [] : [ {url:process.env.IMG_API + value.img} ])
                    }
                }else{
                    this.titleDetail = '巡检单元上报'
@@ -279,13 +309,13 @@
                    this.inspectionRecordDetailForm.fixTime = null
                    this.inspectionRecordDetailForm.fixUid = null
                    this.inspectionRecordDetailForm.info = null
                    this.inspectionRecordDetailForm.img = null
                    this.inspectionRecordDetailForm.img = []
                }
                this.$refs["inspectionRecordDetailForm"].validate((valid) =>{
                    if(valid){
                        submitUnitOne(this.inspectionRecordDetailForm).then( res =>{
                            if(res.data.code === '200'){
                                this.inspectionRecordDetailFormVisible = false
                                this.$message({
                                    type:'success',
                                    message:'上报成功',
@@ -299,6 +329,7 @@
                                    type:'warning'
                                })
                            }
                            this.inspectionRecordDetailFormVisible = false
                        })
                    }else{
                        this.$message({
@@ -313,8 +344,7 @@
            },
            onFileSuccess(response){
                if(response.code === '200'){
                    this.inspectionRecordDetailForm.img = response.result.path
                    this.fileList.push({url:process.env.IMG_API + response.result.path})
                    this.inspectionRecordDetailForm.img.push({url:process.env.IMG_API + response.result.path})
                    this.$notify({
                        type:'success',
                        duration:2000,
@@ -338,8 +368,7 @@
                    cancelButtonText:'取消',
                    type:'warning',
                }).then(()=> {
                    this.inspectionRecordDetailForm.img = null
                    this.fileList = []
                })
            },
        }