diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 1065befd7..64c7573dd 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -139,9 +139,9 @@ :formAllSchemas="SupplierdeliverInspectionDetail.allSchemas" :tableAllSchemas="SupplierdeliverInspectionDetail.allSchemas" :tableFormRules="SupplierdeliverInspectionDetailRules" - :tableData="ploadQualityReportTableData" - @handleAddTable="SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail" - @handleDeleteTable="SupplierdeliverInspectionDetailApi.deleteSupplierdeliverInspectionDetail" + :tableData="uploadQualityReportTableData" + @handleAddTable="handleAddQualityReport" + @handleDeleteTable="handleDeleteQualityReport" @submitForm="submitFormUploadQualityReport" :isShowReduceButton="true" > @@ -617,7 +617,22 @@ const handleOpe = async (id: number) => { } } const ploadQualityReportRef = ref() -const ploadQualityReportTableData = ref([]) +const uploadQualityReportTableData = ref([]) + +const handleAddQualityReport = ()=>{ + const tableFormKeys = {} + SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + uploadQualityReportTableData.value.push(tableFormKeys) + console.log('handleAddQualityReport') +} +const handleDeleteQualityReport = (row,index)=>{ + uploadQualityReportTableData.value.splice(index,1) + console.log('handleDeleteQualityReport',row) + +} + /** 上传质量报告 */ const handleUploadQualityReport = async (row) => { console.log('SupplierdeliverInspectionDetail',SupplierdeliverInspectionDetail.allSchemas) @@ -630,12 +645,12 @@ const handleUploadQualityReport = async (row) => { SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { tableFormKeys[item.field] = item.default ? item.default : '' }) - ploadQualityReportTableData.value = [tableFormKeys] + uploadQualityReportTableData.value = [tableFormKeys] } const submitFormUploadQualityReport = async (formType, data) => { delete data.number - data.subList = ploadQualityReportTableData.value // 拼接子表数据参数 + data.subList = uploadQualityReportTableData.value // 拼接子表数据参数 if (formType === 'create') { await SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail(data) message.success(t('common.createSuccess'))