From 85ebc8de4934cfbcf4291345c40c7d11f490b570 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 10 Jul 2024 13:44:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4WMS=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=AD=E6=89=80=E6=9C=89BOM=E7=89=88=E6=9C=AC=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionplan/productionMain/index.vue | 19 ++++++++++++++++++- .../productionMainAssemble/index.vue | 18 +++++++++++++++++- .../productionMainAssembleSparePart/index.vue | 18 +++++++++++++++++- .../productionMainPredictSparePart/index.vue | 18 +++++++++++++++++- .../productreceiptRequestMain/index.vue | 16 ++++++++++++++++ .../index.vue | 16 ++++++++++++++++ .../productreceiptscrapRequestMain/index.vue | 18 ++++++++++++++++-- 7 files changed, 117 insertions(+), 6 deletions(-) diff --git a/src/views/wms/productionManage/productionplan/productionMain/index.vue b/src/views/wms/productionManage/productionplan/productionMain/index.vue index ef854e67a..2f6dfc3bf 100644 --- a/src/views/wms/productionManage/productionplan/productionMain/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMain/index.vue @@ -87,6 +87,7 @@ import * as ProductionMainApi from '@/api/wms/productionMain' import * as ProductionDetailApi from '@/api/wms/productionDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as ItemBasicApi from '@/api/wms/itembasic' +import * as BomApi from "@/api/wms/bom"; // 生产计划主 // 预生产计划 @@ -119,10 +120,26 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // }) if(formField=='itemCode'){ // row[formField] = val[0][searchField] - val.forEach(item=>{ + val.forEach(async item=>{ if(tableData.value.find(item1=>item1['id'] == item['id'])) return const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow['id'] = item['id'] + // 查看BOM版本 + console.log(22,item) + const param1 = { + productItemCode: item['itemCode'], + available: 'TRUE', + pageSize: 20, + pageNo: 1, + sort: '', + by: 'ASC', + } + await BomApi.getBomPage(param1).then(res => { + console.log(res) + if(res?.list?.length>0){ + newRow['bomVersion'] = res.list[0].version + } + }) tableData.value.push(newRow) }) } else { diff --git a/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue b/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue index 0afec4008..4d196be98 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue @@ -87,6 +87,7 @@ import * as ProductionMainApi from '@/api/wms/productionMain' import * as ProductionDetailApi from '@/api/wms/productionDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as ItemBasicApi from '@/api/wms/itembasic' +import * as BomApi from "@/api/wms/bom"; // 装配计划 defineOptions({ name: 'ProductionMainAssemble' }) @@ -116,10 +117,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // }).catch(err =>{ // console.log(err); // }) - val.forEach(item=>{ + val.forEach(async item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow[formField] = item[searchField] newRow['uom'] = item['uom'] + // 查看BOM版本 + const param1 = { + productItemCode: item['itemCode'], + available: 'TRUE', + pageSize: 20, + pageNo: 1, + sort: '', + by: 'ASC', + } + await BomApi.getBomPage(param1).then(res => { + console.log(res) + if(res?.list?.length>0){ + newRow['bomVersion'] = res.list[0].version + } + }) tableData.value.push(newRow) }) } else { diff --git a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue index 41164cefb..0592934c1 100644 --- a/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue @@ -87,6 +87,7 @@ import * as ProductionMainApi from '@/api/wms/productionMain' import * as ProductionDetailApi from '@/api/wms/productionDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as ItemBasicApi from '@/api/wms/itembasic' +import * as BomApi from "@/api/wms/bom"; // 装配备件计划 defineOptions({ name: 'ProductionMainASparePart' }) @@ -116,10 +117,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // }).catch(err =>{ // console.log(err); // }) - val.forEach(item=>{ + val.forEach(async item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow[formField] = item[searchField] newRow['uom'] = item['uom'] + // 查看BOM版本 + const param1 = { + productItemCode: item['itemCode'], + available: 'TRUE', + pageSize: 20, + pageNo: 1, + sort: '', + by: 'ASC', + } + await BomApi.getBomPage(param1).then(res => { + console.log(res) + if(res?.list?.length>0){ + newRow['bomVersion'] = res.list[0].version + } + }) tableData.value.push(newRow) }) } else { diff --git a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue index 6aa22fecd..a4d22853c 100644 --- a/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue +++ b/src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue @@ -87,6 +87,7 @@ import * as ProductionMainApi from '@/api/wms/productionMain' import * as ProductionDetailApi from '@/api/wms/productionDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as ItemBasicApi from '@/api/wms/itembasic' +import * as BomApi from "@/api/wms/bom"; // 预生产备件计划 defineOptions({ name: 'ProductionMainPredictSparePart' }) @@ -116,10 +117,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // }).catch(err =>{ // console.log(err); // }) - val.forEach(item=>{ + val.forEach(async item=>{ const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow[formField] = item[searchField] newRow['uom'] = item['uom'] + // 查看BOM版本 + const param1 = { + productItemCode: item['itemCode'], + available: 'TRUE', + pageSize: 20, + pageNo: 1, + sort: '', + by: 'ASC', + } + await BomApi.getBomPage(param1).then(res => { + console.log(res) + if(res?.list?.length>0){ + newRow['bomVersion'] = res.list[0].version + } + }) tableData.value.push(newRow) }) } else { diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue index 8263f8d62..c3a97d551 100644 --- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue @@ -149,6 +149,7 @@ import { formatTime } from '@/utils/index' import { getAccessToken } from '@/utils/auth' import dayjs from 'dayjs' import { getJmreportBaseUrl } from '@/utils/systemParam' +import * as BomApi from "@/api/wms/bom"; // 制品收货申请 // 预生产收货申请 defineOptions({ name: 'ProductreceiptRequestMain' }) @@ -212,6 +213,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['uom'] = val[0]['uom'] row['produceDate'] = dayjs().valueOf() row[formField] = val[0][searchField] + // 查看BOM版本 + const param1 = { + productItemCode: val[0]['itemCode'], + available: 'TRUE', + pageSize: 20, + pageNo: 1, + sort: '', + by: 'ASC', + } + BomApi.getBomPage(param1).then(res => { + console.log(res) + if(res?.list?.length>0){ + row['bomVersion'] = res.list[0].version + } + }) }else if (formField == 'workStationCode') { // 明细查询页赋值 val.forEach(item=>{ diff --git a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue index 6296dda1e..a066d3239 100644 --- a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue @@ -149,6 +149,7 @@ import * as PackageApi from '@/api/wms/package' import { formatTime } from '@/utils/index' import { getAccessToken } from '@/utils/auth' import { getJmreportBaseUrl } from '@/utils/systemParam' +import * as BomApi from "@/api/wms/bom"; // 装配收货申请 defineOptions({ name: 'ProductreceiptRequestMainA' }) @@ -213,6 +214,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['uom'] = val[0]['uom'] row['produceDate'] = dayjs().valueOf() row[formField] = val[0][searchField] + // 查看BOM版本 + const param1 = { + productItemCode: val[0]['itemCode'], + available: 'TRUE', + pageSize: 20, + pageNo: 1, + sort: '', + by: 'ASC', + } + BomApi.getBomPage(param1).then(res => { + console.log(res) + if(res?.list?.length>0){ + row['bomVersion'] = res.list[0].version + } + }) }else if (formField == 'workStationCode') { // 明细查询页赋值 val.forEach(item=>{ diff --git a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue index d2be36d10..e9a80a163 100644 --- a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue @@ -136,6 +136,7 @@ import * as ItembasicApi from '@/api/wms/itembasic' import * as PackageApi from '@/api/wms/package' import { formatTime } from '@/utils/index' import { getAccessToken } from '@/utils/auth' +import * as BomApi from "@/api/wms/bom"; import { SupplierdeliverRequestPackage } from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts' @@ -204,8 +205,21 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro row['uom'] = res[0]['uom'] } row[formField] = val[0][searchField] - - console.log('获取计量单位',res) + // 查看BOM版本 + const param1 = { + productItemCode: val[0]['itemCode'], + available: 'TRUE', + pageSize: 20, + pageNo: 1, + sort: '', + by: 'ASC', + } + BomApi.getBomPage(param1).then(res => { + console.log(res) + if(res?.list?.length>0){ + row['bomVersion'] = res.list[0].version + } + }) }else{ //添加明细 val.forEach(item=>{