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 ++------
 src/components/audit-base/main.vue              |   85 +++++++++++++++++
 src/main.js                                     |  106 ++++++++++----------
 src/views/place/index.vue                       |   13 --
 4 files changed, 150 insertions(+), 96 deletions(-)

diff --git a/src/components/audit-base/main.vue b/src/components/audit-base/main.vue
new file mode 100644
index 0000000..751e868
--- /dev/null
+++ b/src/components/audit-base/main.vue
@@ -0,0 +1,85 @@
+<template>
+    <div class="cur-container-box">
+        <avue-form ref="replyForm" :option="option" v-model="form" :close-on-click-modal="false">
+
+            <template slot-scope="{size}" slot="menuForm">
+                <el-button type="primary" :size="size" @click="handleSubmit">通 过</el-button>
+                <el-button :size="size" @click="handleReset">驳 回</el-button>
+            </template>
+
+        </avue-form>
+    </div>
+</template>
+
+<script>
+export default {
+    name: 'auditBase',
+
+    data () {
+        return {
+            form: {},
+            option: {
+                submitBtn: false,
+                emptyBtn: false,
+                column: [
+                    {
+                        span: 23,
+                        row: true,
+                        label: "审批意见",
+                        prop: "confirmNotion",
+                        type: 'textarea',
+                        minRows: 3,
+                        maxRows: 5,
+                        rules: [],
+                    }
+                ]
+            },
+        }
+    },
+
+    methods: {
+        handleSubmit () {
+            this.form.status = 1
+            this.$emit('handleSubmit', this.form)
+        },
+
+        handleReset () {
+            if ('confirmNotion' in this.form && this.form.confirmNotion.trim() == '' || !this.form.confirmNotion) {
+                this.$message({
+                    type: 'warning',
+                    message: "请输入审批意见!",
+                })
+
+                return
+            }
+            this.form.status = 2
+            this.$emit('handleSubmit', this.form)
+        },
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.cur-container-box {
+    display: flex;
+    flex-direction: column;
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+
+    .content-box {
+        margin: 0 4px;
+        padding: 0 16px;
+        height: 0;
+        flex: 1;
+        overflow: hidden;
+        overflow-y: auto;
+    }
+
+    .footer-btn-box {
+        margin-top: 10px;
+        display: flex;
+        justify-content: center;
+    }
+}
+</style>
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index 88899a7..0a51fa9 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,68 +1,70 @@
-import Vue from "vue";
-import axios from "./router/axios";
-import VueAxios from "vue-axios";
-import App from "./App";
-import router from "./router/router";
-import "./permission"; // 权限
-import "./error"; // 日志
-import "./cache"; //页面缓存
-import store from "./store";
-import { loadStyle } from "./util/util";
-import * as urls from "@/config/env";
-import Element from "element-ui";
-import { iconData } from "@/config/env";
-import i18n from "./lang"; // Internationalization
-import "./styles/common.scss";
-import basicBlock from "./components/basic-block/main";
-import basicContainer from "./components/basic-container/main";
-import thirdRegister from "./components/third-register/main";
-import flowDesign from "./components/flow-design/main";
-import avueUeditor from "avue-plugin-ueditor";
-import website from "@/config/website";
-import crudCommon from "@/mixins/crud";
+import Vue from "vue"
+import axios from "./router/axios"
+import VueAxios from "vue-axios"
+import App from "./App"
+import router from "./router/router"
+import "./permission" // 权限
+import "./error" // 日志
+import "./cache" //页面缓存
+import store from "./store"
+import { loadStyle } from "./util/util"
+import * as urls from "@/config/env"
+import Element from "element-ui"
+import { iconData } from "@/config/env"
+import i18n from "./lang" // Internationalization
+import "./styles/common.scss"
+import basicBlock from "./components/basic-block/main"
+import basicContainer from "./components/basic-container/main"
+import thirdRegister from "./components/third-register/main"
+import flowDesign from "./components/flow-design/main"
+import auditBase from "./components/audit-base/main"
+import avueUeditor from "avue-plugin-ueditor"
+import website from "@/config/website"
+import crudCommon from "@/mixins/crud"
 // 业务组件
-import tenantPackage from "./views/system/tenantpackage";
+import tenantPackage from "./views/system/tenantpackage"
 
 // 注册全局crud驱动
-window.$crudCommon = crudCommon;
+window.$crudCommon = crudCommon
 // 加载Vue拓展
-Vue.use(router);
-Vue.use(VueAxios, axios);
+Vue.use(router)
+Vue.use(VueAxios, axios)
 Vue.use(Element, {
-  i18n: (key, value) => i18n.t(key, value),
-});
+    i18n: (key, value) => i18n.t(key, value),
+})
 Vue.use(window.AVUE, {
-  size: "small",
-  tableSize: "small",
-  calcHeight: 65,
-  i18n: (key, value) => i18n.t(key, value),
-});
+    size: "small",
+    tableSize: "small",
+    calcHeight: 65,
+    i18n: (key, value) => i18n.t(key, value),
+})
 // 注册全局容器
