Commit 424c44df authored by “yiyousong”'s avatar “yiyousong”

feat: 社保绑定事项添加批量绑定和事项列表差集显示

parent 95d052da
...@@ -20,6 +20,15 @@ export const getDeviceMatterList = (data) => { ...@@ -20,6 +20,15 @@ export const getDeviceMatterList = (data) => {
}; };
// 保存设备事项 // 保存设备事项
export const batchSaveDeviceMatter = (data) => {
return request({
url: `/sampleform/device/matter/datum/batchSave`,
method: "post",
data,
});
};
// 批量保存设备事项
export const saveDeviceMatter = (data) => { export const saveDeviceMatter = (data) => {
return request({ return request({
url: `/sampleform/device/matter/datum/save`, url: `/sampleform/device/matter/datum/save`,
......
...@@ -33,7 +33,7 @@ export const getMatterSubList = (data) => { ...@@ -33,7 +33,7 @@ export const getMatterSubList = (data) => {
}; };
// 查询样表系统事项列表 // 查询样表系统事项列表
export const getWriteMatterList = (data) => { export const getSampleformMatterList = (data) => {
return request({ return request({
url: `/sampleform/matter/list`, url: `/sampleform/matter/list`,
method: "post", method: "post",
......
...@@ -62,15 +62,11 @@ ...@@ -62,15 +62,11 @@
<div class="right"> <div class="right">
<div class="title mb20">选择事项</div> <div class="title mb20">选择事项</div>
<TableHeader> <TableHeader>
<!-- <div slot="left"> <div slot="left">
<el-button <el-button size="small" type="primary" @click="handleJoinAll"
size="small" >批量选择</el-button
plain
type="primary"
@click="handleJoinAll"
>批量加入</el-button
> >
</div> --> </div>
<div slot="right" class="flex"> <div slot="right" class="flex">
<el-select <el-select
v-model="department" v-model="department"
...@@ -122,13 +118,13 @@ ...@@ -122,13 +118,13 @@
:row-key="(row) => row.id" :row-key="(row) => row.id"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<!-- <el-table-column <el-table-column
type="selection" type="selection"
reserve-selection reserve-selection
width="40" width="40"
align="center" align="center"
> >
</el-table-column> --> </el-table-column>
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
...@@ -196,11 +192,12 @@ ...@@ -196,11 +192,12 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import TableHeader from "@/components/TableHeader.vue"; import TableHeader from "@/components/TableHeader.vue";
import Pagination from "@/components/Pagination.vue"; import Pagination from "@/components/Pagination.vue";
import { getWriteMatterList } from "@/api/matter"; import { getSampleformMatterList } from "@/api/matter";
import { import {
getDeviceMatterList, getDeviceMatterList,
saveDeviceMatter, saveDeviceMatter,
delDeviceMatter, delDeviceMatter,
batchSaveDeviceMatter,
} from "@/api/device"; } from "@/api/device";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
...@@ -230,6 +227,7 @@ export default { ...@@ -230,6 +227,7 @@ export default {
devMatterList: [], // 设备事项列表 devMatterList: [], // 设备事项列表
selectionKeys: [], selectionKeys: [],
devInfo: {}, devInfo: {},
devMatterIdList: [],
}; };
}, },
computed: { computed: {
...@@ -243,35 +241,48 @@ export default { ...@@ -243,35 +241,48 @@ export default {
}, },
...mapGetters(["deptList"]), ...mapGetters(["deptList"]),
}, },
watch: {
devMatterIdList: {
handler() {
this.getSampleformMatterList();
},
deep: true,
immediate: true,
},
},
created() {}, created() {},
methods: { methods: {
getDevInfo(row) { getDevInfo(row) {
this.devInfo = row; this.devInfo = row;
this.getWriteMatterList(); this.getDeviceMatterList();
this.getDeviceMatterList(row.id); // this.getSampleformMatterList();
}, },
// 获取设备事项列表 // 获取设备事项列表
async getDeviceMatterList(deviceId) { async getDeviceMatterList() {
let res = await getDeviceMatterList({ let res = await getDeviceMatterList({
page: 1, page: 1,
size: -1, size: -1,
siteId: this.siteId, siteId: this.siteId,
deviceId, deviceId: this.devInfo.id,
}); });
if (res.data.code == 1) { if (res.data.code == 1) {
let { data } = res.data.data; let { data } = res.data.data;
this.devMatterList = data; this.devMatterList = data.sort((a, b) => {
return b.isRecommend - a.isRecommend;
});
this.devMatterIdList = data.map((item) => item.matterId);
} }
}, },
// 获取填单系统事项列表 // 获取系统事项列表
async getWriteMatterList() { async getSampleformMatterList() {
this.loading = true; this.loading = true;
let res = await getWriteMatterList({ let res = await getSampleformMatterList({
page: this.current, page: this.current,
size: this.size, size: this.size,
matterFullName: `%${this.searchVal}%`, matterFullName: `%${this.searchVal}%`,
deptCode: this.department, deptCode: this.department,
siteId: this.siteId, siteId: this.siteId,
idNotList: this.devMatterIdList,
}); });
this.loading = false; this.loading = false;
if (res.data.code === 1) { if (res.data.code === 1) {
...@@ -285,7 +296,7 @@ export default { ...@@ -285,7 +296,7 @@ export default {
handleSearch() { handleSearch() {
this.current = 1; this.current = 1;
this.$refs.curTable.clearSelection(); this.$refs.curTable.clearSelection();
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 重置 // 重置
handleReset() { handleReset() {
...@@ -293,17 +304,17 @@ export default { ...@@ -293,17 +304,17 @@ export default {
this.searchVal = ""; this.searchVal = "";
this.current = 1; this.current = 1;
this.$refs.curTable.clearSelection(); this.$refs.curTable.clearSelection();
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 翻页 // 翻页
changePagination(cur) { changePagination(cur) {
this.current = cur; this.current = cur;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 改变每页显示数量 // 改变每页显示数量
changeSize(size) { changeSize(size) {
this.size = size; this.size = size;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 表格批量选中 // 表格批量选中
handleSelectionChange(select) { handleSelectionChange(select) {
...@@ -323,10 +334,11 @@ export default { ...@@ -323,10 +334,11 @@ export default {
sort: 0, sort: 0,
}; };
}); });
let res = await saveDeviceMatter(arr); let res = await batchSaveDeviceMatter(arr);
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.$refs.curTable.clearSelection();
this.getDeviceMatterList(); this.getDeviceMatterList();
} }
}, },
...@@ -343,7 +355,7 @@ export default { ...@@ -343,7 +355,7 @@ export default {
if (code == 1) { if (code == 1) {
this.$message.success(msg); this.$message.success(msg);
this.$refs.curTable.clearSelection(); this.$refs.curTable.clearSelection();
this.getDeviceMatterList(this.devInfo.id); this.getDeviceMatterList();
} }
}, },
// 切换推荐 // 切换推荐
...@@ -356,7 +368,7 @@ export default { ...@@ -356,7 +368,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.getDeviceMatterList(this.devInfo.id); this.getDeviceMatterList();
} }
}, },
// 删除设备事项 // 删除设备事项
...@@ -372,7 +384,7 @@ export default { ...@@ -372,7 +384,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.getDeviceMatterList(this.devInfo.id); this.getDeviceMatterList();
} }
}) })
.catch(() => { .catch(() => {
......
...@@ -316,7 +316,7 @@ import Pagination from "@/components/Pagination.vue"; ...@@ -316,7 +316,7 @@ import Pagination from "@/components/Pagination.vue";
import AddFolders from "./modal/AddFolders.vue"; import AddFolders from "./modal/AddFolders.vue";
import FolderList from "./modal/FolderList.vue"; import FolderList from "./modal/FolderList.vue";
import TabHeader from "@/components/TabHeader.vue"; import TabHeader from "@/components/TabHeader.vue";
import { getWriteMatterList } from "@/api/matter"; import { getSampleformMatterList } from "@/api/matter";
import { import {
getMaterialsList, getMaterialsList,
delMaterials, delMaterials,
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
}; };
}, },
created() { created() {
this.getWriteMatterList(); this.getSampleformMatterList();
this.getMaterialsList(); this.getMaterialsList();
}, },
computed: { computed: {
...@@ -377,9 +377,9 @@ export default { ...@@ -377,9 +377,9 @@ export default {
}, },
methods: { methods: {
// 系统事项列表 // 系统事项列表
async getWriteMatterList() { async getSampleformMatterList() {
this.loadingLeft = true; this.loadingLeft = true;
let res = await getWriteMatterList({ let res = await getSampleformMatterList({
page: this.leftCurrent, page: this.leftCurrent,
size: this.leftSize, size: this.leftSize,
matterFullName: `%${this.leftSearch}%`, matterFullName: `%${this.leftSearch}%`,
...@@ -420,14 +420,14 @@ export default { ...@@ -420,14 +420,14 @@ export default {
// 左边搜索 // 左边搜索
handleSearchLeft() { handleSearchLeft() {
this.leftCurrent = 1; this.leftCurrent = 1;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 左边重置 // 左边重置
leftReset() { leftReset() {
this.departmentLeft = ""; this.departmentLeft = "";
this.leftSearch = ""; this.leftSearch = "";
this.leftCurrent = 1; this.leftCurrent = 1;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 左边选择表格行 // 左边选择表格行
...@@ -448,13 +448,13 @@ export default { ...@@ -448,13 +448,13 @@ export default {
// 左边翻页 // 左边翻页
leftChangePagination(cur) { leftChangePagination(cur) {
this.leftCurrent = cur; this.leftCurrent = cur;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 左边改变每页显示数量 // 左边改变每页显示数量
leftChangeSize(size) { leftChangeSize(size) {
this.leftSize = size; this.leftSize = size;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 新增材料 // 新增材料
handleAddMaterial() { handleAddMaterial() {
...@@ -536,7 +536,7 @@ export default { ...@@ -536,7 +536,7 @@ export default {
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
this.getMaterialsList(); this.getMaterialsList();
this.getWriteMatterList(); this.getSampleformMatterList();
this.$refs.rightTable.clearSelection(); this.$refs.rightTable.clearSelection();
this.rightSelectedRowKeys = []; this.rightSelectedRowKeys = [];
} }
...@@ -557,7 +557,7 @@ export default { ...@@ -557,7 +557,7 @@ export default {
}, },
// 新增材料成功 // 新增材料成功
addSuccess() { addSuccess() {
this.getWriteMatterList(); this.getSampleformMatterList();
this.getMaterialsList(); this.getMaterialsList();
}, },
// 新增文件夹 // 新增文件夹
......
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
:addMatterVisible.sync="addMatterVisible" :addMatterVisible.sync="addMatterVisible"
:departmentList="deptList" :departmentList="deptList"
:title="title" :title="title"
@addMatter="getWriteMatterList" @addMatter="getSampleformMatterList"
></AddMatter> ></AddMatter>
</div> </div>
<!-- --> <!-- -->
...@@ -280,7 +280,7 @@ import { mapGetters } from "vuex"; ...@@ -280,7 +280,7 @@ import { mapGetters } from "vuex";
import { import {
// getMatterList, // getMatterList,
createMatter, createMatter,
getWriteMatterList, getSampleformMatterList,
delMatter, delMatter,
recommendMatter, recommendMatter,
getMatterSubList, getMatterSubList,
...@@ -321,7 +321,7 @@ export default { ...@@ -321,7 +321,7 @@ export default {
}, },
created() { created() {
this.getMatterSubList(); this.getMatterSubList();
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
computed: { computed: {
...mapGetters(["deptList"]), ...mapGetters(["deptList"]),
...@@ -347,9 +347,9 @@ export default { ...@@ -347,9 +347,9 @@ export default {
}, },
// 获取样表系统事项列表 // 获取样表系统事项列表
async getWriteMatterList() { async getSampleformMatterList() {
this.loadingLeft = true; this.loadingLeft = true;
let res = await getWriteMatterList({ let res = await getSampleformMatterList({
page: this.leftCurrent, page: this.leftCurrent,
size: this.leftSize, size: this.leftSize,
matterFullName: `%${this.leftSearch}%`, matterFullName: `%${this.leftSearch}%`,
...@@ -361,7 +361,7 @@ export default { ...@@ -361,7 +361,7 @@ export default {
let { data, total, recommendCount } = res.data.data; let { data, total, recommendCount } = res.data.data;
if (!data.length && this.leftCurrent > 1) { if (!data.length && this.leftCurrent > 1) {
this.leftCurrent -= 1; this.leftCurrent -= 1;
this.getWriteMatterList(); this.getSampleformMatterList();
} }
this.LeftTableData = data; this.LeftTableData = data;
this.leftTotal = total; this.leftTotal = total;
...@@ -391,7 +391,7 @@ export default { ...@@ -391,7 +391,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.getWriteMatterList(); this.getSampleformMatterList();
} }
}, },
// 批量删除 // 批量删除
...@@ -407,7 +407,7 @@ export default { ...@@ -407,7 +407,7 @@ export default {
searchLeft() { searchLeft() {
this.leftCurrent = 1; this.leftCurrent = 1;
this.$refs.leftTable.clearSelection(); this.$refs.leftTable.clearSelection();
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 左边重置 // 左边重置
leftReset() { leftReset() {
...@@ -415,7 +415,7 @@ export default { ...@@ -415,7 +415,7 @@ export default {
this.leftSearch = ""; this.leftSearch = "";
this.leftCurrent = 1; this.leftCurrent = 1;
this.$refs.leftTable.clearSelection(); this.$refs.leftTable.clearSelection();
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 左边勾选 // 左边勾选
handleSelectionChange(selection) { handleSelectionChange(selection) {
...@@ -424,12 +424,12 @@ export default { ...@@ -424,12 +424,12 @@ export default {
// 左边翻页 // 左边翻页
leftChangePagination(cur) { leftChangePagination(cur) {
this.leftCurrent = cur; this.leftCurrent = cur;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 左边改变每页显示数量 // 左边改变每页显示数量
leftChangeSize(size) { leftChangeSize(size) {
this.leftSize = size; this.leftSize = size;
this.getWriteMatterList(); this.getSampleformMatterList();
}, },
// 左边删除 // 左边删除
handleDel(id) { handleDel(id) {
...@@ -450,7 +450,7 @@ export default { ...@@ -450,7 +450,7 @@ export default {
this.$message.success(msg); this.$message.success(msg);
this.$refs.leftTable.clearSelection(); this.$refs.leftTable.clearSelection();
this.leftSelectedRowKeys = []; this.leftSelectedRowKeys = [];
this.getWriteMatterList(); this.getSampleformMatterList();
this.getMatterSubList(); this.getMatterSubList();
} }
}) })
...@@ -485,7 +485,7 @@ export default { ...@@ -485,7 +485,7 @@ export default {
this.rightSelectedRowKeys = []; this.rightSelectedRowKeys = [];
this.$refs.rightTable.clearSelection(); this.$refs.rightTable.clearSelection();
this.getMatterSubList(); this.getMatterSubList();
this.getWriteMatterList(); this.getSampleformMatterList();
} }
}, },
// 右边翻页 // 右边翻页
......
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