From 0d308ca27c132775dd21464e5cc8fe8b1b0d96e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Tue, 26 Mar 2024 14:34:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=80=80=E6=96=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionreturnRequestMain/index.vue | 36 ++++- .../productionreturnRequestMain.data.ts | 124 ++++++++++++++---- .../productionreturnRequestMainNo/index.vue | 8 +- .../productionreturnRequestMainNo.data.ts | 122 +++++++++++++---- 4 files changed, 235 insertions(+), 55 deletions(-) diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue index c636538eb..582f72410 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue @@ -175,6 +175,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['uom'] = val[0]['uom'] row['inventoryStatus'] = val[0]['inventoryStatus'] row['qty'] = val[0]['qty'] + // 如果有批次 赋值库存余额批次 无批次 赋值 000000 + if (val[0]['batch'] !== '') { + row['batch'] = val[0]['batch'] + } else { + row['batch'] = '000000' + } // 修改 tableform 属性 数量最大值设置为库存余额中数量 // TODO: tableFormColumns 修改属性目前只限于整个列 并不满足行要求 例如: 第一条数据最大10 第二条数据最大20 那么第一条数据会变成最大20限制 ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => { @@ -186,6 +192,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } else if(formField == 'workStationCode') { row['workStationCode'] = val[0]['code'] row['fromLocationCode'] = val[0]['rawLocationCode'] + } else if(formField == 'packUnit') { + row['packUnit'] = val[0]['packUnit'] + row['packQty'] = val[0]['packQty'] } else { row[formField] = val[0][searchField] } @@ -210,6 +219,12 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { setV['uom'] = val[0]['uom'] setV['inventoryStatus'] = val[0]['inventoryStatus'] setV['qty'] = val[0]['qty'] + // 如果有批次 赋值库存余额批次 无批次 赋值 000000 + if (val[0]['batch'] !== '') { + setV['batch'] = val[0]['batch'] + } else { + setV['batch'] = '000000' + } // 修改 tableform 属性 数量最大值设置为库存余额中数量 ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => { if(item.field == 'qty' && val[0]['qty'] > 0) { @@ -220,6 +235,9 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { } else if(formField == 'workStationCode') { setV['workStationCode'] = val[0]['code'] setV['fromLocationCode'] = val[0]['rawLocationCode'] + } else if(formField == 'packUnit') { + setV['packUnit'] = val[0]['packUnit'] + setV['packQty'] = val[0]['packQty'] } else { setV[formField] = val[0][searchField] } @@ -381,7 +399,7 @@ const buttonTableClick = async (val, row) => { // dialogVisible.value = true formLabelRef.value.open('create', row) detatableData.tableList.map((item) => { - item.batch = '000000' + // item.batch = '000000' // 查询物料类型 原料 只能选择 供应商代码 半成品成品其他 只能选择 生产线 ItembasicApi.getItembasicPage({ pageSize: 10, @@ -498,7 +516,7 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { /** 详情操作——子表表单 */ const detailOpenForm = (type, row) => { nextTick(()=>{ - detailRef.value.formRef.formRef.formModel.batch = '000000' + // detailRef.value.formRef.formRef.formModel.batch = '000000' }) } @@ -545,7 +563,7 @@ const tableData = ref([]) // 添加明细 const handleAddTable = () => { let tfk = JSON.parse(JSON.stringify(tableFormKeys)) - tfk.batch = '000000' + // tfk.batch = '000000' tableData.value.push(tfk) } // 删除明细 @@ -556,6 +574,17 @@ const handleDeleteTable = (item, index) => { // 主子数据 提交 const submitForm = async (formType, data) => { data.subList = tableData.value // 拼接子表数据参数 + let isZC = true // 数量和标包数量 是否整除 + data.subList.forEach(item => { + if (item.qty % item.packQty !== 0) { + isZC = false + } + }) + if(!isZC) { + formRef.value.formLoading = false + await message.confirm('含有不整箱情况,是否继续?') + formRef.value.formLoading = true + } // 合格退料 添加参数 isOK data.isOK = true try { @@ -583,6 +612,7 @@ const submitForm = async (formType, data) => { const submitFormLabel = async (formType, data) => { try { detatableData.tableList.forEach(async (item) => { + item.toLocationCode = item.fromLocationCode await PackageApi.createPackageLabel(item).then(() => { isCreateLabel.value = true message.success('创建标签成功') diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts index b52acb497..ae283b571 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts @@ -17,6 +17,9 @@ import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import * as ProductionlineitemApi from '@/api/wms/productionlineitem' import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data' +import * as ItempackagingApi from '@/api/wms/itempackage' +import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' + import * as SupplieritemApi from '@/api/wms/supplieritem' import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data' @@ -533,22 +536,7 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive - @@ -190,6 +190,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } else if(formField == 'workStationCode') { row['workStationCode'] = val[0]['code'] row['fromLocationCode'] = val[0]['rawLocationCode'] + } else if(formField == 'packUnit') { + row['packUnit'] = val[0]['packUnit'] + row['packQty'] = val[0]['packQty'] } else { row[formField] = val[0][searchField] } @@ -225,6 +228,9 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { } else if(formField == 'workStationCode') { setV['workStationCode'] = val[0]['code'] setV['fromLocationCode'] = val[0]['rawLocationCode'] + } else if(formField == 'packUnit') { + setV['packUnit'] = val[0]['packUnit'] + setV['packQty'] = val[0]['packQty'] } else { setV[formField] = val[0][searchField] } diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts index 0fd27bd5c..c43b49670 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts @@ -13,6 +13,9 @@ import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/worksta import * as BalanceApi from '@/api/wms/balance' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' +import * as ItempackagingApi from '@/api/wms/itempackage' +import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' + const { t } = useI18n() // 国际化 /** @@ -123,22 +126,7 @@ export const ProductionreturnRequestDetail = useCrudSchemas(reactive Date: Tue, 26 Mar 2024 14:50:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BF=BB=E5=8C=85=E8=AE=B0=E5=BD=95=20?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A0=87=E7=AD=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packageoverRecordMain/index.vue | 35 ++++++++++++++++++- .../packageoverRecordMain.data.ts | 10 ++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue index a7421c788..9774d78d0 100644 --- a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue +++ b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue @@ -66,6 +66,8 @@ import { PackageoverMain,PackageoverMainRules, PackageoverDetail, PackageoverDet import * as PackageoverRecordMainApi from '@/api/wms/packageoverRecordMain' import * as PackageoverRecordDetailApi from '@/api/wms/packageoverRecordDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' +import * as PackageApi from '@/api/wms/package' +import { getAccessToken } from '@/utils/auth' // 翻包记录 defineOptions({ name: 'PackageoverMain' }) @@ -118,11 +120,42 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = (row) => { - return [] + return [defaultButtons.mainListPointBtn(null)] // 标签打印 } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + if (val == 'point') { // 标签打印 + handlePoint(row) + } +} + +const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL +const labelType = ref('') // 标签类别 采购还是制造等 +// 标签打印 +const handlePoint = async (row) => { + // 查询是否已创建过标签 + await PackageApi.getPackagePage({ + requestNumber: row.number + }).then((res) => { + if(res.list.length > 0) { + if (res.list[0].productionLineCode != null) { + labelType.value = 'zz' + } else { + labelType.value = 'cg' + } + } + }).catch(err => { + console.log(err) + }) + // 判断是采购还是制造 + if (labelType.value == 'cg') { + const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) + window.open(src.value+'&request_number='+row.number) + } else { + const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) + window.open(src.value+'&request_number='+row.number) + } } /** 详情操作 */ diff --git a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/packageoverRecordMain.data.ts b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/packageoverRecordMain.data.ts index 5d6693780..0cdb5f1f4 100644 --- a/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/packageoverRecordMain.data.ts +++ b/src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/packageoverRecordMain.data.ts @@ -232,6 +232,16 @@ export const PackageoverMain = useCrudSchemas(reactive([ } }, }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false , + table: { + width: 150, + fixed: 'right' + } + } ]))