4 changed files with 669 additions and 341 deletions
@ -1,151 +1,370 @@ |
|||||
<template> |
<template> |
||||
<div class="app-container"> |
<div class="app-container"> |
||||
<div style="margin-left: 16px;"> |
<div v-show="viewState == 1"> |
||||
<h3>{{ name }}</h3> |
<button-bar ref="btnbar" view-title="在途商品管理表" :btndisabled="btndisabled" @btnhandle="btnHandle" /> |
||||
</div> |
<div class="main-content"> |
||||
<div class = "current-data"> |
<div class="searchcon"> |
||||
<div class = "left"> |
<el-button size="small" class="searchbtn" @click="clicksearchShow"> |
||||
<div class="top"> |
{{ searchxianshitit }} |
||||
|
</el-button> |
||||
|
<div v-show="isSearchShow" class="search"> |
||||
|
<el-form ref="queryParams" :model="queryParams" :inline="true" class="tab-header"> |
||||
|
<el-form-item label="日期"> |
||||
|
<el-date-picker v-model="queryParams.date" type="date" clearable value-format="yyyy-MM-dd" |
||||
|
placeholder="选择日期" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div class="btn" style="text-align: center;"> |
||||
|
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button> |
||||
|
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div style="margin-top: 30px;"> |
||||
<span>当前数据</span> |
<span>当前数据</span> |
||||
<span>{{currentDate}}</span> |
<span style="margin-left: 10px;">{{nowDate}}</span> |
||||
</div> |
</div> |
||||
</div> |
|
||||
<div ref="charta" class ="middle"> |
|
||||
|
|
||||
|
<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> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
<div id="main" class="middle" style="margin-top: -40px;"> |
||||
|
|
||||
|
</div> |
||||
|
<div style="width: 50%;margin-left: 20px;margin-top: 30px;"> |
||||
|
<el-table v-loading="tableLoading" :data="listArrivedEarlyWarning" border style="width: 100%"> |
||||
|
<el-table-column width="60" label="序号" prop="num" align="center" /> |
||||
|
<el-table-column label="供应商名称" prop="supplierName" align="center" /> |
||||
|
<el-table-column width="120" label="到货日期" prop="allArrivedDate" align="center" /> |
||||
|
<el-table-column width="100" label="是否延期" prop="isDelay" align="center" /> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
</div> |
</div> |
||||
<div class ="right" /></div> |
|
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
|
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import * as echarts from 'echarts' |
import req from '@/api/supervise/goodsonway' |
||||
|
import ButtonBar from '@/components/ButtonBar' |
||||
|
import Pagination from '@/components/pagination' |
||||
|
import pageye from '@/components/pagination/pageye' |
||||
|
import * as echarts from 'echarts'; |
||||
|
|
||||
export default { |
export default { |
||||
name: '在途商品管理表', |
components: { |
||||
// components: { }, |
ButtonBar, |
||||
|
Pagination, |
||||
|
pageye |
||||
|
}, |
||||
data() { |
data() { |
||||
return { |
return { |
||||
currentDate:"2023-01-01", |
myCharta: null, |
||||
name: '在途商品管理表', |
btndisabled: false, |
||||
myCharta: null |
viewState: 1, // 1、列表 2、添加 3、修改 4、查看 |
||||
|
isSearchShow: false, |
||||
|
searchxianshitit: '显示查询条件', |
||||
|
tableLoading: false, |
||||
|
tableKey: 0, |
||||
|
btnList: [ // 右上角按钮 |
||||
|
{ |
||||
|
type: 'success', |
||||
|
size: 'small', |
||||
|
icon: 'export', |
||||
|
btnKey: 'build', |
||||
|
btnLabel: '导出' |
||||
|
}, |
||||
|
{ |
||||
|
type: 'info', |
||||
|
size: 'small', |
||||
|
icon: 'cross', |
||||
|
btnKey: 'doClose', |
||||
|
btnLabel: '关闭' |
||||
|
} |
||||
|
], |
||||
|
queryParams: { |
||||
|
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": "超出价值" |
||||
|
} |
||||
|
] |
||||
|
}] |
||||
|
} |
||||
} |
} |
||||
}, |
}, |
||||
created() { |
created() { |
||||
// 初始化变量 |
// 初始化变量 |
||||
// this.init() |
console.log('33333') |
||||
// 加载列表 |
this.loadList() |
||||
// this.getList() |
|
||||
}, |
|
||||
beforeDestroy() { |
|
||||
if (this.myCharta) { |
|
||||
this.myCharta.dispose() |
|
||||
this.myCharta = null |
|
||||
} |
|
||||
}, |
}, |
||||
|
// beforeDestroy() { |
||||
|
// if (this.myCharta) { |
||||
|
// this.myCharta.dispose() |
||||
|
// this.myCharta = null |
||||
|
// } |
||||
|
// }, |
||||
mounted() { |
mounted() { |
||||
this.$nextTick(() => { |
// 初始化按钮 |
||||
this.initCharta() |
this.$refs['btnbar'].setButtonList(this.btnList) |
||||
}) |
// |
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
initCharta() { |
// 搜索条件效果 |
||||
// 基于准备好的dom,初始化echarts实例 |
clicksearchShow() { |
||||
this.myCharta = echarts.init(this.$refs.charta) |
this.isSearchShow = !this.isSearchShow |
||||
this.myCharta.setOption( |
if (this.isSearchShow) { |
||||
{ |
this.searchxianshitit = '隐藏查询条件' |
||||
legend: { |
} else { |
||||
top: 'bottom' |
this.searchxianshitit = '显示查询条件' |
||||
}, |
} |
||||
toolbox: { |
}, |
||||
show: true, |
// 右上角点击事件 |
||||
feature: { |
btnHandle(btnKey) { |
||||
mark: { show: true }, |
switch (btnKey) { |
||||
dataView: { show: true, readOnly: false }, |
case 'build': // 导出 |
||||
restore: { show: true }, |
this.doBuild() |
||||
saveAsImage: { show: true } |
break |
||||
} |
case 'doClose': // 关闭 |
||||
}, |
this.doClose() |
||||
series: [ |
break |
||||
{ |
default: |
||||
name: 'Nightingale Chart', |
break |
||||
type: 'pie', |
} |
||||
radius: [50, 250], |
}, |
||||
center: ['50%', '50%'], |
loadList() { |
||||
roseType: 'area', |
this.tableLoading = true |
||||
itemStyle: { |
let _this = this |
||||
borderRadius: 8 |
console.log('22222') |
||||
}, |
req.initData(_this.queryParams).then((resp) => { |
||||
data:[ |
if (resp.success) { |
||||
{ |
console.log('1111', resp.data) |
||||
"value": 2313123, |
const data = resp.data |
||||
"name": "订单总额" |
_this.listGoodsOnWays = data.listGoodsOnWays |
||||
}, |
_this.listArrivedEarlyWarning = data.listArrivedEarlyWarning |
||||
{ |
_this.analysisChartData = data.analysisChartData |
||||
"value": 4359354, |
this.drawLine() |
||||
"name": "实际到货价值" |
this.tableLoading = false |
||||
}, |
|
||||
{ |
} else { |
||||
"value": 2313123, |
// 根据resp.code进行异常情况处理 |
||||
"name": "在途货价值" |
_this.dataList = [] |
||||
}, |
_this.listSalesChannelData = [] |
||||
{ |
|
||||
"value": 2313123, |
|
||||
"name": "超出价值" |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
] |
|
||||
} |
} |
||||
) |
}).catch(e => { |
||||
|
console.log('eeeee', e) |
||||
|
_this.tableLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
// 饼状图图初始化 |
||||
|
drawLine() { |
||||
|
// 基于准备好的dom,初始化echarts实例 |
||||
|
var myChart = echarts.init(document.getElementById('main')); |
||||
|
// 绘制图表 |
||||
|
console.log('option', this.analysisChartData) |
||||
|
myChart.setOption(this.analysisChartData); |
||||
|
}, |
||||
|
|
||||
|
dosearch() { |
||||
|
this.nowDate = this.queryParams.date; |
||||
|
this.loadList(); |
||||
|
|
||||
|
}, |
||||
|
resetQuery() { |
||||
|
this.queryParams = { |
||||
|
date: "", |
||||
|
} |
||||
|
this.loadList(); |
||||
|
}, |
||||
|
|
||||
|
// 导出 |
||||
|
doBuild() { |
||||
|
this.$message({ |
||||
|
showClose: true, |
||||
|
type: 'success', |
||||
|
message: '功能暂未完善...' |
||||
|
}) |
||||
}, |
}, |
||||
getList() {}, |
|
||||
// 返回 |
// 返回 |
||||
handleReturn() { |
doClose() { |
||||
|
this.$store.dispatch('tagsView/delView', this.$route) |
||||
this.$router.go(-1) |
this.$router.go(-1) |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
</script> |
</script> |
||||
|
|
||||
<style> |
<style> |
||||
.current-data{ |
.current-data { |
||||
width:100%; |
width: 100%; |
||||
height:500px; |
height: 500px; |
||||
display: flex; |
display: flex; |
||||
} |
} |
||||
.current-data .top{ |
|
||||
height:30px; |
.current-data .top { |
||||
line-height:30px; |
height: 30px; |
||||
width:100%; |
line-height: 30px; |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.current-data .left { |
||||
|
width: 250px; |
||||
|
height: 600px; |
||||
} |
} |
||||
.current-data .left{ |
|
||||
background-color: aqua; |
.item { |
||||
width:250px; |
margin-top: 35px; |
||||
height:600px; |
display: flex; |
||||
margin-left: 16px; |
align-items: center; |
||||
} |
} |
||||
|
|
||||
.current-data .middle{ |
.item_lift { |
||||
width:600px; |
margin-left: 10px; |
||||
height:600px; |
padding-right: 5px; |
||||
|
font-size: 30px; |
||||
|
color: blue; |
||||
|
} |
||||
|
|
||||
|
.item_text { |
||||
|
padding-left: 15px; |
||||
|
} |
||||
|
|
||||
|
.current-data .middle { |
||||
|
width: 500px; |
||||
|
height: 400px; |
||||
float: left; |
float: left; |
||||
margin-left: 10px; |
margin-left: 10px; |
||||
} |
} |
||||
|
|
||||
.current-data .right{ |
.current-data .right { |
||||
background-color: red; |
background-color: red; |
||||
width:700px; |
width: 700px; |
||||
height:600px; |
height: 600px; |
||||
float: left; |
float: left; |
||||
margin-left: 10px; |
margin-left: 10px; |
||||
|
|
||||
} |
} |
||||
.current-data .right .top{ |
|
||||
|
.current-data .right .top { |
||||
text-align: center; |
text-align: center; |
||||
} |
} |
||||
.current-data .right .charts{ |
|
||||
height:480px; |
.current-data .right .charts { |
||||
width:100%; |
height: 480px; |
||||
|
width: 100%; |
||||
} |
} |
||||
</style> |
</style> |
||||
|
Loading…
Reference in new issue