From fc113adb81a29f3e789136ce72bbe017ba786b57 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Tue, 29 Oct 2024 15:20:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=8D=A2=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/purchaseBarterRequestMain/index.ts | 11 +++ .../purchaseBarterRequest/index.vue | 8 +- .../purchaseBarterRequestMain.data.ts | 83 ++++++++++++------- 3 files changed, 68 insertions(+), 34 deletions(-) diff --git a/src/api/wms/purchaseBarterRequestMain/index.ts b/src/api/wms/purchaseBarterRequestMain/index.ts index 48454ef15..ecbfcfe01 100644 --- a/src/api/wms/purchaseBarterRequestMain/index.ts +++ b/src/api/wms/purchaseBarterRequestMain/index.ts @@ -99,3 +99,14 @@ export async function inStoragePurchaseBarterRequestMain(id: number) { export async function suspendPurchaseBarterRequestMain(id: number) { return await request.put({ url: `/wms/purchase-barter-request-main/suspend?id=` + id }) } + +export const getSupplieritemPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return request.post({ url: '/wms/purchase-barter-request-main/getSupplieritemSenior', data }) + } else { + return await request.get({ url: `/wms/purchase-barter-request-main/getSupplieritemPage`, params }) + } +} + diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue index f71f55917..af1bde13d 100644 --- a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue @@ -141,11 +141,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => let newVal = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) newVal.forEach(item=>{ let tfk = JSON.parse(JSON.stringify(tableFormKeys)) - tfk.batch = formatTime(new Date(), 'yyyyMMdd') tfk['itemCode'] = item['itemCode'] tfk['itemName'] = item['itemName'] - tfk['uom'] = item['supplierUom'] - tfk['packUnit'] = item['packUnit'] + tfk['uom'] = item['uom'] + tfk['batch'] = item['batch'] + tfk['inventoryQty'] = item['qty'] + tfk['locationCode'] = item['locationCode'] + tfk['inventoryStatus'] = item['inventoryStatus'] tableData.value.push(tfk) }) } diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts index 8f3612b02..2639dbbfc 100644 --- a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts @@ -6,7 +6,8 @@ import { Supplieritem } from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data"; import * as SupplieritemApi from "@/api/wms/supplieritem"; - +import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' +import * as PurchaseBarterRequestMainApi from "@/api/wms/purchaseBarterRequestMain"; /** * @returns {Array} 采购换货申请主表 */ @@ -109,16 +110,10 @@ export const PurchaseBarterRequestDetail = useCrudSchemas(reactive isInpuFocusShow: true, // 开启查询弹窗 searchListPlaceholder: '请选择物料代码',// 输入框占位文本 searchField: 'itemCode', // 查询弹窗赋值字段 - searchTitle: '供应商物料信息', // 查询弹窗标题 - searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类 - searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法 + searchTitle: '库存余额信息', // 查询弹窗标题 + searchAllSchemas: Balance.allSchemas, + searchPage: PurchaseBarterRequestMainApi.getSupplieritemPage, // 查询弹窗所需分页方法 searchCondition: [{ - key: 'available', - value: 'TRUE', - action: '==', - isSearch: true, - isMainValue: false - },{ key: 'supplierCode', value: 'supplierCode', action: '==', @@ -147,21 +142,19 @@ export const PurchaseBarterRequestDetail = useCrudSchemas(reactive isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '请选择物料代码', // 输入框占位文本 searchField: 'itemCode', // 查询弹窗赋值字段 - searchTitle: '供应商物料信息', // 查询弹窗标题 - searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类 - searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法 - searchCondition: [ - { - key: 'available', - value: 'TRUE', - isMainValue: false - },{ - key: 'supplierCode', - value: 'supplierCode', - message: '供应商代码不能为空!', - isMainValue:true - } - ], + searchTitle: '库存余额信息', // 查询弹窗标题 + searchAllSchemas: Balance.allSchemas, + searchPage: PurchaseBarterRequestMainApi.getSupplieritemPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'supplierCode', + value: 'supplierCode', + action: '==', + message: '供应商代码不能为空!', + isFormModel:true, // filters中添加筛选的数据--取于formModel + required:true, // 前置添加必有,和isFormModel结合使用 + isSearch: true, + isMainValue: false + }], verificationParams: [ { key: 'itemCode', @@ -220,8 +213,8 @@ export const PurchaseBarterRequestDetail = useCrudSchemas(reactive } }, { - label: '包装规格', - field: 'packUnit', + label: '换货库位', + field: 'locationCode', sort: 'custom', isSearch: false, tableForm: { @@ -233,15 +226,42 @@ export const PurchaseBarterRequestDetail = useCrudSchemas(reactive } } }, + { + label: '库存数量 ', + field: 'inventoryQty', + sort: 'custom', + isSearch: false, + isTable: false, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled:true + } + } + }, { label: '换货数量', field: 'qty', sort: 'custom', isSearch: false, + // form: { + // component: 'InputNumber', + // value: 0 + // }, form: { component: 'InputNumber', - value: 0 + componentProps: { + min: 0, + precision: 6, + } }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 6, + } }, { label: '换货原因 ', @@ -265,15 +285,16 @@ export const PurchaseBarterRequestDetail = useCrudSchemas(reactive function validateQty(rule, value, callback) { const numericValue = Number(value); - if (Number.isInteger(numericValue) && numericValue > 0) { + if (numericValue > 0) { + // if(numericValue < ) callback(); } else { - callback(new Error('数量必须是一个正整数')); + callback(new Error('换货数量必须是一个正数')); } } //表单校验 export const PurchaseBarterRequestDetailRules = reactive({ qty:[ - { validator:validateQty, message: '数量必须是一个正整数', trigger: 'change'} + { validator:validateQty, message: '换货数量必须是一个正数', trigger: 'change'} ], }) From 48fbbc0c1ebddf4c6bbb1f2512e8060f3cfb2557 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Tue, 29 Oct 2024 17:22:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=8D=A2=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchaseBarterRecord/purchaseBarterRecordMain.data.ts | 4 ++-- .../purchaseBarter/purchaseBarterRequest/index.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts index a824305b3..d7ce5ff33 100644 --- a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRecord/purchaseBarterRecordMain.data.ts @@ -74,8 +74,8 @@ export const PurchaseBarterRecordDetail = useCrudSchemas(reactive( isSearch: true, }, { - label: '包装规格', - field: 'packUnit', + label: '换货库位', + field: 'locationCode', sort: 'custom', isSearch: false, }, diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue index af1bde13d..f2ebbc2fa 100644 --- a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue @@ -422,7 +422,7 @@ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => { const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) - detailRef.value.openDetail(row, titleName, titleValue,'requestUnplannedreceiptMain') + detailRef.value.openDetail(row, titleName, titleValue,'requestPurchaseBarterMain') } /** 删除按钮操作 */