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
24597111
Commit
24597111
authored
Jan 18, 2022
by
raojiaguan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
子表根据基础数据带出基础数据公式
parent
92e3baab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
SubTableSetBaseData.js
.../gms-plugin-billexpand/src/formula/SubTableSetBaseData.js
+61
-0
No files found.
develop/@gms/gms-plugin-billexpand/src/formula/SubTableSetBaseData.js
0 → 100644
View file @
24597111
// 子表根据基础数据带出基础数据
export
default
{
execute
:
function
()
{
debugger
console
.
log
(
"子表中的某个字段是否等于某个值"
);
//从那个字段取,那个字段里面的对应的基础数据的名称,要取的基础数据字段标识,要赋值给谁
if
(
arguments
&&
arguments
[
0
]
&&
arguments
[
0
].
length
>
1
&&
arguments
[
1
])
{
let
context
=
arguments
[
1
]
let
masterSubField
=
arguments
[
0
][
0
].
getResult
().
Value
;
let
baseDataField
=
arguments
[
0
][
1
].
StaticValue
;
let
baseDataDefine
=
arguments
[
0
][
2
].
StaticValue
;
let
targetSubField
=
arguments
[
0
][
3
]
let
subTableObject
=
context
.
getTableType
(
targetSubField
.
FieldTableCode
)
let
oldIndex
=
context
.
getSubFocus
()
let
focusData
=
context
.
getAllSubData
()[
subTableObject
.
title
][
oldIndex
].
getData
()
if
(
_
.
isString
(
masterSubField
[
baseDataField
])
&&
masterSubField
[
baseDataField
].
length
>
0
)
{
if
((
!
(
_
.
isEqual
(
focusData
[
arguments
[
0
][
0
].
FieldCode
].
_field_old_value_
,
focusData
[
arguments
[
0
][
0
].
FieldCode
].
value
))))
{
let
param
=
{
"objectcode"
:
masterSubField
[
baseDataField
],
"tableName"
:
baseDataDefine
,
"queryDataStructure"
:
"ALL"
,
"limit"
:
1
,
"offset"
:
0
,
"pagination"
:
true
}
this
.
getMDObject
(
param
,
(
data
)
=>
{
let
newIndex
=
context
.
getSubFocus
();
if
(
oldIndex
!==
newIndex
)
{
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
)
}
context
.
refreshSubDataRow
(
subTableObject
.
title
)
},
(
resp
)
=>
{
GAMS
.
Common
.
messagePrompt
(
"境内住宿标准金额获取接口请求失败,请联系管理员"
)
console
.
error
(
"获取境内住宿标准公式直接失败"
+
resp
)
});
}
}
}
},
getMDObject
(
param
,
callBack
,
errorCallBack
)
{
GMS
.
$http
.
post
(
"/baseData/data/list"
,
param
).
then
(
data
=>
{
callBack
(
data
.
data
);
}).
catch
((
resp
)
=>
{
errorCallBack
(
resp
);
});
},
getResultType
:
function
()
{
return
FMR
.
ConstDataTypes
.
General
;
}
}
\ No newline at end of file
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