fix:光芯车间看板接口调整

This commit is contained in:
shijing 2025-05-21 09:44:53 +08:00
parent e46c2f54bf
commit e6e3298593
4 changed files with 61 additions and 37 deletions

View File

@ -448,10 +448,11 @@ export default {
let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss"); let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss");
this.start_time = start_time; this.start_time = start_time;
this.end_time = end_time; this.end_time = end_time;
this.getMgroups();
this.$nextTick(() => { this.$nextTick(() => {
// //
this.getEqState1(); // this.getEqState1();
this.getEqState2(); // this.getEqState2();
// //
this.getMtask1(); this.getMtask1();
this.getMtask2(); this.getMtask2();
@ -604,6 +605,24 @@ export default {
}, 3000); }, 3000);
}); });
}, },
getMgroups(){
let that = this;
that.$API.mtm.mgroup.list.req({page:0}).then((res) => {
res.forEach((item) => {
if(item.name == '黑化'){
that.mgroup_hh = item.id;
console.log('黑化',item.id);
that.getEqState1();
}
if(item.name == '退火'){
that.mgroup_th = item.id;
console.log('退火',item.id);
that.getEqState2();
}
});
});
},
//0 //0
getEqState10() { getEqState10() {
let that = this; let that = this;
@ -659,7 +678,7 @@ export default {
// //
getEqState1() { getEqState1() {
let that = this; let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup_name: '黑化'}).then((res) => { that.$API.wpm.ana.equipLastMlog.req({mgroup:that.mgroup_hh}).then((res) => {
console.log('黑化设备运行状态',res); console.log('黑化设备运行状态',res);
that.hh.bw = res.保温; that.hh.bw = res.保温;
that.hh.lq = res.冷却; that.hh.lq = res.冷却;
@ -712,7 +731,7 @@ export default {
getMtask1() { getMtask1() {
let that = this; let that = this;
let obj = {}; let obj = {};
obj.mgroup__name = '黑化'; obj.mgroup__name = that.mgroup_hh;
obj.page = 0; obj.page = 0;
that.$API.pm.mtask.list.req(obj).then((res) => { that.$API.pm.mtask.list.req(obj).then((res) => {
that.configData1.data = []; that.configData1.data = [];
@ -740,7 +759,7 @@ export default {
//退 //退
getEqState2() { getEqState2() {
let that = this; let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup_name: '退火'}).then((res) => { that.$API.wpm.ana.equipLastMlog.req({mgroup:that.mgroup_th}).then((res) => {
console.log('退火设备运行状态',res); console.log('退火设备运行状态',res);
that.th.bw = res.保温; that.th.bw = res.保温;
that.th.lq = res.冷却; that.th.lq = res.冷却;

View File

@ -239,27 +239,22 @@ export default {
legend: { legend: {
icon: "stack", icon: "stack",
right: 0, right: 0,
orient: 'vertical',
itemWidth: 12,
itemHeight: 12,
textStyle: {
color: '#fff',
fontSize: 11,
},
}, },
series: [ series: {
{
name: '不合格占比', name: '不合格占比',
type: 'pie', type: 'pie',
radius: ['1%', '60%'], radius: ['1%', '60%'],
center: ['50%', '55%'], center: ['35%', '50%'],
label: false, label: false,
data: [ data: []
{value: 0, name: '划伤'},
{value: 0, name: '气泡'},
{value: 0, name: '水纹'},
{value: 0, name: '崩边'},
{value: 0, name: '雾面'},
{value: 0, name: '麻点'},
{value: 0, name: '线痕'},
{value: 0, name: '破损'},
{value: 0, name: '其他'},
]
} }
]
}, },
tableHeight: 100, tableHeight: 100,
speed: 2000, speed: 2000,
@ -373,6 +368,7 @@ export default {
this.getMtask(); this.getMtask();
/// ///
this.getProductLine(); this.getProductLine();
this.getCountnotok();
}) })
}, },
methods: { methods: {
@ -411,7 +407,7 @@ export default {
}, 500); }, 500);
return myChart; return myChart;
}, },
// //
getProductLine() { getProductLine() {
let that = this; let that = this;
let obj = { let obj = {
@ -444,15 +440,6 @@ export default {
seriesData0[indexs] = item.生产数; seriesData0[indexs] = item.生产数;
seriesData1[indexs] = item.合格数; seriesData1[indexs] = item.合格数;
seriesData2[indexs] = item.合格率; seriesData2[indexs] = item.合格率;
that.pieOption.series.data[0].value += item.划伤;
that.pieOption.series.data[1].value += item.气泡;
that.pieOption.series.data[2].value += item.水纹;
that.pieOption.series.data[3].value += item.崩边;
that.pieOption.series.data[4].value += item.雾面;
that.pieOption.series.data[5].value += item.麻点;
that.pieOption.series.data[6].value += item.线痕;
that.pieOption.series.data[7].value += item.破损;
that.pieOption.series.data[8].value += item.其他;
}); });
} }
that.barOption.xAxis.data = that.xAxisData; that.barOption.xAxis.data = that.xAxisData;
@ -460,8 +447,7 @@ export default {
that.barOption.series[1].data = seriesData1; that.barOption.series[1].data = seriesData1;
that.barOption.series[2].data = seriesData2; that.barOption.series[2].data = seriesData2;
let chart1 = this.setChart("chart1", that.barOption); let chart1 = this.setChart("chart1", that.barOption);
let chart2 = this.setChart("chart2", that.pieOption); let index1 = 0;
let index1 = 0,index2 = 0;
this.chartInterval1 = setInterval(function () { this.chartInterval1 = setInterval(function () {
if (index1 < that.barOption.series[0].data.length) { if (index1 < that.barOption.series[0].data.length) {
chart1.dispatchAction({ chart1.dispatchAction({
@ -483,6 +469,25 @@ export default {
index1 = 0; index1 = 0;
} }
}, 3000); }, 3000);
});
},
//
getCountnotok(){
let that = this;
let obj = {query:{start_date:that.start_time,end_date:that.end_time}};
that.$API.bi.dataset.exec.req('notok_dis', obj).then((res) => {
let seriesData = [];
if(res.data2.ds0){
res.data2.ds0.forEach((item) => {
let obj = {};
obj.name = item.不合格项;
obj.value = item.数量;
seriesData.push(obj);
})
}
that.pieOption.series.data = seriesData;
let index2 = 0;
let chart2 = this.setChart("chart2", that.pieOption);
this.chartInterval2 = setInterval(function () { this.chartInterval2 = setInterval(function () {
if (index2 < that.barOption.series[0].data.length) { if (index2 < that.barOption.series[0].data.length) {
chart2.dispatchAction({ chart2.dispatchAction({
@ -504,7 +509,7 @@ export default {
index2 = 0; index2 = 0;
} }
}, 3000); }, 3000);
}); })
}, },
// //
getEqState(id) { getEqState(id) {

View File

@ -312,8 +312,8 @@ const defaultForm = {
shift: null, shift: null,
wm_in: null, wm_in: null,
fmlog:null, fmlog:null,
handle_user:null, handle_user:'',
handle_users:null, handle_users:[],
material_out:'', material_out:'',
count_pn_jgqbl:0, count_pn_jgqbl:0,
count_use:0, count_use:0,

View File

@ -294,8 +294,8 @@ const defaultForm = {
supplier:'', supplier:'',
route: "", route: "",
equipment: "", equipment: "",
handle_user: null, handle_user: '',
handle_users:null, handle_users:[],
work_start_time: "", work_start_time: "",
work_end_time:null, work_end_time:null,
note:'', note:'',