From 898b42ba51affe8f392bbbc7dcb36556ba8b82b9 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Thu, 28 Nov 2024 16:17:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B7=E5=8F=A3=E5=93=81=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productreceiptRequestMain/index.vue | 15 +++++ .../productreceiptRequestMain.data.ts | 12 +++- .../index.vue | 56 ++++++++++++++----- 3 files changed, 67 insertions(+), 16 deletions(-) diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue index c5065f5ff..b298c5ab3 100644 --- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue @@ -195,6 +195,7 @@ import * as ConfigApi from '@/api/infra/config' import { usePageLoading } from '@/hooks/web/usePageLoading' import {exportProductreceiptRequestMainPredict} from "@/api/wms/productreceiptRequestMain"; import * as ItemPackageApi from "@/api/wms/itempackage"; +import * as ruleApi from '@/api/wms/rule/index' const { loadStart, loadDone } = usePageLoading() // 制品收货申请 // 预生产收货申请 @@ -481,6 +482,7 @@ const butttondata = (row, $index) => { ] } +let toManagementPrecision = ref('') // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { @@ -622,6 +624,19 @@ const buttonTableClick = async (val, row) => { return } }) + ruleApi.getManagementPrecision({ + itemCodes: [item['itemCode']], + locationCode: item.toLocationCode + }).then((res) => { + toManagementPrecision.value = res[0].ManagementPrecision + }) + if ( toManagementPrecision.value == 'BY_BATCH') { + // row['fromBatchFormItemType'] = 'FormDate' + row['disabled_batch'] = false + } else { + // row['fromBatchFormItemType'] = '' + row['disabled_batch'] = true + } }) } else if (val == 'mainHandle') { // 处理 diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts index d55e555f8..f9eb22309 100644 --- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts +++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts @@ -1727,8 +1727,11 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive( width: 150 }, tableForm: { - disabled: true - } + disabled: true, + placeholder: '请选择从批次', + valueFormat: 'YYYYMMDD', + format: 'YYYYMMDD', + }, }, { label: '数量', @@ -2131,6 +2134,9 @@ export const ProductreceiptRequestLabelRules = reactive({ ], productionLineCodePackage: [ { required: true, message: '请选择生产线', trigger: 'change' } - ] + ], + batch: [ + { required: true, message: '请选择生产线', trigger: ['change','blur'] } + ], }) diff --git a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue index 14b85858c..986198d9c 100644 --- a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue @@ -818,20 +818,50 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r return } // window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) - - await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { - console.log(res) - if (labelType.value == 'cg') { - const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) - window.open(src.value+'&asn_number='+res) - } else { - const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) - window.open(src.value+'&asn_number='+res) - } - }).catch(err => { - console.log(err) - message.error('创建标签失败') +let array = []//存储可采购数据 + let array1 = []//存储可制造数据 + let packingNumbers = [] + val.forEach((item,index) => { + packingNumbers.push(item.number) + + if (item.itemType == '可采购') { + array.push(item) + } + if (item.itemType == '可制造') { + array1.push(item) + } }) + if (array.length>0) { + await PackageApi.getPrintingLableId({packingNumbers:array.map(item1=>item1.number)}).then(res => { + console.log(res) + window.open(BASE_URL + '/jmreport/view/1016234988731322368?token=' + getAccessToken()+'&id=' + res) + }).catch(err => { + console.log(err) + message.error('创建标签失败') + }) + } + if (array1.length > 0) { + await PackageApi.batchPrintingLable(array1.map(item1=>item1.number).join(',')).then(res => { + const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) + window.open(src.value + '&asn_number=' + res) + }).catch(err => { + console.log(err) + message.error('创建标签失败') + }) + } + // await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { + // console.log(res) + // if (labelType.value == 'cg') { + // const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) + // window.open(src.value+'&asn_number='+res) + // } else { + // const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) + // window.open(src.value+'&asn_number='+res) + // } + // }).catch(err => { + // console.log(err) + // message.error('创建标签失败') + // }) } const getDefaultWorkshopCode = async () => { const data = await ConfigApi.getConfigPage({