重构盘点管理导出功能,将导出模板接口重命名为导出盘点,统一接口命名规范
This commit is contained in:
@@ -91,10 +91,10 @@ export function cancelInventoryCount(id: string[], reason?: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出盘点模板
|
// 导出盘点
|
||||||
export function exportInventoryCountTemplate(id: string) {
|
export function exportInventoryCount(id: string) {
|
||||||
return newService({
|
return newService({
|
||||||
url: 'assets/inventory/count/exportInventoryCountTemplate',
|
url: 'assets/inventory/count/exportInventoryCount',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { id },
|
params: { id },
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default {
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import type { UploadFile, UploadInstance, UploadRawFile } from 'element-plus';
|
import type { UploadFile, UploadInstance, UploadRawFile } from 'element-plus';
|
||||||
import { exportInventoryCountTemplate, importInventoryCount } from '/@/api/assets/operation/count';
|
import { exportInventoryCount, importInventoryCount } from '/@/api/assets/operation/count';
|
||||||
|
|
||||||
// 定义事件
|
// 定义事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
@@ -96,7 +96,7 @@ const onDownloadTemplate = async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const res = await exportInventoryCountTemplate(countId.value);
|
const res = await exportInventoryCount(countId.value);
|
||||||
const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
|
|||||||
Reference in New Issue
Block a user