Authored by 李奇

标签选中修改

1 <template> 1 <template>
2 <LayoutBody> 2 <LayoutBody>
3 <LayoutTab> 3 <LayoutTab>
4 - <Tabs value="name1" @on-click="switchTab"> 4 + <Tabs :value="activate" animated="false" @on-click="switchTab">
5 <Tab-pane :label="tab1.label" :name="tab1.name"></Tab-pane> 5 <Tab-pane :label="tab1.label" :name="tab1.name"></Tab-pane>
6 <Tab-pane :label="tab2.label" :name="tab2.name"></Tab-pane> 6 <Tab-pane :label="tab2.label" :name="tab2.name"></Tab-pane>
7 <Tab-pane :label="tab3.label" :name="tab3.name"></Tab-pane> 7 <Tab-pane :label="tab3.label" :name="tab3.name"></Tab-pane>
@@ -27,10 +27,24 @@ export default { @@ -27,10 +27,24 @@ export default {
27 tab3: { 27 tab3: {
28 label: '发货物流表', 28 label: '发货物流表',
29 name: 'express' 29 name: 'express'
30 - } 30 + },
  31 + activate: ''
31 }; 32 };
32 }, 33 },
33 created() { 34 created() {
  35 + const path = this.$route.path;
  36 + const children = ['undone', 'done', 'express'];
  37 +
  38 + _.each(children, v => {
  39 + const reg = new RegExp(`/${v}`);
  40 +
  41 + console.log(reg.test(path))
  42 +
  43 + if(reg.test(path)) {
  44 + this.activate = v;
  45 + return false;
  46 + }
  47 + });
34 }, 48 },
35 methods: { 49 methods: {
36 switchTab(name) { 50 switchTab(name) {
@@ -53,8 +53,7 @@ @@ -53,8 +53,7 @@
53 filters: {}, 53 filters: {},
54 page: {}, 54 page: {},
55 table: {}, 55 table: {},
56 - useFilterSign: false,  
57 - showOutStock: true 56 + useFilterSign: false
58 }; 57 };
59 }, 58 },
60 created() { 59 created() {
@@ -130,18 +129,6 @@ @@ -130,18 +129,6 @@
130 data[k] = this.filters[v].model; 129 data[k] = this.filters[v].model;
131 }); 130 });
132 131
133 - const ot = data.isOvertime;  
134 - const date = data.startTime.trim();  
135 -  
136 - if(date && moment(date).isValid()) {  
137 - data.startTime = +moment(date).format('X');  
138 - data.endTime = +moment(date).add(1, 'days').format('X');  
139 - } else {  
140 - data.endTime = '';  
141 - data.startTime = '';  
142 - }  
143 - data.isOvertime = ot === -1 ? '' : ( ot === 1 ? 'N' : 'Y');  
144 -  
145 return data; 132 return data;
146 }, 133 },
147 expressDetail(expressNo) { 134 expressDetail(expressNo) {