Browse Source

库位校验

master
han\hanst 3 months ago
parent
commit
56f3e2740a
  1. 8
      src/api/po/po.js
  2. 84
      src/views/modules/recv/qualifiedStorage.vue

8
src/api/po/po.js

@ -56,4 +56,10 @@ export const getPurchaseOrderReceiptList = data => createAPI(`qualified-storage/
export const validateHandlingUnitForQualifiedStorage = data => createAPI(`qualified-storage/validateHandlingUnit`,'post',data) export const validateHandlingUnitForQualifiedStorage = data => createAPI(`qualified-storage/validateHandlingUnit`,'post',data)
// 确认检验合格入库 // 确认检验合格入库
export const confirmQualifiedStorage = data => createAPI(`qualified-storage/confirmQualifiedStorage`,'post',data)
export const confirmQualifiedStorage = data => createAPI(`qualified-storage/confirmQualifiedStorage`,'post',data)
// 校验库位类型是否匹配收货方式要求
export const validateLocationForReceiveCase = data => createAPI(`warehouse/validateLocationForReceiveCase`, 'post', data)
// 校验库位是否为PICKING类型(检验合格入库用)
export const validateLocationForPicking = data => createAPI(`warehouse/validateLocationForPicking`, 'post', data)

84
src/views/modules/recv/qualifiedStorage.vue

@ -251,7 +251,7 @@
</template> </template>
<script> <script>
import { getPurchaseOrderReceiptList, confirmQualifiedStorage, validateHandlingUnitForQualifiedStorage, getInboundHistory } from "@/api/po/po.js";
import { getPurchaseOrderReceiptList, confirmQualifiedStorage, validateHandlingUnitForQualifiedStorage, getInboundHistory, validateLocationForPicking } from "@/api/po/po.js";
export default { export default {
data() { data() {
@ -369,21 +369,60 @@ export default {
return; return;
} }
//
if (this.$refs.locationInput) {
this.$refs.locationInput.blur();
//
this.validateLocationForPickingType();
},
// PICKING
async validateLocationForPickingType() {
if (!this.targetLocationId.trim()) {
return;
} }
//
this.$nextTick(() => {
const bottomActions = document.querySelector('.bottom-actions');
if (bottomActions) {
bottomActions.scrollIntoView({
behavior: 'smooth',
block: 'end'
try {
const { data } = await validateLocationForPicking({
site: this.site,
locationId: this.targetLocationId.trim()
});
if (data.code === 0) {
//
if (this.$refs.locationInput) {
this.$refs.locationInput.blur();
}
this.$nextTick(() => {
const bottomActions = document.querySelector('.bottom-actions');
if (bottomActions) {
bottomActions.scrollIntoView({
behavior: 'smooth',
block: 'end'
});
}
});
} else {
this.$message.error(data.msg || '库位必须是PICKING类型');
//
this.targetLocationId = '';
//
this.$nextTick(() => {
if (this.$refs.locationInput) {
this.$refs.locationInput.focus();
}
}); });
} }
});
} catch (error) {
console.error('库位校验失败:', error);
this.$message.error('库位校验失败,请重试');
//
this.targetLocationId = '';
//
this.$nextTick(() => {
if (this.$refs.locationInput) {
this.$refs.locationInput.focus();
}
});
}
}, },
// //
@ -458,7 +497,7 @@ export default {
}, },
// //
confirmStorage() {
async confirmStorage() {
// //
if (!this.targetLocationId) { if (!this.targetLocationId) {
this.$message.error('请输入目标库位'); this.$message.error('请输入目标库位');
@ -470,6 +509,23 @@ export default {
return; return;
} }
//
try {
const { data } = await validateLocationForPicking({
site: this.site,
locationId: this.targetLocationId.trim()
});
if (data.code !== 0) {
this.$message.error(data.msg || '库位必须是PICKING类型');
return;
}
} catch (error) {
console.error('库位校验失败:', error);
this.$message.error('库位校验失败,请重试');
return;
}
// HandlingUnit // HandlingUnit
const totalScannedQty = this.scannedItems.reduce((sum, item) => sum + (parseFloat(item.qty) || 0), 0); const totalScannedQty = this.scannedItems.reduce((sum, item) => sum + (parseFloat(item.qty) || 0), 0);
const availableQty = this.getAvailableQty(); const availableQty = this.getAvailableQty();
@ -943,7 +999,7 @@ export default {
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background: rgba(255, 255, 255, 0.9);
background: rgba(255, 255, 255, 0.5);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

Loading…
Cancel
Save