Commit 11fbfdb5 by 袁成

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

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