现场调试更改

This commit is contained in:
lsymicc
2026-09-12 09:26:24 +08:00
parent abeb081825
commit 8ddae081cd
29 changed files with 2579 additions and 146 deletions

152
pda/_pages.json Normal file
View File

@@ -0,0 +1,152 @@
{
"pages": [{
"path": "pages/login",
"style": {
"navigationBarTitleText": "登录"
}
}, {
"path": "pages/register",
"style": {
"navigationBarTitleText": "注册"
}
}, {
"path": "pages/index",
"style": {
"navigationBarTitleText": "WMS 仓储管理",
"navigationStyle": "custom"
}
}, {
"path": "pages/work/index",
"style": {
"navigationBarTitleText": "工作台"
}
}, {
"path": "pages/mine/index",
"style": {
"navigationBarTitleText": "我的"
}
}, {
"path": "pages/mine/avatar/index",
"style": {
"navigationBarTitleText": "修改头像"
}
}, {
"path": "pages/mine/info/index",
"style": {
"navigationBarTitleText": "个人信息"
}
}, {
"path": "pages/mine/info/edit",
"style": {
"navigationBarTitleText": "编辑资料"
}
}, {
"path": "pages/mine/pwd/index",
"style": {
"navigationBarTitleText": "修改密码"
}
}, {
"path": "pages/mine/setting/index",
"style": {
"navigationBarTitleText": "应用设置"
}
}, {
"path": "pages/mine/help/index",
"style": {
"navigationBarTitleText": "常见问题"
}
}, {
"path": "pages/mine/about/index",
"style": {
"navigationBarTitleText": "关于我们"
}
} , {
"path": "pages/warehouse/inbound/index",
"style": {
"navigationBarTitleText": "入库管理"
}
}, {
"path": "pages/warehouse/inbound/bindTray",
"style": {
"navigationBarTitleText": "入库绑盘"
}
}, {
"path": "pages/warehouse/inbound/emptyTray",
"style": {
"navigationBarTitleText": "空托入库"
}
}, {
"path": "pages/warehouse/inbound/supply",
"style": {
"navigationBarTitleText": "补料入库"
}
}, {
"path": "pages/warehouse/outbound/index",
"style": {
"navigationBarTitleText": "出库管理"
}
}, {
"path": "pages/warehouse/outbound/confirm",
"style": {
"navigationBarTitleText": "版辊出库确认"
}
}, {
"path": "pages/warehouse/outbound/trayConfirm",
"style": {
"navigationBarTitleText": "托盘出库确认"
}
}, {
"path": "pages/warehouse/outbound/exception",
"style": {
"navigationBarTitleText": "出库异常确认"
}
}, {
"path": "pages/warehouse/inventory/index",
"style": {
"navigationBarTitleText": "盘点管理"
}
}, {
"path": "pages/warehouse/stock/index",
"style": {
"navigationBarTitleText": "库存统计"
}
}, {
"path": "pages/common/webview/index",
"style": {
"navigationBarTitleText": "浏览网页"
}
}, {
"path": "pages/common/textview/index",
"style": {
"navigationBarTitleText": "浏览文本"
}
}],
"tabBar": {
"color": "#000000",
"selectedColor": "#000000",
"borderStyle": "white",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index",
"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",
"selectedIconPath": "static/images/tabbar/mine_.png",
"text": "我的"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "RuoYi",
"navigationBarBackgroundColor": "#FFFFFF"
}
}

View File

@@ -64,13 +64,13 @@
<uni-icons type="plus" size="22" color="#52c41a"></uni-icons>
<text class="quick-label">空托入库</text>
</view>
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/confirm')">
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/trayConfirm')">
<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')">
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/container')">
<uni-icons type="info" size="22" color="#f5222d"></uni-icons>
<text class="quick-label">出库异常</text>
<text class="quick-label">呼叫空托</text>
</view>
</view>
</view>

View File