-Vue.component("basicContainer", basicContainer);
-Vue.component("basicBlock", basicBlock);
-Vue.component("thirdRegister", thirdRegister);
-Vue.component("avueUeditor", avueUeditor);
-Vue.component("flowDesign", flowDesign);
-Vue.component("tenantPackage", tenantPackage);
+Vue.component("basicContainer", basicContainer)
+Vue.component("basicBlock", basicBlock)
+Vue.component("thirdRegister", thirdRegister)
+Vue.component("avueUeditor", avueUeditor)
+Vue.component("flowDesign", flowDesign)
+Vue.component("auditBase", auditBase)
+Vue.component("tenantPackage", tenantPackage)
 // 加载相关url地址
 Object.keys(urls).forEach((key) => {
-  Vue.prototype[key] = urls[key];
-});
+    Vue.prototype[key] = urls[key]
+})
 // 加载NutFlow
-Vue.use(window.WfDesignBase);
+Vue.use(window.WfDesignBase)
 // 加载website
-Vue.prototype.website = website;
-Vue.prototype.$axios = axios;
+Vue.prototype.website = website
+Vue.prototype.$axios = axios
 
 iconData.forEach((item) => {
-  loadStyle(item.url.replace("$key", item.icon));
-});
+    loadStyle(item.url.replace("$key", item.icon))
+})
 
-Vue.config.productionTip = false;
+Vue.config.productionTip = false
 
 new Vue({
-  router,
-  store,
-  i18n,
-  render: (h) => h(App),
-}).$mount("#app");
+    router,
+    store,
+    i18n,
+    render: (h) => h(App),
+}).$mount("#app")
diff --git a/src/views/place/index.vue b/src/views/place/index.vue
index 7368bab..018dd1e 100644
--- a/src/views/place/index.vue
+++ b/src/views/place/index.vue
@@ -143,9 +143,6 @@
                             trigger: "blur",
                         },],
                     },
-
-
-
                     {
                         width: 110,
                         label: "场所负责人",
@@ -159,7 +156,6 @@
                             trigger: "blur",
                         },],
                     },
-
                     {
                         width: 120,
                         overHidden: true,
@@ -191,7 +187,6 @@
                             }
                         ],
                     },
-
                     {
                         width: 110,
                         label: "所属街道",
@@ -242,7 +237,6 @@
                             },
                         ],
                     },
-
                     {
                         width: 110,
                         overHidden: true,
@@ -279,8 +273,6 @@
                             },
                         ],
                     },
-
-
                     {
                         span: 7,
                         label: "场所标签",
@@ -300,7 +292,6 @@
                             trigger: "blur",
                         },],
                     },
-
                     {
                         span: 5,
                         label: "",
@@ -315,7 +306,6 @@
                         dataType: "string",
                         hide: true,
                     },
-
                     {
                         span: 12,
                         label: "标签颜色",
@@ -402,7 +392,6 @@
                             value: "dictKey",
                         },
                     },
-
                     {
                         width: 110,
                         label: "场所照片",
@@ -462,7 +451,6 @@
                         hide: true,
                         prop: "lng",
                     },
-
                     {
                         width: 96,
                         slot: true,
@@ -473,7 +461,6 @@
                         hide: true,
                         prop: "lat",
                     },
-
                     {
                         width: 100,
                         addDisplay: false,
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