更新仓库

This commit is contained in:
2023-11-07 15:49:33 +08:00
parent 298789bf24
commit 97e6a665de
22 changed files with 556 additions and 204 deletions

View File

@@ -2,16 +2,20 @@
* @Author: zwq
* @Date: 2023-08-22 15:01:54
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 16:32:13
* @LastEditTime: 2023-11-07 14:12:00
* @Description:
-->
<template>
<el-row :gutter="10" class="chart-container">
<el-col :span="14">
<el-col :span="wareType === 1 ? 14 : 24">
<div class="chart-card">
<div class="title">库存总览</div>
<div class="sub-title">产品总数量
<div style="color: black;">{{ totalNum }}</div>
</div>
<barChart
ref="barChart"
height="500px"
height="600px"
title="库存总览"
v-if="overviewList.length"
:histogram="overviewList" />
@@ -19,16 +23,18 @@
<div class="no-data-bg" v-else></div>
</div>
</el-col>
<el-col :span="10">
<el-col :span="wareType === 1 ? 10 : 0">
<div class="chart-card">
<div class="title">库位占用率</div>
<pieChart
ref="pieChart"
height="600px"
title="库位占用率"
v-if="rateList.length"
:pie-data="rateList" />
<!-- 没有数据 -->
<div class="no-data-bg" v-else></div>
</div>
</div>
</el-col>
</el-row>
</template>
@@ -36,46 +42,62 @@
<script>
import barChart from '../../chart/BarChart.vue';
import pieChart from '../../chart/PieChart.vue';
import {
getOverview,
getRate,
} from '@/api/warehouse/warehouseLocation';
import { getOverview, getRate } from '@/api/warehouse/warehouseLocation';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
export default {
data() {
return {
urlOptions: {
allURL: getOverview,
rateURL: getRate
rateURL: getRate,
},
listQuery: {
storageType: 2,
},
wareType: 1,
totalNum: 0,
overviewList: [],
rateList: []
rateList: [],
};
},
components: {
barChart,
pieChart
pieChart,
},
mounted() {
this.getDataList();
},
created() {
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === this.listQuery.storageType) {
this.wareType = item.type;
}
});
});
},
methods: {
// 获取数据列表
getDataList() {
const data = {
storageType : 2
}
this.urlOptions.allURL(data).then((response) => {
this.overviewList = response.data;
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
this.urlOptions.allURL(this.listQuery).then((response) => {
if (response.data && response.data.length) {
this.overviewList = response.data;
this.overviewList.forEach(item=>{
this.totalNum += item.num
})
this.$nextTick(() => {
this.$refs.barChart.initChart();
});
}
});
this.urlOptions.rateURL(data).then((response) => {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
this.urlOptions.rateURL(this.listQuery).then((response) => {
if (response.data && response.data.length) {
this.rateList = response.data;
this.$nextTick(() => {
this.$refs.pieChart.initChart();
});
}
});
},
},
@@ -93,4 +115,33 @@ export default {
padding: 16px;
border-radius: 8px;
}
.title {
font-size: 18px;
line-height: 16px;
margin-bottom: 10px;
color: #000;
font-weight: 500;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
}
.title::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: 16px;
border-radius: 1px;
margin-right: 5px;
background-color: #0b58ff;
}
.sub-title{
font-size: 16px;
line-height: 18px;
color: #888686;
min-width: 80px;
text-align: center;
font-weight: 500;
margin-right: 30px;
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
float: right;
}
</style>

View File

@@ -58,7 +58,7 @@ import {
getWarehouseLocationHisPage,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
@@ -179,8 +179,14 @@ export default {
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === this.listQuery.storageType) {
listByWarehouse(item.id).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
}
});
});
},
methods: {

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-04 14:46:59
* @LastEditTime: 2023-11-06 11:25:34
* @Description:
-->
<template>
@@ -93,7 +93,8 @@
</template>
<script>
import { listByWarehouse, listAll } from '@/api/warehouse/warehouseLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
export default {
data() {
@@ -129,7 +130,10 @@ export default {
there: [],
four: [],
}),
listAll(1).then((response) => {
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 2) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
@@ -142,7 +146,10 @@ export default {
}
});
this.total = Math.ceil(response.data.length / 40);
});
});
}
});
});
},
buttonClick(val) {
switch (val.btnName) {

View File

@@ -64,7 +64,7 @@ import {
outWarehouseRealtimeLocation,
} from '@/api/warehouse/warehouseRealtimeLocation';
import { listByWarehouse } from '@/api/warehouse/warehouseLocation';
import { getWarehouseList } from '@/api/warehouse/warehouse-info';
import { listData } from '@/api/system/dict/data';
import { publicFormatter } from '@/utils/dict';
import { mapGetters } from 'vuex';
@@ -203,8 +203,14 @@ export default {
listData(queryParams).then((response) => {
this.formConfig[2].selectOptions = response.data.list;
});
listByWarehouse(this.listQuery.storageType).then((response) => {
this.formConfig[0].selectOptions = response.data;
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === this.listQuery.storageType) {
listByWarehouse(item.id).then((response) => {
this.formConfig[0].selectOptions = response.data;
});
}
});
});
},
methods: {