diff --git a/src/api/production/production-issue.js b/src/api/production/production-issue.js index 174f2d2..4a5ed0c 100644 --- a/src/api/production/production-issue.js +++ b/src/api/production/production-issue.js @@ -43,4 +43,6 @@ export const confirmDirectIssue = data => createAPI(`/pda/production/issue/confi export const confirmProductionPicking = data => createAPI(`/pda/production/issue/confirmProductionPicking`,'post',data) +export const getShopOrderLine = data => createAPI(`/pda/production/issue/getShopOrderLine`,'post',data) + diff --git a/src/views/modules/production-issue/directIssue.vue b/src/views/modules/production-issue/directIssue.vue index 2ab9c40..b54a72a 100644 --- a/src/views/modules/production-issue/directIssue.vue +++ b/src/views/modules/production-issue/directIssue.vue @@ -16,11 +16,12 @@ v-model="workOrderNo" placeholder="请输入工单号" prefix-icon="el-icon-search" - @keyup.enter.native="handleSearchWorkOrder" + @keyup.enter.native="handleSearchWorkOrderByShopOrderLine" ref="workOrderInput" /> -
+ +
@@ -135,6 +136,7 @@ import { getWorkOrderInfo, getWorkOrderMaterials, + getShopOrderLine, } from "@/api/production/production-issue"; import moment from "moment"; @@ -215,7 +217,7 @@ export default { } }, - // 查询工单信息 + // 查询工单信息(原方法) handleSearchWorkOrder() { if (!this.workOrderNo.trim()) { this.$message.warning("请输入工单号"); @@ -258,6 +260,47 @@ export default { }); }, + // 查询工单信息(使用ShopOrderLine方法) + handleSearchWorkOrderByShopOrderLine() { + if (!this.workOrderNo.trim()) { + this.$message.warning("请输入工单号"); + return; + } + + this.loading = true; + const params = { + workOrderNo: this.workOrderNo.trim(), + site: localStorage.getItem('site'), + }; + + getShopOrderLine(params) + .then(({ data }) => { + this.loading = false; + console.log("工单信息", data); + + if ( + data.workOrders && + data.workOrders.length > 0 && + data.code === 0 + ) { + this.workOrderList = data.workOrders; + this.selectedWorkOrder = null; + this.materialList = []; + this.showOnlySelected = false; + } else { + this.$message.error(data.msg ||"未找到该工单信息"); + this.workOrderList = []; + this.selectedWorkOrder = null; + this.materialList = []; + this.showOnlySelected = false; + } + }) + .catch((error) => { + this.loading = false; + this.$message.error(error.msg || "查询工单信息失败"); + }); + }, + // 判断是否为同一工单 isSameWorkOrder(a, b) { if (!a || !b) return false; diff --git a/src/views/modules/production-return/productionReturnPicking.vue b/src/views/modules/production-return/productionReturnPicking.vue index bae7739..97b574e 100644 --- a/src/views/modules/production-return/productionReturnPicking.vue +++ b/src/views/modules/production-return/productionReturnPicking.vue @@ -18,11 +18,12 @@ v-model="workOrderNo" placeholder="请输入工单号" prefix-icon="el-icon-search" - @keyup.enter.native="handleSearchWorkOrder" + @keyup.enter.native="handleSearchWorkOrderByShopOrderLine" ref="workOrderInput" />
-
+ + - +
- 工单号:{{ material.orderNo }} + 工单号:{{ material.orderNo }}-{{material.releaseNo}}-{{material.sequenceNo}}
@@ -138,7 +136,7 @@