feat: up detail
This commit is contained in:
81
src/components/DetailComponent/ApprovalDetail.vue
Normal file
81
src/components/DetailComponent/ApprovalDetail.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<div>
|
||||
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
|
||||
<!-- <AttachmentUpload></AttachmentUpload> -->
|
||||
|
||||
<div class="approval-record">
|
||||
<baseTitle title="审批记录"></baseTitle>
|
||||
<div class="process">
|
||||
<operation-render v-if="processViewer" :operation-list="data.operationList"
|
||||
:state="data.state"/>
|
||||
<process-diagram-viewer v-if="processViewer"/>
|
||||
</div>
|
||||
</div>
|
||||
<Opinion: v-if="data.taskId" :formData="formData" :taskId="formData.taskId"></Opinion:>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { computed, markRaw, reactive, ref, watchEffect } from 'vue';
|
||||
import AttachmentUpload from '../AttachmentUpload.vue';
|
||||
import OperationRender from '@/views/workflow/common/OperationRender.vue'
|
||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||
import Opinion from './Opinion.vue';
|
||||
import fvTable from '@/fvcomponents/fvTable/index.vue'
|
||||
|
||||
const props = defineProps({
|
||||
formData: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
processViewer: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
companyOption: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
})
|
||||
|
||||
const form = ref()
|
||||
|
||||
const localData = reactive({
|
||||
fileList: props.formData.fileList
|
||||
})
|
||||
|
||||
const schema = computed(()=>{
|
||||
return [
|
||||
{
|
||||
label: '前置流程',
|
||||
prop: 'preProcess',
|
||||
colProps: {
|
||||
span: 24
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '项目立项附件',
|
||||
prop: 'singleFile',
|
||||
colProps: {
|
||||
span: 24
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '其他文件',
|
||||
prop: 'fileList',
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
watchEffect(()=>{
|
||||
Object.keys(props.formData).length && (form.value.setValues(props.formData))
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
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