Files
FT577-WMS/pda/pages/warehouse/outbound/confirm.vue

364 lines
8.8 KiB
Vue

<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="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-if="outboundInfo">
<text class="form-title">出库信息</text>
<view class="info-row">
<text class="info-label">版辊编号</text>
<text class="info-value">{{ outboundInfo.rollerNumber }}</text>
</view>
<view class="info-row">
<text class="info-label">颜色</text>
<text class="info-value">{{ outboundInfo.color }}</text>
</view>
<view class="info-row">
<text class="info-label">色序</text>
<text class="info-value">{{ outboundInfo.colorSequence }}</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.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>
</view>
<view class="info-row">
<text class="info-label">库位</text>
<text class="info-value">{{ outboundInfo.locationCode }}</text>
</view>
<view class="info-row">
<text class="info-label">出库数量</text>
<text class="info-value highlight">{{ outboundInfo.quantity }}</text>
</view>
<view class="info-row">
<text class="info-label">出库口</text>
<text class="info-value">{{ outboundInfo.portName }}</text>
</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" />
</view>
<view class="form-item">
<text class="form-label">备注</text>
<input class="form-input" v-model="form.remark" placeholder="选填" />
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section" >
<button class="btn btn-orange" v-if="outboundInfo" @click="confirmOutbound">确认出库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getOutboundDetail, confirmOutbound, rollerNumberComplete } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
traCode: '',
outboundInfo: null,
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 }
getOutboundDetail(this.barcode).then(function(res) {
that.outboundInfo = res.data
that.confirmQty = String(res.data.quantity)
that.$modal.msgSuccess('出库信息获取成功')
}).catch(function() {
that.outboundInfo = null
that.$modal.msg('未找到该版辊信息,可能是无单据明细或已出库确认完成')
})
},
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
rollerNumberComplete(data).then(function() {
that.$modal.msgSuccess('出库确认成功')
that.resetForm()
})
},
resetForm() {
this.barcode = ''
this.outboundInfo = null
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-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;
}
</style>