diff --git a/src/api/wms/customerSaleInvoiceDetail/index.ts b/src/api/wms/customerSaleInvoiceDetail/index.ts index 48acdabac..774630b37 100644 --- a/src/api/wms/customerSaleInvoiceDetail/index.ts +++ b/src/api/wms/customerSaleInvoiceDetail/index.ts @@ -60,7 +60,7 @@ export const deleteCustomerSaleInvoiceDetail = async (id: number) => { } // 导出客户销售开票子信息表(WMS) Excel -export const exportCustomerSaleInvoiceDetail = async (params) => { +export const exportCustomerSaleInvoiceRequestDetail = async (params) => { if (params.isSearch) { const data = { ...params } return await request.downloadPost({ url: `/wms/customer-sale-invoice-detail/export-excel-senior`, data }) @@ -68,6 +68,15 @@ export const exportCustomerSaleInvoiceDetail = async (params) => { return await request.download({ url: `/wms/customer-sale-invoice-detail/export-excel`, params }) } } +// 导出客户销售开票子信息表(WMS) Excel +export const exportCustomerSaleInvoiceRecordDetail = async (params) => { + if (params.isSearch) { + const data = { ...params } + return await request.downloadPost({ url: `/wms/customer-sale-invoice-record-detail/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/customer-sale-invoice-record-detail/export-excel`, params }) + } +} // 下载用户导入模板 export const importTemplate = () => { diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts index 3955a8085..a3c7a12e7 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts @@ -79,6 +79,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ field: 'customerCode', sort: 'custom', isSearch: true, + isDetail:false, form: { componentProps: { disabled:true @@ -113,6 +114,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ disabled: true } }, + isDetail:false, table:{ width:150 } @@ -202,21 +204,30 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ field: 'remark', sort: 'custom', }, - // { - // label: '创建时间', - // field: 'createTime', - // sort: 'custom', - // formatter: dateFormatter, - // search: { - // component: 'DatePicker', - // componentProps: { - // valueFormat: 'YYYY-MM-DD HH:mm:ss', - // type: 'daterange', - // defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] - // } - // }, - // isForm: false, - // }, + { + label: '创建时间', + field: 'createTime', + sort: 'custom', + formatter: dateFormatter, + isTable:false, + isDetail:true, + detail: { + dateFormat : 'YYYY-MM-DD HH:mm:ss' + }, + isForm: false, + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + formatter: dateFormatter, + isTable:false, + isDetail:true, + detail: { + dateFormat : 'YYYY-MM-DD HH:mm:ss' + }, + isForm: false, + }, ])) // 表单校验 export const CustomerSaleInvoiceDetailRules = reactive({ diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue index e34e66657..e5e9c8d30 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/index.vue @@ -47,6 +47,9 @@ :apiUpdate="CustomerSaleInvoiceDetailApi.updateCustomerSaleInvoiceDetail" :apiPage="CustomerSaleInvoiceDetailApi.getCustomerSaleInvoiceRecordDetailPage" :apiDelete="CustomerSaleInvoiceDetailApi.deleteCustomerSaleInvoiceDetail" + :detailButtonIsShowAdd="false" + :otherHeadButttonData = "[defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-record-main:export` })]" + @buttonBaseClick="detailButtonBaseClick" :Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" /> @@ -84,7 +87,28 @@ const { tableObject, tableMethods } = useTable({ const updataTableColumns = (val) => { tableColumns.value = val } +// 点击子表按钮事件 +const detailButtonBaseClick = async (val, item,tableObject) => { + if (val == 'export') { + // 子表导出 + console.log('子表导出',val, tableObject) + try { + // 导出的二次确认 + await message.exportConfirm() + // 发起导出 + loadStart() + const excelTitle = ref(route.meta.title) + const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceRecordDetail(tableObject.params) + download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) + } catch { + + } finally { + loadDone() + } + + } +} // 查询页面返回——详情 const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { nextTick(() => { @@ -108,8 +132,8 @@ const Echo = [] const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-main:import` }), // 导入 - defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-main:export` }), // 导出 + defaultButtons.defaultImportBtn({hasPermi:`wms:customer-sale-invoice-record-main:import` }), // 导入 + defaultButtons.defaultExportBtn({hasPermi:`wms:customer-sale-invoice-record-main:export` }), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts index cbaa842c8..e3736494e 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts @@ -103,6 +103,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ disabled:true } }, + isDetail:false, search:{ component:'Select', value:custormList.length>1?[custormList[0]['customerCode']]:[], @@ -132,6 +133,7 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ disabled: true } }, + isDetail:false, table:{ width:150 } diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue index f89ebbd09..332003adb 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue @@ -116,7 +116,7 @@ const detailButtonBaseClick = async (val, item,tableObject) => { // 发起导出 loadStart() const excelTitle = ref(route.meta.title) - const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceDetail(tableObject.params) + const data = await CustomerSaleInvoiceDetailApi.exportCustomerSaleInvoiceRequestDetail(tableObject.params) download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) } catch {