|
|
@ -11,22 +11,10 @@ |
|
|
|
|
|
|
|
|
<!-- 搜索框 --> |
|
|
<!-- 搜索框 --> |
|
|
<div class="search-container"> |
|
|
<div class="search-container"> |
|
|
<el-input |
|
|
|
|
|
clearable |
|
|
|
|
|
class="compact-input" |
|
|
|
|
|
v-model="scanCode" |
|
|
|
|
|
placeholder="请扫描物料标签" |
|
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
|
@keyup.enter.native="handleScan" |
|
|
|
|
|
ref="scanInput" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-input clearable class="compact-input" v-model="scanCode" placeholder="请扫描物料标签" prefix-icon="el-icon-search" |
|
|
|
|
|
@keyup.enter.native="handleScan" ref="scanInput" /> |
|
|
<div class="mode-switch"> |
|
|
<div class="mode-switch"> |
|
|
<el-switch |
|
|
|
|
|
class="custom-switch" |
|
|
|
|
|
v-model="isRemoveMode" |
|
|
|
|
|
active-color="#ff4949" |
|
|
|
|
|
inactive-color="#13ce66" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-switch class="custom-switch" v-model="isRemoveMode" active-color="#ff4949" inactive-color="#13ce66"> |
|
|
</el-switch> |
|
|
</el-switch> |
|
|
<span v-if="isRemoveMode" class="switch-text">{{ "移除" }}</span> |
|
|
<span v-if="isRemoveMode" class="switch-text">{{ "移除" }}</span> |
|
|
<span v-else class="switch-text2">{{ "添加" }}</span> |
|
|
<span v-else class="switch-text2">{{ "添加" }}</span> |
|
|
@ -34,22 +22,19 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 订单信息卡片(对齐直接发料明细样式) --> |
|
|
<!-- 订单信息卡片(对齐直接发料明细样式) --> |
|
|
<div class="work-order-list" v-if="orderInfo.orderNo"> |
|
|
|
|
|
|
|
|
<div class="work-order-list" v-if="orderNo"> |
|
|
<div class="work-order-card"> |
|
|
<div class="work-order-card"> |
|
|
<div class="card-title"> |
|
|
<div class="card-title"> |
|
|
<span class="title-label" |
|
|
|
|
|
>{{ |
|
|
|
|
|
orderInfo.type === "outsourcingOrder" ? "委外订单号" : "退料申请单号" |
|
|
|
|
|
|
|
|
<span class="title-label">{{ |
|
|
|
|
|
orderInfo.type === "outsourcingOrder" ? "委外单号" : "退料申请单号" |
|
|
}}:{{ orderInfo.orderNo }} 批次号:{{ batchNo }}</span> |
|
|
}}:{{ orderInfo.orderNo }} 批次号:{{ batchNo }}</span> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 关联信息单独一行 --> |
|
|
<!-- 关联信息单独一行 --> |
|
|
<div class="part-desc-row"> |
|
|
<div class="part-desc-row"> |
|
|
<span class="desc-text" |
|
|
|
|
|
>{{ orderInfo.type === "outsourcingOrder" ? "关联单号" : "关联委外订单" }}:{{ |
|
|
|
|
|
|
|
|
<span class="desc-text">{{ orderInfo.type === "outsourcingOrder" ? "关联单号" : "关联委外订单" }}:{{ |
|
|
orderInfo.transactionId |
|
|
orderInfo.transactionId |
|
|
}}</span |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
}}</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="part-desc-row"> |
|
|
<div class="part-desc-row"> |
|
|
<span class="desc-text">{{ orderInfo.partNo }}</span> |
|
|
<span class="desc-text">{{ orderInfo.partNo }}</span> |
|
|
@ -82,9 +67,7 @@ |
|
|
<span>退料信息确认</span> |
|
|
<span>退料信息确认</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="title-right"> |
|
|
<div class="title-right"> |
|
|
<span class="material-list-link" @click="showMaterialListDialog" |
|
|
|
|
|
>物料清单</span |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<span class="material-list-link" @click="showMaterialListDialog">物料清单</span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
@ -98,11 +81,7 @@ |
|
|
<div class="col-qty">退料数量</div> |
|
|
<div class="col-qty">退料数量</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div |
|
|
|
|
|
v-for="(label, index) in labelList" |
|
|
|
|
|
:key="label.id" |
|
|
|
|
|
class="list-item" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<div v-for="(label, index) in labelList" :key="label.id" class="list-item"> |
|
|
<div class="col-no">{{ index+1 }}</div> |
|
|
<div class="col-no">{{ index+1 }}</div> |
|
|
<div class="col-label">{{ label.labelCode }}</div> |
|
|
<div class="col-label">{{ label.labelCode }}</div> |
|
|
<!-- <div class="col-batch">{{ label.batchNo }}</div> --> |
|
|
<!-- <div class="col-batch">{{ label.batchNo }}</div> --> |
|
|
@ -121,20 +100,11 @@ |
|
|
|
|
|
|
|
|
<!-- 底部操作按钮 --> |
|
|
<!-- 底部操作按钮 --> |
|
|
<div class="bottom-actions"> |
|
|
<div class="bottom-actions"> |
|
|
<el-button |
|
|
|
|
|
class="action-btn primary" |
|
|
|
|
|
style="margin-left: 10px" |
|
|
|
|
|
:loading="loading" |
|
|
|
|
|
@click="confirmReturn" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-button class="action-btn primary" style="margin-left: 10px" :loading="loading" @click="confirmReturn"> |
|
|
确定退料 |
|
|
确定退料 |
|
|
</el-button> |
|
|
</el-button> |
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
class="action-btn secondary" |
|
|
|
|
|
style="margin-left: 10px" |
|
|
|
|
|
@click="cancelReturn" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<button class="action-btn secondary" style="margin-left: 10px" @click="cancelReturn"> |
|
|
取消 |
|
|
取消 |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
@ -164,11 +134,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="table-body"> |
|
|
<div class="table-body"> |
|
|
<div |
|
|
|
|
|
v-for="(item, index) in materialList" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
class="table-row" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<div v-for="(item, index) in materialList" :key="index" class="table-row"> |
|
|
<div class="col-no">{{ index + 1 }}</div> |
|
|
<div class="col-no">{{ index + 1 }}</div> |
|
|
<div class="col-material-code"> |
|
|
<div class="col-material-code"> |
|
|
{{ item.materialCode || item.partNo }} |
|
|
{{ item.materialCode || item.partNo }} |
|
|
@ -205,40 +171,22 @@ |
|
|
<div class="modal-body"> |
|
|
<div class="modal-body"> |
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="form-label">物料标签</label> |
|
|
<label class="form-label">物料标签</label> |
|
|
<el-input |
|
|
|
|
|
v-model="editForm.labelCode" |
|
|
|
|
|
disabled |
|
|
|
|
|
class="form-input" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-input v-model="editForm.labelCode" disabled class="form-input" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="form-label">批次号</label> |
|
|
<label class="form-label">批次号</label> |
|
|
<el-input |
|
|
|
|
|
v-model="editForm.batchNo" |
|
|
|
|
|
disabled |
|
|
|
|
|
class="form-input" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-input v-model="editForm.batchNo" disabled class="form-input" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="form-label">库位 <span class="required">*</span></label> |
|
|
<label class="form-label">库位 <span class="required">*</span></label> |
|
|
<el-input |
|
|
|
|
|
v-model="editForm.locationId" |
|
|
|
|
|
placeholder="请输入库位" |
|
|
|
|
|
class="form-input" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-input v-model="editForm.locationId" placeholder="请输入库位" class="form-input" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
<div class="form-group"> |
|
|
<label class="form-label">退料数量 <span class="required">*</span></label> |
|
|
<label class="form-label">退料数量 <span class="required">*</span></label> |
|
|
<el-input |
|
|
|
|
|
v-model="editForm.quantity" |
|
|
|
|
|
type="number" |
|
|
|
|
|
:min="0" |
|
|
|
|
|
placeholder="请输入退料数量" |
|
|
|
|
|
class="form-input" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<el-input v-model="editForm.quantity" type="number" :min="0" placeholder="请输入退料数量" class="form-input" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
@ -256,66 +204,66 @@ import { |
|
|
getInventoryPartForOutsourcing, |
|
|
getInventoryPartForOutsourcing, |
|
|
scanMaterialLabelForOutsourcing, |
|
|
scanMaterialLabelForOutsourcing, |
|
|
outsourcingReturnUnissueConfirm, |
|
|
outsourcingReturnUnissueConfirm, |
|
|
} from "@/api/outsourcing/outsourcing-return"; |
|
|
|
|
|
import moment from "moment"; |
|
|
|
|
|
|
|
|
} from '@/api/outsourcing/outsourcing-return' |
|
|
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
scanCode: "", |
|
|
|
|
|
|
|
|
scanCode: '', |
|
|
orderInfo: {}, |
|
|
orderInfo: {}, |
|
|
labelList: [], |
|
|
labelList: [], |
|
|
orderNo: "", |
|
|
|
|
|
orderType: "", |
|
|
|
|
|
|
|
|
orderNo: '', |
|
|
|
|
|
orderType: '', |
|
|
showMaterialDialog: false, |
|
|
showMaterialDialog: false, |
|
|
materialList: [], |
|
|
materialList: [], |
|
|
materialListLoading: false, |
|
|
materialListLoading: false, |
|
|
isRemoveMode: false, // 默认为添加模式 |
|
|
isRemoveMode: false, // 默认为添加模式 |
|
|
returnReason: "", |
|
|
|
|
|
partNo:"", // 物料编码 |
|
|
|
|
|
transactionId:"", // 关联单号 |
|
|
|
|
|
accountingId:"", // 会计科目 |
|
|
|
|
|
quantity:"", // 本次退料数量 |
|
|
|
|
|
|
|
|
returnReason: '', |
|
|
|
|
|
partNo: '', // 物料编码 |
|
|
|
|
|
transactionId: '', // 关联单号 |
|
|
|
|
|
accountingId: '', // 会计科目 |
|
|
|
|
|
quantity: '', // 本次退料数量 |
|
|
qtyReversed: 0, // 已退料数量 |
|
|
qtyReversed: 0, // 已退料数量 |
|
|
batchNo:"", // 批次号 |
|
|
|
|
|
|
|
|
batchNo: '', // 批次号 |
|
|
// 编辑弹框相关 |
|
|
// 编辑弹框相关 |
|
|
showEditDialog: false, |
|
|
showEditDialog: false, |
|
|
editForm: { |
|
|
editForm: { |
|
|
labelCode: '', |
|
|
labelCode: '', |
|
|
batchNo: '', |
|
|
batchNo: '', |
|
|
locationId: '', |
|
|
locationId: '', |
|
|
quantity: 0 |
|
|
|
|
|
|
|
|
quantity: 0, |
|
|
}, |
|
|
}, |
|
|
editIndex: -1, // 当前编辑的标签索引 |
|
|
editIndex: -1, // 当前编辑的标签索引 |
|
|
unissureQty: 0, // 需求数量 |
|
|
unissureQty: 0, // 需求数量 |
|
|
itemNo:'', // 物料ID |
|
|
|
|
|
|
|
|
itemNo: {}, // 物料ID |
|
|
loading: false, // 加载状态 |
|
|
loading: false, // 加载状态 |
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
totalScannedQty() { |
|
|
totalScannedQty() { |
|
|
return this.labelList.reduce( |
|
|
return this.labelList.reduce( |
|
|
(sum, l) => sum + (Number(l.quantity) || 0), |
|
|
(sum, l) => sum + (Number(l.quantity) || 0), |
|
|
0 |
|
|
0 |
|
|
); |
|
|
|
|
|
|
|
|
) |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
formatDate(date) { |
|
|
formatDate(date) { |
|
|
return date ? moment(date).format("YYYY-MM-DD") : ""; |
|
|
|
|
|
|
|
|
return date ? moment(date).format('YYYY-MM-DD') : '' |
|
|
}, |
|
|
}, |
|
|
// 处理扫描 |
|
|
// 处理扫描 |
|
|
handleScan() { |
|
|
handleScan() { |
|
|
if (!this.scanCode.trim()) { |
|
|
if (!this.scanCode.trim()) { |
|
|
return; |
|
|
|
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.isRemoveMode) { |
|
|
if (this.isRemoveMode) { |
|
|
this.removeLabelByCode(this.scanCode.trim()); |
|
|
|
|
|
|
|
|
this.removeLabelByCode(this.scanCode.trim()) |
|
|
} else { |
|
|
} else { |
|
|
this.validateAndAddLabel(this.scanCode.trim()); |
|
|
|
|
|
|
|
|
this.validateAndAddLabel(this.scanCode.trim()) |
|
|
} |
|
|
} |
|
|
this.scanCode = ""; |
|
|
|
|
|
|
|
|
this.scanCode = '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 验证标签并添加到列表(委外退料功能) |
|
|
// 验证标签并添加到列表(委外退料功能) |
|
|
@ -327,18 +275,19 @@ export default { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
batchNo: this.batchNo, |
|
|
batchNo: this.batchNo, |
|
|
componentPartNo: this.partNo, |
|
|
componentPartNo: this.partNo, |
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 委外退料标签验证 |
|
|
// 委外退料标签验证 |
|
|
scanMaterialLabelForOutsourcing(params).then(({data}) => { |
|
|
|
|
|
|
|
|
scanMaterialLabelForOutsourcing(params) |
|
|
|
|
|
.then(({ data }) => { |
|
|
if (data.code === 0 && data.labelInfo) { |
|
|
if (data.code === 0 && data.labelInfo) { |
|
|
// 检查是否已经扫描过 |
|
|
// 检查是否已经扫描过 |
|
|
const exists = this.labelList.find( |
|
|
const exists = this.labelList.find( |
|
|
(item) => item.labelCode === labelCode |
|
|
(item) => item.labelCode === labelCode |
|
|
); |
|
|
|
|
|
|
|
|
) |
|
|
if (exists) { |
|
|
if (exists) { |
|
|
this.$message.warning("该标签已扫描,请勿重复扫描"); |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
this.$message.warning('该标签已扫描,请勿重复扫描') |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 添加到列表 |
|
|
// 添加到列表 |
|
|
@ -351,30 +300,28 @@ export default { |
|
|
returnReason: data.labelInfo.returnReason, |
|
|
returnReason: data.labelInfo.returnReason, |
|
|
locationId: data.labelInfo.locationId, |
|
|
locationId: data.labelInfo.locationId, |
|
|
warehouseId: data.labelInfo.warehouseId, |
|
|
warehouseId: data.labelInfo.warehouseId, |
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
|
|
|
|
this.$message.success('操作成功') |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error( |
|
|
|
|
|
data.message || "该标签不符合退料要求,请检查" |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
this.$message.error(data.message || '该标签不符合退料要求,请检查') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
|
this.$message.error("操作失败"); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.$message.error('操作失败') |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 通过条码移除标签 |
|
|
// 通过条码移除标签 |
|
|
removeLabelByCode(labelCode) { |
|
|
removeLabelByCode(labelCode) { |
|
|
const index = this.labelList.findIndex( |
|
|
const index = this.labelList.findIndex( |
|
|
(item) => item.labelCode === labelCode |
|
|
(item) => item.labelCode === labelCode |
|
|
); |
|
|
|
|
|
|
|
|
) |
|
|
if (index !== -1) { |
|
|
if (index !== -1) { |
|
|
this.labelList.splice(index, 1); |
|
|
|
|
|
this.$message.success("操作成功"); |
|
|
|
|
|
|
|
|
this.labelList.splice(index, 1) |
|
|
|
|
|
this.$message.success('操作成功') |
|
|
} else { |
|
|
} else { |
|
|
this.$message.warning("未找到该标签"); |
|
|
|
|
|
|
|
|
this.$message.warning('未找到该标签') |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -384,150 +331,162 @@ export default { |
|
|
labelCode: label.labelCode, |
|
|
labelCode: label.labelCode, |
|
|
batchNo: label.batchNo, |
|
|
batchNo: label.batchNo, |
|
|
locationId: label.locationId || '', |
|
|
locationId: label.locationId || '', |
|
|
quantity: label.quantity |
|
|
|
|
|
}; |
|
|
|
|
|
this.editIndex = index; |
|
|
|
|
|
this.showEditDialog = true; |
|
|
|
|
|
|
|
|
quantity: label.quantity, |
|
|
|
|
|
} |
|
|
|
|
|
this.editIndex = index |
|
|
|
|
|
this.showEditDialog = true |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 关闭编辑弹框 |
|
|
// 关闭编辑弹框 |
|
|
closeEditDialog() { |
|
|
closeEditDialog() { |
|
|
this.showEditDialog = false; |
|
|
|
|
|
|
|
|
this.showEditDialog = false |
|
|
this.editForm = { |
|
|
this.editForm = { |
|
|
labelCode: '', |
|
|
labelCode: '', |
|
|
batchNo: '', |
|
|
batchNo: '', |
|
|
locationId: '', |
|
|
locationId: '', |
|
|
quantity: 0 |
|
|
|
|
|
}; |
|
|
|
|
|
this.editIndex = -1; |
|
|
|
|
|
|
|
|
quantity: 0, |
|
|
|
|
|
} |
|
|
|
|
|
this.editIndex = -1 |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 确认编辑 |
|
|
// 确认编辑 |
|
|
confirmEdit() { |
|
|
confirmEdit() { |
|
|
// 验证必填字段 |
|
|
// 验证必填字段 |
|
|
if (!this.editForm.locationId.trim()) { |
|
|
if (!this.editForm.locationId.trim()) { |
|
|
this.$message.warning('请输入库位'); |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
this.$message.warning('请输入库位') |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!this.editForm.quantity || this.editForm.quantity <= 0) { |
|
|
if (!this.editForm.quantity || this.editForm.quantity <= 0) { |
|
|
this.$message.warning('请输入有效的退料数量'); |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
this.$message.warning('请输入有效的退料数量') |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 更新标签信息 |
|
|
// 更新标签信息 |
|
|
if (this.editIndex >= 0 && this.editIndex < this.labelList.length) { |
|
|
if (this.editIndex >= 0 && this.editIndex < this.labelList.length) { |
|
|
this.labelList[this.editIndex].locationId = this.editForm.locationId; |
|
|
|
|
|
this.labelList[this.editIndex].quantity = Number(this.editForm.quantity); |
|
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
|
|
|
|
this.labelList[this.editIndex].locationId = this.editForm.locationId |
|
|
|
|
|
this.labelList[this.editIndex].quantity = Number(this.editForm.quantity) |
|
|
|
|
|
this.$message.success('修改成功') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.closeEditDialog(); |
|
|
|
|
|
|
|
|
this.closeEditDialog() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 确认委外退料 |
|
|
// 确认委外退料 |
|
|
confirmReturn() { |
|
|
confirmReturn() { |
|
|
if (this.labelList.length === 0) { |
|
|
if (this.labelList.length === 0) { |
|
|
this.$message.warning("请先扫描退料标签"); |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
this.$message.warning('请先扫描退料标签') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(this.totalScannedQty > this.orderInfo.quantity){ |
|
|
|
|
|
this.$message.warning('请先扫描退料数量大于发料数量') |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
|
this.loading = true |
|
|
const returnParams = { |
|
|
const returnParams = { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
outsourcingOrderNo: this.orderNo, |
|
|
outsourcingOrderNo: this.orderNo, |
|
|
orderType: this.orderType, |
|
|
orderType: this.orderType, |
|
|
batchNo: this.batchNo, |
|
|
batchNo: this.batchNo, |
|
|
componentPartNo: this.partNo, |
|
|
componentPartNo: this.partNo, |
|
|
warehouseId: '1', |
|
|
|
|
|
|
|
|
warehouseId: localStorage.getItem('selectedWarehouse'), |
|
|
transactionId: this.transactionId, |
|
|
transactionId: this.transactionId, |
|
|
accountingId: this.accountingId, |
|
|
accountingId: this.accountingId, |
|
|
itemNo:this.itemNo, |
|
|
|
|
|
|
|
|
lineNo: this.itemNo.lineNo, |
|
|
|
|
|
lineItemNo:this.itemNo.lineItemNo, |
|
|
|
|
|
releaseNo: this.itemNo.releaseNo, |
|
|
ifsReversedQty: this.qtyReversed, |
|
|
ifsReversedQty: this.qtyReversed, |
|
|
issueQty: this.quantity, |
|
|
issueQty: this.quantity, |
|
|
// 退料标签列表 |
|
|
// 退料标签列表 |
|
|
selectedMaterials: this.labelList.map((label) => ({ |
|
|
|
|
|
|
|
|
selectedMaterials: this.labelList.map((label,index) => ({ |
|
|
labelCode: label.labelCode, |
|
|
labelCode: label.labelCode, |
|
|
issueQty: label.quantity, |
|
|
issueQty: label.quantity, |
|
|
batchNo: label.batchNo, |
|
|
batchNo: label.batchNo, |
|
|
partNo: label.partNo, |
|
|
partNo: label.partNo, |
|
|
locationId: label.locationId, |
|
|
locationId: label.locationId, |
|
|
|
|
|
warehouseId: label.warehouseId, |
|
|
wdrNo: label.wdrNo || '*', |
|
|
wdrNo: label.wdrNo || '*', |
|
|
|
|
|
itemNo: index+1 |
|
|
})), |
|
|
})), |
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 委外退料确认API |
|
|
// 委外退料确认API |
|
|
outsourcingReturnUnissueConfirm(returnParams).then(({data}) => { |
|
|
|
|
|
|
|
|
outsourcingReturnUnissueConfirm(returnParams) |
|
|
|
|
|
.then(({ data }) => { |
|
|
if (data.code === 0 && data) { |
|
|
if (data.code === 0 && data) { |
|
|
this.$message.success("委外退料成功"); |
|
|
|
|
|
this.$router.push({ name: 'outsourcingReturn' }); |
|
|
|
|
|
|
|
|
this.$message.success('委外退料成功') |
|
|
|
|
|
this.$router.push({ name: 'outsourcingReturn' }) |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.message || "操作失败"); |
|
|
|
|
|
|
|
|
this.$message.error(data.message || '操作失败') |
|
|
} |
|
|
} |
|
|
}).catch(() => { |
|
|
|
|
|
this.$message.error("操作失败"); |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.loading = false; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.catch(() => { |
|
|
|
|
|
this.$message.error('操作失败') |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(() => { |
|
|
|
|
|
this.loading = false |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 取消退料 |
|
|
// 取消退料 |
|
|
cancelReturn() { |
|
|
cancelReturn() { |
|
|
if (this.labelList.length > 0) { |
|
|
if (this.labelList.length > 0) { |
|
|
this.$confirm("取消后将清空已扫描的标签,确定取消吗?", "提示", { |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "继续操作", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
|
|
|
this.$confirm('取消后将清空已扫描的标签,确定取消吗?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '继续操作', |
|
|
|
|
|
type: 'warning', |
|
|
}) |
|
|
}) |
|
|
.then(() => { |
|
|
.then(() => { |
|
|
this.$router.back(); |
|
|
|
|
|
|
|
|
this.$router.back() |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
|
// 用户选择继续操作 |
|
|
// 用户选择继续操作 |
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.$router.back(); |
|
|
|
|
|
|
|
|
this.$router.back() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 显示物料清单弹窗 |
|
|
// 显示物料清单弹窗 |
|
|
showMaterialListDialog() { |
|
|
showMaterialListDialog() { |
|
|
this.showMaterialDialog = true; |
|
|
|
|
|
this.loadMaterialList(); |
|
|
|
|
|
|
|
|
this.showMaterialDialog = true |
|
|
|
|
|
this.loadMaterialList() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 加载物料清单 |
|
|
// 加载物料清单 |
|
|
loadMaterialList() { |
|
|
loadMaterialList() { |
|
|
console.log("加载委外退料物料清单", this.orderInfo, this.orderNo); |
|
|
|
|
|
|
|
|
console.log('加载委外退料物料清单', this.orderInfo, this.orderNo) |
|
|
|
|
|
|
|
|
if (!this.$store.state.user.site || !this.orderNo) { |
|
|
if (!this.$store.state.user.site || !this.orderNo) { |
|
|
this.$message.error("缺少必要参数,无法获取物料清单"); |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
this.$message.error('缺少必要参数,无法获取物料清单') |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.materialListLoading = true; |
|
|
|
|
|
|
|
|
this.materialListLoading = true |
|
|
const params = { |
|
|
const params = { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
orderNo: this.orderNo, |
|
|
orderNo: this.orderNo, |
|
|
orderType: this.orderType, |
|
|
orderType: this.orderType, |
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 模拟获取物料清单 |
|
|
// 模拟获取物料清单 |
|
|
this.simulateMaterialList(params) |
|
|
this.simulateMaterialList(params) |
|
|
.then((data) => { |
|
|
.then((data) => { |
|
|
this.materialListLoading = false; |
|
|
|
|
|
|
|
|
this.materialListLoading = false |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.materialList = data.materials || []; |
|
|
|
|
|
|
|
|
this.materialList = data.materials || [] |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || "获取物料清单失败"); |
|
|
|
|
|
this.materialList = []; |
|
|
|
|
|
|
|
|
this.$message.error(data.msg || '获取物料清单失败') |
|
|
|
|
|
this.materialList = [] |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
|
this.materialListLoading = false; |
|
|
|
|
|
this.$message.error("获取物料清单失败"); |
|
|
|
|
|
this.materialList = []; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.materialListLoading = false |
|
|
|
|
|
this.$message.error('获取物料清单失败') |
|
|
|
|
|
this.materialList = [] |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 模拟物料清单API |
|
|
// 模拟物料清单API |
|
|
@ -536,71 +495,56 @@ export default { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
const mockMaterials = [ |
|
|
const mockMaterials = [ |
|
|
{ |
|
|
{ |
|
|
materialCode: "MAT001", |
|
|
|
|
|
partNo: "MAT001", |
|
|
|
|
|
|
|
|
materialCode: 'MAT001', |
|
|
|
|
|
partNo: 'MAT001', |
|
|
returnableQty: 100, |
|
|
returnableQty: 100, |
|
|
returnedQty: 20, |
|
|
returnedQty: 20, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
materialCode: "MAT002", |
|
|
|
|
|
partNo: "MAT002", |
|
|
|
|
|
|
|
|
materialCode: 'MAT002', |
|
|
|
|
|
partNo: 'MAT002', |
|
|
returnableQty: 200, |
|
|
returnableQty: 200, |
|
|
returnedQty: 50, |
|
|
returnedQty: 50, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
materialCode: "MAT003", |
|
|
|
|
|
partNo: "MAT003", |
|
|
|
|
|
|
|
|
materialCode: 'MAT003', |
|
|
|
|
|
partNo: 'MAT003', |
|
|
returnableQty: 150, |
|
|
returnableQty: 150, |
|
|
returnedQty: 0, |
|
|
returnedQty: 0, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
resolve({ |
|
|
resolve({ |
|
|
code: 0, |
|
|
code: 0, |
|
|
materials: mockMaterials, |
|
|
materials: mockMaterials, |
|
|
}); |
|
|
|
|
|
}, 500); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}, 500) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 关闭物料清单弹窗 |
|
|
// 关闭物料清单弹窗 |
|
|
closeMaterialDialog() { |
|
|
closeMaterialDialog() { |
|
|
this.showMaterialDialog = false; |
|
|
|
|
|
|
|
|
this.showMaterialDialog = false |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 加载订单详情 |
|
|
// 加载订单详情 |
|
|
loadOrderDetails() { |
|
|
loadOrderDetails() { |
|
|
const params = { |
|
|
|
|
|
orderNo: this.orderNo, |
|
|
|
|
|
orderType: this.orderType, |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
partNo:this.partNo |
|
|
|
|
|
}; |
|
|
|
|
|
console.log("加载订单详情参数:", params); |
|
|
|
|
|
|
|
|
|
|
|
// 物料详情接口 |
|
|
|
|
|
getInventoryPartForOutsourcing(params).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.orderInfo = data.inventoryPart[0] |
|
|
|
|
|
this.orderInfo.type = this.orderType |
|
|
this.orderInfo.type = this.orderType |
|
|
this.orderInfo.orderNo = this.orderNo |
|
|
this.orderInfo.orderNo = this.orderNo |
|
|
this.orderInfo.transactionId = this.transactionId |
|
|
this.orderInfo.transactionId = this.transactionId |
|
|
this.orderInfo.quantity = this.quantity |
|
|
this.orderInfo.quantity = this.quantity |
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || "获取订单详情失败"); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message.error("获取订单详情失败"); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.orderInfo.partNo = this.partNo |
|
|
|
|
|
console.log(this.orderInfo); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
mounted() { |
|
|
mounted() { |
|
|
// 获取路由参数 |
|
|
// 获取路由参数 |
|
|
console.log("路由参数:", this.$route.params.material); |
|
|
|
|
|
|
|
|
console.log('路由参数:', this.$route.params.material) |
|
|
|
|
|
|
|
|
this.orderNo = this.$route.params.outsourcingOrderNo; |
|
|
|
|
|
this.orderType = this.$route.params.material.orderType || "outsourcingOrder"; |
|
|
|
|
|
|
|
|
this.orderNo = this.$route.params.outsourcingOrderNo |
|
|
|
|
|
this.orderType = this.$route.params.material.orderType || 'outsourcingOrder' |
|
|
this.partNo = this.$route.params.material.partNo |
|
|
this.partNo = this.$route.params.material.partNo |
|
|
this.transactionId = this.$route.params.material.ifsTransactionID |
|
|
this.transactionId = this.$route.params.material.ifsTransactionID |
|
|
this.accountingId = this.$route.params.material.ifsAccountingID |
|
|
this.accountingId = this.$route.params.material.ifsAccountingID |
|
|
@ -611,22 +555,22 @@ export default { |
|
|
this.qtyReversed = this.$route.params.material.qtyReversedBy || 0 |
|
|
this.qtyReversed = this.$route.params.material.qtyReversedBy || 0 |
|
|
|
|
|
|
|
|
if (!this.orderNo) { |
|
|
if (!this.orderNo) { |
|
|
this.$message.error("参数错误"); |
|
|
|
|
|
this.$router.back(); |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
this.$message.error('参数错误') |
|
|
|
|
|
this.$router.back() |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 聚焦扫描框 |
|
|
// 聚焦扫描框 |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
if (this.$refs.scanInput) { |
|
|
if (this.$refs.scanInput) { |
|
|
this.$refs.scanInput.focus(); |
|
|
|
|
|
|
|
|
this.$refs.scanInput.focus() |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// 加载订单详情 |
|
|
// 加载订单详情 |
|
|
this.loadOrderDetails(); |
|
|
|
|
|
|
|
|
this.loadOrderDetails() |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|
@ -831,7 +775,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.detail-value .total::before { |
|
|
.detail-value .total::before { |
|
|
content: "/"; |
|
|
|
|
|
|
|
|
content: '/'; |
|
|
color: #333; |
|
|
color: #333; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|