316 lines
7.5 KiB
Vue
316 lines
7.5 KiB
Vue
<template>
|
|
<view class="page-container">
|
|
<!-- 入库管理功能入口 -->
|
|
<view class="menu-section">
|
|
<view class="menu-card" @click="navigateTo('/pages/warehouse/inbound/bindTray')">
|
|
<view class="card-left">
|
|
<view class="card-icon blue">
|
|
<uni-icons type="scan" 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/inbound/emptyTray')">
|
|
<view class="card-left">
|
|
<view class="card-icon cyan">
|
|
<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">{{ getInTypeName(item) }}</text>
|
|
<text class="task-no">{{ item.documentN || item.stockinId }}</text>
|
|
</view>
|
|
<view class="task-body">
|
|
<view class="task-info-item">
|
|
<text class="info-label">主单号</text>
|
|
<text class="info-value">{{ item.stockinId }}</text>
|
|
</view>
|
|
<view class="task-info-item">
|
|
<text class="info-label">仓库</text>
|
|
<text class="info-value">{{ item.warehouseName || item.warehouseId || '-' }}</text>
|
|
</view>
|
|
<view class="task-info-item">
|
|
<text class="info-label">供应商</text>
|
|
<text class="info-value">{{ item.supplierName || item.counterpart || '-' }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="task-footer">
|
|
<text class="task-time">{{ getDisplayDate(item) }}</text>
|
|
<view class="task-status" :class="item.statusClass">{{ item.statusName || getStatusName(item.status) }}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { getInboundStockinList } from '@/api/warehouse/inbound'
|
|
import UniIcons from "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
|
|
|
|
export default {
|
|
components: {UniIcons},
|
|
data() {
|
|
return {
|
|
taskList: []
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.loadTasks()
|
|
},
|
|
onShow() {
|
|
this.loadTasks()
|
|
},
|
|
methods: {
|
|
navigateTo(url) {
|
|
this.$tab.navigateTo(url)
|
|
},
|
|
loadTasks() {
|
|
getInboundStockinList().then(res => {
|
|
this.taskList = res.rows || []
|
|
}).catch(() => {
|
|
this.taskList = []
|
|
})
|
|
},
|
|
refreshTasks() {
|
|
this.loadTasks()
|
|
this.$modal.showToast('刷新成功')
|
|
},
|
|
getInTypeName(item) {
|
|
return item.typeName || item.inTypeName || '入库单'
|
|
},
|
|
getStatusName(status) {
|
|
var map = {
|
|
'1': '创建',
|
|
'2': '审核',
|
|
'3': '执行',
|
|
'4': '完成',
|
|
'5': '作废'
|
|
}
|
|
return map[String(status)] || '待处理'
|
|
},
|
|
getDisplayDate(item) {
|
|
return item.documentDat || item.createDate || item.createDat || '-'
|
|
},
|
|
handleTask(item) {
|
|
var params = []
|
|
if (item.stockinId) params.push('stockinId=' + encodeURIComponent(item.stockinId))
|
|
if (item.warehouseId) params.push('warehouseId=' + encodeURIComponent(item.warehouseId))
|
|
if (item.warehouseName) params.push('warehouseName=' + encodeURIComponent(item.warehouseName))
|
|
if (item.documentN) params.push('documentN=' + encodeURIComponent(item.documentN))
|
|
this.$tab.navigateTo('/pages/warehouse/inbound/bindTray' + (params.length ? '?' + params.join('&') : ''))
|
|
}
|
|
}
|
|
}
|
|
</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.blue {
|
|
background: linear-gradient(135deg, #1890ff, #40a9ff);
|
|
}
|
|
|
|
.card-icon.cyan {
|
|
background: linear-gradient(135deg, #13c2c2, #36cfc9);
|
|
}
|
|
|
|
.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;
|
|
color: #1890ff;
|
|
}
|
|
|
|
.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>
|