Browse Source

看板改变

master
ruanqi 4 years ago
parent
commit
715bfecc47
  1. 208
      src/views/newScheduledBoard.vue

208
src/views/newScheduledBoard.vue

@ -45,12 +45,56 @@
data() {
return {
myChart: null,
number1:0,
number2:0,
option:null,
chartDom:null,
option2:null,
tableList:null,
pieList:null,
barList:null,
resourceId:'',
ip:'192.168.1.130'
}
},
components: {
TimeC
},
methods: {
searchData(){
let that = this;
$.ajax({
url: "/board/getNewScheduledData",
type: "post",
data: {ip:that.ip,number:that.number1
},
dataType: "json",
success: (data) => {
if (data.number==-1) {
}else {
that.number1=data.number;
that.pieList=data.pieList;
that.barList=data.barList;
that.resourceId=data.pieList[0].resourceId;
this.number2=0;
this.draw();
this.draw2()
$('#table').bootstrapTable('refresh');
window.setTimeout(() => {
$('#table').bootstrapTable('refresh');
}, 3000);
window.setTimeout(() => {
$('#table').bootstrapTable('refresh');
}, 6000);
window.setTimeout(() => {
$('#table').bootstrapTable('refresh');
}, 9000);
}
}
})
},
draw(){
// if (data_temp[i].percentage >= 100) {
if (true) {
@ -58,9 +102,12 @@
} else {
var color = '#fff300';
}
let option = ({
if (this.myChart!=null) {
this.myChart.clear()
}
this.option = ({
title: [{
text: '工序:' + "打磨",
text: '设备:' + this.pieList[0].resourceId,
// text: '' + data_temp[i + x].itemNo,
// x 'center' ¦ 'left' ¦ 'right' ¦ {number}xpx
x: 'center',
@ -76,7 +123,7 @@
}
},
{
text: '20%',
text: this.pieList[0].qtyPercent + '%',
// text: data_temp[i + x].percentage + '%',
// x 'center' ¦ 'left' ¦ 'right' ¦ {number}xpx
x: 'center',
@ -99,8 +146,8 @@
data: [ // name value
// {value: data_temp[i + x].approveQty, name: ''},
// {value: data_temp[i + x].unapproveQty, name: ''}
{value: 20, name: ''},
{value: 80, name: ''}
{value: this.pieList[0].qtyReported, name: ''},
{value: this.pieList[0].qtyUnReported, name: ''}
],
color: ['#90ca75', '#ec6566'],
labelLine: {
@ -121,10 +168,14 @@
]
});
this.myChart = echarts.init(document.getElementById('pie'));
this.myChart.setOption(option);
this.myChart.setOption(this.option);
},
tableInit() {
let that=this;
$('#table').bootstrapTable({
url: "/board/getNewScheduledTableData",
method: 'post', //*
contentType: 'application/x-www-form-urlencoded',
striped: true, //
cache: false, //使true*
pagination: false, //*
@ -132,7 +183,11 @@
sortOrder: "asc", //
queryParamsType: "undefined", //
queryParams: function queryParams(params) { //
var param = {
"resourceId": that.resourceId,
"number": that.number2,
};
return param;
},
sidePagination: "server", //clientserver*
pageNumber: 1, //
@ -154,66 +209,80 @@
columns: [{
field: 't1',
field: 'seqno',
title: '派工单号',
halign:'left',
width: 100,
width: 80,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
return {css: {"height": "20px", "color": "yellow"}}
}
// }, {
// field: 'orderno',
// title: '',
// halign:'left',
// width: 100,
// cellStyle: function () {
// return {css: {"height": "20px", "color": "yellow"}}
// }
}, {
field: 't1',
title: '操作员工号',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
title: '设备编码',
field: 'partNo',
title: '物料编号',
halign:'left',
width: 100,
width: 60,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
return {css: {"height": "20px", "color": "yellow"}}
}
// }, {
// field: 'partDesc',
// title: '',
// halign:'left',
// width: 100,
// cellStyle: function () {
// return {css: {"height": "20px", "color": "yellow"}}
// }
}, {
field: 't1',
title: '班次',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
field: 'qtyRequired',
title: '派工数量',
halign:'left',
width: 100,
// align:'right',
width: 60,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
return {css: {"height": "20px", "color": "yellow"}}
}
}, {
field: 't1',
title: '已完工数',
field: 'qtyReported',
title: '已完工数',
halign:'left',
width: 100,
// align:'right',
width: 60,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
return {css: {"height": "20px", "color": "yellow"}}
}
}, {
field: 't1',
title: '未完工数',
field: 'qtyUnReported',
title: '未完工数',
halign:'left',
width: 100,
// align:'right',
width: 60,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
return {css: {"height": "20px", "color": "yellow"}}
},
formatter : function(value, row){
if(value<0){
return 0;
}else {
return value;
}
}
}
],
onLoadSuccess: function (data) {
if(data.total<5){
that.number2=0;
}else {
that.number2+=1;
}
}
});
@ -232,16 +301,17 @@
},
draw2(){
let chartDom = document.getElementById('main');
let myChart = echarts.init(chartDom);
let option;
// document.getElementById('main').style.height="300px";
if(this.option!=null){
document.getElementById('main').removeAttribute('_echarts_instance_')
this.option = null
if (this.myChart2!=null) {
this.myChart2.clear()
}
option = {
color:["#11e2b6", "#ff0000"],
this.myChart2 = echarts.init(document.getElementById('main'));
// document.getElementById('main').style.height="300px";
// if(this.option2!=null){
// document.getElementById('main').removeAttribute('_echarts_instance_')
// this.option2 = null
// }
this.option2 = {
color:["#90ca75", "#ec6566"],
legend: {
textStyle: { //
color: '#fff',
@ -255,43 +325,43 @@
// data: xAxisData
data: [
{
value: '周一',
value: this.getDate(this.barList[6].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: '周二',
value: this.getDate(this.barList[5].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: '周三',
value: this.getDate(this.barList[4].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: '周四',
value: this.getDate(this.barList[3].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: '周五',
value: this.getDate(this.barList[2].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: '周六',
value: this.getDate(this.barList[1].strDate),
textStyle: {
color: '#EEE'
}
},
{
value: '周日',
value: this.getDate(this.barList[0].strDate),
textStyle: {
color: '#EEE'
}
@ -333,7 +403,7 @@
focus: 'series'
},
// data: seriesData1
data: [320, 332, 301, 334, 390, 330, 320]
data: [this.barList[6].num1, this.barList[5].num1, this.barList[4].num1, this.barList[3].num1, this.barList[2].num1, this.barList[1].num1, this.barList[0].num1]
},
{
name: '晚班',
@ -342,19 +412,27 @@
focus: 'series'
},
// data: seriesData2
data: [120, 132, 101, 134, 90, 230, 210]
data: [this.barList[6].num2, this.barList[5].num2, this.barList[4].num2, this.barList[3].num2, this.barList[2].num2, this.barList[1].num2, this.barList[0].num2]
}
]
};
option && myChart.setOption(option);
this.option2 && this.myChart2.setOption(this.option2);
},
getDate(value) {
var date = value.substring(5, 10);
return date;
},
pie(){
window.setInterval(() => {
this.searchData();
}, 12000);
}
},
mounted() {
this.draw();
this.tableInit();
this.data();
this.draw2();
this.searchData();
this. pie();
}
}
</script>

Loading…
Cancel
Save