Authored by 李奇

标签选中修改

<template>
<LayoutBody>
<LayoutTab>
<Tabs value="name1" @on-click="switchTab">
<Tabs :value="activate" animated="false" @on-click="switchTab">
<Tab-pane :label="tab1.label" :name="tab1.name"></Tab-pane>
<Tab-pane :label="tab2.label" :name="tab2.name"></Tab-pane>
<Tab-pane :label="tab3.label" :name="tab3.name"></Tab-pane>
... ... @@ -27,10 +27,24 @@ export default {
tab3: {
label: '发货物流表',
name: 'express'
}
},
activate: ''
};
},
created() {
const path = this.$route.path;
const children = ['undone', 'done', 'express'];
_.each(children, v => {
const reg = new RegExp(`/${v}`);
console.log(reg.test(path))
if(reg.test(path)) {
this.activate = v;
return false;
}
});
},
methods: {
switchTab(name) {
... ...
... ... @@ -53,8 +53,7 @@
filters: {},
page: {},
table: {},
useFilterSign: false,
showOutStock: true
useFilterSign: false
};
},
created() {
... ... @@ -130,18 +129,6 @@
data[k] = this.filters[v].model;
});
const ot = data.isOvertime;
const date = data.startTime.trim();
if(date && moment(date).isValid()) {
data.startTime = +moment(date).format('X');
data.endTime = +moment(date).add(1, 'days').format('X');
} else {
data.endTime = '';
data.startTime = '';
}
data.isOvertime = ot === -1 ? '' : ( ot === 1 ? 'N' : 'Y');
return data;
},
expressDetail(expressNo) {
... ...