Merge pull request 'dj' (#280) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/280
This commit is contained in:
2024-06-04 10:23:55 +00:00
12 changed files with 242 additions and 55 deletions

View File

@@ -77,6 +77,39 @@ export const getTags = (projectId) => {
method: "get" method: "get"
}); });
}; };
export const getPhaseProcess = () => {
return request({
url: '/workflow/phase/change/process',
method: "get"
});
};
export const submitPhaseChange = (data) => {
return request({
url: '/workflow/phase/change',
method: "post",
data: data
});
};
export const getPhaseDetail = (projectId) => {
return request({
url: `/workflow/phase/change/info/${projectId}`,
method: "get"
});
};
export const getPhaseForm = (projectId) => {
return request({
url: `/workflow/phase/change/from/${projectId}`,
method: "get"
});
};
export const resubmitPhaseForm = (data) => {
return request({
url: '/workflow/phase/change/resubmit',
method: "post",
data: data
});
};
//项目归档 //项目归档
export const getConclusionDetail = (ProjectId) => { export const getConclusionDetail = (ProjectId) => {
return request({ return request({

View File

@@ -4,12 +4,12 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item :label="label" prop="attachment"> <el-form-item :label="label" prop="attachment">
<template v-if="preview&&JSON.stringify(singleFile) !== '{}'&&JSON.stringify(singleFile)!=='null'"> <template v-if="preview&&JSON.stringify(singleFile) !== '{}'&&JSON.stringify(singleFile)!=='null'">
<el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 18px"> <el-button type="primary" link @click="handleDownload(singleFile)" style="font-size: 16px">
{{ singleFile?.originalFileName }} {{ singleFile?.originalFileName }}
</el-button> </el-button>
<el-button type="danger" link @click="deleteOtherFile(singleFile,1)">删除</el-button> <el-button type="danger" link @click="deleteSingleFile(singleFile,1)">删除</el-button>
</template> </template>
<template v-else-if="!preview||JSON.stringify(singleFile) === '{}'||singleFile==null"> <template v-else-if="!preview||JSON.stringify(singleFile) == '{}'||singleFile==null">
<file-upload @getFile="getAttachment" :showFileList="showFileList" :multiple="false" :maxSize="1" <file-upload @getFile="getAttachment" :showFileList="showFileList" :multiple="false" :maxSize="1"
:disabled="isSingleFile" @delete="deleteAttachment"/> :disabled="isSingleFile" @delete="deleteAttachment"/>
</template> </template>
@@ -175,7 +175,7 @@ const deleteAttachment = (val) => {
} }
}); });
} }
const deleteOtherFile = (row, type) => { const deleteSingleFile = (row, type) => {
ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', { ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@@ -188,6 +188,7 @@ const deleteOtherFile = (row, type) => {
type: res.code === 1000 ? 'success' : 'error' type: res.code === 1000 ? 'success' : 'error'
}) })
if (res.code === 1000) { if (res.code === 1000) {
isSingleFile.value=false
if (type === 1) { if (type === 1) {
singleFile.value = {} singleFile.value = {}
} else { } else {

View File

@@ -10,7 +10,6 @@
<script setup lang="jsx"> <script setup lang="jsx">
import {ElNotification} from 'element-plus'; import {ElNotification} from 'element-plus';
import {agreeTask, rejectTask} from "@/api/project-demand/index.js"; import {agreeTask, rejectTask} from "@/api/project-demand/index.js";
import {useTagsView} from '@/stores/tagsview.js' import {useTagsView} from '@/stores/tagsview.js'
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
@@ -94,6 +93,9 @@ const back = () => {
case 'Share/detail': case 'Share/detail':
router.push({name: 'Expense/share'}) router.push({name: 'Expense/share'})
break; break;
case 'Phase/detail':
router.push({name: 'Implementation'})
break;
} }
} }
// 驳回 // 驳回

View File

@@ -103,13 +103,14 @@ const compositeParam = (item) => {
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
newFile: true, newFile: false,
tag: tag tag: tag
} }
} }
const getAttachment = (val) => { const getAttachment = (val) => {
console.log('上传文件getAttachment', val) console.log('上传文件getAttachment', val)
file.value = compositeParam(val) file.value = compositeParam(val)
formData.value.singleFile = compositeParam(val)
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val) console.log('上传文件getOtherFile', val)

View File

@@ -106,7 +106,7 @@ const searchConfig = reactive([
props: { props: {
placeholder: '请选择状态', placeholder: '请选择状态',
clearable: true, clearable: true,
cacheKey: 'project_initiation' cacheKey: 'project_filing'
} }
}, },
// { // {

View File

@@ -56,13 +56,14 @@ const compositeParam = (item) => {
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
newFile: true, newFile: false,
tag: tag tag: tag
} }
} }
const getAttachment = (val) => { const getAttachment = (val) => {
console.log('上传文件getAttachment', val) console.log('上传文件getAttachment', val)
file.value=compositeParam(val) file.value=compositeParam(val)
formData.value.singleFile = compositeParam(val)
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val) console.log('上传文件getOtherFile', val)

View File

@@ -107,7 +107,7 @@ const searchConfig = reactive([
props: { props: {
placeholder: '请选择状态', placeholder: '请选择状态',
clearable: true, clearable: true,
cacheKey: 'project_initiation' cacheKey: 'project_implementation'
} }
}, },
// { // {
@@ -232,7 +232,7 @@ const tableConfig = reactive({
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({row, index}) => { currentRender: ({row, index}) => {
if (row.state !== null) { if (row.state !== null) {
return (<Tag dictType={'project_initiation'} value={row.state}/>) return (<Tag dictType={'project_implementation'} value={row.state}/>)
} else { } else {
return '--' return '--'
} }
@@ -265,7 +265,13 @@ const tableConfig = reactive({
btn.push({label: '查看分摊', prem: ['mosr:requirement:info'], func: () => handleShare(row), type: 'primary'}) btn.push({label: '查看分摊', prem: ['mosr:requirement:info'], func: () => handleShare(row), type: 'primary'})
} }
if (buttons.has("phaseChange")) { if (buttons.has("phaseChange")) {
btn.push({label: '阶段变更', prem: ['mosr:requirement:info'], func: () => handlePhaseChange(row), type: 'primary'}) btn.push({label: '阶段变更', prem: ['mosr:phase:change'], func: () => handlePhaseChange(row), type: 'primary'})
}
if (buttons.has("phaseChangeInfo")) {
btn.push({label: '阶段变更详情', prem: ['mosr:phase:info'], func: () => handlePhaseChangeDetail(row), type: 'primary'})
}
if (buttons.has("phaseChangeEdit")) {
btn.push({label: '阶段变更编辑', prem: ['mosr:phase:resubmit'], func: () => handlePhaseChangeEdit(row), type: 'primary'})
} }
return ( return (
<div style={{width: '100%'}}> <div style={{width: '100%'}}>
@@ -362,8 +368,27 @@ const handlePhaseChange = (row) => {
router.push({ router.push({
name: 'Phase/change', name: 'Phase/change',
query: { query: {
id: row.requirementId id: row.requirementId,
projectId:row.projectId
} }
}) })
} }
const handlePhaseChangeDetail = (row) => {
router.push({
name: 'Phase/detail',
query: {
projectId:row.projectId
}
})
}
const handlePhaseChangeEdit = (row) => {
router.push({
name: 'Phase/edit',
query: {
projectId:row.projectId
}
})
}
</script> </script>

View File

@@ -2,21 +2,21 @@
<div class="apply-block"> <div class="apply-block">
<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" @getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Phase/edit'"/>
:preview="name === 'Implementation/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"/>
</div> </div>
<div class="oper-page-btn"> <div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button> <el-button color="#DED0B2" v-if="name==='Phase/change'" @click="handleSubmit">提交</el-button>
<el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
</div> </div>
</div> </div>
</template> </template>
<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 {getProjectCheckProcess, projectCheck, getCheckDetail, resubmitCheck} from "@/api/project-manage"; 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'
@@ -29,7 +29,6 @@ const name = ref(router.currentRoute.value.name)
const loading = ref(false) const loading = ref(false)
const formData = ref({}) const formData = ref({})
const file = ref({}) const file = ref({})
const applyForm = ref()
const deploymentId = ref() const deploymentId = ref()
const showTable = ref(true) const showTable = ref(true)
const otherFileList = ref([]) const otherFileList = ref([])
@@ -47,7 +46,7 @@ const compositeParam = (item) => {
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
newFile: true, newFile: false,
tag: tag tag: tag
} }
} }
@@ -71,27 +70,16 @@ const getFileParam = (item) => {
tag: item.tag tag: item.tag
} }
} }
const handleSubmit = (instance) => { const handleSubmit =async () => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
if (JSON.stringify(file.value) === "{}") {
attachment.value.validate()
} else {
attachment.value.clearValidate()
}
if (!valid) return
let files = [] let files = []
let singleFile = {} let singleFile = {}
let fileArray let fileArray
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 => { fileArray.forEach(item => {
files.push(getFileParam(item)) files.push(getFileParam(item))
}) })
@@ -102,24 +90,87 @@ const handleSubmit = (instance) => {
singleFile: singleFile, singleFile: singleFile,
projectId: route.query.projectId, 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) console.log('params-提交', params)
// let res = await projectCheck(params) let res = await submitPhaseChange(params)
// ElNotification({ ElNotification({
// title: '提示', title: '提示',
// message: res.msg, message: res.msg,
// type: res.code === 1000 ? 'success' : 'error' type: res.code === 1000 ? 'success' : 'error'
// }) })
// if (res.code === 1000) { if (res.code === 1000) {
// tagsViewStore.delVisitedViews(router.currentRoute.value.path) tagsViewStore.delVisitedViews(router.currentRoute.value.path)
// await router.push({ await 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 getProjectCheckProcess(route.query.projectId) 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
@@ -141,8 +192,25 @@ const init = async () => {
}) })
} }
} }
const getDetailInfo = async () => {
getPhaseForm(route.query.projectId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
formData.value = res.data
loading.value=false
}
})
}
onMounted(async () => { onMounted(async () => {
// await init() await init()
if (name.value === 'Phase/edit'){
loading.value=true
await getDetailInfo()
}
}) })
</script> </script>

