chore: 保存盘点开发前改动

This commit is contained in:
zgw
2026-06-25 17:42:39 +08:00
parent 1af5b3cbd3
commit 4b8bc03343
114 changed files with 10005 additions and 1392 deletions

View File

@@ -78,10 +78,10 @@ export function submitBindTrayAndAddInJob(data) {
})
}
// 提交补料入库
export function submitSupplyInbound(data) {
// 空托入库并立即生成入库作业
export function submitEmptyTrayInbound(data) {
return request({
url: '/wms/inbound/supply',
url: '/pda/emptyTrayInbound',
method: 'post',
data: data
})

View File

@@ -9,6 +9,27 @@ export function getOutboundTaskList(query) {
})
}
// 查询仓库空托按条码头分组的数量
export function getEmptyTrayOutboundTypes(warehouseId) {
return request({
url: '/pda/emptyTrayOutbound/count',
method: 'get',
params: { warehouseId }
})
}
// 兼容旧调用名
export const getEmptyTrayOutboundCount = getEmptyTrayOutboundTypes
// 生成空托出库作业并下发 WCS
export function submitEmptyTrayOutbound(data) {
return request({
url: '/pda/emptyTrayOutbound',
method: 'post',
data: data
})
}
// 获取出库任务详情
export function getOutboundDetail(query) {
return request({
@@ -27,11 +48,3 @@ export function confirmOutbound(data) {
})
}
// 提交出库异常确认
export function submitOutboundException(data) {
return request({
url: '/pda/outboundException',
method: 'post',
data: data
})
}

View File

@@ -0,0 +1,10 @@
import request from '@/utils/request'
// 扫描托盘码查询托盘绑定的库存物料
export function getTrayStock(trayCode) {
return request({
url: '/pda/trayStock',
method: 'get',
params: { trayCode }
})
}

View File

@@ -71,9 +71,9 @@
"navigationBarTitleText": "入库绑盘"
}
}, {
"path": "pages/warehouse/inbound/supply",
"path": "pages/warehouse/inbound/emptyTray",
"style": {
"navigationBarTitleText": "补料入库"
"navigationBarTitleText": "空托盘入库"
}
}, {
"path": "pages/warehouse/outbound/index",
@@ -86,9 +86,9 @@
"navigationBarTitleText": "出库确认"
}
}, {
"path": "pages/warehouse/outbound/exception",
"path": "pages/warehouse/outbound/emptyTray",
"style": {
"navigationBarTitleText": "出库异常确认"
"navigationBarTitleText": "空托盘出库"
}
}, {
"path": "pages/warehouse/inventory/index",
@@ -121,11 +121,6 @@
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home_.png",
"text": "首页"
}, {
"pagePath": "pages/work/index",
"iconPath": "static/images/tabbar/work.png",
"selectedIconPath": "static/images/tabbar/work_.png",
"text": "工作台"
}, {
"pagePath": "pages/mine/index",
"iconPath": "static/images/tabbar/mine.png",

View File

@@ -19,7 +19,7 @@
<uni-icons type="download" size="28" color="#fff"></uni-icons>
</view>
<text class="menu-label">入库管理</text>
<text class="menu-desc">入库绑盘 / 补料入库</text>
<text class="menu-desc">入库绑盘 / 空托盘入库</text>
</view>
<view class="menu-item" @click="navigateTo('/pages/warehouse/outbound/index')">
@@ -27,7 +27,7 @@
<uni-icons type="upload" size="28" color="#fff"></uni-icons>
</view>
<text class="menu-label">出库管理</text>
<text class="menu-desc">出库确认 / 异常确认</text>
<text class="menu-desc">出库确认 / 空托盘出库</text>
</view>
<view class="menu-item" @click="navigateTo('/pages/warehouse/inventory/index')">
@@ -56,17 +56,17 @@
<uni-icons type="scan" size="22" color="#1890ff"></uni-icons>
<text class="quick-label">入库绑盘</text>
</view>
<view class="quick-item" @click="navigateTo('/pages/warehouse/inbound/supply')">
<uni-icons type="plus" size="22" color="#52c41a"></uni-icons>
<text class="quick-label">补料入库</text>
<view class="quick-item" @click="navigateTo('/pages/warehouse/inbound/emptyTray')">
<uni-icons type="paperplane" size="22" color="#13c2c2"></uni-icons>
<text class="quick-label">空托入库</text>
</view>
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/confirm')">
<uni-icons type="checkmarkempty" size="22" color="#fa8c16"></uni-icons>
<text class="quick-label">出库确认</text>
</view>
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/exception')">
<uni-icons type="info" size="22" color="#f5222d"></uni-icons>
<text class="quick-label">出库异常</text>
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/emptyTray')">
<uni-icons type="paperplane" size="22" color="#1890ff"></uni-icons>
<text class="quick-label">空托出库</text>
</view>
</view>
</view>
@@ -97,10 +97,11 @@
}
.header {
background: linear-gradient(135deg, #1890ff, #096dd9);
background: #fff;
border-radius: 20rpx;
padding: 40rpx 36rpx;
margin-bottom: 32rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.header-info {
@@ -109,27 +110,28 @@
}
.logo {
width: 80rpx;
height: 80rpx;
border-radius: 16rpx;
flex-shrink: 0;
width: 220rpx;
height: 70rpx;
margin-right: 24rpx;
}
.header-text {
display: flex;
flex-direction: column;
min-width: 0;
}
.app-name {
font-size: 36rpx;
font-weight: 500;
color: #fff;
color: #1f2933;
margin-bottom: 8rpx;
}
.welcome-text {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
color: #6b7280;
}
.menu-section {

View File

@@ -1,9 +1,10 @@
<template>
<view class="normal-login-container">
<view class="logo-content align-center justify-center flex">
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
</image>
<text class="title">若依移动端登录</text>
<view class="login-logo-box">
<image class="login-logo" :src="globalConfig.appInfo.logo" mode="aspectFit">
</image>
</view>
</view>
<view class="login-form-content">
<view class="input-item flex align-center">
@@ -143,11 +144,21 @@
padding-top: 15%;
image {
border-radius: 4px;
border-radius: 12rpx;
}
.title {
margin-left: 10px;
.login-logo-box {
width: 300rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.login-logo {
width: 100%;
height: 100%;
}
}

View File

@@ -1,8 +1,10 @@
<template>
<view class="about-container">
<view class="header-section text-center">
<image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix">
</image>
<view class="about-logo-box">
<image class="about-logo" src="/static/logo200.png" mode="aspectFit">
</image>
</view>
<uni-title type="h2" title="若依移动端"></uni-title>
</view>
@@ -72,4 +74,18 @@
flex-direction: column;
align-items: center;
}
.about-logo-box {
width: 360rpx;
height: 114rpx;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.about-logo {
width: 100%;
height: 100%;
}
</style>

View File

@@ -18,19 +18,20 @@
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">入库点位</text>
<picker class="form-picker" mode="selector" :range="stationPointOptions" range-key="pointName"
:value="stationPointIndex" :disabled="bindSuccess || !warehouseId || !trayCode" @change="handleStationPointChange">
<view class="picker-value" :class="{ placeholder: !stationPointId }">
{{ selectedStationPointName || '请选择入库点位' }}
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请扫描托盘号" />
</view>
<view class="form-tip" v-if="!warehouseId || !trayCode">请先选择仓库和扫描托盘号</view>
<view class="form-item" v-else>
<text class="form-label">入库点位</text>
<picker class="form-picker" mode="selector" :range="stationPointOptions" range-key="pointName"
:value="stationPointIndex" :disabled="bindSuccess" @change="handleStationPointChange">
<view class="picker-value" :class="{ placeholder: !stationPointId }">
{{ selectedStationPointName || '请扫描入库点位' }}
</view>
</picker>
</view>
</view>
<!-- 绑盘状态提示 -->
@@ -551,18 +552,28 @@
return submitBindTrayAndAddInJob(data)
}).then(function(res) {
that.$modal.msgSuccess(res.msg || '绑盘并生成入库作业成功')
that.bindSuccess = true
that.resetBindPayload()
if (that.stockinId) {
that.loadDetailList()
}
that.barcode = ''
that.currentMaterial = null
that.currentRemainQty = 0
that.currentQty = ''
that.showQuantityPopup = false
}).catch(function() {})
},
resetBindPayload() {
this.stationPointId = ''
this.stationPointName = ''
this.stationPointIndex = 0
this.stationPointOptions = []
this.trayCode = ''
this.barcode = ''
this.currentMaterial = null
this.currentRemainQty = 0
this.currentQty = ''
this.showQuantityPopup = false
this.bindSuccess = false
this.items = []
},
// 全部重置
resetAll() {
this.stockinId = ''
@@ -697,6 +708,13 @@
padding: 16rpx 0;
}
.form-tip {
padding: 8rpx 0 16rpx 160rpx;
font-size: 24rpx;
color: #909399;
line-height: 1.4;
}
.form-label {
font-size: 28rpx;
color: #666;

View File

@@ -0,0 +1,298 @@
<template>
<view class="page-container">
<view class="form-section">
<text class="form-title">空托盘入库</text>
<view class="form-item">
<text class="form-label">仓库</text>
<picker class="form-picker" mode="selector" :range="warehouseOptions" range-key="warehouseName"
:value="warehouseIndex" @change="handleWarehouseChange">
<view class="picker-value" :class="{ placeholder: !warehouseId }">
{{ selectedWarehouseName || '请选择仓库' }}
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请扫描托盘号" />
</view>
<view class="form-tip" v-if="!warehouseId || !trayCode">请先选择仓库和扫描托盘号</view>
<template v-else>
<view class="form-item">
<text class="form-label">入库点位</text>
<picker class="form-picker" mode="selector" :range="stationPointOptions" range-key="pointName"
:value="stationPointIndex" @change="handleStationPointChange">
<view class="picker-value" :class="{ placeholder: !stationPointId }">
{{ selectedStationPointName || '请选择入库点位' }}
</view>
</picker>
</view>
</template>
</view>
<view class="summary-section">
<view class="summary-row">
<text class="summary-label">作业类型</text>
<text class="summary-value">空容器入库</text>
</view>
<view class="summary-row">
<text class="summary-label">绑定物料</text>
<text class="summary-value muted">无需绑定</text>
</view>
</view>
<view class="btn-section">
<button class="btn btn-primary" :disabled="!canSubmit || submitting" @click="submitEmptyTray">
{{ submitting ? '提交中...' : '确认生成空托入库作业' }}
</button>
<button class="btn btn-default" @click="resetPayload">重置</button>
</view>
</view>
</template>
<script>
import { getInboundStationPointOptions, getWarehouseOptions, submitEmptyTrayInbound } from '@/api/warehouse/inbound'
export default {
data() {
return {
warehouseOptions: [],
warehouseIndex: 0,
warehouseId: '',
warehouseName: '',
trayCode: '',
stationPointOptions: [],
stationPointIndex: 0,
stationPointId: '',
stationPointName: '',
submitting: false
}
},
computed: {
selectedWarehouseName() {
if (this.warehouseName) return this.warehouseName
var selected = this.warehouseOptions[this.warehouseIndex]
return selected && selected.warehouseId === this.warehouseId ? selected.warehouseName : ''
},
selectedStationPointName() {
if (this.stationPointName) return this.stationPointName
var selected = this.stationPointOptions[this.stationPointIndex]
return selected && selected.pointId === this.stationPointId ? (selected.pointName || selected.pointId) : ''
},
canSubmit() {
return !!(this.warehouseId && this.trayCode && this.stationPointId)
}
},
watch: {
trayCode: function() {
this.resetStationPoint()
this.loadStationPointOptions()
}
},
onLoad() {
this.loadWarehouseOptions()
},
methods: {
loadWarehouseOptions() {
var that = this
getWarehouseOptions().then(function(res) {
that.warehouseOptions = res.data || res.rows || []
}).catch(function() {
that.warehouseOptions = []
})
},
handleWarehouseChange(e) {
var index = Number(e.detail.value)
var selected = this.warehouseOptions[index]
if (!selected) return
this.warehouseIndex = index
this.warehouseId = selected.warehouseId
this.warehouseName = selected.warehouseName
this.resetStationPoint()
this.loadStationPointOptions()
},
loadStationPointOptions() {
var that = this
if (!this.warehouseId || !this.trayCode) {
this.stationPointOptions = []
return
}
getInboundStationPointOptions(this.warehouseId, this.trayCode).then(function(res) {
that.stationPointOptions = res.data || res.rows || []
if (that.stationPointOptions.length === 1) {
that.stationPointIndex = 0
that.stationPointId = that.stationPointOptions[0].pointId
that.stationPointName = that.stationPointOptions[0].pointName || that.stationPointOptions[0].pointId
}
}).catch(function() {
that.resetStationPoint()
that.stationPointOptions = []
})
},
handleStationPointChange(e) {
var index = Number(e.detail.value)
var selected = this.stationPointOptions[index]
if (!selected) return
this.stationPointIndex = index
this.stationPointId = selected.pointId
this.stationPointName = selected.pointName || selected.pointId
},
resetStationPoint() {
this.stationPointIndex = 0
this.stationPointId = ''
this.stationPointName = ''
this.stationPointOptions = []
},
submitEmptyTray() {
if (!this.canSubmit) {
this.$modal.msg('请补全仓库、托盘号和入库点位')
return
}
var data = {
warehouseId: this.warehouseId,
trayCode: this.trayCode,
stationPointId: this.stationPointId
}
var that = this
this.$modal.confirm('是否确认生成空托入库作业?').then(function() {
that.submitting = true
return submitEmptyTrayInbound(data)
}).then(function(res) {
that.$modal.msgSuccess(res.msg || '空托入库作业生成成功')
that.resetPayload()
}).catch(function() {}).finally(function() {
that.submitting = false
})
},
resetPayload() {
this.trayCode = ''
this.stationPointOptions = []
this.resetStationPoint()
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
padding-bottom: 60rpx;
}
.form-section,
.summary-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
display: block;
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
width: 160rpx;
flex-shrink: 0;
font-size: 28rpx;
color: #666;
}
.form-input,
.form-picker {
flex: 1;
width: 0;
min-width: 0;
box-sizing: border-box;
}
.form-input,
.picker-value {
width: 100%;
min-height: 72rpx;
padding: 16rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
background: #fff;
font-size: 28rpx;
color: #333;
box-sizing: border-box;
}
.picker-value.placeholder {
color: #c0c4cc;
}
.form-tip {
padding: 8rpx 0 16rpx 160rpx;
font-size: 24rpx;
color: #909399;
line-height: 1.4;
}
.summary-row {
display: flex;
justify-content: space-between;
padding: 12rpx 0;
}
.summary-label {
font-size: 26rpx;
color: #999;
}
.summary-value {
font-size: 26rpx;
color: #333;
}
.summary-value.muted {
color: #52c41a;
}
.btn-section {
padding: 8rpx 0 24rpx;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-primary {
background: #1890ff;
color: #fff;
}
.btn-primary[disabled] {
background: #b0d4f5;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -15,14 +15,14 @@
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
<view class="menu-card" @click="navigateTo('/pages/warehouse/inbound/supply')">
<view class="menu-card" @click="navigateTo('/pages/warehouse/inbound/emptyTray')">
<view class="card-left">
<view class="card-icon green">
<uni-icons type="plus" size="24" color="#fff"></uni-icons>
<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>
<text class="card-title">空托盘入库</text>
<text class="card-desc">选择仓库、扫描托盘并选择入库点位</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
@@ -118,10 +118,6 @@
return item.documentDat || item.createDate || item.createDat || '-'
},
handleTask(item) {
if (item.type === 'supply') {
this.$tab.navigateTo('/pages/warehouse/inbound/supply?taskNo=' + (item.taskNo || ''))
return
}
var params = []
if (item.stockinId) params.push('stockinId=' + encodeURIComponent(item.stockinId))
if (item.warehouseId) params.push('warehouseId=' + encodeURIComponent(item.warehouseId))
@@ -178,8 +174,8 @@
background: linear-gradient(135deg, #1890ff, #40a9ff);
}
.card-icon.green {
background: linear-gradient(135deg, #52c41a, #73d13d);
.card-icon.cyan {
background: linear-gradient(135deg, #13c2c2, #36cfc9);
}
.card-info {

View File

@@ -1,318 +0,0 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">任务编号</text>
<text class="task-value">{{ taskNo }}</text>
</view>
<!-- 扫码区域 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描物料条码</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#52c41a"></uni-icons>
<text class="scan-btn-text green">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描物料条码"
@confirm="handleBarcode" focus />
</view>
</view>
<!-- 补料信息 -->
<view class="form-section">
<text class="form-title">补料信息</text>
<view class="form-item">
<text class="form-label">产线</text>
<input class="form-input" v-model="form.lineCode" placeholder="请输入产线编码" />
</view>
<view class="form-item">
<text class="form-label">工位</text>
<input class="form-input" v-model="form.stationCode" placeholder="请输入工位编码" />
</view>
<view class="form-item">
<text class="form-label">补料数量</text>
<input class="form-input" v-model="form.quantity" type="number" placeholder="请输入补料数量" />
</view>
<view class="form-item">
<text class="form-label">补料原因</text>
<input class="form-input" v-model="form.reason" placeholder="请输入补料原因" />
</view>
</view>
<!-- 物料信息 -->
<view class="form-section" v-if="materialInfo">
<text class="form-title">物料信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ materialInfo.materialCode }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ materialInfo.materialName }}</text>
</view>
<view class="info-row">
<text class="info-label">规格型号</text>
<text class="info-value">{{ materialInfo.spec }}</text>
</view>
<view class="info-row">
<text class="info-label">当前库存</text>
<text class="info-value">{{ materialInfo.stock }}</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-success" @click="submitSupply">确认补料入库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getMaterialByBarcode, submitSupplyInbound } from '@/api/warehouse/inbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
materialInfo: null,
form: {
lineCode: '',
stationCode: '',
quantity: '',
reason: ''
}
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
var that = this
getMaterialByBarcode(this.barcode).then(function(res) {
that.materialInfo = res.data
that.$modal.msgSuccess('物料信息获取成功')
}).catch(function() {
that.materialInfo = null
})
},
submitSupply() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
if (!this.form.lineCode) {
this.$modal.msg('请输入产线编码')
return
}
if (!this.form.quantity) {
this.$modal.msg('请输入补料数量')
return
}
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
lineCode: this.form.lineCode,
stationCode: this.form.stationCode,
quantity: this.form.quantity,
reason: this.form.reason
}
var that = this
submitSupplyInbound(data).then(function() {
that.$modal.msgSuccess('补料入库成功')
that.resetForm()
})
},
resetForm() {
this.barcode = ''
this.materialInfo = null
this.form = {
lineCode: '',
stationCode: '',
quantity: '',
reason: ''
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #f6ffed;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #52c41a;
}
.task-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.scan-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.scan-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.scan-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.scan-btn {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #52c41a;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
color: #1890ff;
margin-left: 8rpx;
}
.scan-btn-text.green {
color: #52c41a;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
}
.form-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.form-input {
flex: 1;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-success {
background: #52c41a;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -1,46 +1,39 @@
<template>
<view class="page-container">
<view class="module-header">
<uni-icons type="search" size="22" color="#52c41a"></uni-icons>
<text class="header-title">盘点管理</text>
</view>
<view class="feature-list">
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="list" size="20" color="#1890ff"></uni-icons>
<text class="feature-name">盘点任务列表</text>
<view class="menu-section">
<view class="menu-card" @click="scanInventory">
<view class="card-left">
<view class="card-icon green">
<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="16" color="#ccc"></uni-icons>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="scan" size="20" color="#fa8c16"></uni-icons>
<text class="feature-name">扫码盘点</text>
<view class="menu-card reserve-card" @click="showReservedTip">
<view class="card-left">
<view class="card-icon gray">
<uni-icons type="compose" 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="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="compose" size="20" color="#52c41a"></uni-icons>
<text class="feature-name">盘点差异记录</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="paperplane" size="20" color="#722ed1"></uni-icons>
<text class="feature-name">盘点报告</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
<uni-icons type="right" size="18" color="#ddd"></uni-icons>
</view>
</view>
<view class="empty-tip">
<text class="tip-text">盘点管理模块正在开发中,敬请期待</text>
<view v-if="scanCode" class="result-card">
<view class="result-header">
<text class="result-title">最近扫描</text>
<text class="result-code">{{ scanCode }}</text>
</view>
<text class="result-desc">扫码盘点明细待业务流程确认后接入。</text>
</view>
</view>
</template>
@@ -48,7 +41,22 @@
<script>
export default {
data() {
return {}
return {
scanCode: ''
}
},
methods: {
scanInventory() {
uni.scanCode({
success: res => {
this.scanCode = res.result || ''
this.$modal.showToast('扫码成功')
}
})
},
showReservedTip() {
this.$modal.showToast('功能预留')
}
}
}
</script>
@@ -63,57 +71,93 @@
padding: 24rpx;
}
.module-header {
display: flex;
align-items: center;
padding: 24rpx 0;
margin-bottom: 20rpx;
.menu-section {
margin-bottom: 32rpx;
}
.header-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-left: 12rpx;
}
.feature-list {
.menu-card {
background: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.feature-card {
padding: 32rpx 28rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 28rpx;
border-bottom: 1rpx solid #f5f5f5;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.feature-card:last-child {
border-bottom: none;
.reserve-card {
opacity: 0.88;
}
.feature-left {
.card-left {
display: flex;
align-items: center;
flex: 1;
}
.feature-name {
font-size: 28rpx;
.card-icon {
width: 72rpx;
height: 72rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx;
}
.card-icon.green {
background: linear-gradient(135deg, #52c41a, #73d13d);
}
.card-icon.gray {
background: linear-gradient(135deg, #8c8c8c, #bfbfbf);
}
.card-info {
display: flex;
flex-direction: column;
}
.card-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-left: 16rpx;
margin-bottom: 8rpx;
}
.empty-tip {
padding: 60rpx 0;
text-align: center;
.card-desc {
font-size: 24rpx;
color: #999;
}
.tip-text {
.result-card {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.result-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 14rpx;
}
.result-title {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.result-code {
font-size: 26rpx;
color: #ccc;
color: #52c41a;
}
.result-desc {
font-size: 24rpx;
color: #999;
}
</style>

View File

@@ -9,14 +9,14 @@
<!-- 扫码区域 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描出库物料条码</text>
<text class="scan-title">扫描托盘条码</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#fa8c16"></uni-icons>
<text class="scan-btn-text orange">扫码</text>
<uni-icons type="scan" size="18" color="#1890ff"></uni-icons>
<text class="scan-btn-text">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描物料条码"
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描托盘条码"
@confirm="handleBarcode" focus />
</view>
</view>
@@ -24,18 +24,6 @@
<!-- 出库信息 -->
<view class="form-section" v-if="outboundInfo">
<text class="form-title">出库信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ outboundInfo.materialCode }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ outboundInfo.materialName }}</text>
</view>
<view class="info-row">
<text class="info-label">规格型号</text>
<text class="info-value">{{ outboundInfo.spec }}</text>
</view>
<view class="info-row">
<text class="info-label">托盘号</text>
<text class="info-value">{{ outboundInfo.trayCode }}</text>
@@ -54,12 +42,34 @@
</view>
</view>
<!-- 托盘物料信息 -->
<view class="form-section" v-if="outboundInfo">
<text class="form-title">托盘物料信息</text>
<view class="material-card" v-for="(item, index) in outboundInfo.materials" :key="item.jobDetailId || index">
<view class="material-header">
<text class="material-code">{{ item.materialCode }}</text>
<text class="material-qty">出库 {{ item.quantity }}</text>
</view>
<view class="material-name">{{ item.materialName }}</view>
<view class="material-meta">
<text>批次:{{ item.lotNo || '-' }}</text>
<text>库存:{{ item.stockQuantity || 0 }}</text>
<text>剩余:{{ item.residualQuantity || 0 }}</text>
</view>
<view class="material-confirm">
<text class="material-confirm-label">实际出库</text>
<input class="material-input" v-model="item.actualQuantity" type="number"
:placeholder="'计划 ' + item.quantity" />
</view>
</view>
</view>
<!-- 确认信息 -->
<view class="form-section" v-if="outboundInfo">
<text class="form-title">确认信息</text>
<view class="form-item">
<text class="form-label">实际数量</text>
<input class="form-input" v-model="confirmQty" type="number" :placeholder="'出库数量: ' + outboundInfo.quantity" />
<text class="form-label">实际总数</text>
<text class="info-value highlight">{{ calculateConfirmQty() }}</text>
</view>
<view class="form-item">
<text class="form-label">备注</text>
@@ -69,7 +79,7 @@
<!-- 操作按钮 -->
<view class="btn-section" v-if="outboundInfo">
<button class="btn btn-orange" @click="confirmOutbound">确认出库</button>
<button class="btn btn-primary" @click="confirmOutbound">确认出库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
@@ -109,28 +119,50 @@
},
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
this.$modal.msg('请输入托盘条码')
return
}
var that = this
var params = { taskNo: this.taskNo, barcode: this.barcode }
getOutboundDetail(params).then(function(res) {
that.outboundInfo = res.data
that.confirmQty = String(res.data.quantity)
var data = res.data || {}
var materials = (data.materials || []).map(function(item) {
return Object.assign({}, item, {
actualQuantity: String(item.quantity || '')
})
})
that.outboundInfo = Object.assign({}, data, { materials: materials })
that.confirmQty = that.calculateConfirmQty()
that.$modal.msgSuccess('出库信息获取成功')
}).catch(function() {
that.outboundInfo = null
})
},
confirmOutbound() {
if (!this.confirmQty) {
this.$modal.msg('请输入实际数量')
if (!this.outboundInfo || !this.outboundInfo.materials || this.outboundInfo.materials.length === 0) {
this.$modal.msg('未获取到出库物料明细')
return
}
var missing = this.outboundInfo.materials.find(function(item) {
return !item.actualQuantity || Number(item.actualQuantity) <= 0
})
if (missing) {
this.$modal.msg('请输入每个物料的实际出库数量')
return
}
this.confirmQty = this.calculateConfirmQty()
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
trayCode: this.barcode,
quantity: this.confirmQty,
materials: this.outboundInfo.materials.map(function(item) {
return {
jobDetailId: item.jobDetailId,
stockDetailId: item.stockDetailId,
quantity: item.actualQuantity
}
}),
remark: this.form.remark
}
var that = this
@@ -146,6 +178,15 @@
this.form = {
remark: ''
}
},
calculateConfirmQty() {
if (!this.outboundInfo || !this.outboundInfo.materials) {
return ''
}
var total = this.outboundInfo.materials.reduce(function(sum, item) {
return sum + Number(item.actualQuantity || 0)
}, 0)
return String(total)
}
}
}
@@ -159,10 +200,11 @@
.page-container {
padding: 24rpx;
padding-bottom: 60rpx;
}
.task-info {
background: #fff7e6;
background: #e6f7ff;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
@@ -173,7 +215,7 @@
.task-label {
font-size: 26rpx;
color: #fa8c16;
color: #1890ff;
}
.task-value {
@@ -207,19 +249,16 @@
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #fa8c16;
border: 1rpx solid #1890ff;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
color: #1890ff;
margin-left: 8rpx;
}
.scan-btn-text.orange {
color: #fa8c16;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
@@ -227,8 +266,14 @@
}
.scan-input {
width: 100%;
font-size: 28rpx;
padding: 16rpx;
word-break: break-all;
min-width: 0;
height: auto;
line-height: 1.4;
box-sizing: border-box;
}
.form-section {
@@ -240,6 +285,7 @@
}
.form-title {
display: block;
font-size: 30rpx;
font-weight: 500;
color: #333;
@@ -263,10 +309,16 @@
.form-input {
flex: 1;
width: 0;
min-width: 0;
box-sizing: border-box;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
word-break: break-all;
height: auto;
line-height: 1.4;
}
.info-row {
@@ -287,12 +339,79 @@
}
.info-value.highlight {
color: #fa8c16;
color: #1890ff;
font-weight: 500;
}
.material-card {
padding: 18rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.material-card:last-child {
border-bottom: 0;
}
.material-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10rpx;
}
.material-code {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
.material-qty {
font-size: 26rpx;
color: #1890ff;
font-weight: 500;
}
.material-name {
font-size: 26rpx;
color: #666;
margin-bottom: 10rpx;
}
.material-meta {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
font-size: 24rpx;
color: #999;
}
.material-confirm {
display: flex;
align-items: center;
margin-top: 16rpx;
}
.material-confirm-label {
width: 140rpx;
font-size: 26rpx;
color: #666;
}
.material-input {
flex: 1;
width: 0;
min-width: 0;
box-sizing: border-box;
font-size: 26rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 12rpx 16rpx;
height: auto;
line-height: 1.4;
}
.btn-section {
padding: 24rpx 0;
padding: 8rpx 0 24rpx;
}
.btn {
@@ -301,8 +420,8 @@
margin-bottom: 20rpx;
}
.btn-orange {
background: #fa8c16;
.btn-primary {
background: #1890ff;
color: #fff;
}

View File

@@ -0,0 +1,416 @@
<template>
<view class="page-container">
<view class="form-section">
<text class="form-title">空托盘出库</text>
<view class="form-item">
<text class="form-label">仓库</text>
<picker class="form-picker" mode="selector" :range="warehouseOptions" range-key="warehouseName"
:value="warehouseIndex" @change="handleWarehouseChange">
<view class="picker-value" :class="{ placeholder: !warehouseId }">
{{ selectedWarehouseName || '请选择仓库' }}
</view>
</picker>
</view>
<view class="type-section" v-if="warehouseId">
<view class="type-header">
<text class="type-title">库内空托盘类型</text>
<text class="type-total">合计 {{ totalEmptyTrayCount }}</text>
</view>
<view class="type-empty" v-if="emptyTrayTypes.length === 0">
<text class="empty-text">当前仓库暂无可出库空托盘</text>
</view>
<view
class="type-card"
:class="{ active: selectedTrayType && selectedTrayType.barcodePrefix === item.barcodePrefix }"
v-for="(item, index) in emptyTrayTypes"
:key="item.barcodePrefix || index"
@click="selectTrayType(index)"
>
<view class="type-main">
<text class="type-name">{{ item.formatName || '托盘条码' }}</text>
<text class="type-prefix">{{ item.barcodePrefix }}</text>
</view>
<view class="type-count">
<text class="type-count-value">{{ item.quantity }}</text>
<text class="type-count-unit">个</text>
</view>
</view>
</view>
<view class="form-item">
<text class="form-label">出库数量</text>
<input class="form-input" v-model="quantity" type="number" placeholder="请输入出库数量" />
</view>
</view>
<view class="summary-section">
<view class="summary-row">
<text class="summary-label">作业类型</text>
<text class="summary-value">空容器出库</text>
</view>
<view class="summary-row">
<text class="summary-label">托盘类型</text>
<text class="summary-value">{{ selectedTrayTypeName || '未选择' }}</text>
</view>
<view class="summary-row">
<text class="summary-label">下发方式</text>
<text class="summary-value muted">生成后自动下发 WCS</text>
</view>
</view>
<view class="btn-section">
<button class="btn btn-primary" :disabled="!canSubmit || submitting" @click="submitEmptyTray">
{{ submitting ? '提交中...' : '生成空托出库作业' }}
</button>
<button class="btn btn-default" @click="resetQuantity">重置数量</button>
</view>
</view>
</template>
<script>
import { getWarehouseOptions } from '@/api/warehouse/inbound'
import { getEmptyTrayOutboundTypes, submitEmptyTrayOutbound } from '@/api/warehouse/outbound'
export default {
data() {
return {
warehouseOptions: [],
warehouseIndex: 0,
warehouseId: '',
warehouseName: '',
emptyTrayTypes: [],
trayTypeIndex: -1,
quantity: '',
submitting: false
}
},
computed: {
selectedWarehouseName() {
if (this.warehouseName) return this.warehouseName
var selected = this.warehouseOptions[this.warehouseIndex]
return selected && selected.warehouseId === this.warehouseId ? selected.warehouseName : ''
},
selectedTrayType() {
if (this.trayTypeIndex < 0) return null
return this.emptyTrayTypes[this.trayTypeIndex] || null
},
selectedTrayTypeName() {
var type = this.selectedTrayType
if (!type) return ''
return (type.formatName || '托盘条码') + '(' + type.barcodePrefix + ')'
},
selectedAvailableCount() {
var type = this.selectedTrayType
return type ? Number(type.quantity || 0) : 0
},
totalEmptyTrayCount() {
return this.emptyTrayTypes.reduce(function(total, item) {
return total + (Number(item.quantity) || 0)
}, 0)
},
canSubmit() {
var qty = Number(this.quantity)
return !!this.warehouseId && !!this.selectedTrayType && qty > 0 && qty <= this.selectedAvailableCount
}
},
onLoad() {
this.loadWarehouseOptions()
},
methods: {
loadWarehouseOptions() {
var that = this
getWarehouseOptions().then(function(res) {
that.warehouseOptions = res.data || res.rows || []
}).catch(function() {
that.warehouseOptions = []
})
},
handleWarehouseChange(e) {
var index = Number(e.detail.value)
var selected = this.warehouseOptions[index]
if (!selected) return
this.warehouseIndex = index
this.warehouseId = selected.warehouseId
this.warehouseName = selected.warehouseName
this.quantity = ''
this.resetTrayType()
this.loadEmptyTrayCount()
},
loadEmptyTrayCount() {
var that = this
if (!this.warehouseId) {
this.emptyTrayTypes = []
this.resetTrayType()
return
}
getEmptyTrayOutboundTypes(this.warehouseId).then(function(res) {
var list = Array.isArray(res.data) ? res.data : []
that.emptyTrayTypes = list.map(function(item) {
return {
formatId: item.formatId,
formatName: item.formatName,
barcodePrefix: item.barcodePrefix,
quantity: Number(item.quantity || 0)
}
})
that.resetTrayType()
if (that.emptyTrayTypes.length === 1) {
that.selectTrayType(0)
}
}).catch(function() {
that.emptyTrayTypes = []
that.resetTrayType()
})
},
selectTrayType(index) {
var selected = this.emptyTrayTypes[index]
if (!selected) return
this.trayTypeIndex = index
this.quantity = ''
},
resetTrayType() {
this.trayTypeIndex = -1
},
submitEmptyTray() {
var qty = Number(this.quantity)
if (!this.warehouseId) {
this.$modal.msg('请选择仓库')
return
}
if (!this.selectedTrayType) {
this.$modal.msg('请选择空托盘类型')
return
}
if (!qty || qty <= 0) {
this.$modal.msg('请输入有效的出库数量')
return
}
if (qty > this.selectedAvailableCount) {
this.$modal.msg('出库数量不能大于当前类型空托盘数量')
return
}
var that = this
var data = {
warehouseId: this.warehouseId,
barcodePrefix: this.selectedTrayType.barcodePrefix,
quantity: qty
}
this.$modal.confirm('是否确认生成空托出库作业并下发 WCS?').then(function() {
that.submitting = true
return submitEmptyTrayOutbound(data)
}).then(function(res) {
that.$modal.msgSuccess(res.msg || '空托出库作业生成成功')
that.quantity = ''
that.loadEmptyTrayCount()
}).catch(function() {}).finally(function() {
that.submitting = false
})
},
resetQuantity() {
this.quantity = ''
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
padding-bottom: 60rpx;
}
.form-section,
.summary-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
display: block;
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
width: 160rpx;
flex-shrink: 0;
font-size: 28rpx;
color: #666;
}
.form-input,
.form-picker {
flex: 1;
width: 0;
min-width: 0;
box-sizing: border-box;
}
.form-input,
.picker-value {
width: 100%;
min-height: 72rpx;
padding: 16rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
background: #fff;
font-size: 28rpx;
color: #333;
box-sizing: border-box;
}
.picker-value.placeholder {
color: #c0c4cc;
}
.type-section {
margin: 18rpx 0;
}
.type-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 14rpx;
}
.type-title {
font-size: 26rpx;
color: #666;
}
.type-total {
font-size: 26rpx;
color: #1890ff;
}
.type-empty {
padding: 30rpx 0;
border: 1rpx dashed #d9d9d9;
border-radius: 12rpx;
display: flex;
justify-content: center;
}
.empty-text {
font-size: 26rpx;
color: #999;
}
.type-card {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 22rpx;
margin-bottom: 16rpx;
border: 1rpx solid #e8e8e8;
border-radius: 12rpx;
background: #fff;
}
.type-card.active {
border-color: #1890ff;
background: #e6f7ff;
}
.type-main {
flex: 1;
min-width: 0;
}
.type-name {
display: block;
font-size: 28rpx;
color: #333;
margin-bottom: 8rpx;
}
.type-prefix {
font-size: 24rpx;
color: #1890ff;
}
.type-count {
display: flex;
align-items: baseline;
margin-left: 20rpx;
}
.type-count-value {
font-size: 40rpx;
font-weight: 600;
color: #096dd9;
}
.type-count-unit {
margin-left: 4rpx;
font-size: 24rpx;
color: #666;
}
.summary-row {
display: flex;
justify-content: space-between;
padding: 12rpx 0;
}
.summary-label {
font-size: 26rpx;
color: #999;
}
.summary-value {
font-size: 26rpx;
color: #333;
}
.summary-value.muted {
color: #52c41a;
}
.btn-section {
padding: 8rpx 0 24rpx;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-primary {
background: #1890ff;
color: #fff;
}
.btn-primary[disabled] {
background: #b0d4f5;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -1,411 +0,0 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">异常任务编号</text>
<text class="task-value">{{ taskNo }}</text>
</view>
<!-- 扫码区域 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描异常物料条码</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#f5222d"></uni-icons>
<text class="scan-btn-text red">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描物料条码"
@confirm="handleBarcode" focus />
</view>
</view>
<!-- 异常信息填写 -->
<view class="form-section">
<text class="form-title">异常信息</text>
<view class="form-item">
<text class="form-label">异常类型</text>
<picker mode="selector" :range="exceptionTypes" range-key="label" @change="onTypeChange">
<view class="picker-value">{{ selectedType ? selectedType.label : '请选择异常类型' }}</view>
</picker>
<uni-icons type="bottom" size="16" color="#ccc"></uni-icons>
</view>
<view class="form-item">
<text class="form-label">处理方式</text>
<picker mode="selector" :range="handleMethods" range-key="label" @change="onMethodChange">
<view class="picker-value">{{ selectedMethod ? selectedMethod.label : '请选择处理方式' }}</view>
</picker>
<uni-icons type="bottom" size="16" color="#ccc"></uni-icons>
</view>
<view class="form-item">
<text class="form-label">异常描述</text>
<input class="form-input" v-model="form.description" placeholder="请描述异常情况" />
</view>
<view class="form-item column">
<text class="form-label">拍照留证</text>
<view class="photo-list">
<view class="photo-item" v-for="(photo, index) in photos" :key="index"
@click="previewPhoto(index)">
<image :src="photo" mode="aspectFill" class="photo-img"></image>
</view>
<view class="photo-add" @click="takePhoto" v-if="photos.length < 3">
<uni-icons type="plusempty" size="28" color="#ccc"></uni-icons>
</view>
</view>
</view>
</view>
<!-- 出库信息(扫码后显示) -->
<view class="form-section" v-if="outboundInfo">
<text class="form-title">出库任务信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ outboundInfo.materialCode }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ outboundInfo.materialName }}</text>
</view>
<view class="info-row">
<text class="info-label">出库数量</text>
<text class="info-value">{{ outboundInfo.quantity }}</text>
</view>
<view class="info-row">
<text class="info-label">出库口</text>
<text class="info-value">{{ outboundInfo.portName }}</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-danger" @click="submitException">提交异常确认</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getOutboundDetail, submitOutboundException } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
outboundInfo: null,
photos: [],
exceptionTypes: [
{ value: 'damage', label: '物料损坏' },
{ value: 'missing', label: '物料缺失' },
{ value: 'wrong', label: '物料错误' },
{ value: 'qty_mismatch', label: '数量不符' },
{ value: 'other', label: '其他异常' }
],
handleMethods: [
{ value: 'return', label: '退回入库' },
{ value: 'replace', label: '更换物料' },
{ value: 'skip', label: '跳过本次' },
{ value: 'manual', label: '人工处理' }
],
selectedType: null,
selectedMethod: null,
form: {
description: ''
}
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
var that = this
var params = { taskNo: this.taskNo, barcode: this.barcode }
getOutboundDetail(params).then(function(res) {
that.outboundInfo = res.data
that.$modal.msgSuccess('出库信息获取成功')
}).catch(function() {
that.outboundInfo = null
})
},
onTypeChange(e) {
this.selectedType = this.exceptionTypes[e.detail.value]
},
onMethodChange(e) {
this.selectedMethod = this.handleMethods[e.detail.value]
},
takePhoto() {
var that = this
uni.chooseImage({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
that.photos = that.photos.concat(res.tempFilePaths)
}
})
},
previewPhoto(index) {
uni.previewImage({
current: this.photos[index],
urls: this.photos
})
},
submitException() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
if (!this.selectedType) {
this.$modal.msg('请选择异常类型')
return
}
if (!this.selectedMethod) {
this.$modal.msg('请选择处理方式')
return
}
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
exceptionType: this.selectedType.value,
handleMethod: this.selectedMethod.value,
description: this.form.description
}
var that = this
submitOutboundException(data).then(function() {
that.$modal.msgSuccess('异常确认提交成功')
that.resetForm()
})
},
resetForm() {
this.barcode = ''
this.outboundInfo = null
this.photos = []
this.selectedType = null
this.selectedMethod = null
this.form = {
description: ''
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #fff1f0;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #f5222d;
}
.task-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.scan-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.scan-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.scan-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.scan-btn {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #f5222d;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
margin-left: 8rpx;
}
.scan-btn-text.red {
color: #f5222d;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
}
.form-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-item.column {
flex-direction: column;
align-items: flex-start;
}
.form-label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.form-item.column .form-label {
width: auto;
margin-bottom: 16rpx;
}
.form-input {
flex: 1;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
}
.picker-value {
flex: 1;
font-size: 28rpx;
color: #333;
padding: 16rpx;
}
.photo-list {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
}
.photo-item {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
overflow: hidden;
}
.photo-img {
width: 100%;
height: 100%;
}
.photo-add {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
border: 1rpx dashed #d9d9d9;
display: flex;
align-items: center;
justify-content: center;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-danger {
background: #f5222d;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -9,20 +9,20 @@
</view>
<view class="card-info">
<text class="card-title">出库确认</text>
<text class="card-desc">扫描出库物料条码进行出库确认</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/exception')">
<view class="menu-card" @click="navigateTo('/pages/warehouse/outbound/emptyTray')">
<view class="card-left">
<view class="card-icon red">
<uni-icons type="info" size="24" color="#fff"></uni-icons>
<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>
<text class="card-title">空托盘出库</text>
<text class="card-desc">选择仓库和数量后生成出库作业</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
@@ -106,8 +106,6 @@
handleTask(item) {
if (item.type === 'confirm') {
this.$tab.navigateTo('/pages/warehouse/outbound/confirm?taskNo=' + item.taskNo)
} else if (item.type === 'exception') {
this.$tab.navigateTo('/pages/warehouse/outbound/exception?taskNo=' + item.taskNo)
}
}
}
@@ -159,8 +157,8 @@
background: linear-gradient(135deg, #fa8c16, #ffa940);
}
.card-icon.red {
background: linear-gradient(135deg, #f5222d, #ff4d4f);
.card-icon.blue {
background: linear-gradient(135deg, #1890ff, #40a9ff);
}
.card-info {
@@ -242,10 +240,6 @@
color: #fa8c16;
}
.task-type.exception {
color: #f5222d;
}
.task-no {
font-size: 24rpx;
color: #999;
@@ -305,8 +299,4 @@
background: #f6ffed;
}
.task-status.exception {
color: #f5222d;
background: #fff1f0;
}
</style>

View File

@@ -1,82 +1,170 @@
<template>
<view class="page-container">
<view class="module-header">
<uni-icons type="bars" size="22" color="#722ed1"></uni-icons>
<text class="header-title">库存统计</text>
<view class="query-card">
<view class="section-header">
<text class="section-title">库存查询</text>
<text class="section-subtitle">托盘码</text>
</view>
<view class="input-row">
<input
class="tray-input"
v-model="trayCode"
placeholder="请扫描或输入托盘码"
confirm-type="search"
@confirm="queryStock"
/>
<button class="icon-button" @click="scanTray">
<uni-icons type="scan" size="22" color="#1890ff"></uni-icons>
</button>
</view>
<button class="primary-button" :disabled="loading" @click="queryStock">
{{ loading ? '查询中...' : '查询库存' }}
</button>
</view>
<!-- 库存概览卡片 -->
<view class="summary-section">
<view class="summary-card">
<view class="summary-row">
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">库存总量</text>
<view v-if="searched" class="result-section">
<view v-if="materialList.length > 0">
<view class="summary-card">
<view class="summary-main">
<text class="summary-tray">{{ currentTrayCode }}</text>
<text class="summary-location">{{ warehouseName }} / {{ cargoSpaceName }}</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">物料种类</text>
<view class="summary-grid">
<view class="summary-item">
<text class="summary-value">{{ materialCount }}</text>
<text class="summary-label">物料种类</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-value">{{ totalQuantity }}</text>
<text class="summary-label">库存总量</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-value">{{ availableQuantity }}</text>
<text class="summary-label">可用库存</text>
</view>
</view>
</view>
<view class="summary-row">
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">今日入库</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">今日出库</text>
<view class="material-list">
<view class="material-card" v-for="(item, index) in materialList" :key="item.stockDetailId || index">
<view class="material-header">
<text class="material-name">{{ formatValue(item.materialName || item.productName) }}</text>
<text class="material-code">{{ formatValue(item.materialCode || item.productId) }}</text>
</view>
<view class="material-body">
<view class="info-item">
<text class="info-label">批次</text>
<text class="info-value">{{ formatValue(item.lotNo) }}</text>
</view>
<view class="info-item">
<text class="info-label">库存数量</text>
<text class="info-value">{{ formatNumber(item.quantity) }}</text>
</view>
<view class="info-item">
<text class="info-label">占用数量</text>
<text class="info-value">{{ formatNumber(item.outQuantity) }}</text>
</view>
<view class="info-item">
<text class="info-label">可用数量</text>
<text class="info-value strong">{{ formatNumber(item.availableQuantity) }}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="feature-list">
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="search" size="20" color="#1890ff"></uni-icons>
<text class="feature-name">库存查询</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
<view v-else class="empty-state">
<uni-icons type="info" size="30" color="#bfbfbf"></uni-icons>
<text class="empty-text">未查询到托盘库存</text>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="location" size="20" color="#fa8c16"></uni-icons>
<text class="feature-name">库位分布</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="pie-chart" size="20" color="#52c41a"></uni-icons>
<text class="feature-name">库存报表</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="alert" size="20" color="#f5222d"></uni-icons>
<text class="feature-name">库存预警</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
</view>
<view class="empty-tip">
<text class="tip-text">库存统计模块正在开发中,敬请期待</text>
</view>
</view>
</template>
<script>
import { getTrayStock } from '@/api/warehouse/stock'
export default {
data() {
return {}
return {
trayCode: '',
currentTrayCode: '',
loading: false,
searched: false,
materialList: []
}
},
computed: {
materialCount() {
var map = {}
this.materialList.forEach(item => {
var key = item.materialCode || item.productId || item.stockDetailId
if (key) map[key] = true
})
return Object.keys(map).length
},
totalQuantity() {
return this.sumBy('quantity')
},
availableQuantity() {
return this.sumBy('availableQuantity')
},
warehouseName() {
return this.formatValue(this.materialList[0] && this.materialList[0].warehouseName)
},
cargoSpaceName() {
return this.formatValue(this.materialList[0] && this.materialList[0].cargoSpaceName)
}
},
methods: {
scanTray() {
uni.scanCode({
success: res => {
this.trayCode = res.result || ''
this.queryStock()
}
})
},
queryStock() {
var code = (this.trayCode || '').trim()
if (!code) {
this.$modal.msg('请扫描或输入托盘码')
return
}
this.loading = true
getTrayStock(code).then(res => {
this.currentTrayCode = code
this.materialList = res.data || []
this.searched = true
}).catch(() => {
this.materialList = []
this.searched = true
}).then(() => {
this.loading = false
})
},
sumBy(field) {
var total = 0
this.materialList.forEach(item => {
total += this.toNumber(item[field])
})
return this.formatNumber(total)
},
toNumber(value) {
var number = Number(value)
return isNaN(number) ? 0 : number
},
formatNumber(value) {
var number = this.toNumber(value)
return Number.isInteger(number) ? String(number) : String(Number(number.toFixed(3)))
},
formatValue(value) {
return value === undefined || value === null || value === '' ? '-' : value
}
}
}
</script>
@@ -91,101 +179,210 @@
padding: 24rpx;
}
.module-header {
display: flex;
align-items: center;
padding: 24rpx 0;
margin-bottom: 20rpx;
.query-card,
.summary-card,
.material-card,
.empty-state {
background: #fff;
border-radius: 16rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.header-title {
.query-card {
padding: 28rpx;
margin-bottom: 28rpx;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 22rpx;
}
.section-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-left: 12rpx;
}
.summary-section {
margin-bottom: 32rpx;
.section-subtitle {
font-size: 24rpx;
color: #999;
}
.input-row {
display: flex;
align-items: center;
margin-bottom: 24rpx;
}
.tray-input {
flex: 1;
height: 82rpx;
padding: 0 24rpx;
border: 1rpx solid #e5e6eb;
border-radius: 12rpx;
background: #fafafa;
font-size: 28rpx;
color: #333;
}
.icon-button {
width: 82rpx;
height: 82rpx;
padding: 0;
margin-left: 18rpx;
border-radius: 12rpx;
background: #e6f7ff;
display: flex;
align-items: center;
justify-content: center;
}
.icon-button::after,
.primary-button::after {
border: none;
}
.primary-button {
height: 84rpx;
line-height: 84rpx;
border-radius: 12rpx;
background: #1890ff;
color: #fff;
font-size: 30rpx;
}
.primary-button[disabled] {
background: #91caff;
color: #fff;
}
.result-section {
margin-bottom: 28rpx;
}
.summary-card {
background: linear-gradient(135deg, #1890ff, #096dd9);
border-radius: 16rpx;
padding: 40rpx 28rpx;
padding: 30rpx 28rpx;
margin-bottom: 24rpx;
}
.summary-row {
.summary-main {
display: flex;
flex-direction: column;
padding-bottom: 24rpx;
margin-bottom: 24rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.summary-tray {
font-size: 34rpx;
font-weight: 600;
color: #333;
margin-bottom: 8rpx;
}
.summary-location {
font-size: 24rpx;
color: #999;
}
.summary-grid {
display: flex;
align-items: center;
justify-content: space-around;
}
.summary-row:first-child {
margin-bottom: 32rpx;
}
.summary-divider {
width: 1rpx;
height: 60rpx;
background: rgba(255, 255, 255, 0.3);
justify-content: space-between;
}
.summary-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
}
.summary-divider {
width: 1rpx;
height: 54rpx;
background: #f0f0f0;
}
.summary-value {
font-size: 40rpx;
font-weight: 500;
color: #fff;
margin-bottom: 8rpx;
font-size: 36rpx;
font-weight: 600;
color: #1890ff;
margin-bottom: 6rpx;
}
.summary-label {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
font-size: 22rpx;
color: #999;
}
.feature-list {
background: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
.material-card {
padding: 28rpx;
margin-bottom: 20rpx;
}
.feature-card {
.material-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 28rpx;
border-bottom: 1rpx solid #f5f5f5;
align-items: flex-start;
padding-bottom: 18rpx;
margin-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.feature-card:last-child {
border-bottom: none;
}
.feature-left {
display: flex;
align-items: center;
}
.feature-name {
font-size: 28rpx;
.material-name {
flex: 1;
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-left: 16rpx;
margin-right: 20rpx;
}
.empty-tip {
padding: 60rpx 0;
text-align: center;
.material-code {
font-size: 24rpx;
color: #999;
}
.tip-text {
.material-body {
display: flex;
flex-direction: column;
}
.info-item {
display: flex;
justify-content: space-between;
padding: 9rpx 0;
}
.info-label {
font-size: 26rpx;
color: #ccc;
color: #999;
}
.info-value {
font-size: 26rpx;
color: #333;
}
.info-value.strong {
color: #1890ff;
font-weight: 600;
}
.empty-state {
padding: 86rpx 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.empty-text {
font-size: 28rpx;
color: #999;
margin-top: 16rpx;
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 22 KiB