现场调试更改

This commit is contained in:
lsymicc
2026-09-08 22:20:47 +08:00
parent 5353351520
commit 7c3ee78d41
140 changed files with 4488 additions and 4311 deletions

View File

@@ -8,24 +8,35 @@
<!-- 托盘信息 -->
<view class="form-section">
<text class="form-title">托盘信息</text>
<view class="form-item">
<!-- <text class="form-title">托盘信息</text> -->
<!-- <view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请输入托盘号" />
</view>
</view>
<!-- 扫码添加物料 -->
<view class="scan-section">
</view> -->
<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="#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="trayCode" placeholder="请输入或扫描托盘条码"
@confirm="handleBarcode" />
</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="#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>
@@ -33,13 +44,25 @@
<!-- 当前扫码物料信息(待添加) -->
<view class="form-section" v-if="currentMaterial">
<text class="form-title">物料信息</text>
<view class="info-row">
<!-- <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.color }}</text>
</view>
<view class="info-row">
<text class="info-label">色序</text>
<text class="info-value">{{ currentMaterial.colorSequence }}</text>
</view>
<view class="info-row">
<text class="info-label">子单号</text>
@@ -47,7 +70,7 @@
</view>
<view class="form-item">
<text class="form-label">绑定数量</text>
<input class="form-input" v-model="currentQty" type="number" placeholder="请输入绑定数量" />
<input class="form-input" v-model="currentQty" disabled type="number" placeholder="请输入绑定数量" />
</view>
<button class="btn-add" @click="addItem">
<uni-icons type="plus" size="16" color="#fff"></uni-icons>
@@ -62,13 +85,30 @@
</view>
<view class="item-card" v-for="(item, index) in items" :key="index">
<view class="item-body">
<view class="item-row">
<!-- <view class="item-row">
<text class="item-label">物料编码</text>
<text class="item-value">{{ item.productId }}</text>
</view>
<view class="item-row">
<text class="item-label">物料名称</text>
<text class="item-value">{{ item.productName }}</text>
</view> -->
<view class="item-row">
<text class="item-label">辊号</text>
<text class="item-value">{{ item.rollerNumber }}</text>
</view>
<view class="item-row">
<text class="item-label">色序</text>
<text class="item-value">{{ item.colorSequence }}</text>
</view>
<view class="item-row">
<text class="item-label">颜色</text>
<text class="item-value">{{ item.color }}</text>
</view>
<view class="item-row">
<text class="item-label">规格</text>
<text class="item-value">{{ item.spec }}</text>
</view>
<view class="item-row">
<text class="item-label">绑定数量</text>
@@ -83,7 +123,7 @@
<!-- 空状态提示 -->
<view class="empty-state" v-if="items.length === 0">
<text class="empty-text">请扫码添加物料</text>
<text class="empty-text">请扫码添加版辊信息</text>
</view>
<!-- 操作按钮 -->
@@ -92,16 +132,16 @@
确认绑盘({{ items.length }} 种物料)
</button>
<button class="btn btn-success" :disabled="items.length === 0 || !trayCode" @click="submitAddInJobAction">
<!-- <button class="btn btn-success" :disabled="!trayCode" @click="submitAddInJobAction">
生成入库作业
</button>
</button> -->
<button class="btn btn-default" @click="resetAll">全部重置</button>
</view>
</view>
</template>
<script>
import { getMaterialByDetailId, submitBindTray,submitAddInJob } from '@/api/warehouse/inbound'
import { getMaterialByDetailId, getMaterialByRollerNumber, submitBindTray, submitBindTrayMsg, submitAddInJob } from '@/api/warehouse/inbound'
export default {
data() {
@@ -138,18 +178,21 @@
// 根据入库明细ID查询物料
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入入库子单号')
// this.$modal.msg('请输入入库子单号')
this.$modal.msg('请输入版辊信息')
return
}
var that = this
getMaterialByDetailId(this.barcode).then(function(res) {
// getMaterialByDetailId(this.barcode).then(function(res) {
getMaterialByRollerNumber(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 = ''
that.$modal.msg('未找到该入库子单信息')
// that.$modal.msg('未找到该入库子单信息')
that.$modal.msg('未找到该版辊信息,可能是无单据明细或已绑定完成')
})
},
@@ -173,8 +216,12 @@
}
this.items.push({
stockinDetailId: this.currentMaterial.stockinDetailId,
productId: this.currentMaterial.productId,
productName: this.currentMaterial.productName,
productId: this.currentMaterial.rollerNumber,
// productName: this.currentMaterial.productName,
rollerNumber: this.currentMaterial.rollerNumber,
colorSequence: this.currentMaterial.colorSequence,
color: this.currentMaterial.color,
spec: this.currentMaterial.spec,
quantity: Number(this.currentQty)
})
// 清空当前扫码区,继续扫下一个
@@ -195,22 +242,29 @@
this.$modal.msg('请输入托盘号')
return
}
if (this.items.length === 0) {
this.$modal.msg('请至少添加一种物料')
return
}
var data = {
trayCode: this.trayCode,
items: this.items.map(function(i) {
return {
stockinDetailId: i.stockinDetailId,
productId: i.productId,
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) {
// submitBindTray(data).then(function(res) {
submitBindTrayMsg(data).then(function(res) {
that.$modal.msgSuccess(res.msg || '入库绑盘成功')
that.resetAll()
}).catch(function() {})
@@ -221,13 +275,16 @@
this.$modal.msg('请输入托盘号')
return
}
if (this.items.length === 0) {
this.$modal.msg('请至少添加一种物料')
return
}
// if (this.items.length === 0) {
// this.$modal.msg('请至少添加一种物料')
// return
// }
var data = {
trayCode: this.trayCode,
}
var that = this
submitAddInJob(data).then(function(res) {
that.$modal.msgSuccess(res.msg || '生成入库作业成功')
@@ -504,7 +561,7 @@
}
.btn-success {
background: #0fe825;
background: #0cca1f;
color: #fff;
}