导入
This commit is contained in:
parent
f19d7d8182
commit
c1a0fcdf59
|
|
@ -1,21 +1,28 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
export function add (data) {
|
||||
return request({
|
||||
url: 'api/quickInterceptService',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function importQuickInterceptService (data) {
|
||||
return request({
|
||||
url: 'api/quickInterceptService/importQuickInterceptService',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
export function del (id) {
|
||||
return request({
|
||||
url: 'api/quickInterceptService/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
export function edit (data) {
|
||||
return request({
|
||||
url: 'api/quickInterceptService',
|
||||
method: 'put',
|
||||
|
|
@ -23,7 +30,7 @@ export function edit(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function downloadQuickInterceptService(params) {
|
||||
export function downloadQuickInterceptService (params) {
|
||||
return request({
|
||||
url: 'api/quickInterceptService/download',
|
||||
method: 'get',
|
||||
|
|
|
|||
|
|
@ -32,6 +32,38 @@
|
|||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:title="upload2.title"
|
||||
:visible.sync="upload2.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:headers="upload2.headers"
|
||||
:action="upload2.url"
|
||||
:disabled="upload2.isUploading"
|
||||
:on-progress="handleFileUploadProgress2"
|
||||
:on-success="handleFileSuccess2"
|
||||
:auto-upload="false"
|
||||
accept=".xlsx, .xls"
|
||||
method="get"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
:loading="upload2.isUploading"
|
||||
type="primary"
|
||||
@click="submitFileForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button @click="upload2.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
|
|
@ -137,7 +169,7 @@
|
|||
>退货退款查询</el-button
|
||||
>
|
||||
<el-button
|
||||
v-permission="['admin', 'xyPersoninfo:add']"
|
||||
v-permission="['admin', 'douyinAfterSales:add']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
|
|
@ -145,6 +177,15 @@
|
|||
@click="handleImport"
|
||||
>售后订单导入</el-button
|
||||
>
|
||||
<el-button
|
||||
v-permission="['admin', 'douyinAfterSales:importRefundData']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleImport2"
|
||||
>退回物流单号导入</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
|
|
@ -305,6 +346,18 @@ export default {
|
|||
// 上传的地址
|
||||
url: "/api/douyinAfterSales/importAfterSaleData"
|
||||
},
|
||||
upload2: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: "/api/douyinAfterSales/importRefundData"
|
||||
},
|
||||
quanxian: false,
|
||||
afterSalesTypeArr: [],
|
||||
shopNameArr: [],
|
||||
|
|
@ -402,10 +455,17 @@ export default {
|
|||
this.upload.title = "售后订单导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
handleImport2() {
|
||||
this.upload2.title = "退回物流单号导入";
|
||||
this.upload2.open = true;
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
handleFileUploadProgress2(event, file, fileList) {
|
||||
this.upload2.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false;
|
||||
|
|
@ -414,6 +474,13 @@ export default {
|
|||
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.init();
|
||||
},
|
||||
handleFileSuccess2(response, file, fileList) {
|
||||
this.upload2.open = false;
|
||||
this.upload2.isUploading = false;
|
||||
this.$refs.upload2.clearFiles();
|
||||
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.init();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
|
|
|
|||
|
|
@ -124,6 +124,15 @@
|
|||
@click="toQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button
|
||||
v-permission="['admin', 'douyinAfterSales:process']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-search"
|
||||
@click="toQuery"
|
||||
>处理</el-button
|
||||
>
|
||||
<el-button
|
||||
v-permission="['admin', 'quickInterceptService:add']"
|
||||
class="filter-item"
|
||||
|
|
@ -246,7 +255,8 @@ import checkPermission from "@/utils/permission";
|
|||
import initData from "@/mixins/initData";
|
||||
import {
|
||||
del,
|
||||
downloadQuickInterceptService
|
||||
downloadQuickInterceptService,
|
||||
importQuickInterceptService
|
||||
} from "@/api/quickInterceptService";
|
||||
import eForm from "./form";
|
||||
import initDict from "@/mixins/initDict";
|
||||
|
|
@ -270,7 +280,7 @@ export default {
|
|||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: "/api/douyinAfterSales/importAfterSaleData"
|
||||
url: "/api/quickInterceptService/process"
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: "shopName", display_name: "店铺名称" },
|
||||
|
|
@ -296,6 +306,40 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
importQuickInterceptService() {
|
||||
if (this.templateSelection == "") {
|
||||
this.$message.error("请选择一条要处理的数据");
|
||||
return;
|
||||
}
|
||||
|
||||
this.$confirm("确认已解决了吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.processLoading = true;
|
||||
importQuickInterceptService(this.templateSelection)
|
||||
.then(res => {
|
||||
this.processLoading = false;
|
||||
|
||||
this.$notify({
|
||||
title: "操作成功",
|
||||
type: "success",
|
||||
duration: 2500
|
||||
});
|
||||
this.templateSelection = "";
|
||||
this.init();
|
||||
})
|
||||
.catch(err => {
|
||||
this.processLoading = false;
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
handleImport() {
|
||||
this.upload.title = "导入";
|
||||
this.upload.open = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user