From c40337df75064370f12627e99af81bc60584589d Mon Sep 17 00:00:00 2001 From: zhangsiyu Date: Wed, 20 Sep 2023 14:35:49 +0800 Subject: [PATCH] 1 --- src/page/index/top/index.vue | 16 +++++++++++++++- src/views/distribution/reservation/atlas.vue | 2 +- vite.config.js | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue index 1cb15397..5008eb45 100644 --- a/src/page/index/top/index.vue +++ b/src/page/index/top/index.vue @@ -29,6 +29,9 @@
+
+ {{ datalist[checkwarehousevalue]?.name||'' }} +
@@ -109,9 +112,18 @@ export default { isshow: false, datalist: [], warehousevalue: '', + checkwarehousevalue:0, }; }, - mounted() {}, + mounted() { + getMyWarehouseList().then(res => { + console.log(res.data.data, 'getMyWarehouseList'); + let arr = [{ name: '全部', id: '0' }]; + this.datalist = arr.concat(res.data.data); + }); + this.checkwarehousevalue=Number(localStorage.getItem('checkwarehousevalue')) + console.log(this.checkwarehousevalue) + }, filters: {}, created() {}, computed: { @@ -140,6 +152,7 @@ export default { let res = await getclearWarehouseCache({}); if (res.data.code == 200) { this.$message({ message: '切换成功', type: 'success' }); + localStorage.setItem('checkwarehousevalue',this.warehousevalue) this.$router.push({ path: '/', }); @@ -153,6 +166,7 @@ export default { let res = await preserveCurrentWarehouse(this.datalist[this.warehousevalue]); if (res.data.code == 200) { this.$message({ message: '切换成功', type: 'success' }); + localStorage.setItem('checkwarehousevalue',this.warehousevalue) this.$router.push({ path: '/', }); diff --git a/src/views/distribution/reservation/atlas.vue b/src/views/distribution/reservation/atlas.vue index 2bc04aa0..7e26addf 100644 --- a/src/views/distribution/reservation/atlas.vue +++ b/src/views/distribution/reservation/atlas.vue @@ -57,7 +57,7 @@ onMounted(() => { watchEffect(() => { console.log(router.currentRoute.value.query.id); details.item = router.currentRoute.value.query.id; - if(!details.item)return + if(!details.item) return getReservationAddr(details.item).then(res => { // selectStockArticleAtlasInfo(details.item.id).then(res => { console.log(res.data.data); diff --git a/vite.config.js b/vite.config.js index 4e19d094..21266574 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,10 +14,10 @@ export default ({ mode, command }) => { '/api': { // target: 'http://192.168.10.126:8889', // target: 'http://192.168.10.48:8888', - target: 'http://192.168.10.123:8889', + // target: 'http://192.168.10.123:8889', // target: 'http://192.168.10.75:8777', // target: 'http://192.168.10.29:13000', - // target: 'http://test.api.huitongys.com', + target: 'http://test.api.huitongys.com', changeOrigin: true, rewrite: path => path.replace(/^\/api/, ''), },