diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js index 71de68a..ebaea7a 100644 --- a/src/stores/CustomerServices.js +++ b/src/stores/CustomerServices.js @@ -13,12 +13,13 @@ class CustomerServices { this.startDateString = this.startDate.format(config.DATE_FORMAT); this.endDateString = this.endDate.format(config.DATE_FORMAT) + '%2023:59'; this.dateType = 'startDate'; + this.inProgress = false; this.selectedAgent = {VendorName: '请选择地接社'}; makeAutoObservable(this); } fetchAgentList() { - + this.inProgress = true; req.fetchJSON(config.HT_HOST + '/service-web/QueryData/GetAgentGroupInfoALL?DateType=' + this.dateType + '&Date1=' + this.startDateString + '&Date2=' + this.endDateString + '&OldDate1=' + this.startDateString + '&OldDate2=' + this.endDateString) .then(json => { if (json.errcode === 0) { @@ -119,10 +120,14 @@ class CustomerServices { ]; }); } + }) + .then(() => { + this.inProgress = false; }); } fetchGroupListByAgentId(agentId) { + this.inProgress = true; this.selectedAgent = {VendorName: '...'}; this.groupList = []; this.groupListColumns = []; @@ -225,6 +230,9 @@ class CustomerServices { ]; }); } + }) + .then(() => { + this.inProgress = false; }); } @@ -250,6 +258,7 @@ class CustomerServices { endDateString; dateType; selectedAgent; + inProgress; groupList = []; diff --git a/src/views/AgentList.js b/src/views/AgentList.js index 7593c91..70d26da 100644 --- a/src/views/AgentList.js +++ b/src/views/AgentList.js @@ -12,10 +12,10 @@ import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; const AgentList = () => { - const { customerServicesStore } = useContext(stores_Context); + const {customerServicesStore} = useContext(stores_Context); const agentList = customerServicesStore.agentList; const agentListColumns = customerServicesStore.agentListColumns; - const { startDate, endDate, dateType } = customerServicesStore; + const {startDate, endDate, dateType, inProgress} = customerServicesStore; const handleSearchClick = () => { customerServicesStore.fetchAgentList(); @@ -57,7 +57,7 @@ const AgentList = () => {