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

perf: 优化窗口板块

parent ae1ef8cb
......@@ -114,19 +114,19 @@
}
// 带按钮搜索框
.search {
input {
font-size: @fz14;
color: #BFBFBF;
}
// .search {
// input {
// font-size: @fz14;
// color: #BFBFBF;
// }
.chaxun {
color: @clfff;
border: 1px solid #5ab6ff;
padding: 0 14px;
background: @addbg;
}
}
// .chaxun {
// color: @clfff;
// border: 1px solid #5ab6ff;
// padding: 0 14px;
// background: @addbg;
// }
// }
// 按钮
.btn {
......
......@@ -42,6 +42,17 @@
}"
@changePagination="getSiteBusinessData"
>
<!-- 序号 -->
<template slot="index" slot-scope="{ record, index }">
<span v-if="record.parentId === 0">
{{
(siteBusinessTable.page - 1) * siteBusinessTable.size +
index +
1
}}
</span>
</template>
<template slot="action" slot-scope="{ record }">
<a-space size="middle">
<span
......@@ -99,6 +110,13 @@
}"
@changePagination="getBusinessListData"
>
<!-- 序号 -->
<template slot="index" slot-scope="{ record, index }">
<span v-if="record.parentId === 0">
{{ (businessTable.page - 1) * businessTable.size + index + 1 }}
</span>
</template>
<template slot="action" slot-scope="{ record }">
<a-space size="middle">
<span class="primary pointer" @click="handleIn(record.id)"
......@@ -153,15 +171,8 @@ export default {
{
title: "序号",
width: "50px",
customRender: (text, record, index) => {
if (record.parentId === 0) {
return (
(this.siteBusinessTable.page - 1) *
this.siteBusinessTable.size +
index +
1
);
}
scopedSlots: {
customRender: "index",
},
},
{
......@@ -189,14 +200,8 @@ export default {
title: "序号",
key: "id",
width: "50px",
customRender: (text, record, index) => {
if (record.parentId === 0) {
return (
(this.businessTable.page - 1) * this.businessTable.size +
index +
1
);
}
scopedSlots: {
customRender: "index",
},
},
{
......
......@@ -71,6 +71,11 @@
}"
@changePagination="getMatterSiteData"
>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(siteMatterTable.page - 1) * siteMatterTable.size + index + 1
}}</template>
<!-- 事项名称 -->
<template slot="matterName" slot-scope="{ record }">
<a-tooltip placement="topLeft">
......@@ -188,6 +193,11 @@
}"
@changePagination="getMatterListData"
>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(baseMatterTable.page - 1) * baseMatterTable.size + index + 1
}}</template>
<!-- 事项名称 -->
<template slot="matterName" slot-scope="{ record }">
<a-tooltip placement="topLeft">
......@@ -280,12 +290,8 @@ export default {
{
title: "序号",
width: "50px",
customRender: (text, record, index) => {
return (
(this.siteMatterTable.page - 1) * this.siteMatterTable.size +
index +
1
);
scopedSlots: {
customRender: "index",
},
},
{
......@@ -332,12 +338,8 @@ export default {
{
title: "序号",
width: "50px",
customRender: (text, record, index) => {
return (
(this.baseMatterTable.page - 1) * this.baseMatterTable.size +
index +
1
);
scopedSlots: {
customRender: "index",
},
},
{
......
......@@ -36,6 +36,11 @@
}"
@changePagination="getBusinessMatterData"
>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(siteBusinessTable.page - 1) * siteBusinessTable.size + index + 1
}}</template>
<template slot="action" slot-scope="{ record }">
<a-space>
<span
......@@ -109,6 +114,11 @@
}"
@changePagination="getMatterSiteData"
>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(siteMatterTable.page - 1) * siteMatterTable.size + index + 1
}}</template>
<!-- 事项名称 -->
<template slot="matterName" slot-scope="{ record }">
<a-tooltip placement="topLeft">
......@@ -282,13 +292,8 @@ export default {
{
title: "序号",
width: "50px",
customRender: (text, record, index) => {
return (
(this.siteBusinessTable.page - 1) *
this.siteBusinessTable.size +
index +
1
);
scopedSlots: {
customRender: "index",
},
},
{
......@@ -321,12 +326,8 @@ export default {
{
title: "序号",
width: "50px",
customRender: (text, record, index) => {
return (
(this.siteMatterTable.page - 1) * this.siteMatterTable.size +
index +
1
);
scopedSlots: {
customRender: "index",
},
},
{
......
......@@ -77,6 +77,11 @@
}"
@changePagination="getMatterSiteData"
>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(searchForm.page - 1) * searchForm.size + index + 1
}}</template>
<!-- 事项名称 -->
<template slot="matterName" slot-scope="{ text }">
<a-tooltip placement="topLeft">
......@@ -168,10 +173,8 @@ export default {
{
title: "序号",
width: "50px",
customRender: (text, record, index) => {
return (
(this.searchForm.page - 1) * this.searchForm.size + index + 1
);
scopedSlots: {
customRender: "index",
},
},
{
......
......@@ -20,6 +20,7 @@
<a-input-search
placeholder="请输入事项名称搜索"
enter-button="搜索"
v-model="winMatterTable.searchForm.matterName"
allowClear
@search="onSearch"
/>
......@@ -28,62 +29,47 @@
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
bordered
:loading="isLoading"
<y-table
:columns="winMatterTable.columns"
:data="winMatterTable.data"
:pageSize.sync="winMatterTable.size"
:page.sync="winMatterTable.page"
:total="winMatterTable.total"
:loading="winMatterTable.loading"
:scroll="{ y: 500 }"
size="middle"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: Current,
total: total,
pageSize: size,
size: 'middle',
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: changePagination,
onShowSizeChange: showSizeChange,
}"
:columns="leftColumns"
:data-source="tableData"
:rowKey="(record) => record.id"
:row-selection="{ onChange: onSelectChange }"
@changePagination="getWindowmatterData"
>
<template slot="num" slot-scope="text, record, index">
<span>
{{ (Current - 1) * size + index + 1 }}
</span>
</template>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(winMatterTable.page - 1) * winMatterTable.size + index + 1
}}</template>
<!-- 排序 -->
<template slot="sort" slot-scope="text">
<span v-if="!text.isEdit">{{ text.sort }}</span>
<a-input v-else v-model="text.sort"></a-input>
<template slot="sort" slot-scope="{ record }">
<span v-if="!record.isEdit">{{ record.sort }}</span>
<a-input v-else v-model="record.sort"></a-input>
</template>
<!-- 是否显示 -->
<template slot="isShow" slot-scope="text">
<!-- <a-tag v-if="text.isShow" color="green"></a-tag>
<a-tag v-else color="red"></a-tag> -->
<y-switch v-model="text.isShow" :disabled="!text.isEdit"></y-switch>
<template slot="isShow" slot-scope="{ record }">
<y-switch
v-model="record.isShow"
:disabled="!record.isEdit"
></y-switch>
</template>
<template slot="action" slot-scope="text">
<template slot="action" slot-scope="{ record }">
<a-space size="middle">
<span
href="javascript:;"
class="pointer"
:class="text.isEdit ? 'edit' : 'primary'"
@click="handleEdit(text)"
>{{ text.isEdit ? "保存" : "编辑" }}</span
:class="record.isEdit ? 'edit' : 'primary'"
@click="handleEdit(record)"
>{{ record.isEdit ? "保存" : "编辑" }}</span
>
<span
href="javascript:;"
@click="handleDel(+text.id)"
class="delete pointer"
<span @click="handleDel(+record.id)" class="delete pointer"
>删除</span
>
</a-space>
</template>
</a-table>
</y-table>
</div>
</div>
<!-- 新增窗口事项 -->
......@@ -97,13 +83,6 @@
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="handleOk">确定</a-button>
</template>
<!-- <div class="form-isShow">
<span>是否显示:</span><y-switch v-model="formData.isShow"></y-switch>
</div>
<div class="form-isShow">
<span>排序:</span>
<a-input-number v-model="formData.sort" :min="0" />
</div> -->
<div class="color_title flex jcb">
<span>站点事项列表:</span>
<div>
......@@ -111,7 +90,7 @@
<a-select
style="width: 120px"
allowClear
v-model="source"
v-model="siteMatterTable.searchForm.source"
class="select-department"
placeholder="事项来源"
>
......@@ -124,48 +103,33 @@
enter-button="搜索"
allowClear
@search="onSearchMatter"
v-model="matterNameSearch"
v-model="siteMatterTable.searchForm.matterName"
/>
</a-space>
</div>
</div>
<div style="margin-top: 10px">
<a-table
bordered
:loading="matterLoading"
:scroll="{ y: 350 }"
<y-table
size="small"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: page,
pageSize: matterSize,
total: matterTotal,
size: 'small',
onChange: changeMatter,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onShowSizeChange: sizeChange,
}"
:columns="matterColumns"
:data-source="siteMatterData"
:rowKey="(record) => record.matterId"
:row-selection="{
selectedRowKeys: matterKeys,
onChange: handleChange,
}"
:columns="siteMatterTable.columns"
:data="siteMatterTable.data"
:pageSize.sync="siteMatterTable.size"
:page.sync="siteMatterTable.page"
:total="siteMatterTable.total"
:loading="siteMatterTable.loading"
:scroll="{ y: 500 }"
@changePagination="getSiteMatterData"
>
<template slot="num" slot-scope="text, record, index">
<span>
{{ (page - 1) * 10 + index + 1 }}
</span>
</template>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(siteMatterTable.page - 1) * siteMatterTable.size + index + 1
}}</template>
<!-- 来源 -->
<template slot="source" slot-scope="text">
<a-tag v-if="text.source == 0" color="green"> 一体化事项 </a-tag>
<template slot="source" slot-scope="{ text }">
<a-tag v-if="text == 0" color="green"> 一体化事项 </a-tag>
<a-tag v-else color="blue"> 自建事项 </a-tag>
</template>
</a-table>
</y-table>
</div>
</a-modal>
</div>
......@@ -173,7 +137,6 @@
<script>
import { getSiteMatterList } from "@/services/matter";
import { pageSizeOptions } from "@/config/pageConfig.js";
import {
saveWindowbatch,
getWindowmatterList,
......@@ -182,13 +145,32 @@ import {
} from "@/services/dept";
import YSwitch from "@/components/yswitch/YSwitch.vue";
import TabHeader from "@/components/TabHeader";
const leftColumns = [
import YTable from "@/components/YTable.vue";
export default {
components: {
YSwitch,
TabHeader,
YTable,
},
data() {
return {
visible: false,
modalTile: "新增窗口事项",
// 窗口事项表格
winMatterTable: {
page: 1,
size: 10,
total: 0,
data: [],
searchForm: {
matterName: "",
},
columns: [
{
title: "序号",
dataIndex: "id",
key: "id",
width: "6%",
scopedSlots: { customRender: "num" },
scopedSlots: { customRender: "index" },
},
{
title: "部门名称",
......@@ -221,13 +203,23 @@ const leftColumns = [
customRender: "action",
},
},
];
const matterColumns = [
],
},
// 站点事项表格
siteMatterTable: {
page: 1,
size: 10,
total: 0,
data: [],
searchForm: {
matterName: "",
source: undefined,
},
columns: [
{
title: "序号",
key: "id",
width: "10%",
scopedSlots: { customRender: "num" },
scopedSlots: { customRender: "index" },
},
{
title: "部门",
......@@ -241,46 +233,20 @@ const matterColumns = [
{
title: "来源",
width: "15%",
dataIndex: "source",
scopedSlots: { customRender: "source" },
},
];
export default {
components: {
YSwitch,
TabHeader,
],
},
data() {
return {
source: undefined,
leftColumns,
matterColumns,
visible: false,
isLoading: false,
modalTile: "新增窗口事项",
Current: 1,
size: 10,
total: 0,
pageSizeOptions,
tableData: [],
siteMatterData: [], // 站点事项列表
matterTotal: 0,
page: 1,
matterSize: 10,
matterLoading: false,
matterKeys: [],
matterRows: [],
matterNameSearch: "", // 事项名称搜索
allDel: "", // 批量删除id
windowInfo: {},
formData: {
isShow: 1,
sort: 0,
},
// rules: {
// siteMatterId: [
// { required: true, message: "事项不能为空", trigger: "change" },
// ],
// },
};
},
created() {
......@@ -307,57 +273,48 @@ export default {
},
// 获取站点事项
async getSiteMatterData() {
this.matterLoading = true;
this.siteMatterTable.loading = true;
let res = await getSiteMatterList({
page: this.page,
size: this.matterSize,
siteId: this.windowInfo.siteId,
matterName: `%${this.matterNameSearch}%`,
source: this.source,
// deptId: this.windowInfo.deptId,
matterName: `%${this.siteMatterTable.searchForm.matterName}%`,
source: this.siteMatterTable.searchForm.source,
});
if (res.data.code == 1) {
let { data, total } = res.data.data;
this.siteMatterData = data;
this.matterTotal = total;
this.matterLoading = false;
},
// 站点事项翻页
changeMatter(cur) {
this.page = cur;
this.getSiteMatterData();
},
// 站点事项改变每页显示数量
sizeChange(current, size) {
console.log(current, size);
this.page = current;
this.matterSize = size;
this.getSiteMatterData();
this.siteMatterTable.data = data;
this.siteMatterTable.total = total;
}
this.siteMatterTable.loading = false;
},
// 站点事项搜索
onSearchMatter() {
this.page = 1;
this.siteMatterTable.page = 1;
this.getSiteMatterData();
},
// 获取窗口事项列表
async getWindowmatterData(search = {}) {
this.isLoading = true;
async getWindowmatterData() {
this.winMatterTable.loading = true;
let res = await getWindowmatterList({
page: this.Current,
size: this.size,
page: this.winMatterTable.page,
size: this.winMatterTable.size,
windowId: this.$route.query.windowId,
...search,
matterName: `%${this.winMatterTable.searchForm.matterName}%`,
});
if (res.data.code == 1) {
let { total, data } = res.data.data;
if (!data.length && this.Current > 1) {
this.Current -= 1;
if (!data.length && this.winMatterTable.page > 1) {
this.winMatterTable.page -= 1;
this.getWindowmatterData();
}
data.forEach((v) => {
v.isEdit = false;
});
this.total = total;
this.tableData = data;
this.isLoading = false;
this.winMatterTable.total = total;
this.winMatterTable.data = data;
}
this.winMatterTable.loading = false;
},
// 打开新增窗口
addWindowMatter() {
......@@ -370,19 +327,8 @@ export default {
this.visible = true;
},
// 搜索
onSearch(val) {
this.Current = 1;
this.getWindowmatterData({ matterName: `%${val}%` });
},
// 翻页
changePagination(num) {
this.Current = num;
this.getWindowmatterData();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.Current = current;
this.size = size;
onSearch() {
this.winMatterTable.page = 1;
this.getWindowmatterData();
},
// 保存
......
......@@ -134,7 +134,7 @@ export default {
methods: {
// 获取窗口信息
async getWindowInfo(info) {
await this.siteBusinessList();
await this.getSiteBusinessList();
this.formData = info;
if (info.businessIds.length) {
this.rowKeys = info.businessIds;
......
......@@ -113,7 +113,7 @@
<a-input-search
placeholder="请输入窗口编号搜索"
v-model="windowSearch"
v-model="windowSearchForm.fromnum"
allowClear
enter-button="搜索"
style="width: 250px"
......@@ -124,30 +124,21 @@
<div class="department_right_tab">
<div class="table-content">
<!-- 表格 -->
<a-table
:scroll="{ y: 550 }"
:loading="loading"
bordered
<y-table
:columns="columns"
:data-source="windowData"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: page,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: onPage,
onShowSizeChange: showSizeChange,
}"
class="department_right_table"
:rowKey="(record) => record.id"
:data="windowData"
:pageSize.sync="windowSearchForm.size"
:page.sync="windowSearchForm.page"
:total="total"
:loading="loading"
:scroll="{ y: 550 }"
@changePagination="getWindowListData"
>
<a slot="name" slot-scope="text">{{ text }}</a>
<span slot="number" slot-scope="text, record, index">{{
(page - 1) * size + index + 1
}}</span>
<!-- 序号 -->
<template slot="index" slot-scope="{ index }">{{
(windowSearchForm.page - 1) * windowSearchForm.size + index + 1
}}</template>
<!-- 工作人员 -->
<template slot="workmanList" slot-scope="text">
<span v-if="text.workmanList && text.workmanList.length">{{
......@@ -155,40 +146,28 @@
}}</span>
<span v-else>--</span>
</template>
<!-- 所属楼栋 -->
<template slot="building" slot-scope="text">
<span>{{ text.building ? text.building + "" : "--" }}</span>
</template>
<!-- 所属楼层 -->
<template slot="level" slot-scope="text">
<span>{{ text.level ? text.level + "" : "--" }}</span>
</template>
<!-- 备注 -->
<template slot="summary" slot-scope="text">
<span>{{ text.summary ? text.summary : "--" }}</span>
</template>
<!-- 创建时间 -->
<template slot="createTime" slot-scope="text">
{{ text.createTime | dateFormat }}
<template slot="createTime" slot-scope="{ text }">
{{ text | dateFormat }}
</template>
<!-- 操作 -->
<div slot="action" slot-scope="text">
<div slot="action" slot-scope="{ record }">
<div class="flex jcb flexwrap">
<span class="primary pointer" @click="workModal(text)"
<span class="primary pointer" @click="workModal(record)"
>业务</span
>
<span class="primary pointer" @click="addWindowMatter(text)"
<span class="primary pointer" @click="addWindowMatter(record)"
>事项</span
>
<span class="primary pointer" @click="editModal(text)"
<span class="primary pointer" @click="editModal(record)"
>编辑</span
>
<span class="delete pointer" @click="delWindow(text.id)"
<span class="delete pointer" @click="delWindow(record.id)"
>删除</span
>
</div>
</div>
</a-table>
</y-table>
</div>
</div>
</div>
......@@ -219,11 +198,11 @@
<script>
import { Empty } from "ant-design-vue";
import { pageSizeOptions } from "@/config/pageConfig.js";
import adddepartment from "./components/adddepartment.vue";
import addwindow from "./components/addwindow.vue";
import addWindowBusiness from "./components/addWindowBusiness.vue";
import TabHeader from "@/components/TabHeader";
import YTable from "@/components/YTable.vue";
import local from "@/utils/local";
import { mapGetters } from "vuex";
import {
......@@ -240,14 +219,16 @@ export default {
addwindow,
addWindowBusiness,
TabHeader,
YTable,
},
data() {
const columns = [
return {
columns: [
{
title: "序号",
width: "6%",
scopedSlots: {
customRender: "number",
customRender: "index",
},
},
{
......@@ -258,20 +239,17 @@ export default {
{
title: "编号",
width: "10%",
customRender: (text) => {
return text.fromnum || "--";
},
dataIndex: "fromnum",
},
{
title: "所属部门",
width: "10%",
customRender: (text) => {
return text.deptName || "--";
},
dataIndex: "deptName",
},
{
title: "工作人员",
width: "10%",
dataIndex: "workmanList",
scopedSlots: {
customRender: "workmanList",
},
......@@ -279,26 +257,32 @@ export default {
{
title: "所属楼栋",
width: "6%",
scopedSlots: {
customRender: "building",
dataIndex: "building",
customRender: (text) => {
if (text) {
return text + "";
}
},
},
{
title: "所属楼层",
width: "6%",
scopedSlots: {
customRender: "level",
dataIndex: "level",
customRender: (text) => {
if (text) {
return text + "";
}
},
},
{
title: "备注",
ellipsis: true,
scopedSlots: {
customRender: "summary",
},
dataIndex: "summary",
},
{
title: "创建时间",
dataIndex: "createTime",
scopedSlots: {
customRender: "createTime",
},
......@@ -310,9 +294,7 @@ export default {
customRender: "action",
},
},
];
return {
spinning: false,
],
api: process.env.VUE_APP_API_BASE_URL + "/",
loading: false,
deptLoading: false,
......@@ -321,22 +303,24 @@ export default {
WindowTitle: "新增窗口",
siteId: local.getLocal("siteId"), // 站点id
business: [], // 站点业务数据
windowSearch: "", // 窗口搜索
// 窗口搜索
windowSearchForm: {
page: 1,
size: 10,
fromnum: "", // 窗口编号
deptId: "", // 部门id
},
deptSearchVal: "", // 部门搜索
deptId: "", // 部门搜索窗口
active: undefined, // 部门激活
// isRelevancy: false,
columns,
formVisible: false,
visibleWork: false,
visibleAdd: false,
department: [], // 部门列表
deptTotal: 0, // 部门总数
windowData: [], // 窗口列表数据
page: 1,
size: 10,
total: 0,
pageSizeOptions,
total: 0, // 窗口总数
// businessPage: 1, // 站点业务翻页
// businessTotal: 0, // 站点业务总数
rules: {
......@@ -347,6 +331,7 @@ export default {
};
},
filters: {
// 过滤展示最近登录用户
workmanList(arr) {
if (arr.length) {
let workerList = [...arr];
......@@ -401,13 +386,12 @@ export default {
});
},
// 获取部门列表
async getDeptListData(obj = {}) {
async getDeptListData() {
this.deptLoading = true;
let res = await getDeptList({
siteId: this.siteId,
page: 1,
size: -1,
...obj,
});
this.deptLoading = false;
let { code, data } = res.data;
......@@ -454,20 +438,20 @@ export default {
},
// 切换部门
changeDept(id, index) {
if (this.deptId === id) {
this.deptId = "";
if (this.windowSearchForm.deptId === id) {
this.windowSearchForm.deptId = "";
this.active = undefined;
this.page = 1;
this.windowSearchForm.page = 1;
this.getWindowListData();
} else {
this.deptId = id;
this.windowSearchForm.deptId = id;
this.active = index;
this.page = 1;
this.windowSearchForm.page = 1;
this.getWindowListData();
}
},
// 删除部门
delDepartment(num) {
delDepartment(id) {
let _this = this;
this.$confirm({
title: "系统提示",
......@@ -478,10 +462,10 @@ export default {
centered: true,
maskClosable: true,
async onOk() {
let res = await delDept({ id: num });
let res = await delDept({ id });
let { code, msg } = res.data;
if (code === 1) {
_this.getDeptListData(_this.siteId);
_this.getDeptListData();
_this.$message.success(msg);
}
},
......@@ -491,22 +475,23 @@ export default {
});
},
// 窗口列表
async getWindowListData(obj = {}) {
async getWindowListData() {
this.loading = true;
let res = await getWindowList({
siteId: this.siteId,
page: this.page,
size: this.size,
fromnum: `%${this.windowSearch}%`,
deptId: this.deptId,
...obj,
...this.windowSearchForm,
fromnum: `%${this.windowSearchForm.fromnum}%`,
});
let { code, data } = res.data;
if (code === 1) {
if (!data.data.length && this.windowSearchForm.page > 1) {
this.windowSearchForm.page -= 1;
this.getWindowListData();
}
this.total = data.pageInfo.totalResult;
this.windowData = data.data;
this.loading = false;
}
this.loading = false;
},
// 新增窗口
addModal() {
......@@ -525,7 +510,7 @@ export default {
this.$refs.addwindow.onEdit(data);
},
// 删除窗口
delWindow(num) {
delWindow(id) {
let _this = this;
this.$confirm({
title: "系统提示",
......@@ -536,10 +521,10 @@ export default {
centered: true,
maskClosable: true,
async onOk() {
let res = await delWindow({ id: num });
let res = await delWindow({ id });
let { code, msg } = res.data;
if (code === 1) {
_this.getWindowListData(_this.siteId);
_this.getWindowListData();
_this.$message.success(msg);
}
},
......@@ -548,40 +533,29 @@ export default {
},
});
},
// 翻页
onPage(num) {
this.page = num;
this.getWindowListData();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.page = current;
this.size = size;
this.getWindowListData();
},
// 左边搜索
// 部门搜索
onSearch(value) {
this.getDeptListData({ name: `%${value}%` });
},
// 右边搜索
// 窗口搜索
onSearchRight() {
this.page = 1;
this.windowSearchForm.page = 1;
this.getWindowListData();
},
// 窗口业务
workModal(data) {
let obj = {
let form = {
windowName: data.name,
windowId: data.id,
fromnum: data.fromnum,
};
if (data.windowBusinessList) {
obj.businessIds = data.windowBusinessList.map((v) => v.siteBusinessId);
form.businessIds = data.windowBusinessList.map((v) => v.siteBusinessId);
} else {
obj.businessIds = [];
form.businessIds = [];
}
this.visibleWork = true;
this.$refs.addWindowBusiness.getWindowInfo(obj);
this.$refs.addWindowBusiness.getWindowInfo(form);
},
// 重置业务窗口
......@@ -614,7 +588,7 @@ export default {
},
// 导入窗口
handleChange({ file }) {
this.spinning = true;
this.loading = true;
if (file.status === "done") {
let { code, msg } = file.response;
if (code == 1) {
......@@ -623,7 +597,7 @@ export default {
} else {
this.$message.error(msg);
}
this.spinning = false;
this.loading = false;
}
},
},
......
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