Commit 5222ce61 by crushh

Merge branch 'feature/act-code' into dev

parents aa2210fe 93e97530
......@@ -23,7 +23,7 @@ module.exports = {
// Various Dev Server settings
// host: '0.0.0.0', // can be overwritten by process.env.HOST
host: 'localhost',//'192.168.1.20',//
port: 8006, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
......
......@@ -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",
......
......@@ -38,3 +38,6 @@ export const linkPage = params => postRequest('/haoban-manage3-web/hm/link/page'
//【活码】详情-查看明细列表
export const detailClerkList = params => postJsonRequest('/haoban-manage3-web/hm/qrcode/detail-clerk-list-page', params);
//【欢迎语】-- 特殊欢迎语关联详情列表
export const welcomeRelationList = params => getRequest('/haoban-manage3-web/welcome/relation/list', params);
......@@ -77,29 +77,29 @@ Vue.axios.interceptors.request.use(
Vue.axios.interceptors.response.use(
data => {
removePending(data.config); //在一个ajax响应后再执行一下取消操作,把已经完成的请求从pending中移除
if (data.status && data.status == 200 && data.data.errorCode != 1) {
if (data.data.errorCode == 4) {
if (window.location.href.indexOf('gic-error') != -1) {
return false;
}
window.location.href = gicHost + '/gic-web/#/login?ishb=1';
}
if (data.data.errorCode == 10 || data.data.errorCode == 7) {
window.location.href = gicHost + '/haoban-3/#/index';
}
return data;
}
// if (data.status && data.status == 200 && data.data.errorCode != 1) {
// if (data.data.errorCode == 4) {
// if (window.location.href.indexOf('gic-error') != -1) {
// return false;
// }
// window.location.href = gicHost + '/gic-web/#/login?ishb=1';
// }
// if (data.data.errorCode == 10 || data.data.errorCode == 7) {
// window.location.href = gicHost + '/haoban-3/#/index';
// }
// return data;
// }
return data;
},
err => {
if (err.response.status == 502) {
window.location.href = gicHost + '/gic-web/#/login?ishb=1';
Message.error({ message: '服务异常⊙﹏⊙∥' });
}
if (err.response.status != 403) {
window.location.href = gicHost + '/gic-web/#/login?ishb=1';
Message.error({ message: '登录失效!' });
}
// if (err.response.status == 502) {
// window.location.href = gicHost + '/gic-web/#/login?ishb=1';
// Message.error({ message: '服务异常⊙﹏⊙∥' });
// }
// if (err.response.status != 403) {
// window.location.href = gicHost + '/gic-web/#/login?ishb=1';
// Message.error({ message: '登录失效!' });
// }
return Promise.resolve(err);
}
);
......
......@@ -23,6 +23,14 @@ const attractFlowLinkRouter = [
component: _import('salesleads/actCodeManage/attractFlowLink', 'detail')
},
{
path: '/attractFlowLinkInfo/:id',
name: '详情引流链接',
meta: {
type: 'info'
},
component: _import('salesleads/actCodeManage/attractFlowLink', 'detail')
},
{
path: '/ladingPageList',
name: '落地页列表',
component: _import('salesleads/actCodeManage/attractFlowLink/landingPage', 'list')
......
<template>
<el-dialog title="关联详情" width="610px" :visible.sync="dialogVisible" @close="$emit('update:dialogVisible', false)">
<div class="daily-set-content boder-box">
<div class="flex flex-space-between m-b-16">
<el-input placeholder="请输入关联ID / 关联名称 " class="w-260" v-model="form.searchContent" @keyup.native="value => toInput(value, searchInput)" clearable @clear="getList"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input>
</div>
</div>
<el-table class="select-table" ref="multipleTable" v-loading="loading" :data="tableData" height="450" tooltip-effect="dark">
<el-table-column prop="referCode" label="关联ID"></el-table-column>
<el-table-column prop="referName" label="关联名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="type" label="类型">
<template slot-scope="{ row }">
{{ row.type == 1 ? '员工活码' : '引流链接' }}
</template>
</el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="{ row }">
<div class="status-class">
<span :class="['state-point', logStatusClass[row.status]]">{{ relationSatusMap[row.status] }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="" label="操作" width="80">
<template slot-scope="{ row }">
<el-button type="text" @click="$emit('goLinkDetail', row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination class="text-right margin-pg" @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-size.sync="form.pageSize" :current-page.sync="form.pageNum" layout="prev, pager, next" :total="total"> </el-pagination>
</el-dialog>
</template>
<script>
import { welcomeRelationList } from '@/api/actCode';
import { _debounce } from '@/common/js/public';
export default {
data() {
return {
form: {
searchContent: '',
welcomeId: '',
pageNum: 1,
pageSize: 20
},
loading: false,
total: 0,
tableData: [],
relationSatusMap: {
1: '启用',
0: '删除',
2: '废弃'
},
logStatusClass: { 1: 'state-point-success', 0: 'state-point-error', 2: 'state-point-warning' }
};
},
props: {
id: {
type: String,
default: ''
},
dialogVisible: {
type: Boolean,
default: false
}
},
watch: {
id(val) {
if (val) {
this.form = { searchContent: '', welcomeId: val, pageNum: 1, pageSize: 20 };
this.getList();
}
}
},
methods: {
toInput: _debounce(function(e, value) {
this.getList();
}, 500),
getList() {
this.loading = true;
welcomeRelationList(this.form)
.then(res => {
const { totalCount, result } = res.data.result;
if (result) {
this.total = totalCount;
this.tableData = result;
}
// let obj = { referCode: 'HM01421002535046766593', referId: '421002535046766593', referName: '吴苏兰', relationId: '421002538737754114', status: 1, type: 2, typeText: null };
// for (let i = 0; i < 50; i++) {
// this.tableData.push(obj);
// }
// this.total = 50;
})
.finally(_ => {
this.loading = false;
});
},
handleSizeChange(val) {
this.form.pageNum = 1;
this.form.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.form.pageNum = val;
this.getList();
}
}
};
</script>
<style type="text/scss" lang="scss" scoped>
.margin-pg {
margin: 20px 0 0 0;
}
</style>
......@@ -28,7 +28,7 @@
<el-button v-if="$getButtonLimit($buttonCode.addSalutatory)" :limit-code="$buttonCode.addSalutatory" type="primary" @click="addSalutatory">新建欢迎语</el-button>
</div>
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }" v-loading="loading">
<el-table-column prop="title" label="标题" width="200">
<el-table-column prop="title" label="标题" width="200" fixed="left">
<div ref="title" slot-scope="{ row }">
<!-- 算出文本的长度,再设置 -->
<el-tooltip placement="top" :content="row.title" v-if="row.isOverflow">
......@@ -76,13 +76,15 @@
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="180" fixed="right" v-if="$getButtonLimit($buttonCode.editSalutatory) || $getButtonLimit($buttonCode.delSalutatory)">
<el-table-column label="操作" :width="type == 2 ? 220 : 180" fixed="right" v-if="$getButtonLimit($buttonCode.editSalutatory) || $getButtonLimit($buttonCode.delSalutatory)">
<template slot-scope="{ row }">
<el-button type="text" @click="showRelateDetail(row)" v-show="row.type == 2">关联详情</el-button>
<el-button v-if="$getButtonLimit($buttonCode.editSalutatory)" :limit-code="$buttonCode.editSalutatory" type="text" @click="changeRoute(row)">编辑</el-button>
<el-button v-if="$getButtonLimit($buttonCode.delSalutatory)" :limit-code="$buttonCode.delSalutatory" type="text" @click="remove(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<relation-dialog :dialogVisible.sync="dialogVisible" :id="welcomeId" @goLinkDetail="goLinkDetail" />
<div class="block common-wrap__page text-right m-t-24" v-if="tableData.length != 0">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="form.pageNum" :page-sizes="[20, 40, 60, 80]" :page-size="form.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
</div>
......@@ -93,6 +95,7 @@
<script>
import { postJsonRequest, getRequest } from '@/api/api';
import { _debounce } from '@/common/js/public';
import relationDialog from './relationDialog';
export default {
data() {
return {
......@@ -101,6 +104,8 @@ export default {
pageSize: 20,
pageNum: 1
},
dialogVisible: false,
welcomeId: '',
total: 0,
wxEnterpriseId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
friendSettingId: '',
......@@ -129,6 +134,9 @@ export default {
default: 1
}
},
components: {
relationDialog
},
watch: {
type(val) {
this.form = {
......@@ -162,12 +170,19 @@ export default {
this.$router.push({ path: '/salutatorySet', query: { type: this.type } });
},
remove(row) {
let str = '是否删除本条欢迎语?';
if (row.type == 2) {
this.delType2(row);
} else {
this.delType1(row);
}
},
delType1(row) {
let str = '模板删除后将无法恢复';
if (row.defaultWelcomeFlag == 1) {
str = '此条欢迎语为全员欢迎语,删除后可能影响欢迎语发送,是否继续删除?';
str = '此条欢迎语为全员欢迎语,删除后可能影响欢迎语发送';
}
this.$confirm(str, '提示', {
confirmButtonText: '确定',
this.$confirm(str, '确认要删除该欢迎语吗?', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
......@@ -180,6 +195,56 @@ export default {
});
});
},
delType2(row) {
getRequest('/haoban-manage3-web/welcome/statistics', { welcomeId: row.welcomeId }).then(res => {
console.log(res);
const { result } = res.data;
let str = '';
if (result) {
if (result.qrCodeReferNum && result.linkReferNum) {
str = `当前模板已关联状态为正常的活码(${result.qrCodeReferNum})、链接(${result.linkReferNum}),请确认相关活码是否不再使用该欢迎语以及链接已投放结束,取消关联后才可删除该模板`;
} else if (result.qrCodeReferNum) {
str = `当前模板已关联状态为正常的活码(${result.qrCodeReferNum}),请确认相关活码是否不再使用该欢迎语,取消关联后才可删除该模板`;
} else if (result.linkReferNum) {
str = `当前模板已关联链接(${result.linkReferNum}),请确认相关链接已投放结束,取消关联后才可删除该模板`;
}
this.$confirm(str, '无法删除该欢迎语', {
confirmButtonText: '关联详情',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.showRelateDetail(row);
});
} else {
str = '模板删除后将无法恢复';
this.$confirm(str, '确认要删除该欢迎语吗?', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
getRequest('/haoban-manage3-web/welcome/remove', { welcomeId: row.welcomeId }).then(res => {
let resData = res.data;
if (resData.code == 0 && resData.result) {
this.$message.success('删除成功');
this.getData();
}
});
});
}
});
},
showRelateDetail(item) {
this.dialogVisible = true;
this.welcomeId = item.welcomeId;
},
goLinkDetail(row) {
console.log(row);
if (row.type == 1) {
this.$router.push('/actCodeDetail?hmId=' + row.referId);
} else {
this.$router.push(`/attractFlowLinkInfo/${row.referId}`);
}
},
/**
* 获取数据
*/
......
......@@ -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'); // 自定义图例,移除默认的分类图例筛选交互
......
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