|
@ -63,6 +63,8 @@ |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
/> |
|
|
/> |
|
|
|
|
|
<!-- 添加明细:采购收货记录单号 --> |
|
|
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<Detail |
|
|
<Detail |
|
@ -181,7 +183,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
isShowButton.value = false |
|
|
// isShowButton.value = false |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
@ -205,6 +207,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
// item.fromLocationCode = item.fromLocationCode |
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
// item.fromLocationGroupCode = item.fromLocationGroupCode |
|
|
}) |
|
|
}) |
|
|
|
|
|
originTableData.value = JSON.parse(JSON.stringify(tableData.value)) |
|
|
|
|
|
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
if (item.field == 'supplierCode') { |
|
|
if (item.field == 'supplierCode') { |
|
@ -422,6 +425,7 @@ const buttonTableClick = async (val, row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
const openForm = async (type: string, row?: number) => { |
|
|
const openForm = async (type: string, row?: number) => { |
|
|
|
|
|
originTableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
isShowButton.value = true |
|
|
isShowButton.value = true |
|
|
if(type == 'create'){ |
|
|
if(type == 'create'){ |
|
@ -564,38 +568,110 @@ PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach((item) => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
|
|
|
const originTableData = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
// 添加明细 |
|
|
// 添加明细 |
|
|
const handleAddTable = () => { |
|
|
const handleAddTable = () => { |
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
|
|
|
let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber |
|
|
const subTableDFata = originTableData.value.filter(item=> !tableData.value.find(item1=>item1.id == item.id)) |
|
|
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
if(subTableDFata.length==0){ |
|
|
item.tableForm.disabled = true |
|
|
message.warning('暂无可选择数据!') |
|
|
if (item.field == 'remark') { |
|
|
return |
|
|
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 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 searchTableSuccess1 = (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
console.log(val) |
|
|
|
|
|
tableData.value = [...tableData.value,...val] |
|
|
} |
|
|
} |
|
|
// 删除明细 |
|
|
// 删除明细 |
|
|
const handleDeleteTable = (item, index, formRef) => { |
|
|
const handleDeleteTable = (item, index, formRef) => { |
|
|