From e1f0c121231ebec973b61455c4e261397660c6ff Mon Sep 17 00:00:00 2001 From: zhangsiyu Date: Mon, 4 Sep 2023 11:39:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=B1=BB=E5=9E=8B=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=A1=A8=E6=A0=BC=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- src/api/work/work.js | 8 + src/components/tablecmt/tablecmt.vue | 6 +- src/page/index/top/index.vue | 113 +- src/utils/store.js | 7 +- .../inventory/distrilbutionBillLading.vue | 2079 +++++++---- .../inventory/distrilbutionBillLadingList.vue | 2 +- src/views/distribution/reservation/atlas1.vue | 1 + .../reservation/reservationAddFrom.vue | 3302 +++++++++++------ 9 files changed, 3435 insertions(+), 2085 deletions(-) diff --git a/index.html b/index.html index 23246e11..c0d090c8 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ + src='https://webapi.amap.com/maps?v=1.4.14&key=f003ec4feb3fcc4cf0742e94f569fd33&plugin=AMap.PlaceSearch,AMap.Geocoder,Map3D,ElasticMarker,AMap.Driving'> diff --git a/src/api/work/work.js b/src/api/work/work.js index b5a971bc..586231a9 100644 --- a/src/api/work/work.js +++ b/src/api/work/work.js @@ -92,4 +92,12 @@ export const preserveCurrentWarehouse = data => { method: 'post', data, }); +}; + +export const getclearWarehouseCache = data => { + return request({ + url: '/api/logpm-basicdata/warehouse/clearWarehouseCache', + method: 'get', + data, + }); }; \ No newline at end of file diff --git a/src/components/tablecmt/tablecmt.vue b/src/components/tablecmt/tablecmt.vue index 351b93ab..a5fbfc36 100644 --- a/src/components/tablecmt/tablecmt.vue +++ b/src/components/tablecmt/tablecmt.vue @@ -86,7 +86,7 @@ @@ -88,7 +86,11 @@ import topLogs from './top-logs.vue'; import topLang from './top-lang.vue'; import topFull from './top-full.vue'; import topSetting from '../setting.vue'; -import { getMyWarehouseList , preserveCurrentWarehouse } from '@/api/work/work' +import { + getMyWarehouseList, + preserveCurrentWarehouse, + getclearWarehouseCache, +} from '@/api/work/work'; export default { components: { @@ -104,14 +106,12 @@ export default { name: 'top', data() { return { - isshow:false, - datalist:[], - warehousevalue:'' + isshow: false, + datalist: [], + warehousevalue: '', }; }, - mounted(){ - - }, + mounted() {}, filters: {}, created() {}, computed: { @@ -128,22 +128,40 @@ export default { ]), }, methods: { - async confirmcks(){ - if(typeof this.warehousevalue !='number'){ - return + async confirmcks() { + if (typeof this.warehousevalue != 'number') { + return; } - console.log(this.warehousevalue) - let res=await preserveCurrentWarehouse(this.datalist[this.warehousevalue]) - if(res.data.code==200){ - this.$message({message:'切换成功',type:'success'}) - this.$router.push({ - path:'/' - }) - setTimeout(() => { - window.location.reload(); - }, 1000); - }else{ - this.$message({message:res.data.msg,type:'error'}) + console.log(this.warehousevalue); + if ( + this.datalist[this.warehousevalue].id == '0' && + this.datalist[this.warehousevalue].name == '全部' + ) { + let res = await getclearWarehouseCache({}); + if (res.data.code == 200) { + this.$message({ message: '切换成功', type: 'success' }); + this.$router.push({ + path: '/', + }); + setTimeout(() => { + window.location.reload(); + }, 1000); + } else { + this.$message({ message: res.data.msg, type: 'error' }); + } + } else { + let res = await preserveCurrentWarehouse(this.datalist[this.warehousevalue]); + if (res.data.code == 200) { + this.$message({ message: '切换成功', type: 'success' }); + this.$router.push({ + path: '/', + }); + setTimeout(() => { + window.location.reload(); + }, 1000); + } else { + this.$message({ message: res.data.msg, type: 'error' }); + } } }, setCollapse() { @@ -160,13 +178,14 @@ export default { }); }); }, - showcl(flg){ - this.isshow=flg - if(this.isshow){ - getMyWarehouseList().then(res=>{ - console.log(res.data.data,'getMyWarehouseList') - this.datalist=res.data.data - }) + showcl(flg) { + this.isshow = flg; + if (this.isshow) { + getMyWarehouseList().then(res => { + console.log(res.data.data, 'getMyWarehouseList'); + let arr = [{ name: '全部', id: '0' }]; + this.datalist = arr.concat(res.data.data); + }); } }, }, @@ -174,14 +193,14 @@ export default { diff --git a/src/utils/store.js b/src/utils/store.js index 4c5ada7b..b53c4281 100644 --- a/src/utils/store.js +++ b/src/utils/store.js @@ -5,7 +5,7 @@ const keyName = website.key + '-'; /** * 存储localStorage */ -export const setStore = (params = {}) => { +export const setStore = (params = {},value) => { try { let { name, content, type } = params; name = keyName + name; @@ -28,7 +28,10 @@ export const setStore = (params = {}) => { keys.map(item=>{ localStorage.removeItem(item) }) - setStore(params) + if(value!=1){ + setStore(params,1) + } + } }; /** diff --git a/src/views/distribution/inventory/distrilbutionBillLading.vue b/src/views/distribution/inventory/distrilbutionBillLading.vue index a6a0c3db..5bd3c7af 100644 --- a/src/views/distribution/inventory/distrilbutionBillLading.vue +++ b/src/views/distribution/inventory/distrilbutionBillLading.vue @@ -1,6 +1,6 @@