diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 0f0132a20..9f06a30d3 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -96,16 +96,34 @@ + +
+ + + + + + {{annexItem.subDetailTableData.tableColumns}} + + + - + - { const annexData = reactive({ annexList: [] }) -// 其他附件默认数据数组 +// // 其他附件默认数据数组 const annexTableData = ref>([]) // 备注数据 @@ -416,7 +434,8 @@ const getFileList = async () => { } } // 获取其他附件列表篇 -const getAnnexFileList = async () => { +const getAnnexFileList = async (row:id) => { + console.log('getAnnexFileList') props.annexTable?.forEach(async (item) => { let requstData = {...remarksData.data,tableName: item?.tableName} const annexList = await FileApi.getFileList(requstData) @@ -427,8 +446,24 @@ const getAnnexFileList = async () => { annexTableData.value.push({ label: item.label, tableName: item?.tableName || '', - annexList + annexList, + hasSubDetail:item.hasSubDetail||false, + subDetailTableData:item.subDetailTableData||{} }) + if(item?.subDetailTableData){ + const { tableObject:subTableObject, tableMethods:subTableMethods } = useTable({ + getListApi: item.subDetailTableData.getSubList // 分页接口 + }) + const {getList:getSubList} = subTableMethods + subTableObject.params= {} + item.subDetailTableData.queryParams.forEach(queryItem => { + subTableObject.params[queryItem.queryField] = row[queryItem.rowField] + }); + await getSubList() + item.subDetailTableData.tableList = subTableObject.tableList + annexItem.subDetailTableData.tableList + console.log('subTableObject',annexTableData.value) + } } }) } @@ -444,7 +479,7 @@ const deleteAnnexSuccess = async () => { } /** 追加的附件 */ const updateAnnexTableHandle = () => { - getAnnexFileList() + getAnnexFileList(detailData.value) getChangeRecordList() } @@ -526,7 +561,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName: detailData.value = row getRemarkList() getFileList() - getAnnexFileList() + getAnnexFileList(row) getChangeRecordList() // 判断详情按钮是否显示 let detailButtonFilter: any = [] diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index a906c8217..fe75c0ccb 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -77,7 +77,21 @@ :annexTable="[{ label: '质检明细', prop: 'uploadFile', - tableName:'uploadFile' + tableName:'UploadQualityReport', + hasSubDetail:true, // 附件中是否展示明细表 + //明细表数据 + subDetailTableData:{ + queryParams:[{ + queryField:'masterId', + rowField:'id' + }], // 查询参数 + getSubList:SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage,//请求接口 + tableColumns:UploadQualityReport.allSchemas.tableColumns, + tableList:[],//表格数据 + total:1, + pageSize:10, + currentPage:1, + } }]" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas" @@ -125,7 +139,11 @@ @handleDeleteTable="SupplierdeliverInspectionDetailApi.deleteSupplierdeliverInspectionDetail" @submitForm="submitFormUploadQualityReport" :isShowReduceButton="true" - /> + > + + @@ -429,7 +447,7 @@ const buttonTableClick = async (val, row) => { handleClo(row.id) } else if (val == 'mainPlanUploadQualityReport') { // 上传质量报告 - handleUploadQualityReport(row.id) + handleUploadQualityReport(row) } else if (val == 'mainPlanSub') { // 提交审批 handleSub(row.id) @@ -573,10 +591,13 @@ const handleOpe = async (id: number) => { const ploadQualityReportRef = ref() const ploadQualityReportTableData = ref([]) /** 上传质量报告 */ -const handleUploadQualityReport = async (id: number) => { +const handleUploadQualityReport = async (row) => { console.log('UploadQualityReport',UploadQualityReport.allSchemas) - // ploadQualityReportRef.value.dialogVisible = true - ploadQualityReportRef.value.open('create', null, null,'上传质量报告')//创建标签页面 createLabel 标题 + const uploadFile = UploadQualityReport.allSchemas.formSchema.find(item=>item.field=='uploadFile') + if(uploadFile){ + uploadFile['componentProps']['upData']['tableId'] = row.id + } + ploadQualityReportRef.value.open('create', null, {masterId:row.id},'上传质量报告')//创建标签页面 createLabel 标题 const tableFormKeys = {} UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => { tableFormKeys[item.field] = item.default ? item.default : '' @@ -585,6 +606,7 @@ const handleUploadQualityReport = async (id: number) => { } const submitFormUploadQualityReport = async (formType, data) => { + delete data.number data.subList = ploadQualityReportTableData.value // 拼接子表数据参数 if (formType === 'create') { await SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail(data) diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts index b03007f2d..3f7c03068 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts @@ -1597,7 +1597,7 @@ export const UploadQualityReport = useCrudSchemas(reactive([ componentProps: { upData:{ tableId: '', - tableName: '' + tableName: 'UploadQualityReport' }, limit:1, }