4 changed files with 669 additions and 341 deletions
@ -1,151 +1,370 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div style="margin-left: 16px;"> |
|||
<h3>{{ name }}</h3> |
|||
</div> |
|||
<div class = "current-data"> |
|||
<div class = "left"> |
|||
<div class="top"> |
|||
<div v-show="viewState == 1"> |
|||
<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"> |
|||
{{ 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>{{currentDate}}</span> |
|||
<span style="margin-left: 10px;">{{nowDate}}</span> |
|||
</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 class ="right" /></div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<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 { |
|||
name: '在途商品管理表', |
|||
// components: { }, |
|||
components: { |
|||
ButtonBar, |
|||
Pagination, |
|||
pageye |
|||
}, |
|||
data() { |
|||
return { |
|||
currentDate:"2023-01-01", |
|||
name: '在途商品管理表', |
|||
myCharta: null |
|||
myCharta: null, |
|||
btndisabled: false, |
|||
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() { |
|||
// 初始化变量 |
|||
// this.init() |
|||
// 加载列表 |
|||
// this.getList() |
|||
}, |
|||
beforeDestroy() { |
|||
if (this.myCharta) { |
|||
this.myCharta.dispose() |
|||
this.myCharta = null |
|||
} |
|||
console.log('33333') |
|||
this.loadList() |
|||
}, |
|||
// beforeDestroy() { |
|||
// if (this.myCharta) { |
|||
// this.myCharta.dispose() |
|||
// this.myCharta = null |
|||
// } |
|||
// }, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.initCharta() |
|||
}) |
|||
// 初始化按钮 |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
// |
|||
}, |
|||
methods: { |
|||
initCharta() { |
|||
// 基于准备好的dom,初始化echarts实例 |
|||
this.myCharta = echarts.init(this.$refs.charta) |
|||
this.myCharta.setOption( |
|||
{ |
|||
legend: { |
|||
top: 'bottom' |
|||
}, |
|||
toolbox: { |
|||
show: true, |
|||
feature: { |
|||
mark: { show: true }, |
|||
dataView: { show: true, readOnly: false }, |
|||
restore: { show: true }, |
|||
saveAsImage: { show: true } |
|||
} |
|||
}, |
|||
series: [ |
|||
{ |
|||
name: 'Nightingale Chart', |
|||
type: 'pie', |
|||
radius: [50, 250], |
|||
center: ['50%', '50%'], |
|||
roseType: 'area', |
|||
itemStyle: { |
|||
borderRadius: 8 |
|||
}, |
|||
data:[ |
|||
{ |
|||
"value": 2313123, |
|||
"name": "订单总额" |
|||
}, |
|||
{ |
|||
"value": 4359354, |
|||
"name": "实际到货价值" |
|||
}, |
|||
{ |
|||
"value": 2313123, |
|||
"name": "在途货价值" |
|||
}, |
|||
{ |
|||
"value": 2313123, |
|||
"name": "超出价值" |
|||
} |
|||
] |
|||
} |
|||
] |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 右上角点击事件 |
|||
btnHandle(btnKey) { |
|||
switch (btnKey) { |
|||
case 'build': // 导出 |
|||
this.doBuild() |
|||
break |
|||
case 'doClose': // 关闭 |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
loadList() { |
|||
this.tableLoading = true |
|||
let _this = this |
|||
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.tableLoading = false |
|||
|
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
_this.dataList = [] |
|||
_this.listSalesChannelData = [] |
|||
} |
|||
) |
|||
}).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) |
|||
} |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style> |
|||
.current-data{ |
|||
width:100%; |
|||
height:500px; |
|||
.current-data { |
|||
width: 100%; |
|||
height: 500px; |
|||
display: flex; |
|||
} |
|||
.current-data .top{ |
|||
height:30px; |
|||
line-height:30px; |
|||
width:100%; |
|||
|
|||
.current-data .top { |
|||
height: 30px; |
|||
line-height: 30px; |
|||
width: 100%; |
|||
} |
|||
|
|||
.current-data .left { |
|||
width: 250px; |
|||
height: 600px; |
|||
} |
|||
.current-data .left{ |
|||
background-color: aqua; |
|||
width:250px; |
|||
height:600px; |
|||
margin-left: 16px; |
|||
|
|||
.item { |
|||
margin-top: 35px; |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
|
|||
.current-data .middle{ |
|||
width:600px; |
|||
height:600px; |
|||
.item_lift { |
|||
margin-left: 10px; |
|||
padding-right: 5px; |
|||
font-size: 30px; |
|||
color: blue; |
|||
} |
|||
|
|||
.item_text { |
|||
padding-left: 15px; |
|||
} |
|||
|
|||
.current-data .middle { |
|||
width: 500px; |
|||
height: 400px; |
|||
float: left; |
|||
margin-left: 10px; |
|||
} |
|||
|
|||
.current-data .right{ |
|||
.current-data .right { |
|||
background-color: red; |
|||
width:700px; |
|||
height:600px; |
|||
width: 700px; |
|||
height: 600px; |
|||
float: left; |
|||
margin-left: 10px; |
|||
|
|||
} |
|||
.current-data .right .top{ |
|||
|
|||
.current-data .right .top { |
|||
text-align: center; |
|||
} |
|||
.current-data .right .charts{ |
|||
height:480px; |
|||
width:100%; |
|||
|
|||
.current-data .right .charts { |
|||
height: 480px; |
|||
width: 100%; |
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue