|
@@ -13,6 +13,25 @@
|
|
|
>
|
|
|
新建
|
|
|
</el-button>
|
|
|
+ <el-upload
|
|
|
+ v-permission="'import/importRedemptionCode'"
|
|
|
+ style="display: inline-block;margin-left:10px;"
|
|
|
+ action="/api-web/import/importRedemptionCode"
|
|
|
+ :show-file-list="false"
|
|
|
+ :before-upload="beforeUpload"
|
|
|
+ accept=".xlsx,.xls"
|
|
|
+ :headers="headers"
|
|
|
+ :on-error="handleError"
|
|
|
+ :on-success="handleSuccess"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ style="margin-bottom:20px"
|
|
|
+ >
|
|
|
+ 导入兑换码
|
|
|
+ </el-button>
|
|
|
+ </el-upload>
|
|
|
+
|
|
|
<save-form :inline="true" @submit="search" :model="searchForm">
|
|
|
<el-form-item label="客户端">
|
|
|
<el-select clearable v-model="searchForm.search">
|
|
@@ -187,7 +206,9 @@ import {
|
|
|
resetAppVersionInfo,
|
|
|
} from "@/api/systemManage";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
+import { getToken, getTenantId} from "@/utils/auth";
|
|
|
import { decode } from "js-base64";
|
|
|
+import load from "@/utils/loading";
|
|
|
export default {
|
|
|
components: {
|
|
|
pagination,
|
|
@@ -235,6 +256,10 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
isNew: false,
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken(),
|
|
|
+ tenantId: getTenantId()
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
|
@@ -269,6 +294,30 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ beforeUpload(file) {
|
|
|
+ load.startLoading();
|
|
|
+ },
|
|
|
+ handleSuccess(response, file, fileList) {
|
|
|
+ // 导入商品
|
|
|
+ // 报表导出
|
|
|
+ load.endLoading();
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.$message.success(response.msg || "导入成功");
|
|
|
+ } else if (response.code == 0) {
|
|
|
+ let str = this.fomatStr(response.msg);
|
|
|
+ this.$alert(str, "导入结果", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ callback: (action) => {
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error(response.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleError(err, file, fileList) {
|
|
|
+ load.endLoading();
|
|
|
+ },
|
|
|
createEdi() {
|
|
|
this.isNew = true;
|
|
|
this.sectionVisible = true;
|