diff --git a/src/api/expense-manage/index.js b/src/api/expense-manage/index.js index 64d6142..7341530 100644 --- a/src/api/expense-manage/index.js +++ b/src/api/expense-manage/index.js @@ -38,3 +38,19 @@ export const getProjectOption = () => { method: "get" }); }; +export const getAllocationCollect = (allocationId) => { + return request({ + url: '/workflow/mosr/cost/allocation/collect', + method: "get", + params:{ + allocationId:allocationId + } + }); +}; +export const editAllocation = (data) => { + return request({ + url: '/workflow/mosr/cost/allocation/edit', + method: "post", + data + }); +}; diff --git a/src/views/expense-management/share/add.vue b/src/views/expense-management/share/add.vue index c625c82..821f8da 100644 --- a/src/views/expense-management/share/add.vue +++ b/src/views/expense-management/share/add.vue @@ -141,6 +141,7 @@ import {useTagsView} from '@/stores/tagsview.js' import {addAllocation, getAllocationDetail, getAllocationProcess, getResearchUser,getProjectOption} from "@/api/expense-manage"; import {useProcessStore} from '@/stores/processStore.js'; import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'; +import {getAllocationDetailList} from "../../../api/expense-manage"; const rules = reactive({ shareName: [{required: true, message: '请输入分摊名称', trigger: 'blur'}], @@ -162,7 +163,7 @@ const loading = ref(false) const route = useRoute() const router = useRouter() const tagsViewStore = useTagsView() -let formData = reactive({ +const formData = ref({ tableData: [ { projectId:'', @@ -213,13 +214,13 @@ const handleAdd = () => { researchDuration: '', // subtotal: '', } - formData.tableData.push(row) + formData.value.tableData.push(row) } const handleCopy = (row) => { - formData.tableData.push(row) + formData.value.tableData.push(row) } const handleDelete = (index) => { - formData.tableData.splice(index, 1) + formData.value.tableData.splice(index, 1) } const handleSubmit = (instance) => { if (!instance) return @@ -231,13 +232,13 @@ const handleSubmit = (instance) => { type: 'error' }) } - formData.tableData.forEach(item => { + formData.value.tableData.forEach(item => { item.projectName = getProjectName(item.projectId) }) let params = { - shareName:formData.shareName, - apportionmentMonth:formData.apportionmentMonth, - usrAllocations: formData.tableData, + shareName:formData.value.shareName, + apportionmentMonth:formData.value.apportionmentMonth, + usrAllocations: formData.value.tableData, deploymentId: processInstanceData.value.deploymentId, } console.log('params',params) @@ -256,18 +257,34 @@ const handleSubmit = (instance) => { }) } const getDetailInfo = async () => { - getAllocationDetail(12).then(res => { + loading.value=true + getAllocationDetail(route.query.id).then(res => { ElNotification({ title: '提示', message: res.msg, type: res.code === 1000 ? 'success' : 'error' }) if (res.code === 1000) { - formData = res.data.formData + formData.value = res.data.formData loading.value = false } }) } +const getDetailList = async () => { + let params = { + allocationId: route.query.id + } + const {code, data, msg} = await getAllocationDetailList(params) + if (code === 1000) { + formData.value.tableData = data.rows + }else { + ElNotification({ + title: '提示', + message: msg, + type: 'error' + }) + } +} const init = async () => { processDiagramViewer.value = false await getResearchOptions() @@ -302,6 +319,7 @@ onMounted(async () => { if (route.query.id) { loading.value = true await getDetailInfo() + // await getDetailList() } }) diff --git a/src/views/expense-management/share/detail.vue b/src/views/expense-management/share/detail.vue index 180a650..9c08a50 100644 --- a/src/views/expense-management/share/detail.vue +++ b/src/views/expense-management/share/detail.vue @@ -18,11 +18,11 @@ - - - - - + + +
@@ -52,7 +52,7 @@ import OperationRender from '@/views/workflow/common/OperationRender.vue' import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue' import {ElNotification} from "element-plus"; import {useProcessStore} from '@/stores/processStore.js'; -import {getAllocationDetail, getAllocationDetailList} from "@/api/expense-manage"; +import {getAllocationDetail, getAllocationDetailList,getAllocationCollect} from "@/api/expense-manage"; const processStore = useProcessStore() const route = useRoute() @@ -63,21 +63,55 @@ const auditOpinion = ref('') const shareProcessViewer = ref(true) const showTable = ref(true) const loading = ref(false) +const collectList = ref([]) const activeName = ref('first') +const tableConfig = reactive({ + columns: [ + { + prop: 'index', + type: 'index', + label: '序号', + align: 'center', + width: '80', + }, + { + prop: 'originalFileName', + label: '项目名称', + align: 'center', + }, + { + prop: 'tag', + label: '费用性质', + align: 'center' + }, + { + prop: 'size', + label: '项目阶段', + align: 'center' + }, + { + prop: 'size', + label: '分摊金额', + align: 'center' + } + ] +}) const getDetail = async () => { const id = route.query.id - shareProcessViewer.value = true + shareProcessViewer.value = false const {code, data, msg} = await getAllocationDetail(id) if (code === 1000) { shareData.value = data formData.value = data.formData - shareProcessViewer.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(()=>{ + shareProcessViewer.value = true + }) } else { ElNotification({ title: '提示', @@ -107,8 +141,21 @@ const getDetailList = async () => { }) } } +const getDetailCollect = async () => { + const {code, data, msg} = await getAllocationCollect(route.query.id) + if (code === 1000) { + collectList.value = data.rows + }else { + ElNotification({ + title: '提示', + message: msg, + type: 'error' + }) + } +} getDetail() getDetailList() +// getDetailCollect()