fix: tabs修改

20240912_adapter_z
chenhc 10 months ago
parent 0f3eb56b3d
commit 26762bc8bc

@ -8,6 +8,7 @@
<CollectOrderAllotCardComponents style="margin: -15px"
:tagStatus="'1'"
:workPlaceCode="workPlaceCode"
@parent-method="parentMethod"
></CollectOrderAllotCardComponents>
</el-tab-pane>
@ -46,6 +47,15 @@ export default {
workPlaceCode: null,
}
},
methods: {
parentMethod(data,url) {
//
this.callParentMethod(url)
},
callParentMethod(val) {
window.open(val, '_blank');
},
},
created() {
if (this.$route.query.workplaceId != null){
this.workPlaceCode = Number(this.$route.query.workplaceId);

@ -8,6 +8,7 @@
<CollectOrderAllotCardComponents style="margin: -15px"
:tagStatus="'1'"
:workPlaceCode="workPlaceCode"
@parent-method="parentMethod"
></CollectOrderAllotCardComponents>
</el-tab-pane>
@ -46,6 +47,16 @@ export default {
workPlaceCode: null,
}
},
methods: {
parentMethod(data,url) {
//
this.callParentMethod(data)
},
callParentMethod(val) {
// 'parent-method'
this.$emit('parent-method', val); // someData
},
},
created() {
if (this.$route.query.workplaceId != null){
this.workPlaceCode = Number(this.$route.query.workplaceId);

@ -478,9 +478,14 @@ export default {
this.changeViewDisabled = !this.changeViewDisabled
},
handleClick(index) {
// this.$router.push({ path: '/tagCodeBlank', query: { workplaceId: this.list[index].workPlaceCode , billNo: this.list[index].billNo }});
this.$router.push({ query: { ...this.$route.query, billNo: this.list[index].billNo }, path: this.$route.path })
this.callParentMethod(index)
},
callParentMethod(index) {
let url = window.location.origin + `/UDI_WMS_NEW#/tagCodeBlank?workplaceId=` + this.list[index].workPlaceCode + "&billNo=" + this.list[index].billNo
// this.$router.push( workplaceId)
window.open(url, '_blank');
// 'parent-method'
this.$emit('parent-method', "DealOrderBlank",url); // someData
},
linkPage(_this, row) {

@ -68,7 +68,7 @@
:name="item.name"
>
<component :is="item.component" v-bind="item.componentProps" :reset-key="resetKeys[item.name]"/>
<component v-if="showChild" :is="item.component" v-bind="item.componentProps" :reset-key="resetKeys[item.name]" @parent-method="parentMethod"/>
</el-tab-pane>
</el-tabs>
@ -101,6 +101,7 @@ export default {
return {
logo: logoImg,
isLinkDisabled: false,
showChild: true,
userInfo: {
inv: this.$store.getters.locInvName,
deptName: this.$store.getters.locDeptName,
@ -117,7 +118,7 @@ export default {
component: DealOrderBlank,
//
componentProps: {
title: '这是单据的标题'
title: '这是单据的标题',
}
},
{
@ -181,6 +182,14 @@ export default {
}
},
methods: {
parentMethod(data) {
const foundTab = this.findAllTabByName(data)
this.clickMenuItem(foundTab.number)
this.showChild = false;
this.$nextTick(() => {
this.showChild = true;
});
},
upodateMenuActive(tab, event) {
const foundTab = this.findTabByName(tab.name)
if (foundTab) {
@ -197,6 +206,7 @@ export default {
//
this.editableTabsValue = foundTab.name
this.$set(this.resetKeys, foundTab.name, Date.now());
this.menuActive = foundTab.number
} else {
//
this.addTab(item)
@ -209,10 +219,17 @@ export default {
// undefined
return tab
},
findAllTabByName(name) {
// 使findIDtabId
const tab = this.componentTables.find(tab => tab.name === name)
// undefined
return tab
},
addTab(item) {
++this.tabIndex
this.editableTabs.push(item)
this.editableTabsValue = item.name
this.menuActive = item.number
},
removeTab(targetName) {
let tabs = this.editableTabs

Loading…
Cancel
Save