更新订单下达、采购入库和仓储汇总页面
This commit is contained in:
@@ -527,6 +527,7 @@
|
||||
</el-card>
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleRKD" title="入库单" center width="700px">
|
||||
<el-table :data="tableDataRKD" border stripe size="small" height="400px">
|
||||
<el-table-column prop="入库单号" label="入库单号" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="采购合同号" label="采购合同" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="供应商名称" label="供应商" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="到货数" label="到货数" align="center" show-overflow-tooltip/>
|
||||
|
||||
@@ -6,52 +6,58 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card" @click.native="showDetail('待入库')">
|
||||
<div class="stat-number">{{ statistics.待入库 }}</div>
|
||||
<div class="stat-label">待入库</div>
|
||||
<div class="stat-number">{{ statistics.待入库 }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card" @click.native="showDetail('待出库')">
|
||||
<div class="stat-number">{{ statistics.待出库 }}</div>
|
||||
<div class="stat-label">待出库</div>
|
||||
<div class="stat-number">{{ statistics.待出库 }}</div>
|
||||
<div class="stat-sub-info">领料单 {{ 领料单数 }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card" @click.native="showDetail('可出库')">
|
||||
<div class="stat-number">{{ statistics.可出库 }}</div>
|
||||
<div class="stat-label">可出库</div>
|
||||
<div class="stat-number">{{ statistics.可出库 }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card" @click.native="showDetail('变更BOM')">
|
||||
<div class="stat-number">{{ statistics.变更BOM }}</div>
|
||||
<div class="stat-label">变更BOM</div>
|
||||
<div class="stat-number">{{ statistics.变更BOM }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" style="margin-top: 20px">
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card" @click.native="showDetail('补货中')">
|
||||
<div class="stat-number">{{ statistics.补货中 }}</div>
|
||||
<div class="stat-label">补货中</div>
|
||||
<div class="stat-number">{{ statistics.补货中 }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card " @click.native="showDetail('生产中')">
|
||||
<div class="stat-number">{{ statistics.生产中 }}</div>
|
||||
<div class="stat-label">生产中</div>
|
||||
<div class="stat-number">{{ statistics.生产中 }}</div>
|
||||
<div class="stat-sub-labels">
|
||||
<span class="sub-normal" :class="{ 'sub-active': 生产中期限筛选 === '正常' }" @click.stop="filterProductionByStatus('正常')">正常 {{ 生产中统计.正常 }}</span>
|
||||
<span class="sub-warning" :class="{ 'sub-active': 生产中期限筛选 === '临期' }" @click.stop="filterProductionByStatus('临期')">临期 {{ 生产中统计.临期 }}</span>
|
||||
<span class="sub-danger" :class="{ 'sub-active': 生产中期限筛选 === '超期' }" @click.stop="filterProductionByStatus('超期')">超期 {{ 生产中统计.超期 }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card" @click.native="showDetail('待投产')">
|
||||
<el-card class="stat-card" @click.native="showDetail('待补货')">
|
||||
<div class="stat-label">待补货</div>
|
||||
<div class="stat-number">{{ statistics.待投产 }}</div>
|
||||
<div class="stat-label">待投产</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="stat-card" @click.native="showDetail('采购中')">
|
||||
<div class="stat-number">{{ statistics.采购中 }}</div>
|
||||
<div class="stat-label">采购中</div>
|
||||
<div class="stat-number">{{ statistics.采购中 }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -74,7 +80,15 @@
|
||||
:label="column.label"
|
||||
:align="column.align">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="column.prop === '期限状态'" :class="getDeadlineStatusClass(scope.row.期限状态)">
|
||||
{{ scope.row.期限状态 }}
|
||||
</span>
|
||||
<span v-else-if="column.prop === '超期时间' && scope.row.期限状态 === '超期'" class="text-danger">
|
||||
{{ scope.row[column.prop] }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ scope.row[column.prop] }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -104,7 +118,15 @@ export default {
|
||||
detailData: [],
|
||||
detailColumns: [],
|
||||
领料单流水号列表: [],
|
||||
statisticsTimer: null
|
||||
statisticsTimer: null,
|
||||
生产中统计: {
|
||||
正常: 0,
|
||||
临期: 0,
|
||||
超期: 0
|
||||
},
|
||||
生产中期限筛选: null,
|
||||
生产中全部数据: [],
|
||||
领料单数: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -128,7 +150,44 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取统计数据
|
||||
calculateDeadlineStatus(item) {
|
||||
if (!item.补货期限) return '正常'
|
||||
var deadline = new Date(item.补货期限)
|
||||
var now = new Date()
|
||||
var diffMs = deadline.getTime() - now.getTime()
|
||||
var diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24))
|
||||
if (diffDays < 0) return '超期'
|
||||
if (diffDays <= 3) return '临期'
|
||||
return '正常'
|
||||
},
|
||||
|
||||
calculateOverdueDays(item) {
|
||||
if (!item.补货期限) return 0
|
||||
var deadline = new Date(item.补货期限)
|
||||
var now = new Date()
|
||||
var diffMs = now.getTime() - deadline.getTime()
|
||||
var diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24))
|
||||
return diffDays > 0 ? diffDays : 0
|
||||
},
|
||||
|
||||
getDeadlineStatusClass(status) {
|
||||
if (status === '超期') return 'text-danger'
|
||||
if (status === '临期') return 'text-warning'
|
||||
return ''
|
||||
},
|
||||
|
||||
filterProductionByStatus(status) {
|
||||
if (this.生产中期限筛选 === status) {
|
||||
this.生产中期限筛选 = null
|
||||
this.detailData = this.生产中全部数据
|
||||
} else {
|
||||
this.生产中期限筛选 = status
|
||||
this.currentDetail = '生产中'
|
||||
this.detailData = this.生产中全部数据.filter(item => item.期限状态 === status)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getStatistics() {
|
||||
this.loading = true
|
||||
|
||||
@@ -162,11 +221,11 @@ export default {
|
||||
// 获取待入库数据
|
||||
getPendingInStorage() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_补货件查询', param)
|
||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
let count = 0
|
||||
response.data.forEach(item => {
|
||||
if (item.状态 === '未到' || item.状态 === '加工中' || item.状态 === '部分到') {
|
||||
if (item.是否入库 === false) {
|
||||
count++
|
||||
}
|
||||
})
|
||||
@@ -187,7 +246,6 @@ export default {
|
||||
param2[0] = ['领料单流水号列表', this.领料单流水号列表]
|
||||
var Data2 = this.CreateData('11', '装配管理_领料单明细_查询_汇总', param2)
|
||||
this.ExecDatabase(Data2).then(response2 => {
|
||||
// 计算物料种类数量
|
||||
let count = 0
|
||||
response2.data.forEach(item => {
|
||||
if (item.已领数 < item.申请数) {
|
||||
@@ -195,6 +253,8 @@ export default {
|
||||
}
|
||||
})
|
||||
this.statistics.待出库 = count
|
||||
var uniqueOrders = new Set(response2.data.map(item => item.领料单号))
|
||||
this.领料单数 = uniqueOrders.size
|
||||
})
|
||||
} else {
|
||||
this.statistics.待出库 = 0
|
||||
@@ -265,28 +325,40 @@ export default {
|
||||
// 获取生产中数据
|
||||
getInProduction() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_补货件查询', param)
|
||||
var Data = this.CreateData('11', '仓储管理_生产订单_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
let count = 0
|
||||
let normalCount = 0
|
||||
let nearExpiryCount = 0
|
||||
let expiredCount = 0
|
||||
response.data.forEach(item => {
|
||||
if (item.状态 === '加工中') {
|
||||
count++
|
||||
const status = this.calculateDeadlineStatus(item)
|
||||
if (status === '超期') {
|
||||
expiredCount++
|
||||
} else if (status === '临期') {
|
||||
nearExpiryCount++
|
||||
} else {
|
||||
normalCount++
|
||||
}
|
||||
}
|
||||
})
|
||||
this.statistics.生产中 = count
|
||||
this.生产中统计.正常 = normalCount
|
||||
this.生产中统计.临期 = nearExpiryCount
|
||||
this.生产中统计.超期 = expiredCount
|
||||
})
|
||||
},
|
||||
|
||||
// 获取待投产数据
|
||||
getPendingProduction() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_补货件查询', param)
|
||||
var Data = this.CreateData('11', '仓储管理_待投产_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
let count = 0
|
||||
response.data.forEach(item => {
|
||||
if (item.状态 === '未开始') {
|
||||
count++
|
||||
}
|
||||
})
|
||||
this.statistics.待投产 = count
|
||||
})
|
||||
@@ -311,6 +383,7 @@ export default {
|
||||
showDetail(type) {
|
||||
this.currentDetail = type
|
||||
this.loading = true
|
||||
this.生产中期限筛选 = null
|
||||
|
||||
switch (type) {
|
||||
case '待入库':
|
||||
@@ -331,7 +404,7 @@ export default {
|
||||
case '生产中':
|
||||
this.getInProductionDetail()
|
||||
break
|
||||
case '待投产':
|
||||
case '待补货':
|
||||
this.getPendingProductionDetail()
|
||||
break
|
||||
case '采购中':
|
||||
@@ -343,15 +416,14 @@ export default {
|
||||
// 获取待入库详情
|
||||
getPendingInStorageDetail() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_补货件查询', param)
|
||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.detailData = response.data.filter(item => item.状态 === '未到' || item.状态 === '加工中' || item.状态 === '部分到')
|
||||
this.detailData = response.data.filter(item => item.是否入库 === false)
|
||||
this.detailColumns = [
|
||||
{ prop: '补货单号', label: '补货单号', width: '150px', align: 'center' },
|
||||
{ prop: '补货人', label: '补货人', width: '100px', align: 'center' },
|
||||
{ prop: '状态', label: '状态', width: '120px', align: 'center' },
|
||||
{ prop: '补货日期', label: '补货日期', width: '150px', align: 'center' },
|
||||
{ prop: '补货期限', label: '补货期限', width: '180px', align: 'center' }
|
||||
{ prop: '入库单号', label: '入库单号', width: '150px', align: 'center' },
|
||||
{ prop: '采购合同号', label: '采购合同号', width: '100px', align: 'center' },
|
||||
{ prop: '供应商名称', label: '供应商', width: '120px', align: 'center' },
|
||||
{ prop: '到货数', label: '数量', width: '150px', align: 'center' }
|
||||
]
|
||||
this.loading = false
|
||||
})
|
||||
@@ -436,16 +508,36 @@ export default {
|
||||
// 获取生产中详情
|
||||
getInProductionDetail() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_补货件查询', param)
|
||||
var Data = this.CreateData('11', '仓储管理_生产订单_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.detailData = response.data.filter(item => item.状态 === '加工中')
|
||||
var filtered = response.data.filter(item => item.状态 === '加工中')
|
||||
filtered.forEach(item => {
|
||||
item.期限状态 = this.calculateDeadlineStatus(item)
|
||||
item.超期时间 = this.calculateOverdueDays(item)
|
||||
})
|
||||
filtered.sort((a, b) => {
|
||||
if (a.期限状态 === '超期' && b.期限状态 !== '超期') return -1
|
||||
if (a.期限状态 !== '超期' && b.期限状态 === '超期') return 1
|
||||
if (a.期限状态 === '超期' && b.期限状态 === '超期') {
|
||||
return (b.超期时间 || 0) - (a.超期时间 || 0)
|
||||
}
|
||||
return new Date(a.补货期限) - new Date(b.补货期限)
|
||||
})
|
||||
this.生产中全部数据 = filtered
|
||||
if (this.生产中期限筛选) {
|
||||
this.detailData = filtered.filter(item => item.期限状态 === this.生产中期限筛选)
|
||||
} else {
|
||||
this.detailData = filtered
|
||||
}
|
||||
this.detailColumns = [
|
||||
{ prop: '补货单号', label: '补货单号', width: '150px', align: 'center' },
|
||||
{ prop: '名称', label: '物料名称', width: '180px', align: 'center' },
|
||||
{ prop: '补货数', label: '补货数量', width: '100px', align: 'center' },
|
||||
{ prop: '状态', label: '状态', width: '100px', align: 'center' },
|
||||
{ prop: '补货日期', label: '补货日期', width: '150px', align: 'center' },
|
||||
{ prop: '补货期限', label: '补货期限', width: '150px', align: 'center' }
|
||||
{ prop: '补货期限', label: '补货期限', width: '150px', align: 'center' },
|
||||
{ prop: '期限状态', label: '期限状态', width: '100px', align: 'center' },
|
||||
{ prop: '超期时间', label: '超期时间(天)', width: '120px', align: 'center' }
|
||||
]
|
||||
this.loading = false
|
||||
})
|
||||
@@ -454,16 +546,14 @@ export default {
|
||||
// 获取待投产详情
|
||||
getPendingProductionDetail() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_补货件查询', param)
|
||||
var Data = this.CreateData('11', '仓储管理_待投产_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.detailData = response.data.filter(item => item.状态 === '未开始')
|
||||
this.detailData = response.data.slice(0, 1000)
|
||||
this.detailColumns = [
|
||||
{ prop: '补货单号', label: '补货单号', width: '150px', align: 'center' },
|
||||
{ prop: '名称', label: '物料名称', width: '180px', align: 'center' },
|
||||
{ prop: '补货数', label: '补货数量', width: '100px', align: 'center' },
|
||||
{ prop: '状态', label: '状态', width: '100px', align: 'center' },
|
||||
{ prop: '补货日期', label: '补货日期', width: '150px', align: 'center' },
|
||||
{ prop: '补货期限', label: '补货期限', width: '150px', align: 'center' }
|
||||
{ prop: '物料名称', label: '物料名称', width: '180px', align: 'center' },
|
||||
{ prop: '图号', label: '图号或型号', width: '150px', align: 'center' },
|
||||
{ prop: '库存数量', label: '库存数量', width: '100px', align: 'center' },
|
||||
{ prop: '应补数量', label: '应补数量', width: '100px', align: 'center' },
|
||||
]
|
||||
this.loading = false
|
||||
})
|
||||
@@ -495,11 +585,11 @@ export default {
|
||||
height: 120px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
text-align: center;
|
||||
padding: 10px 0;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.stat-card:hover {
|
||||
@@ -507,19 +597,73 @@ export default {
|
||||
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.stat-card-production {
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.stat-number {
|
||||
font-size: 24px;
|
||||
font-size: 36px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
margin-top: 10px;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
color: #909399;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.stat-sub-info {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
margin-top: 8px;
|
||||
color: #909399;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.stat-sub-labels {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.sub-normal {
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
.sub-warning {
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
.sub-danger {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.sub-normal.sub-active,
|
||||
.sub-warning.sub-active,
|
||||
.sub-danger.sub-active {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sub-normal,
|
||||
.sub-warning,
|
||||
.sub-danger {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: #f56c6c;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text-warning {
|
||||
color: #e6a23c;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.summary-card {
|
||||
@@ -546,7 +690,6 @@ export default {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* 为不同类型的卡片设置不同的颜色 */
|
||||
.stat-card:nth-child(1) .stat-number {
|
||||
color: #4caf50;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user