diff --git a/src/views/modules/shopOrder/productionOrderScheduling/searchProductionDispatchList.vue b/src/views/modules/shopOrder/productionOrderScheduling/searchProductionDispatchList.vue index d95ca79..222ec41 100644 --- a/src/views/modules/shopOrder/productionOrderScheduling/searchProductionDispatchList.vue +++ b/src/views/modules/shopOrder/productionOrderScheduling/searchProductionDispatchList.vue @@ -122,6 +122,18 @@ + + + + @@ -197,6 +209,9 @@ export default { date6: '', user: this.$store.state.user.name }, + pageIndex: 1, + pageSize: 50, + totalPage: 0, dataList: [], dataListLoading: false, buttons: { @@ -982,7 +997,7 @@ export default { }, mounted() { this.$nextTick(() => { - this.height = window.innerHeight - 180; + this.height = window.innerHeight - 207; // 初始化拖拽排序 this.initSortable(); }) @@ -1036,7 +1051,7 @@ export default { reassignSerialNumbers(oldIndex, newIndex) { // 按照 site 和 resourceId 分组 const groupedData = {}; - + this.dataList.forEach((item) => { const key = `${item.site}_${item.sResourceID}`; if (!groupedData[key]) { @@ -1049,11 +1064,11 @@ export default { const updateList = []; Object.keys(groupedData).forEach(key => { const group = groupedData[key]; - + // 按当前顺序重新分配序号(从1开始) group.forEach((item, index) => { const newSerialNumber = index + 1; - + // 只更新序号发生变化的记录 if (item.serialNumber !== newSerialNumber) { updateList.push({ @@ -1112,7 +1127,7 @@ export default { if (targetIndex !== -1) { const targetItem = this.dataList[targetIndex]; - + // 找到目标行,设置为当前选中行 this.scheduleRow = targetItem; @@ -1181,19 +1196,22 @@ export default { getData() { this.scheduleRow = null; - // 添加时间戳防止缓存 + // 添加时间戳防止缓存和分页参数 const searchDataWithTimestamp = { ...this.searchData, + page: this.pageIndex, + limit: this.pageSize, _timestamp: new Date().getTime() }; return searchProductionDispatchList(searchDataWithTimestamp).then(({data}) => { // 先清空数据列表,强制表格重新渲染 this.dataList = []; - + this.totalPage = data.total || 0; + // 在下一个tick中设置数据并清除排序 this.$nextTick(() => { this.dataList = data.rows; - + // 再等一个tick确保DOM更新完成 this.$nextTick(() => { if (this.$refs.dispatchTable) { @@ -1201,10 +1219,23 @@ export default { } }); }); - + return data.rows; }); }, + + // 每页数 + sizeChangeHandle(val) { + this.pageSize = val; + this.pageIndex = 1; + this.getData(); + }, + + // 当前页 + currentChangeHandle(val) { + this.pageIndex = val; + this.getData(); + }, //导出excel createExportData() {