rejectDialog.vue
1.79 KB
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
<!-- 驳回弹窗 -->
<template>
<GLDialog title="驳回" :visible.sync="dialogVisible" class="rejectDialog" :destroy-on-close="true"
:close-on-click-modal="false" :before-close="handleClose" @onOk="handleConfirm" @onCancel="handleClose">
<el-form ref="rejectForm" class="rejectForm" :model="dataForm" :rules="formRules" label-width="154px" size="small">
<el-form-item label="驳回原因:" prop="reason">
<el-input v-model.trim="dataForm.reason" placeholder="请输入驳回原因" maxlength="20" class="form-node"></el-input>
</el-form-item>
</el-form>
</GLDialog>
</template>
<script>
import { beforeRangePickerOptions } from '@/components/glsx-combi-form/common'
export default {
name: 'rejectDialog',
props: {
visible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => { }
}
},
data() {
return {
beforeRangePickerOptions,
dataForm: {
reason: ''
},
formRules: {
reason: [{ required: true, message: '请输入驳回原因', trigger: 'change' }]
},
}
},
computed: {
dialogVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
mounted() {
this.$nextTick(() => {
this.$refs['rejectForm'].resetFields()
})
},
methods: {
handleClose() {
this.dialogVisible = false
},
handleConfirm() {
this.$refs['rejectForm'].validate(valid => {
if (valid) {
this.$emit('handleRejectConfirm', this.dataForm)
}
})
},
}
}
</script>
<style scoped lang="scss">
.rejectDialog {
.form-node {
width: 432px;
}
::v-deep.el-dialog__body {
display: flex;
align-items: center;
}
}
</style>