|
|
@ -51,11 +51,13 @@ defineOptions({ name: 'RawMaterialConsumptionInfo' }) |
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref([...RawMaterialConsumptionInfo.allSchemas.tableColumns]) |
|
|
|
|
|
|
|
/** 列表导出按钮操作 */ |
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
const mesModelVisible = ref(false) |
|
|
|
const { tableObject: tableObject, tableMethods: tableMethods } =useTable({ |
|
|
|
getListApi: RawMaterialConsumptionInfoApi.getRawMaterialConsumptionInfoPage |
|
|
@ -70,7 +72,7 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
// defaultButtons.defaultExportBtn({hasPermi:'wms:productreceipt-record-main:export'}), // 导出 |
|
|
|
defaultButtons.defaultExportBtn(null), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -80,7 +82,7 @@ const HeadButttondata = [ |
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'export') { // 导出 |
|
|
|
// handleExport() |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
|
|
|
searchFormClick({ |
|
|
@ -104,6 +106,20 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
const handleExport = async () => { |
|
|
|
try { |
|
|
|
// 导出的二次确认 |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await RawMaterialConsumptionInfoApi.exportAssemblyMaterialUsage(tableObject.params) |
|
|
|
download.excel(data, '装配完工原料信息.xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|