@ -20,17 +20,17 @@
< a -col :span ="4" >
< div class = "headCol headColFirst" > 商品信息 < / div >
< / a - c o l >
< a -col :span ="2" >
< div class = "headCol" > 供应商来源方式 < / div >
< / a - c o l >
< a -col :span ="1" >
< div class = "headCol" > 平台 < / div >
< / a - c o l >
< a -col :span ="3" >
< div class = "headCol" > SKU名称 < / div >
< / a - c o l >
< a -col :span ="2" >
< div class = "headCol" > 采购链接 < / div >
< / a - c o l >
< a -col :span ="3" >
< div class = "headCol" > 供应商来源方式 < / div >
< div class = "headCol" > SKU名称 < / div >
< / a - c o l >
< a -col :span ="2" >
< div class = "headCol" > 采购价 < / div >
@ -41,6 +41,9 @@
< a -col :span ="2" >
< div class = "headCol" > 平台扣点 < / div >
< / a - c o l >
< a -col :span ="1" >
< div class = "headCol" > 利润 < / div >
< / a - c o l >
< a -col :span ="1" >
< div class = "headCol" > 利润率 < / div >
< / a - c o l >
@ -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 - c o l >
< a -col :span ="12" style = "text-align: right;" > { { item . Sales } } < / a - c o l >
@ -63,6 +68,14 @@
< / div >
< / div >
< / a - c o l >
<!-- 供应商来源方式 -- >
< 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 - c o l >
<!-- 平台 -- >
< 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 - c o l >
< 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 - c o l >
<!-- 采购链接 -- >
< 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 - c o l >
<!-- 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 - c o l >
<!-- 采购价 -- >
< 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 - c o l >
<!-- 快递费 -- >
< 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 - c o l >
<!-- 平台扣点 -- >
< 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 - c o l >
<!-- 利润 -- >
< 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 - c o l >
<!-- 利润率 -- >
< 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 - c o l >
< 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 - i n p u t >
< 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 - i n p u t >
< 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 - i n p u t >
< 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 - i n p u t >
< / 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 - c o l >
< a -col :span ="12" style = "text-align: right;" > { { item . RivalPLCount } } 人评论 < / a - c o l >
@ -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 - b u t t o n >
< a -button style = "margin-left: 10px;" type = "primary" @click ="setState(item.Id,2)" > 上架
< / a - b u t t o n >
< / a - c o l >
< 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 - b u t t o n >
< a -button style = "margin-right: 10px;" type = "primary" v -else
@ click = "setState(item.Id,3)" > 放弃 < / a - b u t t o n >
< a -button style = "margin-right: 10px;" type = "primary" v -if = " item.isEdit = = = false "
@ click = "editData(item)" > 编辑 < / a - b u t t o n >
< a -button style = "margin-right: 10px;" type = "primary" v -if = " item.isEdit = = = true "
@ click = "canelEdit(item)" > 取消 < / a - b u t t o n >
< a -button style = "margin-right: 10px;" type = "primary" v -if = " item.isEdit = = = true "
@ click = "setData(item)" > 保存 < / a - b u t t o n >
< / a - c o l >
< / a - r o w >
< / a - c o l >
@ -206,12 +238,21 @@
} ) . then ( res => {
res . Data . forEach ( item => {
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 )
{
editData ( data ) {
data . isEdit = true
this . lastEditData = JSON . parse ( JSON . stringify ( data ) )
} ,
@ -220,21 +261,30 @@
Object . assign ( data , this . lastEditData )
} ,
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 )
{
if ( res . Success ) {
this . $message . success ( '操作成功!' ) ;
data . isEdit = false
} else {
this . $message . error ( res . Msg ) ;
}
} )
} ,
setState ( id , type )
{
setState ( id , type ) {
this . http . post ( ` /HuiYan/teamitems/SetState?id= ${ id } &state= ${ type } ` ) . then ( res => {
if ( res . Success )
{
if ( res . Success ) {
this . $message . success ( '操作成功!' ) ;
this . getDatas ( this . currentTab )
} else {
@ -288,16 +338,16 @@
border - left : 0 px ;
border - bottom : 0 px ;
}
. itemtitle {
height : 50 px ;
max - height : 50 px ;
display : block ;
overflow : hidden ;
overflow : auto ;
}
. spanValue
{
. spanValue {
display : block ;
overflow : hidden ;
overflow : auto ;
}
< / style >