Browse Source

按要求修改相关功能

master
С·æ 4 years ago
parent
commit
e24177824c
  1. 6
      src/Coldairarrow.Business/HuiYan/catsBusiness.cs
  2. 3
      src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs
  3. 41
      src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs
  4. 5
      src/Coldairarrow.Entity/DTO/TeamitemDto.cs
  5. 5
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs
  6. 7
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/assets/css/reset.less
  7. 23
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/cats/Index.vue
  8. 166
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue
  9. 1
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/css/app.90e0b2bc.css
  10. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/css/app.css
  11. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/index.html
  12. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js
  13. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js.map
  14. 2
      客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj

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

@ -254,6 +254,12 @@ namespace Coldairarrow.Business.HuiYan
public AjaxResult AddKeyWord(KeyWordDto model)
{
var has = GetIQueryable().Count(c => c.Name == model.KeyWord && c.TeamId == _operator.TeamId && c.Type == model.Type)>0;
if (has)
{
return Error("该品类词已存在!");
}
var cat = new cats()
{
Id = IdHelper.GetId(),

3
src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs

@ -159,6 +159,7 @@ namespace Coldairarrow.Business.HuiYan
break;
case 2:
label.IsAdded = true;
label.IsScreening = true;
break;
case 3:
label.IsCompeting = true;
@ -190,7 +191,9 @@ namespace Coldairarrow.Business.HuiYan
data.IsFilter = true;
break;
case 2:
//加入产品库同时也勾选筛选
data.IsAdded = true;
data.IsScreening = true;
break;
case 3:
data.IsCompeting = true;

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

@ -101,7 +101,6 @@ namespace Coldairarrow.Business.HuiYan
public AjaxResult AddItem(TeamitemDto model)
{
model.Extensions = new List<TeamItemExtension>();
for (int i = 0; i < 5; i++)
@ -185,6 +184,12 @@ namespace Coldairarrow.Business.HuiYan
public AjaxResult SetState(string id,int state)
{
//删除
if (state == 4)
{
return DeleteItem(id);
}
int row = Db.Update<teamitems>(c => c.Id == id, (item) => {
item.State = state;
});
@ -193,5 +198,39 @@ namespace Coldairarrow.Business.HuiYan
return Success();
return Error("操作失败!");
}
public AjaxResult DeleteItem(string id)
{
var titem = Db.GetIQueryable<teamitems>().FirstOrDefault(c => c.Id == id);
var result= Db.RunTransaction(() =>
{
var row = Db.Delete<teamitems>(c => c.Id == id);
if (row <= 0)
{
throw new Exception("操作失败!");
}
row = Db.Update<itemlabels>(c => c.ItemsId == titem.ItemId && c.TeamId == _operator.TeamId, (item) =>
{
//item.IsScreening = false;
item.IsAdded = false;
});
if (row <= 0)
{
throw new Exception("删除失败!");
}
});
if (result.Success)
{
return Success();
}
return Error();
}
}
}

5
src/Coldairarrow.Entity/DTO/TeamitemDto.cs

@ -67,6 +67,11 @@ namespace Coldairarrow.Entity.DTO
/// </summary>
public decimal PlatformPoint { get; set; }
/// <summary>
/// 利润
/// </summary>
public decimal Profit { get; set; }
/// <summary>
/// 利润率
/// </summary>

5
客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs

@ -378,12 +378,15 @@ namespace 齐越慧眼.UserControls
if (type == 3)
{
BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""bgYellow"">竞</div>')");
}
if (type == 0)
if (type == 0||type==2)
{
BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.myitemState').addClass(""trueBg"")");
}
BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")");
}

7
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/assets/css/reset.less

@ -41,3 +41,10 @@
{
background-color: unset;
}
#sonTree span.ant-tree-switcher, .ant-tree li span.ant-tree-iconEle{
background-color: red;
display: none;
width: 0px;
height: 0px;
}

23
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/cats/Index.vue

