Commit 840f4b2c by linjinhong

物流分区修改

parent fb3b2796
......@@ -61,7 +61,6 @@ import {
updateLogisticsZone,
deleteLogisticsZone,
importLogisticsZone,
exportExcelLogisticsZone,
getlogisticsWayAllList,
} from '@/api/logistics'
......@@ -220,7 +219,11 @@ async function getList(data?: {
logisticsIdList?: string[] | string
codePrefix?: string
}) {
loading.value = true
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await getLogisticsZoneList({
...data,
......@@ -301,7 +304,7 @@ async function getList(data?: {
} catch (error) {
console.log(error)
} finally {
loading.value = false
loading.close()
}
}
......@@ -392,13 +395,11 @@ function onBeforeUploadImage(file: File) {
*/
async function downloadExcel() {
try {
const res = await exportExcelLogisticsZone()
const blob = new Blob([res as unknown as BlobPart])
const filename = '物流分区模版.xlsx'
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = filename
link.href = '/files/logisticsZoning.xlsx'
link.download = '物流分区模版.xlsx'
link.click()
document.body.removeChild(link)
} catch (error) {
console.log(error)
}
......@@ -415,10 +416,11 @@ async function exportExcel(file: { file: File }) {
const res = await importLogisticsZone(formData)
if (res.code === 200) {
ElMessage.success('导入成功!')
getList(searchForm.value)
}
} catch (error) {
ElMessage.error('导入失败!')
} finally {
getList(searchForm.value)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment