|
|
|
@ -15,7 +15,7 @@ |
|
|
|
clearable |
|
|
|
class="compact-input" |
|
|
|
v-model="scanCode" |
|
|
|
placeholder="请扫描物料标签或批次号" |
|
|
|
placeholder="请扫描物料标签" |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
@keyup.enter.native="handleScan" |
|
|
|
ref="scanInput" |
|
|
|
@ -40,8 +40,7 @@ |
|
|
|
<span class="title-label" |
|
|
|
>{{ |
|
|
|
orderInfo.type === "workOrder" ? "工单号" : "退料申请单号" |
|
|
|
}}:{{ orderInfo.orderNo }}</span |
|
|
|
> |
|
|
|
}}:{{ orderInfo.orderNo }} 批次号:{{ batchNo }}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 关联信息单独一行 --> |
|
|
|
@ -61,8 +60,8 @@ |
|
|
|
|
|
|
|
<div class="card-details"> |
|
|
|
<div class="detail-item"> |
|
|
|
<div class="detail-label">退料物料</div> |
|
|
|
<div class="detail-value">{{ orderInfo.qtyToUnissue }}</div> |
|
|
|
<div class="detail-label">所需退量</div> |
|
|
|
<div class="detail-value">{{ unissureQty }}</div> |
|
|
|
</div> |
|
|
|
<div class="detail-item"> |
|
|
|
<div class="detail-label">领料数量</div> |
|
|
|
@ -94,7 +93,7 @@ |
|
|
|
<div class="list-header"> |
|
|
|
<div class="col-no">NO.</div> |
|
|
|
<div class="col-label">物料标签</div> |
|
|
|
<div class="col-batch">批次号</div> |
|
|
|
<!-- <div class="col-batch">批次号</div> --> |
|
|
|
<div class="col-part">库位</div> |
|
|
|
<div class="col-qty">退料数量</div> |
|
|
|
</div> |
|
|
|
@ -104,9 +103,9 @@ |
|
|
|
:key="label.id" |
|
|
|
class="list-item" |
|
|
|
> |
|
|
|
<div class="col-no">{{ labelList.length - index }}</div> |
|
|
|
<div class="col-no">{{ index+1 }}</div> |
|
|
|
<div class="col-label">{{ label.labelCode }}</div> |
|
|
|
<div class="col-batch">{{ label.batchNo }}</div> |
|
|
|
<!-- <div class="col-batch">{{ label.batchNo }}</div> --> |
|
|
|
<div class="col-part">{{ label.locationId }}</div> |
|
|
|
<div class="col-qty" @click="openEditDialog(label, index)"> |
|
|
|
<span class="quantity-display">{{ label.quantity }}</span> |
|
|
|
@ -121,7 +120,7 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 退料原因选择 --> |
|
|
|
<div class="return-reason-section"> |
|
|
|
<!-- <div class="return-reason-section"> |
|
|
|
<div class="reason-title">退料原因</div> |
|
|
|
<el-select |
|
|
|
v-model="returnReason" |
|
|
|
@ -134,7 +133,7 @@ |
|
|
|
<el-option label="生产变更" value="PRODUCTION_CHANGE"></el-option> |
|
|
|
<el-option label="其他原因" value="OTHER"></el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
|
|
|
|
<!-- 底部操作按钮 --> |
|
|
|
<div class="bottom-actions"> |
|
|
|
@ -365,7 +364,9 @@ import { |
|
|
|
// getWorkOrderMaterials, |
|
|
|
// parseMaterialLabel, |
|
|
|
// directReturn, |
|
|
|
getInventoryPart |
|
|
|
getInventoryPart, |
|
|
|
scanMaterialLabel, |
|
|
|
productionReturnUnissueConfirm, |
|
|
|
} from "@/api/production/production-return"; |
|
|
|
import moment from "moment"; |
|
|
|
|
|
|
|
@ -398,6 +399,7 @@ export default { |
|
|
|
quantity: 0 |
|
|
|
}, |
|
|
|
editIndex: -1, // 当前编辑的标签索引 |
|
|
|
unissureQty:0, // 需求数量 |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -429,16 +431,15 @@ export default { |
|
|
|
// 验证标签并添加到列表(保留生产退仓功能) |
|
|
|
validateAndAddLabel(labelCode) { |
|
|
|
const params = { |
|
|
|
labelCode: labelCode, |
|
|
|
scannedLabel: labelCode, |
|
|
|
orderNo: this.orderNo, |
|
|
|
orderType: this.orderType, |
|
|
|
site: this.$store.state.user.site, |
|
|
|
}; |
|
|
|
|
|
|
|
// 模拟生产退料标签验证 |
|
|
|
this.simulateReturnLabelScan(params) |
|
|
|
.then((result) => { |
|
|
|
if (result.success) { |
|
|
|
scanMaterialLabel(params).then(({data}) => { |
|
|
|
if (data.code === 0 && data) { |
|
|
|
// 检查是否已经扫描过 |
|
|
|
const exists = this.labelList.find( |
|
|
|
(item) => item.labelCode === labelCode |
|
|
|
@ -452,10 +453,10 @@ export default { |
|
|
|
this.labelList.push({ |
|
|
|
id: Date.now(), |
|
|
|
labelCode: labelCode, |
|
|
|
partNo: result.data.partNo, |
|
|
|
quantity: result.data.quantity, |
|
|
|
batchNo: result.data.batchNo, |
|
|
|
returnReason: result.data.returnReason, |
|
|
|
partNo: data.labelInfo.partNo, |
|
|
|
quantity: data.labelInfo.quantity, |
|
|
|
batchNo: data.labelInfo.batchNo, |
|
|
|
returnReason: data.labelInfo.returnReason, |
|
|
|
}); |
|
|
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
@ -561,10 +562,9 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
const returnParams = { |
|
|
|
site: this.orderInfo.site, |
|
|
|
site: this.$store.state.user.site, |
|
|
|
orderNo: this.orderNo, |
|
|
|
orderType: this.orderType, |
|
|
|
returnReason: this.returnReason, |
|
|
|
labels: this.labelList.map((label) => ({ |
|
|
|
labelCode: label.labelCode, |
|
|
|
quantity: label.quantity, |
|
|
|
@ -574,32 +574,18 @@ export default { |
|
|
|
}; |
|
|
|
|
|
|
|
// 模拟生产退料确认API |
|
|
|
this.simulateReturnConfirm(returnParams) |
|
|
|
.then((result) => { |
|
|
|
if (result.success) { |
|
|
|
productionReturnUnissueConfirm(returnParams).then(({data}) => { |
|
|
|
if (data.code === 0 && data) { |
|
|
|
this.$message.success("生产退料成功"); |
|
|
|
this.$router.back(); |
|
|
|
} else { |
|
|
|
this.$message.error(result.message || "操作失败"); |
|
|
|
this.$message.error(data.message || "操作失败"); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error("操作失败"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 模拟生产退料确认API |
|
|
|
simulateReturnConfirm() { |
|
|
|
return new Promise((resolve) => { |
|
|
|
setTimeout(() => { |
|
|
|
resolve({ |
|
|
|
success: true, |
|
|
|
message: "生产退料成功", |
|
|
|
}); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 打印标签 |
|
|
|
printLabels() { |
|
|
|
|
|
|
|
@ -812,6 +798,7 @@ export default { |
|
|
|
this.transactionId = this.$route.params.transactionId |
|
|
|
this.quantity = this.$route.params.quantity |
|
|
|
this.batchNo = this.$route.params.batchNo |
|
|
|
this.unissureQty = this.$route.params.unissureQty |
|
|
|
console.log("订单号:", this.orderNo, "订单类型:", this.orderType,"物料编码:",this.partNo); |
|
|
|
|
|
|
|
if (!this.orderNo) { |
|
|
|
@ -1046,7 +1033,7 @@ export default { |
|
|
|
justify-content: space-between; |
|
|
|
padding: 6px 8px; |
|
|
|
background: white; |
|
|
|
margin: 0 16px; |
|
|
|
margin: 0 10px; |
|
|
|
margin-top: 4px; |
|
|
|
border-radius: 8px 8px 0 0; |
|
|
|
border-bottom: 2px solid #17b3a3; |
|
|
|
@ -1056,7 +1043,7 @@ export default { |
|
|
|
/* 工单列表容器背景与间距 */ |
|
|
|
.work-order-list { |
|
|
|
overflow-y: auto; |
|
|
|
padding: 12px 16px; |
|
|
|
padding: 10px 10px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 工单卡片具有白色背景、圆角、阴影与边框一致性 */ |
|
|
|
@ -1064,7 +1051,7 @@ export default { |
|
|
|
background: white; |
|
|
|
border-radius: 8px; |
|
|
|
margin-bottom: 12px; |
|
|
|
padding: 16px; |
|
|
|
padding: 10px; |
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
|
|
|
transition: all 0.2s ease; |
|
|
|
border: 2px solid transparent; |
|
|
|
@ -1130,9 +1117,11 @@ export default { |
|
|
|
/* 标签列表 */ |
|
|
|
.label-list { |
|
|
|
background: white; |
|
|
|
margin: 0 16px 12px; |
|
|
|
margin: 0 10px 12px; |
|
|
|
border-radius: 0 0 8px 8px; |
|
|
|
overflow: hidden; |
|
|
|
max-height: 300px; |
|
|
|
overflow-y: auto; |
|
|
|
} |
|
|
|
|
|
|
|
.list-header { |
|
|
|
@ -1143,6 +1132,9 @@ export default { |
|
|
|
font-size: 12px; |
|
|
|
color: #666; |
|
|
|
font-weight: 500; |
|
|
|
position: sticky; |
|
|
|
top: 0; |
|
|
|
z-index: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.list-item { |
|
|
|
@ -1163,7 +1155,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.col-label { |
|
|
|
flex: 2; |
|
|
|
flex: 4; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
@ -1242,7 +1234,6 @@ export default { |
|
|
|
padding: 16px; |
|
|
|
gap: 20px; |
|
|
|
background: white; |
|
|
|
margin-top: auto; |
|
|
|
} |
|
|
|
|
|
|
|
.action-btn { |
|
|
|
|