Commit b61b1c74 by Joey

feat(@gms/gms-plugin-billexpand): 工会取回和提交增加动作

parent 442a73ce
...@@ -2,31 +2,57 @@ export default { ...@@ -2,31 +2,57 @@ export default {
execute(bill, param) { execute(bill, param) {
bill = bill.dom || bill bill = bill.dom || bill
bill.setControlsSate(param["_control_name_"], "enable", false) bill.setControlsSate(param["_control_name_"], "enable", false)
GMS.$http.post(
`/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`, const fn = () => {
{ GMS.$http.post(
approvalComments: comments, `/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`,
data: bill.getBuillData(), {
detailData: [], data: bill.getBuillData(),
detailData: [],
}
).then((res) => {
if (res.data && res.data.code == 0) {
GMS.$hideContainer.$Message.success('操作成功!')
const curTagId = window.nros.context.getCurrTag();
GMS.vbus.$emit('change-form-state', { state: 'readOnly'},curTagId)
}
else {
const { data } = res
data.message && GMS.$hideContainer.$Message.error({
content: errorMessageUtil.submitAction.getErrorMessage(data.message),
duration: 3
});
}
bill.setControlsSate(param["_control_name_"], "loading", false)
bill.setControlsSate(param["_control_name_"], "enable", true)
}).catch((err) => {
GMS.$hideContainer.$Message.error('系统错误,请联系管理员')
console.error(err);
bill.setControlsSate(param["_control_name_"], "loading", false)
bill.setControlsSate(param["_control_name_"], "enable", true)
})
}
if (param.param.actions) {
let saveParam = {
actions: param.param.actions
} }
).then((res) => { bill.executeServerAction(saveParam, function (code, data) {
if (res.data && res.data.code == 0) { if (code === 200) {
GMS.$hideContainer.$Message.success('操作成功!') fn()
} } else {
else { bill.setControlsSate(param["_control_name_"], "enable", true)
const { data } = res if (data.message) {
data.message && GMS.$hideContainer.$Message.error({ const errMsg = data.message.split('nested exception is')
content: errorMessageUtil.submitAction.getErrorMessage(data.message), GMS.$hideContainer.$message.error(errMsg && errMsg[1] || '操作异常请联系管理员');
duration: 3 }
}); else {
} GMS.$hideContainer.$message.error("操作异常请联系管理员");
bill.setControlsSate(param["_control_name_"], "loading", false) }
bill.setControlsSate(param["_control_name_"], "enable", true) }
bill.setControlsSate(param["_control_name_"], "loading", false) }.bind(this));
}).catch(() => { } else {
GMS.$hideContainer.$Message.error('系统错误,请联系管理员') fn()
bill.setControlsSate(param["_control_name_"], "enable", true) }
bill.setControlsSate(param["_control_name_"], "loading", false)
})
}, },
} }
...@@ -111,16 +111,40 @@ export default { ...@@ -111,16 +111,40 @@ export default {
}) })
} }
if (param && param.param && param.param.useSignature) { const fn = () => {
showSignModal(bill, param, '提交人').then(() => { if (param && param.param && param.param.useSignature) {
saveBill(bill, param).then(submitFn) showSignModal(bill, param, '提交人').then(() => {
}).catch(() => { saveBill(bill, param).then(submitFn)
bill.setControlsSate(param["_control_name_"], "enable", true) }).catch(() => {
bill.setControlsSate(param["_control_name_"],"loading",false) bill.setControlsSate(param["_control_name_"], "enable", true)
}) bill.setControlsSate(param["_control_name_"],"loading",false)
})
}
else {
submitFn()
}
} }
else {
submitFn() if (param.param.actions) {
let saveParam = {
actions: param.param.actions
}
bill.executeServerAction(saveParam, function (code, data) {
if (code === 200) {
fn()
} else {
bill.setControlsSate(param["_control_name_"], "enable", true)
if (data.message) {
const errMsg = data.message.split('nested exception is')
GMS.$hideContainer.$message.error(errMsg && errMsg[1] || '操作异常请联系管理员');
}
else {
GMS.$hideContainer.$message.error("操作异常请联系管理员");
}
}
}.bind(this));
} else {
fn()
} }
} else { } else {
......
...@@ -2275,7 +2275,15 @@ export default { ...@@ -2275,7 +2275,15 @@ export default {
"type": "Boolean", "type": "Boolean",
"title": "电子签章", "title": "电子签章",
"key": "useSignature" "key": "useSignature"
} },
{
"clearable": true,
"ref": "gams2.bill",
"type": "select",
"title": "执行动作",
"key": "actions",
"innerRef": "actions"
},
] ]
}, },
"description": "", "description": "",
...@@ -2344,6 +2352,14 @@ export default { ...@@ -2344,6 +2352,14 @@ export default {
"path": "报销/工会", "path": "报销/工会",
"extends": { "extends": {
"param": [ "param": [
{
"clearable": true,
"ref": "gams2.bill",
"type": "select",
"title": "执行动作",
"key": "actions",
"innerRef": "actions"
},
] ]
}, },
"description": "", "description": "",
......
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