Commit 11fbfdb5 by 袁成

fix: 提交之后修改按钮组是否可用

parent 8fda703e
......@@ -10,45 +10,42 @@ export default {
}
if (bill) {
bill.setControlsSate(param["_control_name_"], 'enable', false)
// GMS.$hideContainer.$Spin.show();
bill.executeServerAction(postData, function (code, data) {
bill.setControlsSate(param["_control_name_"], 'enable', true)
if (code === 200) {
// GMS.$hideContainer.$Spin.hide();
const id = data.content.billData.id
// GMS.vbus.$emit('change-form-state', { state: 'readOnly', billId: id})
GMS.$hideContainer.$Message.success('提交成功');
if (
window.osConfig.appOpenMode &&
window.osConfig.appOpenMode == "apploader"
) {
GMS.$hideContainer.$portalAPI.emit('nros-tag-close')
GMS.$hideContainer.$portalAPI.emit(
"open-new-page", //打开一个新的页签
getUUID(),
"runner-bill-form",
{
templateName: param.param.viewName,
id,
state:'readOnly'
},
{
openWay: "FUNCTAB",
title: "单据详情",
}
);
}
else {
Bridge.vm.modal_visible = false
GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
c.templateName = param.param.viewName;
c.billId = id;
c.init = true;
c.modal_visible = true;
c.isReadOnly = true
})
}
GMS.vbus.$emit("workflow-state-change", 90)
// if (
// window.osConfig.appOpenMode &&
// window.osConfig.appOpenMode == "apploader"
// ) {
// GMS.$hideContainer.$portalAPI.emit('nros-tag-close')
// GMS.$hideContainer.$portalAPI.emit(
// "open-new-page", //打开一个新的页签
// getUUID(),
// "runner-bill-form",
// {
// templateName: param.param.viewName,
// id,
// state:'readOnly'
// },
// {
// openWay: "FUNCTAB",
// title: "单据详情",
// }
// );
// }
// else {
// Bridge.vm.modal_visible = false
// GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
// c.templateName = param.param.viewName;
// c.billId = id;
// c.init = true;
// c.modal_visible = true;
// c.isReadOnly = true
// })
// }
} else if (code === 201) {
GMS.$hideContainer.$Spin.hide();
GMS.$hideContainer.$Message.error("提交失败");
......
......@@ -21,6 +21,7 @@ export default {
bottom: ''
},
btnGroup: [],
workflowState: 0
}
},
watch: {
......@@ -53,6 +54,14 @@ export default {
[location]: '0px',
}
}
// 监听工作流状态改变
GMS.vbus.$on("workflow-state-change", (val) => {
this.workflowState = val
this.getBtnGroup()
})
},
beforeDestroy() {
GMS.vbus.$off("workflow-state-change");
},
methods: {
checkParent() {
......@@ -101,7 +110,12 @@ export default {
},
getBillStateDisable(val) {
if (!val) return false
let approveState = this.context.bill.getMasterData().getValue('billState')
let approveState = null
if (this.workflowState === 0) {
approveState = this.context.bill.getMasterData().getValue('billState')
} else {
approveState = this.workflowState
}
let disableState = val.split(';')
const getBillState = () => {
if (this.tmpBill.state === '') {
......@@ -115,6 +129,10 @@ export default {
switch (approveState) {
case 90:
return disableState.includes('90')
case 91:
return disableState.includes('91')
case 92:
return disableState.includes('92')
case 1:
return disableState.includes('1') || getBillState()
default:
......
......@@ -1211,7 +1211,6 @@ export default {
"description": "",
"title": "缓存单据数据[cacheSaveAction]",
"value": "cacheSaveAction",
"btnDisable": "billReadOnly;90;91;92"
},
{
"discard": false,
......@@ -1228,7 +1227,7 @@ export default {
]
},
"description": "",
"title": "保存(报销单)[cacheSaveAction]",
"title": "保存(报销单)[saveActionBXD]",
"value": "saveActionBXD",
"btnDisable": "billReadOnly;90;91;92"
},
......@@ -1482,7 +1481,7 @@ export default {
"description": "",
"title": "财务_提交[CW_submitAction]",
"value": "CW_submitAction",
"btnDisable": "billEdit;90;1;0"
"btnDisable": "billEdit;90;91;92"
},
{
"discard": false,
......
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