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
e747a22e
Commit
e747a22e
authored
Apr 27, 2022
by
Joey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(@gms/gms-plugin-billexpand): 增加公式
parent
2b04601e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
135 additions
and
11 deletions
+135
-11
emcon.js
develop/@gms/gms-plugin-billexpand/src/emcon.js
+39
-0
GetMDByObjectcode.js
...ms/gms-plugin-billexpand/src/formula/GetMDByObjectcode.js
+50
-0
GetMdByFormerCode.js
...ms/gms-plugin-billexpand/src/formula/GetMdByFormerCode.js
+3
-6
GetOwnProperty.js
.../@gms/gms-plugin-billexpand/src/formula/GetOwnProperty.js
+22
-0
SubTableSetBaseData.js
.../gms-plugin-billexpand/src/formula/SubTableSetBaseData.js
+0
-4
index.js
develop/@gms/gms-plugin-billexpand/src/formula/util/index.js
+16
-0
mcon.js
develop/@gms/gms-plugin-billexpand/src/mcon.js
+5
-1
No files found.
develop/@gms/gms-plugin-billexpand/src/emcon.js
View file @
e747a22e
...
...
@@ -2097,6 +2097,45 @@ export default {
"title"
:
"通过code获取指定基础数据项"
,
"value"
:
"GetMDByCode"
},
{
"discard"
:
false
,
"path"
:
"通用"
,
"extends"
:
{
"info"
:
{
"param"
:
[
],
"name"
:
"GetOwnProperty"
,
"description"
:
"GetOwnProperty"
,
"title"
:
"GetOwnProperty"
,
"return"
:
0
}
},
"description"
:
"GetOwnProperty"
,
"title"
:
"GetOwnProperty"
,
"value"
:
"GetOwnProperty"
},
{
"discard"
:
false
,
"path"
:
"通用"
,
"extends"
:
{
"info"
:
{
"param"
:
[
],
"name"
:
"GetMDByObjectcode"
,
"description"
:
"GetMDByObjectcode"
,
"title"
:
"GetMDByObjectcode"
,
"return"
:
0
}
},
"description"
:
"GetMDByObjectcode"
,
"title"
:
"GetMDByObjectcode"
,
"value"
:
"GetMDByObjectcode"
},
{
"discard"
:
false
,
"path"
:
"通用"
,
...
...
develop/@gms/gms-plugin-billexpand/src/formula/GetMDByObjectcode.js
0 → 100644
View file @
e747a22e
// 通过code获取指定基础数据项(当前版本)
import
{
getValue
}
from
'./util'
export
default
{
execute
:
async
function
()
{
if
(
arguments
&&
arguments
[
0
]
&&
arguments
[
0
][
0
]
&&
arguments
[
0
][
1
]
&&
arguments
[
1
])
{
let
tablename
=
arguments
[
0
][
0
].
StaticValue
//基础数据表名
,
mdcodeArg
=
arguments
[
0
][
1
]
//基础数据code
,
context
=
arguments
[
1
];
let
mdcode
=
await
getValue
(
mdcodeArg
)
let
mdObject
=
await
this
.
getMDObject
(
tablename
,
mdcode
);
return
mdObject
;
}
else
{
GAMS
.
Common
.
messagePrompt
(
'GetMDByCode公式:参数配置有误'
);
return
''
;
}
},
getResultType
:
function
()
{
return
FMR
.
ConstDataTypes
.
General
;
},
// 获取基础数据
getMDObject
(
name
,
code
)
{
let
param
=
{
"limit"
:
1
,
"offset"
:
0
,
"pagination"
:
true
,
"tableName"
:
name
,
"objectcode"
:
code
,
//按code和name过滤
"queryDataStructure"
:
"ALL"
//返回的接口类型
}
return
new
Promise
((
resolve
,
reject
)
=>
{
let
promise
=
GMS
.
$http
.
post
(
"/baseData/data/list"
,
param
);
promise
.
then
((
data
)
=>
{
if
(
data
.
data
&&
data
.
data
.
rows
&&
data
.
data
.
rows
.
length
>
0
)
{
resolve
(
data
.
data
.
rows
[
0
]);
}
else
{
resolve
([]);
}
})
.
catch
((
error
)
=>
{
resolve
([]);
});
});
}
}
\ No newline at end of file
develop/@gms/gms-plugin-billexpand/src/formula/GetMdByFormerCode.js
View file @
e747a22e
// 通过code前几位获取指定基础数据项(当前版本)
import
{
getValue
}
from
'./util'
export
default
{
execute
:
async
function
(){
console
.
log
(
"通过code前几位获取指定基础数据项"
);
...
...
@@ -8,12 +10,7 @@ export default {
,
mdcodeArg
=
arguments
[
0
][
1
]
//基础数据code
,
num
=
arguments
[
0
][
2
].
StaticValue
,
context
=
arguments
[
1
];
let
mdcode
=
""
if
(
mdcodeArg
instanceof
BillDataNode
){
mdcode
=
arguments
[
0
][
1
].
getResult
().
Value
}
else
if
(
mdcodeArg
instanceof
StaticDataNode
){
mdcode
=
arguments
[
0
][
1
].
StaticValue
}
let
mdcode
=
await
getValue
(
mdcodeArg
)
let
lastCode
=
mdcode
.
substring
(
0
,
Number
(
num
))
let
mdObject
=
await
this
.
getMDObject
(
tablename
,
lastCode
);
return
mdObject
;
...
...
develop/@gms/gms-plugin-billexpand/src/formula/GetOwnProperty.js
0 → 100644
View file @
e747a22e
import
{
getValue
}
from
'./util'
export
default
{
execute
:
async
function
()
{
if
(
arguments
&&
arguments
[
0
]
&&
arguments
[
0
][
0
]
&&
arguments
[
0
][
1
]
&&
arguments
[
1
])
{
let
resultArg
=
arguments
[
0
][
0
]
,
key
=
arguments
[
0
][
1
].
StaticValue
,
context
=
arguments
[
1
];
let
result
=
await
getValue
(
resultArg
)
if
(
!
(
typeof
result
==
'object'
))
return
null
return
result
[
key
]
}
else
{
return
''
;
}
},
getResultType
:
function
()
{
return
FMR
.
ConstDataTypes
.
General
;
},
}
\ No newline at end of file
develop/@gms/gms-plugin-billexpand/src/formula/SubTableSetBaseData.js
View file @
e747a22e
...
...
@@ -28,10 +28,6 @@ export default {
context
.
setSubFocus
(
oldIndex
)
}
focusData
[
arguments
[
0
][
0
].
FieldCode
].
_field_old_value_
=
focusData
[
arguments
[
0
][
0
].
FieldCode
].
value
// focusData.ZJ._field_old_value_ = focusData.ZJ.value
// focusData.RZRQ._field_old_value_ = focusData.RZRQ.value
// focusData.LDRQ._field_old_value_ = focusData.LDRQ.value
// targetSubField.dynamicNodeFactory.methodJson.SetFieldData('', linkId, data.cSontent, '')
focusData
[
targetSubField
.
FieldCode
].
_field_old_value_
=
focusData
[
targetSubField
.
FieldCode
].
value
=
data
.
rows
[
0
]
if
(
oldIndex
!==
newIndex
)
{
context
.
setSubFocus
(
newIndex
)
...
...
develop/@gms/gms-plugin-billexpand/src/formula/util/index.js
0 → 100644
View file @
e747a22e
export
async
function
getValue
(
obj
)
{
let
result
=
''
if
(
obj
instanceof
FunctionNode
)
{
let
funcResult
=
obj
.
getResult
()
if
(
funcResult
instanceof
AbstractData
)
{
result
=
await
funcResult
.
Value
}
}
else
if
(
obj
instanceof
BillDataNode
)
{
result
=
obj
.
getResult
().
Value
}
else
if
(
obj
instanceof
StaticDataNode
)
{
result
=
obj
.
StaticValue
}
return
result
}
develop/@gms/gms-plugin-billexpand/src/mcon.js
View file @
e747a22e
...
...
@@ -161,6 +161,8 @@ import AmountComp from "./formula/AmountComp";
import
SubTableHasContainField
from
"./formula/SubTableHasContainField"
;
import
SetSubFieldsByBaseData
from
"./formula/SetSubFieldsByBaseData"
;
import
SubTableSetData
from
"./formula/SubTableSetData"
;
import
GetOwnProperty
from
"./formula/GetOwnProperty"
;
import
GetMDByObjectcode
from
"./formula/GetMDByObjectcode"
;
export
default
{
actions
:
{
updateFieldAction
,
...
...
@@ -323,7 +325,9 @@ export default {
SubTableHasContainField
,
ApplyTemplateString
,
SubTableSetData
,
...
GeneralImportFile
GetMDByObjectcode
,
GetOwnProperty
,
...
GeneralImportFile
,
},
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