Commit 770a8f92 by 乔延琦

Merge branch 'develop-yuancheng' into 'develop'

Develop yuancheng

See merge request GFP/RBC/rbc-frontend!100
parents 629849b7 13baccc0
......@@ -8,6 +8,10 @@ export default {
GMS.$hideContainer.$Message.error('请配置审批轨迹')
return
}
if (!this.isApproverEqulloginer(bill, param)) {
GMS.$hideContainer.$Message.error('当前用户不是当前审批人')
return
}
let curTagId = window.nros.context.getCurrTag();
let oldObj = curTagId && GMS.oldBillDataMap[curTagId]?GMS.oldBillDataMap[curTagId]:GMS.oldBillData;
let flag = compareData(oldObj, bill.getBuillData()) || bill.getGlobalParam("noRunTimeFormula");
......@@ -186,5 +190,24 @@ export default {
GMS.$hideContainer.$Message.error('error')
}.bind(this)
);
},
isApproverEqulloginer: function (bill, param) {
const loginer = GMS.userContext && GMS.userContext.id
let approver = []
$.ajax({
type: "GET",
url: `${osConfig.baseUrl}/rbc/workflow/confirmApprover/getUserId/${bill.getGlobalParam('reviewParam').taskId}`,
async: false,
contentType: "application/json;",
beforeSend: function (request) {
request.setRequestHeader("Authorization", GMS.util.getAuthorization());
},
success: function (data1) {
approver = data1.ownerIds
},
error: function () {
}
})
return approver.includes(loginer)
}
}
\ No newline at end of file
......@@ -3,6 +3,10 @@ import { compareData } from "../components-control/util/dataChange"
export default {
execute: function (bill, param) {
if(bill){
if (!this.isApproverEqulloginer(bill, param)) {
GMS.$hideContainer.$Message.error('当前用户不是当前审批人')
return
}
let curTagId = window.nros.context.getCurrTag();
let oldObj = curTagId && GMS.oldBillDataMap[curTagId]?GMS.oldBillDataMap[curTagId]:GMS.oldBillData;
let flag = compareData(oldObj, bill.getBuillData()) || bill.getGlobalParam("noRunTimeFormula");
......@@ -99,5 +103,24 @@ export default {
GMS.$hideContainer.$Message.error(error)
}.bind(this)
);
},
isApproverEqulloginer:async function (bill, param) {
const loginer = GMS.userContext && GMS.userContext.id
let approver = []
$.ajax({
type: "GET",
url: `${osConfig.baseUrl}/rbc/workflow/confirmApprover/getUserId/${bill.getGlobalParam('reviewParam').taskId}`,
async: false,
contentType: "application/json;",
beforeSend: function (request) {
request.setRequestHeader("Authorization", GMS.util.getAuthorization());
},
success: function (data1) {
approver = data1.ownerIds
},
error: function () {
}
})
return approver.includes(loginer)
}
}
\ 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