Commit 334347b8 by 袁成

fix: 同意驳回按钮点击之后禁用

parent 440d17ec
...@@ -4,6 +4,7 @@ import SelectApprovers from '../components-control/select-approvers.vue' ...@@ -4,6 +4,7 @@ import SelectApprovers from '../components-control/select-approvers.vue'
export default { export default {
execute: function (bill, param) { execute: function (bill, param) {
if (bill) { if (bill) {
bill.setControlsSate(param["_control_name_"], "enable", false)
let taskId = bill.getGlobalParam('reviewParam').taskId; let taskId = bill.getGlobalParam('reviewParam').taskId;
let selectedApprovers = [] let selectedApprovers = []
window.GMS.$http.get(`/bpm/bill/selectApprover/ApproverList/${taskId}`).then((res) => { window.GMS.$http.get(`/bpm/bill/selectApprover/ApproverList/${taskId}`).then((res) => {
...@@ -12,10 +13,11 @@ export default { ...@@ -12,10 +13,11 @@ export default {
return return
} }
else if (res.data.code != 200) { else if (res.data.code != 200) {
// this.executeApproval(bill, param) bill.setControlsSate(param["_control_name_"], "enable", true)
GMS.$hideContainer.$Message.error(res.data.msg || '提交失败,请联系系统管理员'); GMS.$hideContainer.$Message.error(res.data.msg || '提交失败,请联系系统管理员');
return return
} }
bill.setControlsSate(param["_control_name_"], "enable", true)
const nodeData = res.data.ApproverVo const nodeData = res.data.ApproverVo
const optionList = [...nodeData.approvers] const optionList = [...nodeData.approvers]
if (optionList.length == 0) { if (optionList.length == 0) {
...@@ -78,6 +80,7 @@ export default { ...@@ -78,6 +80,7 @@ export default {
this.approval(bill, param); this.approval(bill, param);
bill.setControlsSate(param["_control_name_"], "loading", false) bill.setControlsSate(param["_control_name_"], "loading", false)
} else { } else {
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"], "loading", false) bill.setControlsSate(param["_control_name_"], "loading", false)
GMS.$hideContainer.$message.error("操作异常请联系管理员"); GMS.$hideContainer.$message.error("操作异常请联系管理员");
} }
...@@ -93,6 +96,8 @@ export default { ...@@ -93,6 +96,8 @@ export default {
GMS.$http.post('/gms/workflow/task/completed/' + taskId + '?result=1&comments=' + comments).then( GMS.$http.post('/gms/workflow/task/completed/' + taskId + '?result=1&comments=' + comments).then(
function (response) { function (response) {
if (response.status == 200 || response.statusText == 'OK') { if (response.status == 200 || response.statusText == 'OK') {
bill.setControlsSate(param["_control_name_"], "enable", true)
// console.log('审批成功'); // console.log('审批成功');
bill.setControlsSate(param["_control_name_"], "loading", false) bill.setControlsSate(param["_control_name_"], "loading", false)
GMS.$hideContainer.$Message.success('审批成功!') GMS.$hideContainer.$Message.success('审批成功!')
...@@ -112,7 +117,9 @@ export default { ...@@ -112,7 +117,9 @@ export default {
) )
.catch( .catch(
function (error) { function (error) {
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"], "loading", false) bill.setControlsSate(param["_control_name_"], "loading", false)
GMS.$hideContainer.$Message.error('error')
}.bind(this) }.bind(this)
); );
} }
......
...@@ -3,6 +3,7 @@ import Bridge from '../components-control/util/bridge' ...@@ -3,6 +3,7 @@ import Bridge from '../components-control/util/bridge'
export default { export default {
execute: function (bill, param) { execute: function (bill, param) {
if(bill){ if(bill){
bill.setControlsSate(param["_control_name_"], "enable", false)
if(param.param.isNeedSave){ if(param.param.isNeedSave){
let saveParam = { let saveParam = {
actions: "bill.Basic.save", actions: "bill.Basic.save",
...@@ -19,6 +20,7 @@ export default { ...@@ -19,6 +20,7 @@ export default {
bill.setControlsSate(param["_control_name_"],"loading",false) bill.setControlsSate(param["_control_name_"],"loading",false)
}else{ }else{
bill.setControlsSate(param["_control_name_"],"loading",false) bill.setControlsSate(param["_control_name_"],"loading",false)
bill.setControlsSate(param["_control_name_"], "enable", true)
GMS.$hideContainer.$message.error("操作异常请联系管理员"); GMS.$hideContainer.$message.error("操作异常请联系管理员");
} }
}.bind(this)); }.bind(this));
...@@ -37,6 +39,7 @@ export default { ...@@ -37,6 +39,7 @@ export default {
function(response) { function(response) {
if (response.status == 200 || response.statusText == 'OK') { if (response.status == 200 || response.statusText == 'OK') {
// console.log('驳回成功'); // console.log('驳回成功');
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"],"loading",false) bill.setControlsSate(param["_control_name_"],"loading",false)
GMS.$hideContainer.$Message.success('驳回成功!') GMS.$hideContainer.$Message.success('驳回成功!')
if ( if (
...@@ -54,7 +57,9 @@ export default { ...@@ -54,7 +57,9 @@ export default {
) )
.catch( .catch(
function(error) { function(error) {
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"],"loading",false) bill.setControlsSate(param["_control_name_"],"loading",false)
GMS.$hideContainer.$Message.error(error)
}.bind(this) }.bind(this)
); );
} }
......
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