diff --git a/src/api/wms/purchasereceiptRecordDetail/index.ts b/src/api/wms/purchasereceiptRecordDetail/index.ts index b326094dc..569de2b18 100644 --- a/src/api/wms/purchasereceiptRecordDetail/index.ts +++ b/src/api/wms/purchasereceiptRecordDetail/index.ts @@ -58,6 +58,18 @@ export const getPurchasereceiptRecordDetailPage = async (params) => { return await request.get({ url: `/wms/purchasereceipt-record-detail/page`, params }) } } + +// 查询采购收货记录子列表 +export const getPurchasereceiptRecordDetailPageBySupplierCode = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/purchasereceipt-record-detail/seniorBySupplierCode', data }) + } else { + return await request.get({ url: `/wms/purchasereceipt-record-detail/pageBySupplierCode`, params }) + } +} + // 查询采购收货记录子列表 export const getPurchasereceiptRecordDetailList = async (params) => { return await request.get({ url: `/wms/purchasereceipt-record-detail/list`, params }) diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue index 8ce249001..543bc0adf 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue @@ -167,55 +167,62 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => row['projectCode'] = val[0]['projectCode'] } else { const setV = {} - setV[formField] = val[0][searchField] - setV['purchaseReceiptRecordNumber'] = val[0]['number'] - setV['supplierCode'] = val[0]['supplierCode'] - setV['asnNumber'] = val[0]['asnNumber'] - setV['ppNumber'] = val[0]['ppNumber'] - - // 获取子表数据 getBomDisassemble - PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ - masterId: val[0]['id'] - }) - .then((res) => { - if (res) tableData.value = res - tableData.value.forEach((item) => { - item.batch = item.toBatch - item.packingNumber = item.toPackingNumber - item.containerNumber = item.toContainerNumber - item.containerNumber = item.toContainerNumber - item.toLocationGroupCode = null - item.toWarehouseCode = null - item.toLocationTypes = null - item.toLocationCode = null - // item.fromLocationCode = item.fromLocationCode - // item.fromLocationGroupCode = item.fromLocationGroupCode - }) - isShowButton.value = false - PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { - if (item.field == 'supplierCode') { - item.componentProps.disabled = true - } - }) - PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { - item.tableForm.disabled = true - if (item.field == 'remark') { - item.tableForm.disabled = false - } - if (item.field == 'qty') { - item.tableForm.disabled = false - } - if (item.field == 'reason') { - item.tableForm.disabled = false - } - if (item.field == 'itemCode') { - item.tableForm.isInpuFocusShow = false - } - }) - }) - .catch((err) => { + if(formField == 'purchaseReceiptRecordNumber'){ + isShowButton.value = false + setV[formField] = val[0][searchField] + setV['purchaseReceiptRecordNumber'] = val[0]['number'] + setV['supplierCode'] = val[0]['supplierCode'] + setV['asnNumber'] = val[0]['asnNumber'] + setV['ppNumber'] = val[0]['ppNumber'] + + // 获取子表数据 getBomDisassemble + PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ + masterId: val[0]['id'] + }).then((res) => { + if (res) tableData.value = res + tableData.value.forEach((item) => { + item.batch = item.toBatch + item.packingNumber = item.toPackingNumber + item.containerNumber = item.toContainerNumber + item.containerNumber = item.toContainerNumber + item.toLocationGroupCode = null + item.toWarehouseCode = null + item.toLocationTypes = null + item.toLocationCode = null + // item.fromLocationCode = item.fromLocationCode + // item.fromLocationGroupCode = item.fromLocationGroupCode + }) + + PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { + if (item.field == 'supplierCode') { + item.componentProps.disabled = true + } + }) + PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { + item.tableForm.disabled = true + if (item.field == 'remark') { + item.tableForm.disabled = false + } + if (item.field == 'qty') { + item.tableForm.disabled = false + } + if (item.field == 'reason') { + item.tableForm.disabled = false + } + if (item.field == 'itemCode') { + item.tableForm.isInpuFocusShow = false + } + }) + }).catch((err) => { console.log(err) }) + } + if(formField == 'supplierCode'){ + isShowButton.value = true + setV['supplierCode'] = val[0]['code'] + setV['purchaseReceiptRecordNumber'] = '' + tableData.value = [] + } formRef.setValues(setV) } }) @@ -513,6 +520,7 @@ const tableData = ref([]) // 添加明细 const handleAddTable = () => { tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) + let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { item.tableForm.disabled = true if (item.field == 'remark') { @@ -524,8 +532,20 @@ const handleAddTable = () => { if (item.field == 'qty') { item.tableForm.disabled = false } - if (item.field == 'itemCode') { - item.tableForm.isInpuFocusShow = true + if(purchaseReceiptRecordNumber == ''){ + if (item.field == 'itemCode') { + item.tableForm.isInpuFocusShow = true + } + if(item.field == 'poLine'){ + item.tableForm.isInpuFocusShow = false + } + }else{ + if (item.field == 'itemCode') { + item.tableForm.isInpuFocusShow = false + } + if(item.field == 'poLine'){ + item.tableForm.isInpuFocusShow = true + } } }) } @@ -541,7 +561,6 @@ const handleDeleteTable = (item, index, formRef) => { }) nextTick(() => { const setV = {} - setV['purchaseReceiptRecordNumber'] = '' setV['supplierCode'] = '' formRef.setValues(setV) diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts index e3e005a0c..20de11058 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts @@ -10,7 +10,8 @@ import { import * as BalanceApi from '@/api/wms/balance' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' - +import { Supplier } from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data"; +import * as SupplierApi from "@/api/wms/supplier"; // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 @@ -99,7 +100,12 @@ export const PurchasereturnRequestMain = useCrudSchemas(reactive([ isSearch: true, form:{ componentProps:{ - disabled:false + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '供应商信息', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 } } }, @@ -491,7 +497,22 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive width: 150 }, tableForm:{ - disabled:true + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '采购收货记录信息', + searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, + searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage, + searchCondition: [{ + key: 'number', + value: 'purchaseReceiptRecordNumber', + message: '请填写采购收货记录号!', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] }, form: { // labelMessage: '信息提示说明!!!', @@ -521,13 +542,45 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive sort: 'custom', table: { width: 150 - }, + }, tableForm:{ - disabled:true + // labelMessage: '信息提示说明!!!', + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '采购收货记录信息', + searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, + searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageBySupplierCode, + searchCondition: [{ + key: 'supplierCode', + value: 'supplierCode', + message: '请填写采购收货记录号!', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] }, form: { - componentProps:{ - disabled:true + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '采购收货记录信息', + searchAllSchemas: PurchasereceiptRecordDetail.allSchemas, + searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageBySupplierCode, + searchCondition: [{ + key: 'supplierCode', + value: 'supplierCode', + message: '请填写采购收货记录号!', + isMainValue: true + },{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] } } },