Commit 55987344 by 乔延琦

Merge branch 'develop-qiaoyanqi' into 'develop'

提交按钮,加预算逻辑

See merge request GFP/RBC/rbc-frontend!64
parents f01a6664 1b7b3d0b
...@@ -5,6 +5,73 @@ import errorMessageUtil from "./util/errorMessageUtil"; ...@@ -5,6 +5,73 @@ import errorMessageUtil from "./util/errorMessageUtil";
import { getUUID } from "../query-actions/util/lib"; import { getUUID } from "../query-actions/util/lib";
export default { export default {
execute: function (bill, param) { execute: function (bill, param) {
if (param && param.param && param.param.budgetcontrol) {
let res = this.getBudgetControl(bill, true, param);
res.then((data) => {
if (data.code == 0) {
let result = this.getBudgetControl(bill, false, param);
result.then((data1) => {
if (data1.code == 0) {
this.submitExecute(bill, param);
} else if (data1.code == 1) {
GAMS.Common.messagePrompt(data1.msg);
}
});
} else if (data.code == 1) {
setTimeout(() => {
GAMS.Common.messagePrompt(data.msg);
}, 500);
} else if (data.code == 2) {
setTimeout(() => {
this.getModal(bill, param, data);
}, 500);
}
});
} else {
this.submitExecute(bill, param);
}
},
getModal(bill, param, data) {
GMS.$hideContainer.$Modal.confirm({
title: "信息提示",
content: data.msg,
onOk: () => {
let result = this.getBudgetControl(bill, false, param);
result.then((data1) => {
if (data1.code == 0) {
this.submitExecute(bill, param);
} else if (data1.code == 1) {
GAMS.Common.messagePrompt(data1.msg);
}
});
},
onCancel: () => {
GMS.$hideContainer.$Message["error"]({
content: "已取消",
});
},
});
},
getBudgetControl(bill, check, param) {
let postData = {
data: bill.getBuillData(),
};
let url = `/v1/budget/control/${param.define}/${check}`;
return new Promise((resolve, reject) => {
GMS.$http
.post(url, postData, {
headers: {
post: {
"Content-Type": "application/json",
},
},
})
.then((res) => {
resolve(res.data);
});
});
},
submitExecute(bill, param){
let postData = { let postData = {
updatebillState: "2", updatebillState: "2",
actions: "workflow.submitToFlow" actions: "workflow.submitToFlow"
...@@ -14,39 +81,12 @@ export default { ...@@ -14,39 +81,12 @@ export default {
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) {
const id = data.content.billData.id const id = data.content.billData.id;
if(GMS.queryObject){
GMS.queryObject.index = GMS.queryObject.index*1 - 1;//上张下张用
}
GMS.$hideContainer.$Message.success('提交成功'); GMS.$hideContainer.$Message.success('提交成功');
GMS.vbus.$emit("workflow-state-change", 90) GMS.vbus.$emit("workflow-state-change", 90)
// if (
// window.osConfig.appOpenMode &&
// window.osConfig.appOpenMode == "apploader"
// ) {
// GMS.$hideContainer.$portalAPI.emit('nros-tag-close')
// GMS.$hideContainer.$portalAPI.emit(
// "open-new-page", //打开一个新的页签
// getUUID(),
// "runner-bill-form",
// {
// templateName: param.param.viewName,
// id,
// state:'readOnly'
// },
// {
// openWay: "FUNCTAB",
// title: "单据详情",
// }
// );
// }
// else {
// Bridge.vm.modal_visible = false
// GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
// c.templateName = param.param.viewName;
// c.billId = id;
// c.init = true;
// c.modal_visible = true;
// c.isReadOnly = true
// })
// }
} else if (code === 201) { } else if (code === 201) {
GMS.$hideContainer.$Spin.hide() GMS.$hideContainer.$Spin.hide()
data.message && GMS.$hideContainer.$Message.error({ data.message && GMS.$hideContainer.$Message.error({
......
...@@ -53,13 +53,13 @@ export default { ...@@ -53,13 +53,13 @@ export default {
}) })
.then( .then(
function (data, textStatus, response) { function (data, textStatus, response) {
this.loading = false;
if(data.code == 0){ if(data.code == 0){
this.$Message.info("保存成功"); this.$Message.info("保存成功");
this.draftModal = false; this.draftModal = false;
}else{ }else{
data.msg && this.$Message.error(data.msg); data.msg && this.$Message.error(data.msg);
} }
this.loading = false;
}.bind(this) }.bind(this)
) )
.catch((XMLHttpRequest, textStatus, errorThrown) => { .catch((XMLHttpRequest, textStatus, errorThrown) => {
......
...@@ -1664,12 +1664,12 @@ export default { ...@@ -1664,12 +1664,12 @@ export default {
"path": "资产/通用", "path": "资产/通用",
"extends": { "extends": {
"param": [ "param": [
// { {
// "ref": "bill", "budgetcontrol": false,
// "type": "metaData", "type": "Boolean",
// "title": "成功跳转页面", "title": "启用预算控制",
// "key": "viewName" "key": "budgetcontrol"
// } }
] ]
}, },
"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