<template>
|
<div>
|
<el-form class="evaluation" size="mini" ref="form" :model="form" label-width="100px" :rules="formRules">
|
<basic-info :form="form"></basic-info>
|
<el-form-item label="审核:" prop="auditStatus">
|
<el-radio-group v-model="form.auditStatus">
|
<el-radio :label="1">通过</el-radio>
|
<el-radio :label="2" >拒绝</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</el-form>
|
<el-row class="buttonPosition">
|
<el-button type="primary" size="mini" @click="submit" :loading="submitFlag">保存</el-button>
|
<el-button size="mini" @click="cancel">取消</el-button>
|
</el-row>
|
</div>
|
</template>
|
<script>
|
import basicInfo from '@/views/evaluationMgt/components/basicInfo.vue'
|
import evaluationApi from '@/api/evaluation'
|
export default {
|
components: { basicInfo },
|
props: ['form'],
|
data () {
|
return {
|
formRules: {
|
auditStatus: [
|
{ required: true, message: '请选择审核状态', trigger: 'change' }]
|
},
|
submitFlag: false
|
}
|
},
|
methods: {
|
/**
|
* 保存
|
*/
|
submit () {
|
console.log(this.$refs.form)
|
this.$refs.form.validate().then(async res => {
|
this.submitFlag = true
|
try {
|
const res = await evaluationApi.audit({
|
id: this.form.id,
|
auditStatus: this.form.auditStatus
|
})
|
if (res.code === '0') {
|
this.innerVisible = false
|
this.$message({
|
type: 'success',
|
message: res.msg
|
})
|
this.$emit('audit-operation', true)
|
}
|
this.submitFlag = false
|
} catch (error) {
|
this.submitFlag = false
|
}
|
}).catch(() => {})
|
},
|
/**
|
* 取消
|
*/
|
cancel () {
|
this.$emit('audit-operation', false)
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
.buttonPosition{
|
text-align: center;
|
margin-top: 10px;
|
}
|
|
</style>
|