|
|
|
|
@ -201,14 +201,7 @@
|
|
|
|
|
<el-option label="批量删除小程序标签" :value="2"></el-option>
|
|
|
|
|
<el-option label="全量添加小程序标签" :value="3"></el-option>
|
|
|
|
|
<el-option label="全量删除小程序标签" :value="4"></el-option>
|
|
|
|
|
<el-option label="批量加减积分" :value="5"></el-option>
|
|
|
|
|
<el-option label="全量加减积分" :value="6"></el-option>
|
|
|
|
|
<el-option label="批量发送话术" :value="7"></el-option>
|
|
|
|
|
<el-option label="全量发送话术" :value="8"></el-option>
|
|
|
|
|
<el-option label="批量备注" :value="9"></el-option>
|
|
|
|
|
<el-option label="全量备注" :value="10"></el-option>
|
|
|
|
|
<el-option label="注销账号" :value="11"></el-option>
|
|
|
|
|
<el-option label="导出数据" :value="12"></el-option>
|
|
|
|
|
<el-option label="导出批量数据" :value="12"></el-option>
|
|
|
|
|
<el-option label="导出全量数据" :value="13"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-col>
|
|
|
|
|
@ -218,6 +211,7 @@
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-warning"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="batchOperate()"
|
|
|
|
|
>确认
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
@ -238,7 +232,17 @@
|
|
|
|
|
<el-table-column label="会员昵称" align="center" prop="nickname"/>
|
|
|
|
|
<el-table-column label="用户编号" align="center" prop="userId"/>
|
|
|
|
|
<el-table-column label="手机号码" align="center" prop="mobile"/>
|
|
|
|
|
<el-table-column label="打卡记录" align="center" prop="clockNum"/>
|
|
|
|
|
<el-table-column label="打卡记录" align="center" prop="clockNum" min-width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="viewClockDetail(scope.row)"
|
|
|
|
|
>
|
|
|
|
|
{{ '查看详情(' + scope.row.clockNum + ')' }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="打卡天数" align="center" prop="clockNum"/>
|
|
|
|
|
<el-table-column label="最新打卡时间" align="center" prop="lastClockTime"/>
|
|
|
|
|
<el-table-column label="小程序标签" align="center" prop="miniProgramTagListStr"/>
|
|
|
|
|
@ -253,22 +257,98 @@
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 小程序标签批量操作 -->
|
|
|
|
|
<el-dialog :title="this.miniProgramForm.title" :visible.sync="this.miniProgramForm.batchMiniProgramVisible"
|
|
|
|
|
width="50%" :before-close="cancelMiniProgramDialog">
|
|
|
|
|
<el-form ref="miniProgramForm" :model="miniProgramForm" :rules="batchMiniProgramRules" label-width="150px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="100">
|
|
|
|
|
<el-form-item label="小程序标签" prop="tagIdArray" label-width="100px">
|
|
|
|
|
<treeselect
|
|
|
|
|
v-model="miniProgramForm.tagIdArray"
|
|
|
|
|
:options="chatTagOptions"
|
|
|
|
|
:multiple="true"
|
|
|
|
|
:show-count="true"
|
|
|
|
|
placeholder="请选择小程序标签"
|
|
|
|
|
:disable-branch-nodes="true"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="cancelMiniProgramDialog(false)">重 置</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitBatchOperate">确 定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 导出字段选择弹窗 -->
|
|
|
|
|
<el-dialog title="自定义导出字段" :visible.sync="exportFieldsForm.exportFieldsVisible" width="50%"
|
|
|
|
|
:before-close="cancelExportFieldsDialog">
|
|
|
|
|
<el-form ref="form" label-width="150px">
|
|
|
|
|
<el-form-item label="全部字段" prop="allFields">
|
|
|
|
|
<el-switch v-model="allFields" @click.native="isExportAllFields()"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-form :inline="true" ref="form" :model="exportFieldList" label-width="150px">
|
|
|
|
|
<el-form-item label="会员昵称" prop="nickname">
|
|
|
|
|
<el-switch v-model="exportFieldList.nickname" active-value="nickname" :inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="用户编号 " prop="userId">
|
|
|
|
|
<el-switch v-model="exportFieldList.userId" active-value="userId" :inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="手机号 " prop="mobile">
|
|
|
|
|
<el-switch v-model="exportFieldList.mobile" active-value="mobile" :inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="累计打卡仪器名称 " prop="instrumentName">
|
|
|
|
|
<el-switch v-model="exportFieldList.instrumentName" active-value="instrumentName" :inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="最新打卡时间 " prop="lastClockTime">
|
|
|
|
|
<el-switch v-model="exportFieldList.lastClockTime" active-value="lastClockTime" :inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="小程序标签 " prop="miniProgramTagListStr">
|
|
|
|
|
<el-switch v-model="exportFieldList.miniProgramTagListStr" active-value="miniProgramTagListStr"
|
|
|
|
|
:inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="累计打卡天数 " prop="clockNum">
|
|
|
|
|
<el-switch v-model="exportFieldList.clockNum" active-value="clockNum" :inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="用户注册时间 " prop="memberRegisterDate">
|
|
|
|
|
<el-switch v-model="exportFieldList.memberRegisterDate" active-value="memberRegisterDate"
|
|
|
|
|
:inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="外部标签 " prop="wecomTagListStr">
|
|
|
|
|
<el-switch v-model="exportFieldList.wecomTagListStr" active-value="wecomTagListStr" :inactive-value="null"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="cancelExportFieldsDialog()">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="submitBatchOperate">确 定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {listClockLog, getClockLog, delClockLog, addClockLog, updateClockLog} from "@/api/system/clockLog";
|
|
|
|
|
import {
|
|
|
|
|
listClockLog, getClockLog, delClockLog, addClockLog, updateClockLog,
|
|
|
|
|
allAddMiniProgramTag, allDelMiniProgramTag
|
|
|
|
|
} from "@/api/system/clockLog";
|
|
|
|
|
import {listInstrument} from "@/api/system/instrument";
|
|
|
|
|
import {
|
|
|
|
|
getMiniProgramTags,
|
|
|
|
|
getWecomTags,
|
|
|
|
|
getMiniProgramTags, batchAddMiniProgramTag, batchDelMiniProgramTag, getWecomTags,
|
|
|
|
|
} from '@/api/system/member'
|
|
|
|
|
import {tagTreeSelect} from "@/api/system/wechatTab";
|
|
|
|
|
import Treeselect from '@riophae/vue-treeselect';
|
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "ClockLog",
|
|
|
|
|
components: {Treeselect},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
batchOperateValue: '',
|
|
|
|
|
|
|
|
|
|
// 折叠搜索
|
|
|
|
|
activeNames: ['search'],
|
|
|
|
|
// 遮罩层
|
|
|
|
|
@ -283,6 +363,7 @@ export default {
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
chatTagOptions: [],
|
|
|
|
|
// 用户打卡表格数据
|
|
|
|
|
clockLogList: [],
|
|
|
|
|
// 仪器表格数据
|
|
|
|
|
@ -310,10 +391,43 @@ export default {
|
|
|
|
|
clockNumStart: undefined,
|
|
|
|
|
clockNumEnd: undefined,
|
|
|
|
|
},
|
|
|
|
|
// 批量操作:小程序标签
|
|
|
|
|
batchOperateValue: null,
|
|
|
|
|
miniProgramForm: {
|
|
|
|
|
title: null,
|
|
|
|
|
batchMiniProgramVisible: false,
|
|
|
|
|
tagIdArray: [],
|
|
|
|
|
userIdList: [],
|
|
|
|
|
},
|
|
|
|
|
// 导出数据选择字段
|
|
|
|
|
exportFieldsForm: {
|
|
|
|
|
idList: null,
|
|
|
|
|
exportFields: null,
|
|
|
|
|
exportFieldsVisible: false,
|
|
|
|
|
},
|
|
|
|
|
allFields: false,
|
|
|
|
|
exportFieldList: {
|
|
|
|
|
nickname: null,
|
|
|
|
|
userId: null,
|
|
|
|
|
mobile: null,
|
|
|
|
|
clockNum: null,
|
|
|
|
|
lastClockTime: null,
|
|
|
|
|
miniProgramTagListStr: null,
|
|
|
|
|
wecomTagListStr: null,
|
|
|
|
|
memberRegisterDate: null,
|
|
|
|
|
instrumentName: null,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {}
|
|
|
|
|
rules: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
batchMiniProgramRules: {
|
|
|
|
|
tagIdArray: [
|
|
|
|
|
{required: true, message: '请选择小程序标签', trigger: 'change'},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
@ -381,6 +495,9 @@ export default {
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
|
let selectedUserIdList = selection.map(item => item.userId)
|
|
|
|
|
this.miniProgramForm.userIdList = selectedUserIdList;
|
|
|
|
|
this.exportFieldsForm.idList = selectedUserIdList;
|
|
|
|
|
this.single = selection.length !== 1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
@ -440,7 +557,221 @@ export default {
|
|
|
|
|
clearClockNum() {
|
|
|
|
|
this.queryParams.clockNumStart = undefined;
|
|
|
|
|
this.queryParams.clockNumEnd = undefined;
|
|
|
|
|
},
|
|
|
|
|
viewClockDetail(row) {
|
|
|
|
|
console.log(row)
|
|
|
|
|
console.log(this.queryParams.clockDateRange)
|
|
|
|
|
},
|
|
|
|
|
/** 批量操作按钮,显示批量操作弹窗 */
|
|
|
|
|
batchOperate() {
|
|
|
|
|
if (this.batchOperateValue == null) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择要批量操作类型',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
/* 批量操作 小程序标签 */
|
|
|
|
|
if (this.batchOperateValue == 1 || this.batchOperateValue == 2) {
|
|
|
|
|
if (this.ids.length == 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择要操作的数据',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 1) {
|
|
|
|
|
this.miniProgramForm.title = '添加小程序标签'
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 2) {
|
|
|
|
|
this.miniProgramForm.title = '删除小程序标签'
|
|
|
|
|
}
|
|
|
|
|
// 获取标签树
|
|
|
|
|
this.getDeptTree()
|
|
|
|
|
this.miniProgramForm.batchMiniProgramVisible = true
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 3 || this.batchOperateValue == 4) {
|
|
|
|
|
if (this.batchOperateValue == 3) {
|
|
|
|
|
this.miniProgramForm.title = '添加小程序标签'
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 4) {
|
|
|
|
|
this.miniProgramForm.title = '删除小程序标签'
|
|
|
|
|
}
|
|
|
|
|
// 获取标签树
|
|
|
|
|
this.getDeptTree()
|
|
|
|
|
this.miniProgramForm.batchMiniProgramVisible = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 批量操作:导出数据 */
|
|
|
|
|
if (this.batchOperateValue == 12) {
|
|
|
|
|
if (this.ids.length == 0) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '请选择要操作的数据',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.exportFieldsForm.exportFieldsVisible = true
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 13) {
|
|
|
|
|
this.exportFieldsForm.exportFieldsVisible = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 查询部门下拉树结构 */
|
|
|
|
|
getDeptTree() {
|
|
|
|
|
tagTreeSelect({type: 1}).then((response) => {
|
|
|
|
|
this.chatTagOptions = response.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 关闭添加小程序标签窗口
|
|
|
|
|
cancelMiniProgramDialog(isClose) {
|
|
|
|
|
this.$refs.miniProgramForm.clearValidate();
|
|
|
|
|
this.miniProgramForm.tagIdArray = []
|
|
|
|
|
if (isClose) {
|
|
|
|
|
this.miniProgramForm.title = null
|
|
|
|
|
this.miniProgramForm.batchMiniProgramVisible = false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/* 批量操作提交按钮 */
|
|
|
|
|
submitBatchOperate() {
|
|
|
|
|
// 批量添加小程序标签
|
|
|
|
|
if (this.batchOperateValue == 1) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
batchAddMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,
|
|
|
|
|
Array.from(new Set(this.miniProgramForm.userIdList))
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('批量添加小程序标签成功');
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 批量删除小程序标签
|
|
|
|
|
if (this.batchOperateValue == 2) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
batchDelMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,
|
|
|
|
|
Array.from(new Set(this.miniProgramForm.userIdList))
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('批量删除小程序标签成功')
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 全量添加小程序标签
|
|
|
|
|
if (this.batchOperateValue == 3) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
allAddMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,
|
|
|
|
|
this.queryParams
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('全量添加小程序标签成功')
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 全量删除小程序标签
|
|
|
|
|
if (this.batchOperateValue == 4) {
|
|
|
|
|
this.$refs['miniProgramForm'].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
allDelMiniProgramTag(
|
|
|
|
|
this.miniProgramForm.tagIdArray,
|
|
|
|
|
this.queryParams
|
|
|
|
|
).then((Response) => {
|
|
|
|
|
this.$modal.msgSuccess('全量删除小程序标签成功')
|
|
|
|
|
this.cancelMiniProgramDialog(true)
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导出用户打卡数据
|
|
|
|
|
if (this.batchOperateValue == 12) {
|
|
|
|
|
let exportFields = Object.values(this.exportFieldList).filter(
|
|
|
|
|
(val) => val != null
|
|
|
|
|
)
|
|
|
|
|
if (exportFields.length == 0) {
|
|
|
|
|
this.$modal.msgError('请选择导出字段')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.exportFieldsForm.exportFields = exportFields
|
|
|
|
|
this.download('/system/clockLog/batchExport', {
|
|
|
|
|
...this.exportFieldsForm,
|
|
|
|
|
},
|
|
|
|
|
`打卡记录数据_${new Date().getTime()}.xlsx`
|
|
|
|
|
)
|
|
|
|
|
this.cancelExportFieldsDialog()
|
|
|
|
|
}
|
|
|
|
|
if (this.batchOperateValue == 13) {
|
|
|
|
|
let exportFields = Object.values(this.exportFieldList).filter(
|
|
|
|
|
(val) => val != null
|
|
|
|
|
)
|
|
|
|
|
if (exportFields.length == 0) {
|
|
|
|
|
this.$modal.msgError('请选择导出字段')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.download(
|
|
|
|
|
'/system/clockLog/allExport',
|
|
|
|
|
{
|
|
|
|
|
...Object.assign({}, this.queryParams, {
|
|
|
|
|
exportFields: exportFields,
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
`打卡记录数据_${new Date().getTime()}.xlsx`
|
|
|
|
|
)
|
|
|
|
|
this.cancelExportFieldsDialog()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
cancelExportFieldsDialog() {
|
|
|
|
|
this.allFields = false
|
|
|
|
|
this.exportFieldsForm.exportFieldsVisible = false
|
|
|
|
|
this.exportFieldList = {
|
|
|
|
|
nickname: null,
|
|
|
|
|
userId: null,
|
|
|
|
|
mobile: null,
|
|
|
|
|
clockNum: null,
|
|
|
|
|
lastClockTime: null,
|
|
|
|
|
miniProgramTagListStr: null,
|
|
|
|
|
wecomTagListStr: null,
|
|
|
|
|
memberRegisterDate: null,
|
|
|
|
|
instrumentName: null,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
isExportAllFields() {
|
|
|
|
|
if (this.allFields) {
|
|
|
|
|
this.exportFieldList.nickname = "nickname";
|
|
|
|
|
this.exportFieldList.userId = "userId";
|
|
|
|
|
this.exportFieldList.mobile = "mobile";
|
|
|
|
|
this.exportFieldList.clockNum = "clockNum";
|
|
|
|
|
this.exportFieldList.lastClockTime = "lastClockTime";
|
|
|
|
|
this.exportFieldList.miniProgramTagListStr = "miniProgramTagListStr";
|
|
|
|
|
this.exportFieldList.wecomTagListStr = "wecomTagListStr";
|
|
|
|
|
this.exportFieldList.memberRegisterDate = "memberRegisterDate";
|
|
|
|
|
this.exportFieldList.instrumentName = "instrumentName";
|
|
|
|
|
} else {
|
|
|
|
|
this.exportFieldList.nickname = null;
|
|
|
|
|
this.exportFieldList.userId = null;
|
|
|
|
|
this.exportFieldList.mobile = null;
|
|
|
|
|
this.exportFieldList.clockNum = null;
|
|
|
|
|
this.exportFieldList.lastClockTime = null;
|
|
|
|
|
this.exportFieldList.miniProgramTagListStr = null;
|
|
|
|
|
this.exportFieldList.wecomTagListStr = null;
|
|
|
|
|
this.exportFieldList.memberRegisterDate = null;
|
|
|
|
|
this.exportFieldList.instrumentName = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|