Browse Source

Merge remote-tracking branch 'origin/master'

master
常熟吴彦祖 7 days ago
parent
commit
6ab0aff240
  1. 11
      src/views/modules/production-inbound/inboundRegister.vue
  2. 23
      src/views/modules/production-return/productionReturnPDAIssueList.vue
  3. 23
      src/views/modules/production-return/productionReturnPickingDetail.vue
  4. 15
      src/views/modules/recv/recv.vue

11
src/views/modules/production-inbound/inboundRegister.vue

@ -86,8 +86,6 @@
:trigger-on-focus="true" :trigger-on-focus="true"
clearable clearable
style="width: 100%;" style="width: 100%;"
@select="handleLocationSelect"
@blur="handleLocationBlur"
/> />
</el-form-item></el-col> </el-form-item></el-col>
<el-col :span="12"><el-form-item label="批号"> <el-col :span="12"><el-form-item label="批号">
@ -550,14 +548,6 @@ export default {
: historyOptions; : historyOptions;
cb(result); cb(result);
}, },
handleLocationSelect(selectedItem) {
// 选中历史值后立即置顶,保证高频库位下次优先展示。
this.saveLocationHistory(selectedItem && selectedItem.value);
},
handleLocationBlur() {
// 失焦即缓存,覆盖“手输后直接切换焦点”的场景。
this.saveLocationHistory(this.inboundItem.locationNo);
},
saveLocationHistory(locationNo) { saveLocationHistory(locationNo) {
const normalizedLocation = (locationNo || '').trim(); const normalizedLocation = (locationNo || '').trim();
if (!normalizedLocation) return; if (!normalizedLocation) return;
@ -754,6 +744,7 @@ export default {
submitShopOrderInbound(submitData).then(({ data }) => { submitShopOrderInbound(submitData).then(({ data }) => {
if (data.code === 0) { if (data.code === 0) {
this.$message.success("入库成功"); this.$message.success("入库成功");
// 只在入库成功后写入库位历史,避免未提交或校验失败的库位进入下次建议。
this.saveLocationHistory(item.locationNo); this.saveLocationHistory(item.locationNo);
this.clearAllHandlingUnitCache(); this.clearAllHandlingUnitCache();

23
src/views/modules/production-return/productionReturnPDAIssueList.vue

@ -686,6 +686,8 @@ export default {
// 确认生产退料 // 确认生产退料
confirmReturn() { confirmReturn() {
// 先从页面列表移除零数量标签,再校验退料信息
this.labelList = this.labelList.filter((label) => label.quantity && Number(label.quantity) !== 0)
if (this.labelList.length === 0) { if (this.labelList.length === 0) {
this.$message.warning('请先扫描退料标签') this.$message.warning('请先扫描退料标签')
return return
@ -703,26 +705,9 @@ export default {
return return
} }
const hasInvalidLabel = this.labelList.some((label) => {
const isInWh = label.isInWh
const quantity = Number(label.quantity)
return isInWh === 'Y' && !isNaN(quantity) && quantity === 0
})
if (hasInvalidLabel) {
this.$message.warning('立库已有标签不能有数量')
// 立库已有标签不提交
const labelLists = this.labelList.filter((label) => label.isInWh !== 'Y')
return
}
// 从 labelList 中移除 isInWh 为 'Y' 或 quantity 为 0 的标签
let labelLists = this.labelList.filter((label) => {
return !(
label.isInWh === 'Y' ||
(Number(label.quantity) === 0 || !label.quantity)
)
})
// 如果过滤后没有标签了,提示用户 // 如果过滤后没有标签了,提示用户
if (labelLists.length === 0) { if (labelLists.length === 0) {
this.$message.warning('没有可退料的标签') this.$message.warning('没有可退料的标签')

23
src/views/modules/production-return/productionReturnPickingDetail.vue

@ -653,6 +653,8 @@ export default {
// 确认生产退料 // 确认生产退料
confirmReturn() { confirmReturn() {
// 先从页面列表移除零数量标签,再校验退料信息
this.labelList = this.labelList.filter((label) => label.quantity && Number(label.quantity) !== 0)
if (this.labelList.length === 0) { if (this.labelList.length === 0) {
this.$message.warning('请先扫描退料标签') this.$message.warning('请先扫描退料标签')
return return
@ -669,26 +671,9 @@ export default {
return return
} }
const hasInvalidLabel = this.labelList.some((label) => {
const isInWh = label.isInWh
const quantity = Number(label.quantity)
return isInWh === 'Y' && !isNaN(quantity) && quantity === 0
})
if (hasInvalidLabel) {
this.$message.warning('立库已有标签不能有数量')
return
}
// 立库已有标签不提交
const labelLists = this.labelList.filter((label) => label.isInWh !== 'Y')
// 从 labelList 中移除 isInWh 为 'Y' 或 quantity 为 0 的标签
let labelLists = this.labelList.filter((label) => {
return !(
label.isInWh === 'Y' ||
(Number(label.quantity) === 0 || !label.quantity)
)
})
// 如果过滤后没有标签了,提示用户 // 如果过滤后没有标签了,提示用户
if (labelLists.length === 0) { if (labelLists.length === 0) {
this.$message.warning('没有可退料的标签') this.$message.warning('没有可退料的标签')

15
src/views/modules/recv/recv.vue

@ -118,8 +118,6 @@
:trigger-on-focus="true" :trigger-on-focus="true"
clearable clearable
style="width: 100%;" style="width: 100%;"
@select="handleLocationSelect"
@blur="handleLocationBlur"
/> />
</el-form-item></el-col> </el-form-item></el-col>
<el-col :span="12"><el-form-item label="批号"><el-input v-model="recvItem.batchNo" placeholder="请输入批号" /></el-form-item></el-col> <el-col :span="12"><el-form-item label="批号"><el-input v-model="recvItem.batchNo" placeholder="请输入批号" /></el-form-item></el-col>
@ -335,9 +333,6 @@ export default {
if (row.status === 'Stopped' || row.status === 'Closed' || row.status === 'Cancelled') { if (row.status === 'Stopped' || row.status === 'Closed' || row.status === 'Cancelled') {
return this.$message.warning("该采购订单行状态为"+row.status+",无法接收"); return this.$message.warning("该采购订单行状态为"+row.status+",无法接收");
} }
if (row.convFactor !== 1) {
return this.$message.warning("采购计量单位和库存计量单位不一致,无法接收");
}
// 获取下一个itemNo // 获取下一个itemNo
let nextItemNo = 1; let nextItemNo = 1;
@ -589,14 +584,6 @@ export default {
: historyOptions; : historyOptions;
cb(result); cb(result);
}, },
handleLocationSelect(selectedItem) {
// 选中历史值后立即置顶,保证高频库位下次优先展示。
this.saveLocationHistory(selectedItem && selectedItem.value);
},
handleLocationBlur() {
// 失焦即缓存,覆盖“手输后直接切换焦点”的场景。
this.saveLocationHistory(this.recvItem.locationNo);
},
saveLocationHistory(locationNo) { saveLocationHistory(locationNo) {
const normalizedLocation = (locationNo || '').trim(); const normalizedLocation = (locationNo || '').trim();
if (!normalizedLocation) return; if (!normalizedLocation) return;
@ -736,7 +723,7 @@ export default {
receivePo(receiveData).then(({ data }) => { receivePo(receiveData).then(({ data }) => {
if (data.code === 0) { if (data.code === 0) {
this.$message.success("操作成功"); this.$message.success("操作成功");
// 提交成功后再记一次,避免只填了默认库位、未失焦就保存时漏记。
// 只在接收成功后写入库位历史,避免未提交或校验失败的库位进入下次建议。
this.saveLocationHistory(item.locationNo); this.saveLocationHistory(item.locationNo);
this.clearAllHandlingUnitCache(); this.clearAllHandlingUnitCache();
let printLabelType; let printLabelType;

Loading…
Cancel
Save