pda入库绑定选择,手动出库确认选择,盘点任务完成账务处理优化

This commit is contained in:
lsymicc
2026-09-15 00:00:55 +08:00
parent 0bd8d92bc0
commit 39632ef960
29 changed files with 1174 additions and 333 deletions

View File

@@ -38,13 +38,13 @@
<text class="menu-desc">库存盘点</text>
</view>
<view class="menu-item" @click="navigateTo('/pages/warehouse/stock/index')">
<!-- <view class="menu-item" @click="navigateTo('/pages/warehouse/stock/index')">
<view class="menu-icon stock">
<uni-icons type="bars" size="28" color="#fff"></uni-icons>
</view>
<text class="menu-label">库存统计</text>
<text class="menu-desc">库存数据总览</text>
</view>
</view> -->
</view>
</view>

View File

@@ -30,15 +30,31 @@
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">版辊信息</text>
<view class="scan-btn" @click="startScan">
<!-- <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>
<view class="input-wrap">
<uni-data-select class="sel"
v-model="stockinId"
:localdata="inStockinOptions"
placeholder="请选择入库单据"
@change="handleInStockinChange">
</uni-data-select>
<uni-data-select class="sel"
v-model="barcode"
:localdata="rollerNumberOptions"
placeholder="请选择版辊号"
@change="handleBarcode">
</uni-data-select>
<!-- <view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描版辊编号"
@confirm="handleBarcode" />
</view>
</view> -->
<!-- <button class="btn-add" @click="addItem" :disabled="!this.barcode || !this.trayCode">
<uni-icons type="plus" size="16" color="#fff"></uni-icons>
<text class="btn-add-text">加入列表</text>
</button> -->
</view>
<!-- 当前扫码物料信息(待添加) -->
@@ -60,10 +76,10 @@
<text class="info-label">颜色</text>
<text class="info-value">{{ currentMaterial.color }}</text>
</view>
<view class="info-row">
<!-- <view class="info-row">
<text class="info-label">色序</text>
<text class="info-value">{{ currentMaterial.colorSequence }}</text>
</view>
</view> -->
<view class="info-row">
<text class="info-label">子单号</text>
<text class="info-value">{{ currentMaterial.stockinDetailId }}</text>
@@ -98,10 +114,10 @@
<text class="item-label">辊号</text>
<text class="item-value">{{ item.rollerNumber }}</text>
</view>
<view class="item-row">
<!-- <view class="item-row">
<text class="item-label">色序</text>
<text class="item-value">{{ item.colorSequence }}</text>
</view>
</view> -->
<view class="item-row">
<text class="item-label">颜色</text>
<text class="item-value">{{ item.color }}</text>
@@ -141,7 +157,7 @@
</template>
<script>
import { getMaterialByDetailId, getMaterialByRollerNumber, submitBindTray, submitBindTrayMsg, submitAddInJob } from '@/api/warehouse/inbound'
import { getMaterialByDetailId, getMaterialByRollerNumber, submitBindTray, submitBindTrayMsg, submitAddInJob, getInboundStockList, getDetailList } from '@/api/warehouse/inbound'
export default {
data() {
@@ -150,60 +166,141 @@
trayCode: '',
// 当前扫码
barcode: '',
stockinId:'',
currentMaterial: null,
currentQty: '',
// 已加入列表的物料
items: []
items: [],
inStockinOptions:[],
rollerNumberOptions:[],
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
// if (options.taskNo) {
// this.taskNo = options.taskNo
// this.getInStockinList()
// }
this.getInStockinList()
},
methods: {
// 调用摄像头扫码
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
//获取入库单据
async getInStockinList() {
try {
// 发起请求,RuoYi 的分页接口通常返回 { rows: [], total: number }
const res = await getInboundStockList({});
// 将后端返回的 rows 数据转换为 uni-data-select 需要的格式
this.inStockinOptions = (res.rows || []).map(item => {
return {
value: item.stockinId, // 实际传给后端的值(如单据ID)
text: item.stockinId // 显示给用户看的文本(如单据编号)
};
});
} catch (error) {
console.error('获取入库单列表失败:', error);
uni.showToast({ title: '获取数据失败', icon: 'none' });
}
},
handleInStockinChange(value) {
// 1. 参数 value 直接就是选中的 stockinId,无需 e.detail.value
const stockinId = value;
// 2. 使用 v-model 时,组件会自动更新 this.stockinId,无需手动赋值
// this.stockinId = value; (可省略)
// 3. 每次切换单据,清空并重置版辊号下拉框
this.barcode = '';
this.rollerNumberOptions = [];
// 4. 只有选中了值才去请求下级数据,且不要再重复请求入库单列表了
if (stockinId) {
this.fetchRollerNumberOptions(stockinId); // 传入正确的变量名
}
},
// 根据单据号获取版辊号列表
async fetchRollerNumberOptions(stockinId) {
try {
const res = await getDetailList({ stockinId });
// console.log(res)
this.rollerNumberOptions = (res.data || []).map(item => {
return {
value: item.rollerNumber, // 实际传给后端的值(如单据ID)
text: item.rollerNumber // 显示给用户看的文本(如单据编号)
};
});
} catch (error) {
console.error('获取版辊号失败,请检查单据明细:', error);
}
},
handleRollerNumberChange(value) {
// 1. 参数 value 直接就是选中的 stockinId,无需 e.detail.value
const rollerNumber = value;
// 4. 只有选中了值才去请求下级数据,且不要再重复请求入库单列表了
if (value) {
var that = this
// 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('未找到该版辊信息,可能是无单据明细或已绑定完成')
})
}
},
// 根据入库明细ID查询物料
handleBarcode() {
if (!this.barcode) {
// this.$modal.msg('请输入入库子单号')
this.$modal.msg('请输入版辊信息')
return
}
var that = this
// 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('未找到该版辊信息,可能是无单据明细或已绑定完成')
})
},
handleBarcode() {
if (!this.barcode) {
// this.$modal.msg('请输入入库子单号')
this.$modal.msg('请输入版辊信息')
return
}
var that = this
// 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('未找到该版辊信息,可能是无单据明细或已绑定完成')
})
},
// 将当前物料加入绑定列表
addItem() {
if (!this.currentMaterial) {
this.$modal.msg('请先扫码查询物料')
if (!this.trayCode) {
this.$modal.msg('请输入或扫描托盘号')
return
}
if (!this.currentQty || Number(this.currentQty) <= 0) {
this.$modal.msg('请输入有效的绑定数量')
if (!this.barcode) {
this.$modal.msg('请选择要绑定的辊号')
return
}
// 检查是否已存在相同子单
@@ -219,7 +316,7 @@
productId: this.currentMaterial.rollerNumber,
// productName: this.currentMaterial.productName,
rollerNumber: this.currentMaterial.rollerNumber,
colorSequence: this.currentMaterial.colorSequence,
// colorSequence: this.currentMaterial.colorSequence,
color: this.currentMaterial.color,
spec: this.currentMaterial.spec,
quantity: Number(this.currentQty)

View File

@@ -107,7 +107,7 @@
</template>
<script>
import { getOutboundDetail, confirmOutbound } from '@/api/warehouse/outbound'
import { getOutboundDetail, confirmOutbound, rollerNumberComplete } from '@/api/warehouse/outbound'
export default {
data() {
@@ -176,7 +176,7 @@
remark: this.form.remark
}
var that = this
confirmOutbound(data).then(function() {
rollerNumberComplete(data).then(function() {
that.$modal.msgSuccess('出库确认成功')
that.resetForm()
})

View File

@@ -8,8 +8,8 @@
<uni-icons type="checkmarkempty" 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>
@@ -21,8 +21,21 @@
<uni-icons type="checkmarkempty" 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>
</view>
<view class="menu-card" @click="navigateTo('/pages/warehouse/outbound/trayConfirmManual')">
<view class="card-left">
<view class="card-icon red">
<uni-icons type="checkmarkempty" 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="18" color="#ccc"></uni-icons>
@@ -35,13 +48,13 @@
</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/exception')">
<view class="card-left">
<view class="card-icon red">
<uni-icons type="info" size="24" color="#fff"></uni-icons>
@@ -52,7 +65,7 @@
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
</view> -->
</view>
<!-- 待处理任务 -->

View File

@@ -58,13 +58,14 @@
<!-- 操作按钮 -->
<view class="btn-section" >
<button class="btn btn-orange" v-if="outboundList" @click="stockoutComplete">托盘确认出库</button>
<button class="btn btn-green" v-if="outboundList" @click="stockoutCompleteAll">一键确认出库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getOutboundDetail, getTrayCodeDetail, confirmOutbound, stockoutTrayCodeComplete } from '@/api/warehouse/outbound'
import { getOutboundDetail, getTrayCodeDetail, confirmOutbound, stockoutTrayCodeComplete, stockoutTrayCodeCompleteAll } from '@/api/warehouse/outbound'
export default {
data() {
@@ -124,7 +125,7 @@
}
}).catch(function() {
that.outboundList = []
// that.$modal.msg('未找到该托盘信息,可能是未分配单据或已出库完成')
that.$modal.msg('无托盘明细信息,可能是出库单据未分配或已确认出库完成')
})
},
@@ -201,6 +202,44 @@
})
},
stockoutCompleteAll() {
if (!this.barcode) {
this.$modal.msg('请输入托盘号')
return
}
// var data = {
// // taskNo: this.taskNo,
// barcode: this.barcode,
// }
// console.log(this.barcode)
// var that = this
// stockoutTrayCodeCompleteAll(this.barcode).then(() => {
// that.$modal.msgSuccess(this.barcode + '一键出库确认成功')
// that.resetForm()
// }).catch(() => {
// // 全局拦截器通常已处理错误弹窗,这里可只处理状态重置
// // console.log('出库确认失败')
// })
this.$modal.confirm('一键出库操作会自动将该托盘符合条件的版辊确认出库并移除版辊库存,确认执行吗').then(() => {
stockoutTrayCodeCompleteAll(this.barcode).then(() => {
that.$modal.msgSuccess(this.barcode + '一键出库确认成功')
that.resetForm()
}).catch(() => {
// 全局拦截器通常已处理错误弹窗,这里可只处理状态重置
// console.log('出库确认失败')
})
}).then(() => {
this.$modal.msgSuccess(this.barcode + '一键出库确认成功');
this.resetForm();
}).catch(() => {
// 全局拦截器通常已处理错误弹窗,这里可只处理状态重置
// console.log('出库确认失败或用户取消')
});
},
resetItemQty(item) {
item.outQuantity = 0; // 或者重置为后端返回的默认数量
},
@@ -402,6 +441,11 @@
background: #fa8c16;
color: #fff;
}
.btn-green {
background: #0cb306;
color: #fff;
}
.btn-default {
background: #fff;