|
|
|
|
@@ -20,96 +20,107 @@
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-table :data="formData.tableData" style="width: 100%">
|
|
|
|
|
<el-table-column prop="projectId" label="项目名称" width="230">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.projectId?'1':rules.projectId">
|
|
|
|
|
<el-select v-model="scope.row.projectId" placeholder="请选择项目名称" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in nameOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="researchPersonnel" label="研发人员" width="230">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.researchPersonnel?'1':rules.researchPersonnel">
|
|
|
|
|
<el-select v-model="scope.row.researchPersonnel" placeholder="请选择研发人员" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in researchOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="wagesPayable" label="应发工资" width="175">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.wagesPayable?'1':rules.wagesPayable">
|
|
|
|
|
<el-input-number v-model="scope.row.wagesPayable" placeholder="请输入应发工资" :controls="false"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="performance" label="绩效" width="175">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.performance?'1':rules.performance">
|
|
|
|
|
<el-input-number v-model="scope.row.performance" placeholder="请输入绩效" :controls="false"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="reserveFund" label="公积金" width="175">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.reserveFund?'1':rules.reserveFund">
|
|
|
|
|
<el-input-number v-model="scope.row.reserveFund" placeholder="请输入公积金" :controls="false"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="socialSecurity" label="社保" width="175">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.socialSecurity?'1':rules.socialSecurity">
|
|
|
|
|
<el-input-number v-model="scope.row.socialSecurity" placeholder="请输入社保" :controls="false"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="annuity" label="年金" width="175">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.annuity?'1':rules.annuity">
|
|
|
|
|
<el-input-number v-model="scope.row.annuity" placeholder="请输入年金" :controls="false"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="workday" label="工作日(天)" width="175">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-form-item prop="time" :rules="scope.row.workday?'1':rules.workday">
|
|
|
|
|
<el-input-number v-model="scope.row.workday" placeholder="请输入工作日" :controls="false"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="researchDuration" label="研发时长(天)" width="175">
|
|
|
|
|
<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"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column prop="time" label="时间">-->
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
<!-- <el-input v-model="scope.row.time" placeholder="请输入时间" clearable>-->
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column prop="subtotal" label="小计">-->
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
<!-- <el-input v-model="scope.row.subtotal" placeholder="请输入小计" clearable>-->
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<el-table-column prop="oper" label="操作">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button type="primary" @click="handleCopy(scope.row)" link style="font-size: 18px">复制</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleDelete(scope.$index)" link style="font-size: 18px">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-table :data="tableData" style="width: 100%">
|
|
|
|
|
<el-table-column prop="projectId" label="项目名称" width="180">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-select v-model="scope.row.projectId" placeholder="请选择项目名称" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in nameOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="researchPersonnel" label="研发人员" width="180">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-select v-model="scope.row.researchPersonnel" placeholder="请选择研发人员" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in researchOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="wagesPayable" label="应发工资">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.wagesPayable" placeholder="请输入应发工资" clearable>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="performance" label="绩效">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.performance" placeholder="请输入绩效" clearable>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="reserveFund" label="公积金">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.reserveFund" placeholder="请输入公积金" clearable>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="socialSecurity" label="社保">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.socialSecurity" placeholder="请输入社保" clearable>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="annuity" label="年金">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.annuity" placeholder="请输入年金" clearable>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="workday" label="工作日(天)">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.workday" placeholder="请输入工作日" clearable>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="researchDuration" label="研发时长(天)">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-input v-model="scope.row.researchDuration" placeholder="请输入研发时长" clearable>
|
|
|
|
|
</el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column prop="time" label="时间">-->
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
<!-- <el-input v-model="scope.row.time" placeholder="请输入时间" clearable>-->
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- <el-table-column prop="subtotal" label="小计">-->
|
|
|
|
|
<!-- <template #default="scope">-->
|
|
|
|
|
<!-- <el-input v-model="scope.row.subtotal" placeholder="请输入小计" clearable>-->
|
|
|
|
|
<!-- </el-input>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<el-table-column prop="oper" label="操作">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button type="primary" @click="handleCopy(scope.row)" link style="font-size: 18px">复制</el-button>
|
|
|
|
|
<el-button type="primary" @click="handleDelete(scope.$index)" link style="font-size: 18px">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div style="width:100%;text-align: center;padding: 10px">
|
|
|
|
|
<el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
@@ -127,13 +138,22 @@
|
|
|
|
|
<script setup lang="jsx">
|
|
|
|
|
import {ElNotification} from "element-plus";
|
|
|
|
|
import {useTagsView} from '@/stores/tagsview.js'
|
|
|
|
|
import {addAllocation, getAllocationDetail,getAllocationProcess} from "@/api/expense-manage";
|
|
|
|
|
import {addAllocation, getAllocationDetail, getAllocationProcess, getResearchUser,getProjectOption} from "@/api/expense-manage";
|
|
|
|
|
import {useProcessStore} from '@/stores/processStore.js';
|
|
|
|
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
|
|
|
|
|
|
|
|
|
const rules = reactive({
|
|
|
|
|
shareName: [{required: true, message: '请输入分摊名称', trigger: 'blur'}],
|
|
|
|
|
apportionmentMonth: [{required: true, message: '请选择月份', trigger: 'blur'}]
|
|
|
|
|
apportionmentMonth: [{required: true, message: '请选择月份', trigger: 'blur'}],
|
|
|
|
|
projectId: [{required: true, message: '请选择项目名称', trigger: 'blur'}],
|
|
|
|
|
researchPersonnel: [{required: true, message: '请选择研发人员', trigger: 'blur'}],
|
|
|
|
|
wagesPayable: [{required: true, message: '请输入应发工资', trigger: 'blur'}],
|
|
|
|
|
performance: [{required: true, message: '请输入绩效', trigger: 'blur'}],
|
|
|
|
|
reserveFund: [{required: true, message: '请输入公积金', trigger: 'blur'}],
|
|
|
|
|
socialSecurity: [{required: true, message: '请输入社保', trigger: 'blur'}],
|
|
|
|
|
annuity: [{required: true, message: '请输入年金', trigger: 'blur'}],
|
|
|
|
|
workday: [{required: true, message: '请输入工作日', trigger: 'blur'}],
|
|
|
|
|
researchDuration: [{required: true, message: '请输入研发时长', trigger: 'blur'}],
|
|
|
|
|
})
|
|
|
|
|
const processStore = useProcessStore()
|
|
|
|
|
const processInstanceData = ref()
|
|
|
|
|
@@ -142,35 +162,34 @@ const loading = ref(false)
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const tagsViewStore = useTagsView()
|
|
|
|
|
const formData = ref({})
|
|
|
|
|
let formData = reactive({
|
|
|
|
|
tableData: [
|
|
|
|
|
{
|
|
|
|
|
projectId:'',
|
|
|
|
|
projectName: '',
|
|
|
|
|
researchPersonnel:'',
|
|
|
|
|
wagesPayable:'',
|
|
|
|
|
performance:'',
|
|
|
|
|
reserveFund:'',
|
|
|
|
|
socialSecurity:'',
|
|
|
|
|
annuity:'',
|
|
|
|
|
workday:'',
|
|
|
|
|
researchDuration:''
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
const form = ref()
|
|
|
|
|
const nameOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
label: "某项目",
|
|
|
|
|
value: '42'
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
const researchOptions = ref([
|
|
|
|
|
{
|
|
|
|
|
label: "某人员",
|
|
|
|
|
value: '1'
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
const tableData = ref([
|
|
|
|
|
{
|
|
|
|
|
projectId: '',
|
|
|
|
|
projectName: '',
|
|
|
|
|
researchPersonnel: '',
|
|
|
|
|
wagesPayable: '',
|
|
|
|
|
performance: '',
|
|
|
|
|
reserveFund: '',
|
|
|
|
|
socialSecurity: '',
|
|
|
|
|
annuity: '',
|
|
|
|
|
workday: '',
|
|
|
|
|
researchDuration: '',
|
|
|
|
|
// subtotal: '',
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
const nameOptions = ref([])
|
|
|
|
|
const researchOptions = ref([])
|
|
|
|
|
|
|
|
|
|
const getResearchOptions = async () => {
|
|
|
|
|
const res = await getResearchUser()
|
|
|
|
|
researchOptions.value = res.data
|
|
|
|
|
}
|
|
|
|
|
const getProjectOptions = async () => {
|
|
|
|
|
const res = await getProjectOption()
|
|
|
|
|
nameOptions.value = res.data
|
|
|
|
|
}
|
|
|
|
|
const handleAdd = () => {
|
|
|
|
|
let row = {
|
|
|
|
|
projectId: '',
|
|
|
|
|
@@ -185,21 +204,21 @@ const handleAdd = () => {
|
|
|
|
|
researchDuration: '',
|
|
|
|
|
// subtotal: '',
|
|
|
|
|
}
|
|
|
|
|
tableData.value.push(row)
|
|
|
|
|
formData.tableData.push(row)
|
|
|
|
|
}
|
|
|
|
|
const handleCopy = (row) => {
|
|
|
|
|
tableData.value.push(row)
|
|
|
|
|
formData.tableData.push(row)
|
|
|
|
|
}
|
|
|
|
|
const handleDelete = (index) => {
|
|
|
|
|
tableData.value.splice(index, 1)
|
|
|
|
|
formData.tableData.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
const handleSubmit = (instance) => {
|
|
|
|
|
if (!instance) return
|
|
|
|
|
instance.validate(async (valid) => {
|
|
|
|
|
if (!valid) return
|
|
|
|
|
let params = {
|
|
|
|
|
...formData.value,
|
|
|
|
|
usrAllocations: tableData.value,
|
|
|
|
|
...formData,
|
|
|
|
|
usrAllocations: formData.tableData,
|
|
|
|
|
deploymentId: processInstanceData.value.deploymentId,
|
|
|
|
|
}
|
|
|
|
|
const {code, msg} = await addAllocation(params)
|
|
|
|
|
@@ -224,13 +243,15 @@ const getDetailInfo = async () => {
|
|
|
|
|
type: res.code === 1000 ? 'success' : 'error'
|
|
|
|
|
})
|
|
|
|
|
if (res.code === 1000) {
|
|
|
|
|
formData.value = res.data.formData
|
|
|
|
|
formData = res.data.formData
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const init = async () => {
|
|
|
|
|
processDiagramViewer.value = false
|
|
|
|
|
await getResearchOptions()
|
|
|
|
|
await getProjectOptions()
|
|
|
|
|
getAllocationProcess().then(res => {
|
|
|
|
|
if (res.code === 1000) {
|
|
|
|
|
let data = res.data
|
|
|
|
|
@@ -244,7 +265,7 @@ const init = async () => {
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
processDiagramViewer.value = true
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
ElNotification({
|
|
|
|
|
title: '提示',
|
|
|
|
|
message: res.msg,
|
|
|
|
|
|