diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue index 353664dfa..c9d9383c0 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue @@ -577,116 +577,18 @@ const originTableData = ref([]) const searchTableRef = ref() // 添加明细 const handleAddTable = () => { - const subTableDFata = originTableData.value.filter( - (item) => !tableData.value.find((item1) => item1.id == item.id) - ) - if (subTableDFata.length == 0) { - message.warning('暂无可选择数据!') - return - } - - const tableObject = { - // 当前页 - currentPage: 1, - // 导出加载中 - exportLoading: false, - // 加载中 - loading: false, - // 页数 - pageSize: subTableDFata.length, - params: null, - // 排序 - sort: { - order: '', // 排序规则 - prop: '' // 排序字段 - }, - // 总条数 - total: subTableDFata.length, - // 表格数据 - tableList: subTableDFata, - currentRow: null - } - - const tableColumns = PurchasereturnRequestDetail.allSchemas.tableFormColumns - tableColumns.forEach((item) => { - item.width = item.table?.width || 150 - }) - - searchTableRef.value.openData('采购收货记录单号', tableObject, { tableColumns }, true) - // searchTableRef.value.open( - // ('供应商信息', - // // _searchTableAllSchemas, - // // _searchTablePage, // 接口 - // // formField, - // // searchField, - // true,//是否多选 - // // type, - // // row, - // _searchCondition - // ) - // ) - - // console.log(subTableDFata) - // const {tableObject, tableMethods } = useTable({ - // getListApi: getPage.value // 分页接口 - // }) - // searchTableRef.value.open( - // ('供应商信息', - // // _searchTableAllSchemas, - // // _searchTablePage, // 接口 - // // formField, - // // searchField, - // true,//是否多选 - // // type, - // // row, - // _searchCondition - // ) - // ) - // 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') { - // item.tableForm.disabled = false - // } - // if (item.field == 'reason') { - // item.tableForm.disabled = false - // } - // if (item.field == 'qty') { - // item.tableForm.disabled = false - // } - // 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 - // } - // } - // }) + } // 选择收货单明细 const chooseReceiptList = ()=>{ - // searchTableRef.value.open( - // ('供应商信息', - // // _searchTableAllSchemas, - // // _searchTablePage, // 接口 - // // formField, - // // searchField, - // true,//是否多选 - // // type, - // // row, - // _searchCondition - // ) - // ) - + if(!formRef.value.formRef.formModel.itemCode){ + message.error('请选择物料代码') + return + } + if(!formRef.value.formRef.formModel.supplierName){ + message.error('请选择供应商') + return + } searchTableRef.value.open( "收货单明细", Itembasic.allSchemas, @@ -709,9 +611,12 @@ const chooseReceiptList = ()=>{ ) } -const searchTableSuccess1 = (formField, searchField, val, formRef, type, row) => { - console.log(val) - tableData.value = [...tableData.value, ...val] +// 选择收货单明细 +const searchTableSuccess1 = (formField, searchField, selections, type, row) => { + console.log('searchTableSuccess1',formField, searchField, selections, type, row) + formRef.value.formRef.setValues({ + poNumber:111 + }) } // 删除明细 const handleDeleteTable = (item, index, formRef) => {