fix : 修复项目实施-台账基础信息展示及表格更新功能
This commit is contained in:
@@ -12,32 +12,105 @@
|
||||
<script setup lang="jsx">
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {toThousands} from '@/utils/changePrice.js'
|
||||
import {computed, ref} from "vue";
|
||||
import {getBaseInfoApi} from "@/components/steps/api";
|
||||
import {searchUpdateLedgerData} from "@/api/project-manage";
|
||||
import {ElNotification} from "element-plus";
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const schema = computed(() => {
|
||||
return [
|
||||
{
|
||||
label: '征集名称',
|
||||
prop: 'requirementName',
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '项目名称',
|
||||
prop: 'projectName',
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
const formArray = ref([
|
||||
{
|
||||
label: '征集名称',
|
||||
prop: 'requirementName',
|
||||
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 tableIns = ref()
|
||||
const btns=ref([
|
||||
const btns = ref([
|
||||
{name: '表格更新', key: 'update', color: '#DED0B2', auth: ''}
|
||||
])
|
||||
const searchConfig = reactive([
|
||||
@@ -158,10 +231,10 @@ const tableConfig = reactive({
|
||||
},
|
||||
btns: btns.value
|
||||
})
|
||||
if(route.query.state!=4){
|
||||
if (route.query.state !== '4') {
|
||||
btns.value.push({name: '上传费用', key: 'add', color: '#DED0B2', auth: ''})
|
||||
}
|
||||
const handleUpdateTable=()=>{
|
||||
const handleUpdateTable = () => {
|
||||
router.push({
|
||||
name: 'Implementation/update',
|
||||
query: {
|
||||
@@ -201,6 +274,21 @@ const search = (val) => {
|
||||
tableConfig.params = {...val, projectId: route.query.id}
|
||||
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>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user