@ -46,10 +46,10 @@
</a-col>
</a-row>
</template>
<a-tree-node :class="'sonTree'">
<a-tree-node id="sonTree" :class="'sonTree'">
<template v-slot:title >
<div>
<a-card :bordered="false" style="width: 100%;">
<div :bordered="false" style="width: 100%;">
<a-row>
<a-col :span="3">
集团库
@ -62,22 +62,22 @@
</div>
</a-col>
</a-row>
</a-card>
</div>
<a-card style="margin-top: 10px;" :bordered="false">
<div style="margin-top: 10px;" :bordered="false">
<a-row>
<a-col :span="3">
团队库
</a-col>
<a-col :span="19">
<div style="margin-top: -5px;">
<a-tag style="cursor: pointer;float: left;margin-top: 5px;" :key="i4" @click="openKey(keyword,keyword.title,keyword.Id)" :color="keyword.IsShowTBTime?'gray':''"
<a-tag style="cursor: pointer;float: left;margin-top: 5px;" :key="i4" @click="openKey(keyword,keyword.title,keyword.Id)" :color="keyword.IsShowTBTime?'red':''"
v-for="(keyword,i4) in lastCat.children.filter(c=>c.Type==1)">
{{keyword.title}}</a-tag>
</div>
</a-col>
</a-row>
</a-card>
</div>
</div>
</template>
</a-tree-node>
@ -124,6 +124,7 @@
content: `新增类目词【${lastCat.newKey}】添加至哪个数据库?`,
okText: '团队库',
cancelText: '集团库',
closable:true,
onOk(e) {
that.http.post('/HuiYan/cats/AddPLKeyWord', { LastCat: lastCat.value, KeyWord: lastCat.newKey,Type:1 }).then(res => {
if (res.Success) {
@ -144,7 +145,11 @@
}
})
},
onCancel() {
onCancel(canel) {
if(canel.triggerCancel)
{
return
}
that.http.post('/HuiYan/cats/AddPLKeyWord', { LastCat: lastCat.value, KeyWord: lastCat.newKey,Type:0 }).then(res => {
if (res.Success) {
that.$message.success('添加成功!')
@ -158,7 +163,7 @@
Type:0,
value:res.Data
})
e()
canel()
} else {
that.$message.error('添加失败!')
}
@ -176,5 +181,7 @@
{
display: block;
min-width: 555px;
margin-top: -20px;
margin-bottom: -20px;
}
</style>

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

@ -20,17 +20,17 @@
<a-col :span="4">
<div class="headCol headColFirst">商品信息</div>
</a-col>
<a-col :span="2">
<div class="headCol">供应商来源方式</div>
</a-col>
<a-col :span="1">
<div class="headCol">平台</div>
</a-col>
<a-col :span="3">
<div class="headCol">SKU名称</div>
</a-col>
<a-col :span="2">
<div class="headCol">采购链接</div>
</a-col>
<a-col :span="3">
<div class="headCol">供应商来源方式</div>
<div class="headCol">SKU名称</div>
</a-col>
<a-col :span="2">
<div class="headCol">采购价</div>
@ -41,6 +41,9 @@
<a-col :span="2">
<div class="headCol">平台扣点</div>
</a-col>
<a-col :span="1">
<div class="headCol">利润</div>
</a-col>
<a-col :span="1">
<div class="headCol">利润率</div>
</a-col>
@ -54,8 +57,10 @@
<a-row justify="center" style="text-align: center;" v-for="item in datas" :key="item.Id">
<a-col :span="4">
<div class="borderRight">
<div style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 0px auto;height: 215px;">
<img :src="'http:'+item.ItemImg" width="200" height="165">
<div
style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 0px auto;height: 215px;">
<a target="_black" :href="'https://item.taobao.com/item.htm?id='+item.GoodsId"> <img
:src="'http:'+item.ItemImg" width="200" height="165" /></a>
<a-row>
<a-col :span="12" style="text-align: left;">¥{{item.Price}}</a-col>
<a-col :span="12" style="text-align: right;">{{item.Sales}}</a-col>
@ -63,6 +68,14 @@
</div>
</div>
</a-col>
<!--供应商来源方式-->
<a-col :span="2" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.SupplierFrom"></a-input>
<span class="spanValue" v-else>{{ext.SupplierFrom}}</span>
</div>
</a-col>
<!--平台-->
<a-col :span="1" style="margin-top: 5px;">
<div style="height: 40px;" v-for="(ext,index) in item.Extensions" :key="index">
<span v-if="ext.Platform==0">淘宝</span>
@ -70,63 +83,74 @@
<span v-if="ext.Platform==2">拼多多</span>
</div>
</a-col>
<a-col :span="3" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.SkuName"></a-input>
<span class="spanValue" v-else>{{ext.SkuName}}</span>
</div>
</a-col>
<!--采购链接-->
<a-col :span="2" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.BuyUrl"></a-input>
<span class="spanValue" v-else>{{ext.BuyUrl}}</span>
</div>
</a-col>
<!--SKU名称-->
<a-col :span="3" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.SupplierFrom"></a-input>
<span class="spanValue" v-else>{{ext.SupplierFrom}}</span>
<a-input v-if="item.isEdit" v-model="ext.SkuName"></a-input>
<span class="spanValue" v-else>{{ext.SkuName}}</span>
</div>
</a-col>
<!--采购价-->
<a-col :span="2" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.BuyPrice"></a-input>
<span class="spanValue" v-else>{{ext.BuyPrice}}</span>
</div>
</a-col>
<!--快递费-->
<a-col :span="2" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.KDPrice"></a-input>
<span class="spanValue" v-else>{{ext.KDPrice}}</span>
</div>
</a-col>
<!--平台扣点-->
<a-col :span="2" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.PlatformPoint"></a-input>
<span class="spanValue" v-else>{{ext.PlatformPoint}}</span>
<!-- <a-input v-if="item.isEdit" v-model="ext.PlatformPoint"></a-input>-->
<span class="spanValue">{{ext.PlatformPoint}}</span>
</div>
</a-col>
<!--利润-->
<a-col :span="1" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<span class="spanValue">{{ext.Profit}}</span>
</div>
</a-col>
<!--利润率-->
<a-col :span="1" style="margin-top: 5px;">
<div v-for="(ext,index) in item.Extensions" style="height: 40px;" :key="index">
<a-input v-if="item.isEdit" v-model="ext.Profits"></a-input>
<span class="spanValue" v-else>{{ext.Profits}}</span>
<!-- <a-input v-if="item.isEdit" v-model="ext.Profits"></a-input>-->
<span class="spanValue">{{ext.Profits}}%</span>
</div>
</a-col>
<a-col :span="4">
<div style="padding-top: 10px;padding-bottom: 10px;height: 215px;" class="borderLeft">
<div style="margin: 0px auto;width: 200px;">
<div v-if="item.isEdit">
<a-input style="margin-top: 10px;" v-model="item.RivalTitle" placeholder="请输入竞品标题"></a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalTitle" placeholder="请输入竞品标题">
</a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalPrice" placeholder="请输入竞品价格"></a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalPrice" placeholder="请输入竞品价格">
</a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalPLCount" placeholder="请输入竞品评论数"></a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalPLCount" placeholder="请输入竞品评论数">
</a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalGoodsId" placeholder="请输入竞品链接"></a-input>
<a-input style="margin-top: 10px;" v-model="item.RivalGoodsId" placeholder="请输入竞品链接">
</a-input>
</div>
<div v-else>
<div style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 5px auto;">
<img src="/jp.png" width="200" height="165">
<a target="_black" :href="'https://item.taobao.com/item.htm?id='+item.RivalGoodsId">
<img src="/jp.png" width="200" height="165" /></a>
<a-row>
<a-col :span="12" style="text-align: left;">¥{{item.RivalPrice}}</a-col>
<a-col :span="12" style="text-align: right;">{{item.RivalPLCount}}人评论</a-col>
@ -145,15 +169,23 @@
<a-col :span="16">
<a-row>
<a-col :span="12" style="text-align: left;">
<a-button style="margin-left: 10px;" type="primary" @click="setState(item.Id,1)">精选</a-button>
<a-button style="margin-left: 10px;" type="primary" @click="setState(item.Id,2)">上架</a-button>
<a-button style="margin-left: 10px;" type="primary" @click="setState(item.Id,1)">精选
</a-button>
<a-button style="margin-left: 10px;" type="primary" @click="setState(item.Id,2)">上架
</a-button>
</a-col>
<a-col :span="12" style="text-align: right;">
<a-button style="margin-right: 10px;" type="primary" @click="setState(item.Id,3)">放弃</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===false" @click="editData(item)">编辑</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true" @click="canelEdit(item)">取消</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true" @click="setData(item)">保存</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="currentTab==='3'"
@click="setState(item.Id,4)">删除</a-button>
<a-button style="margin-right: 10px;" type="primary" v-else
@click="setState(item.Id,3)">放弃</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===false"
@click="editData(item)">编辑</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true"
@click="canelEdit(item)">取消</a-button>
<a-button style="margin-right: 10px;" type="primary" v-if="item.isEdit===true"
@click="setData(item)">保存</a-button>
</a-col>
</a-row>
</a-col>
@ -183,17 +215,17 @@
loading: false,
queryParam: { condition: 'State', keyword: 0 },
selectedRowKeys: [],
currentTab:0,
lastEditData:undefined
currentTab: 0,
lastEditData: undefined
}
},
mounted() {
window.getDatas = this.getDatas
},
methods: {
changeTab(e){
changeTab(e) {
this.getDatas(e)
this.currentTab=e
this.currentTab = e
},
getDatas(type) {
this.http.post('/HuiYan/teamitems/GetItems', {
@ -205,39 +237,57 @@
...this.filters
}).then(res => {
res.Data.forEach(item => {
item.isEdit=false
item.isEdit = false
item.Extensions.forEach(ext => {
ext.PlatformPoint = item.RivalPrice * 0.05
ext.Profit = item.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint
if (ext.BuyPrice == 0) {
ext.Profits = 0
}
else {
ext.Profits =parseFloat(ext.Profit / ext.BuyPrice).toFixed(2)
}
})
});
this.datas = res.Data
})
},
editData(data)
{
data.isEdit=true
this.lastEditData=JSON.parse(JSON.stringify(data))
editData(data) {
data.isEdit = true
this.lastEditData = JSON.parse(JSON.stringify(data))
},
canelEdit(data){
this.lastEditData.isEdit=false
Object.assign(data,this.lastEditData)
canelEdit(data) {
this.lastEditData.isEdit = false
Object.assign(data, this.lastEditData)
},
setData(data){
this.http.post('/HuiYan/teamitems/SetItem', data).then(res=>{
if(res.Success)
{
setData(data) {
data.Extensions.forEach(ext => {
ext.PlatformPoint = data.RivalPrice * 0.05
ext.Profit = data.RivalPrice - ext.BuyPrice - ext.KDPrice - ext.PlatformPoint
if (ext.BuyPrice == 0) {
ext.Profits = 0
}
else {
ext.Profits = parseFloat(ext.Profit / ext.BuyPrice).toFixed(2)
}
})
this.http.post('/HuiYan/teamitems/SetItem', data).then(res => {
if (res.Success) {
this.$message.success('操作成功!');
data.isEdit=false
}else{
data.isEdit = false
} else {
this.$message.error(res.Msg);
}
})
},
setState(id,type)
{
this.http.post(`/HuiYan/teamitems/SetState?id=${id}&state=${type}`).then(res=>{
if(res.Success)
{
setState(id, type) {
this.http.post(`/HuiYan/teamitems/SetState?id=${id}&state=${type}`).then(res => {
if (res.Success) {
this.$message.success('操作成功!');
this.getDatas(this.currentTab)
}else{
} else {
this.$message.error(res.Msg);
}
})
@ -288,16 +338,16 @@
border-left: 0px;
border-bottom: 0px;
}
.itemtitle{
.itemtitle {
height: 50px;
max-height: 50px;
display: block;
overflow:hidden;
overflow: auto;
}
.spanValue
{
.spanValue {
display: block;
overflow:hidden;
overflow: auto;
}
</style>

1
客户端/齐越慧眼/齐越慧眼/vuepage/dist/css/app.90e0b2bc.css

File diff suppressed because one or more lines are too long

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/css/app.css

File diff suppressed because one or more lines are too long

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/index.html

@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>client</title><link href="/css/app.8a0133b1.css" rel="preload" as="style"><link href="/css/app.css" rel="preload" as="style"><link href="/css/chunk-vendors.09af4a6b.css" rel="preload" as="style"><link href="/css/chunk-vendors.css" rel="preload" as="style"><link href="/js/app.js" rel="preload" as="script"><link href="/js/chunk-vendors.js" rel="preload" as="script"><link href="/css/chunk-vendors.09af4a6b.css" rel="stylesheet"><link href="/css/chunk-vendors.css" rel="stylesheet"><link href="/css/app.8a0133b1.css" rel="stylesheet"><link href="/css/app.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.js"></script><script src="/js/app.js"></script></body></html>
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>client</title><link href="/css/app.90e0b2bc.css" rel="preload" as="style"><link href="/css/app.css" rel="preload" as="style"><link href="/css/chunk-vendors.09af4a6b.css" rel="preload" as="style"><link href="/css/chunk-vendors.css" rel="preload" as="style"><link href="/js/app.js" rel="preload" as="script"><link href="/js/chunk-vendors.js" rel="preload" as="script"><link href="/css/chunk-vendors.09af4a6b.css" rel="stylesheet"><link href="/css/chunk-vendors.css" rel="stylesheet"><link href="/css/app.90e0b2bc.css" rel="stylesheet"><link href="/css/app.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but client doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.js"></script><script src="/js/app.js"></script></body></html>

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js

File diff suppressed because one or more lines are too long

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js.map

File diff suppressed because one or more lines are too long

2
客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj

@ -41,6 +41,7 @@
<None Remove="vuepage\client\.gitignore" />
<None Remove="vuepage\client\.postcssrc.js" />
<None Remove="vuepage\dist\css\app.8a0133b1.css" />
<None Remove="vuepage\dist\css\app.90e0b2bc.css" />
<None Remove="vuepage\dist\css\app.aed7bccd.css" />
<None Remove="vuepage\dist\css\app.b0aefef5.css" />
<None Remove="vuepage\dist\css\app.css" />
@ -69,6 +70,7 @@
<ItemGroup>
<EmbeddedResource Include="vuepage\dist\css\app.8a0133b1.css" />
<EmbeddedResource Include="vuepage\dist\css\app.90e0b2bc.css" />
<EmbeddedResource Include="vuepage\dist\css\app.aed7bccd.css" />
<EmbeddedResource Include="vuepage\dist\css\app.css" />
<EmbeddedResource Include="vuepage\dist\css\chunk-vendors.09af4a6b.css" />

Loading…
Cancel
Save