Commit b61b1c74 by Joey

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

parent 442a73ce
...@@ -2,16 +2,19 @@ export default { ...@@ -2,16 +2,19 @@ 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)
const fn = () => {
GMS.$http.post( GMS.$http.post(
`/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`, `/rbc/bill/action/zgh/change/work/${param.define}/bill.Basic.retrieve`,
{ {
approvalComments: comments,
data: bill.getBuillData(), data: bill.getBuillData(),
detailData: [], detailData: [],
} }
).then((res) => { ).then((res) => {
if (res.data && res.data.code == 0) { if (res.data && res.data.code == 0) {
GMS.$hideContainer.$Message.success('操作成功!') GMS.$hideContainer.$Message.success('操作成功!')
const curTagId = window.nros.context.getCurrTag();
GMS.vbus.$emit('change-form-state', { state: 'readOnly'},curTagId)
} }
else { else {
const { data } = res const { data } = res
...@@ -22,11 +25,34 @@ export default { ...@@ -22,11 +25,34 @@ export default {
} }
bill.setControlsSate(param["_control_name_"], "loading", false) bill.setControlsSate(param["_control_name_"], "loading", false)
bill.setControlsSate(param["_control_name_"], "enable", true) bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"], "loading", false) }).catch((err) => {
}).catch(() => {
GMS.$hideContainer.$Message.error('系统错误,请联系管理员') GMS.$hideContainer.$Message.error('系统错误,请联系管理员')
bill.setControlsSate(param["_control_name_"], "enable", true) console.error(err);
bill.setControlsSate(param["_control_name_"], "loading", false) bill.setControlsSate(param["_control_name_"], "loading", false)
bill.setControlsSate(param["_control_name_"], "enable", true)
}) })
}
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()
}
}, },
} }
...@@ -111,6 +111,7 @@ export default { ...@@ -111,6 +111,7 @@ export default {
}) })
} }
const fn = () => {
if (param && param.param && param.param.useSignature) { if (param && param.param && param.param.useSignature) {
showSignModal(bill, param, '提交人').then(() => { showSignModal(bill, param, '提交人').then(() => {
saveBill(bill, param).then(submitFn) saveBill(bill, param).then(submitFn)
...@@ -122,6 +123,29 @@ export default { ...@@ -122,6 +123,29 @@ export default {
else { else {
submitFn() 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 {
GMS.$hideContainer.$Spin.hide(); GMS.$hideContainer.$Spin.hide();
......
...@@ -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