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

This commit is contained in:
helloDy 2024-04-26 10:16:38 +08:00
commit 0349f3cde0
9 changed files with 140 additions and 98 deletions

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-25 09:02:38 * @LastEditTime: 2024-04-26 09:57:41
* @Description: * @Description:
--> -->
<template> <template>
@ -42,20 +42,21 @@
<el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em;overflow: hidden;"> <el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em;overflow: hidden;">
<!-- <el-col :span="12"> --> <!-- <el-col :span="12"> -->
<!-- <div style="height: 34px;"> --> <!-- <div style="height: 34px;"> -->
<span style="display: inline-block;width: 400px;height: 10px;"> <span style="display: inline-block;width: 400px">
<span class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</span> <span v-if="op.name" class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name
<el-divider class="split" v-if="op.name" direction="vertical"></el-divider> }}</span>
<el-divider v-if="op.specifications" class="split" direction="vertical"></el-divider>
<!-- <span v-if="op.size" class="split"></span> --> <!-- <span v-if="op.size" class="split"></span> -->
<span v-if="op.specifications" class="orderSize" style="font-size: 14px;opacity: calc(.6);">{{ <span v-if="op.specifications" class="orderSize" style="font-size: 14px;opacity: calc(.6);">{{
op.specifications }}</span> op.specifications }}</span>
<el-divider class="split" v-if="op.specifications" direction="vertical"></el-divider> <el-divider class="split" v-if="op.planQuantity" direction="vertical"></el-divider>
<span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{ <span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
op.planQuantity }}</span> op.planQuantity }}</span>
<span v-if="op.planQuantity" class="orderFinishTwo" <span v-if="op.planQuantity" class="orderFinishTwo"
style="font-size: 14px;opacity: calc(.6);"></span> style="font-size: 14px;opacity: calc(.6);"></span>
</span> </span>
<!-- <span style="overflow: hidden;"> --> <!-- <span style="overflow: hidden;"> -->
<span v-if="op.actualQuantity" class="orderFinish" style="font-size: 14px;margin-left: 40px;">{{ <span class="orderFinish" style="font-size: 14px;margin-left: 40px;">{{
op.actualQuantity op.actualQuantity
}}</span> }}</span>
<span v-if="op.actualQuantity" class="orderFinishTwo" style="font-size: 14px"></span> <span v-if="op.actualQuantity" class="orderFinishTwo" style="font-size: 14px"></span>
@ -298,11 +299,11 @@ export default {
// equipmentList:[], // equipmentList:[],
EnergyMonitoringList: [], EnergyMonitoringList: [],
eqConfig: { eqConfig: {
header: ['序号', '设备名称', '产线名', '设备状态'], header: ['序号', '产线名', '设备名称', '设备状态'],
headerBGC: 'rgba(32, 55, 96, 0.8)', headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)', oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)', evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [70, 130, 240, 120], columnWidth: [70, 150, 200, 120],
align: ['center'], align: ['center'],
data: [], data: [],
// index:true, // index:true,
@ -387,7 +388,7 @@ export default {
progressRate: 0.933333, progressRate: 0.933333,
specifications: '1100*5554*22', specifications: '1100*5554*22',
plan: 111111111111, plan: 111111111111,
actualQuantity:10000001111, actualQuantity:1000000111111,
}, },
{ {
id: '2', id: '2',
@ -458,12 +459,12 @@ export default {
this.orderList = detData.map((ele, index) => { this.orderList = detData.map((ele, index) => {
if (ele.progressRate && ele.progressRate != 1) { if (ele.progressRate && ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
name: ele.name, name: this.getStr(String(ele.name), 8),
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)), progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
specifications: ele.specifications ? '规格' + ele.specifications :'', specifications: ele.specifications ? '规格' + ele.specifications : '',
planQuantity: ele.plan ? '计划' + this.getStr(String(ele.plan)) : '', planQuantity: ele.plan ? '计划' + this.getStr(String(ele.plan), 6) : '',
actualQuantity: ele.actualQuantity ?this.getStr(String(ele.actualQuantity)) : '', actualQuantity: ele.actualQuantity ? this.getStr(String(ele.actualQuantity), 6) : '',
}; };
} }
}); });
@ -483,10 +484,9 @@ export default {
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''} `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
</span>`, </span>`,
// formatDate(item.planStartTime) || '', // formatDate(item.planStartTime) || '',
` `<span style="color:rgba(255,255,255,0.5)">${item.lineName || ''}</span>`,`
<span style="color:rgba(255,255,255,0.5)" >${item.name || ''} <span style="color:rgba(255,255,255,0.5)" >${item.name || ''}
</span>`, </span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.lineName || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)"><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' : item.status == '停机' ? 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;background-color: #FFBD02;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0'}"></div> ${item.status || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)"><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' : item.status == '停机' ? 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;background-color: #FFBD02;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0'}"></div> ${item.status || ''}</span>`,
]); ]);
this.eqConfig.data = eqArr; this.eqConfig.data = eqArr;
@ -566,10 +566,10 @@ export default {
// removeEventListener('resize', resizeFun) // removeEventListener('resize', resizeFun)
// }, // },
methods: { methods: {
getStr(str) { getStr(str,num) {
// //
if (str.length > 6) { //10... if (str.length > num) { //10...
str = str.substr(0, 6) + "..." //10... str = str.substr(0, num) + "..." //10...
return str return str
} else { } else {
return str return str
@ -743,12 +743,12 @@ export default {
this.orderList = this.SJGWsData.detData.map((ele, index) => { this.orderList = this.SJGWsData.detData.map((ele, index) => {
if (ele.progressRate && ele.progressRate != 1) { if (ele.progressRate && ele.progressRate != 1) {
return { return {
id: ele.id, id: ele.id,
name: ele.name, name: this.getStr(String(ele.name), 8),
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)), progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
specifications: ele.specifications ? '规格' + ele.specifications :null, specifications: ele.specifications ? '规格' + ele.specifications : '',
planQuantity: ele.planQuantity ? '计划' + ele.planQuantity + '片' : null, planQuantity: ele.planQuantity ? '计划' + this.getStr(String(ele.planQuantity),6) : '',
actualQuantity: ele.actualQuantity ? ele.actualQuantity + '片' : null, actualQuantity: ele.actualQuantity ? this.getStr(String(ele.actualQuantity), 6) : '',
}; };
} }
}); });
@ -757,11 +757,11 @@ export default {
let eqArr = this.SJGWsData.detData.map((item, index) => [ let eqArr = this.SJGWsData.detData.map((item, index) => [
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''} `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
</span>`, </span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.lineName || ''
}</span>`,
`<span style="color:rgba(255,255,255,0.5)" >${item.name || ''} `<span style="color:rgba(255,255,255,0.5)" >${item.name || ''}
</span>`, </span>`,
`<span style="color:rgba(255,255,255,0.5)">${
item.lineName || ''
}</span>`,
`<span style="color:rgba(255,255,255,0.5)"><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' : item.status == '停机' ? 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;background-color: #FFBD02;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0'}"></div> ${item.status || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)"><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' : item.status == '停机' ? 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;background-color: #FFBD02;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0'}"></div> ${item.status || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == false ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:10px 10px 0 0 '}"></div> ${item.error == true ?'' :'' || ''}</span>`, // `<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == false ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:10px 10px 0 0 '}"></div> ${item.error == true ?'' :'' || ''}</span>`,
]); ]);

