master
吴普建 11 months ago
parent 00bfc51123
commit 5e7cb579bb

@ -1,5 +1,6 @@
<template> <template>
<div :style="{ height: height, width: width }" /> <!-- <div :style="{ height: height, width: width }" />-->
<dv-scroll-board :config="config" style="width:900px;height:240px" />
</template> </template>
<script> <script>
@ -7,6 +8,7 @@ import * as echarts from 'echarts';
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import resize from './dashboard/mixins/resize'; import resize from './dashboard/mixins/resize';
import {option} from './options/mid_bot_options'; import {option} from './options/mid_bot_options';
import { getOutputLog } from '~/src/service/api/produre/workRecords/index';
export default defineComponent({ export default defineComponent({
mixins: [resize], mixins: [resize],
props: { props: {
@ -32,6 +34,17 @@ export default defineComponent({
}, },
data() { data() {
return { return {
config: {
header: ['工单类型', '机台', '订单编号', '报工数量','报工时间','报工人'],
headerBGC: 'transparent',
oddRowBGC: '#011B42',
evenRowBGC: '#020D29',
data: [
],
index: true,
columnWidth: [80],
align: ['center']
},
// myChart: null, // myChart: null,
loading: true, loading: true,
dataForCount: [], dataForCount: [],
@ -41,24 +54,25 @@ export default defineComponent({
}, },
async mounted() { async mounted() {
// await this.getTypeData() // await this.getTypeData()
this.chartOptions =JSON.parse(JSON.stringify(option)) // this.chartOptions =JSON.parse(JSON.stringify(option))
// this.initChart() // this.initChart()
this.getTypeData()
setInterval(() => {
this.getTypeData()
}, 500000)
}, },
watch : { // watch : {
productionData : { // productionData : {
handler (newValue) { // handler (newValue) {
console.log('this.chartOptions ==>',this.chartOptions); // this.config.data = newValue.outputLogs && newValue.outputLogs.length && newValue.outputLogs.map(item => {
let series1Data = newValue.wiredrawingNumWeek.map(item => item.putNum); // return [item.taskType == '0'?'':'', item.workstationName, item.orderSn, item.outputWeight, item.createTime, item.createBy]
let series2Data = newValue.wiredrawingNumWeek.map(item => item.outNum); // }) || []
let xAxisData = newValue.wiredrawingNumWeek.map(item => item.date); // // this.initChart();
this.chartOptions.xAxis.data = xAxisData; // },
this.chartOptions.series[0].data = series1Data; // deep : true
this.chartOptions.series[1].data = series2Data; // }
this.initChart(); // },
},
deep : true
}
},
beforeUnmount() { beforeUnmount() {
// if (!this.myChart) { // if (!this.myChart) {
// return; // return;
@ -67,14 +81,30 @@ export default defineComponent({
// this.myChart = null; // this.myChart = null;
}, },
methods: { methods: {
initChart() {
let myChart = echarts.init(this.$el); async getTypeData () {
myChart.setOption(this.chartOptions); let res = await getOutputLog({
this.$nextTick(() => { pageNum : 1,
myChart.resize() pageSize : 10
this.$emit('endLoading', 11)
}) })
} this.config.data = res && res.rows && res.rows.length && res.rows.map(item => {
return [item.taskType == '0'?'金属':'板材', item.workstationName, item.orderSn, item.outputWeight, item.createTime, item.createBy]
}) || []
},
// initChart() {
// let myChart = echarts.init(this.$el);
// myChart.setOption(this.chartOptions);
// this.$nextTick(() => {
// myChart.resize()
// this.$emit('endLoading', 11)
// })
// }
} }
}); });
</script> </script>
<style scoped>
.dv-scroll-board .header{
background-color: transparent;
}
</style>

@ -42,7 +42,7 @@ export default defineComponent({
async mounted() { async mounted() {
this.chartOptions = JSON.parse(JSON.stringify(option)); this.chartOptions = JSON.parse(JSON.stringify(option));
this.chartOptions.title[0].text = this.chartData.week; this.chartOptions.title[0].text = this.chartData.week;
this.chartOptions.title[1].text = this.chartData.carryNum; this.chartOptions.title[1].text = this.chartData && this.chartData.carryNum || 0;
this.initChart() this.initChart()
}, },
// watch : { // watch : {

@ -20,7 +20,7 @@ export let option= {
if (params[i].seriesName !== "") { if (params[i].seriesName !== "") {
str += str +=
params[i].seriesName + "" + params[i].seriesName + "" +
params[i].value + 'kg' params[i].value
"<br/>"; "<br/>";
} }
} }
@ -28,7 +28,7 @@ export let option= {
} }
}, },
legend: { legend: {
data: ['成品入库', '成品出库'], data: ['入库', '出库'],
icon: 'rect', icon: 'rect',
itemWidth: 14, itemWidth: 14,
itemHeight: 14, itemHeight: 14,
@ -80,7 +80,7 @@ export let option= {
], ],
series: [ series: [
{ {
name: '成品入库', name: '入库',
type: 'bar', type: 'bar',
itemStyle: { itemStyle: {
borderWidth: 1, borderWidth: 1,
@ -120,7 +120,7 @@ export let option= {
data: [] data: []
}, },
{ {
name: '成品出库', name: '出库',
type: 'bar', type: 'bar',
itemStyle: { itemStyle: {
borderWidth: 1, borderWidth: 1,

@ -239,28 +239,28 @@
<mid-mid-bot v-show="!loading2" :year="year" :production-data="productionData" width="900px" height="180px" /> <mid-mid-bot v-show="!loading2" :year="year" :production-data="productionData" width="900px" height="180px" />
</div> </div>
<div class="mid_area mid_bot_country_area"> <!-- <div class="mid_area mid_bot_country_area">-->
<div class="total_count"></div> <!-- <div class="total_count"></div>-->
<div class="cunt_count">0</div> <!-- <div class="cunt_count">0</div>-->
<div class="cunt_count">0</div> <!-- <div class="cunt_count">0</div>-->
<div class="cunt_count">0</div> <!-- <div class="cunt_count">0</div>-->
<!-- <div class="douhao"></div> --> <!-- &lt;!&ndash; <div class="douhao"></div> &ndash;&gt;-->
<div class="cunt_count">0</div> <!-- <div class="cunt_count">0</div>-->
<div class="cunt_count">0</div> <!-- <div class="cunt_count">0</div>-->
<div class="cunt_count">2</div> <!-- <div class="cunt_count">2</div>-->
<!-- <div class="douhao"></div> --> <!-- &lt;!&ndash; <div class="douhao"></div> &ndash;&gt;-->
<div class="cunt_count">1</div> <!-- <div class="cunt_count">1</div>-->
<div class="cunt_count">6</div> <!-- <div class="cunt_count">6</div>-->
<div class="cunt_count">2</div> <!-- <div class="cunt_count">2</div>-->
<div class="unit"></div> <!-- <div class="unit"></div>-->
</div> <!-- </div>-->
<div class="mid_area mid_bot_end_area"> <div class="mid_area mid_bot_end_area">
<div class="item"> <div class="item">
<div class="top"> <div class="top">
<span style="font-size: 22px; font-weight: bolder; color: #fff">{{ productionData.wiredrawingNumWeek && productionData.wiredrawingNumWeek[productionData.wiredrawingNumWeek.length - 1].carryNum || 0 }}</span> <span style="font-size: 22px; font-weight: bolder; color: #fff">{{ productionData.wiredrawingNumWeek && productionData.wiredrawingNumWeek.length && productionData.wiredrawingNumWeek[productionData.wiredrawingNumWeek.length - 1].carryNum || 0 }}</span>
</div> </div>
<div class="bottom"> <div class="bottom">
<div class="left"></div> <div class="left"></div>

@ -179,7 +179,11 @@ const columns: Ref<DataTableColumns<DataType>> = ref([
{ {
title: '所在仓库', title: '所在仓库',
key: 'warehouseName' key: 'warehouseName'
} },
{
title: '日期',
key: 'createTime'
}
]); ]);
const checked = ref<(string | number)[]>([]); const checked = ref<(string | number)[]>([]);

Loading…
Cancel
Save