+ @getOtherFile="getOtherFile" :showFileList="true" :formData="localFormData"
+ :preview="mode == 'resubmit'"/>
+
- 提交
- 重新提交
+ 提交
+ 重新提交
返回
@@ -40,14 +40,11 @@ import {
getApplyProcess,
projectApply,
resubmitApply,
- getApplyDetail,
getProjectCheckProcess,
projectCheck,
resubmitCheck,
- getCheckDetail,
projectConclusion,
resubmitConclusion,
- getConclusionDetail,
getProjectConclusionProcess
} from "@/api/project-manage";
import {useProcessStore} from '@/stores/processStore.js';
@@ -59,15 +56,23 @@ const emit = defineEmits(["getAttachment", "getOtherFile"])
const props = defineProps({
title: {
type: String,
- default: '项目立项'
+ default: 'apply'
},
showTable: {
type: Boolean,
default: false
},
+ mode: {
+ type: String,
+ default: "view"
+ },
data: {
- type: Array,
- default: []
+ type: Object,
+ default: {}
+ },
+ formData: {
+ type: Object,
+ default: {}
}
})
const rules = reactive({
@@ -76,16 +81,25 @@ const rules = reactive({
const tagsViewStore = useTagsView()
const processStore = useProcessStore()
const otherFileList = ref([])
-const formData = ref({})
+const localFormData = ref({})
const attachment = ref()
const showTable = ref(true)
const loading = ref(false)
const processDiagramViewer = ref(false)
const name = ref(router.currentRoute.value.name)
-const formRef = ref()
const deploymentId = ref()
const projectId = ref(route.query.projectId)
const step = ref(route.query.step)
+const getTitleName = (type) => {
+ switch (type) {
+ case 'apply':
+ return '项目立项'
+ case 'check':
+ return '项目验收'
+ case 'filing':
+ return '项目归档'
+ }
+}
const handleBack = () => {
history.back()
}
@@ -97,12 +111,12 @@ const compositeParam = (item) => {
fileType: item.fileType,
url: item.url,
newFile: false,
- tag: props.title
+ tag: getTitleName(props.title)
}
}
const getAttachment = (val) => {
console.log('上传文件getAttachment', val)
- formData.value.singleFile = compositeParam(val)
+ localFormData.value.singleFile = compositeParam(val)
}
const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val)
@@ -119,23 +133,27 @@ const getFileParam = (item) => {
tag: item.tag
}
}
-const handleSubmit =async () => {
+const handleSubmit = async () => {
// if (!formRef.value) return
// formRef.value.validate(async (valid) => {
// if (!valid) return
- let files = []
- if (route.query.state === '3') {
- attachment.value.allFileList.forEach(item => {
- files.push(getFileParam(item))
- })
- } else {
- otherFileList.value.forEach(item => {
- files.push(getFileParam(item))
- })
- }
- // if (formData.value.singleFile !== undefined) {
- // formData.value.singleFile = getFileParam(formData.value.singleFile)
- // }
+ let files = []
+ if (props.mode === 'resubmit') {
+ attachment.value.allFileList.forEach(item => {
+ files.push(getFileParam(item))
+ })
+ } else {
+ otherFileList.value.forEach(item => {
+ files.push(getFileParam(item))
+ })
+ }
+ // if (localFormData.value.singleFile !== undefined) {
+ // localFormData.value.singleFile = getFileParam(localFormData.value.singleFile)
+ // }
+ console.log('attachment.value.singleFile',attachment.value,attachment.value.singleFile)
+ if(localFormData.value.singleFile){
+
+ }else {
if (attachment.value.singleFile == null) {
attachment.value.validate()
ElNotification({
@@ -147,55 +165,57 @@ const handleSubmit =async () => {
} else {
attachment.value.clearValidate()
}
- let params = {
- deploymentId: deploymentId.value,
- requirementId: route.query.id,
- fileList: files,
- singleFile: formData.value.singleFile,
- projectId: projectId.value,
+ }
+
+ let params = {
+ deploymentId: deploymentId.value,
+ requirementId: route.query.id,
+ fileList: files,
+ singleFile: localFormData.value.singleFile,
+ projectId: projectId.value,
+ }
+ console.log('params', params)
+ let res
+ if (step.value === '20') {
+ if (props.mode === 'resubmit') {
+ res = await resubmitApply(params)
+ } else {
+ res = await projectApply(params)
}
- console.log('params', params)
- let res
+ } else if (step.value === '40') {
+ if (props.mode === 'resubmit') {
+ res = await resubmitCheck(params)
+ } else {
+ res = await projectCheck(params)
+ }
+ } else if (step.value === '50') {
+ if (props.mode === 'resubmit') {
+ res = await resubmitConclusion(params)
+ } else {
+ res = await projectConclusion(params)
+ }
+ }
+ ElNotification({
+ title: '提示',
+ message: res.msg,
+ type: res.code === 1000 ? 'success' : 'error'
+ })
+ if (res.code === 1000) {
+ tagsViewStore.delVisitedViews(router.currentRoute.value.path)
if (step.value === '20') {
- if (route.query.state === '3') {
- res = await resubmitApply(params)
- } else {
- res = await projectApply(params)
- }
+ await router.push({
+ name: 'Initiation'
+ })
} else if (step.value === '40') {
- if (route.query.state === '3') {
- res = await resubmitCheck(params)
- } else {
- res = await projectCheck(params)
- }
+ await router.push({
+ name: 'Implementation'
+ })
} else if (step.value === '50') {
- if (route.query.state === '3') {
- res = await resubmitConclusion(params)
- } else {
- res = await projectConclusion(params)
- }
- }
- ElNotification({
- title: '提示',
- message: res.msg,
- type: res.code === 1000 ? 'success' : 'error'
- })
- if (res.code === 1000) {
- tagsViewStore.delVisitedViews(router.currentRoute.value.path)
- if (step.value === '20') {
- await router.push({
- name: 'Initiation'
- })
- }else if (step.value === '40') {
- await router.push({
- name: 'Implementation'
- })
- }else if (step.value === '50') {
- await router.push({
- name: 'Filing'
- })
- }
+ await router.push({
+ name: 'Filing'
+ })
}
+ }
// })
}
const init = async () => {
@@ -207,7 +227,7 @@ const init = async () => {
res = await getApplyProcess(id)
} else if (step.value === '40') {
res = await getProjectCheckProcess(id)
- }else if (step.value === '50') {
+ } else if (step.value === '50') {
res = await getProjectConclusionProcess(id)
}
if (res.code === 1000) {
@@ -230,35 +250,13 @@ const init = async () => {
})
}
}
-const getDetailInfo = async () => {
- let id = projectId.value
- if (!id) return;
- let res
- loading.value = true
- if (step.value === '20') {
- res = await getApplyDetail(id)
- } else if (step.value === '40') {
- res = await getCheckDetail(id)
- }else if (step.value === '50') {
- res = await getConclusionDetail(id)
- }
- if (res.code === 1000) {
- formData.value = res.data.formData
- loading.value = false
- }else {
- ElNotification({
- title: '提示',
- message: res.msg,
- type: 'error'
- })
- }
-}
+watchEffect(() => {
+ return Object.keys(props.formData).length && (localFormData.value = props.formData)
+})
+
onMounted(async () => {
await init()
- if (route.query.state == 3) {
- await getDetailInfo()
- }
})
diff --git a/src/components/DetailComponent/SummaryDetail.vue b/src/components/DetailComponent/SummaryDetail.vue
index 8ded615..33156ee 100644
--- a/src/components/DetailComponent/SummaryDetail.vue
+++ b/src/components/DetailComponent/SummaryDetail.vue
@@ -153,7 +153,7 @@
diff --git a/src/views/project-demand/summary/detail.vue b/src/views/project-demand/summary/detail.vue
index 156c563..8b6bb28 100644
--- a/src/views/project-demand/summary/detail.vue
+++ b/src/views/project-demand/summary/detail.vue
@@ -50,6 +50,10 @@ const getInfo = async (state) => {
if (code === 1000) {
summaryData.value = data;
loading.value = false
+ if(data.runningList===null) {
+ loading.close()
+ return;
+ }
processStore.setDesign(data)
processStore.runningList.value = data.runningList;
processStore.endList.value = data.endList;
diff --git a/src/views/project-management/filing/upload.vue b/src/views/project-management/filing/upload.vue
index 0e89e8f..1621887 100644
--- a/src/views/project-management/filing/upload.vue
+++ b/src/views/project-management/filing/upload.vue
@@ -48,7 +48,8 @@ const tableConfig = reactive({
{
prop: 'size',
label: '文件大小',
- align: 'center'
+ align: 'center',
+ currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
@@ -119,7 +120,7 @@ const handleSubmit = async () => {
})
let params = {
fileList: files,
- targetState:'',
+ targetState:route.query.name,
projectId: route.query.id,
}
let res = await uploadFileList(params)
diff --git a/src/views/project-management/implementation/detail.vue b/src/views/project-management/implementation/detail.vue
index a1f232e..527ac2e 100644
--- a/src/views/project-management/implementation/detail.vue
+++ b/src/views/project-management/implementation/detail.vue
@@ -2,31 +2,48 @@
-
-
-
-
-
-
-
-
+
+
+
-
@@ -40,101 +57,83 @@ import {ElLoading, ElNotification} from "element-plus";
import Opinion from "@/components/DetailComponent/Opinion.vue";
const route = useRoute()
-const showApply = ref(false)
-const showCheck = ref(false)
-const showFiling = ref(false)
+const editShow = ref(false)
+const applyTitle = ref('apply')
const loading = ref(false)
const processStore = useProcessStore()
const fileListShow = ref('READ')
+const mode = ref('')
const currentStep = ref()
const auditOpinion = ref('')
+// const step = ref(route.query.step)
route.query.step == '10' && (currentStep.value = 1)
route.query.step == '20' && (currentStep.value = 2)
route.query.step == '40' && (currentStep.value = 3)
route.query.step == '50' && (currentStep.value = 4)
const showActive = ref()
-const commonForm = ref({})
+const detailData = ref({})
const commonProvessViewer = ref(true)
const getAllInfo = async (state) => {
const loading = ElLoading.service({fullscreen: true})
try {
+ fileListShow.value = 'READ'
commonProvessViewer.value = false
const {data, code, msg} = await getMapProjectStateInfo(route.query.projectId, state)
- if (code !== 1000) {
+ if (code === 1000) {
+ detailData.value = data
+ mode.value = data.formData.mode
+ 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(() => {
+ commonProvessViewer.value = true
+ if (data.formPermMap && data.formPermMap["fileList"]) {
+ fileListShow.value = data.formPermMap["fileList"].perm
+ }
+ })
+ changeModel(state, mode.value)
+ loading.close()
+ } else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
})
if (msg === '查询结果为空') {
- commonForm.value = []
+ detailData.value = []
+ detailData.value.formData = {}
}
loading.close()
}
- if (data === undefined) return;
- commonForm.value = data
- 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(() => {
- commonProvessViewer.value = true
- if (data.formPermMap && data.formPermMap["fileList"]) {
- fileListShow.value = data.formPermMap["fileList"].perm
- }
- })
- loading.close()
} catch {
loading.close()
}
}
-const changeModel = (active) => {
- if (route.query.step === '20' && active === '20') {
- if (route.query.state === '0') {
- showApply.value = true
- } else if (route.query.state === '3') {
- showApply.value = true
- getAllInfo(active)
- } else {
- showApply.value = false
- getAllInfo(active)
+const changeModel = (active, mode) => {
+ editShow.value = false
+ nextTick(() => {
+ editShow.value = mode === 'submit' || mode === 'resubmit';
+ if (route.query.step === '20' && active === '20') {
+ applyTitle.value = 'apply'
+ } else if (route.query.step === '40' && active === '40') {
+ applyTitle.value = 'check'
+ } else if (route.query.step === '50' && active === '50') {
+ applyTitle.value = 'filing'
}
- } else if (route.query.step === '40' && active === '40') {
- if (route.query.state === '0') {
- showCheck.value = true
- } else if (route.query.state === '3') {
- showCheck.value = true
- getAllInfo(active)
- } else {
- showCheck.value = false
- getAllInfo(active)
- }
- } else if (route.query.step === '50' && active === '50') {
- if (route.query.state === '0') {
- showFiling.value = true
- } else if (route.query.state === '3') {
- showFiling.value = true
- getAllInfo(active)
- } else {
- showFiling.value = false
- getAllInfo(active)
- }
- } else {
- getAllInfo(active)
- }
+ })
}
-
const setDetail = (active) => {
showActive.value = active
- changeModel(active)
+ getAllInfo(active)
}
const stepChange = (data) => {
showActive.value = data.active
- changeModel(data.active)
+ getAllInfo(data.active)
}