@@ -0,0 +1,441 @@
<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="#1890ff"></uni-icons>
<text class="scan-btn-text">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描版辊编号"
@confirm="handleBarcode" />
</view>
</view>
<!-- 当前扫码物料信息(待添加) -->
<view class="form-section" v-if="currentMaterial">
<text class="form-title">物料信息</text>
<!-- <view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ currentMaterial.productId }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ currentMaterial.productName }}</text>
</view> -->
<view class="info-row">
<text class="info-label">辊号</text>
<text class="info-value">{{ currentMaterial.rollerNumber }}</text>
</view>
<view class="info-row">
<text class="info-label">托盘号</text>
<text class="info-value">{{ currentMaterial.trayCode }}</text>
</view>
<view class="form-item">
<text class="form-label">绑定数量</text>
<input class="form-input" v-model="currentQty" disabled type="number" placeholder="请输入绑定数量" />
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-danger" :disabled="!this.barcode || this.barcode.trim() === ''" @click="submitCancelTrayAction">
确认取消绑定<!-- ({{ items.length }} 种物料) -->
</button>
<button class="btn btn-default" @click="resetAll">全部重置</button>
</view>
</view>
</template>
<script>
import { getMaterialByDetailId, getTrayMsgByRollerNumber, submitCancelTray, submitCancelTrayMsg } from '@/api/warehouse/inbound'
export default {
data() {
return {
taskNo: '',
trayCode: '',
// 当前扫码
barcode: '',
currentMaterial: null,
currentQty: '',
// 已加入列表的物料
items: []
}
},
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()
}
})
},
// 根据入库明细ID查询物料
handleBarcode() {
if (!this.barcode) {
// this.$modal.msg('请输入入库子单号')
this.$modal.msg('请输入版辊信息')
return
}
var that = this
getTrayMsgByRollerNumber(this.barcode).then(function(res) {
that.currentMaterial = res.data
that.currentQty = res.data.quantity ? String(res.data.quantity) : ''
that.$modal.msgSuccess('物料信息获取成功')
}).catch(function() {
that.currentMaterial = null
that.currentQty = ''
})
},
// 从列表中移除某条物料
removeItem(index) {
this.items.splice(index, 1)
},
// 提交绑盘
submitCancelTrayAction() {
if (!this.barcode || this.barcode.trim() === "") {
this.$modal.msg('请输入辊号')
return
}
var data = {
barcode: this.barcode,
items: this.items.map(function(i) {
return {
stockinDetailId: i.stockinDetailId,
productId: i.rollerNumber,
rollerNumber: i.rollerNumber,
colorSequence: i.colorSequence,
color: i.color,
spec: i.spec,
quantity: i.quantity
}
})
}
var that = this
// submitBindTray(data).then(function(res) {
submitCancelTrayMsg(this.barcode).then(function(res) {
that.$modal.msgSuccess(res.msg || '入库绑盘信息已作废')
that.resetAll()
}).catch(function() {})
},
// 全部重置
resetAll() {
this.trayCode = ''
this.barcode = ''
this.currentMaterial = null
this.currentQty = ''
this.items = []
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
padding-bottom: 60rpx;
}
/* 任务信息 */
.task-info {
background: #e6f7ff;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #1890ff;
}
.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 #1890ff;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
color: #1890ff;
margin-left: 8rpx;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
word-break: break-all;
width: 100%;
height: auto;
line-height: 1.4;
}
/* 通用 form-section */
.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;
display: block;
}
.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;
word-break: break-all;
min-width: 0;
height: auto;
line-height: 1.4;
}
.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-add {
margin-top: 24rpx;
background: #1890ff;
color: #fff;
border-radius: 12rpx;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 0;
border: none;
}
.btn-add-text {
font-size: 28rpx;
color: #fff;
margin-left: 8rpx;
}
/* 已添加物料列表 */
.list-section {
margin-bottom: 24rpx;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
}
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.item-card {
background: #fff;
border-radius: 16rpx;
padding: 24rpx 28rpx;
margin-bottom: 16rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
display: flex;
align-items: center;
justify-content: space-between;
}
.item-body {
flex: 1;
margin-right: 20rpx;
}
.item-row {
display: flex;
justify-content: space-between;
padding: 8rpx 0;
}
.item-label {
font-size: 26rpx;
color: #999;
}
.item-value {
font-size: 26rpx;
color: #333;
}
.item-value.highlight {
color: #1890ff;
font-weight: 500;
}
.item-delete {
padding: 8rpx;
}
/* 空状态 */
.empty-state {
background: #fff;
border-radius: 16rpx;
padding: 60rpx 0;
margin-bottom: 24rpx;
display: flex;
align-items: center;
justify-content: center;
}
.empty-text {
font-size: 28rpx;
color: #ccc;
}
/* 底部按钮 */
.btn-section {
padding: 8rpx 0 24rpx;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-primary {
background: #1890ff;
color: #fff;
}
.btn-danger {
background: #d42427;
color: #fff;
}
.btn-success {
background: #0fe825;
color: #fff;
}
.btn-primary[disabled] {
background: #b0d4f5;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -0,0 +1,269 @@
<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="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, submitAddEmptyTrayJob} 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
}
var data = {
barcode: this.barcode,
}
var that = this
submitAddEmptyTrayJob(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: 5rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
word-break: break-all;
width: 100%;
height: auto;
line-height: 1.4;
}
.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

@@ -0,0 +1,274 @@
<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">1.选择立库区域</text>
</view>
<picker mode="selector" :range="cargoAreaOptions" @change="onCargoAreaChange">
<view class="form-input picker-text">
{{ selectedCargoArea || '请选择库区' }}
</view>
</picker>
</view>
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">2.选择托盘类型</text>
</view>
<picker mode="selector" :range="palletTypeOptions" @change="onPalletTypeChange">
<view class="form-input picker-text">
{{ selectedPalletType || '请选择托盘类型' }}
</view>
</picker>
</view>
<!-- 操作按钮 -->
<view class="btn-section" >
<button class="btn btn-orange" @click="handleCallContainer">呼叫容器出库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getOutboundDetail, callStockOutForContainer, confirmOutbound } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
traCode: '',
outboundInfo: null,
confirmQty: '',
form: {
remark: ''
},
// 新增:下拉框选项与选中状态
cargoAreaOptions: ['01', '02', '03', '04'],
palletTypeOptions: [1, 2, 3],
selectedCargoArea: '', // 库区
selectedPalletType: '' // 托盘类型
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
// 处理库区选择
onCargoAreaChange(e) {
this.selectedCargoArea = this.cargoAreaOptions[e.detail.value]
},
// 处理托盘类型选择
onPalletTypeChange(e) {
this.selectedPalletType = this.palletTypeOptions[e.detail.value]
},
// 呼叫空托出库逻辑
handleCallContainer() {
if (!this.selectedCargoArea || !this.selectedPalletType) {
this.$modal.msg('请先选择库区和托盘类型')
return
}
uni.showLoading({ title: '呼叫中...' })
callStockOutForContainer(this.selectedCargoArea, this.selectedPalletType)
.then(res => {
uni.hideLoading()
this.$modal.msgSuccess('呼叫空托出库成功')
})
.catch(err => {
uni.hideLoading()
// this.$modal.msg('网络异常,请稍后重试')
})
},
resetForm() {
this.selectedCargoArea = ''
this.selectedPalletType = ''
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #fff7e6;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #fa8c16;
}
.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 #fa8c16;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
margin-left: 8rpx;
}
.scan-btn-text.orange {
color: #fa8c16;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
word-break: break-all;
width: 100%;
height: auto;
line-height: 1.4;
}
.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;
width: 100%;
height: auto;
line-height: 1.4;
}
.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;
}
.info-value.highlight {
color: #fa8c16;
font-weight: 500;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-orange {
background: #fa8c16;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
.picker-text {
display: flex;
align-items: center;
color: #767676;
}
</style>

View File

@@ -0,0 +1,440 @@
<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="#fa8c16"></uni-icons>
<text class="scan-btn-text orange">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描托盘条码"
@confirm="handleBarcode" focus />
</view>
</view>
<!-- 出库信息 -->
<view class="form-section" v-for="(item, index) in outboundList" :key="index">
<view class="scan-header">
<text class="scan-title">出库信息</text>
<view class="info-btn">
<button class="scan-btn-text orange" @click="confirmSingleOutbound(item)">确认出库</button>
</view>
</view>
<view class="info-row">
<text class="info-label">版辊编号</text>
<text class="info-value">{{ item.rollerNumber }}</text>
</view>
<view class="info-row">
<text class="info-label">托盘库存数量</text>
<text class="info-value">{{ item.stockQuantity }}</text>
</view>
<view class="info-row">
<text class="info-label">出库数量</text>
<!-- <text class="info-value">{{ item.outQuantity }}</text> -->
<input
class="form-section-input"
type="number"
v-model="item.outQuantity"
:value="item.outQuantity || 0"
placeholder="0"
/>
</view>
<view class="btn-group">
<button class="btn-max btn-reset" @click="resetItemQty(item)">重置</button>
<button class="btn-max" @click="setMaxQty(item)">最大</button>
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section" >
<button class="btn btn-orange" v-if="outboundList" @click="stockoutComplete">托盘确认出库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getOutboundDetail, getTrayCodeDetail, confirmOutbound, stockoutTrayCodeComplete } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
traCode: '',
outboundInfo: null,
outboundList: [],
confirmQty: '',
form: {
remark: ''
}
}
},
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 }
var params = { barcode: this.barcode }
getTrayCodeDetail(this.barcode).then(function(res) {
if (Array.isArray(res.data)) {
that.outboundList = res.data
} else if (res.data) {
that.outboundList = [res.data]
} else {
that.outboundList = []
}
if (that.outboundList.length > 0) {
that.$modal.msgSuccess('获取到 ' + that.outboundList.length + ' 条出库信息')
} else {
that.$modal.msg('未找到该托盘信息')
}
}).catch(function() {
that.outboundList = []
// that.$modal.msg('未找到该托盘信息,可能是未分配单据或已出库完成')
})
},
// 新增:确认单条出库请求
confirmSingleOutbound(item) {
// 构造你需要的参数
var params = {
barcode: item.rollerNumber,
outQuantity: item.outQuantity
}
uni.showLoading({ title: '提交中...' })
// TODO: 替换为你实际的后端确认接口
confirmOutbound(params).then(res => {
uni.hideLoading()
this.$modal.msgSuccess('版辊 ' + item.rollerNumber + ' 出库成功')
// 可选:出库成功后从列表中移除该项,避免重复点击
this.outboundList = this.outboundList.filter(i => i.rollerNumber !== item.rollerNumber)
}).catch(err => {
// uni.hideLoading()
// this.$modal.msg('出库失败', err)
})
},
//版辊出库数量确认
confirmOutbound() {
if (!this.barcode) {
this.$modal.msg('请输入托盘号')
return
}
// if (!this.confirmQty) {
// this.$modal.msg('请输入实际数量')
// return
// }
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
quantity: this.confirmQty,
remark: this.form.remark
}
var that = this
confirmOutbound(data).then(function() {
that.$modal.msg('出库确认完成')
that.resetForm()
}).catch(() => {
// 全局拦截器通常已处理错误弹窗,这里可只处理状态重置
console.log('出库确认失败')
})
},
//托盘物料出库完成确认
stockoutComplete() {
if (!this.barcode) {
this.$modal.msg('请输入托盘号')
return
}
// var data = {
// // taskNo: this.taskNo,
// barcode: this.barcode,
// }
// console.log(this.barcode)
// var that = this
stockoutTrayCodeComplete(this.barcode).then(() => {
that.$modal.msgSuccess(this.barcode + '出库确认成功')
that.resetForm()
}).catch(() => {
// 全局拦截器通常已处理错误弹窗,这里可只处理状态重置
// console.log('出库确认失败')
})
},
resetItemQty(item) {
item.outQuantity = 0; // 或者重置为后端返回的默认数量
},
setMaxQty(item) {
// 假设最大数量就是 item 初始带的某个字段,比如 maxQuantity
// 如果没有这个字段,你可以写死一个值,或者使用 item.outQuantity 的某个上限
if (item.maxQuantity !== undefined) {
item.outQuantity = item.maxQuantity;
} else {
// 兜底逻辑:如果后端没传最大数量字段,你可以自定义一个默认最大值
item.outQuantity = 1;
}
},
resetForm() {
this.barcode = ''
this.outboundInfo = null
this.outboundList = []
this.confirmQty = ''
this.form = {
remark: ''
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #fff7e6;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #fa8c16;
}
.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 #fa8c16;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
margin-left: 8rpx;
}
.scan-btn-text.orange {
color: #fa8c16;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
word-break: break-all;
width: 100%;
height: auto;
line-height: 1.4;
}
.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-section-input {
flex: 1;
font-size: 28rpx; /* ✅ 关键:字体大小必须与 label 一致 */
color: #333;
text-align: right; /* ✅ 关键:内容靠右对齐 */
height: 28rpx; /* ✅ 关键:明确设置高度 */
line-height: 28rpx; /* ✅ 关键:行高必须与 label 完全一致,解决多端对齐差异 */
padding: 0; /* ✅ 关键:清除 input 默认的 padding,防止错位 */
margin: 0; /* 清除默认 margin */
border: none; /* 如果需要无边框效果 */
}
.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;
width: 100%;
height: auto;
line-height: 1.4;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 12rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
.info-value.highlight {
color: #fa8c16;
font-weight: 500;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-orange {
background: #fa8c16;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
/* ✅ 新增:按钮组容器,让两个按钮并排 */
.btn-group {
display: flex;
align-items: center;
margin-left: 16rpx; /* 与输入框的间距 */
margin-top: 10rpx;
}
/* 按钮基础样式(最大按钮) */
.btn-max {
font-size: 22rpx;
color: #fafafa;
background-color: #fa8c16;
border: 1rpx solid #fa8c16;
border-radius: 8rpx;
padding: 0 100rpx;
height: 50rpx;
line-height: 50rpx;
flex-shrink: 0;
}
/* ✅ 新增:重置按钮样式(与最大按钮之间留一点间距) */
.btn-reset {
color: #fa8c16;
margin-right: 12rpx;
background-color: #fff7e6;
}
</style>