Authored by 姜敏

销售报表--点击skn加入搜索条件

<template>
<com-pageheader :title="'报表管理'" :sub-title="'商品销售报表'"></com-pageheader>
<com-tab :rows="tab.rows" :active.sync="tab.active"></com-tab>
<div v-show="tab.active==0">
<uc-sale></uc-sale>
... ... @@ -8,12 +9,14 @@
</div>
</template>
<script>
import pageheader from '../../../../components/pageheader/index';
import tab from '../../../../components/tab/index';
import ucRefund from './refundGoods';
import ucSale from './saleGoods';
export default {
components: {
comPageheader: pageheader,
comTab: tab,
ucSale:ucSale,
ucRefund:ucRefund
... ...
<template>
<div class="row" style="text-align: center">
<div class="dataModle0" v-for="row in rows">
<div class="dataModle" >
<div class="dataModle">
<p>{{row.name}}</p>
<h2>{{row.value}}</h2>
</div>
<div class="dataModle" >
<div class="dataModle">
<p>{{row.name1}}</p>
<h2 v-show="row.value1> 0"><b class="_red">↑&nbsp;&nbsp;{{row.value1}}%</b></h2>
<h2 v-show="row.value1< 0"><b class="_green">↓&nbsp;&nbsp;{{-row.value1}}%</b></h2>
<h2 v-show="row.value1== 0"><b class="_blue">--&nbsp;&nbsp;{{row.value1}}%</b></h2>
<h2 v-show="row.value1== 'no'"><b class="_blue">--</b></h2>
</div>
</div>
</div>
... ...
... ... @@ -42,10 +42,10 @@
},
data() {
return {
cards:[
{name:"退货总数",value:"0",name1:"环比",value1:"0"},
{name:"退货总金额(元)",value:"0",name1:"环比",value1:"0"},
{name:"退货率",value:"0",name1:"环比",value1:"0"}
cards: [
{name: "退货总数", value: "0", name1: "环比", value1: "0"},
{name: "退货总金额(元)", value: "0", name1: "环比", value1: "0"},
{name: "退货率", value: "0", name1: "环比", value1: "0"}
],
params: {
type: 1,
... ... @@ -57,7 +57,7 @@
productSku: "",
factoryCode: "",
sortId: "",
sortList:[]
sortList: []
},
grid: {
url: '/report/getReturnGoodsRptList',
... ... @@ -70,7 +70,7 @@
{
name: '', display: 'SKN/SKC/SKU', render: function (item) {
var htmlArr = [];
htmlArr.push('<p>SKN:' + item.productSkn + '</p>');
htmlArr.push('<p>SKN:<a class="productSkn" style="cursor:pointer">' + item.productSkn + '</a></p>');
htmlArr.push('<p>SKC:' + item.productSkc + '</p>');
htmlArr.push('<p>SKU:' + item.productSku + '</p>');
return htmlArr.join("");
... ... @@ -103,7 +103,13 @@
}
},
ready() {
this.submit();
var that = this;
that.submit();
$(document).on("click", ".productSkn", function () {
var skn = $(this).html();
that.params.productSkn = skn;
that.submit();
})
},
methods: {
submit() {
... ... @@ -115,7 +121,7 @@
//日报.月报,开始结束时间不传
this.params.beginTime = this.params.endTime = "";
}
if(this.params.sortList.length > 0){
if (this.params.sortList.length > 0) {
this.params.sortId = this.params.sortList[0].id;
}
var data = {
... ... @@ -136,18 +142,28 @@
time = time.split('-').join("")
}
return time;
},
checkRate(rate,value){
if (rate) {
value =rate
} else if (rate == 0) {
value = 0;
} else {
value = 'no';
}
return value;
}
},
events: {
complete(data){
let result = data.additionInfo;
if (result) {
this.cards[0].value = result.allNumber?result.allNumber:0;
this.cards[0].value1 = result.allNumberRate?result.allNumberRate:0;
this.cards[1].value = result.allAmount?result.allAmount:0;
this.cards[1].value1 = result.allAmountRate?result.allAmountRate:0;
this.cards[2].value = result.returnAmountRate?result.returnAmountRate+ "%":0;
this.cards[2].value1 = result.returnRingRate?result.returnRingRate:0;
this.cards[0].value = result.allNumber ? result.allNumber : 0;
this.cards[0].value1=this.checkRate(result.allNumberRate,this.cards[0].value1);
this.cards[1].value = result.allAmount ? result.allAmount : 0;
this.cards[1].value1=this.checkRate(result.allAmountRate,this.cards[1].value1);
this.cards[2].value = result.returnAmountRate ? result.returnAmountRate + "%" : 0;
this.cards[2].value1=this.checkRate(result.returnRingRate,this.cards[2].value1);
}
}
... ...
... ... @@ -56,7 +56,7 @@
productSku: "",
factoryCode: "",
sortId: "",
sortList:[]
sortList: []
},
grid: {
url: '/report/getOrdersGoodsRptList',
... ... @@ -69,7 +69,7 @@
{
name: 'SKN/SKC/SKU', display: 'SKN/SKC/SKU', render: function (item) {
var htmlArr = [];
htmlArr.push('<p>SKN:' + item.productSkn + '</p>');
htmlArr.push('<p>SKN:<a class="productSkn" style="cursor:pointer">' + item.productSkn + '</a></p>');
htmlArr.push('<p>SKC:' + item.productSkc + '</p>');
htmlArr.push('<p>SKU:' + item.productSku + '</p>');
return htmlArr.join("");
... ... @@ -102,7 +102,13 @@
}
},
ready() {
this.submit();
var that = this;
that.submit();
$(document).on("click", ".productSkn", function () {
var skn = $(this).html();
that.params.productSkn = skn;
that.submit();
})
},
methods: {
submit() {
... ... @@ -114,9 +120,9 @@
//月报,日报,开始结束时间不传
this.params.beginTime = this.params.endTime = "";
}
if(this.params.sortList.length > 0){
let length=this.params.sortList.length;
this.params.sortId = this.params.sortList[length-1].id;
if (this.params.sortList.length > 0) {
let length = this.params.sortList.length;
this.params.sortId = this.params.sortList[length - 1].id;
}
var data = {
type: this.params.type,
... ... @@ -136,6 +142,16 @@
time = time.split('-').join("")
}
return time;
},
checkRate(rate,value){
if (rate) {
value =rate
} else if (rate == 0) {
value = 0;
} else {
value = 'no';
}
return value;
}
},
events: {
... ... @@ -143,11 +159,10 @@
let result = data.additionInfo;
if (result) {
this.cards[0].value = result.allNumber ? result.allNumber : 0;
this.cards[0].value1 = result.allNumberRate ? result.allNumberRate : 0;
this.cards[0].value1=this.checkRate(result.allNumberRate,this.cards[0].value1);
this.cards[1].value = result.allAmount ? result.allAmount : 0;
this.cards[1].value1 = result.allAmountRate ? result.allAmountRate : 0;
this.cards[1].value1=this.checkRate(result.allAmountRate,this.cards[1].value1);
}
}
}
}
... ...
<template>
<com-pageheader :title="'报表管理'" :sub-title="'库存管理'"></com-pageheader>
<div class="contentpanel shopsReport">
<div class="panel">
<div class="panel-heading">
... ... @@ -31,6 +32,7 @@
<script>
import pageheader from '../../../../components/pageheader/index';
import grid from '../../../../components/grid/index';
import calendar from '../../../../components/calendar/index';
import card from './card';
... ... @@ -38,6 +40,7 @@
export default {
components: {
comPageheader: pageheader,
comGrid: grid,
ucCard: card,
ucFilter: filer
... ... @@ -100,9 +103,9 @@
reload()
{
if (this.params.sortList.length > 0) {
this.params.maxSortId = this.params.sortList[0]?this.params.sortList[0].id:"";
this.params.middleSortId = this.params.sortList[1]?this.params.sortList[1].id:"";
this.params.smallSortId = this.params.sortList[2]?this.params.sortList[2].id:"";
this.params.maxSortId = this.params.sortList[0] ? this.params.sortList[0].id : "";
this.params.middleSortId = this.params.sortList[1] ? this.params.sortList[1].id : "";
this.params.smallSortId = this.params.sortList[2] ? this.params.sortList[2].id : "";
}
this.$broadcast('grid-reload', this.params);
}
... ...
... ... @@ -20,7 +20,7 @@
<tbody>
<tr>
<td colspan="7" >
<span :class="{active:month===+m,disabled:isnot(m),month:'month'}" v-for="m in months" v-text="m" @click="selectMonth(m)"></span>
<span :class="{active1:month===+m,disabled:isnot(m),month:'month'}" v-for="m in months" v-text="m" @click="selectMonth(m)"></span>
</td>
</tr>
</tbody>
... ...
... ... @@ -97,10 +97,11 @@
this.$http.post(me.url, data).then(function (response) {
var res = response.data;
me.$dispatch('complete', res.data);
me.data = res.data.list;
me.rowsTotal = res.data.totalPage;
me.page = res.data.page
me.page = res.data.page;
me.$dispatch('complete', res.data);
},function (response) {
me.rowsTotal=0;
me.page=0;
... ...