zhongrj
2024-01-10 88d36fb9707c7e4df931d23511c8be9df7630c6e
src/views/place/components/auditBase.vue
@@ -1,18 +1,13 @@
<template>
    <div class="cur-container-box">
        <div class="content-box">
            审核当前项
        </div>
        <div class="footer-btn-box">
            <el-button type="primary" size="small" @click="auditPass">通 过</el-button>
            <el-button size="small" @click="auditTurnDown">驳 回</el-button>
        </div>
        <avue-form ref="replyForm" :option="option" v-model="form" :close-on-click-modal="false">
        <el-dialog append-to-body :visible.sync="auditTurnDownPopup" width="30%" :close-on-click-modal="false"
            @close="popupClose" :show-close="false">
            <avue-form ref="replyForm" :option="option" v-model="form" @submit="handleSubmit" @reset-change="handleReset">
            </avue-form>
        </el-dialog>
            <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>
@@ -26,27 +21,20 @@
    data () {
        return {
            auditTurnDownPopup: false,
            form: {},
            option: {
                submitBtn: true,
                submitText: '确定',
                emptyBtn: true,
                emptyText: '取消',
                submitBtn: false,
                emptyBtn: false,
                column: [
                    {
                        span: 24,
                        label: "驳回原因",
                        span: 23,
                        row: true,
                        label: "审批意见",
                        prop: "confirmNotion",
                        type: 'textarea',
                        minRows: 3,
                        maxRows: 5,
                        rules: [{
                            required: true,
                            message: "请输入驳回原因",
                            trigger: "blur",
                        }],
                        rules: [],
                    }
                ]
            },
@@ -54,50 +42,46 @@
    },
    methods: {
        popupClose () {
            this.$refs.replyForm && this.$refs.replyForm.resetForm()
        },
        auditPass () {
        handleSubmit () {
            setCheckPlaceExt({
                confirmFlag: 2,
                id: this.placeElement.curAuditRow.placeExtId
            }).then(() => {
                this.placeElement.auditBasePopup = false
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
                this.placeElement.onLoad(this.placeElement.page)
            })
        },
        auditTurnDown () {
            this.placeElement.auditBasePopup = false
            this.auditTurnDownPopup = true
        },
        handleSubmit (form, done) {
            setCheckPlaceExt({
                confirmFlag: 3,
                id: this.placeElement.curAuditRow.placeExtId,
                confirmNotion: form.confirmNotion
                confirmNotion: this.form.confirmNotion
            }).then(() => {
                this.auditTurnDownPopup = false
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
                this.$refs.replyForm && this.$refs.replyForm.resetForm()
                this.placeElement.auditBasePopup = false
                this.placeElement.onLoad(this.placeElement.page)
                done()
            })
        },
        handleReset () {
            this.auditTurnDownPopup = false
        }
            if ('confirmNotion' in this.form && this.form.confirmNotion.trim() == '' || !this.form.confirmNotion) {
                this.$message({
                    type: 'warning',
                    message: "请输入审批意见!",
                })
            }
            setCheckPlaceExt({
                confirmFlag: 3,
                id: this.placeElement.curAuditRow.placeExtId,
                confirmNotion: this.form.confirmNotion
            }).then(() => {
                this.$message({
                    type: "success",
                    message: "操作成功!",
                })
                this.$refs.replyForm && this.$refs.replyForm.resetForm()
                this.placeElement.auditBasePopup = false
                this.placeElement.onLoad(this.placeElement.page)
            })
        },
    }
}
</script>