|
@@ -133,6 +133,12 @@
|
|
|
重置
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :size="'mini'"
|
|
|
+ @click="exportGood('导出盘点商品')"
|
|
|
+ >导出盘点商品
|
|
|
+ </el-button>
|
|
|
<el-col
|
|
|
:span="3"
|
|
|
style="width: 66px; float: right"
|
|
@@ -336,7 +342,7 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
restSearch() {
|
|
|
- // 表格 - 分页
|
|
|
+ // 表格 - 分页
|
|
|
this.pageInfo = {
|
|
|
size: 15,
|
|
|
curr: 1,
|
|
@@ -378,6 +384,59 @@ export default {
|
|
|
await this.searchList();
|
|
|
}
|
|
|
},
|
|
|
+ async exportGood(message) {
|
|
|
+ if (!this.loading) {
|
|
|
+ this.loading = true;
|
|
|
+ let httpType = `aplication/zip`;
|
|
|
+ let model = {
|
|
|
+ end: "2021-10-29",
|
|
|
+ start: "2021-10-01",
|
|
|
+ token: "b04d184cc37ad3658ae87dac1755ae8470c80afd",
|
|
|
+ // id: this.queryId,
|
|
|
+ // token: getToken(),
|
|
|
+ };
|
|
|
+ axios({
|
|
|
+ method: "post",
|
|
|
+ //urlConfig.baseURL + "admin/checkexport"
|
|
|
+ url: "http://inv.sitw.wanyuhengtong.com/downqrdinv",
|
|
|
+ responseType: "blob",
|
|
|
+ data: model,
|
|
|
+ headers: {
|
|
|
+ Accept: httpType,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res && res.status == 200 && res.data) {
|
|
|
+ let blob = new Blob([res.data], {
|
|
|
+ type: httpType,
|
|
|
+ });
|
|
|
+ let url = window.URL.createObjectURL(blob);
|
|
|
+ let aLink = document.createElement("a");
|
|
|
+ aLink.style.display = "none";
|
|
|
+ aLink.href = url;
|
|
|
+ aLink.setAttribute("download", `${message}.zip`);
|
|
|
+ document.body.appendChild(aLink);
|
|
|
+ aLink.click();
|
|
|
+ document.body.removeChild(aLink); //下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url); //释放掉blob对象
|
|
|
+
|
|
|
+ this.$message.success(`${message}导出成功!`);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ } else {
|
|
|
+ // this.$message.error(res.data.message);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log(error);
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
async searchList() {
|
|
|
if (
|
|
|
(this.parmValue.start !== "" && this.parmValue.end === "") ||
|