From 5668b702ede265d97dcb89ca8cd3d9b3d21d9b7b Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Thu, 30 May 2024 11:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E9=80=80=E8=B4=A7=E4=BB=8E?= =?UTF-8?q?=E5=BA=93=E4=BD=8D=E4=BB=A3=E7=A0=81=E5=A2=9E=E5=8A=A0=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=E5=B9=B6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=BA=93=E5=AD=98=E4=BD=99=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/balance/index.ts | 5 +++ src/api/wms/location/index.ts | 11 +++++ .../purchasereturnRequestMain/index.vue | 18 ++++++-- .../purchasereturnRequestMain.data.ts | 43 ++++++++++++++++++- 4 files changed, 72 insertions(+), 5 deletions(-) diff --git a/src/api/wms/balance/index.ts b/src/api/wms/balance/index.ts index cb17a3200..68161dc16 100644 --- a/src/api/wms/balance/index.ts +++ b/src/api/wms/balance/index.ts @@ -105,6 +105,11 @@ export const getBalancePageSpare = async (params) => { } } +// 根据物料code 批次 和库位码查询库存余额总数 +export const getSumByConditions= async (params) => { + return await request.get({ url: `/wms/balance/getSumByConditions`, params }) +} + // 查询库存余额详情 export const getBalance = async (id: number) => { return await request.get({ url: `/wms/balance/get?id=` + id }) diff --git a/src/api/wms/location/index.ts b/src/api/wms/location/index.ts index 3c40f283d..3870b46d7 100644 --- a/src/api/wms/location/index.ts +++ b/src/api/wms/location/index.ts @@ -68,6 +68,17 @@ export const deleteLocation = async (id: number) => { return await request.delete({ url: `/wms/location/delete?id=` + id }) } +// 根据业务类型以及库区查询库位列表 +export const getLocationListByAreaAndBusinesstype = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/location/pageBusinessTypeToLocationSenior1', data }) + } else { + return await request.get({ url: `/wms/location/pageBusinessTypeToLocation1`, params }) + } +} + // 导出库位 Excel export const exportLocation = async (params) => { if (params.isSearch) { diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue index 5d1ef6233..0c46c5e11 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue @@ -134,7 +134,8 @@ import { } from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' import * as PackageApi from '@/api/wms/package' import { getAccessToken } from '@/utils/auth' - +import * as BalanceApi from '@/api/wms/balance' +import { async } from '@antv/x6/lib/registry/marker/async' // 采购退货申请 defineOptions({ name: 'PurchasereturnRequestMain' }) @@ -206,8 +207,10 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row } // 查询页面返回 -const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { - nextTick(() => { +const searchTableSuccess = async(formField, searchField, val, formRef, type, row) => { + console.log('searchTableSuccess',) + + nextTick(async () => { if (type == 'tableForm') { // 明细查询页赋值 row[formField] = val[0][searchField] @@ -254,6 +257,15 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => row['containerNumber'] = val[0]['containerNumber'] // row['fromLocationCode'] = val[0]['fromLocationCode'] row['toLocationCode'] = val[0]['toLocationCode'] + }else if(formField=='fromLocationCode'){ + let params = { + itemCode: row.itemCode, + batch: row.batch, + locationCode:val.code + } + let aa = await BalanceApi.getSumByConditions(params); + console.log('23423423',aa); + row['inventoryBalance'] = aa//库存余额 } } else { const setV = {} diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts index fa9ea5ee8..f5f5aae59 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts @@ -8,6 +8,9 @@ import { Supplier } from "@/views/wms/basicDataManage/supplierManage/supplier/su import * as SupplierApi from "@/api/wms/supplier"; import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' import * as ItemPackageApi from '@/api/wms/itempackage/index' +import * as LocationApi from "@/api/wms/location"; +import {Location} from "@/views/wms/basicDataManage/factoryModeling/location/location.data"; + // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 @@ -118,7 +121,7 @@ export const PurchasereceiptRecordMain1 = useCrudSchemas(reactive( }, }, { - label: '从库位代码', + label: '从库位代码2', field: 'fromLocationCode', sort: 'custom', table: { @@ -877,6 +880,27 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive disabled:false } }, + { + label: '库存余额', + field: 'inventoryBalance', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 6 + } + }, + isForm:false, + tableForm:{ + type:'InputNumber', + min:0, + precision: 6 + } + }, { label: '退货数量', field: 'qty', @@ -943,6 +967,21 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + tableForm:{ + // labelMessage: '信息提示说明!!!', + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择从库位代码', + searchField: 'code', + searchTitle: '库位代码信息', + searchAllSchemas: Location.allSchemas, + searchPage: LocationApi.getLocationListByAreaAndBusinesstype, + searchCondition: [{ + key: 'businessType', + value: 'PurchaseReturn', + message: '请填写业务类型', + isMainValue: false + }] + }, hiddenInMain: true, isTable: false, }, @@ -1389,7 +1428,7 @@ export const PurchasereReturnRequestDetailLabel = useCrudSchemas(reactive