Commit b4baef4b by Kyle_Li

批量积分导入

parents d0e62b92 03745322
......@@ -27,7 +27,8 @@
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vue-style-loader": "^3.1.2",
"vuex": "^3.0.1"
"vuex": "^3.0.1",
"xlsx": "^0.14.3"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
......
......@@ -68,6 +68,11 @@ const urlConfig = {
getReturnMember: '/api-member/query-members-page', // 回收站门店
getSubStoreList: 'api-member/members-sub-store-list', // 获取选中会员的协管门店
updateMemberStore: '/api-member/member-load-update-store', // 修改单个会员的服务门店和协管门店
getBatchRecord: '/api-member/queryBatchRecord', // 批量积分导入-获取积分导入数据
downLoadExcelTemplate: '/api-member/downLoadExcelTemplate', // 批量积分导入-下载积分导入模板
uploadExecl: '/api-member/uploadExecl', // 批量积分导入-导入数据
queryBatchRetErrInfo: '/api-member/queryBatchRetErrInfo', // 批量积分导入-日志详情-获取数据
downloadErrorData: '/api-member/downloadErrorData', // 批量积分导入-日志详情-下载错误数据
}
const defaultUrl = Object.assign({}, urlConfig);
......
<template>
<div id="bulkLogsDetail">
<nav-path :navpath="navpath"></nav-path>
<div class="content">
<div class="contentInfo">
<div class="flex">
<span class="headerTips">总条数:{{ count.all }} 条,成功导入 {{ count.success }} 条,<span class="headerTipsError">错误 {{ count.error }}</span></span>
<el-button type="primary" @click="exportExcel"><i class="iconfont icon-icon_yunxiazai"></i> 导出</el-button>
</div>
<el-table
:data="tableData">
<el-table-column
prop="sequence"
label="序号">
</el-table-column>
<el-table-column
prop="errorCause"
label="错误提示">
</el-table-column>
<el-table-column
prop="cardNum"
label="会员卡号">
</el-table-column>
<el-table-column
prop="opIntegral"
label="变更额度">
</el-table-column>
<el-table-column
v-if="isShow"
prop="address"
label="成本主体">
<template slot-scope="{ row }">
{{ operation || '——' }}
</template>
</el-table-column>
<el-table-column
prop="remark"
label="原因备注">
<template slot-scope="{ row }">
{{ row.remark || '——' }}
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
v-if="tableData.length > 0"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-sizes="[20, 40, 60, 80]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next"
:total="page.totalCount">
</el-pagination>
</div>
<vue-gic-footer></vue-gic-footer>
</div>
</div>
</template>
<script>
import { doFetch, doFetchqs } from "../../components/axios/api";
import NavPath from "@/common/navbar/navbar.vue";
import url from "../../components/axios/url";
import {
checkFalse,
checkStatus,
checkSuccess
} from "../../../static/js/checkStatus";
export default {
data() {
return {
navpath: [{ name: "首页", path: "" }, { name: "微信会员", path: "" }, { name: "批量导入", path: "" }, { name: "日志详情", path: "" }],
tableData: [],
// 换页
page: {
currentPage: 1,
pageSize: 20,
totalCount: 0
},
// 判断积分类型
integralType: '积分扣除',
// 条数
count: {
all: 0,
success: 0,
error: 0
},
batchId: '',
batchType: '',
isShow: false,
}
},
methods: {
// 导出
exportExcel() {
window.location.href = `${url.downloadErrorData}?requestProject=member&batchType=${this.batchType}&batchId=${this.batchId}` ;
},
// 获取数据
getLogsDetail() {
let params = {
batchId: this.batchId,
batchType: this.batchType
}
doFetchqs(url.queryBatchRetErrInfo, params).then(res => {
if(res.data.errorCode == 0) {
let value = res.data.result;
// console.log(value)
this.page.totalCount = value.totalCount;
this.tableData = value.result;
} else {
checkFalse(res.data.message)
}
}).catch(err => {
checkStatus(err);
})
},
},
created() {
if(!this.$route.query.data) {
checkFalse('123')
} else {
const { batchId, batchType, total, succeedNum, errorNum, operaUerName } = this.$route.query.data;
this.batchId = batchId;
this.batchType = batchType;
console.log(this.batchType)
if(batchType == 11) {
this.isShow = true;
this.operation = operaUerName
}
this.count.all = total;
this.count.success = succeedNum;
this.count.error = errorNum;
console.log(this.$route.query.data)
this.getLogsDetail();
}
},
components: {
NavPath
}
}
</script>
<style lang="scss" scoped>
#bulkLogsDetail {
.el-table{
width:99.9%;
}
.content {
padding: 22px 24px;
.contentInfo {
padding: 30px 24px;
background-color: #fff;
.headerTips {
color: #303133;
font-size: 14px;
}
.headerTipsError {
color: #F5222D;
}
.flex {
padding-bottom: 22px;
}
/deep/ .el-table th>.cell {
font-weight: 700;
color: #303133;
}
/deep/ .el-pagination {
text-align: right;
margin: 20px 0 40px;
}
}
}
}
.flex {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
......@@ -789,12 +789,54 @@ export default {
checkStatus(err);
});
},
handleVisibleBatch(val) {
if(this.multipleList.length < 1) {
this.batchValue = '';
checkFalse('请勾选会员');
return false;
}
// handleVisibleBatch(val) {
// if (this.batchValue == "bulkIntegral") {
// this.$router.push({ path: '/bulkIntegral', query: { ids: 123 } });
// } else if(this.multipleList.length < 1) {
// this.batchValue = '';
// checkFalse('请勾选会员');
// return false;
// }
// if (!val) {
// if (this.batchValue == "integral") {
// this.dilogIntegralVisible = true;
// this.getEnterpriseInfo();
// if (this.$refs.IntegralForm) {
// this.$refs.IntegralForm.resetFields();
// }
// }
// if (this.batchValue == "grade") {
// this.dilogGradeVisible = true;
// if (this.$refs.gradeForm) {
// this.$refs.gradeForm.resetFields();
// }
// }
// if (this.batchValue == "mainstore") {
// this.dilogMainstoreVisible = true;
// this.selectStore(val);
// if (this.$refs.mainstoreForm) {
// this.$refs.mainstoreForm.resetFields();
// }
// this.storeName = '';
// }
// if (this.batchValue == "store") {
// this.dilogSubStoreVisible = true;
// if (this.$refs.storeForm) {
// this.$refs.storeForm.resetFields();
// }
// this.getSubStoreList();
// }
// }
// },
handleFocusBatch() {
if (this.batchValue == "bulkIntegral") {
this.batchValue = '';
this.$router.push({ path: '/bulkIntegral' });
} else if(this.multipleList.length < 1) {
this.batchValue = '';
checkFalse('请勾选会员');
return false;
}
if (!val) {
if (this.batchValue == "integral") {
this.dilogIntegralVisible = true;
......@@ -826,13 +868,6 @@ export default {
}
}
},
handleFocusBatch() {
if (this.multipleList.length < 1) {
this.batchValue = "";
checkFalse("请勾选会员");
return false;
}
},
selectAllmultipleList() {
this.selectAll = !this.selectAll;
if (this.selectAll) {
......
......@@ -85,6 +85,11 @@
value="integral"
></el-option>
<el-option
key="bulkIntegral"
label="批量调整积分"
value="bulkIntegral"
></el-option>
<el-option
key="grade"
label="调整会员等级"
value="grade"
......
......@@ -221,6 +221,22 @@ export const constantRouterMap = [
meta: {
title: "微信会员-会员门店消费"
}
},
{
path: "/bulkIntegral",
name: "/bulkIntegral",
component: _import("wechatmembers", "bulkIntegral"),
meta: {
title: "批量导入"
}
},
{
path: "/bulkLogsDetail",
name: "/bulkLogsDetail",
component: _import("wechatmembers", "bulkLogsDetail"),
meta: {
title: "日志详情"
}
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment