|
|
@@ -40,6 +40,7 @@
|
|
|
:row-style="{ height: '20px' }" :selectable="checkboxT"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
:header-cell-style="{ padding: '0px' }" @row-click="pchzRowClick"
|
|
|
+ :row-class-name="pchzrowClassStyle"
|
|
|
highlight-current-row="true" @row-dblclick="gytableDatadoubleClick" id="pchztable"
|
|
|
style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="pchztableData" row-key="ID" >
|
|
|
<el-table-column fixed align="left" label="机台编号" prop="机台编号" width="110"/>
|
|
|
@@ -129,9 +130,10 @@
|
|
|
v-if="ismachine"
|
|
|
:show-overflow-tooltip="true"
|
|
|
@selection-change="selectionChange($event)"
|
|
|
- :row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
|
|
|
+ :row-style="{ height: '20px' }" :cell-class-name="tableDataCellClass"
|
|
|
:cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="sbmxRowClick"
|
|
|
+ :row-class-name="sbmxrowClassStyle"
|
|
|
highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="sbmxtable"
|
|
|
style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="sbmxtableData" row-key="ID" >
|
|
|
<el-table-column align="left" fixed label="机台编号" prop="机台编号" width="90"/>
|
|
|
@@ -251,7 +253,11 @@ const getTreeData = async () => {
|
|
|
children: []
|
|
|
};
|
|
|
|
|
|
- for (const year in rawData['设备工时达成率统计']) {
|
|
|
+ // 获取所有年份并按降序排序
|
|
|
+ const sortedYears = Object.keys(rawData['设备工时达成率统计'])
|
|
|
+ .sort((a, b) => parseInt(b) - parseInt(a));
|
|
|
+
|
|
|
+ for (const year of sortedYears) {
|
|
|
const yearData = rawData['设备工时达成率统计'][year];
|
|
|
if (!yearData) continue;
|
|
|
|
|
|
@@ -260,7 +266,16 @@ const getTreeData = async () => {
|
|
|
children: []
|
|
|
};
|
|
|
|
|
|
- for (const monthKey in yearData) {
|
|
|
+ // 获取该年所有月份并按降序排序
|
|
|
+ const sortedMonths = Object.keys(yearData)
|
|
|
+ .sort((a, b) => {
|
|
|
+ // 处理格式为YYYYMM的月份键
|
|
|
+ const monthA = a.length === 6 ? parseInt(a.substring(4)) : parseInt(a);
|
|
|
+ const monthB = b.length === 6 ? parseInt(b.substring(4)) : parseInt(b);
|
|
|
+ return monthB - monthA;
|
|
|
+ });
|
|
|
+
|
|
|
+ for (const monthKey of sortedMonths) {
|
|
|
const monthData = yearData[monthKey];
|
|
|
if (!monthData) continue;
|
|
|
|
|
|
@@ -336,10 +351,12 @@ const handleNodeExpand = (nodeData, node) => {
|
|
|
console.log('节点展开:', nodeData)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+const currentjtbh = ref('')//储存设备汇总表格当前选中的机台编号
|
|
|
+const currentrq = ref('')//储存设备明细表格当前选中的日期
|
|
|
// 排产表格行点击事件处理
|
|
|
const pchzRowClick = async (row) => {
|
|
|
console.log('行点击:', row)
|
|
|
+ currentjtbh.value = row.机台编号;
|
|
|
const response = await PARDetail({jtbh:row.机台编号,bz:row.班组})
|
|
|
if (response?.code === 0 && Array.isArray(response.data)) {
|
|
|
pcmxtableData.value = response.data;
|
|
|
@@ -347,7 +364,7 @@ const pchzRowClick = async (row) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 排产表格行点击事件处理
|
|
|
+// 设备汇总表格行点击事件处理
|
|
|
const sbhzRowClick = async (row) => {
|
|
|
console.log('行点击:', row)
|
|
|
const response = await PARDetailpro({jtbh:row.机台编号,bz:row.班组,rq:row.sczl_rq})
|
|
|
@@ -355,8 +372,15 @@ const sbhzRowClick = async (row) => {
|
|
|
sbmxtableData.value = response.data;
|
|
|
console.log('表格数据更新成功:', response.data);
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+//设备明细表格行点击事件处理
|
|
|
+const sbmxRowClick = async (row) => {
|
|
|
+ currentrq.value = row.日期;
|
|
|
+}
|
|
|
|
|
|
|
|
|
//导出按钮(汇总)
|
|
|
@@ -532,7 +556,20 @@ const rqexcelcloseDialog = () => {
|
|
|
};
|
|
|
|
|
|
|
|
|
-
|
|
|
+ //===============颜色==================================
|
|
|
+//排产汇总表格样式
|
|
|
+const pchzrowClassStyle = ({row,rowIndex}) =>{
|
|
|
+ if(row['机台编号']== currentjtbh.value){
|
|
|
+ return "warning-row"
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//设备明细表格样式
|
|
|
+ const sbmxrowClassStyle = ({row,rowIndex}) =>{
|
|
|
+ if(row['日期']== currentrq.value){
|
|
|
+ return "warning-row"
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@@ -590,6 +627,9 @@ const rqexcelcloseDialog = () => {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ :deep(.el-table__body .warning-row) {
|
|
|
+ background: #FFFF80 !important;
|
|
|
+}
|
|
|
/* 选中某行时的背景色 */
|
|
|
:deep(.el-table__body tr.current-row) > td {
|
|
|
background: #ff80ff !important;
|