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>
</DetailTable>
</ContentWrap>
<!-- 附件/备注/变更记录 -->
<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'}">
<!-- 附件组件 -->
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}">
<Annex v-for="(annexItem ,index) in annexTableData" :key="index" v-show="tabsList[current].label==annexItem.label"
<!-- other附件组件:如质检明细 -->
<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:annexItem.hasSubDetail?'100%':(remarkHeight-40)+'px'}">
<Annex v-show="tabsList[current].label==annexItem.label"
:annexData="annexItem"
@handleAnnexSuccess="updateAnnexTableHandle"
@deleteAnnexSuccess="updateAnnexTableHandle"
: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=='附件'"
:annexData="annexData"
@handleAnnexSuccess="handleAnnexSuccess"
@ -392,7 +410,7 @@ const remarkHeight = computed(() => {
const annexData = reactive({
annexList: []
})
//
// //
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) => {
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 = []

34
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"
/>
>
<template #UploadQualityReport>
<span>1111</span>
</template>
</BasicForm>
</template>
@ -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)

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

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

Loading…
Cancel
Save