Commit 93e97530 by crushh

Merge branch 'feature/act-code' of http://git.gicdev.com/office/haoban-3 into feature/act-code

parents 64c8d0d6 bddd3589
......@@ -40,7 +40,7 @@
"vue-amap": "^0.5.10",
"vue-awesome-swiper": "^3.1.3",
"vue-clipboard2": "^0.2.0",
"vue-qr": "^1.3.8",
"vue-qr": "^1.5.3",
"vue-runtime-helpers": "^1.1.2",
"xlsx": "^0.13.5"
},
......@@ -97,7 +97,7 @@
"vue-axios": "^2.1.1",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "2.6.6",
"vue-template-compiler": "^2.6.6",
"vuedraggable": "^2.23.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
......
......@@ -3,9 +3,9 @@
<div class="flex p-b-40">
<el-image v-if="codeInfo.hmType == 2" class="img-200" :src="codeInfo.wxQrcode" />
<div class="text-ellipsis-white color-303133" :style="codeInfo.hmType == 1 ? 'width:100%;' : 'width: calc(100% - 230px);'">
<div class="p-t-12 flex">
<div class="font-16 line-22 text-ellipsis-white height-22 font-w-500">{{ codeInfo.name }}</div>
<el-tag effect="dark" :type="codeStatusLis[statusIndex].style" style="margin-left: 8px;">{{ codeStatusLis[statusIndex].value }}</el-tag>
<div class="p-t-12 flex height-22">
<div class="font-16 line-22 text-ellipsis-white font-w-500">{{ codeInfo.name }}</div>
<el-tag size="small" effect="dark" :type="codeStatusLis[statusIndex].style" style="margin-left: 8px;">{{ codeStatusLis[statusIndex].value }}</el-tag>
<!-- 正常success/正常到上限warning/待生效info/已作废danger -->
</div>
<p class="font-14 m-t-10 ">ID:{{ codeInfo.hmId }}</p>
......@@ -14,25 +14,25 @@
<div class="font-14 line-22">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型:
</div>
<el-tag>{{ codeInfo.hmType == 1 ? '单人活码' : '多人活码' }}</el-tag>
<el-tag size="small">{{ codeInfo.hmType == 1 ? '单人活码' : '多人活码' }}</el-tag>
</div>
<div class="font-14 line-22 flex-1">创建人:{{ codeInfo.creatorName || '--' }}</div>
<div class="font-14 line-22 flex-1">创建时间:{{ codeInfo.createTime | formatTimeStamp }}</div>
</div>
<div class="flex font-14" style="padding-top:15px;">
<div class="font-14 line-22 flex-1">所属分组:{{ codeInfo.hmGroupName }}</div>
<div class="font-14 line-22 flex-1">所属分组:{{ codeInfo.hmGroupName || '--' }}</div>
<div class="flex flex-1">
<div class="font-14 line-22">自动通过好友:</div>
<el-tag :type="codeInfo.passFlag == 1 ? '' : 'danger'">{{ codeInfo.passFlag == 1 ? '已开启' : '已关闭' }}</el-tag>
<el-tag size="small" :type="codeInfo.passFlag == 1 ? '' : 'danger'">{{ codeInfo.passFlag == 1 ? '已开启' : '已关闭' }}</el-tag>
</div>
<div class="flex flex-1">
<div class="font-14 line-22">活码标签:</div>
<el-tag type="info">{{ codeInfo.memberLabelName }}</el-tag>
<el-tag size="small" type="info">{{ codeInfo.memberLabelName || '--' }}</el-tag>
</div>
</div>
<div v-if="codeInfo.statusFlag != 2" class="flex" style="padding-top:20px;">
<el-button v-if="codeInfo.hmType == 2 && codeInfo.statusFlag == 1" icon="el-icon-download" type="primary" style="width:120px;margin-right: 12px;" @click="downloadQR">下载二维码</el-button>
<el-button type="primary" plain style="width:98px;" @click="modifyCode">修改</el-button>
<el-button type="primary" plain style="width:98px;" @click="modifyCode">编辑</el-button>
<el-button type="danger" plain style="width:98px;margin-left: 20px; border-color: #F5222D;" @click="discardCode">作废</el-button>
</div>
</div>
......@@ -47,10 +47,10 @@
</div>
<el-tabs v-model="activeName" type="card">
<el-tab-pane label="详情信息" name="first">
<act-code-detail-info :enterprise-id="codeInfo.enterpriseId" :welcome-id="codeInfo.welcomeId" :hm-id="hmId"></act-code-detail-info>
<act-code-detail-info :enterprise-id="codeInfo.enterpriseId" :welcome-id="codeInfo.welcomeId" :hm-id="$route.query.hmId"></act-code-detail-info>
</el-tab-pane>
<el-tab-pane label="数据统计" name="second">
<act-code-detail-statistics :hm-id="hmId"></act-code-detail-statistics>
<act-code-detail-statistics :hm-id="$route.query.hmId"></act-code-detail-statistics>
</el-tab-pane>
</el-tabs>
</div>
......@@ -59,7 +59,7 @@
import actCodeDetailInfo from './actCodeDetailInfo.vue';
import actCodeDetailStatistics from './actCodeDetailStatistics.vue';
import { _throttle } from '@/common/js/public';
// import { getRequest, deleteRequest } from '@/api/api';
import { getRequest, deleteRequest } from '@/api/api';
import errMsg from '@/common/js/error';
export default {
name: 'actCodeDetail',
......@@ -92,70 +92,67 @@ export default {
window.open(this.codeInfo.wxQrcode);
},
modifyCode() {
this.$router.push(`/actCodeEdit?hmId=${this.hmId}`);
this.$router.push(`/actCodeEdit?hmId=${this.$route.query.hmId}`);
},
discardCode() {
// const that = this;
// that.loading = true;
// deleteRequest('/hm/qrcode/del', { hmId: that.hmId })
// .then(res => {
// let resData = res.data;
// that.loading = false;
// if (resData.errorCode == 1) {
// that.getActCodeInfo();
// return;
// }
// errMsg.errorMsg(resData);
// })
// .cash(function(error) {
// that.$message.error({
// duration: 1000,
// message: error.message
// });
// });
const that = this;
this.$confirm('确认要作废该活码?此操作将永久废弃该活码,请确保不影响其他投放使用!', '作废提示', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.loading = true;
deleteRequest('/haoban-manage3-web/hm/qrcode/del', { hmId: that.$route.query.hmId }).then(res => {
that.loading = false;
if (res.data.code == 0) {
this.getActCodeInfo();
return;
}
errMsg.errorMsg(res.data);
});
});
},
async getActCodeInfo() {
const that = this;
that.hmId = '999';
if (that.hmId.length <= 0) return;
if (that.$route.query.hmId.length <= 0) return;
that.loading = true;
// getRequest('/hm/qrcode/detail', { hmId: that.hmId })
// .then(res => {
let res = {
data: {
errorCode: 1,
result: {
name: '测试活码好的可以',
hmId: '727363646474849483332',
statusFlag: 1,
overFlag: 1,
hmType: 2,
creatorName: '少见多怪',
createTime: 182736347383,
passFlag: 0,
welcomeId: 'b680a2cf18b742cc9f4560f6195c9ec6',
enterpriseId: '5bd929fd3b2c49deaa1184bcb0d669b3',
wxQrcode: '',
memberLabelName: '稍加稳得',
hmGroupName: '测试分组'
getRequest('/haoban-manage3-web/hm/qrcode/detail', { hmId: that.$route.query.hmId })
.then(res => {
// let res = {
// data: {
// errorCode: 1,
// result: {
// name: '测试活码好的可以',
// hmId: '727363646474849483332',
// statusFlag: 1,
// overFlag: 1,
// hmType: 2,
// creatorName: '少见多怪',
// createTime: 182736347383,
// passFlag: 0,
// welcomeId: 'b680a2cf18b742cc9f4560f6195c9ec6',
// enterpriseId: '5bd929fd3b2c49deaa1184bcb0d669b3',
// wxQrcode: '',
// memberLabelName: '稍加稳得',
// hmGroupName: '测试分组'
// }
// }
// };
let resData = res.data;
that.loading = false;
if (resData.code == 0) {
that.statusIndex = resData.result.statusFlag == 1 && resData.result.overFlag == 1 ? 4 : resData.result.statusFlag;
that.codeInfo = resData.result;
return;
}
}
};
let resData = res.data;
that.loading = false;
if (resData.errorCode == 1) {
that.statusIndex = resData.result.statusFlag == 1 && resData.result.overFlag == 1 ? 4 : resData.result.statusFlag;
that.codeInfo = resData.result;
return;
}
errMsg.errorMsg(resData);
// })
// .catch(function(error) {
// that.$message.error({
// duration: 1000,
// message: error.message
// });
// });
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
scrollMethod: _throttle(function() {
// 节流会不自然 左右不滑动
......@@ -164,6 +161,7 @@ export default {
},
mounted() {
let that = this;
this.activeName = this.$route.query.activeName || 'first';
that.getActCodeInfo();
document.getElementById('hb-layout-pager-one').addEventListener('scroll', that.scrollMethod);
},
......@@ -189,9 +187,6 @@ export default {
.height-22 {
height: 22px;
}
.line-20 {
line-height: 20px;
}
.text-ellipsis-white {
overflow: hidden;
text-overflow: ellipsis;
......@@ -199,7 +194,7 @@ export default {
}
.fixed-tab {
position: absolute;
top: 75px;
top: 80px;
z-index: 1;
padding-bottom: 0;
height: 40px;
......
......@@ -16,7 +16,7 @@
<div style="width: 84px;">欢迎语内容:</div>
<div style="width: 555px;">{{ welcomeData.welcomeContent }}</div>
</div>
<div class="link-file-view">
<div class="link-file-view" v-if="welcomeData.welcomeMediaList.length > 0">
<div class="flexBoxContainer" v-for="(item, index) in welcomeData.welcomeMediaList" :key="index">
<div class="flexBox">
<svg-icon :iconname="iconType[item.mediaType]" size="16" style="margin-right: 13px;"> </svg-icon>
......@@ -51,7 +51,7 @@
</el-table-column>
<el-table-column prop="" label="企微号" show-overflow-tooltip min-width="185px">
<template slot-scope="scope">
{{ scope.row.staffName }}
{{ scope.row.staffName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="今日已达上限" show-overflow-tooltip min-width="185px">
......@@ -68,8 +68,8 @@
</template>
<script>
import previewWelcome from '@/components/preview-welcome.vue';
import { getRequest } from '@/api/api';
// import errMsg from '@/common/js/error';
import { getRequest, postJsonRequest } from '@/api/api';
import errMsg from '@/common/js/error';
export default {
name: 'act-code-detail-info',
components: { previewWelcome },
......@@ -103,12 +103,7 @@ export default {
6: 'iconwenjianleixing-xiaochengxu', // 带参小程序
7: 'icongongzhonghao1' // 带参公众号
},
useMemberData: [
{ clerkName: '电话电电话', clerkCode: '882292929233', overFlag: 0, storeName: '门店叫什么', storeCode: 's837373772', staffName: '的后视镜设计' },
{ clerkName: '话', clerkCode: '882292929233', overFlag: 1, storeName: '门店叫什么', storeCode: 's837373772', staffName: '的后视镜设计' },
{ clerkName: '电', clerkCode: '882292929233', overFlag: 1, storeName: '门店叫什么', storeCode: 's837373772', staffName: '的后视镜设计' },
{ clerkName: '电话电电话', clerkCode: '882292929233', overFlag: 1, storeName: '门店叫什么', storeCode: 's837373772', staffName: '的后视镜设计' }
],
useMemberData: [],
loading: false,
currentPage: 1,
pageSize: 20,
......@@ -159,35 +154,32 @@ export default {
});
},
getUseTableList() {
// const that = this;
// that.loading = true;
// let para = {
// startTime: '',
// endTime: '',
// storeSearch: '',
// clerkSearch: '',
// hmId: that.hmId,
// pageNum: that.currentPage, // 当前页
// pageSize: that.pageSize // 一页显示个数
// };
// postRequest('/hm/qrcode/detail-clerk-list', para)
// .then(res => {
// let resData = res.data;
// that.loading = false;
// if (resData.errorCode == 1) {
// that.useMemberData = resData.result.list || [];
// that.total = resData.result.pageInfo ? resData.result.pageInfo.total : 0;
// return;
// }
// errMsg.errorMsg(resData);
// })
// .catch(function(error) {
// that.loading = false;
// that.$message.error({
// duration: 1000,
// message: error.message
// });
// });
const that = this;
that.loading = true;
let para = {
hmId: that.hmId,
pageNum: that.currentPage, // 当前页
pageSize: that.pageSize // 一页显示个数
};
postJsonRequest('/haoban-manage3-web/hm/qrcode/detail-clerk-list', para)
.then(res => {
let resData = res.data;
that.loading = false;
if (resData.code == 0) {
that.total = resData.result.totalCount || 0;
that.useMemberData = resData.result.result || [];
// that.total = resData.result.pageInfo ? resData.result.pageInfo.total : 0;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loading = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
mounted() {
......@@ -197,7 +189,7 @@ export default {
watch: {
welcomeId: function(newData, oldData) {
const that = this;
if (newData.length <= 0) return;
if (!newData || newData.length <= 0) return;
that.welcomeId = newData || '';
that.getwelcomeInfo();
}
......
<template>
<!-- <div> -->
<div class="app-detail-wrap">
<div>
<div class="flex justify-between title">
......@@ -41,7 +40,7 @@
<ul class="datebox" v-for="(lis, index) in dateLis" :key="lis.key">
<li :class="dateKey == index ? 'activeClass' : 'noActive'" class="dateLisBox" @click="btnChange(index)">{{ lis.value }}</li>
</ul>
<el-date-picker class="w256" v-model="dateDefault" type="daterange" range-separator="~" start-placeholder="创建开始日期" end-placeholder="创建结束日期" :default-time="['00:00:00', '23:59:59']" :picker-options="pickerOptions()" @change="onDateChange"> </el-date-picker>
<el-date-picker class="w256" v-model="dateDefault" type="daterange" range-separator="~" start-placeholder="创建开始日期" end-placeholder="创建结束日期" :default-time="['00:00:00', '23:59:59']" :picker-options="pickerOptions()" @change="onDateChange" value-format="yyyy-MM-dd"> </el-date-picker>
</div>
</div>
<new-add-chart :charData="overViewData.dateList" id="new-add-chart"></new-add-chart>
......@@ -60,11 +59,12 @@
<data-detail :id="hmId"></data-detail>
</div>
</div>
<!-- </div> -->
</template>
<script>
import dataDetail from '../../components/dataDetail.vue';
import newAddChart from './newAddChart.vue';
import { postJsonRequest } from '@/api/api';
import errMsg from '@/common/js/error';
export default {
name: 'act-code-detail-statistics',
components: { dataDetail, newAddChart },
......@@ -124,60 +124,68 @@ export default {
},
getChartList() {
const that = this;
// that.loading = true;
// getRequest('/hm/qrcode/detail-data-statistics', {hmId: that.hmId})
// .then(res => {
// let resData = res.data;
// that.loading = false;
// if (resData.errorCode == 1) {
let resData = {
result: {
addNumT: 20,
addNum: 10,
dateList: [
{ date: '2018/8/1', addNum: 4623 },
{ date: '2018/8/2', addNum: 6145 },
{ date: '2018/8/3', addNum: 508 },
{ date: '2018/8/4', addNum: 289 },
{ date: '2018/8/5', addNum: 289 },
{ date: '2018/8/6', addNum: 289 },
{ date: '2018/8/7', addNum: 289 },
{ date: '2018/8/8', addNum: 289 },
{ date: '2018/8/9', addNum: 289 },
{ date: '2018/8/10', addNum: 289 },
{ date: '2018/8/11', addNum: 289 },
{ date: '2018/8/12', addNum: 289 },
{ date: '2018/8/13', addNum: 2589 },
{ date: '2018/8/14', addNum: 289 },
{ date: '2018/8/15', addNum: 289 },
{ date: '2018/8/16', addNum: 29 },
{ date: '2018/8/17', addNum: 289 },
{ date: '2018/8/18', addNum: 9 },
{ date: '2018/8/19', addNum: 2189 },
{ date: '2018/8/20', addNum: 289 },
{ date: '2018/8/21', addNum: 2869 },
{ date: '2018/8/22', addNum: 289 },
{ date: '2018/8/23', addNum: 2809 }
]
let para = {
inFields: {
hmId: that.hmId,
startTime: that.dateDefault[0],
endTime: that.dateDefault[1],
type: that.dateKey >= 2 ? 2 : 1
}
};
resData.result.dateList.map(function(date) {
date['新增人数'] = date.addNum;
});
that.overViewData = resData.result;
// return;
// }
// errMsg.errorMsg(resData);
// })
// .catch(function(error) {
// that.loading = false;
// that.$message.error({
// duration: 1000,
// message: error.message
// });
// });
that.loading = true;
postJsonRequest('/haoban-manage3-web/hm/qrcode/detail-data-statistics', para)
.then(res => {
let resData = res.data;
that.loading = false;
if (resData.code == 0) {
// let resData = {
// result: {
// addNumT: 20,
// addNum: 10,
// dateList: [
// { bizDate: '2018/8/1', addNum: 4623 },
// { bizDate: '2018/8/2', addNum: 6145 },
// { bizDate: '2018/8/3', addNum: 508 },
// { bizDate: '2018/8/4', addNum: 289 },
// { bizDate: '2018/8/5', addNum: 289 },
// { bizDate: '2018/8/6', addNum: 289 },
// { bizDate: '2018/8/7', addNum: 289 },
// { bizDate: '2018/8/8', addNum: 289 },
// { bizDate: '2018/8/9', addNum: 289 },
// { bizDate: '2018/8/10', addNum: 289 },
// { bizDate: '2018/8/11', addNum: 289 },
// { bizDate: '2018/8/12', addNum: 289 },
// { bizDate: '2018/8/13', addNum: 2589 },
// { bizDate: '2018/8/14', addNum: 289 },
// { bizDate: '2018/8/15', addNum: 289 },
// { bizDate: '2018/8/16', addNum: 29 },
// { bizDate: '2018/8/17', addNum: 289 },
// { bizDate: '2018/8/18', addNum: 9 },
// { bizDate: '2018/8/19', addNum: 2189 },
// { bizDate: '2018/8/20', addNum: 289 },
// { bizDate: '2018/8/21', addNum: 2869 },
// { bizDate: '2018/8/22', addNum: 289 },
// { bizDate: '2018/8/23', addNum: 2809 }
// ]
// }
// };
((resData.result || {}).dateList || []).map(function(date) {
date['新增人数'] = date.addNum;
});
that.overViewData = resData.result || {};
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loading = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
},
getDateRange(setEndDate) {
const start = new Date();
......@@ -219,18 +227,21 @@ export default {
// 近三个月
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 3);
endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
} else if (index == 3) {
// 近半年
setDate = endDate => {
endDate.setMonth(endDate.getMonth() - 6);
endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
} else {
// 近一年
setDate = endDate => {
endDate.setFullYear(endDate.getFullYear() - 1);
endDate.setDate(endDate.getDate() + 1);
return new Date(endDate);
};
}
......@@ -239,7 +250,7 @@ export default {
that.dateDefault.push(start);
this.getChartList();
},
onDateChange() {
onDateChange(res) {
this.dateKey = -1;
this.getChartList();
}
......@@ -248,7 +259,6 @@ export default {
let that = this;
// 默认显示近七天
that.btnChange(0);
that.getChartList();
}
};
</script>
......
......@@ -7,45 +7,45 @@
</div> -->
<el-table ref="recordTableRef" v-loading="loading" :data="tableData" tooltip-effect="dark" class="act-code-table" @sort-change="sortChange">
<el-table-column prop="" label="基本信息" show-overflow-tooltip min-width="210px" fixed>
<template>
<template slot-scope="scope">
<div class="flex">
<img class="image-40" src="@/assets/user-default.svg" />
<img v-if="scope.row.memberImage" class="image-40" :src="scope.row.memberImage" />
<img v-if="!scope.row.memberImage" class="image-40" src="@/assets/user-default.svg" />
<div class="p-l-10 line-20" style="width: calc(100% - 50px);">
<div class="flex text-ellipsis">
<span class="text-ellipsis">飞扬飞扬飞扬飞扬飞扬飞扬飞扬</span>
<span class="color-909399 text-ellipsis"> (刘飞扬)</span>
<span class="text-ellipsis">{{ scope.row.memberName || '--' }}</span>
<span class="color-909399 text-ellipsis"> {{ scope.row.memberNick || '--' }}</span>
</div>
<p class="font-12">189****5322</p>
<p class="font-12">{{ scope.row.memberPhone || '--' }}</p>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="" label="会员卡号" show-overflow-tooltip min-width="126px">
<template slot-scope="scope">
{{ scope.row.cardName }}
{{ scope.row.memberCardNo || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="会员等级" show-overflow-tooltip min-width="86px">
<template slot-scope="scope">
{{ scope.row.cardName }}
{{ scope.row.memberGradeName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="导购信息" show-overflow-tooltip min-width="128px">
<template slot-scope="scope">
<p class="line-20 text-ellipsis">{{ scope.row.cardName }}</p>
<p class="color-606266 line-18 text-ellipsis font-12">DM34344444444DM34344444444</p>
<p class="line-20 text-ellipsis">{{ scope.row.clerkName || '--' }}</p>
<p class="color-606266 line-18 text-ellipsis font-12">{{ scope.row.clerkCode || '--' }}</p>
</template>
</el-table-column>
<el-table-column prop="" label="导购所属门店" show-overflow-tooltip min-width="185px">
<template slot-scope="scope">
<p class="line-20 text-ellipsis">{{ scope.row.cardName }}</p>
<p class="color-606266 line-18 text-ellipsis font-12">D3433433456</p>
<p class="line-20 text-ellipsis">{{ scope.row.storeName || '--' }}</p>
<p class="color-606266 line-18 text-ellipsis font-12">{{ scope.row.storeCode || '--' }}</p>
</template>
</el-table-column>
<el-table-column prop="" label="企微号" show-overflow-tooltip min-width="107px">
<template slot-scope="scope">
<p class="line-20 text-ellipsis">{{ scope.row.cardName }}</p>
<p class="color-606266 line-18 text-ellipsis font-12">D3433433456</p>
{{ scope.row.staffName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="添加时间" show-overflow-tooltip min-width="106px" sortable>
......@@ -56,17 +56,17 @@
</el-table-column>
<el-table-column prop="" label="标签" show-overflow-tooltip min-width="144px">
<template slot-scope="scope">
{{ scope.row.cardName }}
{{ scope.row.memberLabelName || '--' }}
</template>
</el-table-column>
<el-table-column prop="" label="关联类型" show-overflow-tooltip min-width="103px">
<template slot-scope="scope">
{{ scope.row.cardName }}
{{ scope.row.addChannel == 1 ? '引流链接' : '员工活码' }}
</template>
</el-table-column>
<el-table-column prop="" label="关联信息" show-overflow-tooltip min-width="103px">
<el-table-column prop="" label="关联信息" show-overflow-tooltip min-width="150px">
<template slot-scope="scope">
{{ scope.row.cardName }}
{{ scope.row.addChannel == 1 ? scope.row.linkName || '--' : scope.row.hmName || '--' }}
</template>
</el-table-column>
</el-table>
......@@ -77,9 +77,9 @@
</section>
</template>
<script>
// import errMsg from '@/common/js/error';
import errMsg from '@/common/js/error';
// import { _debounce } from '@/common/js/public';
// import { postRequest } from '@/api/api';
import { postJsonRequest } from '@/api/api';
export default {
name: 'actCodeRecord',
components: {},
......@@ -94,14 +94,12 @@ export default {
loading: false,
// searchInputStore: '',
// searchInputGuide: '',
tableData: [{ cardName: '常常常常常常常常常常常常常常常常', createTime: 1891282736363 }],
tableData: [{ addChannel: 2, hmName: '好多好多活码呢', linkName: '没什么的链接', storeName: '实话实说mendian', storeCode: '0928338', staffName: '是共商国是', memberLabelName: '和大哥大哥大哥的话打电话', clerkCode: '99000', clerkName: '常常常常', createTime: 1891282736363, memberImage: '@/assets/user-default.svg', memberName: '溜溜里', memberNick: 'kiu今生', memberPhone: '15757906438', memberCardNo: '92838383838', memberGradeName: '高级卡' }],
// 分页参数
currentPage: 1,
pageSize: 20,
total: 0,
sortColumn: '',
sortType: ''
// 面包屑
sortType: 'desc'
};
},
methods: {
......@@ -123,8 +121,9 @@ export default {
*/
sortChange(column, prop, order) {
const that = this;
that.sortColumn = column.prop;
that.sortType = column.order == 'ascending' ? 'asc' : 'desc';
console.log(column.order);
that.currentPage = 1;
that.sortType = column.order == 'ascending' ? 'asc' : 'desc'; // 默认倒序
that.getTableList();
},
/**
......@@ -154,33 +153,30 @@ export default {
const that = this;
that.loading = true;
let para = {
// gicEnterpriseId: that.brandId,
// store: that.searchInputStore || '', // 搜索字段
// guide: that.searchInputGuide || '', // 搜索字段
pageNum: that.currentPage, // 当前页
pageSize: that.pageSize, // 一页显示个数
hmId: that.hmId
hmId: that.$route.query.hmId,
createTimeOrder: that.sortType || ''
};
console.log(para);
that.loading = false;
// postRequest('/haoban-app-customer-web/cardCoupon/find-card-page', para)
// .then(res => {
// let resData = res.data;
// that.loading = false;
// if (resData.errorCode == 1) {
// that.tableData = resData.result.list || [];
// that.total = resData.result.pageInfo ? resData.result.pageInfo.total : 0;
// return;
// }
// errMsg.errorMsg(resData);
// })
// .catch(function(error) {
// that.loading = false;
// that.$message.error({
// duration: 1000,
// message: error.message
// });
// });
// console.log(para);
postJsonRequest('/haoban-manage3-web/hm/qrcode/wxUserAddLog/list', para)
.then(res => {
let resData = res.data;
that.loading = false;
if (resData.code == 0) {
that.tableData = resData.result.result || [];
that.total = resData.result.totalCount || 0;
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.loading = false;
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
mounted() {
......
......@@ -11,7 +11,6 @@ export default {
data() {
return {
chart: null
// name: '新增会员'
};
},
props: {
......@@ -57,7 +56,7 @@ export default {
// { date: '2018/8/4', 新增人数: 289 }
// this.chart.data(this.charData); // 载入数据源
this.chart.data(this.charData, {
date: {
bizDate: {
// type: 'cat', //分类
alias: '日期' //别名
},
......@@ -66,7 +65,7 @@ export default {
}
});
//坐标轴配置(法一配置)
this.chart.axis('date', {
this.chart.axis('bizDate', {
line: {
style: {
stroke: '#606266',
......@@ -114,7 +113,7 @@ export default {
this.chart
.line()
.position('date*新增人数')
.position('bizDate*新增人数')
.color('#4B74E8');
this.chart.removeInteraction('legend-filter'); // 自定义图例,移除默认的分类图例筛选交互
......
......@@ -83,10 +83,9 @@
<p>
<el-popover width="200" trigger="click">
<ul class="userMember-ul">
<!-- <li v-for="(item, index) in row.hmUserMember" :key="index"> -->
<li v-for="(item, index) in hmUserMember" :key="index" class="userMemberLi">
<p class="ulName">{{ item.name }}</p>
<p class="ft-12 phone">4564565446</p>
<li v-for="item in row.clerkList" :key="item.clerkId" class="userMemberLi">
<p class="ulName">{{ item.clerkName }}</p>
<p class="ft-12 phone">{{ item.clerkCode }}</p>
</li>
</ul>
<el-button class="ft-12" type="text" slot="reference">查看更多</el-button>
......@@ -101,10 +100,9 @@
<p>
<el-popover width="200" trigger="click">
<ul class="userMember-ul">
<!-- <li v-for="(item, index) in row.hmUserMember" :key="index"> -->
<li v-for="(item, index) in hmUserMember" :key="index" class="userMemberLi">
<p class="ulName">{{ item.name }}</p>
<p class="ft-12 phone">4564565446</p>
<li v-for="item in row.clerkList" :key="item.storeId" class="userMemberLi">
<p class="ulName">{{ item.storeName }}</p>
<p class="ft-12 phone">{{ item.storeCode }}</p>
</li>
</ul>
<el-button class="ft-12" type="text" slot="reference">查看更多</el-button>
......
......@@ -10,7 +10,7 @@
</template>
<template #member>
<el-form-item label="使用成员" :rules="[{ required: true, message: '请选择使用成员', trigger: 'blur' }]">
<el-radio-group v-model="form.memberType">
<el-radio-group v-model="form.memberType" @change="radioChange">
<el-radio :label="1">全部成员</el-radio>
<el-radio :label="2">部分成员</el-radio>
</el-radio-group>
......@@ -34,18 +34,27 @@ export default {
hmMemberNum: 103,
form: {
hmType: 1,
// name: '',
clerkIdList: [],
memberType: 1,
hmUserNum: null
},
data: [],
storeClerkList: []
storeClerkList: [],
dataArr: []
};
},
created() {
this.getStoreClerkList();
},
methods: {
radioChange(e) {
if (e == 1) {
this.form.clerkIdList = ['-1'];
this.data = [];
}
},
// 获取全部成员个数
getStoreClerkList() {
getRequest('/haoban-manage3-web/hm/store-clerk-list', { pageNum: 1, pageSize: 20 }).then(res => {
const { code, message, result } = res.data || {};
......@@ -55,32 +64,43 @@ export default {
result.result = Array.isArray(result.result) ? result.result : [];
this.storeClerkList = result.result.map(el => {
el.clerkList = Array.isArray(el.clerkList) ? el.clerkList : [];
// 设置导购的禁用状态和选中状态
return el.clerkList.length;
});
console.log(this.storeClerkList, 'this.storeClerkList');
let sum = 0;
this.storeClerkList.forEach(item => {
sum = sum + item;
});
this.hmMemberNum = sum;
});
},
onChange(data) {
this.data = data;
this.form.clerkIdList = data;
this.form.hmUserNum = data.length;
// this.dataArr = data.map(item => {
// return item.clerkName;
// });
// if (this.form.name == '') {
// this.form.name = this.dataArr.toString();
// }
},
async onSubmit(event) {
let obj = {
...event,
...this.form
};
await postJsonRequest('/haoban-manage3-web/hm/qrcode/add', obj).then(res => {
console.log(res);
await postJsonRequest('/haoban-manage3-web/hm/qrcode/addList', obj).then(res => {
if (res.data.code == 0) {
this.form = {
hmType: 1,
clerkIdList: [],
hmUserNum: null //多人活码人数
};
this.$router.go(-1);
} else {
return this.$message.error(res.data.message);
}
});
console.log(obj, '父组件,整体表单数据');
// this.$refs.form.clearValidate();
this.form = {
hmType: 1,
clerkIdList: [],
hmUserNum: null //多人活码人数
};
}
}
};
......
......@@ -61,8 +61,8 @@ export default {
}
},
onChange(data) {
console.log(data, 'data');
this.data = data;
this.form.hmUserNum = data.length;
this.form.clerkIdList = data.map(item => {
return item.clerkId;
});
......@@ -106,6 +106,8 @@ export default {
hmUserNum: null //多人活码人数
};
this.$router.go(-1);
} else {
return this.$message.error(res.data.message);
}
});
} else {
......@@ -120,6 +122,8 @@ export default {
hmUserNum: null //多人活码人数
};
this.$router.go(-1);
} else {
return this.$message.error(res.data.message);
}
});
}
......
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