Browse Source

上传质量报告---质检明细

master_hella_20240701
yufei0306 8 months ago
parent
commit
48e264ce3b
  1. 55
      src/components/Detail/src/Detail.vue
  2. 34
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  3. 2
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

55
src/components/Detail/src/Detail.vue

@ -96,16 +96,34 @@
</template> </template>
</DetailTable> </DetailTable>
</ContentWrap> </ContentWrap>
<!-- 附件/备注/变更记录 --> <!-- other附件组件:如质检明细 -->
<ContentWrap class="w-[100%]" v-show="annexTableData.some(item=>item.label==tabsList[current].label)||tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}"> <div v-for="(annexItem ,index) in annexTableData" :key="index" v-show="annexTableData.some(item=>item.label==tabsList[current].label)" class="w-[100%]" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 --> <ContentWrap class="w-[100%]">
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> <ElScrollbar ref="scrollbar" :style="{height:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}">
<Annex v-for="(annexItem ,index) in annexTableData" :key="index" v-show="tabsList[current].label==annexItem.label" <Annex v-show="tabsList[current].label==annexItem.label"
:annexData="annexItem" :annexData="annexItem"
@handleAnnexSuccess="updateAnnexTableHandle" @handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="updateAnnexTableHandle" @deleteAnnexSuccess="updateAnnexTableHandle"
:upData="{...remarksData.data,tableName:annexItem.tableName}" :upData="{...remarksData.data,tableName:annexItem.tableName}"
/> />
</ElScrollbar>
</ContentWrap>
{{annexItem.subDetailTableData.tableColumns}}
<Table style="border:1px solid red;height:100px"
v-if="!isBasic && fromeWhere != 'countPlan'"
:columns="annexItem.subDetailTableData.tableColumns"
:data="annexItem.subDetailTableData.tableList"
:loading="annexItem.subDetailTableData.loading"
:pagination="{ total: annexItem.subDetailTableData.tableList.length }"
v-model:pageSize="tableObjectRef.pageSize"
v-model:currentPage="tableObjectRef.currentPage"
/>
</div>
<!-- 附件/备注/变更记录 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='附件'||tabsList[current].label=='备注'||tabsList[current].label=='变更记录'" :style="{height:remarkHeight+'px'}">
<!-- 附件组件 -->
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label=='附件'" <Annex v-show="tabsList[current].label=='附件'"
:annexData="annexData" :annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess" @handleAnnexSuccess="handleAnnexSuccess"
@ -392,7 +410,7 @@ const remarkHeight = computed(() => {
const annexData = reactive({ const annexData = reactive({
annexList: [] annexList: []
}) })
// // //
const annexTableData = ref<Array<any>>([]) const annexTableData = ref<Array<any>>([])
// //
@ -416,7 +434,8 @@ const getFileList = async () => {
} }
} }
// //
const getAnnexFileList = async () => { const getAnnexFileList = async (row:id) => {
console.log('getAnnexFileList')
props.annexTable?.forEach(async (item) => { props.annexTable?.forEach(async (item) => {
let requstData = {...remarksData.data,tableName: item?.tableName} let requstData = {...remarksData.data,tableName: item?.tableName}
const annexList = await FileApi.getFileList(requstData) const annexList = await FileApi.getFileList(requstData)
@ -427,8 +446,24 @@ const getAnnexFileList = async () => {
annexTableData.value.push({ annexTableData.value.push({
label: item.label, label: item.label,
tableName: item?.tableName || '', 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 = () => { const updateAnnexTableHandle = () => {
getAnnexFileList() getAnnexFileList(detailData.value)
getChangeRecordList() getChangeRecordList()
} }
@ -526,7 +561,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
detailData.value = row detailData.value = row
getRemarkList() getRemarkList()
getFileList() getFileList()
getAnnexFileList() getAnnexFileList(row)
getChangeRecordList() getChangeRecordList()
// //
let detailButtonFilter: any = [] let detailButtonFilter: any = []

34
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -77,7 +77,21 @@
:annexTable="[{ :annexTable="[{
label: '质检明细', label: '质检明细',
prop: 'uploadFile', 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" :isBasic="false"
:allSchemas="SupplierdeliverRequestMain.allSchemas" :allSchemas="SupplierdeliverRequestMain.allSchemas"
@ -125,7 +139,11 @@
@handleDeleteTable="SupplierdeliverInspectionDetailApi.deleteSupplierdeliverInspectionDetail" @handleDeleteTable="SupplierdeliverInspectionDetailApi.deleteSupplierdeliverInspectionDetail"
@submitForm="submitFormUploadQualityReport" @submitForm="submitFormUploadQualityReport"
:isShowReduceButton="true" :isShowReduceButton="true"
/> >
<template #UploadQualityReport>
<span>1111</span>
</template>
</BasicForm>
</template> </template>
@ -429,7 +447,7 @@ const buttonTableClick = async (val, row) => {
handleClo(row.id) handleClo(row.id)
} else if (val == 'mainPlanUploadQualityReport') { } else if (val == 'mainPlanUploadQualityReport') {
// //
handleUploadQualityReport(row.id) handleUploadQualityReport(row)
} else if (val == 'mainPlanSub') { } else if (val == 'mainPlanSub') {
// //
handleSub(row.id) handleSub(row.id)
@ -573,10 +591,13 @@ const handleOpe = async (id: number) => {
const ploadQualityReportRef = ref() const ploadQualityReportRef = ref()
const ploadQualityReportTableData = ref([]) const ploadQualityReportTableData = ref([])
/** 上传质量报告 */ /** 上传质量报告 */
const handleUploadQualityReport = async (id: number) => { const handleUploadQualityReport = async (row) => {
console.log('UploadQualityReport',UploadQualityReport.allSchemas) console.log('UploadQualityReport',UploadQualityReport.allSchemas)
// ploadQualityReportRef.value.dialogVisible = true const uploadFile = UploadQualityReport.allSchemas.formSchema.find(item=>item.field=='uploadFile')
ploadQualityReportRef.value.open('create', null, null,'上传质量报告')// createLabel if(uploadFile){
uploadFile['componentProps']['upData']['tableId'] = row.id
}
ploadQualityReportRef.value.open('create', null, {masterId:row.id},'上传质量报告')// createLabel
const tableFormKeys = {} const tableFormKeys = {}
UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => { UploadQualityReport.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
@ -585,6 +606,7 @@ const handleUploadQualityReport = async (id: number) => {
} }
const submitFormUploadQualityReport = async (formType, data) => { const submitFormUploadQualityReport = async (formType, data) => {
delete data.number
data.subList = ploadQualityReportTableData.value // data.subList = ploadQualityReportTableData.value //
if (formType === 'create') { if (formType === 'create') {
await SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail(data) await SupplierdeliverInspectionDetailApi.createSupplierdeliverInspectionDetail(data)

2
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -1597,7 +1597,7 @@ export const UploadQualityReport = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
upData:{ upData:{
tableId: '', tableId: '',
tableName: '' tableName: 'UploadQualityReport'
}, },
limit:1, limit:1,
} }

Loading…
Cancel
Save