Commit 56f83026 by xinla

修改部分issue

1 parent 1441e845
<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 { 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
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!