提交 4346130d 编写于 作者: X xinlaa

组织架构,离职继承调试等

上级 f240c990
...@@ -2,7 +2,7 @@ import request from '@/utils/request' ...@@ -2,7 +2,7 @@ import request from '@/utils/request'
const service = config.services.wecom + '/user' const service = config.services.wecom + '/user'
/** /**
* 获取离职分配员工列表 * 获取离职分配员工列表
* @param {*} params * @param {*} params
* { * {
pageNum: pageNum:
...@@ -20,7 +20,7 @@ export function getList(params) { ...@@ -20,7 +20,7 @@ export function getList(params) {
} }
/** /**
* 获取离职分配员工列表 * 获取离职分配员工列表
* @param {*} params * @param {*} params
* { * {
pageNum: pageNum:
...@@ -52,3 +52,21 @@ export function allocate(data) { ...@@ -52,3 +52,21 @@ export function allocate(data) {
data data
}) })
} }
/**
* 离职已分配客户
* @param {*} params
{
"pageNum": 0,
"pageSize": 0,
"beginTime": "",
"endTime": "",
"handoverUserId": ""
}
*/
export function getAllocateCustomers(params) {
return request({
url: service + '/getAllocateCustomers',
params
})
}
...@@ -139,11 +139,11 @@ export default { ...@@ -139,11 +139,11 @@ export default {
}); });
}, },
handleNodeClick(data) { handleNodeClick(data) {
data.id != 1 && (this.query.department = data.id); this.query.department = data.id == 1 ? "" : data.id;
this.getList(1); this.getList(1);
}, },
edit(data, type) { edit(data, type) {
this.form = Object.assign({}, data || {}); this.form = Object.assign({}, data || { _new: true });
this.dialogVisible = true; this.dialogVisible = true;
type || !data ? (this.disabled = false) : (this.disabled = true); type || !data ? (this.disabled = false) : (this.disabled = true);
}, },
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
let form = JSON.parse(JSON.stringify(this.form)); let form = JSON.parse(JSON.stringify(this.form));
form.department += ""; form.department += "";
form.isLeaderInDept += ""; form.isLeaderInDept += "";
api[form.userId ? "updateUser" : "addUser"](form) api[form._new ? "addUser" : "updateUser"](form)
.then(() => { .then(() => {
this.msgSuccess("操作成功"); this.msgSuccess("操作成功");
this.dialogVisible = false; this.dialogVisible = false;
...@@ -360,7 +360,7 @@ export default { ...@@ -360,7 +360,7 @@ export default {
@click="edit(scope.row, 0)" @click="edit(scope.row, 0)"
>查看</el-button> >查看</el-button>
<el-button <el-button
v-hasPermi="['contacts:organization:forbidden']" v-hasPermi="['contacts:organization:setStatus']"
v-if="scope.row.userId !== 1 && scope.row.enable < 2" v-if="scope.row.userId !== 1 && scope.row.enable < 2"
type="text" type="text"
@click="startOrStop(scope.row)" @click="startOrStop(scope.row)"
...@@ -373,7 +373,7 @@ export default { ...@@ -373,7 +373,7 @@ export default {
>编辑</el-button> >编辑</el-button>
<el-button <el-button
v-if="scope.row.enable < 2" v-if="scope.row.enable < 2"
v-hasPermi="['customerManage:tag:remove']" v-hasPermi="['contacts:organization:remove']"
@click="remove(scope.row.userId)" @click="remove(scope.row.userId)"
type="text" type="text"
>删除</el-button> >删除</el-button>
......
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
}, },
submit() { submit() {
this.Pvisible = false; this.Pvisible = false;
this.$emit("success", this.userList.splice(0)); this.$emit("success", this.userList);
}, },
}, },
}; };
......
<script>
import { getAllocateCustomers } from "@/api/customer/dimission";
import AllocatedStaffDetailList from "./allocatedStaffDetailList";
export default {
name: "AllocatedStaffDetail",
components: { AllocatedStaffDetailList },
props: {},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
handoverUserId: undefined,
beginTime: undefined,
endTime: undefined,
},
loading: false,
total: 0,
list: [],
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]);
},
},
],
},
};
},
watch: {},
computed: {},
created() {},
mounted() {},
methods: {
getList() {
this.$refs.AllocatedStaffDetailList.getList(1);
},
resetForm(formName) {
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-date-picker
v-model="dateRange"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="primary"
@click="getList(1)"
>查询</el-button>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="info"
@click="resetForm('queryForm')"
>重置</el-button>
</el-form-item>
</el-form>
<el-tabs value="first" type="card">
<el-tab-pane label="已分配客户" name="first">
<AllocatedStaffDetailList ref="AllocatedStaffDetailList" :dateRange="dateRange"></AllocatedStaffDetailList>
</el-tab-pane>
<el-tab-pane label="已分配群聊" name="second">
<AllocatedStaffDetailList ref="AllocatedStaffDetailList" :dateRange="dateRange"></AllocatedStaffDetailList>
</el-tab-pane>
</el-tabs>
</div>
</template>
<style lang="scss" scoped>
</style>
<script>
import { getAllocateCustomers } from "@/api/customer/dimission";
export default {
name: "AllocatedStaffDetailList",
components: {},
props: {
dateRange: {
type: Array,
default: () => [],
},
},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
handoverUserId: undefined,
beginTime: undefined,
endTime: undefined,
},
loading: false,
total: 0,
list: [],
};
},
watch: {},
computed: {},
created() {
this.query.handoverUserId = this.$route.query.userId;
this.getList();
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page);
this.loading = true;
getAllocateCustomers(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
},
};
</script>
<template>
<div class="page">
<el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%">
<el-table-column prop="customerName" label="客户名称"></el-table-column>
<el-table-column prop="takeUserName" label="接替员工"></el-table-column>
<el-table-column prop="department" label="接替员工所属部门" show-overflow-tooltip></el-table-column>
<el-table-column prop="allocateTime" label="分配时间" show-overflow-tooltip></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/customerDetail', query: {id: scope.row.id}})"
type="text"
size="small"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div>
</template>
<style lang="scss" scoped>
</style>
<script>
import { getList } from "@/api/customer/dimission";
export default {
name: "AllocatedStaffList",
components: {},
props: {},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
userName: undefined,
beginTime: undefined,
endTime: undefined,
},
loading: false,
total: 0,
list: [],
dialogVisibleSelectUser: false,
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]);
},
},
],
},
};
},
watch: {},
computed: {},
created() {
this.getList();
},
mounted() {},
methods: {
/** 查询 */
getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page);
this.loading = true;
getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
resetForm(formName) {
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-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="离职日期">
<el-date-picker
v-model="dateRange"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="primary"
@click="getList(1)"
>查询</el-button>
<el-button
v-hasPermi="['customerManage:dimission:query']"
type="info"
@click="resetForm('queryForm')"
>重置</el-button>
</el-form-item>
</el-form>
<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>
<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}})"
type="text"
size="small"
>查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div>
</template>
<style lang="scss" scoped>
</style>
<script> <script>
import * as api from "@/api/customer/dimission"; import * as api from "@/api/customer/dimission";
import SelectUser from "./components/SelectUser"; import SelectUser from "../components/SelectUser";
export default { export default {
name: "Dimission", name: "Dimission",
...@@ -14,6 +14,7 @@ export default { ...@@ -14,6 +14,7 @@ export default {
pageSize: 10, pageSize: 10,
userName: undefined, userName: undefined,
beginTime: undefined, beginTime: undefined,
endTime: undefined,
}, },
loading: false, loading: false,
isMoreFilter: false, isMoreFilter: false,
...@@ -23,8 +24,44 @@ export default { ...@@ -23,8 +24,44 @@ export default {
region: "", region: "",
}, },
list: [], list: [],
multipleSelection: [], currentRow: {},
dialogVisibleSelectUser: false, dialogVisibleSelectUser: false,
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]);
},
},
],
},
}; };
}, },
watch: {}, watch: {},
...@@ -36,6 +73,10 @@ export default { ...@@ -36,6 +73,10 @@ export default {
methods: { methods: {
/** 查询 */ /** 查询 */
getList(page) { getList(page) {
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page); page && (this.query.pageNum = page);
this.loading = true; this.loading = true;
api api
...@@ -60,21 +101,33 @@ export default { ...@@ -60,21 +101,33 @@ export default {
}); });
}, },
resetForm(formName) { resetForm(formName) {
this.dateRange = [];
this.$refs["queryForm"].resetFields(); this.$refs["queryForm"].resetFields();
}, },
showSelectDialog() {
if (this.currentRow.userId) {
this.dialogVisibleSelectUser = true;
} else {
this.$message.warning("请先选择一位员工");
}
},
allocate(userlist) { allocate(userlist) {
if (userlist.length > 1) {
this.dialogVisibleSelectUser = true;
return;
}
api api
.allocate({ .allocate({
handoverUserid: this.multipleSelection[0].id, handoverUserid: this.currentRow.userId,
takeoverUserid: userlist[0].id, takeoverUserid: userlist[0].userId,
}) })
.then(() => { .then(() => {
this.msgSuccess("操作成功"); this.msgSuccess("操作成功");
}); });
}, },
// 多选框选中数据 // 选中数据
handleSelectionChange(selection) { handleCurrentChange(val) {
this.multipleSelection = selection; this.currentRow = val;
}, },
}, },
}; };
...@@ -86,6 +139,17 @@ export default { ...@@ -86,6 +139,17 @@ export default {
<el-form-item label="已离职员工"> <el-form-item label="已离职员工">
<el-input v-model="query.userName" placeholder="请输入"></el-input> <el-input v-model="query.userName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="离职日期">
<el-date-picker
v-model="dateRange"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
></el-date-picker>
</el-form-item>
<el-form-item label="离职日期"> <el-form-item label="离职日期">
<el-date-picker v-model="query.beginTime" type="date" placeholder="离职日期" align="right"></el-date-picker> <el-date-picker v-model="query.beginTime" type="date" placeholder="离职日期" align="right"></el-date-picker>
...@@ -111,13 +175,13 @@ export default { ...@@ -111,13 +175,13 @@ export default {
v-hasPermi="['customerManage:dimission:filter']" v-hasPermi="['customerManage:dimission:filter']"
type="primary" type="primary"
size="mini" size="mini"
@click="getList(1)" @click="$router.push({path: '/customerManage/allocatedStaffList'})"
>已分配的离职员工</el-button> >已分配的离职员工</el-button>
<el-button <el-button
v-hasPermi="['customerManage:dimission:allocate']" v-hasPermi="['customerManage:dimission:allocate']"
type="primary" type="primary"
size="mini" size="mini"
@click="dialogVisibleSelectUser = true" @click="showSelectDialog"
>分配给其他员工</el-button> >分配给其他员工</el-button>
</div> </div>
</div> </div>
...@@ -127,27 +191,22 @@ export default { ...@@ -127,27 +191,22 @@ export default {
:data="list" :data="list"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChange" highlight-current-row
@current-change="handleCurrentChange"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="index" label="序号" width="55"></el-table-column>
<el-table-column prop="userName" label="已离职员工" width="120"></el-table-column> <el-table-column prop="userName" label="已离职员工"></el-table-column>
<el-table-column prop="department" label="所属部门" width="120"></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="allocateCustomerNum" label="待分配客户数" show-overflow-tooltip></el-table-column>
<el-table-column prop="allocateGroupNum" 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="dimissionTime" label="离职时间" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.dimissionTime }}</template> <template slot-scope="scope">{{ scope.row.dimissionTime }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100"> <!-- <el-table-column label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button
v-hasPermi="['customerManage:dimission:edit']"
@click="handleClick(scope.row)"
type="text"
size="small"
>查看</el-button>-->
<el-button v-hasPermi="['customerManage:dimission:edit']" type="text" size="small">编辑</el-button> <el-button v-hasPermi="['customerManage:dimission:edit']" type="text" size="small">编辑</el-button>
</template> </template>
</el-table-column> </el-table-column>-->
</el-table> </el-table>
<pagination <pagination
......
...@@ -6,7 +6,6 @@ function resolve(dir) { ...@@ -6,7 +6,6 @@ function resolve(dir) {
} }
process.env.VUE_APP_TITLE = require('./package.json').description process.env.VUE_APP_TITLE = require('./package.json').description
// process.env.VUE_APP_BASE_API = process.env.NODE_ENV === 'development' ? 'http://106.13.201.219:8080' : 'http://106.13.201.219:8080'
process.env.VUE_APP_BASE_API = process.env.NODE_ENV === 'development' ? 'http://127.0.0.1:8080' : 'http://127.0.0.1:8080' process.env.VUE_APP_BASE_API = process.env.NODE_ENV === 'development' ? 'http://127.0.0.1:8080' : 'http://127.0.0.1:8080'
// vue.config.js 配置说明 // vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册