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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template>
<div class="report-detail">
<div style="margin-top: 16px;">
<check-info v-model="checkInfo" />
<a-form-model ref="form" :model="auditObj" :rules="rules">
<audit-edit :auditObj.sync="auditObj" />
<a-row>
<a-col :span="24" class="bg-gray">
<a-button @click="cancel">取消</a-button>
<a-button type="primary" @click="submit">提交</a-button>
</a-col>
</a-row>
</a-form-model>
</div>
</div>
</template>
<script>
import { isEmptyParams } from '@/views/utils/common'
import moment from 'moment'
import CheckInfo from '@/views/report/check/components/checkInfo'
import AuditList from '@/views/audit/components/auditInfo'
import AuditEdit from '@/views/audit/components/auditEdit'
export default {
name: 'Audit',
components: {
CheckInfo,
AuditList,
AuditEdit,
},
data() {
return {
checkInfo: {
id: '',
projId: '',
checkYear: null,
// 工作进展
workProgress: '',
// 其他(请做说明)
otherResults: '',
// 项目批准经费
applyMoney: 0,
// 已使用经费
usingMoney: 0,
// 现结余经费
surplusMoney: 0,
// 经费具体使用情况说明
moneyInstructions: '',
checkState: null,
projName: '',
projNo: '',
appPersonName: '',
appUnitName: '',
startDate: '',
endDate: '',
// 成果
results: [],
auditList: [{ result: '', unit: '', time: '' }],
},
auditObj: {
id: this.value,
auditObjectId: this.objId,
auditResult: null,
auditType: 3,
auditContent: '',
},
rules: {
auditContent: {
required: true,
message: '请填写审核意见',
trigger: 'blur',
},
auditResult: {
required: true,
message: '请选择审核结果',
trigger: 'change',
},
},
}
},
props: {
value: {
type: String,
default: () => {
return null
},
},
objId: {
type: String,
default() {
return null
},
},
},
created() {
this.getCheckInfoById()
},
methods: {
moment,
getCheckInfoById() {
let pars = { id: this.objId }
if (this.objId != null) {
this.$api.checkReport
.getCheckInfoById(pars)
.then(({ data = {} }) => {
if (data) {
this.checkInfo = data
this.checkInfo.startDate = moment(
this.checkInfo.startDate
).format('YYYY年MM月DD日')
this.checkInfo.endDate = moment(this.checkInfo.endDate).format(
'YYYY年MM月DD日'
)
}
})
.catch(() => {
this.loading = false
})
}
},
cancel() {
this.$emit('closeWindow', 'auditcel')
},
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
let pars = isEmptyParams(this.auditObj)
let par = { ...pars }
this.$api.auditManager
.checkAudit(par)
.then(({ data = {} }) => {
if (data) {
this.$message.success('审核成功!')
this.$emit('closeWindow', 'audit')
}
})
.catch(() => {
this.loading = false
})
} else {
return false
}
})
},
},
}
</script>
<style lang="less" scoped>
.report-detail {
height: 70vh;
overflow: auto;
border-left: 1px solid #f0f0f0;
border-top: 1px solid #f0f0f0;
}
</style>