Browse Source

完善报表

master
guoxing 2 years ago
parent
commit
4da0436c70
  1. 20
      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

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

@ -1,16 +1,20 @@
import request from '@/utils/request' import request from '@/utils/request'
// 库房提供的采购订单 // 阀值分析
export default { export default {
initData(data) {
// 查询分页列表
listPage: function(params) {
return request({ return request({
url: '/risk/getThresholdAnalysis', url: '/risk/getThresholdAnalysis',
method: 'post', method: 'get',
data: params, params: data
headers: { 'Content-Type': 'application/json' }
}) })
} },
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'), component: () => import('@/views/reportCenter/goodsOnWay.vue'),
name: 'goodsOnWay', name: 'goodsOnWay',
meta: {title: '在途商品管理表',noCache: true} 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="current-data">
<div class="left"> <div class="left">
<div style="display: flex;flex-direction: column;justify-content: center; margin-top: 30px;"> <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
<span class="item"><span class="item_lift"></span>实际到货价值<span class="item_text">{{listGoodsOnWays.arrivedGoodsValue}}</span></span> class="item_text">{{listGoodsOnWays.orderAmount}}</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
<span class="item"><span class="item_lift"></span>超出价值<span class="item_text">{{listGoodsOnWays.exceedGoodsValue}}</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>
</div> </div>
@ -97,131 +101,17 @@
date: "", date: "",
}, },
nowDate: new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate(), nowDate: new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate(),
listGoodsOnWays: { listGoodsOnWays: {},
orderAmount: "", listArrivedEarlyWarning: [],
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": "超出价值"
}
]
}]
}
} }
}, },
created() { created() {
// //
console.log('33333')
this.loadList() this.loadList()
}, },
// beforeDestroy() {
// if (this.myCharta) {
// this.myCharta.dispose()
// this.myCharta = null
// }
// },
mounted() { mounted() {
// //
this.$refs['btnbar'].setButtonList(this.btnList) this.$refs['btnbar'].setButtonList(this.btnList)
//
}, },
methods: { methods: {
// //
@ -249,15 +139,14 @@
loadList() { loadList() {
this.tableLoading = true this.tableLoading = true
let _this = this let _this = this
console.log('22222') console.log('22222')
req.initData(_this.queryParams).then((resp) => { req.initData(_this.queryParams).then((resp) => {
if (resp.success) { if (resp.success) {
console.log('1111', resp.data) console.log('1111', resp.data)
const data = resp.data const data = resp.data
_this.listGoodsOnWays = data.listGoodsOnWays _this.listGoodsOnWays = data.listGoodsOnWays
_this.listArrivedEarlyWarning = data.listArrivedEarlyWarning _this.listArrivedEarlyWarning = data.listArrivedEarlyWarning
_this.analysisChartData = data.analysisChartData this.drawLine(data.analysisChartData)
this.drawLine()
this.tableLoading = false this.tableLoading = false
} else { } else {
@ -271,12 +160,49 @@
}) })
}, },
// //
drawLine() { drawLine(obj) {
// domecharts // domecharts
var myChart = echarts.init(document.getElementById('main')); var myChart = echarts.init(document.getElementById('main'));
// //
console.log('option', this.analysisChartData) console.log('option', obj)
myChart.setOption(this.analysisChartData); 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() { 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 id="main" style="width: 100%;height: 100%;min-height: 480px; margin-top: 30px;"></div>
<!-- </div> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </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> </div>
</div> </div>
@ -113,40 +88,8 @@
searchxianshitit: '显示查询条件', searchxianshitit: '显示查询条件',
tableLoading: false, tableLoading: false,
tableKey: 0, tableKey: 0,
dataList: [{ dataList: [],
name: '销售商品收到的现金(元)', listSalesChannelData: [],
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'
}
],
financialAnalysisChartData: {}, financialAnalysisChartData: {},
// 1.,2.3. // 1.,2.3.
state_list: [{ state_list: [{
@ -178,47 +121,17 @@
} }
], ],
queryParams: { queryParams: {
customerSid: '', customerSid: '',
date: "", date: "",
type: '' // key type: '' // key
}, },
nowDate: new Date().getFullYear() + "-" + (new Date().getMonth() + 1) + "-" + new Date().getDate(), 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() { mounted() {
// //
this.$refs['btnbar'].setButtonList(this.btnList) this.$refs['btnbar'].setButtonList(this.btnList)
// this.drawLine();
}, },
created() { created() {
this.loadList() this.loadList()
@ -246,18 +159,19 @@
break break
} }
}, },
//
loadList() { loadList() {
console.log('2222222') console.log('2222222')
this.tableLoading = true this.tableLoading = true
let _this = this let _this = this
req.initData(_this.queryParams).then((resp) => { req.initData(_this.queryParams).then((resp) => {
if (resp.success) { if (resp.success) {
console.log('1111', resp.data) console.log('1111', resp.data)
const data = resp.data const data = resp.data
_this.dataList = data.financialData _this.dataList = data.financialData
_this.listSalesChannelData = data.listSalesChannelData _this.listSalesChannelData = data.listSalesChannelData
_this.financialAnalysisChartData = data.financialAnalysisChartData _this.drawLine(data.financialAnalysisChartData)
_this.drawLine()
this.tableLoading = false this.tableLoading = false
} else { } else {
// resp.code // resp.code
@ -270,12 +184,31 @@
}) })
}, },
// //
drawLine() { drawLine(obj) {
// domecharts // domecharts
var myChart = echarts.init(document.getElementById('main')); var myChart = echarts.init(document.getElementById('main'));
// //
console.log('option', this.financialAnalysisChartData) console.log('option', obj)
myChart.setOption(this.financialAnalysisChartData); myChart.setOption({
legend: {},
tooltip: {},
dataset: {
//
source: obj
},
// X category dataset
xAxis: {
type: 'category'
},
// Y
yAxis: {},
// bar dataset
series: [{
type: 'bar'
}, {
type: 'bar'
}]
})
}, },
dosearch() { dosearch() {
@ -286,7 +219,7 @@
}, },
resetQuery() { resetQuery() {
this.queryParams = { this.queryParams = {
customerSid: '', customerSid: '',
date: "", date: "",
type: '' // key type: '' // key
} }

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

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

Loading…
Cancel
Save