提交 7e2b9528 编写于 作者: X xinla

修改部分issue

上级 104f01cd
<script>
import * as api from "@/api/customer/tag";
import * as api from '@/api/customer/tag'
export default {
name: "AddTag",
name: 'AddTag',
components: {},
props: {
// 添加标签显隐
......@@ -14,7 +14,7 @@ export default {
form: {
type: Object,
default: () => ({
gourpName: "",
gourpName: '',
weTags: [],
}),
},
......@@ -22,15 +22,15 @@ export default {
data() {
return {
// 添加标签输入框
newInput: "",
newInput: '',
// 表单验证规则
rules: Object.freeze({
gourpName: [{ required: true, message: "必填项", trigger: "blur" }],
weTags: [{ required: true, message: "必填项", trigger: "blur" }],
gourpName: [{ required: true, message: '必填项', trigger: 'blur' }],
weTags: [{ required: true, message: '必填项', trigger: 'blur' }],
}),
// 添加便签按钮显隐
visibleAdd: false,
};
}
},
watch: {},
computed: {
......@@ -38,13 +38,13 @@ export default {
get() {
if (this.visible) {
this.$nextTick(() => {
this.$refs["form"].clearValidate();
});
this.$refs['form'].clearValidate()
})
}
return this.visible;
return this.visible
},
set(val) {
this.$emit("update:visible", val);
this.$emit('update:visible', val)
},
},
},
......@@ -53,43 +53,42 @@ export default {
methods: {
closeTag(tag, index) {
if (tag.id) {
tag.status = 1;
tag.status = 1
} else {
this.form.weTags.splice(index, 1);
this.form.weTags.splice(index, 1)
}
},
showInput() {
this.visibleAdd = true;
this.visibleAdd = true
this.$nextTick((_) => {
this.$refs.saveTagInput.$refs.input.focus();
});
this.$refs.saveTagInput.$refs.input.focus()
})
},
newInputConfirm() {
let name = this.newInput;
let name = this.newInput
if (name) {
Array.isArray(this.form.weTags) || (this.form.weTags = []);
this.form.weTags.push({ name });
Array.isArray(this.form.weTags) || (this.form.weTags = [])
this.form.weTags.push({ name })
}
this.visibleAdd = false;
this.newInput = "";
this.visibleAdd = false
this.newInput = ''
},
submit() {
this.$refs["form"].validate((valid) => {
let form = JSON.parse(JSON.stringify(this.form));
this.$refs['form'].validate((valid) => {
let form = JSON.parse(JSON.stringify(this.form))
if (!form.weTags.length) {
return;
return
}
debugger;
api[form.groupId ? "update" : "add"](form).then(() => {
this.msgSuccess("操作成功");
this.Pvisible = false;
this.$emit("success");
});
});
api[form.groupId ? 'update' : 'add'](form).then(() => {
this.msgSuccess('操作成功')
this.Pvisible = false
this.$emit('success')
})
})
},
},
};
}
</script>
<template>
......@@ -118,12 +117,14 @@ export default {
size="medium"
:key="index"
@close="closeTag(item, index)"
>{{item.name}}</el-tag>
>
{{ item.name }}
</el-tag>
</template>
<el-input
class="input-new-tag"
v-if="visibleAdd"
v-model="newInput"
v-model.trim="newInput"
ref="saveTagInput"
size="mini"
maxlength="10"
......@@ -138,11 +139,14 @@ export default {
class="button-new-tag"
size="mini"
@click="showInput"
>+ 添加标签</el-button>
>+ 添加标签</el-button
>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">确 定</el-button>
<el-button type="primary" @click="submit" v-preventReClick="1000"
>确 定</el-button
>
<el-button @click="Pvisible = false">取 消</el-button>
</div>
</el-dialog>
......
......@@ -36,6 +36,9 @@ export default {
type(val) {
val === 'remove' && (this.removeTag = this.selected.slice())
},
selected(val) {
this.Pselected = val
},
},
computed: {
Pvisible: {
......@@ -94,12 +97,14 @@ export default {
v-show="item.groupId === selectedGroup || !selectedGroup"
:key="index"
>
<el-checkbox
:label="unit"
v-for="(unit, unique) in item.weTags"
:key="index + unique"
>{{ unit.name }}</el-checkbox
>
<template v-for="(unit, unique) in item.weTags">
<el-checkbox
v-if="unit.name.trim()"
:label="unit"
:key="index + unique"
>{{ unit.name }}</el-checkbox
>
</template>
</div>
</template>
</el-checkbox-group>
......@@ -109,7 +114,7 @@ export default {
v-if="item.groupId === selectedGroup || !selectedGroup"
:label="item"
:key="index"
>{{ item.name }}</el-checkbox
>{{ item.name.trim() || '(空的无效标签,请移除)' }}</el-checkbox
>
</template>
</el-checkbox-group>
......
import hasRole from './hasRole'
import hasPermi from './hasPermi'
import hasRole from './permission/hasRole'
import hasPermi from './permission/hasPermi'
import preventReClick from './preventReClick'
const install = function(Vue) {
Vue.directive('hasRole', hasRole)
Vue.directive('hasPermi', hasPermi)
Vue.directive('preventReClick', preventReClick)
}
if (window.Vue) {
window['hasRole'] = hasRole
window['hasPermi'] = hasPermi
Vue.use(install); // eslint-disable-line
Vue.use(install) // eslint-disable-line
}
export default install
/**
* vue 自定义阻止按钮连续点击指令
* 使用 <div @click="search" v-preventReClick="1000">搜索</div>
*/
export default {
inserted(el, binding) {
el.addEventListener('click', () => {
el.style.pointerEvents = 'none'
setTimeout(() => {
el.style.pointerEvents = 'auto'
}, binding.value || 2000)
})
},
}
......@@ -20,7 +20,7 @@ import config from '@/config'
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import directive from './directive'
import './assets/icons' // icon
import './permission' // permission control
......@@ -69,7 +69,7 @@ Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('Upload', Upload)
Vue.use(permission)
Vue.use(directive)
/**
* If you don't want to use mock-server
......
......@@ -157,7 +157,7 @@ export default {
.then(() => {
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList(!this.form.id && 1)
this.getList(form._new && 1)
})
.catch(() => {
this.dialogVisible = false
......@@ -260,7 +260,7 @@ export default {
:inline="true"
label-width="100px"
>
<el-form-item label="账号/姓名/手机号" label-width="120px" prop="title">
<el-form-item label="姓名" prop="title">
<el-input v-model="query.name" placeholder="请输入" clearable />
</el-form-item>
<el-form-item label="入职时间">
......@@ -277,7 +277,7 @@ export default {
<el-form-item label="激活状态">
<el-select v-model="query.isActivate">
<el-option label="已激活" :value="1"></el-option>
<el-option label="未激活" :value="2"></el-option>
<el-option label="未激活" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label>
......@@ -446,7 +446,7 @@ export default {
<!-- 人员弹窗 -->
<el-dialog
:title="(form.id ? (disabled ? '查看' : '修改') : '添加') + '成员'"
:title="(form.userId ? (disabled ? '查看' : '修改') : '添加') + '成员'"
:visible.sync="dialogVisible"
>
<el-row :gutter="10">
......@@ -484,7 +484,7 @@ export default {
</el-form-item>
<el-form-item label="账号" prop="userId">
<el-input
:disabled="form.id"
:disabled="!form._new"
v-model="form.userId"
placeholder="成员唯一标识,不支持更改,不支持中文"
></el-input>
......@@ -572,7 +572,7 @@ export default {
:title="(formDepart.id ? '修改' : '添加') + '部门'"
:visible.sync="dialogVisibleDepart"
>
<el-form :model="formDepart" :label-width="80">
<el-form :model="formDepart" label-width="80px">
<el-form-item label="部门名称">
<el-input v-model="formDepart.name"></el-input>
</el-form-item>
......
<script>
import * as api from "@/api/customer";
import { getList as getListTag } from "@/api/customer/tag";
import { getList as getListOrganization } from "@/api/organization";
import AddTag from "@/components/AddTag";
import SelectUser from "@/components/SelectUser";
import SelectTag from "@/components/SelectTag";
import * as api from '@/api/customer'
import { getList as getListTag } from '@/api/customer/tag'
import { getList as getListOrganization } from '@/api/organization'
import AddTag from '@/components/AddTag'
import SelectUser from '@/components/SelectUser'
import SelectTag from '@/components/SelectTag'
export default {
name: "Customer",
name: 'Customer',
components: { AddTag, SelectUser, SelectTag },
props: {},
data() {
......@@ -15,11 +15,11 @@ export default {
query: {
pageNum: 1,
pageSize: 10,
name: "", // "客户名称",
userIds: "", // "添加人id",
tagIds: "", // "标签id,多个标签,id使用逗号隔开",
beginTime: "", // "开始时间",
endTime: "" // "结束时间"
name: '', // "客户名称",
userIds: '', // "添加人id",
tagIds: '', // "标签id,多个标签,id使用逗号隔开",
beginTime: '', // "开始时间",
endTime: '', // "结束时间"
},
queryTag: [], // 搜索框选择的标签
queryUser: [], // 搜索框选择的添加人
......@@ -27,45 +27,45 @@ export default {
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
return time.getTime() > Date.now()
},
shortcuts: [
{
text: "最近一周",
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
}
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
},
},
{
text: "最近一个月",
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
}
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
},
},
{
text: "最近三个月",
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
}
}
]
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
},
},
],
},
loading: false,
isMoreFilter: false,
total: 0,
// 添加标签表单
form: {
gourpName: "",
weTags: []
gourpName: '',
weTags: [],
},
list: [], // 客户列表
listOrganization: [], // 组织架构列表
......@@ -73,182 +73,182 @@ export default {
dialogVisible: false, // 选择标签弹窗显隐
dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
dialogVisibleAddTag: false, // 添加标签弹窗显隐
selectedGroup: "", // 选择的标签分组
selectedGroup: '', // 选择的标签分组
selectedTag: [], // 选择的标签
removeTag: [], // 可移除的标签
tagDialogType: {
title: "", // 选择标签弹窗标题
type: "" // 弹窗类型
}
};
title: '', // 选择标签弹窗标题
type: '', // 弹窗类型
},
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getListTag();
this.getListOrganization();
this.getList()
this.getListTag()
this.getListOrganization()
},
mounted() {},
methods: {
getList(page) {
// console.log(this.dateRange);
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = "";
this.query.endTime = "";
this.query.beginTime = ''
this.query.endTime = ''
}
page && (this.query.pageNum = page);
this.loading = true;
page && (this.query.pageNum = page)
this.loading = true
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
this.multipleSelection = [];
this.list = rows
this.total = +total
this.loading = false
this.multipleSelection = []
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
getListTag() {
getListTag().then(({ rows }) => {
this.listTagOneArray = [];
rows.forEach(element => {
element.weTags.forEach(d => {
this.listTagOneArray.push(d);
});
});
});
this.listTagOneArray = []
rows.forEach((element) => {
element.weTags.forEach((d) => {
this.listTagOneArray.push(d)
})
})
})
},
getListOrganization() {
getListOrganization().then(({ rows }) => {
this.listOrganization = Object.freeze(rows);
});
this.listOrganization = Object.freeze(rows)
})
},
showTagDialog() {
this.selectedTag = this.queryTag;
this.selectedTag = this.queryTag
this.tagDialogType = {
title: "选择标签",
type: "query"
};
this.dialogVisible = true;
this.$refs.selectTag.$forceUpdate();
title: '选择标签',
type: 'query',
}
this.dialogVisible = true
this.$refs.selectTag.$forceUpdate()
},
makeTag(type) {
this.selectedTag = [];
this.selectedTag = []
if (!this.multipleSelection.length) {
this.msgInfo("请选择一位客户");
return;
this.msgInfo('请选择一位客户')
return
}
if (this.multipleSelection.length > 1) {
this.msgInfo("同时只能选择一位客户");
return;
this.msgInfo('同时只能选择一位客户')
return
}
let isError = false;
this.multipleSelection.forEach(element => {
element.weFlowerCustomerRels.forEach(child => {
child.weFlowerCustomerTagRels.forEach(grandchild => {
let filter = this.listTagOneArray.find(d => {
return d.tagId === grandchild.tagId;
});
let isError = false
this.multipleSelection.forEach((element) => {
element.weFlowerCustomerRels.forEach((child) => {
child.weFlowerCustomerTagRels.forEach((grandchild) => {
let filter = this.listTagOneArray.find((d) => {
return d.tagId === grandchild.tagId
})
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏
if (!filter) {
isError = true;
return;
isError = true
return
}
this.selectedTag.push(filter);
});
});
});
this.selectedTag.push(filter)
})
})
})
if (isError) {
this.msgError("已有标签不在便签库中,或存在异常");
return;
this.msgError('已有标签不在便签库中,或存在异常')
return
}
this.tagDialogType = {
title: type === "add" ? "增加标签" : "移出标签",
type: type
};
this.removeTag = this.selectedTag.slice();
this.dialogVisible = true;
this.$refs.selectTag.$forceUpdate();
title: type === 'add' ? '增加标签' : '移出标签',
type: type,
}
this.removeTag = this.selectedTag.slice()
this.dialogVisible = true
this.$refs.selectTag.$forceUpdate()
},
sync() {
const loading = this.$loading({
lock: true,
text: "Loading",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)"
});
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
api
.sync()
.then(() => {
loading.close();
this.msgSuccess("后台开始同步数据,请稍后关注进度");
loading.close()
this.msgSuccess('后台开始同步数据,请稍后关注进度')
})
.catch((fail) => {
loading.close()
console.log(fail)
})
.catch(fail => {
loading.close();
console.log(fail);
});
},
/** 导出按钮操作 */
exportCustomer() {
const queryParams = this.query;
this.$confirm("是否确认导出所有客户数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
const queryParams = this.query
this.$confirm('是否确认导出所有客户数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(function() {
return api.exportCustomer(queryParams);
return api.exportCustomer(queryParams)
})
.then(response => {
this.download(response.msg);
.then((response) => {
this.download(response.msg)
})
.catch(function() {});
.catch(function() {})
},
selectedUser(list) {
this.queryUser = list;
this.query.userIds = list.map(d => d.userId) + "";
this.queryUser = list
this.query.userIds = list.map((d) => d.userId) + ''
},
submitSelectTag(selected) {
if (this.tagDialogType.type === "query") {
this.query.tagIds = selected.map(d => d.tagId) + "";
if (this.tagDialogType.type === 'query') {
this.query.tagIds = selected.map((d) => d.tagId) + ''
// debugger;
this.queryTag = selected;
this.dialogVisible = false;
this.queryTag = selected
this.dialogVisible = false
} else {
let data = {
externalUserid: this.multipleSelection[0].externalUserid,
addTag: selected
};
addTag: selected,
}
let apiType = {
add: "makeLabel",
remove: "removeLabel"
};
add: 'makeLabel',
remove: 'removeLabel',
}
api[apiType[this.tagDialogType.type]](data).then(() => {
this.msgSuccess("操作成功");
this.dialogVisible = false;
this.getList();
});
this.msgSuccess('操作成功')
this.dialogVisible = false
this.getList()
})
}
},
resetForm(formName) {
this.dateRange = [];
this.queryTag = [];
this.queryUser = [];
this.$refs["queryForm"].resetFields();
this.getList(1);
this.dateRange = []
this.queryTag = []
this.queryUser = []
this.$refs['queryForm'].resetFields()
this.getList(1)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.multipleSelection = selection;
}
}
};
this.multipleSelection = selection
},
},
}
</script>
<template>
......@@ -280,6 +280,7 @@ export default {
<el-form-item label="添加日期">
<el-date-picker
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
......@@ -381,12 +382,12 @@ export default {
{{ scope.row.name }}
<span
:style="{ color: scope.row.type === 1 ? '#4bde03' : '#f9a90b' }"
>{{ { 1: "@微信", 2: "@企业微信" }[scope.row.type] }}</span
>{{ { 1: '@微信', 2: '@企业微信' }[scope.row.type] }}</span
>
<i
:class="[
'el-icon-s-custom',
{ 1: 'man', 2: 'woman' }[scope.row.gender]
{ 1: 'man', 2: 'woman' }[scope.row.gender],
]"
></i>
</template>
......@@ -398,13 +399,16 @@ export default {
></el-table-column>
<el-table-column prop="userName" label="添加人(首位)" align="center">
<template slot-scope="scope">{{
scope.row.weFlowerCustomerRels[0]?scope.row.weFlowerCustomerRels[0].userName:""
scope.row.weFlowerCustomerRels[0]
? scope.row.weFlowerCustomerRels[0].userName
: ''
}}</template>
</el-table-column>
<el-table-column prop="createTime" label="添加时间" align="center">
<template slot-scope="scope">{{
scope.row.weFlowerCustomerRels[0]?scope.row.weFlowerCustomerRels[0].createTime:""
scope.row.weFlowerCustomerRels[0]
? scope.row.weFlowerCustomerRels[0].createTime
: ''
}}</template>
</el-table-column>
<el-table-column prop="address" label="标签" align="center">
......@@ -429,7 +433,7 @@ export default {
@click="
$router.push({
path: '/customerManage/customerDetail',
query: { id: scope.row.externalUserid }
query: { id: scope.row.externalUserid },
})
"
type="text"
......
<script>
import { getList } from "@/api/customer/dimission";
import { getList } from '@/api/customer/dimission'
export default {
name: "AllocatedStaffList",
name: 'AllocatedStaffList',
components: {},
props: {},
data() {
......@@ -23,77 +23,83 @@ export default {
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
return time.getTime() > Date.now()
},
shortcuts: [
{
text: "最近一周",
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
},
},
{
text: "最近一个月",
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
},
},
{
text: "最近三个月",
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
},
},
],
},
};
}
},
watch: {},
computed: {},
created() {
this.getList();
this.getList()
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
}
page && (this.query.pageNum = page);
this.loading = true;
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
resetForm(formName) {
this.dateRange = [];
this.$refs["queryForm"].resetFields();
this.dateRange = []
this.$refs['queryForm'].resetFields()
},
},
};
}
</script>
<template>
<div class="page">
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search">
<el-form-item label="已离职员工">
<el-form
ref="queryForm"
:inline="true"
:model="query"
label-width="100px"
class="top-search"
>
<el-form-item label="已离职员工" prop="userName">
<el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item>
......@@ -113,38 +119,63 @@ export default {
v-hasPermi="['customerManage:dimission:query']"
type="primary"
@click="getList(1)"
>查询</el-button>
>查询</el-button
>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="info"
@click="resetForm('queryForm')"
>重置</el-button>
>重置</el-button
>
</el-form-item>
</el-form>
<el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%">
<el-table
ref="multipleTable"
:data="list"
tooltip-effect="dark"
style="width: 100%"
>
<el-table-column type="index" label="序号" width="55"></el-table-column>
<el-table-column prop="userName" label="已离职员工"></el-table-column>
<el-table-column prop="department" label="所属部门"></el-table-column>
<el-table-column prop="allocateCustomerNum" label="已分配客户数" show-overflow-tooltip></el-table-column>
<el-table-column prop="allocateGroupNum" label="已分配群聊数" show-overflow-tooltip></el-table-column>
<el-table-column prop="dimissionTime" label="离职时间" show-overflow-tooltip>
<el-table-column
prop="allocateCustomerNum"
label="已分配客户数"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="allocateGroupNum"
label="已分配群聊数"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="dimissionTime"
label="离职时间"
show-overflow-tooltip
>
<template slot-scope="scope">{{ scope.row.dimissionTime }}</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button
v-hasPermi="['customerManage:dimission:edit']"
@click="$router.push({path: '/customerManage/allocatedStaffDetail', query: {userId: scope.row.userId}})"
@click="
$router.push({
path: '/customerManage/allocatedStaffDetail',
query: { userId: scope.row.userId },
})
"
type="text"
size="small"
>查看</el-button>
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
......@@ -153,5 +184,4 @@ export default {
</div>
</template>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
......@@ -132,7 +132,7 @@ export default {
label-width="100px"
class="top-search"
>
<el-form-item label="已离职员工">
<el-form-item label="已离职员工" prop="userName">
<el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="离职日期">
......@@ -147,14 +147,6 @@ export default {
></el-date-picker>
</el-form-item>
<el-form-item label="离职日期">
<el-date-picker
v-model="query.beginTime"
type="date"
placeholder="离职日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button
v-hasPermi="['customerManage:dimission:query']"
......
......@@ -15,6 +15,41 @@ export default {
},
// 日期范围
dateRange: [],
// 日期快捷选项
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
},
shortcuts: [
{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
},
},
{
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
},
},
{
text: '最近三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
},
},
],
},
// 遮罩层
loading: false,
// 选中数组
......@@ -123,6 +158,7 @@ export default {
v-model="dateRange"
value-format="yyyy-MM-dd"
type="daterange"
:picker-options="pickerOptions"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
......
......@@ -292,6 +292,7 @@ export default {
</div>
<el-table
v-loading="loading"
ref="multipleTable"
:data="list"
tooltip-effect="dark"
......
<script>
import { getDetail, getUserAddCustomerStat, download } from '@/api/drainageCode/staff'
import {
getDetail,
getUserAddCustomerStat,
download,
} from '@/api/drainageCode/staff'
import ClipboardJS from 'clipboard'
import echarts from 'echarts'
export default {
......@@ -26,6 +30,7 @@ export default {
endTime: undefined,
},
type: { 1: '单人', 2: '多人', 3: '批量单人' },
timeRange: 7,
}
},
created() {
......@@ -89,9 +94,11 @@ export default {
})
},
setTime(days) {
this.timeRange = days
let date = new Date()
date.setDate(date.getDate() - days)
this.dateRange = [this.getTime(date), this.getTime()]
this.getList()
},
getHandledValue(num) {
return num < 10 ? '0' + num : num
......@@ -104,19 +111,21 @@ export default {
return year + '-' + month + '-' + date
},
download() {
let userName = this.form.weEmpleCodeUseScops.map((item) =>{
return item.businessName
}).join(",");
let name = userName +"-"+this.form.activityScene+".png"
download(this.form.id).then((res) =>{
if (res!=null) {
let blob = new Blob([res], {type: 'application/zip'});
let url = window.URL.createObjectURL(blob);
const link = document.createElement('a'); // 创建a标签
link.href = url;
link.download = name; // 重命名文件
link.click();
URL.revokeObjectURL(url); // 释放内存
let userName = this.form.weEmpleCodeUseScops
.map((item) => {
return item.businessName
})
.join(',')
let name = userName + '-' + this.form.activityScene + '.png'
download(this.form.id).then((res) => {
if (res != null) {
let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = name // 重命名文件
link.click()
URL.revokeObjectURL(url) // 释放内存
}
})
},
......@@ -182,10 +191,18 @@ export default {
<div class="mb15">累计总人数{{ total }}</div>
<div>
<el-button-group>
<el-button size="small" type="primary" plain @click="setTime(7)"
<el-button
size="small"
type="primary"
:plain="timeRange != 7"
@click="setTime(7)"
>近7日</el-button
>
<el-button size="small" type="primary" plain @click="setTime(30)"
<el-button
size="small"
type="primary"
:plain="timeRange != 30"
@click="setTime(30)"
>近30日</el-button
>
</el-button-group>
......
......@@ -25,7 +25,7 @@ export default {
watch: {},
computed: {},
created() {
this.form = this.$route.query
this.form = Object.assign(this.form, this.$route.query)
},
mounted() {},
methods: {
......@@ -66,7 +66,7 @@ export default {
<div style="height: 300px;">
<el-input
type="textarea"
:rows="5"
:autosize="{ minRows: 2, maxRows: 6 }"
maxlength="100"
show-word-limit
placeholder="请输入欢迎语"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册