This commit is contained in:
2026-02-03 11:40:02 +08:00
parent 0744b3de01
commit 7340260cb2
6 changed files with 80 additions and 123 deletions

View File

@@ -187,9 +187,8 @@
</template>
</el-table-column>
<!-- <el-table-column prop="situation" label="情况" /> -->
<el-table-column prop="projectCount" label="项目数" align="center"/>
<el-table-column prop="itemCount" label="条目数" align="center"/>
<el-table-column prop="amountPlan" label="总金额" align="center"/>
<el-table-column prop="projectCnt" label="项目数" align="center"/>
<el-table-column prop="totalAmt" label="总金额" align="center"/>
<el-table-column prop="totalQty" label="总数量" align="center"/>
</el-table>
</div>
@@ -398,7 +397,7 @@
<script setup>
import * as echarts from 'echarts';
import { onMounted } from "vue";
import { getMonthCount, getWaitIn, getWaitOut, getInventoryAge, getAgeLong, getInventoryReview, getInStorage, getGoodsType, getDailyInventory, getInventoryType, getOutInventoryType } from '@/api/index'
import { getMonthCount, getAgeLong, getWait, getInventoryReview, getInStorage, getGoodsType, getDailyInventory, getInventoryType, getOutInventoryType } from '@/api/index'
import { listNotice,getNotice } from "@/api/system/notice";
import { parseTime } from '@/utils/manage'
@@ -420,6 +419,20 @@ const getMonthCountList = () => {
})
}
let startTime = parseTime(new Date(Date.now() - 30 * 24 * 60 * 60 * 1000), '{y}-{m}-{d}') // 14天前
let endTime = parseTime(new Date(), '{y}-{m}-{d}') // 当前时间
const getAgeLongList = () => {
getAgeLong().then(res => {
let data1 = res.data.slice(0, 3)
getChartInventoryAge(data1, "inventoryAgeEchatrs")
let data2 = res.data.slice(3)
getChartInventoryAge(data2, "warningEchatrs")
})
}
// 自定义单元格样式
// const handleCellStyle = ({ row, column, rowIndex, columnIndex }) => {
// // 示例:根据“类型”和“情况”设置颜色
@@ -439,62 +452,34 @@ const handleCellStyle = ()=>{
return { backgroundColor: '#f5f7fa' }
}
let waitTableData = ref([
{
type: '应到未到[部分未到]',
situation: '部分未到',
projectCount: '',
itemCount: '',
totalQty: '',
amountPlan: ''
},
{
type: '应到未到[全部未到]',
situation: '全部未到',
projectCount: '',
itemCount: '',
totalQty: '',
amountPlan: ''
},
{
type: '应出未出[全部未出]',
situation: '全部未出',
projectCount: '',
itemCount: '',
totalQty: '',
amountPlan: ''
}
// {
// type: '应到未到[部分未到]',
// situation: '部分未到',
// projectCount: '',
// itemCount: '',
// totalQty: '',
// amountPlan: ''
// },
// {
// type: '应到未到[全部未到]',
// situation: '全部未到',
// projectCount: '',
// itemCount: '',
// totalQty: '',
// amountPlan: ''
// },
// {
// type: '应出未出[全部未出]',
// situation: '全部未出',
// projectCount: '',
// itemCount: '',
// totalQty: '',
// amountPlan: ''
// }
])
const getWaitList = () => {
getWaitIn().then(res => {
waitTableData.value[0].projectCount = res.data.undelivered.projectCount
waitTableData.value[0].itemCount = res.data.undelivered.itemCount
waitTableData.value[0].totalQty = res.data.undelivered.totalQty
waitTableData.value[0].amountPlan = res.data.undelivered.amountPlan.toFixed(2)
waitTableData.value[1].projectCount = res.data.partialUndelivered.projectCount
waitTableData.value[1].itemCount = res.data.partialUndelivered.itemCount
waitTableData.value[1].totalQty = res.data.partialUndelivered.totalQty
waitTableData.value[1].amountPlan = res.data.partialUndelivered.amountPlan.toFixed(2)
})
getWaitOut().then(res => {
waitTableData.value[2].projectCount = res.data.projectCount
waitTableData.value[2].itemCount = res.data.goodsCountTotal
waitTableData.value[2].totalQty = res.data.sumQty
waitTableData.value[2].amountPlan = res.data.sumAmount.toFixed(2)
})
}
let startTime = parseTime(new Date(Date.now() - 30 * 24 * 60 * 60 * 1000), '{y}-{m}-{d}') // 14天前
let endTime = parseTime(new Date(), '{y}-{m}-{d}') // 当前时间
const getInventoryAgeList = () => {
getInventoryAge().then(res => {
getChartInventoryAge(res.data, "inventoryAgeEchatrs")
})
}
const getAgeLongList = () => {
getAgeLong().then(res => {
getChartInventoryAge(res.data, "warningEchatrs")
getWait().then(res => {
waitTableData.value = res.data
})
}
@@ -716,12 +701,11 @@ const goNotice = (noticeId) => {
onMounted(() => {
// getMonthCountList()
// getWaitList()
// getInventoryAgeList()
// getInventoryReviewList()
getAgeLongList()
getWaitList()
getInventoryReviewList()
// getInStorageList()
// getGoodsTypeList()
// getAgeLongList()
// getInventoryTypeList()
// getOutInventoryTypeList()
// getDailyInventoryList()
@@ -729,7 +713,7 @@ onMounted(() => {
});
const downloadExcel = () => {
proxy.download('/stat/age/export', {}, `库龄统计_${new Date().getTime()}.xlsx`)
proxy.download('/stat/stockAge/export30', {}, `库龄统计_${new Date().getTime()}.xlsx`)
}
@@ -767,11 +751,11 @@ const getChartInventoryReview = (data) => {
let totalData = []
let usedData = []
let freeData = []
data.items.forEach(item => {
xAxisData.push(item.warehouseName)
totalData.push(item.totalPositions)
usedData.push(item.usedPositions)
freeData.push(item.freePositions)
data.forEach(item => {
xAxisData.push(item.cangkuName)
totalData.push(item.totalSlot)
usedData.push(item.usedSlot)
freeData.push(item.unusedSlot)
})
var chartDom = document.getElementById('echartsInventoryReview');
var myChart = echarts.init(chartDom);