Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
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
fulixin
dsk-operate-sys-cscec
Commits
0d3924f0
Commit
0d3924f0
authored
Mar 07, 2024
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
df3a8a55
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
183 additions
and
23 deletions
+183
-23
decimal.js
dsk-operate-ui/src/utils/decimal.js
+54
-0
AddActualCost.vue
...etail/components/FeedSummary/components/AddActualCost.vue
+87
-0
index.vue
...projectCostLedger/detail/components/FeedSummary/index.vue
+40
-21
index.vue
dsk-operate-ui/src/views/projectCostLedger/detail/index.vue
+2
-2
No files found.
dsk-operate-ui/src/utils/decimal.js
0 → 100644
View file @
0d3924f0
import
Decimal
from
"decimal.js"
;
/**
* 加法
* @param {*} num1
* @param {*} num2
* @returns
*/
export
const
add
=
(
num1
,
num2
)
=>
{
const
flag
=
(
!
parseFloat
(
num1
)
&&
parseFloat
(
num1
)
!=
"0"
)
||
(
!
parseFloat
(
num2
)
&&
parseFloat
(
num2
)
!=
"0"
);
if
(
flag
)
throw
new
Error
(
"传入参数错误,参数不为number"
);
const
decimal1
=
new
Decimal
(
num1
);
const
decimal2
=
new
Decimal
(
num2
);
return
decimal1
.
plus
(
decimal2
).
toString
();
};
/**
* 减法
* @param {*} num1
* @param {*} num2
* @returns
*/
export
const
subtract
=
(
num1
,
num2
)
=>
{
const
flag
=
(
!
parseFloat
(
num1
)
&&
parseFloat
(
num1
)
!=
"0"
)
||
(
!
parseFloat
(
num2
)
&&
parseFloat
(
num2
)
!=
"0"
);
const
decimal1
=
new
Decimal
(
num1
);
const
decimal2
=
new
Decimal
(
num2
);
return
decimal1
.
minus
(
decimal2
).
toString
();
};
/**
* 乘法
* @param {*} num1
* @param {*} num2
* @returns
*/
export
const
multiply
=
(
num1
,
num2
)
=>
{
const
flag
=
(
!
parseFloat
(
num1
)
&&
parseFloat
(
num1
)
!=
"0"
)
||
(
!
parseFloat
(
num2
)
&&
parseFloat
(
num2
)
!=
"0"
);
const
decimal1
=
new
Decimal
(
num1
);
const
decimal2
=
new
Decimal
(
num2
);
return
decimal1
.
times
(
decimal2
).
toString
();
};
/**
* 除法
* @param {*} num1
* @param {*} num2
* @returns
*/
export
const
divide
=
(
num1
,
num2
)
=>
{
const
flag
=
(
!
parseFloat
(
num1
)
&&
parseFloat
(
num1
)
!=
"0"
)
||
(
!
parseFloat
(
num2
)
&&
parseFloat
(
num2
)
!=
"0"
);
const
decimal1
=
new
Decimal
(
num1
);
const
decimal2
=
new
Decimal
(
num2
);
return
decimal1
.
dividedBy
(
decimal2
).
toString
();
};
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/components/AddActualCost.vue
0 → 100644
View file @
0d3924f0
<
template
>
<el-dialog
title=
"填写实际成本"
:visible=
"comDialogStatus"
class=
"add-actual-cost-container"
>
</el-dialog>
</
template
>
<
script
>
export
default
{
name
:
"AddActualCost"
,
props
:
{
dialogStatus
:
{
type
:
Boolean
,
default
:
false
}
},
model
:
{
prop
:
"dialogStatus"
,
event
:
"dialogStatusChange"
},
watch
:
{
dialogStatus
(
newValue
)
{
this
.
comDialogStatus
=
newValue
;
}
},
data
()
{
return
{
comDialogStatus
:
this
.
dialogStatus
};
},
//可访问data属性
created
()
{
},
//计算集
computed
:
{
},
//方法集
methods
:
{
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.add-actual-cost-container
{
::v-deep
.el-dialog
{
margin-top
:
0px
!
important
;
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
border-radius
:
4px
;
width
:
480px
;
.el-dialog__header
{
height
:
56px
;
padding
:
0px
20px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
border-bottom
:
1px
solid
#eeeeee
;
.el-dialog__title
{
font-size
:
16px
;
font-weight
:
bold
;
color
:
#232323
;
}
.el-dialog__headerbtn
{
position
:
static
;
width
:
16px
;
height
:
16px
;
.el-dialog__close
{
font-size
:
16px
;
}
}
}
.el-dialog__body
{
padding
:
0px
;
min-height
:
120px
;
padding
:
24px
20px
;
box-sizing
:
border-box
;
}
}
}
</
style
>
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/index.vue
View file @
0d3924f0
...
...
@@ -39,7 +39,7 @@
<table-list-com
:tableData=
"tableDataList"
:formColum=
"formColum"
v-else-if=
"!tableLoading"
:maxHeight=
"true"
:tableDataTotal=
"total"
:paging=
"false"
>
<
template
slot=
"action-field-bar"
slot-scope=
"scope"
>
<div
class=
"project-action-field-bar"
v-if=
"scope.row.id
=
= '0'"
>
<div
class=
"project-action-field-bar"
v-if=
"scope.row.id
!
= '0'"
>
<span
class=
"push-project"
>
推送工程量
</span>
</div>
<span
v-else
>
-
</span>
...
...
@@ -48,6 +48,10 @@
</div>
</div>
</div>
<!-- 填写实际成本触发 -->
<add-actual-cost
v-model=
"showAddActualCost"
></add-actual-cost>
</div>
</template>
<
script
>
...
...
@@ -56,9 +60,25 @@ import { getFeedSummaryMenuTreeApi, getFeedSummaryMonthListApi, getFeedSummaryLi
import
DskTableHeaderSetting
from
"@/components/DskTableHeaderSetting"
;
import
DskSkeleton
from
"@/components/DskSkeleton"
;
import
TableListCom
from
"@/components/TableListCom"
;
import
AddActualCost
from
"./components/AddActualCost"
;
import
{
v4
}
from
'uuid'
;
import
dayjs
from
"dayjs"
;
import
{
cloneDeep
}
from
"lodash-es"
;
import
{
add
}
from
"@/utils/decimal"
;
// 需要统计的字段名
const
statisticsPropNames
=
[
"guidePrice"
,
"bidUnitPrice"
,
"unitPriceDifference"
,
"quantity"
,
"combinedPrice"
,
"combinedPriceTax"
,
"quantities"
,
"totalQuantities"
,
"purchaseUnitPrice"
];
export
default
{
name
:
"feedSummary"
,
props
:
{
...
...
@@ -92,7 +112,8 @@ export default {
ProjectSideMenu
,
DskTableHeaderSetting
,
TableListCom
,
DskSkeleton
DskSkeleton
,
AddActualCost
},
data
()
{
return
{
...
...
@@ -156,18 +177,8 @@ export default {
// 数据列表
tableDataList
:
[],
statisticsParentName
:
[
"劳务分包工程"
,
"专业分包工程"
],
// 需要统计的字段名
statisticsPropNames
:
[
"guidePrice"
,
"bidUnitPrice"
,
"unitPriceDifference"
,
"quantity"
,
"combinedPrice"
,
"combinedPriceTax"
,
"quantities"
,
"totalQuantities"
,
"purchaseUnitPrice"
]
// 填写实际成本弹窗
showAddActualCost
:
false
};
},
//可访问data属性
...
...
@@ -251,7 +262,8 @@ export default {
const
_temp
=
list
.
data
;
// 计算总和
if
(
this
.
hasTarget
)
{
const
row
=
this
.
countRowParams
(
_temp
,
this
.
statisticsPropNames
);
const
row
=
this
.
countRowParams
(
_temp
,
statisticsPropNames
);
_temp
.
unshift
(
row
);
}
this
.
tableDataList
=
_temp
;
this
.
total
=
_temp
.
length
;
...
...
@@ -262,7 +274,7 @@ export default {
this
.
tableLoading
=
false
;
}
},
countRowParams
(
arraylist
=
[],
statisticsPropNames
)
{
countRowParams
(
arraylist
=
[],
_
statisticsPropNames
)
{
if
(
arraylist
.
length
)
{
const
_template
=
{};
const
_temp
=
cloneDeep
(
arraylist
[
0
]);
...
...
@@ -272,17 +284,24 @@ export default {
if
(
key
==
"id"
)
{
_template
[
key
]
=
"0"
;
continue
;
}
else
if
(
key
==
"cbSubjectName"
)
{
_template
[
key
]
=
"合计"
;
continue
;
}
_template
[
key
]
=
""
;
}
console
.
log
(
_template
);
// 循环统计 需要统计的列 总数
for
(
const
prop
of
statisticsPropNames
)
{
for
(
const
prop
of
_
statisticsPropNames
)
{
const
sum
=
arraylist
.
reduce
((
pre
,
current
,
index
)
=>
{
const
before
=
Object
.
prototype
.
toString
.
call
(
pre
)
==
"[object Object]"
?
pre
[
prop
]
:
parseFloat
(
pre
)
?
pre
:
0
;
const
after
=
Object
.
prototype
.
toString
.
call
(
current
)
==
"[object Object]"
?
current
[
prop
]
:
parseFloat
(
current
)
?
current
:
0
;
const
before
=
Object
.
prototype
.
toString
.
call
(
pre
)
==
"[object Object]"
?
pre
[
prop
]
?
pre
[
prop
]
:
0
:
parseFloat
(
pre
)
?
pre
:
0
;
const
after
=
Object
.
prototype
.
toString
.
call
(
current
)
==
"[object Object]"
?
current
[
prop
]
?
current
[
prop
]
:
0
:
parseFloat
(
current
)
?
current
:
0
;
return
add
(
before
,
after
);
},
0
);
// 对应key 赋值结果
_template
[
prop
]
=
sum
;
}
return
_template
;
}
},
async
getFeedSummaryMenuTree
(
params
)
{
...
...
@@ -374,7 +393,7 @@ export default {
},
// 填写或修改新的 成本月份
fillActualCost
()
{
this
.
showAddActualCost
=
true
;
}
},
}
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/index.vue
View file @
0d3924f0
...
...
@@ -193,8 +193,8 @@ export default {
const
detail
=
await
getProjectDetailApi
(
projectId
);
if
(
detail
.
code
==
200
&&
detail
.
data
)
{
if
(
detail
.
data
.
id
)
detail
.
data
[
"projectId"
]
=
detail
.
data
.
id
;
detail
.
data
[
"projectId"
]
=
"1754425038355890177"
;
detail
.
data
[
"cbStage"
]
=
0
;
//
detail.data["projectId"] = "1754425038355890177";
//
detail.data["cbStage"] = 0;
this
.
detailInfo
=
detail
.
data
;
}
}
catch
(
error
)
{
...
...
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