增加导入导出

This commit is contained in:
liux 2026-01-23 18:17:52 +08:00
parent 2fb5341550
commit 03fc862fbd
3 changed files with 134 additions and 127 deletions

View File

@ -141,6 +141,25 @@
@click="handleBatchDel" @click="handleBatchDel"
>批量删除</el-button> >批量删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:show-file-list="false"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
>
<el-button
type="success"
size="mini"
>批量导入
</el-button>
</el-upload>
</el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
@ -150,25 +169,7 @@
>批量修改类别 >批量修改类别
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:show-file-list="false"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
>
<el-button
type="success"
size="mini"
>批量导入
</el-button>
</el-upload>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
size="mini" size="mini"
@ -408,7 +409,7 @@ export default {
// //
headers: { Authorization: 'Bearer ' + getToken() }, headers: { Authorization: 'Bearer ' + getToken() },
// //
url: process.env.VUE_APP_BASE_API + '/smart-canteen/api/v1/menumaterial/batch/import/material', url: process.env.VUE_APP_BASE_API + '/smart-canteen/ims_order_goods/import/commodity',
}, },
}; };
}, },
@ -676,7 +677,7 @@ export default {
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
this.upload.isUploading = false this.upload.isUploading = false
this.$refs.upload.clearFiles() this.$refs.upload.clearFiles()
this.$modal.msgSuccess("后台导入中,请稍后刷新列表!"); this.$modal.msgSuccess(response.msg);
this.getList() this.getList()
}, },

View File

@ -51,6 +51,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button icon="el-icon-button" size="mini" @click="handleExport">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -300,6 +301,11 @@ export default {
} }
}); });
}, },
handleExport() {
this.download('smart-canteen/api/v1/drpinventory/export', {
...this.queryParams
}, `货品库存${new Date().getDate()}.xlsx`)
}
} }
}; };
</script> </script>