feat : 需求变更详情修改
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
<template>
|
||||||
|
<el-button type="primary" link >
|
||||||
|
{{ modelValue || '请选择抄送人员' }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, watch, watchEffect } from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// const emit = defineEmits('update: modelValue')
|
||||||
|
|
||||||
|
const localText = ref('')
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="apply-block">
|
<div class="apply-block">
|
||||||
|
<div>
|
||||||
|
抄送人员:
|
||||||
|
<Ttsup :modelValue="chooseUserInfo()" @click="chooseUser"/>
|
||||||
|
</div>
|
||||||
|
<user-picker :multiple="true" ref="userPicker" title="请选择抄送人员" v-model:value="userList" @ok="selected"/>
|
||||||
<AttachmentUpload ref="attachment" label="阶段变更附件" :showTable="showTable" :otherFileList="otherFileList"
|
<AttachmentUpload ref="attachment" label="阶段变更附件" :showTable="showTable" :otherFileList="otherFileList"
|
||||||
@getAttachment="getAttachment"
|
@getAttachment="getAttachment"
|
||||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Phase/edit'"/>
|
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
|
||||||
|
:preview="name === 'Phase/edit'"/>
|
||||||
<div class="approval-record">
|
<div class="approval-record">
|
||||||
<baseTitle title="流程"></baseTitle>
|
<baseTitle title="流程"></baseTitle>
|
||||||
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
||||||
@@ -16,7 +22,9 @@
|
|||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||||
import {getPhaseProcess,submitPhaseChange,getPhaseForm,resubmitPhaseForm} from "@/api/project-manage";
|
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||||
|
import Ttsup from './components/ToolToShowUserPicker.vue'
|
||||||
|
import {getPhaseProcess, submitPhaseChange, getPhaseForm, resubmitPhaseForm} from "@/api/project-manage";
|
||||||
import {ElNotification} from "element-plus";
|
import {ElNotification} from "element-plus";
|
||||||
import {useProcessStore} from '@/stores/processStore.js';
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
import {useTagsView} from '@/stores/tagsview.js'
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
@@ -25,6 +33,7 @@ const tagsViewStore = useTagsView()
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const attachment = ref()
|
const attachment = ref()
|
||||||
|
const userPicker = ref()
|
||||||
const name = ref(router.currentRoute.value.name)
|
const name = ref(router.currentRoute.value.name)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const formData = ref({})
|
const formData = ref({})
|
||||||
@@ -34,6 +43,7 @@ const showTable = ref(true)
|
|||||||
const otherFileList = ref([])
|
const otherFileList = ref([])
|
||||||
const processInstanceData = ref()
|
const processInstanceData = ref()
|
||||||
const processDiagramViewer = ref(true)
|
const processDiagramViewer = ref(true)
|
||||||
|
const userList = ref([])
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
const compositeParam = (item) => {
|
const compositeParam = (item) => {
|
||||||
let tag = ''
|
let tag = ''
|
||||||
@@ -70,39 +80,131 @@ const getFileParam = (item) => {
|
|||||||
tag: item.tag
|
tag: item.tag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleSubmit =async () => {
|
|
||||||
let files = []
|
const chooseUser = () => {
|
||||||
let singleFile = {}
|
userPicker.value.showUserPicker()
|
||||||
let fileArray
|
}
|
||||||
|
const chooseUserInfo = () => {
|
||||||
|
if (userList.value.length > 0){
|
||||||
|
return userList.value.map(item => {
|
||||||
|
return item.name
|
||||||
|
}).join(',')
|
||||||
|
}else {
|
||||||
|
return "请选择抄送人员"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const selected = (select) => {
|
||||||
|
let userInfoList = []
|
||||||
|
for (let val of select) {
|
||||||
|
let userInfo = {
|
||||||
|
id: val.id,
|
||||||
|
name: val.name,
|
||||||
|
avatar: val.avatar,
|
||||||
|
}
|
||||||
|
userInfoList.push(userInfo)
|
||||||
|
}
|
||||||
|
userList.value = userInfoList
|
||||||
|
}
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
let files = []
|
||||||
|
let singleFile = {}
|
||||||
|
let fileArray
|
||||||
|
if (file.value.fileId !== undefined) {
|
||||||
|
singleFile = {
|
||||||
|
fileId: file.value.fileId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileArray = otherFileList.value
|
||||||
|
fileArray.forEach(item => {
|
||||||
|
files.push(getFileParam(item))
|
||||||
|
})
|
||||||
|
let userIds = []
|
||||||
|
if (userList.value.length > 0){
|
||||||
|
userIds = userList.value.map(item => {
|
||||||
|
return item.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
deploymentId: deploymentId.value,
|
||||||
|
requirementId: route.query.id,
|
||||||
|
fileList: files,
|
||||||
|
singleFile: singleFile,
|
||||||
|
projectId: route.query.projectId,
|
||||||
|
userIds: userIds
|
||||||
|
}
|
||||||
|
if (JSON.stringify(singleFile) === "{}") {
|
||||||
|
attachment.value.validate()
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: '请上传附件',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
attachment.value.clearValidate()
|
||||||
|
}
|
||||||
|
console.log('params-提交', params,userList.value)
|
||||||
|
// let res = await submitPhaseChange(params)
|
||||||
|
// ElNotification({
|
||||||
|
// title: '提示',
|
||||||
|
// message: res.msg,
|
||||||
|
// type: res.code === 1000 ? 'success' : 'error'
|
||||||
|
// })
|
||||||
|
// if (res.code === 1000) {
|
||||||
|
// tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
|
// await router.push({
|
||||||
|
// name: 'Implementation'
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
const handleResubmit = (instance) => {
|
||||||
|
let singleFile = {}
|
||||||
|
let otherFiles = []
|
||||||
|
let fileArray
|
||||||
|
if (attachment.value.singleFile !== null && name.value === 'Phase/edit') {
|
||||||
|
singleFile = {
|
||||||
|
fileId: attachment.value.singleFile.fileId
|
||||||
|
}
|
||||||
|
fileArray = attachment.value.allFileList
|
||||||
|
} else {
|
||||||
if (file.value.fileId !== undefined) {
|
if (file.value.fileId !== undefined) {
|
||||||
singleFile = {
|
singleFile = {
|
||||||
fileId: file.value.fileId
|
fileId: file.value.fileId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fileArray = otherFileList.value
|
fileArray = otherFileList.value
|
||||||
fileArray.forEach(item => {
|
}
|
||||||
files.push(getFileParam(item))
|
fileArray.forEach(item => {
|
||||||
|
otherFiles.push(getFileParam(item))
|
||||||
|
})
|
||||||
|
let userIds = []
|
||||||
|
if (userList.value.length > 0){
|
||||||
|
userIds = userList.value.map(item => {
|
||||||
|
return item.id
|
||||||
})
|
})
|
||||||
let params = {
|
}
|
||||||
deploymentId: deploymentId.value,
|
//todo requirementId
|
||||||
requirementId: route.query.id,
|
let params = {
|
||||||
fileList: files,
|
deploymentId: deploymentId.value,
|
||||||
singleFile: singleFile,
|
requirementId: route.query.id,
|
||||||
projectId: route.query.projectId,
|
fileList: otherFiles,
|
||||||
}
|
singleFile: singleFile,
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
projectId: route.query.projectId,
|
||||||
attachment.value.validate()
|
userIds: userIds
|
||||||
ElNotification({
|
}
|
||||||
title: '提示',
|
if (JSON.stringify(singleFile) === "{}") {
|
||||||
message: '请上传附件',
|
attachment.value.validate()
|
||||||
type: 'error'
|
ElNotification({
|
||||||
})
|
title: '提示',
|
||||||
return;
|
message: '请上传附件',
|
||||||
}else {
|
type: 'error'
|
||||||
attachment.value.clearValidate()
|
})
|
||||||
}
|
return;
|
||||||
console.log('params-提交', params)
|
} else {
|
||||||
let res = await submitPhaseChange(params)
|
attachment.value.clearValidate()
|
||||||
|
}
|
||||||
|
console.log('重新提交params', params)
|
||||||
|
resubmitPhaseForm(params).then(res => {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
@@ -110,67 +212,14 @@ const handleSubmit =async () => {
|
|||||||
})
|
})
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
await router.push({
|
router.push({
|
||||||
name: 'Implementation'
|
name: 'Implementation'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
const handleResubmit = (instance) => {
|
|
||||||
let singleFile = {}
|
|
||||||
let otherFiles = []
|
|
||||||
let fileArray
|
|
||||||
if (attachment.value.singleFile!==null&&name.value === 'Phase/edit') {
|
|
||||||
singleFile = {
|
|
||||||
fileId: attachment.value.singleFile.fileId
|
|
||||||
}
|
|
||||||
fileArray = attachment.value.allFileList
|
|
||||||
} else {
|
|
||||||
if (file.value.fileId !== undefined) {
|
|
||||||
singleFile = {
|
|
||||||
fileId: file.value.fileId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileArray = otherFileList.value
|
|
||||||
}
|
|
||||||
fileArray.forEach(item => {
|
|
||||||
otherFiles.push(getFileParam(item))
|
|
||||||
})
|
|
||||||
//todo requirementId
|
|
||||||
let params = {
|
|
||||||
deploymentId: deploymentId.value,
|
|
||||||
requirementId: route.query.id,
|
|
||||||
fileList: otherFiles,
|
|
||||||
singleFile: singleFile,
|
|
||||||
projectId: route.query.projectId,
|
|
||||||
}
|
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
|
||||||
attachment.value.validate()
|
|
||||||
ElNotification({
|
|
||||||
title: '提示',
|
|
||||||
message: '请上传附件',
|
|
||||||
type: 'error'
|
|
||||||
})
|
|
||||||
return;
|
|
||||||
}else {
|
|
||||||
attachment.value.clearValidate()
|
|
||||||
}
|
|
||||||
console.log('重新提交params', params)
|
|
||||||
resubmitPhaseForm(params).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: 'Implementation'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const {msg, code,data} = await getPhaseProcess()
|
const {msg, code, data} = await getPhaseProcess()
|
||||||
processDiagramViewer.value = false
|
processDiagramViewer.value = false
|
||||||
if (code === 1000) {
|
if (code === 1000) {
|
||||||
deploymentId.value = data.deploymentId
|
deploymentId.value = data.deploymentId
|
||||||
@@ -184,11 +233,11 @@ const init = async () => {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
processDiagramViewer.value = true
|
processDiagramViewer.value = true
|
||||||
})
|
})
|
||||||
}else {
|
} else {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: msg,
|
message: msg,
|
||||||
type:'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -201,21 +250,21 @@ const getDetailInfo = async () => {
|
|||||||
})
|
})
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
formData.value = res.data
|
formData.value = res.data
|
||||||
loading.value=false
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await init()
|
await init()
|
||||||
if (name.value === 'Phase/edit'){
|
if (name.value === 'Phase/edit') {
|
||||||
loading.value=true
|
loading.value = true
|
||||||
await getDetailInfo()
|
await getDetailInfo()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.apply-block{
|
.apply-block {
|
||||||
margin: 15px 0;
|
margin: 15px 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {fileURLToPath, URL} from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
import {defineConfig} from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||||
import Icons from 'unplugin-icons/vite'
|
import Icons from 'unplugin-icons/vite'
|
||||||
import IconsResolver from 'unplugin-icons/resolver'
|
import IconsResolver from 'unplugin-icons/resolver'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
@@ -17,7 +17,7 @@ export default defineConfig({
|
|||||||
vueJsx(),
|
vueJsx(),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
//自动导入vue相关函数
|
//自动导入vue相关函数
|
||||||
imports: ['vue', 'vue-router'],
|
imports: ['vue','vue-router'],
|
||||||
resolvers: [
|
resolvers: [
|
||||||
ElementPlusResolver(),
|
ElementPlusResolver(),
|
||||||
//自动导入图标组件
|
//自动导入图标组件
|
||||||
@@ -69,8 +69,8 @@ export default defineConfig({
|
|||||||
open: true,
|
open: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
// '/api/workflow': {
|
// '/api/workflow': {
|
||||||
// target: 'http://frp.feashow.cn:31800/',
|
// // target: 'http://frp.feashow.cn:31800/',
|
||||||
// // target: 'http://clay.frp.feashow.cn/',
|
// target: 'http://clay.frp.feashow.cn/',
|
||||||
// // target: 'http://192.168.31.175:8000',
|
// // target: 'http://192.168.31.175:8000',
|
||||||
// changeOrigin: true,
|
// changeOrigin: true,
|
||||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
@@ -80,19 +80,19 @@ export default defineConfig({
|
|||||||
// target: 'http://clay.frp.feashow.cn/',
|
// target: 'http://clay.frp.feashow.cn/',
|
||||||
// // target: 'http://192.168.31.175:8000',
|
// // target: 'http://192.168.31.175:8000',
|
||||||
// changeOrigin: true,
|
// changeOrigin: true,
|
||||||
// rewrite: (path) => path.replace(/^\/summary/, '')
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
// },
|
// },
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://mosr.feashow.cn',
|
// target: 'http://mosr.feashow.cn/',
|
||||||
// target: 'http://clay.frp.feashow.cn/',
|
target: 'http://10.7.127.57:8000',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
},
|
},
|
||||||
// '/summary/notice-ws': {
|
'/api/notice-ws': {
|
||||||
// target: 'ws://mosr.feashow.cn/summary/notice-ws',
|
target: 'ws://mosr.feashow.cn/api/notice-ws',
|
||||||
// ws: true,
|
ws: true,
|
||||||
// changeOrigin: true,
|
changeOrigin: true,
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user