|
|
|
@ -15,7 +15,6 @@
|
|
|
|
待审批
|
|
|
|
待审批
|
|
|
|
</el-tag>
|
|
|
|
</el-tag>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -49,7 +48,7 @@
|
|
|
|
width: 54,
|
|
|
|
width: 54,
|
|
|
|
reserveSelection: true,
|
|
|
|
reserveSelection: true,
|
|
|
|
fixed: "left",
|
|
|
|
fixed: "left",
|
|
|
|
selectable: row => row.oa_ht_away_links ? false : true,
|
|
|
|
selectable: row => row.canSelect
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
prop: 'name',
|
|
|
|
prop: 'name',
|
|
|
|
@ -136,12 +135,22 @@
|
|
|
|
name: xingming_details,
|
|
|
|
name: xingming_details,
|
|
|
|
children: [],
|
|
|
|
children: [],
|
|
|
|
parent: null, // 添加父级字段
|
|
|
|
parent: null, // 添加父级字段
|
|
|
|
isSelect: false // 添加选中状态字段
|
|
|
|
isSelect: false ,// 添加选中状态字段
|
|
|
|
|
|
|
|
canSelect:true,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const innerData = originalData[xingming_details];
|
|
|
|
const innerData = originalData[xingming_details];
|
|
|
|
|
|
|
|
let count=0
|
|
|
|
innerData.map(item => {
|
|
|
|
innerData.map(item => {
|
|
|
|
item.isSelect = false
|
|
|
|
item.isSelect = false
|
|
|
|
})
|
|
|
|
item.canSelect = item.oa_ht_away_links?false:true
|
|
|
|
|
|
|
|
if(item.oa_ht_away_links){
|
|
|
|
|
|
|
|
count++
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
// 如果所有的都已完成了,则父级选择框不可选
|
|
|
|
|
|
|
|
if(count==innerData.length){
|
|
|
|
|
|
|
|
person.canSelect = false
|
|
|
|
|
|
|
|
}
|
|
|
|
person.children.push(...innerData)
|
|
|
|
person.children.push(...innerData)
|
|
|
|
// const source = {
|
|
|
|
// const source = {
|
|
|
|
// id: Math.random(),
|
|
|
|
// id: Math.random(),
|
|
|
|
@ -167,8 +176,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
splite(data, flag) {
|
|
|
|
splite(data, flag) {
|
|
|
|
data.forEach((row) => {
|
|
|
|
data.forEach((row) => {
|
|
|
|
this.$refs.awayTable.toggleRowSelection(row, flag)
|
|
|
|
if(row.canSelect){
|
|
|
|
|
|
|
|
this.$refs.awayTable.toggleRowSelection(row, flag)
|
|
|
|
|
|
|
|
}
|
|
|
|
if (row.children) {
|
|
|
|
if (row.children) {
|
|
|
|
this.splite(row.children, flag)
|
|
|
|
this.splite(row.children, flag)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -198,10 +209,12 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selectChildren(parent) {
|
|
|
|
selectChildren(parent) {
|
|
|
|
if (parent.children) {
|
|
|
|
if (parent.children) {
|
|
|
|
parent.children.forEach((child) => {
|
|
|
|
parent.children.forEach((child) => {
|
|
|
|
this.$refs.awayTable.toggleRowSelection(child, true); // 选中当前子级
|
|
|
|
if(child.canSelect){
|
|
|
|
// child.isSelect = true; // 更新子级的 isSelect 状态
|
|
|
|
this.$refs.awayTable.toggleRowSelection(child, true); // 选中当前子级
|
|
|
|
this.$set(child, 'isSelect', true)
|
|
|
|
// child.isSelect = true; // 更新子级的 isSelect 状态
|
|
|
|
|
|
|
|
this.$set(child, 'isSelect', true)
|
|
|
|
|
|
|
|
}
|
|
|
|
this.selectChildren(child); // 递归选中子级的子级
|
|
|
|
this.selectChildren(child); // 递归选中子级的子级
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -209,14 +222,18 @@
|
|
|
|
deselectChildren(parent, isSelect) {
|
|
|
|
deselectChildren(parent, isSelect) {
|
|
|
|
console.log("isSelect", isSelect, parent)
|
|
|
|
console.log("isSelect", isSelect, parent)
|
|
|
|
if (parent.children) {
|
|
|
|
if (parent.children) {
|
|
|
|
parent.children.forEach((child, index) => {
|
|
|
|
parent.children.forEach((child, index) => {
|
|
|
|
this.$refs.awayTable.toggleRowSelection(child, isSelect); // 取消选择当前子级
|
|
|
|
if(child.canSelect){
|
|
|
|
this.$set(child, 'isSelect', isSelect)
|
|
|
|
this.$refs.awayTable.toggleRowSelection(child, isSelect); // 取消选择当前子级
|
|
|
|
|
|
|
|
this.$set(child, 'isSelect', isSelect)
|
|
|
|
|
|
|
|
}
|
|
|
|
this.deselectChildren(child, isSelect); // 递归取消选择子级的子级
|
|
|
|
this.deselectChildren(child, isSelect); // 递归取消选择子级的子级
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.$refs.awayTable.toggleRowSelection(parent, isSelect);
|
|
|
|
if(parent.canSelect){
|
|
|
|
this.$set(parent, 'isSelect', isSelect)
|
|
|
|
this.$refs.awayTable.toggleRowSelection(parent, isSelect);
|
|
|
|
|
|
|
|
this.$set(parent, 'isSelect', isSelect)
|
|
|
|
|
|
|
|
}
|
|
|
|
console.log("parent", parent)
|
|
|
|
console.log("parent", parent)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -241,7 +258,7 @@
|
|
|
|
async confirm() {
|
|
|
|
async confirm() {
|
|
|
|
console.log("this.$refs['awayTable'].getSelection()", this.$refs['awayTable'].getSelection());
|
|
|
|
console.log("this.$refs['awayTable'].getSelection()", this.$refs['awayTable'].getSelection());
|
|
|
|
let flowsList = this.$refs['awayTable'].getSelection();
|
|
|
|
let flowsList = this.$refs['awayTable'].getSelection();
|
|
|
|
|
|
|
|
// return
|
|
|
|
let flow_id = [];
|
|
|
|
let flow_id = [];
|
|
|
|
let chuchai_pay_id = [];
|
|
|
|
let chuchai_pay_id = [];
|
|
|
|
let chuchai_pay_details = [];
|
|
|
|
let chuchai_pay_details = [];
|
|
|
|
|