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