fix : 修复分摊编辑传参和台账导出

This commit is contained in:
2024-06-25 11:55:48 +08:00
parent 87768bfdf4
commit 9d0490a253
2 changed files with 46 additions and 19 deletions

View File

@@ -160,17 +160,17 @@ import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
const userList = ref([])
const changeDiagram = ref(false)
const rules = reactive({
shareName: [{required: true, message: '请输入分摊名称', trigger: 'blur'}],
apportionmentMonth: [{required: true, message: '请选择月份', trigger: 'blur'}],
projectId: [{required: true, message: '请选择项目名称', trigger: 'blur'}],
// researchPersonnel: [{required: true, message: '请选择研发人员', trigger: 'blur'}],
wagesPayable: [{required: true, message: '请输入应发工资', trigger: 'blur'}],
performance: [{required: true, message: '请输入绩效', trigger: 'blur'}],
reserveFund: [{required: true, message: '请输入公积金', trigger: 'blur'}],
socialSecurity: [{required: true, message: '请输入社保', trigger: 'blur'}],
annuity: [{required: true, message: '请输入年金', trigger: 'blur'}],
workday: [{required: true, message: '请输入工作日', trigger: 'blur'}],
researchDuration: [{required: true, message: '请输入研发时长', trigger: 'blur'}],
shareName: [{required: true, message: '请输入分摊名称', trigger: ['blur', 'change']}],
apportionmentMonth: [{required: true, message: '请选择月份', trigger: ['blur', 'change']}],
projectId: [{required: true, message: '请选择项目名称', trigger: ['blur', 'change']}],
// researchPersonnel: [{required: true, message: '请选择研发人员', trigger: ['blur', 'change']}],
wagesPayable: [{required: true, message: '请输入应发工资', trigger: ['blur', 'change']}],
performance: [{required: true, message: '请输入绩效', trigger: ['blur', 'change']}],
reserveFund: [{required: true, message: '请输入公积金', trigger: ['blur', 'change']}],
socialSecurity: [{required: true, message: '请输入社保', trigger: ['blur', 'change']}],
annuity: [{required: true, message: '请输入年金', trigger: ['blur', 'change']}],
workday: [{required: true, message: '请输入工作日', trigger: ['blur', 'change']}],
researchDuration: [{required: true, message: '请输入研发时长', trigger: ['blur', 'change']}],
})
const processStore = useProcessStore()
const opentionData = ref()
@@ -293,7 +293,7 @@ const handleSubmit = (instance) => {
usrAllocations: formData.value.tableData,
deploymentId: processInstanceData.value.deploymentId,
}
console.log('params', params, formData.value.tableData)
// console.log('params', params, formData.value.tableData)
const {code, msg} = await addAllocation(params)
ElNotification({
title: '提示',
@@ -318,21 +318,35 @@ const handleResubmit = (instance) => {
type: 'error'
})
}
let newUsrAllocationsObj={}
let newUsrAllocationsObjArray=[]
formData.value.tableData.forEach(item => {
item.allocationId = formData.value.allocationId
item.projectName = getProjectName(item.projectId)
if (item.performance == 0) {
item.performance = null
}
newUsrAllocationsObj={
projectId: item.projectId,
projectName:item.projectName,
researchPersonnel: item.researchPersonnel,
wagesPayable: item.wagesPayable,
performance: item.performance,
reserveFund: item.reserveFund,
socialSecurity: item.socialSecurity,
annuity: item.annuity,
workday: item.workday,
researchDuration: item.researchDuration,
}
newUsrAllocationsObjArray.push(newUsrAllocationsObj)
})
let params = {
allocationId: formData.value.allocationId,
shareName: formData.value.shareName,
apportionmentMonth: formData.value.apportionmentMonth,
usrAllocations: formData.value.tableData,
usrAllocations: newUsrAllocationsObjArray,
deploymentId: processInstanceData.value.deploymentId,
}
console.log('params', params)
const {code, msg} = await editAllocation(params)
ElNotification({
title: '提示',

View File

@@ -2,8 +2,7 @@
<baseTitle title="基础信息"></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>baseForm = e"></fvForm>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<el-button @click="exportExcelHandler">导出</el-button>
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick">
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange">
<template #empty>
<el-empty description="暂无数据"/>
</template>
@@ -89,7 +88,8 @@ const formDataArray = ref([
prop: 'projectCompletionRate',
colProps: {
span: 6
}
},
component: ()=><span>{tableData.value.projectCompletionRate}%</span>
},
{
label: '已完成工作量',
@@ -99,7 +99,6 @@ const formDataArray = ref([
}
}
])
const tableData = ref({})
const schema = computed(() => {
if (JSON.stringify(tableData.value) !== '{}') {
@@ -111,7 +110,8 @@ const schema = computed(() => {
const baseForm = ref()
const tableIns = ref()
const btns = ref([
{name: '表格更新', key: 'update', color: '#DED0B2', auth: ''}
{name: '表格更新', key: 'update', color: '#DED0B2', auth: ''},
{name: '导出', key: 'export', color: '#DED0B2', auth: ''}
])
const searchConfig = reactive([
{
@@ -173,6 +173,10 @@ const searchConfig = reactive([
])
const tableConfig = reactive({
columns: [
{
type: 'selection',
prop: 'selection'
},
{
prop: 'name',
type: 'index',
@@ -234,6 +238,11 @@ const tableConfig = reactive({
if (route.query.state !== '4') {
btns.value.push({name: '上传费用', key: 'add', color: '#DED0B2', auth: ''})
}
const exportIds=ref([])
const selectionChange=(data)=>{
console.log('data',data)
console.log(' data.forEach(item=>item.id)', data.forEach(item=>item.id))
}
const handleUpdateTable = () => {
router.push({
name: 'Implementation/update',
@@ -259,6 +268,9 @@ const headBtnClick = (key) => {
case 'update':
handleUpdateTable()
break;
case 'export':
exportExcelHandler()
break;
}
}
const handleUploadFee = () => {
@@ -271,6 +283,7 @@ const handleUploadFee = () => {
}
const exportExcelHandler = () => {
console.log('exportIds.value',exportIds.value)
let data = {
projectId: 113
}