Merge pull request 'master' (#348) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/348
This commit is contained in:
2024-06-17 03:22:45 +00:00
2 changed files with 100 additions and 41 deletions

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>

View File

@@ -13,6 +13,35 @@ import { ElNotification} from "element-plus";
import {deleteAllocation} from "@/api/expense-manage"; import {deleteAllocation} from "@/api/expense-manage";
const router = useRouter(); const router = useRouter();
const shortcuts = [
{
text: '上周',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
return [start, end]
},
},
{
text: '上月',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
return [start, end]
},
},
{
text: '三月前',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
return [start, end]
},
},
]
const searchConfig = reactive([ const searchConfig = reactive([
{ {
label: '分摊名称', label: '分摊名称',
@@ -32,18 +61,23 @@ const searchConfig = reactive([
placeholder: '请选择分摊月份', placeholder: '请选择分摊月份',
clearable: true, clearable: true,
type:'month', type:'month',
valueFormat:"YYYY-MM-DD HH:mm:ss" format: 'YYYY-MM',
valueFormat:"YYYY-MM"
}, },
colProps: {} colProps: {}
}, },
{ {
label: '生成时间', label: '生成时间',
prop: 'generationTime', prop: 'dateValue',
component: 'el-date-picker', component: 'el-date-picker',
props: { props: {
placeholder: '请选择生成时间',
clearable: true, clearable: true,
type: 'daterange',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD',
shortcuts: shortcuts
}, },
colProps: {} colProps: {}
}, },
@@ -147,7 +181,13 @@ const tableConfig = reactive({
}) })
const search = (val) => { const search = (val) => {
tableConfig.params = {...val} let obj = {...val}
if (obj.dateValue) {
obj.startGenerationTime = obj.dateValue[0]
obj.endGenerationTime = obj.dateValue[1]
delete obj.dateValue
}
tableConfig.params = obj
tableIns.value.refresh() tableIns.value.refresh()
} }
const handleAdd = () => { const handleAdd = () => {