fix : 修复权限按钮细节
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
<template>
|
||||
<baseTitle title="审核意见"></baseTitle>
|
||||
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
|
||||
<div class="oper">
|
||||
<div class="oper-page-btn">
|
||||
<el-button type="danger" @click="handleReject">驳回</el-button>
|
||||
<el-button type="primary" @click="handleAgree">同意</el-button>
|
||||
<el-button color="#DED0B2" @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";
|
||||
import {ElNotification} from 'element-plus';
|
||||
import {agreeTask, rejectTask} from "@/api/project-demand/index.js";
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const props = defineProps({
|
||||
taskId: {
|
||||
type: String,
|
||||
@@ -22,10 +25,10 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const form = ref()
|
||||
const schema = computed(()=>{
|
||||
const schema = computed(() => {
|
||||
return [
|
||||
{
|
||||
label: '审核意见',
|
||||
label: '',
|
||||
prop: 'auditOpinion',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
@@ -39,16 +42,29 @@ const schema = computed(()=>{
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// {
|
||||
// "auditOpinion": "统一",
|
||||
// "formData": {"formData":""},
|
||||
// "taskId": "156e69b7-15eb-11ef-a152-f268fc747b04"
|
||||
// }
|
||||
const back = () => {
|
||||
switch (route.name) {
|
||||
case 'Initiation/detail':
|
||||
router.push({name: 'Initiation'})
|
||||
break;
|
||||
case 'Filing/detail':
|
||||
router.push({name: 'Filing'})
|
||||
break;
|
||||
case 'Implementation/detail':
|
||||
router.push({name: 'Implementation'})
|
||||
break;
|
||||
case 'Summary/detail':
|
||||
router.push({name: 'Summary'})
|
||||
break;
|
||||
case 'Requirement/detail':
|
||||
router.push({name: 'Requirement'})
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 驳回
|
||||
const handleReject = async () => {
|
||||
const values = form.value.getValues()
|
||||
if(!values.auditOpinion) {
|
||||
if (!values.auditOpinion) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请填写审核意见',
|
||||
@@ -56,12 +72,18 @@ const handleReject = async () => {
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log('values', values)
|
||||
const params = {
|
||||
// taskId: props.taskId,
|
||||
// formData: props.formData,
|
||||
// ...values
|
||||
taskId: props.taskId,
|
||||
...values
|
||||
}
|
||||
const res = await rejectTask(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
back()
|
||||
}
|
||||
|
||||
const handleAgree = async () => {
|
||||
@@ -72,9 +94,15 @@ const handleAgree = async () => {
|
||||
...values
|
||||
}
|
||||
const res = await agreeTask(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
back()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user