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
<template>
<div class="from-table font-line-space" style="height:65vh;overflow:auto;">
<a-spin :spinning="loading" style="width: 100%;height: 100%;">
<thesis-info v-model="conclusionData" />
<a-form-model ref="form" :model="auditObj" :rules="rules" class="from-table">
<audit-edit :auditObj.sync="auditObj" :disabledBtns.sync="disabledBtns" />
</a-form-model>
</a-spin>
</div>
</template>
<script>
import { isEmptyParams } from "@/views/utils/common";
import thesisInfo from '@/views/conclusion/components/thesis/thesisInfo'
import auditEdit from '@/views/audit/components/auditEdit'
export default {
name: "Audit",
components: {
thesisInfo, auditEdit
},
data () {
return {
conclusionData: {
projNo: null,
projName: null,
appPersonName: null,
appUnitName: null,
telephone: null,
planCategory: null,
startDate: null,
endDate: null,
promotionContent: null,
promotionTarget: null,
selfEvaluation: null,
achievingResults: null,
thesisList: [],
researchersList: [],
//拔款
grant: [],
//其它途径筹资
finance: [],
//主要支出项目
spending: [],
balance: null,
researchContent: null,
workPlan: null,
extensionReport: null,
fileList: [],
catalogList: [],
},
auditObj: { id: this.value, auditObjectId: this.objectId, auditResult: null, auditType: 5, auditContent: '' },
rules: {
auditContent: { required: true, message: '请填写审核意见', trigger: 'blur' },
auditResult: { required: true, message: '请选择审核结果', trigger: 'change' },
},
loading: false,
};
},
props: {
value: {
type: String,
default: () => {
return null;
},
},
projId: {
type: String,
default: () => {
return null
}
},
objectId: {
type: String,
default: () => {
return null
}
},
disabledBtns: {
type: Object,
default: () => {
return {
btnPassed: false,
btnReturn: false,
btnUnpassed: false,
}
}
}
},
created () {
this.getConclusionByProjId()
},
methods: {
getConclusionByProjId () {
this.loading = true
if (!!this.projId) {
this.$api.conclusion.getConclusionByProjId({ id: this.projId }).then(({ data = {} }) => {
if (data) {
this.conclusionData = data
this.loading = false
} else {
this.$emit('closeWindow', 'error')
}
}).catch(() => {
this.$emit('closeWindow', 'error')
})
} else {
this.$emit('closeWindow', 'error')
}
},
submit () {
this.$refs.form.validate(valid => {
if (valid) {
this.loading = true
let pars = isEmptyParams(this.auditObj)
let par = { ...pars }
this.$api.conclusion.thesisAudit(par).then(({ data = {} }) => {
if (data) {
this.$message.success('审核成功!')
this.$emit('closeWindow', 'audit')
}
}).catch((error) => {
this.$message.error(error)
this.loading = false
})
} else {
this.$message.error('请选择审核结果或填写审核意见!')
return false
}
})
},
},
}
</script>
<style lang="less" scoped>
</style>