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
6e69092d
Commit
6e69092d
authored
Mar 20, 2024
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
4e616dd1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
21 deletions
+95
-21
decimal.js
dsk-operate-ui/src/utils/decimal.js
+7
-0
PushProjectUseDialog.vue
...omponents/FeedSummary/components/PushProjectUseDialog.vue
+87
-19
index.vue
...projectCostLedger/detail/components/FeedSummary/index.vue
+1
-2
No files found.
dsk-operate-ui/src/utils/decimal.js
View file @
6e69092d
...
...
@@ -59,3 +59,10 @@ export const divide = (num1, num2, digit = 9, omit = false) => {
const
result
=
decimal1
.
dividedBy
(
decimal2
);
return
omit
?
result
.
toFixed
(
digit
,
Decimal
.
ROUND_UP
)
:
result
.
toDecimalPlaces
(
digit
,
Decimal
.
ROUND_UP
).
toString
();
};
// 检测结果是否是负数
export
const
targetIsNegative
=
(
num
)
=>
{
const
flag
=
(
!
parseFloat
(
num
)
&&
parseFloat
(
num
)
!=
"0"
);
if
(
flag
)
throw
new
Error
(
"传入参数错误,参数不为number"
);
return
new
Decimal
(
num
).
isNegative
();
};
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/components/PushProjectUseDialog.vue
View file @
6e69092d
<
template
>
<el-dialog
:title=
"comIsEntityMaterials ? '推送到物资用量' : '推送工程量'"
:visible
.
sync=
"comPushProjectUseDialog"
width=
"480px
"
class=
"push-project-use-dialog"
@
close=
"dialogClos
e"
>
<el-dialog
:title=
"comIsEntityMaterials ? '推送到物资用量' : '推送工程量'"
:visible
=
"comPushProjectUseDialog"
width=
"480px"
class=
"push-project-use-dialog
"
@
close=
"dialogClose"
@
open=
"dialogOpen"
:close-on-click-modal=
"false"
:destroy-on-close=
"tru
e"
>
<div
class=
"dialog-body-content"
>
<el-form
:model=
"pushForm"
ref=
"pushForm"
:rules=
"rules"
class=
"push-form"
>
<el-form-item
label=
"分包项目名称"
>
<el-input
:value=
"pushForm.projectName"
:disabled=
"true"
></el-input>
<el-input
:value=
"pushForm.project
DetailInfo.project
Name"
:disabled=
"true"
></el-input>
</el-form-item>
<el-form-item
label=
"本月实际工程量"
>
<el-input
:value=
"pushForm.totalQuantities"
:disabled=
"true"
></el-input>
</el-form-item>
<el-form-item
label=
"需推送工程量"
prop=
"pushQuantities"
>
<el-form-item
label=
"需推送工程量"
prop=
"pushQuantities"
:rules=
"pushQuantitiesValidator(pushForm.totalQuantities)"
>
<el-input
v-model=
"pushForm.pushQuantities"
placeholder=
"请填写需推送工程量"
></el-input>
</el-form-item>
<!-- ipm项目编码 -->
<el-form-item
label=
"IPM项目编码"
>
<el-input
v-model=
"pushForm.projectDetailInfo.ipmProjectNo"
placeholder=
"请输入IPM项目编码"
></el-input>
</el-form-item>
<!-- ipm合同编码 -->
<el-form-item
label=
"IPM合同编码"
>
<el-input
v-model=
"pushForm.ipmContractCode"
placeholder=
"请输入IPM合同编码"
></el-input>
</el-form-item>
<!-- ipm作业编码 -->
<el-form-item
label=
"IPM作业编码"
>
<el-input
v-model=
"pushForm.ipmBizCode"
placeholder=
"请输入IPM作业编码"
></el-input>
</el-form-item>
</el-form>
</div>
<!-- 底部按钮 -->
<div
class=
"dialog-footer-content"
>
<div
class=
"footer-btn cancel-submit"
@
click=
"cancelSubmit"
>
取消
</div>
<div
class=
"footer-btn ok-submit"
>
确定推送
</div>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
subtract
}
from
"@/utils/decimal"
;
import
{
subtract
,
targetIsNegative
}
from
"@/utils/decimal"
;
import
{
cloneDeep
}
from
'lodash-es'
;
export
default
{
name
:
"pushProjectUseDialog"
,
...
...
@@ -58,12 +75,6 @@ export default {
}
},
data
()
{
// 验证需推送工程量
const
pushQuantitiesValidator
=
(
rule
,
value
,
callback
)
=>
{
const
reg
=
/^
(?!
0
\d)(?!
0+$
)(?!
0*
\.
0*$
)\d
+
(\.\d
+
)?
$/
;
if
(
!
reg
.
test
(
value
))
return
callback
(
new
Error
(
"请输入正确的工程量"
));
callback
();
};
return
{
comIsEntityMaterials
:
this
.
isEntityMaterials
,
comPushProjectUseDialog
:
this
.
pushProjectUseDialog
,
...
...
@@ -72,13 +83,14 @@ export default {
pushQuantities
:
""
,
ipmProjectCode
:
""
,
ipmContractCode
:
""
,
ipmBizCode
:
""
ipmBizCode
:
""
,
totalQuantities
:
""
,
projectDetailInfo
:
{
projectName
:
""
,
ipmProjectNo
:
""
}
},
rules
:
{
pushQuantities
:
[
{
trigger
:
[
"blur"
,
"change"
],
validator
:
pushQuantitiesValidator
}
]
}
rules
:
{}
};
},
//可访问data属性
...
...
@@ -91,12 +103,30 @@ export default {
},
//方法集
methods
:
{
// 验证需推送工程量
pushQuantitiesValidator
(
maxValue
)
{
return
[{
trigger
:
[
'blur'
,
'change'
],
validator
:
(
rule
,
value
,
callback
)
=>
{
const
reg
=
/^
(?!
0
\d)(?!
0+$
)(?!
0*
\.
0*$
)\d
+
(\.\d
+
)?
$/
;
if
(
!
reg
.
test
(
value
))
return
callback
(
new
Error
(
"请输入正确的工程量"
));
const
_maxValue
=
maxValue
?
maxValue
:
0
;
if
(
targetIsNegative
(
subtract
(
_maxValue
,
value
)))
return
callback
(
new
Error
(
"注:推送工程量不得大于实际产生的总工程量"
));
callback
();
}
}];
},
dialogClose
()
{
const
form
=
this
.
$refs
[
"pushForm"
];
if
(
form
)
form
.
clearValidate
();
this
.
$emit
(
"dialogClose"
);
this
.
pushForm
=
this
.
$options
.
data
.
call
(
this
).
pushForm
;
const
form
=
this
.
$refs
[
"pushForm"
];
if
(
form
)
form
.
clearValidate
();
this
.
$emit
(
"close"
,
false
);
},
dialogOpen
()
{
},
cancelSubmit
()
{
this
.
comPushProjectUseDialog
=
false
;
}
},
}
...
...
@@ -143,6 +173,10 @@ export default {
.push-form
{
.el-form-item
{
&
.is-error
{
margin-bottom
:
33px
;
}
margin-bottom
:
16px
;
display
:
flex
;
align-items
:
center
;
...
...
@@ -186,6 +220,40 @@ export default {
}
}
}
.dialog-footer-content
{
padding
:
16px
20px
;
box-sizing
:
border-box
;
border-top
:
1px
solid
#eeeeee
;
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
.footer-btn
{
height
:
32px
;
padding
:
0px
16px
;
font-size
:
14px
;
font-weight
:
350
;
box-sizing
:
border-box
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
border-radius
:
4px
;
cursor
:
pointer
;
&
.cancel-submit
{
color
:
rgba
(
35
,
35
,
35
,
0
.8
);
background
:
#fff
;
border
:
1px
solid
#dcdfe6
;
margin-right
:
12px
;
}
&
.ok-submit
{
color
:
#fff
;
background
:
#0081ff
;
}
}
}
}
}
}
...
...
dsk-operate-ui/src/views/projectCostLedger/detail/components/FeedSummary/index.vue
View file @
6e69092d
...
...
@@ -641,8 +641,7 @@ export default {
pushProjectUse
(
row
)
{
if
(
!
row
.
id
)
return
;
// 打开推送推送弹窗
const
_temp
=
{
...
this
.
pushProjectUseTemp
,
...
cloneDeep
(
row
)
};
_temp
.
projectName
=
this
.
projectDetailInfo
.
projectName
;
const
_temp
=
{
...
this
.
pushProjectUseTemp
,
...
cloneDeep
(
row
),
projectDetailInfo
:
cloneDeep
(
this
.
projectDetailInfo
)
};
this
.
pushProjectUseTemp
=
_temp
;
this
.
pushProjectUseDialog
=
true
;
},
...
...
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