View File

@@ -0,0 +1,55 @@
<template>
<ApprovalDetail :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/>
<opinion v-if="summaryData.taskId" :formData="summaryData.formData" :taskId="summaryData.taskId"></opinion>
</template>
<script setup lang="jsx">
import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
import {getPhaseDetail} from "@/api/project-manage";
const route = useRoute()
const summaryData = ref({})
const summaryProcessViewer = ref(true)
const processStore = useProcessStore()
const loading = ref(false)
const fileListShow = ref('READ')
const getInfo = async () => {
fileListShow.value='READ'
const projectId = route.query.projectId
summaryProcessViewer.value = false
loading.value = true
const {code, data,msg} = await getPhaseDetail(projectId)
if(code===1000){
summaryData.value = data;
loading.value = false
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(() => {
summaryProcessViewer.value = true
if (data.formPermMap["fileList"]) {
fileListShow.value = data.formPermMap["fileList"].perm
}
})
}else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
})
if(msg==='查询结果为空'){
summaryData.value=[]
}
loading.value = false
}
}
getInfo()
</script>
<style scoped>
</style>

View File

@@ -108,13 +108,14 @@ const compositeParam = (item) => {
originalFileName: item.originalFilename, originalFileName: item.originalFilename,
fileType: item.fileType, fileType: item.fileType,
url: item.url, url: item.url,
newFile: true, newFile: false,
tag: tag tag: tag
} }
} }
const getAttachment = (val) => { const getAttachment = (val) => {
console.log('上传文件getAttachment', val) console.log('上传文件getAttachment', val)
file.value = compositeParam(val) file.value = compositeParam(val)
formData.value.singleFile = compositeParam(val)
} }
const getOtherFile = (val) => { const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val) console.log('上传文件getOtherFile', val)
@@ -163,7 +164,6 @@ const handleSubmit = (instance) => {
singleFile: singleFile, singleFile: singleFile,
projectId: route.query.projectId, projectId: route.query.projectId,
} }
console.log('params', params) console.log('params', params)
let res = await projectApply(params) let res = await projectApply(params)
ElNotification({ ElNotification({

View File

@@ -36,6 +36,7 @@
<el-table-column prop="orderNum" label="排序" width="60px"/> <el-table-column prop="orderNum" label="排序" width="60px"/>
<el-table-column prop="perms" label="权限标识"/> <el-table-column prop="perms" label="权限标识"/>
<el-table-column prop="component" label="组件路径"/> <el-table-column prop="component" label="组件路径"/>
<el-table-column prop="path" label="路由地址"/>
<el-table-column prop="state" label="状态" width="80px"> <el-table-column prop="state" label="状态" width="80px">
<template #default="scope"> <template #default="scope">
<tag dict-type="normal_disable" :value="scope.row.state"/> <tag dict-type="normal_disable" :value="scope.row.state"/>

View File

@@ -68,13 +68,13 @@ export default defineConfig({
strictPort: false, strictPort: false,
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/, '')
// }, },
// '/summary/admin': { // '/summary/admin': {
// // target: 'http://frp.feashow.cn:31800/', // // target: 'http://frp.feashow.cn:31800/',
// target: 'http://clay.frp.feashow.cn/', // target: 'http://clay.frp.feashow.cn/',