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
<template>
<div class="from-table">
<a-spin :spinning="loading" style="width: 100%;height: 100%;">
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>人员信息</span>
</div>
</a-col>
</a-row>
<person-info :data="personInfo" />
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>审核</span>
</div>
</a-col>
</a-row>
<a-form-model ref="form" :model="formData" :rules="rules">
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div>审核意见</div>
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="auditContent">
<a-input v-model="formData.auditContent" :maxLength="30" style="width:400px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
<div class="special-middle">
<div>审核结果</div>
</div>
</a-col>
<a-col :span="20">
<a-form-model-item prop="auditResult">
<a-radio-group v-model="formData.auditResult" @change="onChange">
<a-radio :value="10">通过 </a-radio>
<a-radio :value="20">不通过 </a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
</div>
</template>
<script>
import personInfo from '@/views/person/components/personInfo'
import { isEmptyParams } from "@/views/utils/common"
export default {
name: "personAudit",
components: {
personInfo
},
data () {
return {
formData: { id: this.value, auditResult: null, auditContent: null },
personInfo: {},
rules: {
auditContent: { required: true, message: '请填写审核意见', trigger: 'blur' },
auditResult: { required: true, message: '请选择审核结果', trigger: 'change' },
},
loading: false
}
},
props: {
value: {
type: String,
default: () => {
return null
}
},
},
created () {
this.getPersonById()
},
methods: {
getPersonById () {
this.loading = true
this.$api.person.getPersonById({ id: this.value }).then(({ data = {} }) => {
if (data) {
this.personInfo = data
this.formData.auditResult = data.auditResult == 1 ? null : data.auditResult
this.formData.auditContent = data.auditContent
}
this.loading = false
}).catch(() => { this.loading = false })
},
onChange (e) {
},
submit () {
this.$refs.form.validate(valid => {
if (valid) {
this.loading = true
let pars = isEmptyParams(this.formData)
let par = { ...pars }
this.$api.person.audit(par).then(({ data = {} }) => {
if (data) {
this.$message.success('审核成功!')
this.$emit('close', 'audit')
}
this.loading = false
}).catch(() => { this.loading = false })
}
})
}
}
}
</script>