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

fix:修改部门搜索

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