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

@@ -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;
}