Browse Source

完善报表

master
guoxing 2 years ago
parent
commit
4da0436c70
  1. 24
      base-ui/src/api/supervise/thresholdanalysis.js
  2. 6
      base-ui/src/router/index.js
  3. 178
      base-ui/src/views/reportCenter/goodsOnWay.vue
  4. 127
      base-ui/src/views/reportCenter/salesReport.vue
  5. 301
      base-ui/src/views/risk/thresholdAnalysis.vue

24
base-ui/src/api/supervise/thresholdanalysis.js

@ -1,16 +1,20 @@
import request from '@/utils/request'
// 库房提供的采购订单
// 阀值分析
export default {
// 查询分页列表
listPage: function(params) {
initData(data) {
return request({
url: '/risk/getThresholdAnalysis',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
method: 'get',
params: data
})
}
},
initData2(data) {
return request({
url: '/reportCenter/getTest',
method: 'get',
params: data
})
},
}

6
base-ui/src/router/index.js

@ -209,6 +209,12 @@ export const constantRoutes = [
component: () => import('@/views/reportCenter/goodsOnWay.vue'),
name: 'goodsOnWay',
meta: {title: '在途商品管理表',noCache: true}
},
{
path: '/reportCenter/test',
component: () => import('@/views/reportCenter/test.vue'),
name: 'test',
meta: {titcle: '测试数据',noCache: true}
}
]
},

178
base-ui/src/views/reportCenter/goodsOnWay.vue

