|
@@ -43,12 +43,15 @@
|
|
|
placeholder="请输入申请部门名称"
|
|
placeholder="请输入申请部门名称"
|
|
|
class="act-search-input"
|
|
class="act-search-input"
|
|
|
clearable
|
|
clearable
|
|
|
- />
|
|
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</section>
|
|
</section>
|
|
|
<section class="search-btn">
|
|
<section class="search-btn">
|
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
<el-button @click="handleReset">重置</el-button>
|
|
<el-button @click="handleReset">重置</el-button>
|
|
|
|
|
+ <el-button plain @click="handleDownload">
|
|
|
|
|
+ 导出
|
|
|
|
|
+ </el-button>
|
|
|
</section>
|
|
</section>
|
|
|
</div>
|
|
</div>
|
|
|
</header>
|
|
</header>
|
|
@@ -110,10 +113,12 @@
|
|
|
import {
|
|
import {
|
|
|
queryPurchaseApplyList,
|
|
queryPurchaseApplyList,
|
|
|
deletePurchaseApply,
|
|
deletePurchaseApply,
|
|
|
|
|
+ exportSafetyEquipmentProcurementRequest,
|
|
|
type PpePurchaseApply,
|
|
type PpePurchaseApply,
|
|
|
type QueryPurchaseApplyPageReq,
|
|
type QueryPurchaseApplyPageReq,
|
|
|
} from '@/api/production-safety/personal-protective-equipment-purchase-apply';
|
|
} from '@/api/production-safety/personal-protective-equipment-purchase-apply';
|
|
|
import { template } from 'lodash-es';
|
|
import { template } from 'lodash-es';
|
|
|
|
|
+ import { downloadByData } from '@/utils/file/download';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
@@ -269,6 +274,20 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const handleDownload = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const response = await exportSafetyEquipmentProcurementRequest(tableQuery.queryParam);
|
|
|
|
|
+ if (response) {
|
|
|
|
|
+ const fileName = `劳防用品采购申请管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
|
|
+ downloadByData(response, fileName);
|
|
|
|
|
+ ElMessage.success('导出成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('导出劳防用品采购申请管理失败:', e);
|
|
|
|
|
+ ElMessage.error('导出失败,请重试');
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getTableData();
|
|
getTableData();
|
|
|
});
|
|
});
|