Commit f26f1564 by 袁成

fix: 同意驳回增加登陆人与审批人校验

parent df951d37
...@@ -8,6 +8,10 @@ export default { ...@@ -8,6 +8,10 @@ export default {
GMS.$hideContainer.$Message.error('请配置审批轨迹') GMS.$hideContainer.$Message.error('请配置审批轨迹')
return return
} }
if (!this.isApproverEqulloginer(bill, param)) {
GMS.$hideContainer.$Message.error('当前用户不是当前审批人')
return
}
let curTagId = window.nros.context.getCurrTag(); let curTagId = window.nros.context.getCurrTag();
let oldObj = curTagId && GMS.oldBillDataMap[curTagId]?GMS.oldBillDataMap[curTagId]:GMS.oldBillData; let oldObj = curTagId && GMS.oldBillDataMap[curTagId]?GMS.oldBillDataMap[curTagId]:GMS.oldBillData;
let flag = compareData(oldObj, bill.getBuillData()) || bill.getGlobalParam("noRunTimeFormula"); let flag = compareData(oldObj, bill.getBuillData()) || bill.getGlobalParam("noRunTimeFormula");
...@@ -186,5 +190,11 @@ export default { ...@@ -186,5 +190,11 @@ export default {
GMS.$hideContainer.$Message.error('error') GMS.$hideContainer.$Message.error('error')
}.bind(this) }.bind(this)
); );
},
isApproverEqulloginer:async function (bill, param) {
const loginer = GMS.userContext && GMS.userContext.id
const res = await GMS.$http.get(`/rbc/workflow/confirmApprover/getUserId/${bill.getGlobalParam('reviewParam').taskId}`)
const approver = res.data.ownerIds[0]
return loginer === approver
} }
} }
\ No newline at end of file
...@@ -3,6 +3,10 @@ import { compareData } from "../components-control/util/dataChange" ...@@ -3,6 +3,10 @@ import { compareData } from "../components-control/util/dataChange"
export default { export default {
execute: function (bill, param) { execute: function (bill, param) {
if(bill){ if(bill){
if (!this.isApproverEqulloginer(bill, param)) {
GMS.$hideContainer.$Message.error('当前用户不是当前审批人')
return
}
let curTagId = window.nros.context.getCurrTag(); let curTagId = window.nros.context.getCurrTag();
let oldObj = curTagId && GMS.oldBillDataMap[curTagId]?GMS.oldBillDataMap[curTagId]:GMS.oldBillData; let oldObj = curTagId && GMS.oldBillDataMap[curTagId]?GMS.oldBillDataMap[curTagId]:GMS.oldBillData;
let flag = compareData(oldObj, bill.getBuillData()) || bill.getGlobalParam("noRunTimeFormula"); let flag = compareData(oldObj, bill.getBuillData()) || bill.getGlobalParam("noRunTimeFormula");
...@@ -99,5 +103,11 @@ export default { ...@@ -99,5 +103,11 @@ export default {
GMS.$hideContainer.$Message.error(error) GMS.$hideContainer.$Message.error(error)
}.bind(this) }.bind(this)
); );
},
isApproverEqulloginer:async function (bill, param) {
const loginer = GMS.userContext && GMS.userContext.id
const res = await GMS.$http.get(`/rbc/workflow/confirmApprover/getUserId/${bill.getGlobalParam('reviewParam').taskId}`)
const approver = res.data.ownerIds[0]
return loginer === approver
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment