Browse Source

2025-10-30

生产派工单列表支持拖拽
master
fengyuan_yang 3 months ago
parent
commit
53fc7ce644
  1. 49
      src/views/modules/shopOrder/productionOrderScheduling/searchProductionDispatchList.vue

49
src/views/modules/shopOrder/productionOrderScheduling/searchProductionDispatchList.vue

@ -122,6 +122,18 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 -->
<el-pagination
style="margin-top: 0px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 动态列 --> <!-- 动态列 -->
@ -197,6 +209,9 @@ export default {
date6: '', date6: '',
user: this.$store.state.user.name user: this.$store.state.user.name
}, },
pageIndex: 1,
pageSize: 50,
totalPage: 0,
dataList: [], dataList: [],
dataListLoading: false, dataListLoading: false,
buttons: { buttons: {
@ -982,7 +997,7 @@ export default {
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight - 180;
this.height = window.innerHeight - 207;
// //
this.initSortable(); this.initSortable();
}) })
@ -1036,7 +1051,7 @@ export default {
reassignSerialNumbers(oldIndex, newIndex) { reassignSerialNumbers(oldIndex, newIndex) {
// site resourceId // site resourceId
const groupedData = {}; const groupedData = {};
this.dataList.forEach((item) => { this.dataList.forEach((item) => {
const key = `${item.site}_${item.sResourceID}`; const key = `${item.site}_${item.sResourceID}`;
if (!groupedData[key]) { if (!groupedData[key]) {
@ -1049,11 +1064,11 @@ export default {
const updateList = []; const updateList = [];
Object.keys(groupedData).forEach(key => { Object.keys(groupedData).forEach(key => {
const group = groupedData[key]; const group = groupedData[key];
// 1 // 1
group.forEach((item, index) => { group.forEach((item, index) => {
const newSerialNumber = index + 1; const newSerialNumber = index + 1;
// //
if (item.serialNumber !== newSerialNumber) { if (item.serialNumber !== newSerialNumber) {
updateList.push({ updateList.push({
@ -1112,7 +1127,7 @@ export default {
if (targetIndex !== -1) { if (targetIndex !== -1) {
const targetItem = this.dataList[targetIndex]; const targetItem = this.dataList[targetIndex];
// //
this.scheduleRow = targetItem; this.scheduleRow = targetItem;
@ -1181,19 +1196,22 @@ export default {
getData() { getData() {
this.scheduleRow = null; this.scheduleRow = null;
//
//
const searchDataWithTimestamp = { const searchDataWithTimestamp = {
...this.searchData, ...this.searchData,
page: this.pageIndex,
limit: this.pageSize,
_timestamp: new Date().getTime() _timestamp: new Date().getTime()
}; };
return searchProductionDispatchList(searchDataWithTimestamp).then(({data}) => { return searchProductionDispatchList(searchDataWithTimestamp).then(({data}) => {
// //
this.dataList = []; this.dataList = [];
this.totalPage = data.total || 0;
// tick // tick
this.$nextTick(() => { this.$nextTick(() => {
this.dataList = data.rows; this.dataList = data.rows;
// tickDOM // tickDOM
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.dispatchTable) { if (this.$refs.dispatchTable) {
@ -1201,10 +1219,23 @@ export default {
} }
}); });
}); });
return data.rows; return data.rows;
}); });
}, },
//
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getData();
},
//
currentChangeHandle(val) {
this.pageIndex = val;
this.getData();
},
//excel //excel
createExportData() { createExportData() {

Loading…
Cancel
Save