|
@@ -32,6 +32,7 @@
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
|
:setIndex="setIndex"
|
|
:setIndex="setIndex"
|
|
|
@load="load"
|
|
@load="load"
|
|
|
|
|
+ @select="selectRow"
|
|
|
>
|
|
>
|
|
|
<template slot="customize">
|
|
<template slot="customize">
|
|
|
<el-button v-if="type !== 0" @click="exportSH" type="success">
|
|
<el-button v-if="type !== 0" @click="exportSH" type="success">
|
|
@@ -308,15 +309,21 @@ export default {
|
|
|
},
|
|
},
|
|
|
selectableStatus: true,
|
|
selectableStatus: true,
|
|
|
selectableFunc: (row, rowIndex) => {
|
|
selectableFunc: (row, rowIndex) => {
|
|
|
- if (
|
|
|
|
|
- row.roleId &&
|
|
|
|
|
- (this.$store.state.user.rolesId.includes(row.roleId) ||
|
|
|
|
|
- this.$store.state.user.rolesId.includes(1)) &&
|
|
|
|
|
- row.checkStatus === 0
|
|
|
|
|
- ) {
|
|
|
|
|
- return true;
|
|
|
|
|
|
|
+ if (row.oId) {
|
|
|
|
|
+ if (
|
|
|
|
|
+ row.roleId &&
|
|
|
|
|
+ (this.$store.state.user.rolesId.includes(row.roleId) ||
|
|
|
|
|
+ this.$store.state.user.rolesId.includes(1)) &&
|
|
|
|
|
+ row.checkStatus === 0
|
|
|
|
|
+ ) {
|
|
|
|
|
+ row.disabled = false;
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.disabled = true;
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- return false;
|
|
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -690,6 +697,7 @@ export default {
|
|
|
countInfo: {},
|
|
countInfo: {},
|
|
|
spanData: {},
|
|
spanData: {},
|
|
|
maps: new Map(),
|
|
maps: new Map(),
|
|
|
|
|
+ activeList: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -697,8 +705,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getRoles(roleId) {
|
|
getRoles(roleId) {
|
|
|
- if (this.$store.state.user.rolesId?.length > 0 &&
|
|
|
|
|
- this.$store.state.user.rolesId.includes(roleId) ||
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ (this.$store.state.user.rolesId?.length > 0 &&
|
|
|
|
|
+ this.$store.state.user.rolesId.includes(roleId)) ||
|
|
|
this.$store.state.user.rolesId.includes(1)
|
|
this.$store.state.user.rolesId.includes(1)
|
|
|
) {
|
|
) {
|
|
|
return false;
|
|
return false;
|
|
@@ -752,11 +761,11 @@ export default {
|
|
|
return a;
|
|
return a;
|
|
|
},
|
|
},
|
|
|
exportSH() {
|
|
exportSH() {
|
|
|
- if (this.$refs.tableList.allCheckData.length === 0) {
|
|
|
|
|
|
|
+ if (this.activeList.length === 0) {
|
|
|
this.$message.error("请勾选数据");
|
|
this.$message.error("请勾选数据");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.openDialog(this.$refs.tableList.allCheckData, 1);
|
|
|
|
|
|
|
+ this.openDialog(this.activeList, 1);
|
|
|
},
|
|
},
|
|
|
openDialog(data, type) {
|
|
openDialog(data, type) {
|
|
|
if (type === 1) {
|
|
if (type === 1) {
|
|
@@ -839,6 +848,8 @@ export default {
|
|
|
this.type == 2 ? e.divideSellerMoney : e.brokerage;
|
|
this.type == 2 ? e.divideSellerMoney : e.brokerage;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ tree.active = true;
|
|
|
|
|
+ tree.children = res.data;
|
|
|
resolve(res.data);
|
|
resolve(res.data);
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
@@ -857,6 +868,67 @@ export default {
|
|
|
this.load(tree, treeNode, resolve);
|
|
this.load(tree, treeNode, resolve);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ setChildren(children, type) {
|
|
|
|
|
+ // 编辑多个子层级
|
|
|
|
|
+ children.map((j) => {
|
|
|
|
|
+ this.toggleSelection(j, type);
|
|
|
|
|
+ if (j.children) {
|
|
|
|
|
+ this.setChildren(j.children, type);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 选中父节点时,子节点一起选中取消
|
|
|
|
|
+ async selectRow(selection, row) {
|
|
|
|
|
+ if (!row.oId && row.active !== true) {
|
|
|
|
|
+ row.active = true;
|
|
|
|
|
+ const index = this.tableData.findIndex((e) => e.id == row.id);
|
|
|
|
|
+ const box = document.querySelectorAll(".el-table__row--level-0")[index];
|
|
|
|
|
+ const btn = box.querySelector(".el-table__expand-icon");
|
|
|
|
|
+ btn.onclick = () => {
|
|
|
|
|
+ //
|
|
|
|
|
+ };
|
|
|
|
|
+ const event = new MouseEvent("click", {
|
|
|
|
|
+ view: window,
|
|
|
|
|
+ bubbles: true,
|
|
|
|
|
+ cancelable: true,
|
|
|
|
|
+ });
|
|
|
|
|
+ btn.dispatchEvent(event);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const hasSelect = selection.some((el) => {
|
|
|
|
|
+ return row.id === el.id;
|
|
|
|
|
+ });
|
|
|
|
|
+ if (hasSelect) {
|
|
|
|
|
+ if (row.children) {
|
|
|
|
|
+ // 解决子组件没有被勾选到
|
|
|
|
|
+ this.setChildren(row.children, true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.toggleSelection(row, true);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (row.children) {
|
|
|
|
|
+ this.setChildren(row.children, false);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.toggleSelection(row, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ toggleSelection(row, select) {
|
|
|
|
|
+ const table = this.$refs.tableList.$refs.pagerset;
|
|
|
|
|
+ if (row && row.disabled === false) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ if (select) {
|
|
|
|
|
+ if (this.activeList.findIndex((i) => i.id === row.id) === -1) {
|
|
|
|
|
+ this.activeList.push(row);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.activeList = this.activeList.filter((i) => i.id !== row.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ table.toggleRowSelection(row, select);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 切换已付待付
|
|
// 切换已付待付
|
|
|
backStatus({ row, column }) {
|
|
backStatus({ row, column }) {
|
|
|
let { payStatus, oId } = row;
|
|
let { payStatus, oId } = row;
|
|
@@ -901,6 +973,7 @@ export default {
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
|
|
+ this.activeList = [];
|
|
|
this.$refs.tableList.clearMoreActive();
|
|
this.$refs.tableList.clearMoreActive();
|
|
|
});
|
|
});
|
|
|
this.maps.forEach((value, id) => {
|
|
this.maps.forEach((value, id) => {
|
|
@@ -1018,6 +1091,10 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
+/deep/ .el-table__header .el-table__cell > .cell > .el-checkbox {
|
|
|
|
|
+ //找到表头那一行,然后把里面的复选框隐藏掉
|
|
|
|
|
+ display: none;
|
|
|
|
|
+}
|
|
|
.tip4,
|
|
.tip4,
|
|
|
.tip3 {
|
|
.tip3 {
|
|
|
white-space: normal;
|
|
white-space: normal;
|