From ea3eaea9b6ef359e6a9ef81dc829e3fc4a2baec4 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Wed, 21 Feb 2024 13:56:52 +0800
Subject: [PATCH] 审核弹窗组件封装,消防自查审核弹窗修改

---
 src/views/publicSecurity/keynotePlaceManage.vue |   42 +++++++++++-------------------------------
 1 files changed, 11 insertions(+), 31 deletions(-)

diff --git a/src/views/publicSecurity/keynotePlaceManage.vue b/src/views/publicSecurity/keynotePlaceManage.vue
index 1bbac9d..4be0bfd 100644
--- a/src/views/publicSecurity/keynotePlaceManage.vue
+++ b/src/views/publicSecurity/keynotePlaceManage.vue
@@ -40,21 +40,7 @@
 
         <el-dialog :visible.sync="visible" append-to-body destroy-on-close title="审核" width="30%"
             custom-class="flow-design-dialog" :before-close="handleClose">
-            <el-form ref="auditForm" :model="auditForm" :rules="auditRules">
-                <el-form-item label="审核结论:" prop="status">
-                    <el-radio-group v-model="auditForm.status">
-                        <el-radio :label="2">通过</el-radio>
-                        <el-radio :label="3">不通过</el-radio>
-                    </el-radio-group>
-                </el-form-item>
-                <el-form-item label="不通过原因:" prop="remark" v-if="auditForm.status == 3">
-                    <el-input type="textarea" v-model="auditForm.remark"></el-input>
-                </el-form-item>
-            </el-form>
-            <div style="display:flex;justify-content:center">
-                <el-button @click="submitAudit" size="small" type="primary">保 存</el-button>
-                <el-button @click="cancelAudit" size="small">取 消</el-button>
-            </div>
+            <audit-base @handleSubmit="submitAudit" @handleReset="submitAudit"></audit-base>
         </el-dialog>
     </basic-container>
 </template>
@@ -97,7 +83,6 @@
                 status: [{ required: true, message: "必填" }],
                 remark: [{ required: true, message: "必填" }],
             },
-            auditForm: {},
             visible: false,
             taskType: 0,
             curRow: {},
@@ -350,23 +335,19 @@
         // 取消审核
         cancelAudit () {
             this.visible = false
-            this.auditForm = {}
-            this.$refs.auditForm.resetFields()
         },
 
         // 确认提交审核
-        submitAudit () {
-            this.$refs.auditForm.validate((valid) => {
-                if (valid) {
-                    applyTaskExamine(Object.assign(this.auditParams, this.auditForm)).then(res => {
-                        if (res.data.code == 200) {
-                            this.$message.warning("审核成功")
-                            this.onLoad(this.page)
-                            this.cancelAudit()
-                        }
-                    })
-                } else {
-                    return false
+        submitAudit (form) {
+            let auditForm = {
+                status: form.status == 1 ? 2 : 3,
+                remark: form.confirmNotion
+            }
+            applyTaskExamine(Object.assign(this.auditParams, auditForm)).then(res => {
+                if (res.data.code == 200) {
+                    this.$message.warning("审核成功")
+                    this.onLoad(this.page)
+                    this.cancelAudit()
                 }
             })
         },
@@ -377,7 +358,6 @@
                 id: row.id,
                 reportType: row.reportType
             }
-            console.log('this.auditParams', this.auditParams)
             this.visible = true
         },
 

--
Gitblit v1.9.3