feat: up detail
This commit is contained in:
80
src/components/DetailComponent/Opinion.vue
Normal file
80
src/components/DetailComponent/Opinion.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
|
||||
<div class="oper">
|
||||
<el-button type="danger" @click="handleReject">驳回</el-button>
|
||||
<el-button type="primary" @click="handleAgree">同意</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { ElLoading, ElNotification } from 'element-plus';
|
||||
import { agreeTask, rejectTask} from "@/api/project-demand/index.js";
|
||||
|
||||
const props = defineProps({
|
||||
taskId: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
formData: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
|
||||
const form = ref()
|
||||
const schema = computed(()=>{
|
||||
return [
|
||||
{
|
||||
label: '审核意见',
|
||||
prop: 'auditOpinion',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入审核意见',
|
||||
type: 'textarea',
|
||||
maxlength: 140
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// {
|
||||
// "auditOpinion": "统一",
|
||||
// "formData": {"formData":""},
|
||||
// "taskId": "156e69b7-15eb-11ef-a152-f268fc747b04"
|
||||
// }
|
||||
// 驳回
|
||||
const handleReject = async () => {
|
||||
const values = form.value.getValues()
|
||||
if(!values.auditOpinion) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请填写审核意见',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
const params = {
|
||||
// taskId: props.taskId,
|
||||
// formData: props.formData,
|
||||
// ...values
|
||||
}
|
||||
const res = await rejectTask(params)
|
||||
}
|
||||
|
||||
const handleAgree = async () => {
|
||||
const values = form.value.getValues()
|
||||
const params = {
|
||||
taskId: props.taskId,
|
||||
formData: props.formData,
|
||||
...values
|
||||
}
|
||||
const res = await agreeTask(params)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user