Merge branch 'projects/mesxc-test' into projects/mesxc-zhp

This commit is contained in:
‘937886381’ 2024-04-26 09:28:46 +08:00
commit 317d01934b
3 changed files with 49 additions and 37 deletions

View File

@ -32,11 +32,11 @@ export default {
return {
timestr: '',
config: {
header: ['序号', '设备名称', '产线名', '设备状态'],
header: ['序号', '产线名', '设备名称', '设备状态'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60, 280, 120],
columnWidth: [60, 120, 280],
align: ['center'],
data: [],
// data: [
@ -63,8 +63,8 @@ export default {
handler(newVal, oldVal) {
let outArr = this.sjgEquipment.map((item, index) => [
index + 1,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
`<span title=${item.lineName || ''}>${item.lineName || ''}</span>`,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
`<span><div style="${
item.status == '运行'
? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 '

View File

@ -75,7 +75,7 @@ export default {
selectOptions: [
{ id: '1', name: '当前班次' },
{ id: '2', name: '近24小时' },
{ id: '3', name: '日报' },
{ id: '3', name: '昨日日报' },
],
defaultSelect: '1',
param: 'timeType',
@ -112,7 +112,7 @@ export default {
selectOptions: [
{ id: '1', name: '当前班次' },
{ id: '2', name: '近24小时' },
{ id: '3', name: '日报' },
{ id: '3', name: '昨日日报' },
],
param: 'timeType',
clearable: false,
@ -196,6 +196,7 @@ export default {
this.tableProp = [];
let timeArr = this.uniqueTime(data, 'timeStr');
let arr = [];
let arr1 = [];
timeArr.map((item) => {
let obj = {};
obj.prop = item.timeStr;
@ -203,7 +204,17 @@ export default {
obj.minWidth = 140;
arr.push(obj);
});
this.tableProp = this.tableProp1.concat(arr); //
let obj1 = {};
obj1.children = arr.length > 0 ? arr : [{ label: '合计' }];
obj1.label =
'24小时原片工段产量表(' +
moment(this.queryParams.startTime).format('YYYY-MM-DD HH:mm:ss') +
'-' +
moment(this.queryParams.endTime).format('YYYY-MM-DD HH:mm:ss') +
')';
arr1.push(obj1);
this.tableProp = this.tableProp1.concat(arr1); //
console.log(this.tableProp);
this.transferData(data);
});
},
@ -286,7 +297,6 @@ export default {
transferData(data) {
let tempData = [];
let lineNum = 0; //线
let sumArr = [];
for (let i = 0; i < data.length; i++) {
if (i === 0) {
this.procedureName.map((item) => {
@ -299,37 +309,28 @@ export default {
});
lineNum++;
} else {
if (data[i].timeStr === '总计') {
sumArr.push(data[i]);
} else {
if (data[i].lineName === data[i - 1].lineName) {
//线,
let startNum = 5 * (lineNum - 1);
let endNum = 5 * lineNum - 1;
for (let k = startNum; k <= endNum; k++) {
let str = this.procedureName[k % 5];
tempData[k][data[i].timeStr] = data[i][str.ename];
}
} else {
//线5
this.procedureName.map((item) => {
let obj = {};
obj.lineName = data[i].lineName;
obj.procedure = item.name;
obj.eName = item.ename;
obj[data[i].timeStr] = data[i][item.ename];
tempData.push(obj);
});
lineNum++;
if (data[i].lineName === data[i - 1].lineName) {
//线,
let startNum = 5 * (lineNum - 1);
let endNum = 5 * lineNum - 1;
for (let k = startNum; k <= endNum; k++) {
let str = this.procedureName[k % 5];
tempData[k][data[i].timeStr] = data[i][str.ename];
}
} else {
//线5
this.procedureName.map((item) => {
let obj = {};
obj.lineName = data[i].lineName;
obj.procedure = item.name;
obj.eName = item.ename;
obj[data[i].timeStr] = data[i][item.ename];
tempData.push(obj);
});
lineNum++;
}
}
}
for (let j = 0; j < tempData.length; j++) {
sumArr.map((item) => {
tempData[j]['总计'] = item[tempData[j].eName];
});
}
this.tableData = tempData;
this.$nextTick(() => {
@ -395,7 +396,17 @@ export default {
arr.push(obj);
});
arr.push({ prop: 'sum', label: '合计' });
this.tableProp2 = this.tableProp1.concat(arr); //
let arr1 = [];
let obj1 = {};
obj1.children = arr;
obj1.label =
'24小时深加工工段产量表(' +
moment(this.queryParams2.startTime).format('YYYY-MM-DD HH:mm:ss') +
'-' +
moment(this.queryParams2.endTime).format('YYYY-MM-DD HH:mm:ss') +
')';
arr1.push(obj1);
this.tableProp2 = this.tableProp1.concat(arr1); //
this.getSpanArr(this.tableData2);
this.$nextTick(() => {
this.reTable2();

View File

@ -25,7 +25,7 @@ const tableProp1 = [
{
prop: 'lineName',
label: '生产线',
width: 110,
width: 90,
fixed: true,
},
{
@ -71,6 +71,7 @@ export default {
label: '产线',
selectOptions: [],
param: 'lineId',
multiple: true,
},
{
type: 'button',
@ -92,7 +93,7 @@ export default {
queryParams: {
startTime: '',
endTime: '',
lineId: '',
lineId: [],
},
tableProp1,
tableProp: [],