Merge remote-tracking branch 'origin/master'

This commit is contained in:
2024-05-20 00:29:46 +08:00
5 changed files with 246 additions and 17 deletions

View 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>

View 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>

View File

@@ -39,7 +39,7 @@ const props = defineProps({
// 当前显示步骤
active: {
type: Number,
default: 0
default: '0'
},
// 已完成的工作流步骤
stepSuccess: {
@@ -168,18 +168,23 @@ const formatReProcedure = (data) => {
const formatActive = (val) => {
console.log(val, 'val');
let active = ''
switch(val) {
case '0' || 0 : active = '00'
break
case '1' || 1 : active = '10'
break
case '2' || 2 : active = '20'
break
case '3' || 3 : active = '30'
break
case '4' || 4 : active = '40'
break
}
// switch(val) {
// case '0' : active = '00'
// break
// case '1' : active = '10'
// break
// case '2' : active = '20'
// break
// case '3' : active = '30'
// break
// case '4' : active = '40'
// break
// }
val == 0 && (active = '00')
val == 1 && (active = '10')
val == 2 && (active = '20')
val == 3 && (active = '30')
val == 4 && (active = '40')
console.log(active, 'active--');
return active
}