Commit b61b1c74 by Joey

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

parent 442a73ce
......@@ -2,31 +2,57 @@ export default {
execute(bill, param) {
bill = bill.dom || bill
bill.setControlsSate(param["_control_name_"], "enable", false)
GMS.$http.post(
`/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`,
{
approvalComments: comments,
data: bill.getBuillData(),
detailData: [],
const fn = () => {
GMS.$http.post(
`/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`,
{
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) => {
if (res.data && res.data.code == 0) {
GMS.$hideContainer.$Message.success('操作成功!')
}
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)
bill.setControlsSate(param["_control_name_"], "loading", false)
}).catch(() => {
GMS.$hideContainer.$Message.error('系统错误,请联系管理员')
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"], "loading", false)
})
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()
}
},
}
......@@ -111,16 +111,40 @@ export default {
})
}
if (param && param.param && param.param.useSignature) {
showSignModal(bill, param, '提交人').then(() => {
saveBill(bill, param).then(submitFn)
}).catch(() => {
bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"],"loading",false)
})
const fn = () => {
if (param && param.param && param.param.useSignature) {
showSignModal(bill, param, '提交人').then(() => {
saveBill(bill, param).then(submitFn)
}).catch(() => {
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 {
......
......@@ -2275,7 +2275,15 @@ export default {
"type": "Boolean",
"title": "电子签章",
"key": "useSignature"
}
},
{
"clearable": true,
"ref": "gams2.bill",
"type": "select",
"title": "执行动作",
"key": "actions",
"innerRef": "actions"
},
]
},
"description": "",
......@@ -2344,6 +2352,14 @@ export default {
"path": "报销/工会",
"extends": {
"param": [
{
"clearable": true,
"ref": "gams2.bill",
"type": "select",
"title": "执行动作",
"key": "actions",
"innerRef": "actions"
},
]
},
"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