Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rbc-demo
Overview
Overview
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
王衍超
rbc-demo
Commits
a1a9cd77
Commit
a1a9cd77
authored
Feb 07, 2022
by
fengjiansheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(@gms/gms-plugin-billexpand): 增加金额比较公式
parent
f491bbf4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
6 deletions
+85
-6
emcon.js
develop/@gms/gms-plugin-billexpand/src/emcon.js
+16
-0
AmountComp.js
develop/@gms/gms-plugin-billexpand/src/formula/AmountComp.js
+35
-0
FormulaConstants.js
...gms/gms-plugin-billexpand/src/formula/FormulaConstants.js
+31
-5
mcon.js
develop/@gms/gms-plugin-billexpand/src/mcon.js
+3
-1
No files found.
develop/@gms/gms-plugin-billexpand/src/emcon.js
View file @
a1a9cd77
...
...
@@ -3764,6 +3764,22 @@ export default {
"extends"
:
{
"info"
:
{
"param"
:
[],
"name"
:
"AmountComp"
,
"description"
:
"金额比较公式 e.g. AmountComp(BXD_H.BXJEXX,BXD_H.BXJEX1)"
,
"title"
:
"金额比较公式"
,
"return"
:
1
}
},
"description"
:
""
,
"title"
:
"金额比较公式"
,
"value"
:
"AmountComp"
},
{
"discard"
:
false
,
"path"
:
"通用"
,
"extends"
:
{
"info"
:
{
"param"
:
[],
"name"
:
"CheckReferenceRelation"
,
"description"
:
"校验单据是否被引用 e.g. CheckReferenceRelation('REF_FLAG','1','当前单据已被引用,暂时无法删除。')"
,
"title"
:
"校验单据是否被引用"
,
...
...
develop/@gms/gms-plugin-billexpand/src/formula/AmountComp.js
0 → 100644
View file @
a1a9cd77
import
_
from
"./FormulaConstants"
;
/**
* 金额比较公式
* 比较左右两个操作数是否相等 参数可以是返回值类型为number的公式
* @author fengjiansheng
* @date 2022-02-07
*/
export
default
{
formulaName
:
"AmountComp"
,
execute
:
function
()
{
if
(
arguments
&&
arguments
[
0
]
&&
arguments
[
0
].
length
===
2
)
{
let
leftOperand
=
arguments
[
0
][
0
];
let
rightOperand
=
arguments
[
0
][
1
];
if
(
leftOperand
&&
rightOperand
)
{
leftOperand
=
_
.
getFormulaParamValue
(
leftOperand
);
rightOperand
=
_
.
getFormulaParamValue
(
rightOperand
);
if
(
_
.
isNumber
(
leftOperand
)
&&
_
.
isNumber
(
rightOperand
))
{
return
_
.
isAmountEqual
(
leftOperand
,
rightOperand
);
}
else
{
console
.
error
(
this
.
formulaName
+
_
.
ERROR_MSG
.
PARAM_TYPE
);
return
false
;
}
}
else
{
return
false
;
}
}
else
{
console
.
error
(
this
.
formulaName
+
_
.
ERROR_MSG
.
PARAM_NUM
);
return
false
;
}
},
getResultType
:
function
()
{
return
_
.
resultType
.
boolean
;
}
}
develop/@gms/gms-plugin-billexpand/src/formula/FormulaConstants.js
View file @
a1a9cd77
import
_
from
'lodash'
/**
* 公式常量
* @author fengjiansheng
* @date 2021-09-13
*/
export
default
{
billFiled
:{
billFiled
:
{
BMJJFL
:
9999
,
NULL
:
0
,
},
resultType
:
{
anyType
:
0
,
boolean
:
1
,
datetime
:
2
,
number
:
3
,
string
:
6
,
},
ERROR_MSG
:
{
PARAM_TYPE
:
"公式配置错误,参数类型不匹配。"
,
PARAM_NUM
:
"公式配置错误,参数个数不匹配。"
,
},
moneyFormatDecimal
:
(
num
,
decimal
)
=>
{
toNumber
(
a
)
{
return
_
.
toNumber
(
a
);
},
isNumber
(
a
)
{
return
_
.
isNumber
(
a
);
},
isAmountEqual
(
a
,
b
)
{
if
(
this
.
isNumber
(
a
)
&&
this
.
isNumber
(
b
))
{
return
Math
.
abs
(
this
.
toNumber
(
a
)
-
this
.
toNumber
(
b
))
<=
0.0000001
;
}
else
{
throw
new
Error
(
"invalid param"
);
}
},
moneyFormatDecimal
(
num
,
decimal
)
{
num
=
num
.
toString
()
let
index
=
num
.
indexOf
(
'.'
)
if
(
index
!==
-
1
)
{
...
...
@@ -19,9 +45,9 @@ export default {
}
return
parseFloat
(
num
).
toFixed
(
decimal
)
},
getFormulaParamValue
(
obj
){
if
(
obj
)
{
return
obj
.
getResult
().
Value
getFormulaParamValue
(
obj
)
{
if
(
obj
)
{
return
obj
.
getResult
().
Value
}
return
obj
},
...
...
develop/@gms/gms-plugin-billexpand/src/mcon.js
View file @
a1a9cd77
...
...
@@ -169,6 +169,7 @@ import SubTableJointString from "@/formula/SubTableJointString"
import
LoginUserIsContianRole
from
"@/formula/SubTableJointString"
import
SubTableSetBaseData
from
"@/formula/SubTableSetBaseData"
import
UpdateBillReferenceRelationshipFunction
from
"./formula/UpdateBillReferenceRelationshipFunction"
;
import
AmountComp
from
"./formula/AmountComp"
;
export
default
{
actions
:
{
updateFieldAction
,
...
...
@@ -341,7 +342,8 @@ export default {
UpdateImageInfoRefState
,
UpdateBillReferenceRelationshipFunction
,
ClearImageInfoRefState
,
CheckReferenceRelation
CheckReferenceRelation
,
AmountComp
,
},
routes
:
{
showPrint
:
{
...
...
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