Browse Source

采购校验

master
han\hanst 3 months ago
parent
commit
caacf0bd85
  1. 46
      src/views/modules/recv/recv.vue
  2. 49
      src/views/modules/recv/unqualifiedProcess.vue

46
src/views/modules/recv/recv.vue

@ -1,6 +1,9 @@
<template>
<div>
<div class="pda-container" v-loading.fullscreen.lock="fullscreenLoading">
<div class="pda-container" v-loading.fullscreen.lock="fullscreenLoading"
element-loading-background="rgba(255, 255, 255, 0.3)"
element-loading-spinner="el-icon-loading"
:element-loading-text="loadingText">
<div class="status-bar">
<div class="goBack" @click="handleBack"><i class="el-icon-arrow-left"></i>上一页</div>
<div class="goBack">登记到达</div>
@ -156,7 +159,8 @@ export default {
hanlingItem: { code: '', qty: '', perQty: '', packageQty: '' },
site:localStorage.getItem('site'),
warehouseId:localStorage.getItem('selectedWarehouse'),
fullscreenLoading: false // loading
fullscreenLoading: false, // loading
loadingText: '加载中...' // loading
};
},
computed: {
@ -194,6 +198,11 @@ export default {
},
searchPoList() {
if (!this.scanCode) return this.poList = [];
// loading
this.loadingText = '搜索中...';
this.fullscreenLoading = true;
getPoList({ poNumber: this.scanCode,site: this.site }).then(({ data }) => {
if (data.code === 0) {
this.poList = data.rows
@ -206,9 +215,18 @@ export default {
this.$refs.scanCodeRef.blur();
}
});
}).catch(error => {
console.error('搜索失败:', error);
this.$message.error('搜索失败,请重试');
}).finally(() => {
// loading
this.fullscreenLoading = false;
});
},
async recvLine(row) {
if (row.authorizationRequired=='TRUE') {
return this.$message.warning("该采购订单需要审核,无法接收");
}
if (row.receiveCaseDB!='INVDIR' && row.receiveCaseDB!='QAINV' && row.receiveCaseDB!='ARRINV') {
return this.$message.warning("该采购订单行的收货方式为"+row.receiveCase+",无法接收");
}
@ -323,6 +341,7 @@ export default {
},
async receivePo() {
if (this.fullscreenLoading) return; //
this.loadingText = '提交中...';
this.fullscreenLoading = true;
const item = this.recvItem;
if (!item.transQty || !item.locationNo || !item.batchNo) {
@ -363,6 +382,8 @@ export default {
deliveryDate: item.deliveryDate,
arrivalDate: item.arrivalDate,
supplierBatchNo: item.supplierBatchNo,
samplePercent: item.samplePercent || 0,
sampleQty: item.sampleQty || 0,
// PO
poNo: item.poNumber || item.poNo,
orderNo: item.orderNo,
@ -491,4 +512,25 @@ export default {
background: #17b3a3;
color: white;
}
/* 自定义loading样式 */
.pda-container >>> .el-loading-mask {
background-color: rgba(255, 255, 255, 0.3) !important;
}
.pda-container >>> .el-loading-spinner {
margin-top: -25px;
}
.pda-container >>> .el-loading-spinner .circular {
width: 35px;
height: 35px;
}
.pda-container >>> .el-loading-text {
color: #17b3a3 !important;
font-size: 14px;
font-weight: 500;
margin-top: 10px;
}
</style>

49
src/views/modules/recv/unqualifiedProcess.vue

@ -57,7 +57,7 @@
<div class="detail-item">
<div class="detail-label">已扫描数量</div>
<div class="detail-value">
<span class="scanned">{{ getTotalScannedQty() }}</span>
<span :class="getScannedQtyClass()">{{ getTotalScannedQty() }}</span>
</div>
</div>
</div>
@ -241,6 +241,12 @@ export default {
return;
}
//
if (this.processInfo.transNo && huInfo.batchNo !== this.processInfo.transNo) {
this.$message.error('单据号不匹配,请检查');
return;
}
//
if (this.processInfo.partNo && huInfo.partNo !== this.processInfo.partNo) {
this.$message.error('物料编码不匹配,请检查');
@ -286,6 +292,20 @@ export default {
}, 0);
},
//
getScannedQtyClass() {
const totalScannedQty = this.getTotalScannedQty();
const unqualifiedQty = parseFloat(this.processInfo.unqualifiedQty) || 0;
if (totalScannedQty === 0) {
return 'scanned-empty';
} else if (totalScannedQty === unqualifiedQty) {
return 'scanned-match';
} else {
return 'scanned-mismatch';
}
},
//
confirmProcess() {
if (this.scannedItems.length === 0) {
@ -293,6 +313,16 @@ export default {
return;
}
// 退/
const totalScannedQty = this.getTotalScannedQty();
const unqualifiedQty = parseFloat(this.processInfo.unqualifiedQty) || 0;
if (totalScannedQty !== unqualifiedQty) {
const processTitle = this.getProcessTitle();
this.$message.error(`扫描的HU总数量(${totalScannedQty})与${processTitle}数量(${unqualifiedQty})不一致,请检查!`);
return;
}
const processTitle = this.getProcessTitle();
this.$confirm(`确认要${processTitle}这些物料吗?`, '提示', {
confirmButtonText: '确定',
@ -310,6 +340,7 @@ export default {
const handlingUnitIds = this.scannedItems.map(item => item.unitId);
const params = {
site: localStorage.getItem('site'),
transNo: this.processInfo.transNo,
processType: this.processInfo.processType,
handlingUnitIds: handlingUnitIds
@ -581,6 +612,22 @@ export default {
color: #333;
}
/* 已扫描数量样式 */
.detail-value .scanned-empty {
color: #909399;
font-weight: 500;
}
.detail-value .scanned-match {
color: #67C23A;
font-weight: 600;
}
.detail-value .scanned-mismatch {
color: #F56C6C;
font-weight: 600;
}
/* 区域标题 */
.section-title {
display: flex;

Loading…
Cancel
Save