Commit 18f2def3 by qiaoyanqi

组件注销

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