Merge pull request 'feat : 项目实施-台账新增表格更新功能' (#385) from dd into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/385
This commit is contained in:
@@ -145,3 +145,10 @@ export const getPreProcess= () => {
|
|||||||
method: "get"
|
method: "get"
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
export const updateLedger = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/workflow/mosr/expense/ledger/replenishment',
|
||||||
|
method: "post",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ const schema = computed(() => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
const baseForm = ref()
|
const baseForm = ref()
|
||||||
|
const tableIns = ref()
|
||||||
|
const btns=ref([
|
||||||
|
{name: '表格更新', key: 'update', color: '#DED0B2', auth: ''}
|
||||||
|
])
|
||||||
const searchConfig = reactive([
|
const searchConfig = reactive([
|
||||||
{
|
{
|
||||||
label: '时间',
|
label: '时间',
|
||||||
@@ -146,17 +150,25 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row}) => {
|
currentRender: ({row}) => {
|
||||||
return <span>{toThousands(row.afterTax)}</span>
|
return <span>{toThousands(row.afterTax)}</span>
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
api: '/workflow/mosr/expense/ledger',
|
api: '/workflow/mosr/expense/ledger',
|
||||||
params: {
|
params: {
|
||||||
projectId: route.query.id
|
projectId: route.query.id
|
||||||
},
|
},
|
||||||
btns: [
|
btns: btns.value
|
||||||
{name: '上传费用', key: 'add', color: '#DED0B2', auth: ''}
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
const tableIns = ref()
|
if(route.query.state!=4){
|
||||||
|
btns.value.push({name: '上传费用', key: 'add', color: '#DED0B2', auth: ''})
|
||||||
|
}
|
||||||
|
const handleUpdateTable=()=>{
|
||||||
|
router.push({
|
||||||
|
name: 'Implementation/update',
|
||||||
|
query: {
|
||||||
|
id: route.query.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
const getBaseInfo = async () => {
|
const getBaseInfo = async () => {
|
||||||
try {
|
try {
|
||||||
const {code, data} = await getBaseInfoApi(route.query.id)
|
const {code, data} = await getBaseInfoApi(route.query.id)
|
||||||
@@ -171,6 +183,9 @@ const headBtnClick = (key) => {
|
|||||||
case 'add':
|
case 'add':
|
||||||
handleUploadFee()
|
handleUploadFee()
|
||||||
break;
|
break;
|
||||||
|
case 'update':
|
||||||
|
handleUpdateTable()
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleUploadFee = () => {
|
const handleUploadFee = () => {
|
||||||
|
|||||||
@@ -344,11 +344,11 @@ const handleEdit = (row) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleStandingBook = (row) => {
|
const handleStandingBook = (row) => {
|
||||||
localStorage.setItem('projectName', row.projectName)
|
|
||||||
router.push({
|
router.push({
|
||||||
name: 'Implementation/account',
|
name: 'Implementation/account',
|
||||||
query: {
|
query: {
|
||||||
id: row.projectId
|
id: row.projectId,
|
||||||
|
state:row.state
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
166
src/views/project-management/implementation/updateTable.vue
Normal file
166
src/views/project-management/implementation/updateTable.vue
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<template>
|
||||||
|
<baseTitle title="表格更新"></baseTitle>
|
||||||
|
<el-form :model="tableForm" ref="form">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item prop="projectName" label="项目名称">
|
||||||
|
<span>{{ tableForm.projectName }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item prop="projectChargePerson" label="项目负责人">
|
||||||
|
{{currentPerson.name}}
|
||||||
|
<el-button @click="showPersonnelPicker">
|
||||||
|
{{ currentPerson.name ? '更改' : '请选择研发人员' }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="startTime" label="项目开始时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="tableForm.startTime"
|
||||||
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="选择项目开始时间"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="endTime" label="项目预计持续时间" :title="!tableForm.startTime?'请先选择项目开始时间!':''">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="tableForm.endTime"
|
||||||
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="选择项目预计持续时间"
|
||||||
|
:disabled="!tableForm.startTime"
|
||||||
|
:disabled-date="disabledDate"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item prop="projectDevelopmentWay" label="项目开展方式" style="width: 100%">
|
||||||
|
<el-input v-model="tableForm.projectDevelopmentWay" placeholder="请输入项目开展方式" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item prop="projectBudgetDescription" label="项目预算" style="width: 100%">
|
||||||
|
<el-input v-model="tableForm.projectBudgetDescription" placeholder="请输入项目预算" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item prop="projectCompletionRate" label="项目总体完成率">
|
||||||
|
<el-input v-model="tableForm.projectCompletionRate" placeholder="请输入项目总体完成率" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16" :offset="1">
|
||||||
|
<el-form-item prop="completeWork" label="已完成工作量">
|
||||||
|
<el-input v-model="tableForm.completeWork" placeholder="请输入已完成工作量" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<user-picker :multiple="false" ref="userPicker" title="请选择项目负责人" @ok="selected"/>
|
||||||
|
<div class="oper-page-btn">
|
||||||
|
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||||
|
<el-button @click="handleBack">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="jsx">
|
||||||
|
import {ElMessage, ElNotification} from "element-plus";
|
||||||
|
import {updateLedger} from "@/api/project-manage";
|
||||||
|
import {getBaseInfoApi} from "@/components/steps/api";
|
||||||
|
import {ref} from "vue";
|
||||||
|
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||||
|
|
||||||
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
|
|
||||||
|
const tagsViewStore = useTagsView()
|
||||||
|
const baseForm = ref()
|
||||||
|
const route = useRoute()
|
||||||
|
const router = useRouter()
|
||||||
|
const currentPerson = ref({})
|
||||||
|
const tableForm = ref({
|
||||||
|
projectName: '',
|
||||||
|
completeWork: '',
|
||||||
|
endTime: '',
|
||||||
|
projectBudgetDescription: '',
|
||||||
|
projectChargePerson: '',
|
||||||
|
projectCompletionRate: '',
|
||||||
|
projectDevelopmentWay: '',
|
||||||
|
projectId: '',
|
||||||
|
startTime: '',
|
||||||
|
})
|
||||||
|
const userPicker = ref()
|
||||||
|
const selected = (select) => {
|
||||||
|
for (const selectElement of select) {
|
||||||
|
currentPerson.value = selectElement
|
||||||
|
tableForm.value.projectChargePerson=selectElement.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const disabledDate = (time) => {
|
||||||
|
return time.getTime() < new Date(tableForm.value.startTime).getTime();
|
||||||
|
}
|
||||||
|
const handleBack = () => {
|
||||||
|
history.back()
|
||||||
|
}
|
||||||
|
const showPersonnelPicker = () => {
|
||||||
|
userPicker.value.showUserPicker()
|
||||||
|
}
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
console.log('tableForm', tableForm.value)
|
||||||
|
let params={
|
||||||
|
...tableForm.value,
|
||||||
|
projectId:route.query.id
|
||||||
|
}
|
||||||
|
// tableForm.value={
|
||||||
|
// "projectName": "测试上报622",
|
||||||
|
// "completeWork": "已完成系统性需求调研、核心业务流程梳理以及研发计划的制定。",
|
||||||
|
// "endTime": "2024-06-26",
|
||||||
|
// "projectBudgetDescription": "本项目总研发投入预算为xx万元,其中支付给外部专业机构的合作研发费用预计为xx万元。(示例)",
|
||||||
|
// "projectChargePerson": 161,
|
||||||
|
// "projectCompletionRate": "40",
|
||||||
|
// "projectDevelopmentWay": "项目采用合作研发模式,由省国经公司牵头,联合本领域外部专业研究机构作为合作方共同开展。",
|
||||||
|
// "projectId": "",
|
||||||
|
// "startTime": "2024-06-11"
|
||||||
|
// }
|
||||||
|
updateLedger(params).then(res => {
|
||||||
|
if (res.code === 1000) {
|
||||||
|
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
|
router.push({
|
||||||
|
name: 'Implementation/account',
|
||||||
|
query: {
|
||||||
|
id: route.query.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: res.msg,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const getBaseInfo = async () => {
|
||||||
|
const {code, data} = await getBaseInfoApi(route.query.id)
|
||||||
|
tableForm.value.projectName = data.projectName
|
||||||
|
}
|
||||||
|
|
||||||
|
getBaseInfo()
|
||||||
|
const init = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user