基础信息添加模板下载

This commit is contained in:
王帅 2025-06-06 08:38:54 +08:00
parent a26fdfa1c9
commit a1298819d5
6 changed files with 37 additions and 2 deletions

View File

@ -307,6 +307,31 @@ export const JeecgListMixin = {
}
})
},
/**下载模板 */
handleExportTemplate(fileName){
if(!fileName || typeof fileName != "string"){
fileName = "导出文件"
}
downFile(this.url.exportTemplate).then((data)=>{
if (!data) {
this.$message.warning("文件下载失败")
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
}else{
let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName+'.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
}
})
},
/* 导入 */
handleImportExcel(info){
this.loading = true;

View File

@ -67,6 +67,7 @@
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('物流价格基础信息管理')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportTemplate('物流价格基础信息管理模板')">下载模板</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
@ -277,6 +278,7 @@
delete: "/iogisticsprice/tmsIogisticsPrice/delete",
deleteBatch: "/iogisticsprice/tmsIogisticsPrice/deleteBatch",
exportXlsUrl: "/iogisticsprice/tmsIogisticsPrice/exportXls",
exportTemplate: "/iogisticsprice/tmsIogisticsPrice/exportTemplate",
importExcelUrl: "iogisticsprice/tmsIogisticsPrice/importExcel",
},

View File

@ -45,6 +45,7 @@
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('物流路线信息维护')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportTemplate('物流路线信息维护模板')">下载模板</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
@ -197,6 +198,7 @@
delete: "/logisticsroute/logisticsRoute/delete",
deleteBatch: "/logisticsroute/logisticsRoute/deleteBatch",
exportXlsUrl: "/logisticsroute/logisticsRoute/exportXls",
exportTemplate: "/logisticsroute/logisticsRoute/exportTemplate",
importExcelUrl: "logisticsroute/logisticsRoute/importExcel",
},

View File

@ -33,6 +33,7 @@
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('车辆运营商管理')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportTemplate('车辆运营商管理模板')">下载模板</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
@ -180,6 +181,7 @@
delete: "/vehicleoperator/tmsVehicleOperator/delete",
deleteBatch: "/vehicleoperator/tmsVehicleOperator/deleteBatch",
exportXlsUrl: "/vehicleoperator/tmsVehicleOperator/exportXls",
exportTemplate: "/vehicleoperator/tmsVehicleOperator/exportTemplate",
importExcelUrl: "vehicleoperator/tmsVehicleOperator/importExcel",
},

View File

@ -30,7 +30,8 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tms_vehicle_pallet')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('车型可装托数维护')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportTemplate('车型可装托数维护模板')">下载模板</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
@ -175,6 +176,7 @@
delete: "/vehiclepallet/vehiclePallet/delete",
deleteBatch: "/vehiclepallet/vehiclePallet/deleteBatch",
exportXlsUrl: "/vehiclepallet/vehiclePallet/exportXls",
exportTemplate: "/vehiclepallet/vehiclePallet/exportTemplate",
importExcelUrl: "vehiclepallet/vehiclePallet/importExcel",
getCarType: "vehiclepallet/vehiclePallet/getCarType",

View File

@ -27,7 +27,8 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('product')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('产品每托支数维护')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportTemplate('产品每托支数维护模板')">下载模板</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
@ -170,6 +171,7 @@
delete: "/vehicleproduct/tmsVehicleProduct/delete",
deleteBatch: "/vehicleproduct/tmsVehicleProduct/deleteBatch",
exportXlsUrl: "/vehicleproduct/tmsVehicleProduct/exportXls",
exportTemplate: "/vehicleproduct/tmsVehicleProduct/exportTemplate",
importExcelUrl: "vehicleproduct/tmsVehicleProduct/importExcel",
},