fix : 修复新增费用分摊输入框垂直居中

This commit is contained in:
2024-06-16 21:41:20 +08:00
parent b162bb8977
commit 0c36801e83

View File

@@ -93,7 +93,7 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="researchDuration" label="研发时长(天)" >
<el-table-column prop="researchDuration" label="研发时长(天)">
<template #default="scope">
<el-form-item prop="time" :rules="scope.row.researchDuration?'1':rules.researchDuration">
<el-input-number v-model="scope.row.researchDuration" placeholder="请输入研发时长" :controls="false"/>
@@ -145,7 +145,15 @@
<script setup lang="jsx">
import {ElNotification} from "element-plus";
import {useTagsView} from '@/stores/tagsview.js'
import {addAllocation, getAllocationDetail, getAllocationProcess, getResearchUser,getProjectOption,editAllocation, getAllocationDetailList} from "@/api/expense-manage";
import {
addAllocation,
getAllocationDetail,
getAllocationProcess,
getResearchUser,
getProjectOption,
editAllocation,
getAllocationDetailList
} from "@/api/expense-manage";
import {useProcessStore} from '@/stores/processStore.js';
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
@@ -175,16 +183,16 @@ const tagsViewStore = useTagsView()
const formData = ref({
tableData: [
{
projectId:'',
projectId: '',
projectName: '',
researchPersonnel:'',
wagesPayable:null,
performance:null,
reserveFund:null,
socialSecurity:null,
annuity:null,
workday:'21.75',
researchDuration:null,
researchPersonnel: '',
wagesPayable: null,
performance: null,
reserveFund: null,
socialSecurity: null,
annuity: null,
workday: '21.75',
researchDuration: null,
}
]
})
@@ -200,11 +208,11 @@ const getProjectOptions = async () => {
const res = await getProjectOption()
nameOptions.value = res.data
}
const getProjectName=(id)=>{
let label=''
nameOptions.value.forEach(item=>{
if(item.value===id){
label=item.label
const getProjectName = (id) => {
let label = ''
nameOptions.value.forEach(item => {
if (item.value === id) {
label = item.label
}
})
return label
@@ -214,13 +222,13 @@ const handleAdd = () => {
projectId: '',
projectName: '',
researchPersonnel: '',
wagesPayable:null,
performance:null,
reserveFund:null,
socialSecurity:null,
annuity:null,
workday:'21.75',
researchDuration:null,
wagesPayable: null,
performance: null,
reserveFund: null,
socialSecurity: null,
annuity: null,
workday: '21.75',
researchDuration: null,
}
formData.value.tableData.push(row)
}
@@ -228,13 +236,13 @@ const handleCopy = (row) => {
let copyObj = {
projectId: row.projectId,
projectName: '',
researchPersonnel: row.researchPersonnel,
researchPersonnel: row.researchPersonnel,
wagesPayable: row.wagesPayable,
performance: row.performance,
reserveFund: row.reserveFund,
socialSecurity: row.socialSecurity,
annuity: row.annuity,
workday:'21.75',
workday: '21.75',
researchDuration: row.researchDuration,
}
formData.value.tableData.push(copyObj)
@@ -245,7 +253,7 @@ const handleDelete = (index) => {
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid){
if (!valid) {
return ElNotification({
title: '提示',
message: '请完善数据,再提交!',
@@ -256,8 +264,8 @@ const handleSubmit = (instance) => {
item.projectName = getProjectName(item.projectId)
})
let params = {
shareName:formData.value.shareName,
apportionmentMonth:formData.value.apportionmentMonth,
shareName: formData.value.shareName,
apportionmentMonth: formData.value.apportionmentMonth,
usrAllocations: formData.value.tableData,
deploymentId: processInstanceData.value.deploymentId,
}
@@ -279,7 +287,7 @@ const handleSubmit = (instance) => {
const handleResubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid){
if (!valid) {
return ElNotification({
title: '提示',
message: '请完善数据,再提交!',
@@ -291,9 +299,9 @@ const handleResubmit = (instance) => {
item.projectName = getProjectName(item.projectId)
})
let params = {
allocationId:formData.value.allocationId,
shareName:formData.value.shareName,
apportionmentMonth:formData.value.apportionmentMonth,
allocationId: formData.value.allocationId,
shareName: formData.value.shareName,
apportionmentMonth: formData.value.apportionmentMonth,
usrAllocations: formData.value.tableData,
deploymentId: processInstanceData.value.deploymentId,
}
@@ -314,7 +322,7 @@ const handleResubmit = (instance) => {
}
const getDetailInfo = async () => {
loading.value=true
loading.value = true
getAllocationDetail(route.query.id).then(res => {
ElNotification({
title: '提示',
@@ -322,7 +330,7 @@ const getDetailInfo = async () => {
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
getDetailList()
getDetailList()
formData.value = res.data.formData
loading.value = false
}
@@ -332,7 +340,7 @@ const getDetailList = async () => {
let params = {
allocationId: route.query.id
}
showTable.value=false
showTable.value = false
const {code, data, msg} = await getAllocationDetailList(params)
if (code === 1000) {
data.rows.forEach(item => {
@@ -342,11 +350,11 @@ const getDetailList = async () => {
nextTick(() => {
showTable.value = true
})
}else {
} else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
type: 'error'
})
}
}
@@ -386,3 +394,14 @@ onMounted(async () => {
}
})
</script>
<style scoped lang="scss">
:deep(.el-table--enable-row-transition) {
.el-table__body td.el-table__cell {
.cell {
.el-form-item {
margin-top: 20px;
}
}
}
}
</style>