Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangkaihuai
2024-06-25 11:59:55 +08:00
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 userList = ref([])
const changeDiagram = ref(false) const changeDiagram = ref(false)
const rules = reactive({ const rules = reactive({
shareName: [{required: true, message: '请输入分摊名称', trigger: 'blur'}], shareName: [{required: true, message: '请输入分摊名称', trigger: ['blur', 'change']}],
apportionmentMonth: [{required: true, message: '请选择月份', trigger: 'blur'}], apportionmentMonth: [{required: true, message: '请选择月份', trigger: ['blur', 'change']}],
projectId: [{required: true, message: '请选择项目名称', trigger: 'blur'}], projectId: [{required: true, message: '请选择项目名称', trigger: ['blur', 'change']}],
// researchPersonnel: [{required: true, message: '请选择研发人员', trigger: 'blur'}], // researchPersonnel: [{required: true, message: '请选择研发人员', trigger: ['blur', 'change']}],
wagesPayable: [{required: true, message: '请输入应发工资', trigger: 'blur'}], wagesPayable: [{required: true, message: '请输入应发工资', trigger: ['blur', 'change']}],
performance: [{required: true, message: '请输入绩效', trigger: 'blur'}], performance: [{required: true, message: '请输入绩效', trigger: ['blur', 'change']}],
reserveFund: [{required: true, message: '请输入公积金', trigger: 'blur'}], reserveFund: [{required: true, message: '请输入公积金', trigger: ['blur', 'change']}],
socialSecurity: [{required: true, message: '请输入社保', trigger: 'blur'}], socialSecurity: [{required: true, message: '请输入社保', trigger: ['blur', 'change']}],
annuity: [{required: true, message: '请输入年金', trigger: 'blur'}], annuity: [{required: true, message: '请输入年金', trigger: ['blur', 'change']}],
workday: [{required: true, message: '请输入工作日', trigger: 'blur'}], workday: [{required: true, message: '请输入工作日', trigger: ['blur', 'change']}],
researchDuration: [{required: true, message: '请输入研发时长', trigger: 'blur'}], researchDuration: [{required: true, message: '请输入研发时长', trigger: ['blur', 'change']}],
}) })
const processStore = useProcessStore() const processStore = useProcessStore()
const opentionData = ref() const opentionData = ref()
@@ -293,7 +293,7 @@ const handleSubmit = (instance) => {
usrAllocations: formData.value.tableData, usrAllocations: formData.value.tableData,
deploymentId: processInstanceData.value.deploymentId, deploymentId: processInstanceData.value.deploymentId,
} }
console.log('params', params, formData.value.tableData) // console.log('params', params, formData.value.tableData)
const {code, msg} = await addAllocation(params) const {code, msg} = await addAllocation(params)
ElNotification({ ElNotification({
title: '提示', title: '提示',
@@ -318,21 +318,35 @@ const handleResubmit = (instance) => {
type: 'error' type: 'error'
}) })
} }
let newUsrAllocationsObj={}
let newUsrAllocationsObjArray=[]
formData.value.tableData.forEach(item => { formData.value.tableData.forEach(item => {
item.allocationId = formData.value.allocationId item.allocationId = formData.value.allocationId
item.projectName = getProjectName(item.projectId) item.projectName = getProjectName(item.projectId)
if (item.performance == 0) { if (item.performance == 0) {
item.performance = null 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 = { 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: newUsrAllocationsObjArray,
deploymentId: processInstanceData.value.deploymentId, deploymentId: processInstanceData.value.deploymentId,
} }
console.log('params', params)
const {code, msg} = await editAllocation(params) const {code, msg} = await editAllocation(params)
ElNotification({ ElNotification({
title: '提示', title: '提示',

View File

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