fix : 修复项目实施-台账基础信息展示及表格更新功能
This commit is contained in:
@@ -152,3 +152,9 @@ export const updateLedger = (data) => {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
export const searchUpdateLedgerData = (projectId) => {
|
||||||
|
return request({
|
||||||
|
url: `/workflow/mosr/expense/ledger/${projectId}`,
|
||||||
|
method: "get"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function getDepartmentTree() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function getMosrDept(params) {
|
export function getMosrUser(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/admin/mosr/user/choose',
|
url: '/admin/mosr/user/choose',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-button color="#DED0B2" style="float: right;margin: 0 10px 10px 0" @click="exportTable">导出</el-button>
|
<el-button color="#DED0B2" style="float: right;margin: 0 10px 10px 0" @click="exportTable">导出</el-button>
|
||||||
<el-table ref="table" :data="tableData" style="width: 100%;height: 479px" :show-summary="true"
|
<el-table ref="table" :data="tableData" style="width: 100%;height: 479px" :show-summary="true" border
|
||||||
:summary-method="getSummaries" v-loading="loading" :header-cell-style="{background:'#f5f7fa'}">
|
:summary-method="getSummaries" v-loading="loading" :header-cell-style="{background:'#f5f7fa'}">
|
||||||
<el-table-column type="index" label="序号" align="center" width="60"/>
|
<el-table-column type="index" label="序号" align="center" width="60"/>
|
||||||
<el-table-column prop="projectName" label="项目名称" align="center"/>
|
<el-table-column prop="projectName" label="项目名称" align="center"/>
|
||||||
|
|||||||
@@ -12,32 +12,105 @@
|
|||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||||
import {toThousands} from '@/utils/changePrice.js'
|
import {toThousands} from '@/utils/changePrice.js'
|
||||||
import {computed, ref} from "vue";
|
|
||||||
import {getBaseInfoApi} from "@/components/steps/api";
|
import {getBaseInfoApi} from "@/components/steps/api";
|
||||||
|
import {searchUpdateLedgerData} from "@/api/project-manage";
|
||||||
|
import {ElNotification} from "element-plus";
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const schema = computed(() => {
|
const formArray = ref([
|
||||||
return [
|
{
|
||||||
{
|
label: '征集名称',
|
||||||
label: '征集名称',
|
prop: 'requirementName',
|
||||||
prop: 'requirementName',
|
colProps: {
|
||||||
colProps: {
|
span: 12
|
||||||
span: 12
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '项目名称',
|
|
||||||
prop: 'projectName',
|
|
||||||
colProps: {
|
|
||||||
span: 12
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
{
|
||||||
|
label: '项目名称',
|
||||||
|
prop: 'projectName',
|
||||||
|
colProps: {
|
||||||
|
span: 12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
const formDataArray = ref([
|
||||||
|
{
|
||||||
|
label: '征集名称',
|
||||||
|
prop: 'requirementName',
|
||||||
|
colProps: {
|
||||||
|
span: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '项目名称',
|
||||||
|
prop: 'projectName',
|
||||||
|
colProps: {
|
||||||
|
span: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '项目负责人',
|
||||||
|
prop: 'projectChargePerson',
|
||||||
|
colProps: {
|
||||||
|
span: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '项目开始时间',
|
||||||
|
prop: 'startTime',
|
||||||
|
colProps: {
|
||||||
|
span: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '项目预计持续时间',
|
||||||
|
prop: 'endTime',
|
||||||
|
colProps: {
|
||||||
|
span: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '项目开展方式',
|
||||||
|
prop: 'projectDevelopmentWay',
|
||||||
|
colProps: {
|
||||||
|
span: 24
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '项目预算',
|
||||||
|
prop: 'projectBudgetDescription',
|
||||||
|
colProps: {
|
||||||
|
span: 24
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '项目总体完成率(%)',
|
||||||
|
prop: 'projectCompletionRate',
|
||||||
|
colProps: {
|
||||||
|
span: 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '已完成工作量',
|
||||||
|
prop: 'completeWork',
|
||||||
|
colProps: {
|
||||||
|
span: 18
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
const tableData = ref({})
|
||||||
|
const schema = computed(() => {
|
||||||
|
if (JSON.stringify(tableData.value) !== '{}') {
|
||||||
|
return formDataArray.value
|
||||||
|
} else {
|
||||||
|
return formArray.value
|
||||||
|
}
|
||||||
})
|
})
|
||||||
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: ''}
|
||||||
])
|
])
|
||||||
const searchConfig = reactive([
|
const searchConfig = reactive([
|
||||||
@@ -158,10 +231,10 @@ const tableConfig = reactive({
|
|||||||
},
|
},
|
||||||
btns: btns.value
|
btns: btns.value
|
||||||
})
|
})
|
||||||
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 handleUpdateTable=()=>{
|
const handleUpdateTable = () => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'Implementation/update',
|
name: 'Implementation/update',
|
||||||
query: {
|
query: {
|
||||||
@@ -201,6 +274,21 @@ const search = (val) => {
|
|||||||
tableConfig.params = {...val, projectId: route.query.id}
|
tableConfig.params = {...val, projectId: route.query.id}
|
||||||
tableIns.value.refresh()
|
tableIns.value.refresh()
|
||||||
}
|
}
|
||||||
|
const init = async () => {
|
||||||
|
const {code, msg, data} = await searchUpdateLedgerData(route.query.id)
|
||||||
|
if (data) {
|
||||||
|
tableData.value = data
|
||||||
|
baseForm.value.setValues(data)
|
||||||
|
}
|
||||||
|
// if (code !== 1000) {
|
||||||
|
// ElNotification({
|
||||||
|
// title: '提示',
|
||||||
|
// message: msg,
|
||||||
|
// type: 'error'
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
init()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item prop="projectChargePerson" label="项目负责人">
|
<el-form-item prop="projectChargePerson" label="项目负责人">
|
||||||
{{currentPerson.name}}
|
{{tableForm.projectChargePerson?tableForm.projectChargePerson: currentPerson.name }}
|
||||||
<el-button @click="showPersonnelPicker">
|
<el-button @click="showPersonnelPicker">
|
||||||
{{ currentPerson.name ? '更改' : '请选择研发人员' }}
|
{{ tableForm.projectChargePerson||currentPerson.name ? '更改' : '请选择研发人员' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -54,9 +54,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item prop="projectCompletionRate" label="项目总体完成率">
|
<el-form-item prop="projectCompletionRate" label="项目总体完成率(%)">
|
||||||
<el-input v-model="tableForm.projectCompletionRate" placeholder="请输入项目总体完成率" clearable>
|
<el-input-number v-model="tableForm.projectCompletionRate" placeholder="请输入项目总体完成率" :controls="false" style="width: 200px">
|
||||||
</el-input>
|
</el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="16" :offset="1">
|
<el-col :span="16" :offset="1">
|
||||||
@@ -82,6 +82,7 @@ import {ref} from "vue";
|
|||||||
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||||
|
|
||||||
import {useTagsView} from '@/stores/tagsview.js'
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
|
import {searchUpdateLedgerData} from "@/api/project-manage";
|
||||||
|
|
||||||
const tagsViewStore = useTagsView()
|
const tagsViewStore = useTagsView()
|
||||||
const baseForm = ref()
|
const baseForm = ref()
|
||||||
@@ -103,7 +104,7 @@ const userPicker = ref()
|
|||||||
const selected = (select) => {
|
const selected = (select) => {
|
||||||
for (const selectElement of select) {
|
for (const selectElement of select) {
|
||||||
currentPerson.value = selectElement
|
currentPerson.value = selectElement
|
||||||
tableForm.value.projectChargePerson=selectElement.id
|
tableForm.value.projectChargePerson = selectElement.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const disabledDate = (time) => {
|
const disabledDate = (time) => {
|
||||||
@@ -116,22 +117,10 @@ const showPersonnelPicker = () => {
|
|||||||
userPicker.value.showUserPicker()
|
userPicker.value.showUserPicker()
|
||||||
}
|
}
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
console.log('tableForm', tableForm.value)
|
let params = {
|
||||||
let params={
|
|
||||||
...tableForm.value,
|
...tableForm.value,
|
||||||
projectId:route.query.id
|
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 => {
|
updateLedger(params).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||||
@@ -154,11 +143,19 @@ const getBaseInfo = async () => {
|
|||||||
const {code, data} = await getBaseInfoApi(route.query.id)
|
const {code, data} = await getBaseInfoApi(route.query.id)
|
||||||
tableForm.value.projectName = data.projectName
|
tableForm.value.projectName = data.projectName
|
||||||
}
|
}
|
||||||
|
|
||||||
getBaseInfo()
|
getBaseInfo()
|
||||||
const init = () => {
|
const init = async () => {
|
||||||
|
const {code, msg, data} = await searchUpdateLedgerData(route.query.id)
|
||||||
|
tableForm.value = data
|
||||||
|
if (code !== 1000) {
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: msg,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
init()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -70,9 +70,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, defineProps, defineExpose} from "vue";
|
|
||||||
import {ElMessageBox} from "element-plus";
|
import {ElMessageBox} from "element-plus";
|
||||||
import {getMosrDept} from "@/api/workflow/process-user";
|
import {getMosrUser} from "@/api/workflow/process-user";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
value: {
|
value: {
|
||||||
@@ -155,7 +154,7 @@ const getList = (flag) => {
|
|||||||
chooseName: filterText.value
|
chooseName: filterText.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getMosrDept(params).then(res => {
|
getMosrUser(params).then(res => {
|
||||||
// if (res.data) {
|
// if (res.data) {
|
||||||
if (selectItem.type === -1) {
|
if (selectItem.type === -1) {
|
||||||
dataList.value = res.data;
|
dataList.value = res.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user