Commit b8d3ad5d authored by “yiyousong”'s avatar “yiyousong”

fix:修改部门搜索

parent 2f8de085
...@@ -21,6 +21,7 @@ export default { ...@@ -21,6 +21,7 @@ export default {
.copyright { .copyright {
color: @text-color-second; color: @text-color-second;
font-size: 14px; font-size: 14px;
opacity: 0;
i { i {
margin: 0 4px; margin: 0 4px;
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
size="middle" size="middle"
:pagination="{ :pagination="{
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: current, current: Current,
total: total, total: total,
size: 'middle', size: 'middle',
showSizeChanger: true, showSizeChanger: true,
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="预约" prop="isOrder"> <a-form-model-item label="正常使用" prop="usValid">
<y-switch v-model="form.isOrder"></y-switch> <y-switch v-model="form.usValid"></y-switch>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -73,8 +73,8 @@ ...@@ -73,8 +73,8 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="正常使用" prop="usValid"> <a-form-model-item label="预约" prop="isOrder">
<y-switch v-model="form.usValid"></y-switch> <y-switch v-model="form.isOrder"></y-switch>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -113,13 +113,13 @@ export default { ...@@ -113,13 +113,13 @@ export default {
deptAbb: "", // 部门简称 deptAbb: "", // 部门简称
deptTelphone: "", // 部门电话 deptTelphone: "", // 部门电话
deptNumber: "", // 部门编号 deptNumber: "", // 部门编号
isAutotable: "", // 填表展示 isAutotable: 1, // 填表展示
isOrder: "", // 预约展示 isOrder: 1, // 预约展示
isBkb: "", // 背靠背 isBkb: 1, // 背靠背
isWorkGuide: "", // 办事指南展示 isWorkGuide: 1, // 办事指南展示
usValid: "", // 是否使用 usValid: 1, // 是否使用
isSecphone: "", // 部门电话展示 isSecphone: 1, // 部门电话展示
isEnglish: "", // 是否展示英文 isEnglish: 1, // 是否展示英文
sort: "", // 排序 sort: "", // 排序
}, },
rules: { rules: {
......
...@@ -28,9 +28,19 @@ ...@@ -28,9 +28,19 @@
<!-- 部门管理 --> <!-- 部门管理 -->
<div class="department-list"> <div class="department-list">
<div v-if="department.length"> <div v-if="department.length">
<div class="department_off" v-for="v in department" :key="v.id"> <div
:class="{ department_off: true, active: active === i }"
v-for="(v, i) in department"
:key="v.id"
@click="changeDept(v.id, i)"
>
<div class="department-title"> <div class="department-title">
<span class="department_a">{{ v.name }}</span> <div class="department_a">
<a-tooltip>
<template slot="title"> {{ v.name }} </template>
{{ v.name }}
</a-tooltip>
</div>
<div class="department_icon_edit"> <div class="department_icon_edit">
<a-tooltip> <a-tooltip>
<template slot="title"> 查看编辑 </template> <template slot="title"> 查看编辑 </template>
...@@ -43,25 +53,19 @@ ...@@ -43,25 +53,19 @@
</a-tooltip> </a-tooltip>
<a-tooltip> <a-tooltip>
<template slot="title"> 删除 </template> <template slot="title"> 删除 </template>
<a-popconfirm
title="删除不可恢复,确定要删除吗?" <a-icon
@confirm="delDepartment(v.id)" type="delete"
> @click="delDepartment(v.id)"
<a-icon class="delete"
slot="icon" department_del
type="question-circle-o" />
style="color: red"
/>
<a-icon type="delete" class="delete" department_del />
</a-popconfirm>
</a-tooltip> </a-tooltip>
</div> </div>
</div> </div>
<div> <div>
<span class="department_span">简称:{{ v.deptAbb }}</span> <div class="department_span">简称:{{ v.deptAbb }}</div>
<br /> <div>联系电话:{{ v.deptTelphone }}</div>
<span>联系电话:{{ v.deptTelphone }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -138,18 +142,7 @@ ...@@ -138,18 +142,7 @@
<a class="yewu" type="primary" @click="workModal(text)">业务</a> <a class="yewu" type="primary" @click="workModal(text)">业务</a>
<a class="shixiang" @click="addWindowMatter(text)">事项</a> <a class="shixiang" @click="addWindowMatter(text)">事项</a>
<a class="edit" type="primary" @click="editModal(text)">编辑</a> <a class="edit" type="primary" @click="editModal(text)">编辑</a>
<a-popconfirm <a class="delete" @click="delWindow(text.id)">删除</a>
title="删除不可恢复,确定要删除吗?"
placement="left"
@confirm="delWindow(text.id)"
>
<a-icon
slot="icon"
type="question-circle-o"
style="color: red"
/>
<a class="delete">删除</a>
</a-popconfirm>
</span> </span>
</a-table> </a-table>
</div> </div>
...@@ -339,6 +332,8 @@ export default { ...@@ -339,6 +332,8 @@ export default {
business: [], // 站点业务数据 business: [], // 站点业务数据
windowSearch: "", // 窗口搜索 windowSearch: "", // 窗口搜索
deptSearchVal: "", // 部门搜索 deptSearchVal: "", // 部门搜索
deptId: "", // 部门搜索窗口
active: undefined, // 部门激活
// isRelevancy: false, // isRelevancy: false,
formData: { formData: {
// 关联表单 // 关联表单
...@@ -385,6 +380,8 @@ export default { ...@@ -385,6 +380,8 @@ export default {
methods: { methods: {
handleClick(val) { handleClick(val) {
this.siteId = val.id; this.siteId = val.id;
this.active = undefined;
this.deptId = "";
this.getDeptListData({ siteId: val.id }); this.getDeptListData({ siteId: val.id });
this.getWindowListData({ siteId: val.id }); this.getWindowListData({ siteId: val.id });
this.getBusinessData({ siteId: val.id }); this.getBusinessData({ siteId: val.id });
...@@ -400,6 +397,8 @@ export default { ...@@ -400,6 +397,8 @@ export default {
this.windowData = []; this.windowData = [];
this.siteId = ""; this.siteId = "";
this.total = 0; this.total = 0;
this.active = undefined;
this.deptId = "";
}, },
// 去掉空children // 去掉空children
delChildren(arr) { delChildren(arr) {
...@@ -461,18 +460,43 @@ export default { ...@@ -461,18 +460,43 @@ export default {
this.formVisible = true; this.formVisible = true;
this.$refs.adddepartment.onEdit(val); this.$refs.adddepartment.onEdit(val);
}, },
// 切换部门
// 删除部门 changeDept(id, index) {
async delDepartment(num) { if (this.deptId === id) {
let res = await delDept({ id: num }); this.deptId = "";
let { code, msg } = res.data; this.active = undefined;
if (code === 1) { this.page = 1;
this.getDeptListData(this.siteId); this.getWindowListData();
this.$message.success(msg);
} else { } else {
this.$message.error(msg); this.deptId = id;
this.active = index;
this.page = 1;
this.getWindowListData();
} }
}, },
// 删除部门
delDepartment(num) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
async onOk() {
let res = await delDept({ id: num });
let { code, msg } = res.data;
if (code === 1) {
_this.getDeptListData(_this.siteId);
_this.$message.success(msg);
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 窗口列表 // 窗口列表
async getWindowListData(obj = {}) { async getWindowListData(obj = {}) {
...@@ -482,6 +506,7 @@ export default { ...@@ -482,6 +506,7 @@ export default {
page: this.page, page: this.page,
size: this.size, size: this.size,
name: `%${this.windowSearch}%`, name: `%${this.windowSearch}%`,
deptId: this.deptId,
...obj, ...obj,
}); });
let { code, data } = res.data; let { code, data } = res.data;
...@@ -509,12 +534,27 @@ export default { ...@@ -509,12 +534,27 @@ export default {
this.$refs.addwindow.onEdit(data); this.$refs.addwindow.onEdit(data);
}, },
// 删除窗口 // 删除窗口
async delWindow(num) { delWindow(num) {
let res = await delWindow({ id: num }); let _this = this;
let { code } = res.data; this.$confirm({
if (code === 1) { title: "系统提示",
this.getWindowListData(this.siteId); content: "删除不可恢复,确定要删除吗?",
} okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
async onOk() {
let res = await delWindow({ id: num });
let { code, msg } = res.data;
if (code === 1) {
_this.getWindowListData(_this.siteId);
_this.$message.success(msg);
}
},
onCancel() {
console.log("Cancel");
},
});
}, },
// 翻页 // 翻页
onPage(num) { onPage(num) {
...@@ -631,10 +671,7 @@ export default { ...@@ -631,10 +671,7 @@ export default {
border: 0; border: 0;
margin-right: 10px; margin-right: 10px;
} }
.department_off span {
margin-top: 5px;
margin-left: 15px;
}
.department_off:hover { .department_off:hover {
.department_icon_edit { .department_icon_edit {
display: block; display: block;
...@@ -649,13 +686,15 @@ export default { ...@@ -649,13 +686,15 @@ export default {
align-items: center; align-items: center;
} }
.department_icon_edit { .department_icon_edit {
margin-right: 20px;
display: none; display: none;
} }
.department_a { .department_a {
margin-left: 10px; width: 260px;
font-size: 17px; font-size: 17px;
font-weight: 500; font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.department_edit { .department_edit {
margin-right: 16px; margin-right: 16px;
...@@ -670,8 +709,7 @@ export default { ...@@ -670,8 +709,7 @@ export default {
} }
.department_off { .department_off {
// margin-left: 20px; // margin-left: 20px;
margin-top: 20px; padding: 20px 10px;
padding-bottom: 20px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
.department_tab { .department_tab {
...@@ -740,6 +778,9 @@ export default { ...@@ -740,6 +778,9 @@ export default {
flex: 1; flex: 1;
padding-bottom: 10px; padding-bottom: 10px;
overflow-y: auto; overflow-y: auto;
.active {
border-left: 2px solid #0595fd;
}
} }
} }
// .ant-form-item { // .ant-form-item {
......
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