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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
<div class="app-content from-table" style="max-height:450px;overflow:auto;">
<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>
<unit-info :data="unitData" />
<a-row>
<a-col :span="24">
<div class="tb-title">
<span>管理员信息</span>
</div>
</a-col>
</a-row>
<unit-manager-info :data="managerData" />
<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>
<a-col :span="4" class="bg-gray" style="border-top: 0px">
审核意见
</a-col>
<a-col :span="20" style="border-top: 0px">
<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>
<a-col :span="4" class="bg-gray">
审核结果
</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 moment from 'moment'
import unitInfo from '@/views/unit/components/unitInfo'
import unitManagerInfo from '@/views/unit/components/unitManagerInfo'
import { isEmptyParams } from "@/views/utils/common";
export default {
name: "unitAudit",
components: {
unitInfo, unitManagerInfo
},
data () {
return {
loading: false,
unitData: {},
managerData: [],
formData: { id: this.value, auditResult: this.auditInfo.auditResult == 1 ? null : this.auditInfo.auditResult, auditContent: this.auditInfo.auditContent },
rules: {
auditContent: { required: true, message: '请填写审核意见', trigger: 'blur' },
auditResult: { required: true, message: '请选择审核结果', trigger: 'change' },
},
loading: false,
}
},
props: {
value: {
type: String,
default: () => {
return null
}
},
auditInfo: {
type: Object,
default: () => {
return null
}
}
},
created () {
this.getUnitById()
},
methods: {
moment,
getUnitById () {
if (this.value) {
this.loading = true
this.$api.unit.getUnitById({ id: this.value }).then(({ data = {} }) => {
if (data) {
this.unitData = data
this.managerData = data.managers
} 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.unit.audit(par).then(({ data = {} }) => {
if (data) {
this.$message.success('审核成功!')
this.$emit('close', 'audit')
} this.loading = false
}).catch(() => { this.loading = false })
}
})
}
}
}
</script>