From 2117d55f9da1de7e0052324bc774aa4567926a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=B4=E8=BE=89?= Date: Fri, 21 Mar 2025 18:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E9=80=80=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/StockOut/index.ts | 7 +++ src/views/stockOut/PurReturn/index.vue | 71 ++++++++++++------------- src/views/stocked/MoveLibrary/index.vue | 8 +-- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/src/api/StockOut/index.ts b/src/api/StockOut/index.ts index ae7fa85..1975e7a 100644 --- a/src/api/StockOut/index.ts +++ b/src/api/StockOut/index.ts @@ -72,6 +72,13 @@ export function DeAssignShipRequest(data: any) { data: data, }); } +export function AssignAndDessign(data: any) { + return request({ + url: '/api/AssignAndDessign/AssignAndDessignM', + method: 'post', + data: data, + }); +} export function AssignShipRequestByCharge(data: any) { return request({ url: '/api/SaleOut/AssignShipRequestByCharge', diff --git a/src/views/stockOut/PurReturn/index.vue b/src/views/stockOut/PurReturn/index.vue index 10aa636..a6dce00 100644 --- a/src/views/stockOut/PurReturn/index.vue +++ b/src/views/stockOut/PurReturn/index.vue @@ -128,6 +128,8 @@ import { useRouter } from "vue-router"; import { create } from "sortablejs"; import { FirstInFirstOut, IFTRUE } from '@/utils/CommonUtil' import { bTableHeight } from "../../../composables/calcTableHeight"; +import { AssignAndDessign } from '@/api/StockOut' +import { localStorage } from '@/utils/storage' const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(440); const queryFormRef = ref(ElForm); @@ -153,7 +155,7 @@ const state: any = reactive({ queryId: "", version: "", params: { - SITENAME: 'SDK',//localStorage.getItem("siteName"), + SITENAME: 'SDK',//localStorage.get("siteName"), DELIVERYTYPE: "", //移动类型 SUPPLIERNAME: "", RECEIVEREQUESTNAME: "", @@ -211,7 +213,7 @@ const state: any = reactive({ header: { MESSAGENAME: '', LANGUAGE: 'Chinese', - EventUser: localStorage.getItem('userId') || '10975133' + EventUser: localStorage.get('userId') }, body: { RECEIVEREQUESTNAME: '', @@ -388,25 +390,21 @@ async function LeftIn() { if (state.MaterialPackingList.length > 0 && state.column4.length > 0) { state.loading = true; - state.ChangeParams.header.MESSAGENAME = 'AssignReceiveRequestToBox2ForSDK'; - state.ChangeParams.body.RECEIVEREQUESTDETAILNAME = state.queryParams.params.SHIPREQUESTDETAILNAME - // state.ChangeParams.body.RECEIVEREQUESTDETAILNAME = "0001" - state.ChangeParams.body.RECEIVEREQUESTNAME = state.queryParams.params.SHIPREQUESTNAME - state.ChangeParams.body.MATERIALQUANTITY = 0 - // 遍历 state.column4,将 MATERIALPACKINGNAME 添加到 packingNames 数组中 - state.ChangeParams.body.objPara = [] - for (const item of state.column4) { - state.ChangeParams.body.objPara.push(item.MATERIALPACKINGNAME); - state.ChangeParams.body.MATERIALQUANTITY += item.MATERIALQUANTITY; - } - // 如果 packingNames 数组不为空,则将其转换为一个由“、”分隔的字符串 - if (state.ChangeParams.body.objPara.length > 0) { - state.ChangeParams.body.MATERIALPACKINGNAME = state.ChangeParams.body.objPara.join(";"); - } else { - // 如果 packingNames 为空,可以根据需要设置初始值,或者保持为空字符串 - state.ChangeParams.body.MATERIALPACKINGNAME = ""; - } - await BpelEvent(state.ChangeParams).then((res: any) => { + let boxList = []; + for (const item of state.column4) { + boxList.push({ + materialPackingName: item.MATERIALPACKINGNAME, + siteName: "SDK" + }); + } + let param = { + userId: localStorage.get('userId'), + opType: "Assign", + receiveRequestName: state.queryParams.params.SHIPREQUESTNAME, + receiveRequestDetailName: state.queryParams.params.SHIPREQUESTDETAILNAME, + boxList : boxList + }; + AssignAndDessign(param).then((res: any) => { if (IFTRUE(res)) { handle(tempRow, tempevent, tempcolumn); handleQuery(); @@ -439,25 +437,22 @@ async function LeftIn() { async function RightIn() { if (state.column3.length > 0) { state.loading2 = true; - state.ChangeParams.header.MESSAGENAME = 'DeassignShipRequestFromBox2'; - state.ChangeParams.body.RECEIVEREQUESTDETAILNAME = state.RightqueryParams.params.RECEIVEREQUESTDETAILNAME - state.ChangeParams.body.RECEIVEREQUESTNAME = state.RightqueryParams.params.RECEIVEREQUESTNAME - state.ChangeParams.body.MATERIALQUANTITY = 0 - // 遍历 state.column4,将 MATERIALPACKINGNAME 添加到 packingNames 数组中 - state.ChangeParams.body.objPara = [] + let boxList = []; for (const item of state.column3) { - state.ChangeParams.body.objPara.push(item.MATERIALPACKINGNAME); - state.ChangeParams.body.MATERIALQUANTITY += item.MATERIALQUANTITY; + boxList.push({ + materialPackingName: item.MATERIALPACKINGNAME, + siteName: "SDK" + }); } - // 如果 packingNames 数组不为空,则将其转换为一个由“、”分隔的字符串 - if (state.ChangeParams.body.objPara.length > 0) { - state.ChangeParams.body.MATERIALPACKINGNAME = state.ChangeParams.body.objPara.join(";"); - } else { - // 如果 packingNames 为空,可以根据需要设置初始值,或者保持为空字符串 - state.ChangeParams.body.MATERIALPACKINGNAME = ""; - } - await BpelEvent(state.ChangeParams).then((res: any) => { + let param = { + userId: localStorage.get('userId'), + opType: "Dessign", + receiveRequestName: state.queryParams.params.SHIPREQUESTNAME, + receiveRequestDetailName: state.queryParams.params.SHIPREQUESTDETAILNAME, + boxList : boxList + }; + AssignAndDessign(param).then((res: any) => { if (IFTRUE(res)) { handle(tempRow, tempevent, tempcolumn); handleQuery(); @@ -496,7 +491,7 @@ async function handleStockOut() { state.button_state = true; state.button_loadings = true; state.ReserveParams.header.MESSAGENAME = 'CompleteShipRequestForPurReturn' - state.ReserveParams.body.SITENAME = localStorage.getItem("siteName") == null ? "SDK" : localStorage.getItem("siteName"); + state.ReserveParams.body.SITENAME = localStorage.get("siteName") == null ? "SDK" : localStorage.get("siteName"); state.ReserveParams.body.RECEIVEREQUESTNAME = state.queryParams.params.RECEIVEREQUESTNAME state.ReserveParams.body.RECEIVEREQUESTNAME = state.queryParams.params.RECEIVEREQUESTNAME state.ReserveParams.body.RECEIVEREQUESTDETAILNAME = state.queryParams.params.SHIPREQUESTDETAILNAME diff --git a/src/views/stocked/MoveLibrary/index.vue b/src/views/stocked/MoveLibrary/index.vue index b5089b2..9859dd3 100644 --- a/src/views/stocked/MoveLibrary/index.vue +++ b/src/views/stocked/MoveLibrary/index.vue @@ -419,13 +419,15 @@ async function handleReserve() { state.button_loading = true state.BoxList = [] state.Button_state = true - if (state.column3.length > 0 || state.column4.length > 0) { + console.log(state.column3) + console.log(state.column4) + if (state.MaterialPackingUsername.length > 0 ) { state.ChangeParams.header.EVENTUSER = localStorage.getItem('userId') || '10975133' state.ChangeParams.header.MESSAGENAME = 'ModifyERPLocation' state.ChangeParams.body.AREANAME = state.StorageSelect[0] state.ChangeParams.body.LOCATIONNAME = state.StorageSelect[1] - for (let item = 0; item < state.column3.length; item++) { - state.BoxList.push({ BoxL: state.column3[item].MATERIALPACKINGNAME }) + for (let item = 0; item < state.MaterialPackingUsername.length; item++) { + state.BoxList.push({ BoxL: state.MaterialPackingUsername[item].MATERIALPACKINGNAME }) } state.ChangeParams.body.BOXList = state.BoxList // await BpelEvent(state.ChangeParams)