diff --git a/src/api/distribution/distributionReservation.js b/src/api/distribution/distributionReservation.js index 362563cd..0dba21ab 100644 --- a/src/api/distribution/distributionReservation.js +++ b/src/api/distribution/distributionReservation.js @@ -235,6 +235,19 @@ export const getDeliveryZeroOrderDetail = (deliveryId,id) => { }); } +/** + * 查询预约计划零担详情 + * @param ids + * @returns {AxiosPromise} + */ +export const getReservationPackageListByOrderId = (reservationId,orderId,current, size) => { + return request({ + url: '/api/logpm-distribution/reservation/getReservationPackageListByOrderId', + method: 'get', + params: { reservationId,orderId,current, size } + }); +} + diff --git a/src/api/distribution/distributionStockArticle.js b/src/api/distribution/distributionStockArticle.js index c46710de..70296e77 100644 --- a/src/api/distribution/distributionStockArticle.js +++ b/src/api/distribution/distributionStockArticle.js @@ -250,4 +250,16 @@ export const selectUpdateAvailableStockArticle = (current, size, params) => { }) } +export const getPackageListByStockArticleId = (current, size, orderId) => { + return request({ + url: '/api/logpm-distribution/distributionStockArticle/getPackageListByStockArticleId', + method: 'get', + params: { + orderId, + current, + size, + } + }) +} + diff --git a/src/views/distribution/reservation/reservationAddFrom.vue b/src/views/distribution/reservation/reservationAddFrom.vue index f3b0c9a1..f80327a3 100644 --- a/src/views/distribution/reservation/reservationAddFrom.vue +++ b/src/views/distribution/reservation/reservationAddFrom.vue @@ -589,11 +589,11 @@ autonomouslySave, update, remove, - getReservationInfo, getReservationZeroOrderDetail + getReservationInfo, getReservationZeroOrderDetail, getReservationPackageListByOrderId } from '@/api/distribution/distributionReservation'; import { getStockArticleList, - selectStockArticleList, + getPackageListByStockArticleId, selectStockArticleInfoList, selectUpdateAvailableStockArticle, getZeroOrderDetail } from '@/api/distribution/distributionStockArticle'; @@ -2053,68 +2053,79 @@ this.loading = true; this.packageList = row.packageList; this.obj = row; + let page = this.page; console.log('row>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', row); if (this.reservationId) { - //这里就是编辑的数据回显问题 - let packageInfo = row.parcelListVOS; - // this.packageData = row.parcelListVOS; - let packageListData = this.packageData; - if (row.packageList.length > 0) { - let packageListInfo = row.packageList; - packageInfo.forEach((item, index) => { - packageListInfo.forEach(p => { - if (item.id === p.id) { - this.$nextTick(() => { - this.$refs.packageList.toggleRowSelection(this.packageData[index], true); - }); - } - }); - }); - } else { - //新增订单,默认全选 - packageInfo.forEach((item, index) => { - this.$nextTick(() => { - this.$refs.packageList.toggleRowSelection(this.packageData[index], true); - }); - }); - } - this.packageData = row.parcelListVOS; + getReservationPackageListByOrderId(this.reservationId,row.id,page.currentPage,page.pageSize).then(res=>{ + console.log("->>>>>>>>>>>>>>>>>>",res); + }) + - // 当row内packageList为空时, 默认全选 - if (row.packageList.length === 0) { - this.packageDataSec = row.parcelListVOS; - } else { - this.packageDataSec = row.parcelListVOS.filter(item => { - return row.packageList.some(value => value.id === item.id); - }); - } + + + // //这里就是编辑的数据回显问题 + // let packageInfo = row.parcelListVOS; + // // this.packageData = row.parcelListVOS; + // let packageListData = this.packageData; + // if (row.packageList.length > 0) { + // let packageListInfo = row.packageList; + // packageInfo.forEach((item, index) => { + // packageListInfo.forEach(p => { + // if (item.id === p.id) { + // this.$nextTick(() => { + // this.$refs.packageList.toggleRowSelection(this.packageData[index], true); + // }); + // } + // }); + // }); + // } else { + // //新增订单,默认全选 + // packageInfo.forEach((item, index) => { + // this.$nextTick(() => { + // this.$refs.packageList.toggleRowSelection(this.packageData[index], true); + // }); + // }); + // } + // this.packageData = row.parcelListVOS; + // + // // 当row内packageList为空时, 默认全选 + // if (row.packageList.length === 0) { + // this.packageDataSec = row.parcelListVOS; + // } else { + // this.packageDataSec = row.parcelListVOS.filter(item => { + // return row.packageList.some(value => value.id === item.id); + // }); + // } } else { - this.packageData = row.parcelListVOS; - this.packageDataSec = row.parcelListVOS; - //这里回显展示的效果应该是展示被其他预约单勾选的订单处于禁用勾选,冻结订单处于禁用无法勾选,其他默认为全选 - let data = row.parcelListVOS; - data.forEach((item, index) => { - if ( - item.orderPackageReservationStatusName === '已预约' || - item.orderPackageReservationStatus === '20' - ) { - // //这里就是表示包件此时状态处于已预约,表示该订单下的这个包件信息被其他的预约信息使用,此时应该处于勾选禁用状态 - this.$nextTick(() => { - this.$refs.packageList.toggleRowSelection(this.packageData[index], true); - }); - // console.log('::', item); - // this.checkPackage(item, index); - } - // else if ( - // item.orderPackageFreezeStatusName !== '已冻结' || - // item.orderPackageFreezeStatus !== '20' - // ) { - // this.$nextTick(() => { - // this.$refs.packageList.toggleRowSelection(this.packageData[index], true); - // }); - // } - }); + getPackageListByStockArticleId(page.currentPage,page.pageSize,row.id).then(res=>{ + console.log("res---------------->",res); + }) + // this.packageData = row.parcelListVOS; + // this.packageDataSec = row.parcelListVOS; + // //这里回显展示的效果应该是展示被其他预约单勾选的订单处于禁用勾选,冻结订单处于禁用无法勾选,其他默认为全选 + // let data = row.parcelListVOS; + // data.forEach((item, index) => { + // if ( + // item.orderPackageReservationStatusName === '已预约' || + // item.orderPackageReservationStatus === '20' + // ) { + // // //这里就是表示包件此时状态处于已预约,表示该订单下的这个包件信息被其他的预约信息使用,此时应该处于勾选禁用状态 + // this.$nextTick(() => { + // this.$refs.packageList.toggleRowSelection(this.packageData[index], true); + // }); + // // console.log('::', item); + // // this.checkPackage(item, index); + // } + // // else if ( + // // item.orderPackageFreezeStatusName !== '已冻结' || + // // item.orderPackageFreezeStatus !== '20' + // // ) { + // // this.$nextTick(() => { + // // this.$refs.packageList.toggleRowSelection(this.packageData[index], true); + // // }); + // // } + // }); } this.isaddvalue = true; this.loading = false;