Commit 18f2def3 by qiaoyanqi

组件注销

parent 0fdcb3aa
...@@ -4,7 +4,6 @@ export default { ...@@ -4,7 +4,6 @@ export default {
if (param) { if (param) {
console.log('param', param) console.log('param', param)
GMS.$hideContainer.addComponent(customSelect, {}, async function (c) { GMS.$hideContainer.addComponent(customSelect, {}, async function (c) {
const getExtrCondition = async (filterFieldObj) => { const getExtrCondition = async (filterFieldObj) => {
let extrConditions = [] let extrConditions = []
for (const key in filterFieldObj) { for (const key in filterFieldObj) {
......
...@@ -4,8 +4,6 @@ export default { ...@@ -4,8 +4,6 @@ export default {
execute: function (bill, param) { execute: function (bill, param) {
if (param) { if (param) {
let component = null; let component = null;
let columns = []
let children = [];
let name = GMS.$hideContainer.addComponent(draftName, {}, function (c) { let name = GMS.$hideContainer.addComponent(draftName, {}, function (c) {
component = c; component = c;
c.bill = bill; c.bill = bill;
...@@ -40,6 +38,13 @@ export default { ...@@ -40,6 +38,13 @@ export default {
} }
c.billDefineName = bill.curForm.content.billdefine; c.billDefineName = bill.curForm.content.billdefine;
c.draftModal = true; c.draftModal = true;
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
}); });
} else { } else {
GAMS.Common.messagePrompt('缺少参数'); GAMS.Common.messagePrompt('缺少参数');
......
...@@ -3,13 +3,18 @@ export default { ...@@ -3,13 +3,18 @@ export default {
execute: function (bill, param) { execute: function (bill, param) {
if (param) { if (param) {
let component = null; let component = null;
let columns = []
let children = []
let name = GMS.$hideContainer.addComponent(customSelect, {}, function (c) { let name = GMS.$hideContainer.addComponent(customSelect, {}, function (c) {
component = c; component = c;
c.bill = bill; c.bill = bill;
c.drawerShow = true; c.drawerShow = true;
c.getList(); c.getList();
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
}); });
} else { } else {
GAMS.Common.messagePrompt('缺少参数'); GAMS.Common.messagePrompt('缺少参数');
......
...@@ -2,8 +2,8 @@ import printBill from '../control/printBill.vue' ...@@ -2,8 +2,8 @@ import printBill from '../control/printBill.vue'
export default { export default {
execute: function (bill, param) { execute: function (bill, param) {
if (param) { if (param) {
let component = null;
GMS.$hideContainer.addComponent(printBill, {}, function (c) { let name = GMS.$hideContainer.addComponent(printBill, {}, function (c) {
if(param.param.detailFieldName){ if(param.param.detailFieldName){
let url = `/rbcfunc/print/merge/multi/${param.define}/${bill.getMasterData().getValue('id')}/${param.param.detailFieldName}?detailName=BXMXZB`; let url = `/rbcfunc/print/merge/multi/${param.define}/${bill.getMasterData().getValue('id')}/${param.param.detailFieldName}?detailName=BXMXZB`;
GMS.$http GMS.$http
...@@ -30,6 +30,14 @@ export default { ...@@ -30,6 +30,14 @@ export default {
} }
c.modalShow = true; c.modalShow = true;
} }
component = c;
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
}) })
} else { } else {
GAMS.Common.messagePrompt('缺少参数') GAMS.Common.messagePrompt('缺少参数')
......
...@@ -3,7 +3,6 @@ export default { ...@@ -3,7 +3,6 @@ export default {
execute: function (bill, param) { execute: function (bill, param) {
if (param) { if (param) {
GMS.$hideContainer.addComponent(selectQueryAction, {}, async function (c) { GMS.$hideContainer.addComponent(selectQueryAction, {}, async function (c) {
debugger
const getExtrCondition = async (filterFieldObj) => { const getExtrCondition = async (filterFieldObj) => {
let extrConditions = [] let extrConditions = []
for (const key in filterFieldObj) { for (const key in filterFieldObj) {
......
...@@ -59,6 +59,18 @@ export default { ...@@ -59,6 +59,18 @@ export default {
} }
}, },
methods: { methods: {
addListener(l) {
this.listener = l;
},
close() {
this.modal_visible = false;
if (this.listener) {
this.$nextTick(()=> {
this.$destroy();
this.listener.close();
})
}
},
changeData(billId,state) { changeData(billId,state) {
this.init = false; this.init = false;
this.$nextTick(() => { this.$nextTick(() => {
...@@ -96,14 +108,14 @@ export default { ...@@ -96,14 +108,14 @@ export default {
GMS.vbus.$off("cacheEcho"); GMS.vbus.$off("cacheEcho");
GMS.vbus.$emit("custom-query-refresh"); GMS.vbus.$emit("custom-query-refresh");
GMS.vbus.$emit("tab-count-refresh"); GMS.vbus.$emit("tab-count-refresh");
this.modal_visible = false; this.close();
} else { } else {
//提示是否保存 //提示是否保存
this.$Modal.confirm({ this.$Modal.confirm({
title: "信息提示", title: "信息提示",
content: "信息发生变化,确认关闭?", content: "信息发生变化,确认关闭?",
onOk: () => { onOk: () => {
this.modal_visible = false; this.close();
}, },
onCancel: () => { onCancel: () => {
this.modal_visible = true; this.modal_visible = true;
...@@ -160,7 +172,7 @@ export default { ...@@ -160,7 +172,7 @@ export default {
GMS.vbus.$on("submitSuccess", (res, param) => { GMS.vbus.$on("submitSuccess", (res, param) => {
GMS.vbus.$emit("custom-query-refresh"); GMS.vbus.$emit("custom-query-refresh");
GMS.vbus.$emit("tab-count-refresh"); GMS.vbus.$emit("tab-count-refresh");
this.modal_visible = false; this.close();
}); });
GMS.vbus.$on("openEditBillForm", (res, param) => { GMS.vbus.$on("openEditBillForm", (res, param) => {
//详情界面点击修改按钮 //详情界面点击修改按钮
......
...@@ -118,12 +118,10 @@ export default { ...@@ -118,12 +118,10 @@ export default {
close() { close() {
this.modal_visible = false; this.modal_visible = false;
if (this.listener) { if (this.listener) {
this.$nextTick( this.$nextTick(()=> {
function() {
this.$destroy(); this.$destroy();
this.listener.close(); this.listener.close();
}.bind(this) })
);
} }
}, },
}, },
......
...@@ -28,15 +28,27 @@ export default { ...@@ -28,15 +28,27 @@ export default {
draftModal: false, draftModal: false,
value: "", value: "",
billDefineName: null, billDefineName: null,
loading:false loading: false,
}; };
}, },
mounted() {}, mounted() {},
methods: { methods: {
addListener(l) {
this.listener = l;
},
close() {
this.draftModal = false;
if (this.listener) {
this.$nextTick(()=> {
this.$destroy();
this.listener.close();
})
}
},
asyncOK() { asyncOK() {
if(!this.value){ if (!this.value) {
this.$Message.info('请输入草稿名称'); this.$Message.info("请输入草稿名称");
return return;
} }
this.loading = true; this.loading = true;
//掉接口保存当前json 和value //掉接口保存当前json 和value
...@@ -52,17 +64,17 @@ export default { ...@@ -52,17 +64,17 @@ export default {
contentType: "application/json", contentType: "application/json",
}) })
.then( .then(
function (data, textStatus, response) { function (data) {
if(data.code == 0){ if (data.code == 0) {
this.$Message.info("保存成功"); this.$Message.info("保存成功");
this.draftModal = false; this.close();
}else{ } else {
data.msg && this.$Message.error(data.msg); data.msg && this.$Message.error(data.msg);
} }
this.loading = false; this.loading = false;
}.bind(this) }.bind(this)
) )
.catch((XMLHttpRequest, textStatus, errorThrown) => { .catch(() => {
this.loading = false; this.loading = false;
}); });
}, },
...@@ -82,5 +94,3 @@ export default { ...@@ -82,5 +94,3 @@ export default {
background: #fff; background: #fff;
} }
</style> </style>
...@@ -109,6 +109,18 @@ export default { ...@@ -109,6 +109,18 @@ export default {
this.maxHeight= window.innerHeight - this.$refs.table.$el.offsetTop - 87 this.maxHeight= window.innerHeight - this.$refs.table.$el.offsetTop - 87
}, },
methods: { methods: {
addListener(l) {
this.listener = l;
},
close() {
this.drawerShow = false;
if (this.listener) {
this.$nextTick(()=> {
this.$destroy();
this.listener.close();
})
}
},
getList() { getList() {
GAMS.Util.invokeServer({ GAMS.Util.invokeServer({
path: "rbcfunc/billdraft/list", path: "rbcfunc/billdraft/list",
...@@ -183,7 +195,7 @@ export default { ...@@ -183,7 +195,7 @@ export default {
this.bill.getDraftDetailData(row.id); this.bill.getDraftDetailData(row.id);
this.bill.getDraftDetailData(row.id); this.bill.getDraftDetailData(row.id);
this.bill.refreshBillForm(this.bill.curForm.content.billdefine); this.bill.refreshBillForm(this.bill.curForm.content.billdefine);
this.drawerShow = false; this.close();
}, },
edit(row) { edit(row) {
this.currentId = row.id; this.currentId = row.id;
...@@ -222,7 +234,7 @@ export default { ...@@ -222,7 +234,7 @@ export default {
}); });
}, },
handleConfirm() { handleConfirm() {
this.drawerShow = false; this.close();
}, },
convertOnlyReadBillDefine(billDefine){ convertOnlyReadBillDefine(billDefine){
// 解决遗留问题,接待单子的只读界面标识特殊处理 // 解决遗留问题,接待单子的只读界面标识特殊处理
......
...@@ -44,6 +44,18 @@ export default { ...@@ -44,6 +44,18 @@ export default {
}, },
}, },
methods: { methods: {
addListener(l) {
this.listener = l;
},
close() {
this.modalShow = false;
if (this.listener) {
this.$nextTick(()=> {
this.$destroy();
this.listener.close();
})
}
},
printAsync() { printAsync() {
if(!this.printTemplate){ if(!this.printTemplate){
GMS.$hideContainer.$Message.info('请选择打印模板'); GMS.$hideContainer.$Message.info('请选择打印模板');
...@@ -69,12 +81,7 @@ export default { ...@@ -69,12 +81,7 @@ export default {
let href = window.URL.createObjectURL(blob); //创建下载的链接 let href = window.URL.createObjectURL(blob); //创建下载的链接
downloadElement.href = href; downloadElement.href = href;
window.open(href) window.open(href)
this.modalShow = false; this.close();
// let routeData = GMS.routerManager.getRouter().resolve({
// path: "/showPrint",
// query: { src: href },
// });
// window.open(routeData.href, "_blank");
}); });
}); });
}, },
......
...@@ -33,12 +33,21 @@ export default { ...@@ -33,12 +33,21 @@ export default {
} }
); );
} else { } else {
GMS.$hideContainer.addComponent(typesBill, {}, function(c) { let component = null;
let name = GMS.$hideContainer.addComponent(typesBill, {}, function(c) {
component = c;
c.templateName = templateName; c.templateName = templateName;
c.billId = billId; c.billId = billId;
c.state = billState; c.state = billState;
c.init = true; c.init = true;
c.modal_visible = true; c.modal_visible = true;
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
}); });
} }
}, },
......
...@@ -32,14 +32,23 @@ export default { ...@@ -32,14 +32,23 @@ export default {
} }
); );
} else { } else {
GMS.$hideContainer.addComponent(typesBill, {}, function (c) { let component = null;
let name = GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
c.templateName = templateName; c.templateName = templateName;
c.billId = context.selects[0][param.billId]; c.billId = context.selects[0][param.billId];
c.init = true; c.init = true;
c.modal_visible = true; c.modal_visible = true;
c.isReadOnly = true c.isReadOnly = true
c.state = 'readOnly' c.state = 'readOnly'
c.hideButtonGroup = param.hideButton? true: false c.hideButtonGroup = param.hideButton? true: false;
component = c;
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
}) })
} }
} }
......
...@@ -29,12 +29,21 @@ export default { ...@@ -29,12 +29,21 @@ export default {
} }
); );
} else { } else {
GMS.$hideContainer.addComponent(typesBill, {}, function (c) { let component = null;
let name = GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
c.templateName = billTemplateName; c.templateName = billTemplateName;
c.billId = billId; c.billId = billId;
c.init = true; c.init = true;
c.modal_visible = true; c.modal_visible = true;
c.isReadOnly = true; c.isReadOnly = true;
component = c;
c.$nextTick(()=>{
component.addListener({
close: function() {
GMS.$hideContainer.remove(name);
}
});
})
}); });
} }
}, },
......
...@@ -12,12 +12,5 @@ export default { ...@@ -12,12 +12,5 @@ export default {
c.yearFlag = yearFlag c.yearFlag = yearFlag
c.imageId = imageId c.imageId = imageId
}) })
// if (param) {
// GMS.$hideContainer.addComponent(ImageViewModal, {}, function (c) {
// c.billId = bill.getMasterData().getValue('id');
// })
// } else {
// GAMS.Common.messagePrompt('缺少参数')
// }
} }
} }
\ No newline at end of file
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