From 33d8aac59a8bd18929779ca3baeabedcaa3a4984 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Sat, 2 Apr 2022 10:39:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../petrol-station-manage.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts index 5c92767..2f80e6e 100644 --- a/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts +++ b/src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.ts @@ -187,17 +187,16 @@ export class PetrolStationManageComponent implements OnInit { } this.assignOrgForm.value['storeList'] = storeList; this.tyAgentOilStationService.assignOrg(this.assignOrgForm.value, data => { + this.loadingObject.spinning = false; if (data['return_code'] === '000000') { this.modal.success({ nzTitle: '提示', nzContent: '分配成功', }); this.checkedData = []; - this.loadingObject.spinning = false; this.requestData(this.whereObject['pageNum']); this.closeAssignOrgModal(); } else { - this.loadingObject.spinning = false; this.modal.error({ nzTitle: '提示', nzContent: data['return_msg'], @@ -325,17 +324,16 @@ export class PetrolStationManageComponent implements OnInit { } this.assignAgentForm.value['oilStationList'] = storeList; this.tyAgentOilStationService.assignAgent(this.assignAgentForm.value, data => { + this.loadingObject.spinning = false; if (data['return_code'] === '000000') { this.modal.success({ nzTitle: '提示', nzContent: '分配成功', }); this.checkedData = []; - this.loadingObject.spinning = false; this.requestData(this.whereObject['pageNum']); this.closeAssignAgentModal(); } else { - this.loadingObject.spinning = false; this.modal.error({ nzTitle: '提示', nzContent: data['return_msg'], @@ -466,17 +464,16 @@ export class PetrolStationManageComponent implements OnInit { } this.assignSalesmanForm.value['oilStationList'] = oilStationList; this.tyAgentOilStationService.assignSalesman(this.assignSalesmanForm.value, data => { + this.loadingObject.spinning = false; if (data['return_code'] === '000000') { this.modal.success({ nzTitle: '提示', nzContent: '分配成功', }); this.checkedData = []; - this.loadingObject.spinning = false; this.requestData(this.whereObject['pageNum']); this.closeAssignSalesmanModal(); } else { - this.loadingObject.spinning = false; this.modal.error({ nzTitle: '提示', nzContent: data['return_msg'], @@ -606,7 +603,7 @@ export class PetrolStationManageComponent implements OnInit { if (checked === true) { const filterArray = this.dataObject['list'].filter(({ disabled }) => !disabled); for (const data of filterArray) { - if (this.checkedData.find(o => Number(o['id']) === Number(data['id'])) == null) { + if (this.checkedData.find(o => Number(o['storeId']) === Number(data['storeId'])) == null) { data['checked'] = true; this.checkedData.push(data); } @@ -615,7 +612,7 @@ export class PetrolStationManageComponent implements OnInit { const filterArray = this.dataObject['list'].filter(({ disabled }) => !disabled); for (const data of filterArray) { data['checked'] = false; - const findIndex = this.checkedData.findIndex(o => Number(o['id']) === Number(data['id'])); + const findIndex = this.checkedData.findIndex(o => Number(o['storeId']) === Number(data['storeId'])); this.checkedData.splice(findIndex, 1); } } @@ -628,13 +625,13 @@ export class PetrolStationManageComponent implements OnInit { */ checkedChange(data: object, checked: boolean) { if (checked === true) { - if (this.checkedData.find(o => Number(o['id']) === Number(data['id'])) == null) { + if (this.checkedData.find(o => Number(o['storeId']) === Number(data['storeId'])) == null) { data['checked'] = true; this.checkedData.push(data); } } else { data['checked'] = true; - const findIndex = this.checkedData.findIndex(o => Number(o['id']) === Number(data['id'])); + const findIndex = this.checkedData.findIndex(o => Number(o['storeId']) === Number(data['storeId'])); this.checkedData.splice(findIndex, 1); } }