Compare commits

..

No commits in common. "ed5120ca972ba5ac54785b7cb5a9bf96cf26fdf6" and "b6cf7b2ddccf707180dae67348e4bc45aff1c916" have entirely different histories.

9 changed files with 81 additions and 250 deletions

View File

@ -2,7 +2,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-23 14:04:24 * @LastEditTime: 2024-04-22 09:36:58
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -266,9 +266,12 @@ export default {
// }, // },
}, },
{ {
min: 0, min: function() { //
max: 100000, return 0
minInterval: 5,// },
max: function(value) { //
return Math.ceil(value.max)
},
scale: true, scale: true,
type: 'value', type: 'value',
name: '产量/㎡', // y name: '产量/㎡', // y

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-23 14:06:05 * @LastEditTime: 2024-04-16 13:37:38
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -265,9 +265,12 @@ export default {
// }, // },
}, },
{ {
min: 0, // min: function() { //
max: 100000, // return 0
minInterval: 5,// // },
// max: function(value) { //
// return Math.ceil(value.max)
// },
scale: true, scale: true,
type: 'value', type: 'value',
name: '产量/片', // y name: '产量/片', // y

View File

@ -3,11 +3,10 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />
<base-table <base-table
class="sectionProductionTable1" class="sectionProductionTable1"
ref="sectionProductionTable11"
id="sectionProductionTable1"
:table-props="tableProp" :table-props="tableProp"
:table-data="tableData" :table-data="tableData"
:span-method="objectSpanMethod" :span-method="objectSpanMethod"
@ -16,11 +15,10 @@
<search-bar <search-bar
style="margin-top: 10px" style="margin-top: 10px"
:formConfigs="formConfig2" :formConfigs="formConfig2"
ref="searchBarForm"
@headBtnClick="buttonClick2" /> @headBtnClick="buttonClick2" />
<base-table <base-table
class="sectionProductionTable2" class="sectionProductionTable2"
ref="sectionProductionTable22"
id="sectionProductionTable2"
:table-props="tableProp2" :table-props="tableProp2"
:table-data="tableData2" :table-data="tableData2"
:span-method="objectSpanMethod2" :span-method="objectSpanMethod2"
@ -32,18 +30,17 @@ const tableProp1 = [
{ {
prop: 'lineName', prop: 'lineName',
label: '生产线', label: '生产线',
width: 80, width: 110,
fixed: true, fixed: true,
}, },
{ {
label: '时间', label: '时间',
fixed: true, fixed: true,
width: 140, width: 110,
children: [ children: [
{ {
prop: 'procedure', prop: 'procedure',
label: '工序', label: '工序',
fixed: true,
width: 140, width: 140,
}, },
], ],
@ -135,13 +132,13 @@ export default {
}, },
], ],
queryParams: { queryParams: {
startTime: '', startTime: '1706114700000',
endTime: '', endTime: '1706190300000',
lineId: '', lineId: '',
}, },
queryParams2: { queryParams2: {
startTime: '', startTime: '1706114700000',
endTime: '', endTime: '1706190300000',
lineId: '', lineId: '',
}, },
tableProp1, tableProp1,
@ -169,11 +166,6 @@ export default {
this.getLine(); this.getLine();
this.tableProp = this.tableProp1; this.tableProp = this.tableProp1;
this.tableProp2 = this.tableProp1; this.tableProp2 = this.tableProp1;
let arr = this.getTime('1');
this.queryParams.startTime = arr[0];
this.queryParams.endTime = arr[1];
this.queryParams2.startTime = arr[0];
this.queryParams2.endTime = arr[1];
this.getList(); this.getList();
this.getList2(); this.getList2();
}, },
@ -193,8 +185,8 @@ export default {
// //
originalSection({ ...this.queryParams }).then((res) => { originalSection({ ...this.queryParams }).then((res) => {
let data = res.data; let data = res.data;
this.tableProp = [];
let timeArr = this.uniqueTime(data, 'timeStr'); let timeArr = this.uniqueTime(data, 'timeStr');
this.tableProp = [];
let arr = []; let arr = [];
timeArr.map((item) => { timeArr.map((item) => {
let obj = {}; let obj = {};
@ -208,44 +200,34 @@ export default {
}); });
}, },
getTime(val) { getTime(val) {
let nowTime = moment().valueOf();
let dTime = moment(moment().format('YYYY-MM-DD') + ' 07:00:00').valueOf();
switch (val) { switch (val) {
case '1': case '1':
let fTime = moment( let nowTime = moment().valueOf();
moment(moment().valueOf() - 86400000).format('YYYY-MM-DD') + let dTime = moment(
' 19:00:00' moment().format('YYYY-MM-DD') + ' 07:00:00'
).valueOf(); ).valueOf();
let nTime = moment( let nTime = moment(
moment().format('YYYY-MM-DD') + ' 19:00:00' moment().format('YYYY-MM-DD') + ' 19:00:00'
).valueOf(); ).valueOf();
if (nowTime <= dTime) { let fTime =
return [fTime, nowTime]; moment(moment().valueOf() - 86400).format('YYYY-MM-DD') +
} else if (nowTime > dTime && nowTime <= nTime) { ' 19:00:00';
return [dTime, nowTime]; console.log(fTime);
} else { // if (nowTime >= dTime) {
return [nTime, nowTime]; // return [dTime, nowTime]
} // }else if (){
// }
break; break;
case '2': case '2':
let lastTime = nowTime - 86400000;
return [lastTime, nowTime];
break; break;
default: default:
let f1Time = dTime - 86400000 * 2;
let f2Time = dTime - 86400000;
if (nowTime <= dTime) {
return [f1Time, f2Time];
} else {
return [f2Time, dTime];
}
} }
}, },
buttonClick(val) { buttonClick(val) {
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.queryParams.lineId = val.lineId; this.queryParams.lineId = val.lineId;
this.queryParams.startTime = this.getTime(val.timeType)[0]; this.getTime(val.timeType);
this.queryParams.endTime = this.getTime(val.timeType)[1];
this.getList(); this.getList();
} else { } else {
// //
@ -286,61 +268,39 @@ 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) => {
let obj = {}; let obj = {};
obj.lineName = data[i].lineName; obj.lineName = data[i].lineName;
obj.procedure = item.name; obj.procedure = item.name;
obj.eName = item.ename;
obj[data[i].timeStr] = data[i][item.ename]; obj[data[i].timeStr] = data[i][item.ename];
tempData.push(obj); tempData.push(obj);
}); });
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[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.reTable1();
});
},
reTable1() {
this.$refs.sectionProductionTable11.doLayout('sectionProductionTable1');
},
reTable2() {
this.$refs.sectionProductionTable22.doLayout('sectionProductionTable2');
}, },
// //
uniqueTime(arr, prop) { uniqueTime(arr, prop) {
@ -397,17 +357,12 @@ export default {
arr.push({ prop: 'sum', label: '合计' }); arr.push({ prop: 'sum', label: '合计' });
this.tableProp2 = this.tableProp1.concat(arr); // this.tableProp2 = this.tableProp1.concat(arr); //
this.getSpanArr(this.tableData2); this.getSpanArr(this.tableData2);
this.$nextTick(() => {
this.reTable2();
});
}); });
}, },
// 2 // 2
buttonClick2(val) { buttonClick2(val) {
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.queryParams2.lineId = val.lineId; this.queryParams2.lineId = val.lineId;
this.queryParams2.startTime = this.getTime(val.timeType)[0];
this.queryParams2.endTime = this.getTime(val.timeType)[1];
this.getList2(); this.getList2();
} else { } else {
this.exportTable('.sectionProductionTable2', '深加工工段数据.xlsx', 1); this.exportTable('.sectionProductionTable2', '深加工工段数据.xlsx', 1);

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-23 15:05:47 * @LastEditTime: 2024-04-22 08:42:07
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -36,19 +36,6 @@
<el-table-column prop="message"></el-table-column> <el-table-column prop="message"></el-table-column>
</el-table-column> --> </el-table-column> -->
<el-table-column v-for="(item,index) in codeList " :prop="item" :label="item"> <el-table-column v-for="(item,index) in codeList " :prop="item" :label="item">
<!-- <template slot-scope="scope">
<el-col :span="12">
{{ codeList[index] }}
</el-col>
<el-col :span="12">
</el-col>
<el-row>
<el-col :span="24">
{{ scope.row.sj2 }}
</el-col>
</el-row>
</template> -->
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
@ -185,7 +172,7 @@ export default {
spanOneArr.push(1); spanOneArr.push(1);
} else { } else {
// //
if (item.classType === this.tableData[index - 1].classType) { if (item.className === this.tableData[index - 1].className) {
spanOneArr[concatOne] += 1; spanOneArr[concatOne] += 1;
spanOneArr.push(0); spanOneArr.push(0);
} else { } else {
@ -203,14 +190,6 @@ export default {
colspan: _col colspan: _col
} }
} }
// if (columnIndex === 1 ) {
// if (rowIndex === 0 || rowIndex === 2 || rowIndex === 4 || rowIndex === 6 || rowIndex === 8 || rowIndex === 10) {
// return {
// rowspan: 2,
// colspan: 1
// }
// }
// }
}, },
handleExport() { handleExport() {
// //
@ -281,23 +260,6 @@ export default {
'sj14': null, 'sj14': null,
putType: '投入数量' putType: '投入数量'
}, },
{
classType: 1,
className: '白班(8:00-20:00)',
'sj1': null,
'sj2': null,
'sj3': null,
'sj4': null,
'sj5': null,
'sj7': null,
'sj8': null,
'sj10': null,
'sj11': null,
'sj12': null,
'sj13': null,
'sj14': null,
putType: ''
},
{ {
classType: 1, classType: 1,
className: '白班(8:00-20:00)', className: '白班(8:00-20:00)',
@ -315,23 +277,6 @@ export default {
'sj14': null, 'sj14': null,
putType: '投入次数' putType: '投入次数'
}, },
{
classType: 1,
className: '白班(8:00-20:00)',
'sj1': null,
'sj2': null,
'sj3': null,
'sj4': null,
'sj5': null,
'sj7': null,
'sj8': null,
'sj10': null,
'sj11': null,
'sj12': null,
'sj13': null,
'sj14': null,
putType: ''
},
{ {
classType: 2, classType: 2,
className: '夜班(20:00-8:00)', className: '夜班(20:00-8:00)',
@ -349,23 +294,6 @@ export default {
'sj14': null, 'sj14': null,
putType: '投入数量', putType: '投入数量',
}, },
{
classType: 2,
className: '夜班(8:00-20:00)',
'sj1': null,
'sj2': null,
'sj3': null,
'sj4': null,
'sj5': null,
'sj7': null,
'sj8': null,
'sj10': null,
'sj11': null,
'sj12': null,
'sj13': null,
'sj14': null,
putType: ''
},
{ {
classType:2, classType:2,
className: '夜班(20:00-8:00)', className: '夜班(20:00-8:00)',
@ -384,24 +312,7 @@ export default {
putType: '投入次数', putType: '投入次数',
}, },
{ {
classType: 2, classType: 1,
className: '夜班(8:00-20:00)',
'sj1': null,
'sj2': null,
'sj3': null,
'sj4': null,
'sj5': null,
'sj7': null,
'sj8': null,
'sj10': null,
'sj11': null,
'sj12': null,
'sj13': null,
'sj14': null,
putType: ''
},
{
classType: 3,
className: '全天', className: '全天',
'sj1': null, 'sj1': null,
'sj2': null, 'sj2': null,
@ -418,24 +329,7 @@ export default {
putType: '投入数量', putType: '投入数量',
}, },
{ {
classType: 3, classType: 2,
className: '全天',
'sj1': null,
'sj2': null,
'sj3': null,
'sj4': null,
'sj5': null,
'sj7': null,
'sj8': null,
'sj10': null,
'sj11': null,
'sj12': null,
'sj13': null,
'sj14': null,
putType: ''
},
{
classType: 3,
className: '全天', className: '全天',
'sj1': null, 'sj1': null,
'sj2': null, 'sj2': null,
@ -450,37 +344,20 @@ export default {
'sj13': null, 'sj13': null,
'sj14': null, 'sj14': null,
putType: '投入次数', putType: '投入次数',
}, }
{
classType: 3,
className: '全天',
'sj1': null,
'sj2': null,
'sj3': null,
'sj4': null,
'sj5': null,
'sj7': null,
'sj8': null,
'sj10': null,
'sj11': null,
'sj12': null,
'sj13': null,
'sj14': null,
putType: ''
},
] ]
res.data.forEach((ele) => { res.data.forEach((ele) => {
this.codeList.forEach((item) => { this.codeList.forEach((item) => {
if (ele.classType === 1 && ele.code == item) { if (ele.classType === 1 && ele.code == item) {
// console.log(arr[0][item]) // console.log(arr[0][item])
arr[0][item] = ele.putNum arr[0][item] = ele.putNum
arr[2][item] = ele.useNum arr[1][item] = ele.useNum
} else if (ele.classType === 2 && ele.code == item) { } else if (ele.classType === 2 && ele.code == item) {
arr[4][item] = ele.putNum arr[2][item] = ele.putNum
arr[6][item] = ele.useNum arr[3][item] = ele.useNum
} else if (ele.classType === 3 && ele.code == item) { } else if (ele.classType === 3 && ele.code == item) {
arr[8][item] = ele.putNum arr[4][item] = ele.putNum
arr[10][item] = ele.useNum arr[5][item] = ele.useNum
} }
}) })
}) })

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-23 15:08:51 * @LastEditTime: 2024-04-23 13:46:29
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -154,7 +154,7 @@ export default {
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'checkTime', param: 'checkTime',
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 350 width: 250
}, },
{ {
type: 'select', type: 'select',

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-23 15:08:44 * @LastEditTime: 2024-04-23 13:51:05
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -222,7 +222,7 @@ export default {
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'checkTime', param: 'checkTime',
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 350 width: 250
}, },
{ {
type: 'button', type: 'button',
@ -653,24 +653,25 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style>
::v-deep.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;
} }
::v-deep .baseTable .el-table .el-table__cell { .baseTable .el-table .el-table__cell {
padding: 0; padding: 0;
height: 35px; height: 35px;
} }
::v-deep.el-table thead.is-group th {
.el-table thead.is-group th {
background: none; background: none;
} }
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type { .el-table thead.is-group tr:first-of-type th:first-of-type {
border-bottom: none; border-bottom: none;
} }
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type:before { .el-table thead.is-group tr:first-of-type th:first-of-type:before {
content: ''; content: '';
position: absolute; position: absolute;
width: 1px; width: 1px;
@ -686,7 +687,7 @@ export default {
transform-origin: top; transform-origin: top;
} }
::v-deep.el-table thead.is-group tr:last-of-type th:first-of-type:before { .el-table thead.is-group tr:last-of-type th:first-of-type:before {
content: ''; content: '';
position: absolute; position: absolute;
width: 1px; width: 1px;
@ -701,5 +702,4 @@ export default {
/*这里需要自己调整,根据线的位置*/ /*这里需要自己调整,根据线的位置*/
transform-origin: bottom; transform-origin: bottom;
} }
</style> </style>

View File

@ -3,11 +3,10 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />
<base-table <base-table
class="israLineReportTable1" class="israLineReportTable1"
ref="israLineReportTable11"
id="israLineReportTable1"
:table-props="tableProp" :table-props="tableProp"
:table-data="tableData" :table-data="tableData"
:span-method="objectSpanMethod" :span-method="objectSpanMethod"
@ -200,12 +199,6 @@ export default {
} }
this.tableData = part2Data; this.tableData = part2Data;
this.getSpanArr(this.tableData); this.getSpanArr(this.tableData);
this.$nextTick(() => {
this.reTable();
});
},
reTable() {
this.$refs.israLineReportTable11.doLayout('israLineReportTable1');
}, },
// 线 // 线
uniqueLine(arr, prop) { uniqueLine(arr, prop) {

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-23 15:08:40 * @LastEditTime: 2024-04-23 13:51:30
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -129,7 +129,7 @@ export default {
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'checkTime', param: 'checkTime',
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 350 width: 250
}, },
{ {
type: 'select', type: 'select',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 15:07:53 * @Date: 2024-04-18 15:07:53
* @LastEditTime: 2024-04-23 15:07:51 * @LastEditTime: 2024-04-23 13:51:20
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -99,7 +99,7 @@ export default {
listQuery: { listQuery: {
startTime: undefined, startTime: undefined,
endTime: undefined, endTime: undefined,
lineId:undefined lineId:null
}, },
formConfig: [ formConfig: [
// { // {
@ -128,7 +128,7 @@ export default {
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'checkTime', param: 'checkTime',
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 350 width: 250
}, },
{ {
type: 'select', type: 'select',