This commit is contained in:
TianyangZhang 2025-11-25 16:47:12 +08:00
commit 00dd3473dc
7 changed files with 62 additions and 204 deletions

View File

@ -262,7 +262,7 @@ export default {
//
configDataEq:{
headerBGC:'#0a3f44',
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
header:['设备名称','设备编号','设备状态','物料数量'],
headerHeight:40,
data:[]
},
@ -471,45 +471,22 @@ export default {
getEqState(id) {
let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
that.hh.bw = res.保温;
that.hh.lq = res.冷却;
that.hh.yx = res.运行;
that.hh.wyx = res.未运行;
that.hh.gz = res.故障;
let nowTime = new Date(res.now).getTime();
that.hh.yx += res.运行;
that.hh.wyx += res.未运行;
that.hh.gz += res.故障;
if(res.rows.length>0){
res.rows.forEach((item) => {
let arr = [];
arr[0] = item.name;
arr[1] = item.number;
if(item.mstate=='冷却'){
if(item.mstate=='运行'){
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
}else if(item.mstate=='未运行'){
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
}else if(item.mstate=='故障'){
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
}
let process = null, workTime =0,saveTime=null,sumTime=0;
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
item.reminder_interval_list.forEach(item=>{
sumTime += item;
})
let startTime = new Date(item.work_start_time).getTime();
workTime = (nowTime-startTime)/60000;//
process = Math.round((workTime/sumTime)*100);
process = process>100?'100%':process+'%';
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
if(bwSaveTime>0){
saveTime = bwSaveTime;
}else{
saveTime = 0;
}
}else{
process = '';
saveTime = '';
}
arr[3] = process;
arr[4] = item.t_count_use?item.t_count_use:0;
arr[3] = item.t_count_use?item.t_count_use:0;
that.configDataEq.data.push(arr);
});
}
@ -518,7 +495,8 @@ export default {
//
getMaterials(page) {
let that = this;
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'倒角' }).then((res) => {
let query = '{ material_name, batch, count, count_working }';
that.$API.wpm.wmaterial.list.req({ page: page,page_size:100,mgroup__name__in:'倒角',query:query }).then((res) => {
if(res.results.length>0){
res.results.forEach((item) => {
let arr = [];
@ -528,10 +506,10 @@ export default {
arr[3] = item.count_working;
that.configDataInm.data.push(arr);
})
if(res.count>that.configDataInm.data.length){
that.page++;
that.getMaterials(that.page);
}
// if(res.count>that.configDataInm.data.length){
// that.page++;
// that.getMaterials(that.page);
// }
}
})
},

View File

@ -262,7 +262,7 @@ export default {
//
configDataEq:{
headerBGC:'#0a3f44',
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
header:['设备名称','设备编号','设备状态','物料数量'],
headerHeight:40,
data:[]
},
@ -472,45 +472,22 @@ export default {
getEqState(id) {
let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
that.hh.bw = res.保温;
that.hh.lq = res.冷却;
that.hh.yx = res.运行;
that.hh.wyx = res.未运行;
that.hh.gz = res.故障;
let nowTime = new Date(res.now).getTime();
that.hh.yx += res.运行;
that.hh.wyx += res.未运行;
that.hh.gz += res.故障;
if(res.rows.length>0){
res.rows.forEach((item) => {
let arr = [];
arr[0] = item.name;
arr[1] = item.number;
if(item.mstate=='冷却'){
if(item.mstate=='运行'){
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
}else if(item.mstate=='未运行'){
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
}else if(item.mstate=='故障'){
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
}
let process = null, workTime =0,saveTime=null,sumTime=0;
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
item.reminder_interval_list.forEach(item=>{
sumTime += item;
})
let startTime = new Date(item.work_start_time).getTime();
workTime = (nowTime-startTime)/60000;//
process = Math.round((workTime/sumTime)*100);
process = process>100?'100%':process+'%';
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
if(bwSaveTime>0){
saveTime = bwSaveTime;
}else{
saveTime = 0;
}
}else{
process = '';
saveTime = '';
}
arr[3] = process;
arr[4] = item.t_count_use?item.t_count_use:0;
arr[3] = item.t_count_use?item.t_count_use:0;
that.configDataEq.data.push(arr);
});
}
@ -519,7 +496,8 @@ export default {
//
getMaterials(page) {
let that = this;
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'多线切' }).then((res) => {
let query = '{ material_name, batch, count, count_working }';
that.$API.wpm.wmaterial.list.req({ page: page,page_size:100,mgroup__name__in:'多线切',query:query }).then((res) => {
if(res.results.length>0){
res.results.forEach((item) => {
let arr = [];
@ -529,10 +507,6 @@ export default {
arr[3] = item.count_working;
that.configDataInm.data.push(arr);
})
if(res.count>that.configDataInm.data.length){
that.page++;
that.getMaterials(that.page);
}
}
})
},

View File

@ -262,7 +262,7 @@ export default {
//
configDataEq:{
headerBGC:'#0a3f44',
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
header:['设备名称','设备编号','设备状态','物料数量'],
headerHeight:40,
data:[]
},
@ -471,45 +471,22 @@ export default {
getEqState(id) {
let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
that.hh.bw = res.保温;
that.hh.lq = res.冷却;
that.hh.yx = res.运行;
that.hh.wyx = res.未运行;
that.hh.gz = res.故障;
let nowTime = new Date(res.now).getTime();
that.hh.yx += res.运行;
that.hh.wyx += res.未运行;
that.hh.gz += res.故障;
if(res.rows.length>0){
res.rows.forEach((item) => {
let arr = [];
arr[0] = item.name;
arr[1] = item.number;
if(item.mstate=='冷却'){
if(item.mstate=='运行'){
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
}else if(item.mstate=='未运行'){
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
}else if(item.mstate=='故障'){
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
}
let process = null, workTime =0,saveTime=null,sumTime=0;
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
item.reminder_interval_list.forEach(item=>{
sumTime += item;
})
let startTime = new Date(item.work_start_time).getTime();
workTime = (nowTime-startTime)/60000;//
process = Math.round((workTime/sumTime)*100);
process = process>100?'100%':process+'%';
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
if(bwSaveTime>0){
saveTime = bwSaveTime;
}else{
saveTime = 0;
}
}else{
process = '';
saveTime = '';
}
arr[3] = process;
arr[4] = item.t_count_use?item.t_count_use:0;
arr[3] = item.t_count_use?item.t_count_use:0;
that.configDataEq.data.push(arr);
});
}
@ -518,7 +495,8 @@ export default {
//
getMaterials(page) {
let that = this;
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'精雕' }).then((res) => {
let query = '{ material_name, batch, count, count_working }';
that.$API.wpm.wmaterial.list.req({ page: page,page_size:100,mgroup__name__in:'精雕',query:query }).then((res) => {
if(res.results.length>0){
res.results.forEach((item) => {
let arr = [];
@ -528,10 +506,6 @@ export default {
arr[3] = item.count_working;
that.configDataInm.data.push(arr);
})
if(res.count>that.configDataInm.data.length){
that.page++;
that.getMaterials(that.page);
}
}
})
},

View File

@ -262,7 +262,7 @@ export default {
//
configDataEq:{
headerBGC:'#0a3f44',
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
header:['设备名称','设备编号','设备状态','物料数量'],
headerHeight:40,
data:[]
},
@ -471,45 +471,22 @@ export default {
getEqState(id) {
let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
that.hh.bw = res.保温;
that.hh.lq = res.冷却;
that.hh.yx = res.运行;
that.hh.wyx = res.未运行;
that.hh.gz = res.故障;
let nowTime = new Date(res.now).getTime();
that.hh.yx += res.运行;
that.hh.wyx += res.未运行;
that.hh.gz += res.故障;
if(res.rows.length>0){
res.rows.forEach((item) => {
let arr = [];
arr[0] = item.name;
arr[1] = item.number;
if(item.mstate=='冷却'){
if(item.mstate=='运行'){
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
}else if(item.mstate=='未运行'){
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
}else if(item.mstate=='故障'){
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
}
let process = null, workTime =0,saveTime=null,sumTime=0;
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
item.reminder_interval_list.forEach(item=>{
sumTime += item;
})
let startTime = new Date(item.work_start_time).getTime();
workTime = (nowTime-startTime)/60000;//
process = Math.round((workTime/sumTime)*100);
process = process>100?'100%':process+'%';
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
if(bwSaveTime>0){
saveTime = bwSaveTime;
}else{
saveTime = 0;
}
}else{
process = '';
saveTime = '';
}
arr[3] = process;
arr[4] = item.t_count_use?item.t_count_use:0;
arr[3] = item.t_count_use?item.t_count_use:0;
that.configDataEq.data.push(arr);
});
}
@ -518,7 +495,8 @@ export default {
//
getMaterials(page) {
let that = this;
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'白片抛后超洗,平磨,磨抛一次抛,一次抛后超洗,成品抛,一次超洗,二次超洗,三次超洗' }).then((res) => {
let query = '{ material_name, batch, count, count_working }';
that.$API.wpm.wmaterial.list.req({ page: page,page_size:100,mgroup__name__in:'白片抛后超洗,平磨,磨抛一次抛,一次抛后超洗,成品抛,一次超洗,二次超洗,三次超洗',query:query }).then((res) => {
if(res.results.length>0){
res.results.forEach((item) => {
let arr = [];
@ -528,10 +506,6 @@ export default {
arr[3] = item.count_working;
that.configDataInm.data.push(arr);
})
if(res.count>that.configDataInm.data.length){
that.page++;
that.getMaterials(that.page);
}
}
})
},

View File

@ -262,7 +262,7 @@ export default {
//
configDataEq:{
headerBGC:'#0a3f44',
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
header:['设备名称','设备编号','设备状态','物料数量'],
headerHeight:40,
data:[]
},
@ -471,45 +471,22 @@ export default {
getEqState(id) {
let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
that.hh.bw = res.保温;
that.hh.lq = res.冷却;
that.hh.yx = res.运行;
that.hh.wyx = res.未运行;
that.hh.gz = res.故障;
let nowTime = new Date(res.now).getTime();
that.hh.yx += res.运行;
that.hh.wyx += res.未运行;
that.hh.gz += res.故障;
if(res.rows.length>0){
res.rows.forEach((item) => {
let arr = [];
arr[0] = item.name;
arr[1] = item.number;
if(item.mstate=='冷却'){
if(item.mstate=='运行'){
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
}else if(item.mstate=='未运行'){
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
}else if(item.mstate=='故障'){
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
}
let process = null, workTime =0,saveTime=null,sumTime=0;
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
item.reminder_interval_list.forEach(item=>{
sumTime += item;
})
let startTime = new Date(item.work_start_time).getTime();
workTime = (nowTime-startTime)/60000;//
process = Math.round((workTime/sumTime)*100);
process = process>100?'100%':process+'%';
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
if(bwSaveTime>0){
saveTime = bwSaveTime;
}else{
saveTime = 0;
}
}else{
process = '';
saveTime = '';
}
arr[3] = process;
arr[4] = item.t_count_use?item.t_count_use:0;
arr[3] = item.t_count_use?item.t_count_use:0;
that.configDataEq.data.push(arr);
});
}
@ -518,7 +495,8 @@ export default {
//
getMaterials(page) {
let that = this;
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'扫边A,扫边B' }).then((res) => {
let query = '{ material_name, batch, count, count_working }';
that.$API.wpm.wmaterial.list.req({ page: page,page_size:100,mgroup__name__in:'扫边A,扫边B',query:query }).then((res) => {
if(res.results.length>0){
res.results.forEach((item) => {
let arr = [];
@ -528,10 +506,6 @@ export default {
arr[3] = item.count_working;
that.configDataInm.data.push(arr);
})
if(res.count>that.configDataInm.data.length){
that.page++;
that.getMaterials(that.page);
}
}
})
},

View File

@ -276,7 +276,7 @@ export default {
//
configDataEq:{
headerBGC:'#0a3f44',
header:['设备名称','设备编号','设备状态','生产进度','物料数量'],
header:['设备名称','设备编号','设备状态','物料数量'],
headerHeight:40,
data:[]
},
@ -493,45 +493,22 @@ export default {
getEqState(id) {
let that = this;
that.$API.wpm.ana.equipLastMlog.req({mgroup:id}).then((res) => {
that.hh.bw = res.保温;
that.hh.lq = res.冷却;
that.hh.yx = res.运行;
that.hh.wyx = res.未运行;
that.hh.gz = res.故障;
let nowTime = new Date(res.now).getTime();
that.hh.yx += res.运行;
that.hh.wyx += res.未运行;
that.hh.gz += res.故障;
if(res.rows.length>0){
res.rows.forEach((item) => {
let arr = [];
arr[0] = item.name;
arr[1] = item.number;
if(item.mstate=='冷却'){
if(item.mstate=='运行'){
arr[2] = '<span style="color:rgb(0,163,245)">运行中</span>';
}else if(item.mstate=='未运行'){
arr[2] = '<span style="color:rgb(69,176,118)">未运行</span>';
}else if(item.mstate=='故障'){
arr[2] = '<span style="color:rgb(222,60,54)">故障</span>';
}
let process = null, workTime =0,saveTime=null,sumTime=0;
if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
item.reminder_interval_list.forEach(item=>{
sumTime += item;
})
let startTime = new Date(item.work_start_time).getTime();
workTime = (nowTime-startTime)/60000;//
process = Math.round((workTime/sumTime)*100);
process = process>100?'100%':process+'%';
let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
if(bwSaveTime>0){
saveTime = bwSaveTime;
}else{
saveTime = 0;
}
}else{
process = '';
saveTime = '';
}
arr[3] = process;
arr[4] = item.t_count_use?item.t_count_use:0;
arr[3] = item.t_count_use?item.t_count_use:0;
that.configDataEq.data.push(arr);
});
}
@ -598,7 +575,8 @@ export default {
//
getMaterials(page) {
let that = this;
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'减薄A,减薄B' }).then((res) => {
let query = '{ material_name, batch, count, count_working }';
that.$API.wpm.wmaterial.list.req({ page: page,page_size:500,mgroup__name__in:'减薄A,减薄B',query:query }).then((res) => {
if(res.results.length>0){
res.results.forEach((item) => {
let arr = [];
@ -608,10 +586,6 @@ export default {
arr[3] = item.count_working;
that.configDataInm.data.push(arr);
})
if(res.count>that.configDataInm.data.length){
that.page++;
that.getMaterials(that.page);
}
}
})
},

View File

@ -523,6 +523,16 @@ export default {
that.form.route = null;
}
if (that.mode === "add") {
let oinfo_json={}
if(that.testitems.length>0){
that.testitems.forEach((item) => {
oinfo_json[item.id] = item.value;
if(item.name=='炉号'){
that.form.index = item.value;
}
})
that.form.oinfo_json = oinfo_json;
}
if(that.mgroupName=='黑化'||that.mgroupName=='退火'){
let times = 0,reminder_interval_list=[];
that.testitems.forEach(item=>{