keep-alive

This commit is contained in:
2023-06-29 16:02:24 +08:00
parent b28add0fc1
commit 5aa63a973b
6 changed files with 36 additions and 5 deletions

View File

@@ -25,7 +25,7 @@
<button class="button button--primary">快速查询</button>
<button class="button button--primary">确定</button>
<button class="button button--primary">清除</button>
<button class="button button--primary">关闭</button>
<button class="button button--primary" @click="colseUp">关闭</button>
</div>
</div>
</div>
@@ -73,6 +73,9 @@ export default {
async _getMaterial () {
let res = await getMaterial(this.val1)
this.options1 = [...res.data]
},
colseUp () {
this.$router.push('/semifinishedinstore')
}
}
}

View File

@@ -31,7 +31,7 @@
<div class="search-item">
<div class="search-label">物料</div>
<div class="filter_input_wraper pointer" @click="searchMater">
<input type="text" class="filter-input" disabled>
<input type="text" class="filter-input" disabled v-model="val1">
</div>
</div>
<div class="search-item">
@@ -98,6 +98,7 @@
<script>
import {getBcpStor, getBillType} from '@config/getData2.js'
export default {
name: 'semifinishedinstore',
data () {
return {
options1: [],
@@ -105,9 +106,19 @@ export default {
options2: [],
value2: '',
options3: [],
value3: ''
value3: '',
val1: ''
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
// this.val2 = this.$store.getters.materObj.material_name
},
created () {
this._getBcpStor()
this._getBillType()