keep-alive

This commit is contained in:
2023-06-29 18:42:36 +08:00
parent 5aa63a973b
commit a49a28370b
5 changed files with 23 additions and 15 deletions

View File

@@ -3,9 +3,7 @@
<v-toast v-show="showToast"></v-toast>
<v-alert v-show="showAlert"></v-alert>
<v-loading v-show="loading"></v-loading>
<keep-alive :include="keepAlive" >
<router-view/>
</keep-alive>
<router-view/>
</div>
</template>
@@ -26,7 +24,7 @@ export default {
}
},
computed: {
...mapGetters(['showToast', 'showAlert', 'loading', 'keepAlive'])
...mapGetters(['showToast', 'showAlert', 'loading'])
}
}
</script>

View File

@@ -6,13 +6,16 @@
/>
<div class="body-container">
<div class="main-container">
<router-view></router-view>
<keep-alive :include="keepAlive" >
<router-view/>
</keep-alive>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import jxHeader from '@components/header.vue'
export default {
components: {
@@ -25,7 +28,8 @@ export default {
title () {
let res = ['半成品入库', '半成品入库查询', '半成品出库', '半成品出库查询', '半成品盘点', '半成品盘点查询', '半成品拼盘查询', '物料查询'][Number(this.$route.meta.guidePath) - 1]
return res
}
},
...mapGetters(['keepAlive'])
},
methods: {
switchColor (type) {

View File

@@ -22,7 +22,7 @@
</div>
</div>
<div class="search-item_2 flexend">
<button class="button button--primary">快速查询</button>
<button class="button button--primary" @click="_getMaterial">快速查询</button>
<button class="button button--primary">确定</button>
<button class="button button--primary">清除</button>
<button class="button button--primary" @click="colseUp">关闭</button>
@@ -41,7 +41,7 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.material_code}" @click="toRadio(e)">
<td>{{ i+1 }}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
@@ -62,7 +62,9 @@ export default {
options1: [],
value1: '',
val1: '',
dataList: []
dataList: [{material_code: '1'}],
pkId: '',
pkObj: {}
}
},
created () {
@@ -76,6 +78,10 @@ export default {
},
colseUp () {
this.$router.push('/semifinishedinstore')
},
toRadio (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
}
}
}

View File

@@ -37,7 +37,7 @@
<div class="search-item">
<div class="search-label">规格</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input">
<input type="text" class="filter-input" v-model="val2">
</div>
</div>
<div class="search-item">
@@ -107,7 +107,8 @@ export default {
value2: '',
options3: [],
value3: '',
val1: ''
val1: '',
val2: ''
}
},
beforeRouteLeave (to, from, next) {

View File

@@ -106,11 +106,10 @@ export default new Router({
}, {
path: '/semifinishedcomposesearch',
component: semiFinishedComposeSearch,
meta: {guidePath: '7'}
}, {
path: '/matersearch',
component: materSearch,
meta: {guidePath: '8'}
}, {
path: '/materSearch',
component: materSearch
}]
},
{