@ -29,10 +29,14 @@
<div class="current-data">
<div class="left">
<div style="display: flex;flex-direction: column;justify-content: center; margin-top: 30px;">
<span class="item"><span class="item_lift"></span>订单总额<span class="item_text">{{listGoodsOnWays.orderAmount}}</span></span>
<span class="item"><span class="item_lift"></span>实际到货价值<span class="item_text">{{listGoodsOnWays.arrivedGoodsValue}}</span></span>
<span class="item"><span class="item_lift"></span>在途货价值<span class="item_text">{{listGoodsOnWays.onWayGoodsValue}}</span></span>
<span class="item"><span class="item_lift"></span>超出价值<span class="item_text">{{listGoodsOnWays.exceedGoodsValue}}</span></span>
<span class="item"><span class="item_lift"></span>订单总额<span
class="item_text">{{listGoodsOnWays.orderAmount}}</span></span>
<span class="item"><span class="item_lift"></span>实际到货价值<span
class="item_text">{{listGoodsOnWays.arrivedGoodsValue}}</span></span>
<span class="item"><span class="item_lift"></span>在途货价值<span
class="item_text">{{listGoodsOnWays.onWayGoodsValue}}</span></span>
<span class="item"><span class="item_lift"></span>超出价值<span
class="item_text">{{listGoodsOnWays.exceedGoodsValue}}</span></span>
</div>
</div>
@ -97,131 +101,17 @@
date: "",
},
nowDate: new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate(),
listGoodsOnWays: {
orderAmount: "",
arrivedGoodsValue: "",
onWayGoodsValue: "",
exceedGoodsValue: "",
},
listArrivedEarlyWarning: [{
num: '1',
supplierName: '中粮可口可乐饮料(河北)有限公司',
allArrivedDate: '2022.12.29',
isDelay: '是'
},
{
num: '2',
supplierName: '中顺洁柔纸业股份有限公司',
allArrivedDate: '2022.12.27',
isDelay: '否'
},
{
num: '3',
supplierName: '今麦郎食品股份有限公司石家庄分公司',
allArrivedDate: '2022.12.23',
isDelay: '否'
},
{
num: '4',
supplierName: '农夫山泉股份有限公司',
allArrivedDate: '2022.12.25',
isDelay: '是'
},
{
num: '5',
supplierName: '北京百事可乐饮料有限公司',
allArrivedDate: '2022.12.12',
isDelay: '否'
},
{
num: '6',
supplierName: '今麦郎食品股份有限公司石家庄分公司',
allArrivedDate: '2022.12.02',
isDelay: '是'
},
{
num: '7',
supplierName: '农夫山泉股份有限公司',
allArrivedDate: '2022.12.09',
isDelay: '否'
},
{
num: '8',
supplierName: '北京百事可乐饮料有限公司',
allArrivedDate: '2022.12.20',
isDelay: '是'
},
],
analysisChartData: {
legend: {
top: 'bottom'
},
toolbox: {
show: true,
feature: {
mark: {
show: true
},
//
dataView: {
show: false,
readOnly: false
},
//
restore: {
show: false
},
//
saveAsImage: {
show: false
}
}
},
series: [{
name: 'Nightingale Chart',
type: 'pie',
radius: [30, 150],
center: ['50%', '50%'],
roseType: 'area',
itemStyle: {
borderRadius: 8
},
data: [{
"value": 2313123,
"name": "订单总额"
},
{
"value": 4359354,
"name": "实际到货价值"
},
{
"value": 2313123,
"name": "在途货价值"
},
{
"value": 2313123,
"name": "超出价值"
}
]
}]
}
listGoodsOnWays: {},
listArrivedEarlyWarning: [],
}
},
created() {
//
console.log('33333')
this.loadList()
},
// beforeDestroy() {
// if (this.myCharta) {
// this.myCharta.dispose()
// this.myCharta = null
// }
// },
mounted() {
//
this.$refs['btnbar'].setButtonList(this.btnList)
//
},
methods: {
//
@ -249,15 +139,14 @@
loadList() {
this.tableLoading = true
let _this = this
console.log('22222')
console.log('22222')
req.initData(_this.queryParams).then((resp) => {
if (resp.success) {
console.log('1111', resp.data)
const data = resp.data
_this.listGoodsOnWays = data.listGoodsOnWays
_this.listArrivedEarlyWarning = data.listArrivedEarlyWarning
_this.analysisChartData = data.analysisChartData
this.drawLine()
this.drawLine(data.analysisChartData)
this.tableLoading = false
} else {
@ -271,12 +160,49 @@
})
},
//
drawLine() {
drawLine(obj) {
// domecharts
var myChart = echarts.init(document.getElementById('main'));
//
console.log('option', this.analysisChartData)
myChart.setOption(this.analysisChartData);
console.log('option', obj)
myChart.setOption({
legend: {
top: 'bottom'
},
toolbox: {
show: true,
feature: {
mark: {
show: true
},
//
dataView: {
show: false,
readOnly: false
},
//
restore: {
show: false
},
//
saveAsImage: {
show: false
}
}
},
series: [{
name: 'Nightingale Chart',
type: 'pie',
radius: [30, 150],
center: ['50%', '50%'],
roseType: 'area',
itemStyle: {
borderRadius: 8
},
data: obj
}]
})
},
dosearch() {

127
base-ui/src/views/reportCenter/salesReport.vue

@ -56,35 +56,10 @@
<div id="main" style="width: 100%;height: 100%;min-height: 480px; margin-top: 30px;"></div>
<!-- </div> -->
</el-col>
</el-row>
</el-form>
</div>
<div style="display: flex; flex-direction: row;margin-top: 20px;width: 100%;">
<!-- <div style="width: 35%;">
<div class="tit">当日数据 {{nowDate}}</div>
<div style="margin-top: 30px;">
<el-table v-loading="tableLoading" :key="tableKey" :data="dataList" border style="width: 100%"
show-summary :summary-method="getSummaries">
<el-table-column prop="name" label="现金流量-经营活动产生的现金流量(元)" align="center" />
<el-table-column prop="totalPrice" label="总额" align="center" width="150" />
</el-table>
</div>
<div style="margin-top: 50px;">
<el-table v-loading="tableLoading" :data="listSalesChannelData" border style="width: 100%">
<el-table-column width="200" label="销售渠道类别" prop="salesChannelCategory" align="center" />
<el-table-column label="总额" prop="totalAmount" align="center" />
<el-table-column label="应收帐款" prop="accountsReceivable" align="center" />
<el-table-column label="扣除应收" prop="deductionAccountsReceivable" align="center" />
</el-table>
</div>
</div> -->
<div style="width: 65%;margin-left: 50px;margin-top: 20px;">
<div id="main" style="width: 800px; height: 500px;margin-top: 30px;"></div>
</div>
</div>
</div>
</div>
</div>
@ -113,40 +88,8 @@
searchxianshitit: '显示查询条件',
tableLoading: false,
tableKey: 0,
dataList: [{
name: '销售商品收到的现金(元)',
totalPrice: '10000'
},
{
name: '收到其他与经营活动有关的现金(元)',
totalPrice: '2000'
}
],
listSalesChannelData: [{
salesChannelCategory: '连网连锁店',
totalAmount: '2000000',
accountsReceivable: '31,914',
deductionAccountsReceivable: '35,793'
},
{
salesChannelCategory: '连锁内加盟',
totalAmount: '28,700',
accountsReceivable: '28,749',
deductionAccountsReceivable: '58,339'
},
{
salesChannelCategory: '配送中心',
totalAmount: '-1241.81',
accountsReceivable: '28,749',
deductionAccountsReceivable: '58,339'
},
{
salesChannelCategory: '连锁外加盟',
totalAmount: '29822.44',
accountsReceivable: '28,749',
deductionAccountsReceivable: '58,339'
}
],
dataList: [],
listSalesChannelData: [],
financialAnalysisChartData: {},
// 1.,2.3.
state_list: [{
@ -178,47 +121,17 @@
}
],
queryParams: {
customerSid: '',
customerSid: '',
date: "",
type: '' // key
},
nowDate: new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate(),
//
option: {
legend: {},
tooltip: {},
dataset: {
//
source: [
['product', '分销商进货额', '实际发货额'],
['1-1', "30816", '28700'],
['1-2', '20960', '15471'],
['1-3', 31465, 41573],
['1-4', 32796, 26290],
['1-5', 31914, 28749],
['1-6', 35793, 58339],
['1-7', 33370, 16888]
]
},
// X category dataset
xAxis: {
type: 'category'
},
// Y
yAxis: {},
// bar dataset
series: [{
type: 'bar'
}, {
type: 'bar'
}]
},
}
},
mounted() {
//
this.$refs['btnbar'].setButtonList(this.btnList)
// this.drawLine();
},
created() {
this.loadList()
@ -246,18 +159,19 @@
break
}
},
//
loadList() {
console.log('2222222')
this.tableLoading = true
let _this = this
req.initData(_this.queryParams).then((resp) => {
if (resp.success) {
console.log('1111', resp.data)
const data = resp.data
_this.dataList = data.financialData
_this.listSalesChannelData = data.listSalesChannelData
_this.financialAnalysisChartData = data.financialAnalysisChartData
_this.drawLine()
_this.drawLine(data.financialAnalysisChartData)
this.tableLoading = false
} else {
// resp.code
@ -270,12 +184,31 @@
})
},
//
drawLine() {
drawLine(obj) {
// domecharts
var myChart = echarts.init(document.getElementById('main'));
//
console.log('option', this.financialAnalysisChartData)
myChart.setOption(this.financialAnalysisChartData);
console.log('option', obj)
myChart.setOption({
legend: {},
tooltip: {},
dataset: {
//
source: obj
},
// X category dataset
xAxis: {
type: 'category'
},
// Y
yAxis: {},
// bar dataset
series: [{
type: 'bar'
}, {
type: 'bar'
}]
})
},
dosearch() {
@ -286,7 +219,7 @@
},
resetQuery() {
this.queryParams = {
customerSid: '',
customerSid: '',
date: "",
type: '' // key
}

301
base-ui/src/views/risk/thresholdAnalysis.vue

@ -2,7 +2,7 @@
<div class="app-container">
<div style="margin-left:16px;">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="在途商品管理表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<button-bar ref="btnbar" view-title="阀值分析" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
@ -29,9 +29,9 @@
</div>
</div>
<div id="main" style="width: 100%;height: 500px;min-height: 480px;margin-top: 30px;"></div>
<div id="main" style="width: 100%;height:100%;min-height: 480px;margin-top: 30px;"></div>
<div style="margin-top: 30px;">
<!-- <div style="margin-top: 30px;">
<el-table v-loading="tableLoading" :data="thresholdAnalysisTable" border style="width: 100%">
<el-table-column width="60" prop="num" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column prop="date" label="数据日期" align="center" />
@ -46,15 +46,16 @@
</div>
<!-- End 项目列表 -->
<div class="pages">
<!-- <div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="thresholdAnalysisTable.length > 0" :total="queryParams.total"
<!-- <pagination v-show="thresholdAnalysisTable.length > 0" :total="queryParams.total"
:page.sync="queryParams.current" :limit.sync="queryParams.size" @pagination="loadList" />
</div>
</div>
</div> -->
</div>
</div>
</div>
</div>
@ -112,141 +113,142 @@
}
],
queryParams: {
current: 1,
size: 5,
total: 0,
params: {
customerSid: '',
date: "",
type: '',
} // key
// current: 1,
// size: 5,
// total: 0,
// params: {
customerSid: '',
date: "",
type: '',
// } // key
},
nowDate: new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate(),
thresholdAnalysisTable: [{
num: '1',
date: '2023-01-01',
stockValue: '319314',
onWayGoodsValue: '3474943',
storeValue: '369546',
accountBalance: '435234',
accountsReceivable: '565234',
paymentAmount: '544632',
threshold: "454657"
}, {
num: '2',
date: '2023-01-02',
stockValue: '434577',
onWayGoodsValue: '324536',
storeValue: '8765234',
accountBalance: '876543',
accountsReceivable: '324365',
paymentAmount: '7238734',
threshold: "3454743"
}, {
num: '3',
date: '2023-01-03',
stockValue: '345467',
onWayGoodsValue: '634242',
storeValue: '2367364',
accountBalance: '734534',
accountsReceivable: '2356734',
paymentAmount: '743345',
threshold: "36345"
}, {
num: '4',
date: '2023-01-04',
stockValue: '435632',
onWayGoodsValue: '2455234',
storeValue: '32434523',
accountBalance: '2343523',
accountsReceivable: '565234',
paymentAmount: '234234',
threshold: "45676453"
}, {
num: '5',
date: '2023-01-05',
stockValue: '453423',
onWayGoodsValue: '1324354',
storeValue: '65342',
accountBalance: '13243',
accountsReceivable: '54342',
paymentAmount: '34323',
threshold: "3243424"
}],
analysisChartData: {
title: {
text: ''
},
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
initChart(obj) {
var _legend = []
var _xdata = obj.date
var _series = obj.series
var _ss = []
for (var i in _series) {
let objNum = _series[i];
let _key;
let _value;
Object.keys(objNum).forEach(key => {
_key = key;
_value = objNum[key];
})
_legend.push(
_key
)
if (i == 6)
//
_ss.push({
name: _key,
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function(value) {
return value + ' %';
}
},
data: _value
})
else
//
_ss.push({
name: _key,
type: 'bar',
tooltip: {
valueFormatter: function(value) {
return value + ' 万元';
}
},
data: _value
})
}
var myChart = echarts.init(document.getElementById('main'));
//
myChart.setOption({
tooltip: {
trigger: 'axis'
},
legend: {
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
toolbox: {
feature: {
dataView: {
//
show: false,
readOnly: false
},
magicType: {
//
show: false,
type: ['line', 'bar']
},
//
restore: {
show: false
},
//
saveAsImage: {
show:false
show: false
}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
legend: {
data: _legend
},
series: [{
name: 'Email',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'Union Ads',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'Video Ads',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'Direct',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 320]
xAxis: [{
type: 'category',
data: _xdata,
axisPointer: {
type: 'shadow'
}
}],
yAxis: [{
type: 'value',
name: '人民币',
min: 0,
max: 10000,
interval: 1000,
axisLabel: {
formatter: '{value} 万元'
}
},
{
name: 'Search Engine',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320]
type: 'value',
name: '百分比',
min: 0,
max: 100,
interval: 10,
axisLabel: {
formatter: '{value} %'
}
}
]
}
],
series: _ss
});
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
},
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
@ -258,13 +260,10 @@
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doDel':
this.doDel()
case 'build': //
this.doBuild()
break
case 'doClose':
case 'doClose': //
this.doClose()
break
default:
@ -274,21 +273,16 @@
loadList() {
this.tableLoading = true
let _this = this
req.listPage(_this.queryParams).then((resp) => {
req.initData(_this.queryParams).then((resp) => {
_this.tableLoading = false
if (resp.success) {
console.log('11111',resp.data)
console.log('11111', resp.data)
const data = resp.data
_this.queryParams.total = data.total
_this.thresholdAnalysisTable = data.thresholdAnalysisTable
_this.analysisChartData = data.analysisChartData
_this. drawLine()
_this.tableLoading = false
_this.tableLoading = false
this.initChart(resp.data)
} else {
// resp.code
_this.thresholdAnalysisTable = []
_this.analysisChartData = {}
_this.queryParams.total = 0
}
}).catch(() => {
_this.tableLoading = false
@ -300,15 +294,6 @@
var pageindex = index + 1 + pagestart
return pageindex
},
// 线
drawLine() {
// domecharts
var myChart = echarts.init(document.getElementById('main'));
//
console.log('option', this.analysisChartData)
myChart.setOption(this.analysisChartData);
},
dosearch() {
this.nowDate = this.queryParams.date;
@ -317,14 +302,14 @@
},
resetQuery() {
this.queryParams = {
current: 1,
size: 5,
total: 0,
params: {
customerSid: '',
date: '',
type: '',
}
// current: 1,
// size: 5,
// total: 0,
// params: {
customerSid: '',
date: '',
type: '',
// }
}
this.loadList()
},

Loading…
Cancel
Save