fix : 修复需求上报排版、费用分摊传参、需求汇总查询字段

This commit is contained in:
2024-06-28 22:37:30 +08:00
parent 16c4e07a86
commit 942fc219e2
3 changed files with 165 additions and 101 deletions

View File

@@ -36,12 +36,12 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="researchPersonnel" label="研发人员" width="230">
<el-table-column prop="researchPersonnelId" label="研发人员" width="230">
<template #default="scope">
<el-form-item prop="researchPersonnel">
{{ scope.row.researchPersonnelName }}
<el-form-item prop="researchPersonnelId">
{{ scope.row.researchPersonnel }}
<el-button @click="showPersonnelPicker(scope.row,scope.$index)">
{{ scope.row.researchPersonnelName ? '更改' : '请选择研发人员' }}
{{ scope.row.researchPersonnel ? '更改' : '请选择研发人员' }}
</el-button>
</el-form-item>
</template>
@@ -163,7 +163,7 @@ const rules = reactive({
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']}],
// researchPersonnelId: [{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']}],
@@ -187,7 +187,7 @@ const formData = ref({
{
projectId: '',
projectName: '',
researchPersonnel: '',
researchPersonnelId: '',
wagesPayable: null,
performance: null,
reserveFund: null,
@@ -216,8 +216,8 @@ const selected = (select) => {
}
formData.value.tableData.forEach((item, index) => {
if (index === currentIndex.value) {
item.researchPersonnel = select[0].id
item.researchPersonnelName = select[0].name
item.researchPersonnelId = select[0].id
item.researchPersonnel = select[0].name
}
})
}
@@ -242,8 +242,8 @@ const handleAdd = () => {
let row = {
projectId: '',
projectName: '',
researchPersonnelId: '',
researchPersonnel: '',
researchPersonnelName: '',
wagesPayable: null,
performance: null,
reserveFund: null,
@@ -259,8 +259,8 @@ const handleCopy = (row) => {
let copyObj = {
projectId: row.projectId,
projectName: '',
researchPersonnelId: row.researchPersonnelId,
researchPersonnel: row.researchPersonnel,
researchPersonnelName: row.researchPersonnelName,
wagesPayable: row.wagesPayable,
performance: row.performance,
reserveFund: row.reserveFund,
@@ -284,15 +284,15 @@ const handleSubmit = (instance) => {
type: 'error'
})
}
let researchPersonnel = ''
let researchPersonnelId = ''
formData.value.tableData.forEach(item => {
item.projectName = getProjectName(item.projectId)
researchPersonnel = item.researchPersonnel
researchPersonnelId = item.researchPersonnelId
if (item.performance == 0) {
item.performance = null
}
})
if (!researchPersonnel) {
if (!researchPersonnelId) {
ElNotification({
title: '提示',
message: '请选择研发人员',
@@ -333,18 +333,18 @@ const handleResubmit = (instance) => {
}
let newUsrAllocationsObj = {}
let newUsrAllocationsObjArray = []
let researchPersonnel = ''
let researchPersonnelId = ''
formData.value.tableData.forEach(item => {
item.allocationId = formData.value.allocationId
item.projectName = getProjectName(item.projectId)
researchPersonnel = item.researchPersonnel
researchPersonnelId = item.researchPersonnelId
if (item.performance == 0) {
item.performance = null
}
newUsrAllocationsObj = {
projectId: item.projectId,
projectName: item.projectName,
researchPersonnel: item.researchPersonnel,
researchPersonnelId: item.researchPersonnelId,
wagesPayable: item.wagesPayable,
performance: item.performance,
reserveFund: item.reserveFund,
@@ -355,7 +355,7 @@ const handleResubmit = (instance) => {
}
newUsrAllocationsObjArray.push(newUsrAllocationsObj)
})
if (!researchPersonnel) {
if (!researchPersonnelId) {
ElNotification({
title: '提示',
message: '请选择研发人员',
@@ -409,7 +409,7 @@ const getDetailList = async () => {
const {code, data, msg} = await getAllocationDetailList(params)
if (code === 1000) {
data.rows.forEach(item => {
item.researchPersonnel = Number(item.researchPersonnel)
item.researchPersonnelId = Number(item.researchPersonnelId)
})
formData.value.tableData = data.rows
nextTick(() => {