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
b02fe999
Commit
b02fe999
authored
Feb 09, 2022
by
qiaoyanqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存。上张下张index
parent
0cd90f43
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
163 additions
and
162 deletions
+163
-162
cacheSaveAction.js
...@gms/gms-plugin-billexpand/src/actions/cacheSaveAction.js
+4
-96
saveAction.js
develop/@gms/gms-plugin-billexpand/src/actions/saveAction.js
+114
-56
errorMessageUtil.js
...ms-plugin-billexpand/src/actions/util/errorMessageUtil.js
+41
-0
typesBill.vue
...ms-plugin-billexpand/src/components-control/typesBill.vue
+0
-1
emcon.js
develop/@gms/gms-plugin-billexpand/src/emcon.js
+0
-5
editBill.js
.../@gms/gms-plugin-billexpand/src/query-actions/editBill.js
+1
-1
examineAction.js
.../gms-plugin-billexpand/src/query-actions/examineAction.js
+1
-1
goToDetail.js
...gms/gms-plugin-billexpand/src/query-actions/goToDetail.js
+1
-1
seeDetailAction.js
...ms-plugin-billexpand/src/query-actions/seeDetailAction.js
+1
-1
No files found.
develop/@gms/gms-plugin-billexpand/src/actions/cacheSaveAction.js
View file @
b02fe999
...
@@ -11,14 +11,10 @@ export default {
...
@@ -11,14 +11,10 @@ export default {
if
(
param
)
{
if
(
param
)
{
bill
.
setControlsSate
(
param
[
"_control_name_"
],
'enable'
,
false
);
bill
.
setControlsSate
(
param
[
"_control_name_"
],
'enable'
,
false
);
bill
.
runFormulaCheckData
(
param
.
param
,
function
(
msg
)
{
bill
.
runFormulaCheckData
(
param
.
param
,
function
(
msg
)
{
if
(
msg
.
length
==
0
)
{
if
(
msg
.
length
==
0
)
{
//缓存数据
if
(
param
.
param
&&
param
.
param
.
hasOwnProperty
(
'cacheData'
)
&&
!
param
.
param
.
cacheData
)
{
let
obj
=
bill
.
getBuillData
();
this
.
saveData
(
bill
,
param
);
obj
.
billDefine
=
param
.
define
;
}
else
{
this
.
execuFormula
(
obj
,
param
);
//点击确定,执行公式
let
obj
=
bill
.
getBuillData
();
obj
.
billDefine
=
param
.
define
;
this
.
execuFormula
(
obj
,
param
);
//点击确定,执行公式
}
}
else
{
}
else
{
GMS
.
$http
.
post
(
`/baseData/data/list`
,
{
GMS
.
$http
.
post
(
`/baseData/data/list`
,
{
pagination
:
false
,
pagination
:
false
,
...
@@ -39,94 +35,6 @@ export default {
...
@@ -39,94 +35,6 @@ export default {
GAMS
.
Common
.
messagePrompt
(
'缺少参数'
);
GAMS
.
Common
.
messagePrompt
(
'缺少参数'
);
}
}
},
},
saveData
(
bill
,
param
)
{
let
that
=
this
;
let
buidData
=
bill
.
getBuillData
();
console
.
log
(
'buidData:'
,
buidData
);
let
controlArr
=
bill
.
action
.
filter
(
(
v
)
=>
v
.
execute
==
"searchBillAction"
);
let
detailData
=
[];
let
arrApi1
=
[];
if
(
controlArr
[
0
].
param
.
field
&&
controlArr
[
0
].
param
.
field
.
length
>
0
)
{
let
tableList
=
controlArr
[
0
].
param
.
field
.
map
(
v
=>
v
.
targetTableName
);
tableList
=
Array
.
from
(
new
Set
(
tableList
));
tableList
.
forEach
(
v
=>
{
if
(
buidData
.
hasOwnProperty
(
v
))
{
for
(
let
i
=
0
;
i
<
bill
.
getSubData
(
v
).
length
;
i
++
)
{
let
rowDataObject
=
bill
.
getSubDataRow
(
v
,
i
);
let
obj
=
rowDataObject
.
getValue
(
"currentRowData"
);
if
(
obj
&&
obj
.
BILLDETAILOBJ
)
{
let
billId
=
obj
.
BILLID
;
let
billName
=
obj
.
BILLNAME
;
let
billDefine
=
billName
.
replace
(
/_E/ig
,
""
).
replace
(
/_R/ig
,
""
).
replace
(
/_A/ig
,
""
);
arrApi1
.
push
(
that
.
searchBillObj
(
billDefine
,
billId
,
obj
.
BILLDETAILOBJ
));
}
else
{
let
billId
=
rowDataObject
.
getData
().
BILLID
.
value
;
let
billName
=
rowDataObject
.
getData
().
BILLNAME
.
value
;
let
billDefine
=
billName
.
replace
(
/_E/ig
,
""
).
replace
(
/_R/ig
,
""
).
replace
(
/_A/ig
,
""
);
arrApi1
.
push
(
that
.
searchBillObj
(
billDefine
,
billId
));
}
}
}
})
}
if
(
arrApi1
.
length
>
0
)
{
Promise
.
all
(
arrApi1
).
then
((
list
)
=>
{
detailData
=
list
;
that
.
saveAsync
(
buidData
,
detailData
,
param
,
bill
);
})
}
else
{
that
.
saveAsync
(
buidData
,
detailData
,
param
,
bill
);
}
},
saveAsync
(
buidData
,
detailData
,
param
,
bill
)
{
let
postData
=
{
data
:
buidData
,
detailData
:
detailData
}
let
url
=
`/rbc/bill/action/saveExpenceAccount/
${
param
.
define
}
`
;
GMS
.
$http
.
post
(
url
,
JSON
.
stringify
(
postData
),
{
headers
:
{
post
:
{
"Content-Type"
:
"application/json"
,
}
}
}).
then
(
function
(
response
)
{
bill
.
setControlsSate
(
param
[
"_control_name_"
],
'enable'
,
true
);
if
(
response
.
data
.
code
==
0
)
{
//存储返回回来的创建时间、修改时间
bill
.
getMasterData
().
setValue
(
'createTime'
,
response
.
data
.
content
.
billData
.
createTime
);
bill
.
getMasterData
().
setValue
(
'modifyTime'
,
response
.
data
.
content
.
billData
.
modifyTime
);
bill
.
getMasterData
().
setValue
(
'recver'
,
response
.
data
.
content
.
billData
.
recver
);
bill
.
getMasterData
().
setValue
(
'billCode'
,
response
.
data
.
content
.
billData
.
billCode
);
GMS
.
vbus
.
$emit
(
'saveSuccess'
,
buidData
,
param
);
}
else
{
response
.
data
.
msg
&&
GMS
.
vbus
.
$Message
.
error
(
response
.
data
.
msg
);
}
}
).
catch
()
},
searchBillObj
(
billDefine
,
billId
,
BILLDETAILOBJ
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
GMS
.
$http
.
get
(
`/gms/bill/
${
billDefine
}
/
${
billId
}
?withSubs=true`
).
then
((
data
)
=>
{
let
obj
=
BILLDETAILOBJ
;
if
(
data
.
status
==
200
&&
data
.
data
.
code
==
0
)
{
if
(
!
BILLDETAILOBJ
){
obj
=
data
.
data
.
content
}
obj
.
recver
=
data
.
data
.
content
&&
data
.
data
.
content
.
recver
;
}
obj
.
billDefine
=
billDefine
;
resolve
(
obj
);
}).
catch
((
error
)
=>
{
reject
(
error
)
})
})
},
execuFormula
(
buidData
,
param
)
{
execuFormula
(
buidData
,
param
)
{
let
postData
=
{
let
postData
=
{
data
:
buidData
data
:
buidData
...
...
develop/@gms/gms-plugin-billexpand/src/actions/saveAction.js
View file @
b02fe999
import
{
getUUID
}
from
"../query-actions/util/lib"
;
import
errorMessageUtil
from
"./util/errorMessageUtil"
;
export
default
{
export
default
{
execute
:
function
(
bill
,
param
)
{
execute
:
function
(
bill
,
param
)
{
if
(
bill
)
{
if
(
bill
)
{
// const masterData = bill.getMasterData()
bill
.
runFormulaCheckData
(
param
,
(
msg
)
=>
{
// // 驳回状态
// // 此时保存创建一张新单据
// if (masterData.getValue('billState') == 91) {
// ;[
// 'billCode',
// 'billState',
// 'flowFinishTime',
// 'flowProcessId',
// 'flowState',
// 'flowSubmitTime',
// 'orgCode',
// 'createTime',
// 'modifyTime',
// ].forEach((key) => {
// if (masterData.getValue(key))
// masterData.setValue(key, '')
// bill.billdata.masterFiled[key] = ''
// })
// masterData.setValue('orgId', '00000000-0000-0000-000000000000')
// masterData.setValue('recver', 0)
// masterData.setValue('id', getUUID())
// }
bill
.
runFormulaCheckData
(
param
,
function
(
msg
)
{
if
(
msg
.
length
==
0
)
{
if
(
msg
.
length
==
0
)
{
let
postData
=
{
bill
.
setControlsSate
(
param
[
"_control_name_"
],
"enable"
,
false
);
actions
:
"bill.Basic.save"
this
.
saveData
(
bill
,
param
);
}
else
{
GMS
.
vbus
.
$Modal
.
warning
({
title
:
"信息错误"
,
content
:
msg
,
});
}
});
}
},
saveData
(
bill
,
param
)
{
let
that
=
this
;
let
buidData
=
bill
.
getBuillData
();
console
.
log
(
"buidData:"
,
buidData
);
let
controlArr
=
bill
.
action
.
filter
((
v
)
=>
v
.
execute
==
"searchBillAction"
);
let
detailData
=
[];
let
arrApi1
=
[];
if
(
controlArr
.
length
>
0
&&
controlArr
[
0
].
param
.
field
&&
controlArr
[
0
].
param
.
field
.
length
>
0
)
{
let
tableList
=
controlArr
[
0
].
param
.
field
.
map
((
v
)
=>
v
.
targetTableName
);
tableList
=
Array
.
from
(
new
Set
(
tableList
));
tableList
.
forEach
((
v
)
=>
{
if
(
buidData
.
hasOwnProperty
(
v
))
{
for
(
let
i
=
0
;
i
<
bill
.
getSubData
(
v
).
length
;
i
++
)
{
let
rowDataObject
=
bill
.
getSubDataRow
(
v
,
i
);
let
obj
=
rowDataObject
.
getValue
(
"currentRowData"
);
if
(
obj
&&
obj
.
BILLDETAILOBJ
)
{
let
billId
=
obj
.
BILLID
;
let
billName
=
obj
.
BILLNAME
;
let
billDefine
=
billName
.
replace
(
/_E/gi
,
""
)
.
replace
(
/_R/gi
,
""
)
.
replace
(
/_A/gi
,
""
);
arrApi1
.
push
(
that
.
searchBillObj
(
billDefine
,
billId
,
obj
.
BILLDETAILOBJ
)
);
}
else
{
let
billId
=
rowDataObject
.
getData
().
BILLID
.
value
;
let
billName
=
rowDataObject
.
getData
().
BILLNAME
.
value
;
let
billDefine
=
billName
.
replace
(
/_E/gi
,
""
)
.
replace
(
/_R/gi
,
""
)
.
replace
(
/_A/gi
,
""
);
arrApi1
.
push
(
that
.
searchBillObj
(
billDefine
,
billId
));
}
}
}
bill
.
setControlsSate
(
param
[
"_control_name_"
],
'enable'
,
false
)
}
});
bill
.
executeServerAction
(
postData
,
function
(
code
,
data
)
{
}
bill
.
setControlsSate
(
param
[
"_control_name_"
],
'enable'
,
true
)
if
(
arrApi1
.
length
>
0
)
{
console
.
log
(
'code'
,
code
)
Promise
.
all
(
arrApi1
).
then
((
list
)
=>
{
console
.
log
(
'data'
,
data
)
detailData
=
list
;
if
(
code
===
200
)
{
that
.
saveAsync
(
buidData
,
detailData
,
param
,
bill
);
const
id
=
data
.
content
.
billData
.
id
});
GMS
.
vbus
.
$emit
(
'change-form-state'
,
{
state
:
'readOnly'
,
billId
:
id
})
}
else
{
GMS
.
vbus
.
$Message
.
success
(
"保存成功"
);
that
.
saveAsync
(
buidData
,
detailData
,
param
,
bill
);
}
else
if
(
code
===
201
)
{
}
GMS
.
vbus
.
$Message
.
error
(
data
.
message
);
},
}
else
if
(
code
===
202
)
{
searchBillObj
(
billDefine
,
billId
,
BILLDETAILOBJ
)
{
if
(
data
.
responseJSON
.
message
&&
data
.
responseJSON
.
message
.
startsWith
(
"FLOW-"
))
{
return
new
Promise
((
resolve
,
reject
)
=>
{
GMS
.
vbus
.
$Message
.
error
({
GMS
.
$http
.
get
(
`/gms/bill/
${
billDefine
}
/
${
billId
}
?withSubs=true`
)
content
:
data
.
responseJSON
.
message
,
.
then
((
data
)
=>
{
duration
:
3
let
obj
=
BILLDETAILOBJ
;
});
if
(
data
.
status
==
200
&&
data
.
data
.
code
==
0
)
{
}
else
{
if
(
!
BILLDETAILOBJ
)
{
GMS
.
vbus
.
$Message
.
error
(
"保存单据异常请联系管理员"
);
obj
=
data
.
data
.
content
;
}
}
}
})
obj
.
recver
=
data
.
data
.
content
&&
data
.
data
.
content
.
recver
;
}
obj
.
billDefine
=
billDefine
;
resolve
(
obj
);
})
.
catch
((
error
)
=>
{
reject
(
error
);
});
});
},
saveAsync
(
buidData
,
detailData
,
param
,
bill
)
{
let
postData
=
{
data
:
buidData
,
detailData
:
detailData
,
};
//executed/bill.CCSPD/bill.Basic.save?transmission=total
let
url
=
`/rbc/bill/action/rbcbillsave/
${
param
.
define
}
/bill.Basic.save?transmission=total`
;
GMS
.
$http
.
post
(
url
,
JSON
.
stringify
(
postData
),
{
headers
:
{
post
:
{
"Content-Type"
:
"application/json"
,
},
},
})
.
then
(
function
(
response
)
{
bill
.
setControlsSate
(
param
[
"_control_name_"
],
"enable"
,
true
);
if
(
response
.
data
.
code
==
0
)
{
//存储返回回来的创建时间、修改时间
bill
.
getMasterData
().
setValue
(
"createTime"
,
response
.
data
.
content
.
billData
.
createTime
);
bill
.
getMasterData
().
setValue
(
"modifyTime"
,
response
.
data
.
content
.
billData
.
modifyTime
);
bill
.
getMasterData
().
setValue
(
"recver"
,
response
.
data
.
content
.
billData
.
recver
);
bill
.
getMasterData
().
setValue
(
"billCode"
,
response
.
data
.
content
.
billData
.
billCode
);
const
id
=
response
.
data
.
content
.
billData
.
id
;
GMS
.
vbus
.
$Message
.
success
(
"保存成功"
);
GMS
.
vbus
.
$emit
(
'change-form-state'
,
{
state
:
'readOnly'
,
billId
:
id
})
GMS
.
vbus
.
$emit
(
"saveSuccess"
,
buidData
,
param
);
}
else
{
}
else
{
GMS
.
vbus
.
$Modal
.
warning
({
response
.
data
.
message
&&
GMS
.
vbus
.
$Message
.
error
({
title
:
'信息错误'
,
content
:
errorMessageUtil
.
saveAction
.
getErrorMessage
(
response
.
data
.
message
)
,
content
:
msg
duration
:
3
});
});
}
}
})
})
}
.
catch
((
error
)
=>
{});
}
}
,
}
}
\ No newline at end of file
develop/@gms/gms-plugin-billexpand/src/actions/util/errorMessageUtil.js
0 → 100644
View file @
b02fe999
import
_
from
'lodash'
/**
* 按钮报错信息处理
*
* @author fengjiansheng
* @date 2022-02-09
*/
export
default
{
saveAction
:
{
commonMessage
:
"保存失败,请联系系统管理员。"
,
customMessageList
:
[
{
preMessage
:
"More than one row with the given identifier was found"
,
convertMessage
:
"保存失败,基础数据存在多条相同记录,基础数据标识:"
}
],
getErrorBaseDataName
(
a
)
{
if
(
!
a
||
!
_
.
isString
(
a
))
{
return
""
;
}
let
reg
=
/
(?<
=datamodel
\.)
.*
?(?=
;
)
/
;
let
targetString
=
a
.
match
(
reg
);
return
targetString
?
targetString
[
0
]
:
""
;
},
getErrorMessage
(
a
)
{
if
(
!
a
||
!
_
.
isString
(
a
))
{
return
this
.
commonMessage
;
}
let
errorPreMessage
=
""
;
for
(
let
i
=
0
;
i
<
this
.
customMessageList
.
length
;
i
++
)
{
if
(
a
.
indexOf
(
this
.
customMessageList
[
i
].
preMessage
)
>
-
1
)
{
errorPreMessage
=
this
.
customMessageList
[
i
].
convertMessage
;
break
;
}
}
return
errorPreMessage
===
""
?
this
.
commonMessage
:
errorPreMessage
+
this
.
getErrorBaseDataName
(
a
);
}
}
}
\ No newline at end of file
develop/@gms/gms-plugin-billexpand/src/components-control/typesBill.vue
View file @
b02fe999
...
@@ -144,7 +144,6 @@ export default {
...
@@ -144,7 +144,6 @@ export default {
});
});
GMS
.
vbus
.
$on
(
"saveSuccess"
,
(
res
,
param
)
=>
{
GMS
.
vbus
.
$on
(
"saveSuccess"
,
(
res
,
param
)
=>
{
//自己扩展的保存
//自己扩展的保存
GMS
.
vbus
.
$Message
.
success
(
"保存成功"
);
this
.
initBill
(
res
,
param
,
true
);
this
.
initBill
(
res
,
param
,
true
);
});
});
GMS
.
vbus
.
$on
(
"resetBillData"
,
this
.
changeData
);
GMS
.
vbus
.
$on
(
"resetBillData"
,
this
.
changeData
);
...
...
develop/@gms/gms-plugin-billexpand/src/emcon.js
View file @
b02fe999
...
@@ -1185,11 +1185,6 @@ export default {
...
@@ -1185,11 +1185,6 @@ export default {
"path"
:
"单据/缓存单据数据"
,
"path"
:
"单据/缓存单据数据"
,
"extends"
:
{
"extends"
:
{
"param"
:
[{
"param"
:
[{
"cacheData"
:
true
,
"type"
:
"Boolean"
,
"title"
:
"是否缓存数据"
,
"key"
:
"cacheData"
},
{
"clearable"
:
true
,
"clearable"
:
true
,
"ref"
:
"gams2.bill"
,
"ref"
:
"gams2.bill"
,
"type"
:
"select"
,
"type"
:
"select"
,
...
...
develop/@gms/gms-plugin-billexpand/src/query-actions/editBill.js
View file @
b02fe999
...
@@ -4,7 +4,7 @@ export default {
...
@@ -4,7 +4,7 @@ export default {
execute
(
context
,
param
)
{
execute
(
context
,
param
)
{
GMS
.
queryObject
=
{
//上张下张用
GMS
.
queryObject
=
{
//上张下张用
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
index
:
context
.
selects
[
0
].
_index
,
index
:
context
.
selects
[
0
].
_index
||
(
context
.
selects
[
0
].
_serialIndex
)
*
1
-
1
,
templateName
:
param
.
viewName
,
templateName
:
param
.
viewName
,
isReadOnly
:
false
isReadOnly
:
false
}
}
...
...
develop/@gms/gms-plugin-billexpand/src/query-actions/examineAction.js
View file @
b02fe999
...
@@ -8,7 +8,7 @@ export default {
...
@@ -8,7 +8,7 @@ export default {
}
}
GMS
.
queryObject
=
{
//上张下张用
GMS
.
queryObject
=
{
//上张下张用
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
index
:
context
.
selects
[
0
].
_index
,
index
:
context
.
selects
[
0
].
_index
||
(
context
.
selects
[
0
].
_serialIndex
)
*
1
-
1
,
templateName
:
param
.
viewName
,
templateName
:
param
.
viewName
,
isReadOnly
:
true
isReadOnly
:
true
}
}
...
...
develop/@gms/gms-plugin-billexpand/src/query-actions/goToDetail.js
View file @
b02fe999
...
@@ -9,7 +9,7 @@ export default {
...
@@ -9,7 +9,7 @@ export default {
}
}
GMS
.
queryObject
=
{
//上张下张用
GMS
.
queryObject
=
{
//上张下张用
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
index
:
context
.
selects
[
0
].
_index
,
index
:
context
.
selects
[
0
].
_index
||
(
context
.
selects
[
0
].
_serialIndex
)
*
1
-
1
,
templateName
:
context
.
selects
[
0
][
param
.
viewName
],
templateName
:
context
.
selects
[
0
][
param
.
viewName
],
isReadOnly
:
true
,
isReadOnly
:
true
,
}
}
...
...
develop/@gms/gms-plugin-billexpand/src/query-actions/seeDetailAction.js
View file @
b02fe999
...
@@ -8,7 +8,7 @@ export default {
...
@@ -8,7 +8,7 @@ export default {
}
}
GMS
.
queryObject
=
{
//上张下张用
GMS
.
queryObject
=
{
//上张下张用
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
currentDataQueryConditionSet
:
context
.
currentDataQueryConditionSet
,
index
:
context
.
selects
[
0
].
_index
,
index
:
context
.
selects
[
0
].
_index
||
(
context
.
selects
[
0
].
_serialIndex
)
*
1
-
1
,
templateName
:
param
.
viewName
,
templateName
:
param
.
viewName
,
isReadOnly
:
true
isReadOnly
:
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