Admin
2022-11-23 90de81ed138823dc498b201bc7873f74016d2f65
src/views/selfCheck/components/supervisionDetails.vue
文件名从 src/views/supervision/components/supervisionDetails.vue 修改
@@ -5,6 +5,7 @@
        :close-on-click-modal="false"
        width="75%"
        center
        @close="resetForm()"
    >
         <div slot="title" class="dialog-title">
            烟花爆竹批发企业自查情况信息报送表
@@ -40,7 +41,7 @@
                    <td class="w-30 overText">{{item.rectifyMeasure}}</td>
                    <td class="w-10">{{item.rectifyPrice}}</td>
                    <td class="w-10">{{item.chargePerson}}</td>
                    <td class="w-20">
                    <td class="w-20 overText">
                        <span v-if="item.rectifyStatus == 0">
                            未整改
                            <el-button type="text" @click="toRectify(item)">去整改</el-button>
@@ -78,32 +79,34 @@
            :close-on-click-modal="false"
            width="40%"
            center
            @close="resetEdit()"
        >
            <el-form ref="reportFormRef" :model="reportForm" label-width="140px">
            <el-form ref="reportForm" :model="reportForm" :rules="reportRule" label-width="140px">
                <el-form-item label="当前隐患:">
                    <el-input type="textarea" v-model="reportForm.info"></el-input>
                    <el-input type="textarea" readonly v-model="reportForm.info"></el-input>
                </el-form-item>
                <el-form-item label="当前完成整改日期:">
                <el-form-item label="当前完成整改日期:" prop="completeRectifyTime">
                    <el-date-picker
                        v-model="reportForm.completeRectifyTime"
                        type="date"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择整改日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="整改资金:">
                <el-form-item label="整改资金:" prop="rectifyPrice">
                    <el-input v-model="reportForm.rectifyPrice"></el-input>
                </el-form-item>
                <el-form-item label="整改措施:">
                <el-form-item label="整改措施:" prop="rectifyMeasure">
                    <el-input type="textarea" autosize v-model="reportForm.rectifyMeasure"></el-input>
                </el-form-item>
                <el-form-item label="负责人:">
                <el-form-item label="负责人:" prop="chargePerson">
                    <el-input v-model="reportForm.chargePerson"></el-input>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
              <el-button @click="dialogReport = false">取消</el-button>
              <el-button type="primary" @click="confirmReport()">提交</el-button>
              <el-button type="primary" @click="confirmReport('reportForm')">提交</el-button>
            </span>
        </el-dialog>
    </el-dialog>
@@ -126,27 +129,33 @@
                    enterpriseProvince: '',
                    enterpriseCity: '',
                    enterpriseArea: '',
                    checkUnitType: 1,
                    checkUnitType: null,
                    checkName: '',
                    checkTime: '',
                    hiddendangerStatus: 0,
                    hiddendangerStatus: null,
                    hiddendangerInfos: [],
                    hiddendangerSum: 0,
                    majorHiddendangerNum: 0
                    hiddendangerSum: null,
                    majorHiddendangerNum: null
                },
                reportForm:{
                    id: null,
                    info: '',
                    completeRectifyTime: '',
                    rectifyPrice: 0,
                    rectifyPrice: null,
                    rectifyMeasure: '',
                    chargePerson: ''
                },
                reportRule:{
                    completeRectifyTime: [{ required: true, message: '请选择完成整改日期', trigger: 'blur' }],
                    rectifyPrice: [{ required: true, message: '请输入整改资金', trigger: 'blur' }],
                    rectifyMeasure: [{ required: true, message: '请输入整改措施', trigger: 'blur' }],
                    chargePerson: [{ required: true, message: '请输入负责人', trigger: 'blur' }]
                }
            }
        },
        created() {
            const t = this
            t.getEnterpriseInfo()
            // t.getEnterpriseInfo()
        },
        watch: {
        },
@@ -158,6 +167,7 @@
                if(res.data.code === "200"){
                    t.corpInfo = res.data.result
                }else{
                    t.dialogVisible = false
                    t.$message({
                        type:'warning',
                        message:res.data.message
@@ -171,22 +181,56 @@
                t.dialogReport = true
            },
            async confirmReport(){
            async confirmReport(formName){
                const t = this
                let {info,...data} = t.reportForm
                let res = await updateSpotCheckRectifyInfo(data)
                if(res.data.code === "200"){
                    t.$message({
                        type:'success',
                        message:res.data.message
                    })
                }else{
                    t.$message({
                        type:'warning',
                        message:res.data.message
                    })
                t.$refs[formName].validate(async (valid) => {
                    if(valid){
                        let {info,...data} = t.reportForm
                        let res = await updateSpotCheckRectifyInfo(data)
                        if(res.data.code === "200"){
                            t.$message({
                                type:'success',
                                message:res.data.message
                            })
                        }else{
                            t.$message({
                                type:'warning',
                                message:res.data.message
                            })
                        }
                        t.dialogReport = false
                        t.getEnterpriseInfo()
                        t.$parent.getSpotCheckList()
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                })
            },
            resetForm(){
              this.corpInfo ={
                  enterpriseName: '',
                  enterpriseProvince: '',
                  enterpriseCity: '',
                  enterpriseArea: '',
                  checkUnitType: null,
                  checkName: '',
                  checkTime: '',
                  hiddendangerStatus: null,
                  hiddendangerInfos: [],
                  hiddendangerSum: null,
                  majorHiddendangerNum: null
              }
            },
            resetEdit(){
                this.reportForm = {
                    id: null,
                    info: '',
                    completeRectifyTime: '',
                    rectifyPrice: null,
                    rectifyMeasure: '',
                    chargePerson: ''
                }
                t.dialogReport = false
            },
            confirmBack(){
                this.dialogVisible = false
@@ -276,6 +320,9 @@
                    &.w-20{
                        width: 20%;
                    }
                    &.w-30{
                        width: 30%;
                    }
                    &.w-50{
                        width: 50%;
                    }
@@ -285,14 +332,13 @@
                    &.w-75{
                        width: 75%;
                    }
                    &.w-33{
                        width: 33.33%;
                    }
                    &.overText{
                        overflow: auto;
                        line-height: 1.5;
                        text-align: left;
                        padding: 10px;
                        &::-webkit-scrollbar { width: 0; height: 0; color: transparent }
                        &::scrollbar { width: 0; height: 0; color: transparent }
                    }
                }
            }