Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
紫光云
web-project
Commits
4e9112d9
Commit
4e9112d9
authored
Dec 24, 2024
by
高滢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(年度资金计划): 填报
parent
58b906e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
35 deletions
+34
-35
domUtils.ts
src/utils/domUtils.ts
+9
-0
completedEdit.vue
src/views/completed/completedEdit/completedEdit.vue
+21
-32
tableData.tsx
src/views/completed/completedEdit/tableData.tsx
+3
-2
index.vue
src/views/completed/index.vue
+1
-1
No files found.
src/utils/domUtils.ts
View file @
4e9112d9
...
...
@@ -196,3 +196,12 @@ export function useRafThrottle<T extends FunctionArgs>(fn: T): T {
});
};
}
// 小数计算
export
function
getNumber
(
a
,
b
)
{
let
val
=
Number
(
a
)
+
Number
(
b
);
if
(
!
isNaN
(
parseFloat
(
val
)))
{
val
=
val
.
toFixed
(
2
);
}
return
val
;
}
src/views/completed/completedEdit/completedEdit.vue
View file @
4e9112d9
...
...
@@ -3,7 +3,6 @@
<template
#
extra
>
<a-button
type=
"primary"
v-if=
"!disabled"
@
click=
"handleSubmit('0')"
>
暂存
</a-button>
<a-button
type=
"primary"
v-if=
"!disabled"
@
click=
"handleSubmit('1')"
>
提交
</a-button>
<!--
<a-button
type=
"primary"
@
click=
"history"
v-if=
"historyData"
>
历史记录
</a-button>
-->
<a-button
type=
"default"
@
click=
"router.back()"
>
返回
</a-button>
</
template
>
<CollapseContainer
v-for=
"(item, index) in tabsFormSchema"
:key=
"index"
v-show=
"item.show"
>
...
...
@@ -48,7 +47,7 @@
beforeEditSubmitTwo(item, index);
}
"
:scroll=
"{ x: 2000, y:
400
}"
:scroll=
"{ x: 2000, y:
400
}"
/>
</div>
</div>
...
...
@@ -72,10 +71,7 @@
import
Operations
from
'@/components/Operations/Operations.vue'
;
import
{
router
}
from
'@/router'
;
import
{
BasicTable
,
useTable
}
from
'@/components/Table'
;
import
{
getBasicColumnsTwo
,
basicColumnsTwoDisabled
,
}
from
'./tableData'
;
import
{
getBasicColumnsTwo
,
basicColumnsTwoDisabled
}
from
'./tableData'
;
import
{
ref
,
nextTick
,
onMounted
,
unref
,
reactive
}
from
'vue'
;
import
CollapseContainer
from
'@/components/Container/src/collapse/CollapseContainer.vue'
;
import
completedModel
from
'../completedModel/completedModel.vue'
;
...
...
@@ -90,6 +86,7 @@
import
{
addItem
,
updateItem
,
getItem
}
from
'@/api/project/completed'
;
import
{
editModel
}
from
'@/api/project/model/engineeringprojectModel'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
{
getNumber
}
from
'@/utils/domUtils'
;
//历史记录是否可查
const
historyData
=
ref
(
true
);
...
...
@@ -101,27 +98,27 @@
let
{
getDataSource
}
=
item
.
tableTwo
[
1
];
const
res
=
getDataSource
();
const
totalNo
=
res
.
reduce
((
prev
,
next
)
=>
{
prev
+=
Number
(
next
.
specialBond
);
prev
=
getNumber
(
prev
,
next
.
specialBond
);
return
prev
;
},
0
);
const
totalNoTwo
=
res
.
reduce
((
prev
,
next
)
=>
{
prev
+=
Number
(
next
.
bankFinancing
);
prev
=
getNumber
(
prev
,
next
.
bankFinancing
);
return
prev
;
},
0
);
const
totalNoThree
=
res
.
reduce
((
prev
,
next
)
=>
{
prev
+=
Number
(
next
.
ownFunds
);
prev
=
getNumber
(
prev
,
next
.
ownFunds
);
return
prev
;
},
0
);
const
totalNofour
=
res
.
reduce
((
prev
,
next
)
=>
{
prev
+=
Number
(
next
.
governmentGrant
);
prev
=
getNumber
(
prev
,
next
.
governmentGrant
);
return
prev
;
},
0
);
const
totalNofiv
=
res
.
reduce
((
prev
,
next
)
=>
{
prev
+=
Number
(
next
.
fundingGap
);
prev
=
getNumber
(
prev
,
next
.
fundingGap
);
return
prev
;
},
0
);
const
totalNosix
=
res
.
reduce
((
prev
,
next
)
=>
{
prev
+=
Number
(
next
.
totalValue
);
prev
=
getNumber
(
prev
,
next
.
totalValue
);
return
prev
;
},
0
);
tabsFormSchema
[
index
].
tableTwo
[
1
].
setProps
({
...
...
@@ -175,11 +172,6 @@
let
res
=
await
getItem
({
id
});
console
.
log
(
'后端返回的数据'
,
res
);
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
// const amountList = res[i].amountList;
// let num = 0;
// for (let a = 0; a
<
amountList
.
length
;
a
++
)
{
// num += Number(amountList[a].value);
// }
const
sourceList
=
res
[
i
].
sourceList
;
let
specialBondNum
=
0
;
let
bankFinancingNum
=
0
;
...
...
@@ -188,12 +180,12 @@
let
totalValueNum
=
0
;
let
fundingGapNum
=
0
;
for
(
let
a
=
0
;
a
<
sourceList
.
length
;
a
++
)
{
specialBondNum
+=
Number
(
sourceList
[
a
].
specialBond
);
bankFinancingNum
+=
Number
(
sourceList
[
a
].
bankFinancing
);
ownFundsNum
+=
Number
(
sourceList
[
a
].
ownFunds
);
governmentGrantNum
+=
Number
(
sourceList
[
a
].
governmentGrant
);
totalValueNum
+=
Number
(
sourceList
[
a
].
totalValue
);
fundingGapNum
+=
Number
(
sourceList
[
a
].
fundingGap
);
specialBondNum
=
getNumber
(
Number
(
sourceList
[
a
].
specialBond
),
specialBondNum
);
bankFinancingNum
=
getNumber
(
Number
(
sourceList
[
a
].
bankFinancing
),
bankFinancingNum
);
ownFundsNum
=
getNumber
(
Number
(
sourceList
[
a
].
ownFunds
),
ownFundsNum
);
governmentGrantNum
=
getNumber
(
Number
(
sourceList
[
a
].
governmentGrant
),
governmentGrantNum
);
totalValueNum
=
getNumber
(
Number
(
sourceList
[
a
].
totalValue
),
totalValueNum
);
fundingGapNum
=
getNumber
(
Number
(
sourceList
[
a
].
fundingGap
),
fundingGapNum
);
}
const
item
=
{
proId
:
res
[
i
].
proId
,
...
...
@@ -235,7 +227,6 @@
if
(
formData
.
value
.
subList
===
undefined
)
{
formData
.
value
.
subList
=
[];
}
// setTable(item.table[1], info.amountList);
setTable
(
item
.
tableTwo
[
1
],
info
.
sourceList
);
nextTick
(()
=>
{
setFieldsValue
(
info
);
...
...
@@ -254,7 +245,6 @@
proId
:
string
;
name
:
string
;
show
?:
boolean
;
// sumData?: any;
sumDatatwo
?:
any
;
forceRender
?:
boolean
;
Form
:
UseFormReturnType
;
...
...
@@ -447,18 +437,17 @@
let
item
=
tabsFormSchema
[
i
];
if
(
item
.
show
)
{
const
{
validate
,
getFieldsValue
}
=
item
.
Form
[
1
];
// let data = getData(item.table[1]);
let
dataTwo
=
getData
(
item
.
tableTwo
[
1
]);
await
validate
();
let
res
=
getFieldsValue
();
console
.
log
(
'表单的数据'
,
res
);
for
(
let
j
=
0
;
j
<
dataTwo
.
length
;
j
++
)
{
dataTwo
[
j
].
governmentGrant
=
Number
(
dataTwo
[
j
].
governmentGrant
);
dataTwo
[
j
].
specialBond
=
Number
(
dataTwo
[
j
].
specialBond
);
dataTwo
[
j
].
bankFinancing
=
Number
(
dataTwo
[
j
].
bankFinancing
);
dataTwo
[
j
].
ownFunds
=
Number
(
dataTwo
[
j
].
ownFunds
);
dataTwo
[
j
].
totalValue
=
Number
(
dataTwo
[
j
].
totalValue
);
dataTwo
[
j
].
fundingGap
=
Number
(
dataTwo
[
j
].
fundingGap
);
dataTwo
[
j
].
editValueRefs
.
governmentGrant
=
Number
(
dataTwo
[
j
].
governmentGrant
);
dataTwo
[
j
].
editValueRefs
.
specialBond
=
Number
(
dataTwo
[
j
].
specialBond
);
dataTwo
[
j
].
editValueRefs
.
bankFinancing
=
Number
(
dataTwo
[
j
].
bankFinancing
);
dataTwo
[
j
].
editValueRefs
.
ownFunds
=
Number
(
dataTwo
[
j
].
ownFunds
);
dataTwo
[
j
].
editValueRefs
.
totalValue
=
Number
(
dataTwo
[
j
].
totalValue
);
dataTwo
[
j
].
editValueRefs
.
fundingGap
=
Number
(
dataTwo
[
j
].
fundingGap
);
}
var
obj
=
{
startTime
:
res
.
time
?
res
.
time
[
0
]
:
''
,
...
...
src/views/completed/completedEdit/tableData.tsx
View file @
4e9112d9
...
...
@@ -94,12 +94,13 @@ export function getBasicColumnsTwo(): BasicColumn[] {
width
:
50
,
customRender
:
({
record
})
=>
{
// 这里可以根据record的其他字段计算值
record
.
totalValue
=
record
.
totalValue
=
(
Number
(
record
.
ownFunds
)
+
Number
(
record
.
specialBond
)
+
Number
(
record
.
bankFinancing
)
+
Number
(
record
.
governmentGrant
)
+
Number
(
record
.
fundingGap
);
// 计算新值
Number
(
record
.
fundingGap
)
).
toFixed
(
2
);
// 计算新值
return
record
.
totalValue
;
// 返回计算后的值
},
},
...
...
src/views/completed/index.vue
View file @
4e9112d9
...
...
@@ -75,7 +75,7 @@
</div>
</
template
>
<
template
#
toolbar
>
<a-button
class=
"btn"
type=
"primary"
@
click=
"addCompleted(planType)"
>
{{
'新建
投资
计划'
+
'('
+
planType
+
')'
}}
</a-button>
<a-button
class=
"btn"
type=
"primary"
@
click=
"addCompleted(planType)"
>
{{
'新建
资金
计划'
+
'('
+
planType
+
')'
}}
</a-button>
<!--
<a-button
class=
"btn"
type=
"primary"
@
click=
"addCompleted('计划投资项目')"
>
-->
<!-- 新建年度工程资金计划(计划投资项目)-->
<!--
</a-button>
-->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment