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