|
|
|
@ -44,9 +44,7 @@
|
|
|
|
|
<router-link to="/">{{ $t('navbar.dashboard') }}</router-link> |
|
|
|
|
</el-dropdown-item> |
|
|
|
|
<el-dropdown-item> |
|
|
|
|
<div @click="showcl(true)"> |
|
|
|
|
切换仓库 |
|
|
|
|
</div> |
|
|
|
|
<div @click="showcl(true)">切换仓库</div> |
|
|
|
|
</el-dropdown-item> |
|
|
|
|
<el-dropdown-item> |
|
|
|
|
<router-link to="/info/index">{{ $t('navbar.userinfo') }}</router-link> |
|
|
|
@ -62,7 +60,7 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-dialog v-model="isshow" title="切换仓库" width="30%"> |
|
|
|
|
<div style="display: flex;flex-direction: column;align-items: center;"> |
|
|
|
|
<div style="display: flex; flex-direction: column; align-items: center"> |
|
|
|
|
<el-select class="selecin" v-model="warehousevalue" placeholder="请选择切换的仓库"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="(item, index) in datalist" |
|
|
|
@ -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: { |
|
|
|
@ -106,12 +108,10 @@ export default {
|
|
|
|
|
return { |
|
|
|
|
isshow: false, |
|
|
|
|
datalist: [], |
|
|
|
|
warehousevalue:'' |
|
|
|
|
warehousevalue: '', |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted(){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
mounted() {}, |
|
|
|
|
filters: {}, |
|
|
|
|
created() {}, |
|
|
|
|
computed: { |
|
|
|
@ -130,20 +130,38 @@ export default {
|
|
|
|
|
methods: { |
|
|
|
|
async confirmcks() { |
|
|
|
|
if (typeof this.warehousevalue != 'number') { |
|
|
|
|
return |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
console.log(this.warehousevalue) |
|
|
|
|
let res=await preserveCurrentWarehouse(this.datalist[this.warehousevalue]) |
|
|
|
|
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.$message({ message: '切换成功', type: 'success' }); |
|
|
|
|
this.$router.push({ |
|
|
|
|
path:'/' |
|
|
|
|
}) |
|
|
|
|
path: '/', |
|
|
|
|
}); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
window.location.reload(); |
|
|
|
|
}, 1000); |
|
|
|
|
} else { |
|
|
|
|
this.$message({message:res.data.msg,type:'error'}) |
|
|
|
|
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() { |
|
|
|
@ -161,12 +179,13 @@ export default {
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
showcl(flg) { |
|
|
|
|
this.isshow=flg |
|
|
|
|
this.isshow = flg; |
|
|
|
|
if (this.isshow) { |
|
|
|
|
getMyWarehouseList().then(res => { |
|
|
|
|
console.log(res.data.data,'getMyWarehouseList') |
|
|
|
|
this.datalist=res.data.data |
|
|
|
|
}) |
|
|
|
|
console.log(res.data.data, 'getMyWarehouseList'); |
|
|
|
|
let arr = [{ name: '全部', id: '0' }]; |
|
|
|
|
this.datalist = arr.concat(res.data.data); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|