Files
FTC25009/pda/pages/warehouse/outbound/index.vue

303 lines
6.7 KiB
Vue

<template>
<view class="page-container">
<!-- 出库管理功能入口 -->
<view class="menu-section">
<view class="menu-card" @click="navigateTo('/pages/warehouse/outbound/confirm')">
<view class="card-left">
<view class="card-icon orange">
<uni-icons type="checkmarkempty" size="24" color="#fff"></uni-icons>
</view>
<view class="card-info">
<text class="card-title">出库确认</text>
<text class="card-desc">扫描托盘条码进行出库确认</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
<view class="menu-card" @click="navigateTo('/pages/warehouse/outbound/emptyTray')">
<view class="card-left">
<view class="card-icon blue">
<uni-icons type="paperplane" size="24" color="#fff"></uni-icons>
</view>
<view class="card-info">
<text class="card-title">空托盘出库</text>
<text class="card-desc">选择仓库和数量后生成出库作业</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
</view>
<!-- 待处理任务 -->
<view class="task-section">
<view class="section-header">
<text class="section-title">待处理任务</text>
<text class="section-more" @click="refreshTasks">刷新</text>
</view>
<view v-if="taskList.length === 0" class="empty-state">
<text class="empty-text">暂无待处理任务</text>
</view>
<view v-else>
<view class="task-card" v-for="(item, index) in taskList" :key="index"
@click="handleTask(item)">
<view class="task-header">
<text class="task-type" :class="item.typeClass">{{ item.typeName }}</text>
<text class="task-no">{{ item.taskNo }}</text>
</view>
<view class="task-body">
<view class="task-info-item">
<text class="info-label">物料编码</text>
<text class="info-value">{{ item.materialCode }}</text>
</view>
<view class="task-info-item">
<text class="info-label">物料名称</text>
<text class="info-value">{{ item.materialName }}</text>
</view>
<view class="task-info-item">
<text class="info-label">出库数量</text>
<text class="info-value">{{ item.quantity }}</text>
</view>
<view class="task-info-item">
<text class="info-label">出库口</text>
<text class="info-value">{{ item.portName }}</text>
</view>
</view>
<view class="task-footer">
<text class="task-time">{{ item.createTime }}</text>
<view class="task-status" :class="item.statusClass">{{ item.statusName }}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getOutboundTaskList } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskList: []
}
},
onLoad() {
this.loadTasks()
},
onShow() {
this.loadTasks()
},
methods: {
navigateTo(url) {
this.$tab.navigateTo(url)
},
loadTasks() {
getOutboundTaskList().then(res => {
this.taskList = res.data || []
}).catch(() => {
this.taskList = []
})
},
refreshTasks() {
this.loadTasks()
this.$modal.showToast('刷新成功')
},
handleTask(item) {
if (item.type === 'confirm') {
this.$tab.navigateTo('/pages/warehouse/outbound/confirm?taskNo=' + item.taskNo)
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.menu-section {
margin-bottom: 32rpx;
}
.menu-card {
background: #fff;
border-radius: 16rpx;
padding: 32rpx 28rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.card-left {
display: flex;
align-items: center;
flex: 1;
}
.card-icon {
width: 72rpx;
height: 72rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx;
}
.card-icon.orange {
background: linear-gradient(135deg, #fa8c16, #ffa940);
}
.card-icon.blue {
background: linear-gradient(135deg, #1890ff, #40a9ff);
}
.card-info {
display: flex;
flex-direction: column;
}
.card-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 8rpx;
}
.card-desc {
font-size: 24rpx;
color: #999;
}
.task-section {
margin-top: 16rpx;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.section-more {
font-size: 26rpx;
color: #1890ff;
}
.empty-state {
background: #fff;
border-radius: 16rpx;
padding: 80rpx 0;
display: flex;
align-items: center;
justify-content: center;
}
.empty-text {
font-size: 28rpx;
color: #ccc;
}
.task-card {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.task-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.task-type {
font-size: 28rpx;
font-weight: 500;
}
.task-type.confirm {
color: #fa8c16;
}
.task-no {
font-size: 24rpx;
color: #999;
}
.task-body {
margin-bottom: 16rpx;
}
.task-info-item {
display: flex;
justify-content: space-between;
padding: 10rpx 0;
}
.info-label {
font-size: 26rpx;
color: #999;
}
.info-value {
font-size: 26rpx;
color: #333;
}
.task-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 16rpx;
border-top: 1rpx solid #f0f0f0;
}
.task-time {
font-size: 22rpx;
color: #ccc;
}
.task-status {
font-size: 22rpx;
padding: 4rpx 16rpx;
border-radius: 8rpx;
}
.task-status.pending {
color: #fa8c16;
background: #fff7e6;
}
.task-status.processing {
color: #1890ff;
background: #e6f7ff;
}
.task-status.completed {
color: #52c41a;
background: #f6ffed;
}
</style>