Commit 0c7043e1 by Joey

feat(@gms/gms-plugin-billexpand): 提交、同意、驳回换接口

parent 9cba7d81
...@@ -152,9 +152,13 @@ export default { ...@@ -152,9 +152,13 @@ export default {
approval: function (bill, param) { approval: function (bill, param) {
let taskId = bill.getGlobalParam('reviewParam').taskId; let taskId = bill.getGlobalParam('reviewParam').taskId;
let comments = bill.getGlobalParam('reviewParam').suggestions ? bill.getGlobalParam('reviewParam').suggestions : ""; let comments = bill.getGlobalParam('reviewParam').suggestions ? bill.getGlobalParam('reviewParam').suggestions : "";
GMS.$http.post('/gms/workflow/task/completed/' + taskId + '?result=1&comments=' + comments).then( GMS.$http.post('/rbc/workflow/approve/completed/' + taskId + '?result=1&comments=' + comments).then(
function (response) { function (response) {
if (response.status == 200 || response.statusText == 'OK') { if (response.status == 200 || response.statusText == 'OK') {
if (response.data.code != 0) {
GMS.$hideContainer.$Message.error(response.data.message)
return
}
bill.setControlsSate(param["_control_name_"], "enable", true) bill.setControlsSate(param["_control_name_"], "enable", true)
// console.log('审批成功'); // console.log('审批成功');
......
...@@ -68,9 +68,13 @@ export default { ...@@ -68,9 +68,13 @@ export default {
} }
let taskId = bill.getGlobalParam('reviewParam').taskId; let taskId = bill.getGlobalParam('reviewParam').taskId;
let comments = bill.getGlobalParam('reviewParam').suggestions ? bill.getGlobalParam('reviewParam').suggestions:""; let comments = bill.getGlobalParam('reviewParam').suggestions ? bill.getGlobalParam('reviewParam').suggestions:"";
GMS.$http.post('/gms/workflow/task/completed/' + taskId + '?result=3&comments='+comments).then( GMS.$http.post('/rbc/workflow/approve/completed/' + taskId + '?result=3&comments='+comments).then(
function(response) { function(response) {
if (response.status == 200 || response.statusText == 'OK') { if (response.status == 200 || response.statusText == 'OK') {
if (response.data.code != 0) {
GMS.$hideContainer.$Message.error(response.data.message)
return
}
bill.setControlsSate(param["_control_name_"], "enable", true) bill.setControlsSate(param["_control_name_"], "enable", true)
bill.setControlsSate(param["_control_name_"],"loading",false) bill.setControlsSate(param["_control_name_"],"loading",false)
GMS.vbus.$emit('change-form-state', { state: 'readOnly'}) GMS.vbus.$emit('change-form-state', { state: 'readOnly'})
......
...@@ -69,13 +69,19 @@ export default { ...@@ -69,13 +69,19 @@ export default {
}); });
}, },
submitExecute(bill, param){ submitExecute(bill, param){
let postData = {
updatebillState: "2",
actions: "workflow.submitToFlow"
}
if (bill) { if (bill) {
bill.setControlsSate(param["_control_name_"], 'enable', false) bill.setControlsSate(param["_control_name_"], 'enable', false)
bill.executeServerAction(postData, function (code, data) { let postData = {
data: bill.getBuillData(),
};
let url = `/rbc/bill/workflowAction/executed/${param.define}/workflow.submitToFlow?transmission=total`;
window.GMS.$http.post(url, JSON.stringify(postData)).then((response) => {
const data = response.data
let code = 200
if (data.code != 0) {
code = 201
}
bill.setControlsSate(param["_control_name_"], 'enable', true) bill.setControlsSate(param["_control_name_"], 'enable', true)
if (code === 200) { if (code === 200) {
const id = data.content.billData.id; const id = data.content.billData.id;
...@@ -92,7 +98,7 @@ export default { ...@@ -92,7 +98,7 @@ export default {
GMS.$hideContainer.$Spin.hide(); GMS.$hideContainer.$Spin.hide();
GMS.$hideContainer.$Message.error("暂存单据异常请联系管理员"); GMS.$hideContainer.$Message.error("暂存单据异常请联系管理员");
} }
}.bind(this)); })
} else { } else {
GMS.$hideContainer.$Spin.hide(); GMS.$hideContainer.$Spin.hide();
alert('缺少参数'); alert('缺少参数');
......
...@@ -83,6 +83,10 @@ export default { ...@@ -83,6 +83,10 @@ export default {
{ {
preMessage: "No participant founds for user task", preMessage: "No participant founds for user task",
convertMessage: "提交失败,没有找到下一步审批人", convertMessage: "提交失败,没有找到下一步审批人",
},
{
preMessage: "单据已提交,不能再次提交",
convertMessage: "单据已提交,不能再次提交",
} }
], ],
getErrorMessage(a) { getErrorMessage(a) {
......
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