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

pref:添加窗口关联大厅

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