|
|
|
|
@ -2412,8 +2412,7 @@ export default {
|
|
|
|
|
const params = {
|
|
|
|
|
page: this.summaryModal.pageIndex,
|
|
|
|
|
page_size: this.summaryModal.pageSize,
|
|
|
|
|
sort_name: 'status',
|
|
|
|
|
sort_type: 'DESC',
|
|
|
|
|
inventory_grouped_sort: 1,
|
|
|
|
|
'filter[0][key]': 'material_infos_plan_id',
|
|
|
|
|
'filter[0][op]': 'eq',
|
|
|
|
|
'filter[0][value]': this.summaryModal.data.id
|
|
|
|
|
@ -2422,23 +2421,6 @@ export default {
|
|
|
|
|
const res = await getStocktakingPlanLinkList(qs.stringify(params))
|
|
|
|
|
if (res && res.list) {
|
|
|
|
|
const list = res.list.data || []
|
|
|
|
|
// 对数据进行排序:盘点数量和在库数量不同的排在前面
|
|
|
|
|
list.sort((a, b) => {
|
|
|
|
|
// 判断 a 是否不同
|
|
|
|
|
const aQuantity = a.check_num
|
|
|
|
|
const aOriginalQuantity = a.inventory?.zaikushuliang
|
|
|
|
|
const aIsDifferent = (aOriginalQuantity == null || aOriginalQuantity === '') || (aOriginalQuantity != null && String(aQuantity) !== String(aOriginalQuantity))
|
|
|
|
|
|
|
|
|
|
// 判断 b 是否不同
|
|
|
|
|
const bQuantity = b.check_num
|
|
|
|
|
const bOriginalQuantity = b.inventory?.zaikushuliang
|
|
|
|
|
const bIsDifferent = (bOriginalQuantity == null || bOriginalQuantity === '') || (bOriginalQuantity != null && String(bQuantity) !== String(bOriginalQuantity))
|
|
|
|
|
|
|
|
|
|
// 不同的排在前面(返回负数表示 a 排在前面,正数表示 b 排在前面)
|
|
|
|
|
if (aIsDifferent && !bIsDifferent) return -1
|
|
|
|
|
if (!aIsDifferent && bIsDifferent) return 1
|
|
|
|
|
return 0
|
|
|
|
|
})
|
|
|
|
|
this.summaryModal.inventoryList = list
|
|
|
|
|
this.summaryModal.total = res.list.total || list.length
|
|
|
|
|
}
|
|
|
|
|
@ -2471,6 +2453,7 @@ export default {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
is_export: 1,
|
|
|
|
|
inventory_grouped_sort: 1,
|
|
|
|
|
'filter[0][key]': 'material_infos_plan_id',
|
|
|
|
|
'filter[0][op]': 'eq',
|
|
|
|
|
'filter[0][value]': targetPlanId,
|
|
|
|
|
|