Browse Source

采购退货从库位代码增加筛选功能添加并查询库存余额

master_hella_20240701
songguoqiang 6 months ago
parent
commit
5668b702ed
  1. 5
      src/api/wms/balance/index.ts
  2. 11
      src/api/wms/location/index.ts
  3. 18
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  4. 43
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts

5
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 })

11
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) {

18
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 = {}

43
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<CrudSchema[]>(
},
},
{
label: '从库位代码',
label: '从库位代码2',
field: 'fromLocationCode',
sort: 'custom',
table: {
@ -877,6 +880,27 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
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<CrudSchema[]>
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<CrudSc
}
},
{
label: '从库位代码',
label: '从库位代码1',
field: 'fromLocationCode',
sort: 'custom',
table: {

Loading…
Cancel
Save