Merge pull request 'fix : 修复需求上报/详情下流程渲染' (#215) from dj into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/215
This commit is contained in:
@@ -74,10 +74,8 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v
|
|||||||
import {matterTree} from '@/utils/matterTree.js';
|
import {matterTree} from '@/utils/matterTree.js';
|
||||||
import {downloadFile} from "@/api/project-demand";
|
import {downloadFile} from "@/api/project-demand";
|
||||||
|
|
||||||
const emit = defineEmits(['getInfo'])
|
const emit = defineEmits(['getInfo',"update:formData"])
|
||||||
const form = ref()
|
const form = ref()
|
||||||
const showForm = ref(true)
|
|
||||||
const loading = ref(false)
|
|
||||||
const showTable = ref(false)
|
const showTable = ref(false)
|
||||||
const companyNameArray = ref([])
|
const companyNameArray = ref([])
|
||||||
|
|
||||||
@@ -97,7 +95,10 @@ const props = defineProps({
|
|||||||
companyOption: {
|
companyOption: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: []
|
||||||
},
|
}, loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const tableConfig = reactive({
|
const tableConfig = reactive({
|
||||||
columns: [
|
columns: [
|
||||||
@@ -136,10 +137,6 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const getInfo = () => {
|
|
||||||
emit('getInfo')
|
|
||||||
}
|
|
||||||
const handleDownload = (row) => {
|
const handleDownload = (row) => {
|
||||||
downloadFile(row.fileId).then(res => {
|
downloadFile(row.fileId).then(res => {
|
||||||
const blob = new Blob([res])
|
const blob = new Blob([res])
|
||||||
@@ -155,25 +152,23 @@ const getDataSourceOptionItem = (val) => {
|
|||||||
matterTree(companyNameArray.value, props.companyOption, item)
|
matterTree(companyNameArray.value, props.companyOption, item)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return companyNameArray.value.join(',');
|
let uniqueArr = Array.from(new Set(companyNameArray.value));
|
||||||
|
return uniqueArr.join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(() => props.loading, (newVal) => {
|
||||||
|
props.loading = newVal
|
||||||
|
}, {deep: true})
|
||||||
|
|
||||||
watch(() => props.companyOption, (newVal) => {
|
watch(() => props.companyOption, (newVal) => {
|
||||||
props.companyOption = newVal
|
props.companyOption = newVal
|
||||||
}, {deep: true})
|
}, {deep: true})
|
||||||
watch(() => props.formData, (newVal) => {
|
watch(() => props.formData.companyIds, (newVal) => {
|
||||||
if (newVal) {
|
props.formData.companyIds = getDataSourceOptionItem(newVal)
|
||||||
newVal.companyIds = getDataSourceOptionItem(newVal.companyIds)
|
|
||||||
props.formData=newVal
|
|
||||||
}
|
|
||||||
}, {deep: true})
|
}, {deep: true})
|
||||||
watch(() => props.processViewer, (newVal) => {
|
watch(() => props.processViewer, (newVal) => {
|
||||||
props.processViewer = newVal
|
props.processViewer = newVal
|
||||||
}, {deep: true})
|
}, {deep: true})
|
||||||
onMounted(() => {
|
|
||||||
loading.value = true
|
|
||||||
getInfo()
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form :model="localFormData" ref="summaryForm">
|
<div class="detail-block" v-loading="loading">
|
||||||
|
<el-form :model="localFormData" ref="summaryForm" :rules="rules">
|
||||||
<el-row gutter="50">
|
<el-row gutter="50">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="名称" prop="requirementName">
|
<el-form-item label="名称" prop="projectName">
|
||||||
<span>{{ localFormData.requirementId }}</span>
|
<span>{{ localFormData.projectName }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -32,8 +33,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="结束时间" prop="endTime">
|
<el-form-item label="研发主体" prop="rdSubject">
|
||||||
<span>{{ localFormData.endTime }}</span>
|
<span>{{ localFormData.rdSubject }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -123,7 +124,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="需求上报申请书">
|
<el-form-item label="需求上报申请书">
|
||||||
<el-button type="primary" link @click="handleDownload(localFormData.singleFile)">{{localFormData.singleFile?.originalFileName}}</el-button>
|
<el-button type="primary" link @click="handleDownload(localFormData.singleFile)">
|
||||||
|
{{ localFormData.singleFile?.originalFileName }}
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@@ -136,23 +139,45 @@
|
|||||||
</fvTable>
|
</fvTable>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div v-if="data.taskId">
|
||||||
|
<baseTitle title="审核意见"></baseTitle>
|
||||||
|
<el-form-item prop="auditOpinion">
|
||||||
|
<el-input
|
||||||
|
v-model="localFormData.auditOpinion"
|
||||||
|
:rows="3"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入审核意见"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="approval-record">
|
<div class="approval-record">
|
||||||
<baseTitle title="审批记录"></baseTitle>
|
<baseTitle title="审批记录"></baseTitle>
|
||||||
<div class="process">
|
<div class="process">
|
||||||
<operation-render v-if="processViewer" :operation-list="data.operationList"
|
<operation-render v-if="processViewer" :operation-list="data.operationList"
|
||||||
:state="data.state"/>
|
:state="data.state"/>
|
||||||
<process-diagram-viewer v-if="processViewer"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="oper-page-btn" v-if="data.state === '1' && data.taskId">
|
||||||
|
<el-button @click="handleReject(summaryForm)">驳回</el-button>
|
||||||
|
<el-button color="#DED0B2" @click="handleAgree">同意</el-button>
|
||||||
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import {downloadFile} from "@/api/project-demand";
|
import {downloadFile} from "@/api/project-demand";
|
||||||
import OperationRender from '@/views/workflow/common/OperationRender.vue'
|
import OperationRender from '@/views/workflow/common/OperationRender.vue'
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
|
||||||
|
import {ElMessage, ElNotification} from "element-plus";
|
||||||
|
import {agreeTask, rejectTask} from "@/api/project-demand";
|
||||||
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
|
|
||||||
|
const tagsViewStore = useTagsView()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formData: {
|
formData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -165,7 +190,10 @@ const props = defineProps({
|
|||||||
processViewer: {
|
processViewer: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
}, loading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const localFormData = ref({})
|
const localFormData = ref({})
|
||||||
const tableConfig = reactive({
|
const tableConfig = reactive({
|
||||||
@@ -205,7 +233,54 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
const router = useRouter()
|
||||||
|
const summaryForm = ref()
|
||||||
|
const rules = reactive({
|
||||||
|
auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}],
|
||||||
|
})
|
||||||
|
const handleReject = (instance) => {
|
||||||
|
if (!instance) return
|
||||||
|
instance.validate(async (valid) => {
|
||||||
|
if (!valid) return
|
||||||
|
let approve = {
|
||||||
|
taskId: props.data.taskId,
|
||||||
|
auditOpinion: localFormData.value.auditOpinion,
|
||||||
|
}
|
||||||
|
rejectTask(approve).then(res => {
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: res.msg,
|
||||||
|
type: res.code === 1000 ? 'success' : 'error'
|
||||||
|
})
|
||||||
|
if (res.code === 1000) {
|
||||||
|
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
|
router.push({
|
||||||
|
name: 'Summary'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const handleAgree = () => {
|
||||||
|
let approve = {
|
||||||
|
taskId: props.data.taskId,
|
||||||
|
auditOpinion: localFormData.value.auditOpinion,
|
||||||
|
formData: localFormData.value
|
||||||
|
}
|
||||||
|
agreeTask(approve).then(res => {
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: res.msg,
|
||||||
|
type: res.code === 1000 ? 'success' : 'error'
|
||||||
|
})
|
||||||
|
if (res.code === 1000) {
|
||||||
|
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
|
router.push({
|
||||||
|
name: 'Summary'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const handleDownload = (row) => {
|
const handleDownload = (row) => {
|
||||||
downloadFile(row.fileId).then(res => {
|
downloadFile(row.fileId).then(res => {
|
||||||
const blob = new Blob([res])
|
const blob = new Blob([res])
|
||||||
@@ -222,6 +297,12 @@ watch(
|
|||||||
console.log(val, 'ssss');
|
console.log(val, 'ssss');
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
watch(() => props.processViewer, (newVal) => {
|
||||||
|
props.processViewer = newVal
|
||||||
|
}, {deep: true})
|
||||||
|
watch(() => props.loading, (newVal) => {
|
||||||
|
props.loading = newVal
|
||||||
|
}, {deep: true})
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
Object.keys(props.formData).length && (localFormData.value = props.formData)
|
Object.keys(props.formData).length && (localFormData.value = props.formData)
|
||||||
@@ -233,4 +314,10 @@ watchEffect(()=>{
|
|||||||
height: auto !important;
|
height: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.detail-block {
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="detail-block">
|
<div class="detail-block" v-loading="loading">
|
||||||
<baseTitle title="需求上报"></baseTitle>
|
<baseTitle title="需求上报"></baseTitle>
|
||||||
<el-form :model="formData" ref="summaryForm" :rules="rules">
|
<el-form :model="formData" ref="summaryForm" :rules="rules">
|
||||||
<el-row gutter="50">
|
<el-row gutter="50">
|
||||||
@@ -223,6 +223,13 @@
|
|||||||
@getAttachment="getAttachment"
|
@getAttachment="getAttachment"
|
||||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="router.currentRoute.value.name === 'Summary/edit'"/>
|
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="router.currentRoute.value.name === 'Summary/edit'"/>
|
||||||
<!-- <fvForm :schema="schame" @getInstance="getInstance"></fvForm>-->
|
<!-- <fvForm :schema="schame" @getInstance="getInstance"></fvForm>-->
|
||||||
|
<div class="approval-record">
|
||||||
|
<baseTitle title="流程"></baseTitle>
|
||||||
|
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
||||||
|
<!-- <div class="process" id="approvalRecord">-->
|
||||||
|
<!-- <process-tree ref="processTree" mode="view" id-name="approvalRecord"/>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
</div>
|
||||||
<div class="oper-page-btn">
|
<div class="oper-page-btn">
|
||||||
<el-button type="primary" @click="staging">存为草稿</el-button>
|
<el-button type="primary" @click="staging">存为草稿</el-button>
|
||||||
<el-button type="primary" @click="handleSubmit(summaryForm)">发布</el-button>
|
<el-button type="primary" @click="handleSubmit(summaryForm)">发布</el-button>
|
||||||
@@ -236,12 +243,16 @@ import {getDetail, getProcessInfo, requirementReported, resubmitReported} from "
|
|||||||
import {ElMessage, ElNotification} from "element-plus";
|
import {ElMessage, ElNotification} from "element-plus";
|
||||||
import {useTagsView} from '@/stores/tagsview.js'
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
import {useCacheStore} from '@/stores/cache.js'
|
import {useCacheStore} from '@/stores/cache.js'
|
||||||
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
import {getSubCompOpt} from "@/api/user/user";
|
import {getSubCompOpt} from "@/api/user/user";
|
||||||
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||||
const cacheStore = useCacheStore()
|
const cacheStore = useCacheStore()
|
||||||
|
const processStore = useProcessStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const name=ref(router.currentRoute.value.name)
|
const name=ref(router.currentRoute.value.name)
|
||||||
|
const loading = ref(false)
|
||||||
|
const processDiagramViewer = ref(false)
|
||||||
const tagsViewStore = useTagsView()
|
const tagsViewStore = useTagsView()
|
||||||
const companyOption = ref([])
|
const companyOption = ref([])
|
||||||
const summaryForm = ref()
|
const summaryForm = ref()
|
||||||
@@ -430,6 +441,7 @@ const getDetailInfo = async () => {
|
|||||||
})
|
})
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
formData.value = res.data.formData
|
formData.value = res.data.formData
|
||||||
|
loading.value=false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -445,20 +457,30 @@ const init = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
let data = res.data
|
let data = res.data
|
||||||
deploymentId.value = data.deploymentId
|
deploymentId.value = data.deploymentId
|
||||||
|
processStore.setDesign(data)
|
||||||
|
processStore.runningList.value = data.runningList;
|
||||||
|
processStore.endList.value = data.endList;
|
||||||
|
processStore.noTakeList.value = data.noTakeList;
|
||||||
|
processStore.refuseList.value = data.refuseList;
|
||||||
|
processStore.passList.value = data.passList;
|
||||||
|
nextTick(() => {
|
||||||
|
processDiagramViewer.value = true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
loading.value=true
|
||||||
await init()
|
await init()
|
||||||
if (route.query.projectId) {
|
if (route.query.projectId) {
|
||||||
await getDetailInfo()
|
await getDetailInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
const staging = async () => {
|
const staging = async () => {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
.detail-block {
|
.detail-block {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<steps :active="active" @setDetail="setDetail" @stepChange="stepChange">
|
<steps :active="active" @setDetail="setDetail" @stepChange="stepChange">
|
||||||
<template #content>
|
<template #content>
|
||||||
<collection-detail v-show="showActive == '00'" :formData="summaryData.formData" :data="summaryData"
|
<collection-detail v-show="showActive == '00'" :formData="summaryData.formData" :data="summaryData"
|
||||||
:processViewer="summaryProcessViewer" :companyOption="companyOption" />
|
:processViewer="summaryProcessViewer" :companyOption="companyOption" :loading="loading"/>
|
||||||
<summary-detail v-show="showActive == '10'" :formData="summaryData.formData" :data="summaryData"
|
<summary-detail v-show="showActive == '10'" :formData="summaryData.formData" :data="summaryData"
|
||||||
:processViewer="summaryProcessViewer"/>
|
:processViewer="summaryProcessViewer" :loading="loading"/>
|
||||||
</template>
|
</template>
|
||||||
</steps>
|
</steps>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,6 +20,7 @@ const route = useRoute()
|
|||||||
const companyOption = ref([])
|
const companyOption = ref([])
|
||||||
const summaryData = ref({})
|
const summaryData = ref({})
|
||||||
const summaryProcessViewer = ref(true)
|
const summaryProcessViewer = ref(true)
|
||||||
|
const loading = ref(false)
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
const active = ref(route.query.state)
|
const active = ref(route.query.state)
|
||||||
const showActive = ref()
|
const showActive = ref()
|
||||||
@@ -31,8 +32,10 @@ const getInfo = async (state) => {
|
|||||||
const projectId = route.query.projectId
|
const projectId = route.query.projectId
|
||||||
await getCompanyOption()
|
await getCompanyOption()
|
||||||
summaryProcessViewer.value = false
|
summaryProcessViewer.value = false
|
||||||
|
loading.value = true
|
||||||
const {code, data} = await getMapProjectStateInfo(projectId, state)
|
const {code, data} = await getMapProjectStateInfo(projectId, state)
|
||||||
summaryData.value = data;
|
summaryData.value = data;
|
||||||
|
loading.value = false
|
||||||
processStore.setDesign(data)
|
processStore.setDesign(data)
|
||||||
processStore.runningList.value = data.runningList;
|
processStore.runningList.value = data.runningList;
|
||||||
processStore.endList.value = data.endList;
|
processStore.endList.value = data.endList;
|
||||||
|
|||||||
Reference in New Issue
Block a user