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

pref:添加窗口关联大厅

parent 696f712d
...@@ -215,6 +215,7 @@ export default { ...@@ -215,6 +215,7 @@ export default {
let { code, msg } = res.data; let { code, msg } = res.data;
if (code == 1) { if (code == 1) {
_this.$message.success(msg); _this.$message.success(msg);
_this.selectedRowKeys = [];
_this.getHallList(); _this.getHallList();
} }
}, },
......
...@@ -105,7 +105,6 @@ export default { ...@@ -105,7 +105,6 @@ export default {
// 关闭弹窗 // 关闭弹窗
handleClose() { handleClose() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
console.log(this.form);
this.Visible = false; this.Visible = false;
}, },
// 保存 // 保存
...@@ -130,7 +129,7 @@ export default { ...@@ -130,7 +129,7 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-input-number { .ant-input-number {
width: 100%; width: 100%;
} }
......
...@@ -7,10 +7,28 @@ ...@@ -7,10 +7,28 @@
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button> <a-button type="danger" @click="handleDelAll"> 批量移除 </a-button>
<div class="business-control"> <div class="business-control">
<a-space> <a-space>
<a-select
style="min-width: 120px"
v-model="leftHallSearch"
showSearch
optionFilterProp="label"
>
<a-select-option value="" label="全部大厅">
全部大厅
</a-select-option>
<a-select-option
v-for="v in hallList"
:key="v.id"
:value="v.id"
:label="v.hallName"
>
{{ v.hallName }}
</a-select-option>
</a-select>
<a-input-search <a-input-search
placeholder="请输入窗口名称搜索" placeholder="请输入窗口名称搜索"
enter-button="搜索" enter-button="搜索"
v-model="serchSiteBusiness" v-model="leftSearchVal"
@search="onSearchLeft" @search="onSearchLeft"
allowClear allowClear
/> />
...@@ -37,39 +55,22 @@ ...@@ -37,39 +55,22 @@
onShowSizeChange: showSizeChange, onShowSizeChange: showSizeChange,
}" }"
:columns="leftColumns" :columns="leftColumns"
:expandIconColumnIndex="2" :data-source="hallWindowData"
:data-source="businessData"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedLeftRowKeys, selectedRowKeys: selectedLeftRowKeys,
onChange: onSelectChange, onChange: onSelectChange,
onSelect: onSelectLeftRow,
}" }"
:rowKey="(record) => record.id" :rowKey="(record) => record.id"
> >
<template <template slot="num" slot-scope="text, record, index">
slot="num"
v-if="record.parentId === 0"
slot-scope="text, record, index"
>
<span> <span>
{{ (leftCurrent - 1) * leftSize + index + 1 }} {{ (leftCurrent - 1) * leftSize + index + 1 }}
</span> </span>
</template> </template>
<template slot="businessName" slot-scope="text">
{{ text.businessName }}
</template>
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
<a-space size="middle"> <a href="javascript:;" class="delete" @click="handleDel(text.id)"
<a href="javascript:;" class="edit" @click="handleEdit(text)" >删除</a
>编辑</a >
>
<a
href="javascript:;"
class="delete"
@click="handleDel(text.id, text)"
>删除</a
>
</a-space>
</template> </template>
</a-table> </a-table>
</div> </div>
...@@ -80,16 +81,36 @@ ...@@ -80,16 +81,36 @@
<h3 class="titel">站点窗口</h3> <h3 class="titel">站点窗口</h3>
<div class="control"> <div class="control">
<div> <div>
<a-button type="primary" @click="handleAddAll"> 批量加入 </a-button> <!-- <a-button type="primary" @click="handleAddAll"> 批量加入 </a-button> -->
</div> </div>
<div class="business-control"> <div class="business-control">
<a-input-search <a-space>
placeholder="请输入窗口名称搜索" <a-select
enter-button="搜索" style="min-width: 120px"
v-model="serchData" v-model="deptSearch"
@search="onSearch" showSearch
allowClear optionFilterProp="label"
/> >
<a-select-option value="" label="全部部门">
全部部门
</a-select-option>
<a-select-option
v-for="v in deptList"
:key="v.id"
:value="v.id"
:label="v.name"
>
{{ v.name }}
</a-select-option>
</a-select>
<a-input-search
placeholder="请输入窗口编号搜索"
enter-button="搜索"
v-model="rightSearchVal"
@search="onSearch"
allowClear
/>
</a-space>
</div> </div>
</div> </div>
</div> </div>
...@@ -111,48 +132,42 @@ ...@@ -111,48 +132,42 @@
onShowSizeChange: showSizeChangeRight, onShowSizeChange: showSizeChangeRight,
}" }"
size="middle" size="middle"
:expandIconColumnIndex="2"
:row-selection="{ :row-selection="{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onRightSelectChange,
}" }"
:columns="rightColumns" :columns="rightColumns"
:data-source="businessDataList" :data-source="siteWindowData"
:rowKey="(record) => record.id" :rowKey="(record) => record.id"
> >
<template <template slot="num" slot-scope="text, record, index">
v-if="record.parentId === 0"
slot="num"
slot-scope="text, record, index"
>
<span> <span>
{{ (rightCurrent - 1) * rightSize + index + 1 }} {{ (rightCurrent - 1) * rightSize + index + 1 }}
</span> </span>
</template> </template>
<template slot="name" slot-scope="text">
{{ text.name }}
</template>
<template slot="action" slot-scope="text"> <template slot="action" slot-scope="text">
<a-space size="middle"> <a-space size="middle">
<a class="jion" @click="handleIn(text.id)">加入</a> <a class="jion" @click="handleIn(text)">加入大厅</a>
<a
href="javascript:;"
class="delete"
@click="handleDelRight(+text.id)"
>删除</a
>
</a-space> </a-space>
</template> </template>
</a-table> </a-table>
</div> </div>
</div> </div>
<!-- 添加大厅窗口 -->
<WindowToHall
ref="WindowToHall"
:addVisile.sync="visible"
:hallList="hallList"
@addSuccess="addSuccess"
></WindowToHall>
</div> </div>
</template> </template>
<script> <script>
import { getHallList } from "@/services/hall"; import { getHallList, getWindowHallList, delWindowHall } from "@/services/hall";
import WindowToHall from "./modal/WindowToHall.vue";
import local from "@/utils/local"; import local from "@/utils/local";
import { getDeptList, getSubHalllist } from "@/services/dept";
const leftColumns = [ const leftColumns = [
{ {
title: "序号", title: "序号",
...@@ -164,12 +179,12 @@ const leftColumns = [ ...@@ -164,12 +179,12 @@ const leftColumns = [
dataIndex: "windowName", dataIndex: "windowName",
}, },
{ {
title: "所属大厅", title: "窗口编号",
dataIndex: "hallName", dataIndex: "fromnum",
}, },
{ {
title: "创建时间", title: "所属大厅",
dataIndex: "createTime", dataIndex: "hallName",
}, },
{ {
title: "操作", title: "操作",
...@@ -209,12 +224,17 @@ const rightColumns = [ ...@@ -209,12 +224,17 @@ const rightColumns = [
]; ];
export default { export default {
components: {}, components: { WindowToHall },
data() { data() {
return { return {
leftColumns, leftColumns,
rightColumns, rightColumns,
hallList: [], // 大厅列表 hallList: [], // 大厅列表
deptList: [], // 部门列表
leftHallSearch: "",
deptSearch: "",
leftSearchVal: "",
rightSearchVal: "",
leftLoading: false, leftLoading: false,
rightLoading: false, rightLoading: false,
selectedRowKeys: [], selectedRowKeys: [],
...@@ -228,10 +248,15 @@ export default { ...@@ -228,10 +248,15 @@ export default {
rightSize: 10, rightSize: 10,
pageSizeOptions: ["10", "30", "50", "100"], pageSizeOptions: ["10", "30", "50", "100"],
siteId: local.getLocal("siteId"), // 站点id siteId: local.getLocal("siteId"), // 站点id
hallWindowData: [], // 大厅窗口数据
siteWindowData: [], // 站点窗口数据
}; };
}, },
created() { created() {
this.getHallList(); this.getHallList();
this.getDeptList();
this.getWindowHallList();
this.getSubHalllist();
}, },
methods: { methods: {
// 获取大厅列表 // 获取大厅列表
...@@ -244,17 +269,67 @@ export default { ...@@ -244,17 +269,67 @@ export default {
if (res.data.code == 1) { if (res.data.code == 1) {
let { data } = res.data.data; let { data } = res.data.data;
this.hallList = data; this.hallList = data;
console.log(data);
} }
}, },
// 获取部门列表
async getDeptList() {
let res = await getDeptList({
page: 1,
size: -1,
siteId: this.siteId,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.deptList = data;
}
},
// 获取大厅窗口列表
async getWindowHallList() {
this.leftLoading = true;
let res = await getWindowHallList({
page: this.leftCurrent,
size: this.leftSize,
siteId: this.siteId,
windowName: `%${this.leftSearchVal}%`,
hallId: this.leftHallSearch,
});
if (res.data.code == 1) {
let { data, total } = res.data.data;
if (!data.length && this.leftCurrent > 1) {
this.leftCurrent -= 1;
this.getWindowHallList();
}
this.hallWindowData = data;
this.leftTotal = total;
}
this.leftLoading = false;
},
// 获取站点差集窗口列表
async getSubHalllist() {
this.rightLoading = true;
let res = await getSubHalllist({
page: this.rightCurrent,
size: this.rightSize,
siteId: this.siteId,
fromnum: `%${this.rightSearchVal}%`,
deptId: this.deptSearch,
});
if (res.data.code == 1) {
let { data, total } = res.data.data;
this.siteWindowData = data;
this.rightTotal = total;
}
this.rightLoading = false;
},
// 左边搜索 // 左边搜索
onSearchLeft() { onSearchLeft() {
this.leftCurrent = 1; this.leftCurrent = 1;
this.selectedLeftRowKeys = [];
this.getWindowHallList();
}, },
// 删除 // 删除
handleDel() { handleDel(id) {
// let _this = this; let _this = this;
this.$confirm({ this.$confirm({
title: "系统提示", title: "系统提示",
content: "删除不可恢复,确定要删除吗?", content: "删除不可恢复,确定要删除吗?",
...@@ -264,78 +339,75 @@ export default { ...@@ -264,78 +339,75 @@ export default {
centered: true, centered: true,
icon: "exclamation-circle", icon: "exclamation-circle",
maskClosable: true, maskClosable: true,
async onOk() {}, async onOk() {
let res = await delWindowHall({ id });
let { code, msg } = res.data;
if (code == 1) {
_this.$message.success(msg);
_this.selectedLeftRowKeys = [];
_this.getWindowHallList();
_this.getSubHalllist();
}
},
onCancel() { onCancel() {
console.log("Cancel"); console.log("Cancel");
}, },
}); });
}, },
// 左边选中 // 左边选中
onSelectChange(key) { onSelectChange(key) {
this.selectedLeftRowKeys = key; this.selectedLeftRowKeys = key;
}, },
// 批量删除 // 批量删除
handleDelAll() { handleDelAll() {
if (this.deleteData.length <= 0) { if (!this.selectedLeftRowKeys.length) {
this.$message.warning("请先勾选数据"); this.$message.warning("请先勾选数据");
return; return;
} }
let ids = this.selectedLeftRowKeys.join(",");
this.handleDel(ids);
}, },
// 获取批量加入id // 获取批量加入id
onRightSelectChange(key) { onRightSelectChange(key) {
this.selectedRowKeys = key; this.selectedRowKeys = key;
}, },
// 批量加入
handleAddAll() {},
// 左翻页 // 左翻页
changeLeft(num) { changeLeft(cur) {
this.leftCurrent = num; this.leftCurrent = cur;
this.getWindowHallList();
}, },
// 左边改变每页显示数量 // 左边改变每页显示数量
showSizeChange(current, size) { showSizeChange(current, size) {
this.leftCurrent = current; this.leftCurrent = current;
this.leftSize = size; this.leftSize = size;
this.getWindowHallList();
}, },
// 右翻页 // 右翻页
changeRight(num) { changeRight(cur) {
this.rightCurrent = num; this.rightCurrent = cur;
this.getSubHalllist();
}, },
// 右边改变显示数量 // 右边改变显示数量
showSizeChangeRight(current, size) { showSizeChangeRight(current, size) {
this.rightCurrent = current; this.rightCurrent = current;
this.rightSize = size; this.rightSize = size;
this.getSubHalllist();
}, },
// 编辑
async handleEdit() {},
// 搜索 // 搜索
async onSearch() { async onSearch() {
this.rightCurrent = 1; this.rightCurrent = 1;
this.getSubHalllist();
}, },
// 加入 // 加入
async handleIn() { handleIn(row) {
if (!this.siteId) { this.$refs.WindowToHall.onAdd(row);
this.$message.warning("请先选择站点"); this.visible = true;
return;
}
}, },
// 删除-右 // 加入成功
handleDelRight() { addSuccess() {
this.$confirm({ this.getWindowHallList();
title: "系统提示", this.getSubHalllist();
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
icon: "exclamation-circle",
async onOk() {},
onCancel() {
console.log("Cancel");
},
});
}, },
}, },
}; };
......
<template>
<div>
<a-modal
v-model="Visible"
:maskClosable="false"
title="新增大厅窗口"
@cancel="handleClose"
destroyOnClose
centered
>
<template slot="footer">
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
<a-form-model
ref="form"
:model="form"
:rules="rules"
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<a-form-model-item label="所属大厅" prop="hallName">
<a-select
@change="handleChange"
labelInValue
placeholder="请选择所属大厅"
v-model="selectInfo"
>
<a-select-option v-for="v in hallList" :key="v.id" :value="v.id">
{{ v.hallName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveWindowHall } from "@/services/hall";
export default {
props: {
addVisile: {
type: Boolean,
require: true,
default: false,
},
hallList: {
type: Array,
require: true,
default: () => {
return [];
},
},
},
components: {},
data() {
return {
selectInfo: undefined,
form: {
windowId: "", // 窗口id
windowName: "", // 窗口名称
hallId: "", // 大厅id
hallName: "", // 大厅名称
// sort: "", // 排序
// remark: "", // 备注
},
rules: {
hallName: [
{ required: true, message: "请选择所属大厅", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisile;
},
set(val) {
this.$emit("update:addVisile", val);
},
},
},
methods: {
// 切换选择
handleChange(row) {
this.form.hallId = row.key;
this.form.hallName = row.label;
},
// 新增
onAdd(row) {
this.form.windowId = row.id;
this.form.windowName = row.name;
},
// 关闭弹窗
handleClose() {
this.selectInfo = undefined;
this.$refs.form.resetFields();
this.Visible = false;
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let res = await saveWindowHall(this.form);
let { code, msg } = res.data;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleClose();
}
}
});
},
// 重置
handleReset() {
this.selectInfo = undefined;
this.$refs.form.resetFields();
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
...@@ -149,35 +149,35 @@ const options = { ...@@ -149,35 +149,35 @@ const options = {
}, },
], ],
}, },
// { {
// path: "hall", path: "hall",
// name: "大厅管理", name: "大厅管理",
// meta: { meta: {
// icon: "gateway", icon: "gateway",
// }, },
// component: () => import("@/pages/basicset/hall/Hall"), component: () => import("@/pages/basicset/hall/Hall"),
// redirect: "/hall/hallmanage", redirect: "/hall/hallmanage",
// children: [ children: [
// { {
// path: "hallmanage", path: "hallmanage",
// name: "", name: "",
// component: () => component: () =>
// import("@/pages/basicset/hall/hallmanage/HallManage.vue"), import("@/pages/basicset/hall/hallmanage/HallManage.vue"),
// meta: { meta: {
// invisible: true, invisible: true,
// }, },
// }, },
// { {
// path: "hallwindow", path: "hallwindow",
// name: "大厅窗口管理", name: "大厅窗口管理",
// meta: { meta: {
// invisible: true, invisible: true,
// }, },
// component: () => component: () =>
// import("@/pages/basicset/hall/hallwindow/HallWindow.vue"), import("@/pages/basicset/hall/hallwindow/HallWindow.vue"),
// }, },
// ], ],
// }, },
{ {
path: "personnel", path: "personnel",
name: "工作人员管理", name: "工作人员管理",
......
...@@ -47,6 +47,10 @@ export async function addWindow(data) { ...@@ -47,6 +47,10 @@ export async function addWindow(data) {
export async function delWindow(data) { export async function delWindow(data) {
return request(window.delete, METHOD.GET, data); return request(window.delete, METHOD.GET, data);
} }
// 获取差集窗口列表
export async function getSubHalllist(data) {
return request(window.subList, METHOD.POST, data);
}
/** /**
* 窗口业务 * 窗口业务
......
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