Your Name
2022-08-06 ca151ff4c1cdc4a029f13ac6da7d42e4f8147287
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
    <el-dialog title="验收" :visible.sync="isShowCheckDialog" width="600px">
        <el-form :model="checkForm" :rules="checkFormRules" ref="checkFormRef" size="default" label-width="120px">
            <el-row :gutter="35">
                <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                    <el-form-item label="验收意见" prop="checkAcceptDesc">
                        <el-input class="input-add" type="textarea" :rows="2" v-model.trim="checkForm.checkAcceptDesc" placeholder="请输入验收意见" clearable></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <div align="right" class="dialog-footer">
                    <el-button @click="isShowCheckDialog = !isShowCheckDialog" size="default">取 消</el-button>
                    <el-button type="primary" @click="submitCheck" size="default">确 定</el-button>
        </div>
    </el-dialog>
</template>
 
 
<script>
    import { hiddenDangerAccept,hiddenDangerReject} from '@/api/hiddenDanger';
    import { getToken} from "@/utils/auth";
    import {checkHiddenDangerReport, submitHiddenDangerReport} from "../../../../../../api/hiddenDanger";
 
    export default {
        name: "acceptDialog",
        data(){
            return {
                headers: {
                    'Authorization': getToken()
                },
                baseUrl: process.env.BASE_API + 'hiddenDanger/report',
                imgUrls:[],
                imgUrls2:[],
                fileList:[],
                imgPreviewUrls:[],
                imgPreviewUrls2:[],
                isView:false,
                isReject:false,
                submiting:false,
                levels:[
                    {"key":"URGENT","value":"重大隐患"},
                    {"key":"COMMON","value":"一般隐患"},
                ],
                dataForm: {
                    id:'',
                    note: '',
                    level:'',
                    rejectnote:'',
                },
                dialogFormVisible: false,
                dialogStatus:'',
                dataFormRules: {},
                checkTypeList: [],
                rectifyTypeList: [
                    { id: 1, name: '即查即改' },
                    { id: 2, name: '限期整改' }
                ],
                departmentList: [],
                userList: [],
                isShowCheckDialog: false,
                isShowCheckInfoDialog: false,
                checkForm: {
                    id: null,
                    dangerManagerId: null,
                    checkAcceptDesc: null
                },
                checkInfoForm: {
                    rectifyDepId: null,
                    liablePersonId: null
                },
                checkFormRules: {
                    checkAcceptDesc: [{ required: true, message: '请填写整改说明', trigger: 'blur' }]
                }
            }
        },
        methods:{
            showDialog(row){
                this.isShowCheckDialog = true;
                const checkForm = JSON.parse(JSON.stringify(row));
                this.checkForm.id = checkForm.id;
                this.checkForm.dangerManagerId = checkForm.dangerManagerId;
            },
 
            submitCheck() {
                this.$refs['checkFormRef'].validate(async (valid) => {
                    if (valid) {
                        let res = await checkHiddenDangerReport(this.checkForm);
                        if (res.data.code === '200') {
                            this.$message({
                                type: 'success',
                                message: '整改提交成功',
                                duration: 2000
                            });
                            this.isShowCheckDialog = false;
                            this.$emit('refreshCheck');
                        } else {
                            this.$message({
                                type: 'warning',
                                message: res.data.message
                            });
                        }
                    } else {
                        this.$message({
                            type: 'warning',
                            message: '请完善基本信息'
                        });
                    }
                });
            },
 
            rejectSubmit(){
                let params = {}
                params['id'] = this.dataForm.id
                params['rejectnote'] = this.dataForm.rectifynote
                this.submit(params,hiddenDangerReject)
            },
 
            submit(params,func){
                this.submiting = true
                func(params)
                    .then(res=>{
                        if (res.data.code === '200') {
                            this.dialogFormVisible = false
                            this.$message({message: '操作成功', type: 'success'});
                            this.$emit("refresh")
                        }else{
                            this.$message({message: res.data.message, type: 'success'});
                        }
                        this.fileList = []
                    })
                    .catch(err=>{
                        console.log(err);
                        this.$message({message: '接口错误', type: 'warning'});
                    })
                    .finally(()=>{
                        this.submiting = false
                    })
            },
            handleChange(file, fileList) {
                this.fileList = fileList
            },
        }
    }
</script>
 
<style scoped>
 
</style>