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