-
This commit is contained in:
@ -443,16 +443,12 @@ export class TaxManagementIndividualDeclareComponent extends BasicTableComponent
|
|||||||
* @param e
|
* @param e
|
||||||
*/
|
*/
|
||||||
changeST(e: STChange): void {
|
changeST(e: STChange): void {
|
||||||
// console.log(e?.type);
|
|
||||||
if (e?.type === 'checkbox') {
|
if (e?.type === 'checkbox') {
|
||||||
if (e?.checkbox!.length === 0) {
|
if (e?.checkbox!.length === 0) {
|
||||||
// 全选取消
|
// 全选取消
|
||||||
this.st.list.forEach((item, index) => {
|
this.st.list.forEach((item, index) => {
|
||||||
|
|
||||||
this.st.setRow(index, { checked: false });
|
this.st.setRow(index, { checked: false });
|
||||||
|
|
||||||
})
|
})
|
||||||
// this.st.clearCheck();
|
|
||||||
this.checkedList = [];
|
this.checkedList = [];
|
||||||
} else {
|
} else {
|
||||||
// 取消选择
|
// 取消选择
|
||||||
@ -465,10 +461,9 @@ export class TaxManagementIndividualDeclareComponent extends BasicTableComponent
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
console.log(this.checkedList);
|
// 全选
|
||||||
console.log(e?.checkbox);
|
const allChecked = this.st?.list.every(item => item.checked);
|
||||||
// 增加选择
|
if (allChecked) {
|
||||||
if ((this.checkedList.length + 1) !== e?.checkbox!.length) {
|
|
||||||
this.st.list?.forEach((row, index) => {
|
this.st.list?.forEach((row, index) => {
|
||||||
const flag = this.checkedList.find(_item => _item.id === row?.id);
|
const flag = this.checkedList.find(_item => _item.id === row?.id);
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
@ -477,7 +472,9 @@ export class TaxManagementIndividualDeclareComponent extends BasicTableComponent
|
|||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e?.checkbox?.forEach(item => {
|
// 单个新增选择
|
||||||
|
const list = e?.checkbox?.filter(item => !this.checkedList.some(_item => _item?.id === item.id));
|
||||||
|
list?.forEach(item => {
|
||||||
this.st.list?.forEach((row, index) => {
|
this.st.list?.forEach((row, index) => {
|
||||||
if (row?.driverId === item?.driverId && row?.ltdId === item?.ltdId && row?.taxMonth === item?.taxMonth) {
|
if (row?.driverId === item?.driverId && row?.ltdId === item?.ltdId && row?.taxMonth === item?.taxMonth) {
|
||||||
this.st.setRow(index, { checked: true });
|
this.st.setRow(index, { checked: true });
|
||||||
@ -488,12 +485,8 @@ export class TaxManagementIndividualDeclareComponent extends BasicTableComponent
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if(e?.type === 'change'){
|
|
||||||
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user