Browse Source

修复仓库显示问题

dev-xx
马远东 1 year ago
parent
commit
f21b9fb11b
  1. 20
      src/page/index/index.vue
  2. 57
      src/page/index/top/index.vue
  3. 28
      src/views/distribution/signfor/distributionSignfortreat.vue
  4. 2
      src/views/wel/index.vue

20
src/page/index/index.vue

@ -36,7 +36,7 @@ import search from './search.vue';
import logo from './logo.vue';
import top from './top/index.vue';
import sidebar from './sidebar/index.vue';
import { getMyCurrentWarehouse } from '@/api/work/work';
// import { getMyCurrentWarehouse } from '@/api/work/work';
export default {
mixins: [index],
components: {
@ -76,15 +76,15 @@ export default {
};
},
created() {
getMyCurrentWarehouse().then(res => {
if (res.data.data == null) {
console.log('当前没有数据');
localStorage.setItem('WarehouseName', void 0);
return;
}
localStorage.setItem('WarehouseName', res.data.data.name);
localStorage.setItem('my_data', JSON.stringify(res.data.data))
});
// getMyCurrentWarehouse().then(res => {
// if (res.data.data == null) {
// console.log('');
// localStorage.setItem('WarehouseName', void 0);
// return;
// }
// localStorage.setItem('WarehouseName', res.data.data.name);
// localStorage.setItem('my_data', JSON.stringify(res.data.data))
// });
},
mounted() {
if (this.userInfo.tenant_id == '000000') {

57
src/page/index/top/index.vue

@ -32,7 +32,7 @@
<!-- 仓库名称 -->
<div class="top-bar__item">
<view>{{ datalist[checkwarehousevalue]?.name || '' }}</view>
<view>{{ dataName || '' }}</view>
</div>
<div class="top-user">
@ -67,7 +67,13 @@
</div>
<el-dialog v-model="isshow" title="切换仓库" width="30%">
<div style="display: flex; flex-direction: column; align-items: center">
<el-select class="selecin" v-model="warehousevalue" filterable placeholder="请选择切换的仓库">
<el-select
@change="warehouseChange"
class="selecin"
v-model="warehousevalue"
filterable
placeholder="请选择切换的仓库"
>
<el-option
v-for="(item, index) in datalist"
:key="item.id"
@ -96,6 +102,7 @@ import {
getMyWarehouseList,
preserveCurrentWarehouse,
getclearWarehouseCache,
getMyCurrentWarehouse,
} from '@/api/work/work';
export default {
@ -117,6 +124,7 @@ export default {
warehousevalue: '',
checkwarehousevalue: 0,
dataName: null,
warehouseList: [], //
};
},
mounted() {
@ -129,16 +137,30 @@ export default {
filters: {},
created() {
this.dataName = null;
let warehouseName = localStorage.getItem('WarehouseName');
let modifiedName = warehouseName.replace(/"/g, '');
if (modifiedName == 'undefined') {
this.dataName = '';
console.log('当前暂时没有参数', this.dataName);
} else {
this.dataName = modifiedName;
console.log(this.dataName, '当前参数存在值');
}
getMyCurrentWarehouse().then(res => {
if (res.data.data == null) {
console.log('当前没有数据');
localStorage.setItem('WarehouseName', void 0);
return;
}
localStorage.setItem('WarehouseName', res.data.data.name);
if(!res.data.data.name){
this.dataName = '';
}else{
this.dataName = res.data.data.name;//
}
// localStorage.setItem('my_data', JSON.stringify(res.data.data))
});
// let warehouseName = localStorage.getItem('WarehouseName');
// // let modifiedName = warehouseName.replace(/"/g, '');
// if (warehouseName == 'undefined') {
// this.dataName = '';
// console.log('', this.dataName);
// } else {
// this.dataName = warehouseName;
// console.log(this.dataName, '');
// }
},
computed: {
...mapGetters([
@ -154,6 +176,7 @@ export default {
]),
},
methods: {
//
async confirmcks() {
if (typeof this.warehousevalue != 'number') {
return;
@ -173,6 +196,8 @@ export default {
setTimeout(() => {
window.location.reload();
}, 1000);
this.dataName = '全部';
localStorage.setItem('WarehouseName', this.dataName);
} else {
this.$message({ message: res.data.msg, type: 'error' });
}
@ -187,11 +212,16 @@ export default {
setTimeout(() => {
window.location.reload();
}, 1000);
this.dataName = this.warehouseList[this.warehousevalue - 1].name;
localStorage.setItem('WarehouseName', this.dataName);
} else {
this.$message({ message: res.data.msg, type: 'error' });
}
}
},
warehouseChange(val) {
console.log(val);
},
setCollapse() {
this.$store.commit('SET_COLLAPSE');
},
@ -207,12 +237,15 @@ export default {
});
},
showcl(flg) {
console.log(this.datalist[this.warehousevalue], '当前选择的仓库');
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);
this.warehouseList = res.data.data;
console.log(this.warehouseList, '存储的仓库');
});
}
},

28
src/views/distribution/signfor/distributionSignfortreat.vue

@ -191,6 +191,7 @@
<template v-if="slotProps.scope.column.label === '操作'">
<el-text size="small" @click="editsolt(slotProps.scope)"> </el-text>
<el-text
size="small"
v-if="slotProps.scope.row.isHaveAbnormalPackage === 2"
@ -454,15 +455,18 @@
:columnList="columnList"
></edittablehead>
<el-dialog
title="异常装车包件列表"
v-model="abnormalBox"
width="50%"
:before-close="beforeClose"
append-to-body
>
<el-table
ref="table"
v-loading="loading"
v-loading="Abnormalloading"
@selection-change="selectionChange"
:data="wrapdata"
:height="height"
@ -568,6 +572,8 @@ import { ElMessage } from 'element-plus';
export default {
data() {
return {
abnormalReview:'',//
Abnormalloading:false,//
dialogImageUrl: '', //
dialogVisible: false, //
dialogImageUrlA: '',
@ -2067,6 +2073,7 @@ export default {
},
//
auditing(row) {
this.Abnormalloading=true;
// const { row } = scope;
console.log('----------->row', row);
loadingAbnormalPackageListAuditing(row.id).then(res => {
@ -2076,6 +2083,8 @@ export default {
type: 'success',
message: '操作成功!',
});
this.Abnormalloading=false;
this.AbnormalreviewFn(this.abnormalReview);//
}
});
},
@ -2138,16 +2147,25 @@ export default {
// this.wid= row.id
// this.getWrapdetails(this.wpage)
},
//
//
AbnormalreviewFn(row){
loadingAbnormalPackageListDetail(row.id).then(res => {
this.wrapdata = res.data.data;
console.log('res------------->', res.data.data);
});
},
viewAbnormalLoading(scope) {
const { row } = scope;
console.log(scope,'异常审核');
this.abnormalReview=row
// this.title = '';
// this.view = true;
this.abnormalBox = true;
console.log('异常装车审核------------->', row);
loadingAbnormalPackageListDetail(row.id).then(res => {
this.wrapdata = res.data.data;
console.log('res------------->', res.data.data);
});
this.AbnormalreviewFn(this.abnormalReview)
},
editsolt(scope) {
const { row } = scope;

2
src/views/wel/index.vue

@ -134,7 +134,7 @@
<div class="info">
<div class="name">{{ name }}</div>
<div class="slogan">您好欢迎使用货无忧</div>
<div class="title"> 广州市汇通运输有限公司 </div>
<div class="title"> 成都数联物科有限公司 </div>
<div class="time">{{currentTime}}</div>

Loading…
Cancel
Save