Browse Source

导出明细,二维表

master_hella_20240701
wangyufei 2 months ago
parent
commit
ae3ee586a1
  1. 19
      src/api/wms/purchasePlanMain/index.ts
  2. 6
      src/locales/en-US.ts
  3. 6
      src/locales/zh-CN.ts
  4. 25
      src/utils/disposition/defaultButtons.ts
  5. 35
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

19
src/api/wms/purchasePlanMain/index.ts

@ -85,7 +85,24 @@ export const exportPurchasePlanMain = async (params) => {
return await request.download({ url: `/wms/purchase-plan-main/export-excel`, params })
}
}
// 导出明细要货计划主 Excel
export const exportDetailsPurchasePlanMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchase-plan-main/export-excel-senior`, data })
} else {
return await request.download({ url: `/wms/purchase-plan-main/export-excel-detail`, params })
}
}
// 导出要货计划二维表 Excel
export const exportTablePurchasePlanMain = async (params) => {
// if (params.isSearch) {
// const data = {...params}
// return await request.downloadPost({ url: `/wms/purchase-plan-main/export-excel-senior`, data })
// } else {
return await request.download({ url: `/wms/purchase-plan-main/export-excel`, params })
//}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchase-plan-main/get-import-template' })

6
src/locales/en-US.ts

@ -1144,7 +1144,11 @@ export default {
:'All read',
'申请发货数量不能大于 计划数量 - 已发货数量':'The requested quantity cannot be greater than the planned quantity - the quantity shipped',
:'Oversend is not allowed',
:'The total quantity exceeds the planned quantity'
:'The total quantity exceeds the planned quantity',
:'Exporting two-dimensional tables',
:'Detailed requisition plan',
:'Two dimensional requisition schedule'
},

6
src/locales/zh-CN.ts

@ -1144,8 +1144,10 @@ export default {
:'全部已读',
'申请发货数量不能大于 计划数量 - 已发货数量':'申请发货数量不能大于 计划数量 - 已发货数量',
:'不允许超发',
:'总数量超出计划数量'
:'总数量超出计划数量',
:'导出二维表',
:'要货计划明细',
:'要货计划二维表'
},
}

25
src/utils/disposition/defaultButtons.ts

@ -44,6 +44,31 @@ export function defaultExportBtn(option: any) {
hasPermi: ''
})
}
// 导出明细按钮
export function defaultExportDetailsBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.导出明细`).replace('ts.', ''),
name: 'export-details',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
})
}
// 导出明细按钮
export function defaultExportTableBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.导出二维表`).replace('ts.', ''),
name: 'export-table',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
})
}
// 字段设置
// export function defaultFieldSettingBtn(option:any) {

35
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -292,7 +292,9 @@ const getSearchTableData = async (number,formField,searchField)=>{
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchase-plan-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchase-plan-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchase-plan-main:export' }), //
// defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchase-plan-main:export' }), //
defaultButtons.defaultExportDetailsBtn({ hasPermi: 'wms:purchase-plan-main:export' }), //
defaultButtons.defaultExportTableBtn({ hasPermi: 'wms:purchase-plan-main:export' }), //
// defaultButtons.mainListSelectionOrderPubBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
@ -316,6 +318,10 @@ const getSearchTableData = async (number,formField,searchField)=>{
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'export-details') { //
handleExportDetails()
} else if (val == 'export-table') { //
handleExportTable()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
@ -628,6 +634,33 @@ const handleSelectionPublish = async ()=>{
}
}
const handleExportDetails = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PurchasePlanMainApi.exportDetailsPurchasePlanMain(tableObject.params)
download.excel(data, `${t('ts.要货计划明细')}.xlsx`)
} catch {
} finally {
exportLoading.value = false
}
}
const handleExportTable = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PurchasePlanMainApi.exportTablePurchasePlanMain(tableObject.params)
download.excel(data, `${t('ts.要货计划二维表')}.xlsx`)
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/

Loading…
Cancel
Save