增加导入导出
This commit is contained in:
parent
2fb5341550
commit
03fc862fbd
|
|
@ -141,6 +141,25 @@
|
|||
@click="handleBatchDel"
|
||||
>批量删除</el-button>
|
||||
</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-button
|
||||
type="primary"
|
||||
|
|
@ -150,25 +169,7 @@
|
|||
>批量修改类别
|
||||
</el-button>
|
||||
</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-button
|
||||
size="mini"
|
||||
|
|
@ -408,7 +409,7 @@ export default {
|
|||
// 设置上传的请求头部
|
||||
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) {
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$modal.msgSuccess("后台导入中,请稍后刷新列表!");
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.getList()
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
<el-form-item>
|
||||
<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-button" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
|
@ -300,6 +301,11 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
this.download('smart-canteen/api/v1/drpinventory/export', {
|
||||
...this.queryParams
|
||||
}, `货品库存${new Date().getDate()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue