Commit e2fc4887 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

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