|
@@ -72,15 +72,25 @@
|
|
|
:label="item.label"
|
|
:label="item.label"
|
|
|
/>
|
|
/>
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ plain
|
|
|
|
|
+ class="plan-table-expand-toggle"
|
|
|
|
|
+ @click="togglePlanTableExpandAll"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ planTableExpandAll ? '收起全部' : '展开全部' }}
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<ele-pro-table
|
|
<ele-pro-table
|
|
|
- :key="planTableCacheKey"
|
|
|
|
|
|
|
+ :key="planTableCacheKey + '-' + (planTableExpandAll ? 'expanded' : 'collapsed')"
|
|
|
width="100%"
|
|
width="100%"
|
|
|
ref="planTable"
|
|
ref="planTable"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:cache-key="planTableCacheKey"
|
|
:cache-key="planTableCacheKey"
|
|
|
:datasource="sortedPlanDataList"
|
|
:datasource="sortedPlanDataList"
|
|
|
row-key="id"
|
|
row-key="id"
|
|
|
|
|
+ :default-expand-all="planTableExpandAll"
|
|
|
|
|
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
:selection.sync="selection"
|
|
:selection.sync="selection"
|
|
|
:height="planTableHeight"
|
|
:height="planTableHeight"
|
|
|
:page-size="20"
|
|
:page-size="20"
|
|
@@ -263,7 +273,7 @@
|
|
|
savePlanDotLine
|
|
savePlanDotLine
|
|
|
} from '@/api/productionPlan/planDotLine';
|
|
} from '@/api/productionPlan/planDotLine';
|
|
|
import { deepClone } from '@/utils';
|
|
import { deepClone } from '@/utils';
|
|
|
- import { compareBatchNo } from '@/utils/batchNoSort';
|
|
|
|
|
|
|
+ import { compareBatchNo, buildBatchNoTree } from '@/utils/batchNoSort';
|
|
|
import {
|
|
import {
|
|
|
EXEC_TYPE,
|
|
EXEC_TYPE,
|
|
|
EXEC_TYPE_OPTIONS,
|
|
EXEC_TYPE_OPTIONS,
|
|
@@ -317,6 +327,8 @@
|
|
|
planDataList: [],
|
|
planDataList: [],
|
|
|
allPlanDataList: [],
|
|
allPlanDataList: [],
|
|
|
selection: [],
|
|
selection: [],
|
|
|
|
|
+ // 计划表是否展开所有父子节点(按 batchNo 折叠的树形结构)
|
|
|
|
|
+ planTableExpandAll: false,
|
|
|
activeTab: 'factory',
|
|
activeTab: 'factory',
|
|
|
dateRange: [startDate, endDate],
|
|
dateRange: [startDate, endDate],
|
|
|
planPickerVisible: false,
|
|
planPickerVisible: false,
|
|
@@ -443,18 +455,13 @@
|
|
|
: 'aps-factory-scheduling-plan-table';
|
|
: 'aps-factory-scheduling-plan-table';
|
|
|
},
|
|
},
|
|
|
// 不论 planDataList 由哪条路径赋值,最终给表格用的数据都按 batchNo 排序:
|
|
// 不论 planDataList 由哪条路径赋值,最终给表格用的数据都按 batchNo 排序:
|
|
|
- // 基础号相同的,"20260914-1" 这类带 "-N" 后缀的按数字升序排在基础号之后
|
|
|
|
|
|
|
+ // 子 batchNo(20260914-1)会挂到基础号(20260914)的 children 下,
|
|
|
|
|
+ // 仅当父节点本身存在于数据中时才会折叠;父节点不存在时子项独立显示
|
|
|
sortedPlanDataList() {
|
|
sortedPlanDataList() {
|
|
|
if (!Array.isArray(this.planDataList)) {
|
|
if (!Array.isArray(this.planDataList)) {
|
|
|
return this.planDataList;
|
|
return this.planDataList;
|
|
|
}
|
|
}
|
|
|
- return [...this.planDataList].sort((a, b) =>
|
|
|
|
|
- compareBatchNo(a?.batchNo, b?.batchNo)
|
|
|
|
|
- ).sort((a, b) =>{
|
|
|
|
|
- const startTimeA = new Date(a?.startTime || 0).getTime();
|
|
|
|
|
- const startTimeB = new Date(b?.startTime || 0).getTime();
|
|
|
|
|
- return startTimeB - startTimeA
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return buildBatchNoTree(this.planDataList);
|
|
|
},
|
|
},
|
|
|
cacheKeyUrl() {
|
|
cacheKeyUrl() {
|
|
|
return this.planTableCacheKey;
|
|
return this.planTableCacheKey;
|
|
@@ -1260,6 +1267,9 @@
|
|
|
}, 0);
|
|
}, 0);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ togglePlanTableExpandAll() {
|
|
|
|
|
+ this.planTableExpandAll = !this.planTableExpandAll;
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
// Plan picker flow
|
|
// Plan picker flow
|
|
|
async planPickerDatasource({ page, limit, where }) {
|
|
async planPickerDatasource({ page, limit, where }) {
|
|
@@ -3611,6 +3621,16 @@
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
border-bottom: 1px solid #e5edf6;
|
|
border-bottom: 1px solid #e5edf6;
|
|
|
background: linear-gradient(180deg, #f9fcff 0%, #f3f7fb 100%);
|
|
background: linear-gradient(180deg, #f9fcff 0%, #f3f7fb 100%);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: flex-end;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .plan-table-expand-toggle {
|
|
|
|
|
+ margin-bottom: 4px;
|
|
|
|
|
+ height: 28px;
|
|
|
|
|
+ padding: 0 12px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.plan-table-status-tabs ::v-deep {
|
|
.plan-table-status-tabs ::v-deep {
|