View File

@ -32,11 +32,11 @@ export default {
return { return {
timestr: '', timestr: '',
config: { config: {
header: ['序号', '设备名称', '产线名', '设备状态'], header: ['序号', '产线名', '设备名称', '设备状态'],
headerBGC: 'rgba(32, 55, 96, 0.8)', headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)', oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)', evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60, 280, 120], columnWidth: [60, 120, 280],
align: ['center'], align: ['center'],
data: [], data: [],
// data: [ // data: [
@ -63,8 +63,8 @@ export default {
handler(newVal, oldVal) { handler(newVal, oldVal) {
let outArr = this.sjgEquipment.map((item, index) => [ let outArr = this.sjgEquipment.map((item, index) => [
index + 1, index + 1,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
`<span title=${item.lineName || ''}>${item.lineName || ''}</span>`, `<span title=${item.lineName || ''}>${item.lineName || ''}</span>`,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
`<span><div style="${ `<span><div style="${
item.status == '运行' 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 ' ? '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: [ selectOptions: [
{ id: '1', name: '当前班次' }, { id: '1', name: '当前班次' },
{ id: '2', name: '近24小时' }, { id: '2', name: '近24小时' },
{ id: '3', name: '日报' }, { id: '3', name: '昨日日报' },
], ],
defaultSelect: '1', defaultSelect: '1',
param: 'timeType', param: 'timeType',
@ -112,7 +112,7 @@ export default {
selectOptions: [ selectOptions: [
{ id: '1', name: '当前班次' }, { id: '1', name: '当前班次' },
{ id: '2', name: '近24小时' }, { id: '2', name: '近24小时' },
{ id: '3', name: '日报' }, { id: '3', name: '昨日日报' },
], ],
param: 'timeType', param: 'timeType',
clearable: false, clearable: false,
@ -196,6 +196,7 @@ export default {
this.tableProp = []; this.tableProp = [];
let timeArr = this.uniqueTime(data, 'timeStr'); let timeArr = this.uniqueTime(data, 'timeStr');
let arr = []; let arr = [];
let arr1 = [];
timeArr.map((item) => { timeArr.map((item) => {
let obj = {}; let obj = {};
obj.prop = item.timeStr; obj.prop = item.timeStr;
@ -203,7 +204,17 @@ export default {
obj.minWidth = 140; obj.minWidth = 140;
arr.push(obj); 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); this.transferData(data);
}); });
}, },
@ -286,7 +297,6 @@ export default {
transferData(data) { transferData(data) {
let tempData = []; let tempData = [];
let lineNum = 0; //线 let lineNum = 0; //线
let sumArr = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
if (i === 0) { if (i === 0) {
this.procedureName.map((item) => { this.procedureName.map((item) => {
@ -299,37 +309,28 @@ export default {
}); });
lineNum++; lineNum++;
} else { } else {
if (data[i].timeStr === '总计') { if (data[i].lineName === data[i - 1].lineName) {
sumArr.push(data[i]); //线,
} else { let startNum = 5 * (lineNum - 1);
if (data[i].lineName === data[i - 1].lineName) { let endNum = 5 * lineNum - 1;
//线, for (let k = startNum; k <= endNum; k++) {
let startNum = 5 * (lineNum - 1); let str = this.procedureName[k % 5];
let endNum = 5 * lineNum - 1; tempData[k][data[i].timeStr] = data[i][str.ename];
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++;
} }
} 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.tableData = tempData;
this.$nextTick(() => { this.$nextTick(() => {
@ -395,7 +396,17 @@ export default {
arr.push(obj); arr.push(obj);
}); });
arr.push({ prop: 'sum', label: '合计' }); 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.getSpanArr(this.tableData2);
this.$nextTick(() => { this.$nextTick(() => {
this.reTable2(); this.reTable2();

View File

@ -170,8 +170,8 @@ export default {
mounted() { mounted() {
// this.formConfig[1].defaultSelect[] // this.formConfig[1].defaultSelect[]
this.listQuery.startTime = Date.now() this.listQuery.startTime = Date.now()
this.time = moment(new Date(Date.now())).format('YYYY-MM-DD') this.time = moment(new Date((Date.now())).setHours(8, 0, 0, 0)).format('YYYY-MM-DD HH:mm:ss') + moment(new Date(Date.now() + 24*60*60*1000).setHours(8, 0, 0, 0)).format('YYYY-MM-DD HH:mm:ss')
this.listQuery.endTime = Date.now() + 24 * 60 * 60 * 1000 this.listQuery.endTime = Date.now()
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.getDataList() this.getDataList()
// this.getSpanArr(this.tableData) // this.getSpanArr(this.tableData)
@ -308,7 +308,7 @@ export default {
'sj11': null, 'sj11': null,
'sj14': null, 'sj14': null,
putType: '原料投入' putType: '原料投入(kg)'
}, },
{ {
classType: 1, classType: 1,
@ -374,7 +374,7 @@ export default {
'sj11': null, 'sj11': null,
'sj14': null, 'sj14': null,
putType: '原料投入', putType: '原料投入(kg)',
}, },
{ {
classType: 2, classType: 2,
@ -440,7 +440,7 @@ export default {
'sj11': null, 'sj11': null,
'sj14': null, 'sj14': null,
putType: '原料投入', putType: '原料投入(kg)',
}, },
{ {
classType: 3, classType: 3,
@ -535,9 +535,9 @@ export default {
// Date.now() - 24 * 60 * 60 - 1000 // Date.now() - 24 * 60 * 60 - 1000
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.startTime = val.checkTime ? val.checkTime : undefined; this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime).setHours(8, 0, 0, 0)).getTime() : undefined;
this.time = moment(new Date(this.listQuery.startTime)).format('YYYY-MM-DD') this.time = moment(new Date((val.checkTime)).setHours(8, 0, 0, 0)).format('YYYY-MM-DD HH:mm:ss') + moment(new Date(val.checkTime + 24 * 60 * 60 * 1000).setHours(7, 59, 59)).format('YYYY-MM-DD HH:mm:ss')
this.listQuery.endTime = val.checkTime ? val.checkTime + 24 * 60 * 60 * 1000 : undefined; this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime + 24 * 60 * 60 * 1000).setHours(7, 59, 59)).getTime() : undefined;
this.getDataList(); this.getDataList();
break; break;
case 'export': case 'export':
@ -551,6 +551,10 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.baseTable{
border-color: #D1D4DB;
background-color: #F2F4F9;
}
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell { ::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC; background-color: #EAF1FC;
} }

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 10:01:33 * @Date: 2024-04-18 10:01:33
* @LastEditTime: 2024-04-25 13:40:51 * @LastEditTime: 2024-04-25 17:13:14
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -493,6 +493,10 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.baseTable {
border-color: #D1D4DB;
background-color: #F2F4F9;
}
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell { ::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC; background-color: #EAF1FC;
} }

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 14:08:46 * @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-25 13:30:11 * @LastEditTime: 2024-04-26 09:10:53
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -13,7 +13,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="产线" prop="productionLineId"> <el-form-item label="产线" prop="productionLineId">
<el-select v-model="listQuery.productionLineId" placeholder="请选择"> <el-select v-model="listQuery.productionLineId" placeholder="请选择" clearable>
<el-option v-for="item in lineList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in lineList" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -413,6 +413,10 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.baseTable {
border-color: #D1D4DB;
background-color: #F2F4F9;
}
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell { ::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC; background-color: #EAF1FC;
} }

View File

@ -25,7 +25,7 @@ const tableProp1 = [
{ {
prop: 'lineName', prop: 'lineName',
label: '生产线', label: '生产线',
width: 110, width: 90,
fixed: true, fixed: true,
}, },
{ {
@ -71,6 +71,7 @@ export default {
label: '产线', label: '产线',
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
multiple: true,
}, },
{ {
type: 'button', type: 'button',
@ -92,7 +93,7 @@ export default {
queryParams: { queryParams: {
startTime: '', startTime: '',
endTime: '', endTime: '',
lineId: '', lineId: [],
}, },
tableProp1, tableProp1,
tableProp: [], tableProp: [],
@ -108,8 +109,9 @@ export default {
let start = moment().format('yyyy-MM-DD'); let start = moment().format('yyyy-MM-DD');
let end = moment().format('yyyy-MM-DD'); let end = moment().format('yyyy-MM-DD');
this.formConfig[0].defaultSelect = [start, end]; this.formConfig[0].defaultSelect = [start, end];
this.queryParams.startTime = moment(start + ' 00:00:00').valueOf(); this.queryParams.startTime =
this.queryParams.endTime = moment(end + ' 23:59:59').valueOf(); moment(start + ' 00:00:00').valueOf() + 25200000;
this.queryParams.endTime = moment(end + ' 23:59:59').valueOf() + 25200000;
this.getList(); this.getList();
}, },
methods: { methods: {
@ -238,12 +240,10 @@ export default {
buttonClick(val) { buttonClick(val) {
if (val.btnName === 'search') { if (val.btnName === 'search') {
if (val.timeVal && val.timeVal.length > 0) { if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.startTime = moment( this.queryParams.startTime =
val.timeVal[0] + ' 00:00:00' moment(val.timeVal[0] + ' 00:00:00').valueOf() + 25200000;
).valueOf(); this.queryParams.endTime =
this.queryParams.endTime = moment( moment(val.timeVal[1] + ' 23:59:59').valueOf() + 25200000;
val.timeVal[1] + ' 23:59:59'
).valueOf();
} }
this.queryParams.lineId = val.lineId; this.queryParams.lineId = val.lineId;
this.getList(); this.getList();

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 10:01:33 * @Date: 2024-04-18 10:01:33
* @LastEditTime: 2024-04-25 13:40:36 * @LastEditTime: 2024-04-26 09:42:54
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -56,7 +56,7 @@ const tableProps = [
}, },
{ {
prop: 'equipmentName', prop: 'equipmentName',
label: '', label: '机械手名称',
width: '200' width: '200'
}, },
{ {
@ -395,6 +395,11 @@ export default {
}; };
</script> </script>
<style> <style>
.baseTable {
border-color: #D1D4DB;
background-color: #F2F4F9;
}
.baseTable .el-table__body tr.current-row>td.el-table__cell { .baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC; background-color: #EAF1FC;
} }

View File

@ -1,14 +1,14 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 15:07:53 * @Date: 2024-04-18 15:07:53
* @LastEditTime: 2024-04-25 13:41:27 * @LastEditTime: 2024-04-26 09:41:54
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-table :header-cell-style="{ <el-table :max-height="tableH" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}" class="baseTable" border id="exportTable" :data="tableData" style="width: 100%" :span-method="objectSpanMethod"> }" class="baseTable" border id="exportTable" :data="tableData" style="width: 100%" :span-method="objectSpanMethod">
@ -40,6 +40,8 @@ import {
} from '@/api/report/qcReport'; } from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
// import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
// import { getList, } from "@/api/base/qualityScrapType"; // import { getList, } from "@/api/base/qualityScrapType";
const tableProps = [ const tableProps = [
// { // {
@ -54,7 +56,7 @@ const tableProps = [
}, },
{ {
prop: 'dataType', prop: 'dataType',
label: '', label: '类别',
width: '150', width: '150',
}, },
{ {
@ -67,11 +69,16 @@ const tableProps = [
}, },
{ {
prop: 'area', prop: 'area',
label: '面积' label: '面积(㎡)'
}, },
{ {
prop: 'rate', prop: 'rate',
label: '占比%', label: '占比(%)',
// filter: (val) => val == false ? '' : '',
},
{
prop: 'rateSum',
label: '综合成品率(%)',
// filter: (val) => val == false ? '' : '', // filter: (val) => val == false ? '' : '',
}, },
// { // {
@ -129,7 +136,7 @@ export default {
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'checkTime', param: 'checkTime',
defaultSelect: [new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime(), new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000], defaultSelect: [new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000, new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()],
width: 350 width: 350
}, },
{ {
@ -167,8 +174,8 @@ export default {
created() { }, created() { },
mounted() { mounted() {
// this.formConfig[1].defaultSelect[] // this.formConfig[1].defaultSelect[]
this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000
this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000 this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.getDataList() this.getDataList()
this.getDict() this.getDict()
@ -286,14 +293,15 @@ export default {
// }) // })
this.tableData = response.data.map((ele) => { this.tableData = response.data.map((ele) => {
return { return {
dataType: ele.dataType == 1 ? '成品' : ele.dataType == 2 ? '取样' : '废版', dataType: ele.dataType == 1 ? '成品' : ele.dataType == 2 ? '取样' : ele.dataType == 4 ? '合计' : ele.dataType == 3 ? '废版' : '',
code: ele.code, code: ele.code,
putNum: ele.putNum, putNum: ele.putNum,
lineName: ele.lineName, lineName: ele.lineName,
type: ele.type, type: ele.type == '合计' ? '' : ele.type,
pieces: ele.pieces, pieces: ele.pieces,
area: ele.area, area: ele.area,
rate: (ele.rate * 100).toFixed(2) rate: ele.lineName != '总计' && ele.rate ? (ele.rate * 100).toFixed(2) : '',
rateSum: ele.lineName === '总计' ? (ele.rate * 100).toFixed(2) : ''
// useNum: ele.useNum, // useNum: ele.useNum,
// num: ele.num, // num: ele.num,
// size: typeof (ele.size) // size: typeof (ele.size)
@ -357,8 +365,10 @@ export default {
// this.listQuery.materialId = val.materialId ? val.materialId : undefined; // this.listQuery.materialId = val.materialId ? val.materialId : undefined;
// this.listQuery.startTime = '1706144404000'; // this.listQuery.startTime = '1706144404000';
// this.listQuery.endTime = '1706230804000'; // this.listQuery.endTime = '1706230804000';
this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime[0]).setHours(7, 0, 0, 0)).getTime() : undefined; // this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000
this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime[1]).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000 : undefined; // this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()
this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime[0]).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000 : undefined;
this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime[1]).setHours(6, 59, 59)).getTime() : undefined;
this.listQuery.lineId = val.lineId ? val.lineId : undefined this.listQuery.lineId = val.lineId ? val.lineId : undefined
this.getDataList(); this.getDataList();
break; break;
@ -387,6 +397,10 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
.baseTable {
border-color: #D1D4DB;
background-color: #F2F4F9;
}
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell { ::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC; background-color: #EAF1FC;
} }