Commit 66038271 by crushh

update: 群发导出

parent c6dce127
......@@ -391,7 +391,6 @@ export default {
if (resData.errorCode == 1) {
that.tableData = resData.result.list || [];
that.total = resData.result.pageInfo.total;
this.tableRefresh = !this.tableRefresh;
if (val == 1) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
......
......@@ -18,15 +18,15 @@
</div>
<div v-else class="card-add-btn text-center cursor-pointer" @click="showCard"><span class="el-icon-plus font-12 color-909399"></span><span class="font-14 color-909399 p-l-8">添加卡券</span></div>
</el-form-item>
<!-- <el-form-item>
<el-form-item>
<span slot="label">
<el-tooltip class="item" effect="dark" content="此领取次数表示导购将该卡券发送给顾客后可领取的总次数,顾客可将该卡券转发给他人,但领取次数受此控制" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;">领取次数</span></el-tooltip>
</span>
<el-radio-group v-model="formData.receiveTime">
<el-radio-group v-model="formData.receiveTimes">
<el-radio :label="0">固定1次</el-radio>
<el-radio :label="1">不限次数</el-radio>
</el-radio-group>
</el-form-item> -->
</el-form-item>
<div class="el-form-item el-form-item--large">
<label for="name" class="el-form-item__label" style="width: 120px; cursor: pointer;">
<el-tooltip class="item" effect="dark" content="卡券的发送范围设置" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;">选择发送范围</span></el-tooltip>
......@@ -152,7 +152,7 @@ export default {
selectList: [],
eachSendTimes: 3,
sendType: '0',
// receiveTime: 0,
receiveTimes: 0,
totalSendTimes: 0
},
rules: {
......@@ -252,7 +252,7 @@ export default {
coupCardId: that.formData.coupCardId,
sendRange: that.formData.sendRange,
selectList: selectList,
// receiveTime: this.formData.receiveTime,
receiveTimes: this.formData.receiveTimes,
// eachSendTimes: that.formData.eachSendTimes || '0',
// sendType: that.formData.sendType,
totalSendTimes: that.formData.totalSendTimes,
......@@ -361,8 +361,8 @@ export default {
selectList: resData.result.detail.sendRange != 0 ? (resData.result.detail.sendRange == 2 ? resData.result.list.map(item => item.id) : resData.result.list) : [],
eachSendTimes: resData.result.detail.eachSendTimes,
sendType: String(resData.result.detail.sendType),
totalSendTimes: resData.result.detail.totalSendTimes
// receiveTime: resData.result.detail.receiveTime
totalSendTimes: resData.result.detail.totalSendTimes,
receiveTimes: resData.result.detail.receiveTimes
// receiveType: String(resData.result.detail.receiveType),
// totalReceiveTimes: resData.result.detail.totalReceiveTimes
};
......
......@@ -512,7 +512,6 @@ export default {
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
this.tableRefresh = !this.tableRefresh;
that.tableData = resData.result.result || [];
that.total = resData.result.totalCount;
if (val == 1) {
......
......@@ -18,7 +18,7 @@
<div class="add-group font-14 color-909399 cursor-pointer line-h-32" @click="addGroup"><span class="el-icon-plus"></span><span class="p-l-5">新建分组</span></div>
</div>
<div class="group-body">
<div :class="['no-group m-t-10 line-h-32 font-14 color-606266 cursor-pointer', currentCategoryId == '-1' ? 'current-group' : '']" @click="selectNoGroup"><span style="color: transparent;" :class="['color-c0c4cc font-12 cursor-pointer p-l-10 el-icon-caret-bottom el-icon-caret-right']"></span>分组</div>
<div :class="['no-group m-t-10 line-h-32 font-14 color-606266 cursor-pointer', currentCategoryId == '-1' ? 'current-group' : '']" @click="selectNoGroup"><span style="color: transparent;" :class="['color-c0c4cc font-12 cursor-pointer p-l-10 el-icon-caret-bottom el-icon-caret-right']"></span>全部分组</div>
<ul class="group-ul padding-lr-12">
<template v-for="(item, index) in groupData">
<li class="group-cell" :key="index + 'group'">
......
......@@ -28,7 +28,20 @@
</div>
</div>
<div class="m-t-20">
<el-table v-loading="loading" class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%;">
<el-table v-loading="loading" class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%;" :key="tableRefresh" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45" :class-name="selectRadio == 1 ? 'cell-disabled' : 'font-size-zero'"> </el-table-column>
<el-table-column width="25">
<template #header>
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="0" :false-label="2" @change="handleCommand">选择当页</el-checkbox></el-dropdown-item>
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="1" :false-label="2" @change="handleCommand">选择全部</el-checkbox></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope">{{ scope ? ' ' : ' ' }}</template>
</el-table-column>
<el-table-column label="任务标题" show-overflow-tooltip min-width="120">
<template slot-scope="scope">{{ scope.row.taskTitle || '--' }}</template>
</el-table-column>
......@@ -91,6 +104,7 @@ import headDefault from '@/assets/head_default.jpg';
import navCrumb from '@/components/nav/nav.vue';
import { getRequest, postRequest, postExcel } from '@/api/api';
import errMsg from '@/common/js/error';
import showMsg from '@/common/js/showmsg';
import { _debounce } from '@/common/js/public';
import detailPreview from '@/components/review/salesleads-detail-preview.vue';
export default {
......@@ -111,6 +125,9 @@ export default {
},
data() {
return {
selectRadio: 2, // 选择当页/选择全部
tableRefresh: false,
multipleSelection: [],
headDefault,
bgHeight: window.screen.availHeight - 298 + 'px',
loading: false,
......@@ -175,17 +192,48 @@ export default {
computed: {},
methods: {
/**
* 表格选择
*/
handleSelectionChange(val) {
this.multipleSelection = val;
val.length ? '' : (this.selectRadio = 2);
},
/**
* 显示选择本页/全部
*/
handleCommand(command) {
this.selectRadio = command;
this.tableRefresh = !this.tableRefresh;
if (command == 1 || command == 0) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
});
} else if (command == 2) {
this.$refs.multipleTable.clearSelection();
}
},
/**
* 导出
*/
exportExcel(type) {
if (!this.multipleSelection.length) {
showMsg.showmsg('请选择任务', 'warning');
return false;
}
this.loadingBtn = true;
let url = '/haoban-task-manage-web/market/clue/export/store-view-task-detail';
const { finishOverStatus, taskType, pageNum, pageSize } = this.pageParams;
let para = {
enterpriseId: sessionStorage.getItem('userInfoBrandId'),
dataType: 1,
...this.pageParams,
finishOverStatus,
taskType,
pageNum,
pageSize,
startTime: this.pageParams.date[0],
endTime: this.pageParams.date[1],
selectType: this.selectRadio,
selectIdList: this.selectRadio == 1 ? '' : this.multipleSelection.map(ele => ele.taskId).join(','), // 门店分组,数组
storeId: this.$route.params.id
};
let fileName = this.pageParams.date.length ? `群发任务-门店视图-任务详情_${para.startTime}${para.endTime}.xls` : `群发任务-门店视图-任务详情.xls`;
......@@ -217,11 +265,13 @@ export default {
// errMsg.errorMsg(resData);
})
.catch(function(error) {
this.loadingBtn = false;
this.$message.error({
duration: 1000,
message: error.message
});
})
.finally(() => {
this.loadingBtn = false;
});
},
/**
......
......@@ -31,7 +31,20 @@
</div>
</div>
<div class="m-t-20">
<el-table v-loading="loading" class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%;">
<el-table v-loading="loading" :key="tableRefresh" class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45" :class-name="selectRadio == 1 ? 'cell-disabled' : 'font-size-zero'"> </el-table-column>
<el-table-column width="25">
<template #header>
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="0" :false-label="2" @change="handleCommand">选择当页</el-checkbox></el-dropdown-item>
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="1" :false-label="2" @change="handleCommand">选择全部</el-checkbox></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope">{{ scope ? ' ' : ' ' }}</template>
</el-table-column>
<el-table-column label="门店名称" show-overflow-tooltip>
<template slot-scope="scope"
>{{ scope.row.storeName || '--' }}
......@@ -74,6 +87,7 @@
</div>
</template>
<script>
import showMsg from '@/common/js/showmsg';
import gicSelectGroup from '@/components/common/gic-select-group.vue';
import navCrumb from '@/components/nav/nav.vue';
import { getRequest, postExcel } from '@/api/api';
......@@ -91,6 +105,9 @@ export default {
},
data() {
return {
selectRadio: 2, // 选择当页/选择全部
tableRefresh: false,
multipleSelection: [],
bgHeight: window.screen.availHeight - 298 + 'px',
dateStart: new Date().getTime() - 3600 * 1000 * 24 * 365,
dateEnd: new Date(),
......@@ -143,14 +160,44 @@ export default {
computed: {},
methods: {
/**
* 表格选择
*/
handleSelectionChange(val) {
this.multipleSelection = val;
val.length ? '' : (this.selectRadio = 2);
},
/**
* 显示选择本页/全部
*/
handleCommand(command) {
this.selectRadio = command;
this.tableRefresh = !this.tableRefresh;
if (command == 1 || command == 0) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
});
} else if (command == 2) {
this.$refs.multipleTable.clearSelection();
}
},
/**
* 导出
*/
exportExcel() {
if (!this.multipleSelection.length) {
showMsg.showmsg('请选择门店', 'warning');
return false;
}
this.loadingBtn = true;
let url = '/haoban-task-manage-web/market/clue/export/store-view';
const { pageNum, pageSize, storeName } = this.pageParams;
let para = {
...this.pageParams,
pageNum,
pageSize,
storeName,
taskType: 2,
selectType: this.selectRadio,
selectIdList: this.selectRadio == 1 ? '' : this.multipleSelection.map(ele => ele.storeId).join(','), // 门店分组,数组
enterpriseId: sessionStorage.getItem('userInfoBrandId'),
qywxEnterpriseId: JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId,
startTime: this.pageParams.date[0],
......@@ -191,11 +238,13 @@ export default {
// errMsg.errorMsg(resData);
})
.catch(function(error) {
this.loadingBtn = false;
this.$message.error({
duration: 1000,
message: error.message
});
})
.finally(() => {
this.loadingBtn = false;
});
},
checkGroupIds: function(nodes) {
......
......@@ -39,7 +39,20 @@
</div>
</div>
<div class="m-t-20">
<el-table v-loading="loading" class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%;">
<el-table v-loading="loading" class="select-table" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%;" :key="tableRefresh" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="45" :class-name="selectRadio == 1 ? 'cell-disabled' : 'font-size-zero'"> </el-table-column>
<el-table-column width="25">
<template #header>
<el-dropdown style="line-height: 10px; padding: 0; margin-left: -15px; transform: translateY(4px); -webkit-transform: translateY(4px);" placement="bottom-start">
<span class="el-dropdown-link"><i class="iconfont icongengduo"></i> </span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="0" :false-label="2" @change="handleCommand">选择当页</el-checkbox></el-dropdown-item>
<el-dropdown-item> <el-checkbox v-model="selectRadio" :true-label="1" :false-label="2" @change="handleCommand">选择全部</el-checkbox></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope">{{ scope ? ' ' : ' ' }}</template>
</el-table-column>
<el-table-column label="计划名称" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.ecmPlanName || '--' }}</template>
</el-table-column>
......@@ -79,6 +92,7 @@
<script>
import navCrumb from '@/components/nav/nav.vue';
import { getRequest, postExcel } from '@/api/api';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public';
......@@ -94,6 +108,9 @@ export default {
},
data() {
return {
selectRadio: 2, // 选择当页/选择全部
tableRefresh: false,
multipleSelection: [],
bgHeight: window.screen.availHeight - 298 + 'px',
dateStart: new Date().getTime() - 3600 * 1000 * 24 * 365,
dateEnd: new Date(),
......@@ -141,14 +158,41 @@ export default {
},
computed: {},
methods: {
/**
* 表格选择
*/
handleSelectionChange(val) {
this.multipleSelection = val;
val.length ? '' : (this.selectRadio = 2);
},
/**
* 显示选择本页/全部
*/
handleCommand(command) {
this.selectRadio = command;
this.tableRefresh = !this.tableRefresh;
if (command == 1 || command == 0) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
});
} else if (command == 2) {
this.$refs.multipleTable.clearSelection();
}
},
exportExcel(type) {
if (!this.multipleSelection.length) {
showMsg.showmsg('请选择计划', 'warning');
return false;
}
this.loadingBtn = true;
let para = {
...this.pageParams,
enterpriseId: sessionStorage.getItem('userInfoBrandId'),
qywxEnterpriseId: JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId,
startTime: this.pageParams.date[0],
endTime: this.pageParams.date[1]
endTime: this.pageParams.date[1],
selectType: this.selectRadio,
selectIdList: this.selectRadio == 1 ? '' : this.multipleSelection.map(ele => ele.ecmPlanId).join(',')
};
postExcel('/haoban-task-manage-web/market/clue/export/plan-view', para)
.then(res => {
......@@ -173,11 +217,13 @@ export default {
// errMsg.errorMsg(resData);
})
.catch(function(error) {
this.loadingBtn = false;
this.$message.error({
duration: 1000,
message: error.message
});
})
.finally(() => {
this.loadingBtn = false;
});
},
/**
......
......@@ -338,7 +338,7 @@ export default {
methods: {
beforeExportExcel() {
if (!this.multipleSelection.length) {
showMsg.showmsg('请选择门店', 'warning');
showMsg.showmsg('请选择任务', 'warning');
return false;
}
if (this.enableDownloadCompleteData == 1) {
......@@ -371,7 +371,10 @@ export default {
isOverTime: that.conditionObj.overdue || '', // 逾期
isCompleted: that.conditionObj.completed || '', // 完成
taskIds: that.selectRadio == 1 ? '' : that.multipleSelection.map(ele => ele.taskId).join(','),
dataType: type
dataType: type,
createTimeStart: this.conditionObj.date[0],
createTimeEnd: this.conditionObj.date[1],
title: this.conditionObj.title
};
postExcel('/haoban-app-tel-task-three-web/task/export-store-view-clerk-list', para)
.then(res => {
......@@ -654,7 +657,6 @@ export default {
}
that.tableData = resData.result.list || [];
that.total = resData.result.pageInfo.total;
this.tableRefresh = !this.tableRefresh;
if (val == 1) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
......
......@@ -399,7 +399,6 @@ export default {
if (resData.errorCode == 1) {
that.tableData = resData.result.list || [];
that.total = resData.result.pageInfo.total;
this.tableRefresh = !this.tableRefresh;
if (val == 1) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
......
......@@ -462,7 +462,6 @@ export default {
if (resData.errorCode == 1) {
that.tableData = resData.result.list || [];
that.total = resData.result.pageInfo.total;
this.tableRefresh = !this.tableRefresh;
if (val == 1) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleAllSelection();
......
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