Browse Source

更新任务数量显示

master
feng 3 years ago
parent
commit
861bc810f9
  1. 3
      src/Coldairarrow.Api/Controllers/HuiYan/pricetasklogController.cs
  2. 6
      src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs
  3. 5
      src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs
  4. 2
      src/Coldairarrow.IBusiness/HuiYan/IpricetasklogBusiness.cs
  5. 20
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue
  6. 18
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/pricetask/Index.vue

3
src/Coldairarrow.Api/Controllers/HuiYan/pricetasklogController.cs

@ -155,5 +155,8 @@ namespace Coldairarrow.Api.Controllers.HuiYan
{
return _pricetasklogBus.AcceptTask(teamItemId);
}
}
}

6
src/Coldairarrow.Business/HuiYan/pricetasklogBusiness.cs

@ -75,9 +75,8 @@ namespace Coldairarrow.Business.HuiYan
public AjaxResult GetTaskCount()
{
var list = Db.GetIQueryable<pricetasklog>().Where(c => c.UserId == _operator.UserId).Select(c => c.State);
return Success(list);
var list = Db.GetIQueryable<pricetasklog>().Where(c => c.UserId == _operator.UserId).Select(c => c.State).ToList();
return Success(list.GroupBy(c => c).Select(c=>new {Id= c.Key,Count=c.Count() }));
}
@ -234,6 +233,7 @@ namespace Coldairarrow.Business.HuiYan
return Error(result.ex.Message);
}
public AjaxResult AcceptTask(string teamItemId)
{
var teamItem = Db.GetIQueryable<teamitems>().FirstOrDefault(c => c.Id == teamItemId);

5
src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs

@ -72,9 +72,8 @@ namespace Coldairarrow.Business.HuiYan
public AjaxResult GetTeamCount()
{
var list= Db.GetIQueryable<teamitems>().Where(c => c.TeamId == _operator.TeamId).Select(c => c.State);
return Success(list);
var list= Db.GetIQueryable<teamitems>().Where(c => c.TeamId == _operator.TeamId).Select(c => c.State).ToList();
return Success(list.GroupBy(c => c).Select(c => new { Id = c.Key, Count = c.Count() }));
}
public PageResult<TeamitemDto> GetItems(PageInput<ConditionDTO> input, string keyWord)

2
src/Coldairarrow.IBusiness/HuiYan/IpricetasklogBusiness.cs

@ -25,5 +25,7 @@ namespace Coldairarrow.Business.HuiYan
AjaxResult DayTaskSet();
AjaxResult AcceptTask(string teamItemId);
}
}

20
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue

@ -3,32 +3,32 @@
<a-tabs @change="changeTab">
<a-tab-pane
key="0"
:tab="'待比价(' + stateList.filter((c) => c == 0).length + ')'"
:tab="'待比价(' + getTaskCount(0) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="6"
:tab="'已比价(' + stateList.filter((c) => c == 6).length + ')'"
:tab="'已比价(' + getTaskCount(6) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="1"
:tab="'精选(' + stateList.filter((c) => c == 1).length + ')'"
:tab="'精选(' + getTaskCount(1) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="8"
:tab="'待上架(' + stateList.filter((c) => c == 8).length + ')'"
:tab="'待上架(' + getTaskCount(8) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="2"
:tab="'已上架(' + stateList.filter((c) => c == 2).length + ')'"
:tab="'已上架(' +getTaskCount(2) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="3"
:tab="'放弃(' + stateList.filter((c) => c == 3).length + ')'"
:tab="'放弃(' + getTaskCount(3) + ')'"
>
</a-tab-pane>
</a-tabs>
@ -603,6 +603,14 @@ export default {
this.stateList = res.Data;
});
},
getTaskCount(id){
var task= this.stateList.find(c=>c.Id==id)
if(task==null||task==undefined)
{
return 0
}
return task.Count
},
getImgPath(img) {
if (!img||img==undefined) return;

18
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/pricetask/Index.vue

@ -8,22 +8,22 @@
</a-tab-pane>
<a-tab-pane
key="0"
:tab="'待比价(' + stateList.filter((c) => c == 0).length + ')'"
:tab="'待比价(' + getTaskCount(0) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="1"
:tab="'已比价(' + stateList.filter((c) => c == 1).length + ')'"
:tab="'已比价(' + getTaskCount(1) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="2"
:tab="'待修改(' + stateList.filter((c) => c == 2).length + ')'"
:tab="'待修改(' + getTaskCount(2) + ')'"
>
</a-tab-pane>
<a-tab-pane
key="3"
:tab="'已完结(' + stateList.filter((c) => c == 3).length + ')'"
:tab="'已完结(' + getTaskCount(3) + ')'"
>
</a-tab-pane>
</a-tabs>
@ -561,9 +561,16 @@ export default {
getTabCount() {
this.http.get("/HuiYan/pricetasklog/GetTaskCount").then((res) => {
this.stateList = res.Data;
console.log(this.stateList);
});
},
getTaskCount(id){
var task= this.stateList.find(c=>c.Id==id)
if(task==null||task==undefined)
{
return 0
}
return task.Count
},
getImgPath(img) {
if (!img || img == undefined) return;
if (img.indexOf("http") >= 0) {
@ -597,6 +604,7 @@ export default {
this.getDatas(e);
this.currentTab = e;
this.pagination.current = 1;
this.getTabCount();
},
searchDatas() {
this.pagination.current = 1;

Loading…
Cancel
Save