|
@@ -568,7 +568,6 @@ export default {
|
|
|
pickingPageNum: 1, // 包装虚拟分页页数
|
|
pickingPageNum: 1, // 包装虚拟分页页数
|
|
|
materielPageNum: 1, // 物料虚拟分页页数
|
|
materielPageNum: 1, // 物料虚拟分页页数
|
|
|
packingSpecificationOption: [], // 包装规格下拉
|
|
packingSpecificationOption: [], // 包装规格下拉
|
|
|
- proData: []
|
|
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -1082,7 +1081,9 @@ export default {
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
showOverflowTooltip: true
|
|
|
};
|
|
};
|
|
|
- });
|
|
|
|
|
|
|
+ }).filter(item => item.label !== '包装规格');
|
|
|
|
|
+
|
|
|
|
|
+ console.log(newRes, 'newRes');
|
|
|
this.newColumns = [...newRes];
|
|
this.newColumns = [...newRes];
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -1789,8 +1790,9 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 添加物品明细
|
|
// 添加物品明细
|
|
|
async addGoods(data) {
|
|
async addGoods(data) {
|
|
|
|
|
+ if (data.length === 0) return this.$message.warning('请选择产品信息')
|
|
|
console.log(data, 'datadatadatadatadatadatadata111')
|
|
console.log(data, 'datadatadatadatadatadatadata111')
|
|
|
- this.proData = data;
|
|
|
|
|
|
|
+
|
|
|
// 获取批次号
|
|
// 获取批次号
|
|
|
const batchNo = await getCode('lot_number_code');
|
|
const batchNo = await getCode('lot_number_code');
|
|
|
// 获取供应商
|
|
// 获取供应商
|
|
@@ -1827,6 +1829,9 @@ export default {
|
|
|
1
|
|
1
|
|
|
: this.productList.length + index,
|
|
: this.productList.length + index,
|
|
|
|
|
|
|
|
|
|
+ // extField: {
|
|
|
|
|
+ // packingSpecification: item.extField.packingSpecification
|
|
|
|
|
+ // }, // 包装规格
|
|
|
categoryId: item.id, // 物品id
|
|
categoryId: item.id, // 物品id
|
|
|
categoryName: item.name, // 物品名称
|
|
categoryName: item.name, // 物品名称
|
|
|
categoryCode: item.code, // 物品编码
|
|
categoryCode: item.code, // 物品编码
|
|
@@ -2310,7 +2315,7 @@ export default {
|
|
|
let measureQuantity = 1;
|
|
let measureQuantity = 1;
|
|
|
let packingQuantity = 1;
|
|
let packingQuantity = 1;
|
|
|
let packingUnit = row.packingUnit;
|
|
let packingUnit = row.packingUnit;
|
|
|
- console.log(packingUnit, 'packingUnit 立方ma ')
|
|
|
|
|
|
|
+
|
|
|
// 处理单位为KG类,计算每桶KG值
|
|
// 处理单位为KG类,计算每桶KG值
|
|
|
if (packingBoolen) {
|
|
if (packingBoolen) {
|
|
|
if (!row.isUnpack && row.packingUnit == '立方') {
|
|
if (!row.isUnpack && row.packingUnit == '立方') {
|
|
@@ -2327,10 +2332,11 @@ export default {
|
|
|
? filterArr[0].packageCell
|
|
? filterArr[0].packageCell
|
|
|
: Number(row.packingQuantity) -
|
|
: Number(row.packingQuantity) -
|
|
|
this.$math.format(filterArr[0].packageCell * index, 14);
|
|
this.$math.format(filterArr[0].packageCell * index, 14);
|
|
|
|
|
+ console.log(measureQuantity, 'measureQuantity')
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
if (row.isUnpack == 1) {
|
|
if (row.isUnpack == 1) {
|
|
|
- console.log('1 不拆--------', measureBoolen)
|
|
|
|
|
|
|
+ console.log('1 拆--------', measureBoolen)
|
|
|
if (measureBoolen) {
|
|
if (measureBoolen) {
|
|
|
// 处理单位不为KG类,计量单位为KG类的情况
|
|
// 处理单位不为KG类,计量单位为KG类的情况
|
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
@@ -2346,27 +2352,30 @@ export default {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- console.log('2 不拆--------')
|
|
|
|
|
- let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
|
|
- (item) =>
|
|
|
|
|
- item.conversionUnit == row.packingUnit &&
|
|
|
|
|
- item.packageUnit != item.conversionUnit
|
|
|
|
|
- );
|
|
|
|
|
- for (; splitIndex > 0; splitIndex--) {
|
|
|
|
|
- measureQuantity = this.$math.format(
|
|
|
|
|
- measureQuantity *
|
|
|
|
|
- row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
|
|
- 14
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
|
|
+ // (item) =>
|
|
|
|
|
+ // item.conversionUnit == row.packingUnit &&
|
|
|
|
|
+ // item.packageUnit != item.conversionUnit
|
|
|
|
|
+ // );
|
|
|
|
|
+ // for (; splitIndex > 0; splitIndex--) {
|
|
|
|
|
+ // measureQuantity = this.$math.format(
|
|
|
|
|
+ // measureQuantity *
|
|
|
|
|
+ // row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
|
|
+ // 14
|
|
|
|
|
+ // );
|
|
|
|
|
+ // }
|
|
|
|
|
+ measureQuantity = row.packingSpecificationOption[1]?.packageCell;
|
|
|
|
|
+
|
|
|
|
|
+ console.log('3 拆--------', measureQuantity)
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- console.log('3 不拆--------')
|
|
|
|
|
|
|
+ console.log('4 拆--------')
|
|
|
if (row.packingQuantity) {
|
|
if (row.packingQuantity) {
|
|
|
measureQuantity = row.measureQuantity / row.packingQuantity;
|
|
measureQuantity = row.measureQuantity / row.packingQuantity;
|
|
|
}
|
|
}
|
|
|
- console.log(measureQuantity, 'measureQuantity')
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(measureQuantity, 'measureQuantity')
|
|
|
}
|
|
}
|
|
|
console.log(filterArr[0], 'filterArr[0]')
|
|
console.log(filterArr[0], 'filterArr[0]')
|
|
|
|
|
|
|
@@ -2386,6 +2395,17 @@ export default {
|
|
|
packageNo: packingCodeList[index]?.onlyCode, // 包装编码
|
|
packageNo: packingCodeList[index]?.onlyCode, // 包装编码
|
|
|
packingQuantity: packingQuantity, // 包装数量
|
|
packingQuantity: packingQuantity, // 包装数量
|
|
|
|
|
|
|
|
|
|
+ // packingUnit: row.isUnpack
|
|
|
|
|
+ // ? packingBoolen
|
|
|
|
|
+ // ? filterArr[0].conversionUnit
|
|
|
|
|
+ // : measureBoolen
|
|
|
|
|
+ // ? row.packingSpecificationOption[1]
|
|
|
|
|
+ // ? row.packingSpecificationOption[1].conversionUnit
|
|
|
|
|
+ // : row.packingSpecificationOption[0].conversionUnit
|
|
|
|
|
+ // : row.measureUnit
|
|
|
|
|
+ // : packingBoolen
|
|
|
|
|
+ // ? row.packingUnit === '立方' ? row.packingUnit : filterArr[0]?.conversionUnit
|
|
|
|
|
+ // : row.packingUnit,
|
|
|
packingUnit: row.isUnpack
|
|
packingUnit: row.isUnpack
|
|
|
? packingBoolen
|
|
? packingBoolen
|
|
|
? filterArr[0].conversionUnit
|
|
? filterArr[0].conversionUnit
|
|
@@ -2393,11 +2413,16 @@ export default {
|
|
|
? row.packingSpecificationOption[1]
|
|
? row.packingSpecificationOption[1]
|
|
|
? row.packingSpecificationOption[1].conversionUnit
|
|
? row.packingSpecificationOption[1].conversionUnit
|
|
|
: row.packingSpecificationOption[0].conversionUnit
|
|
: row.packingSpecificationOption[0].conversionUnit
|
|
|
- : row.measureUnit
|
|
|
|
|
|
|
+ : (() => {
|
|
|
|
|
+ if (row.packingUnit === row.measureUnit) {
|
|
|
|
|
+ return row.measureUnit;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return row.packingSpecificationOption[1]?.conversionUnit;
|
|
|
|
|
+ }
|
|
|
|
|
+ })()
|
|
|
: packingBoolen
|
|
: packingBoolen
|
|
|
? row.packingUnit === '立方' ? row.packingUnit : filterArr[0]?.conversionUnit
|
|
? row.packingUnit === '立方' ? row.packingUnit : filterArr[0]?.conversionUnit
|
|
|
: row.packingUnit,
|
|
: row.packingUnit,
|
|
|
-
|
|
|
|
|
measureQuantity: row.isUnpack
|
|
measureQuantity: row.isUnpack
|
|
|
? packingBoolen
|
|
? packingBoolen
|
|
|
? measureQuantity
|
|
? measureQuantity
|
|
@@ -2613,11 +2638,14 @@ export default {
|
|
|
row.categoryLevelPathIdParent
|
|
row.categoryLevelPathIdParent
|
|
|
);
|
|
);
|
|
|
} else {
|
|
} else {
|
|
|
- console.log(packingBoolen, measureBoolen, '33333');
|
|
|
|
|
|
|
+ console.log(packingBoolen, measureBoolen, row, '33333');
|
|
|
|
|
|
|
|
let num = Math.ceil(
|
|
let num = Math.ceil(
|
|
|
row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
);
|
|
);
|
|
|
|
|
+ console.log(num, 'num')
|
|
|
|
|
+ console.log(row.measureQuantity, 'row.measureQuantity')
|
|
|
|
|
+
|
|
|
this.$refs.wareHouseDailogRef.open(num ? num : 0, row.measureQuantity, idx, row.warehouseId, row.warehouseName + '',
|
|
this.$refs.wareHouseDailogRef.open(num ? num : 0, row.measureQuantity, idx, row.warehouseId, row.warehouseName + '',
|
|
|
row.categoryLevelPathIdParent);
|
|
row.categoryLevelPathIdParent);
|
|
|
}
|
|
}
|
|
@@ -2661,14 +2689,21 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
//如果此行不拆包,并且测量单位=包装单位 packingQuantity=0
|
|
//如果此行不拆包,并且测量单位=包装单位 packingQuantity=0
|
|
|
|
|
|
|
|
- row.forEach(item => {
|
|
|
|
|
- if (!item.isUnpack && item.measureUnit === item.packingUnit) {
|
|
|
|
|
- item.packingQuantity2 = 0;
|
|
|
|
|
- } else {
|
|
|
|
|
- item.packingQuantity2 = item.packingQuantity;
|
|
|
|
|
|
|
+ for (let i = 0; i < row.length; i++) {
|
|
|
|
|
+ if (row[i].isUnpack === 0 && row[i].measureUnit === row[i].packingUnit) {
|
|
|
|
|
+ row[i].packingQuantity2 = 0;
|
|
|
|
|
+ } else if (row[i].isUnpack === 1) {
|
|
|
|
|
+ const packageCell = row[i].packingSpecificationOption[1]?.packageCell;
|
|
|
|
|
+ if (packageCell) {
|
|
|
|
|
+ row[i].packingQuantity2 = Number(row[i].measureQuantity) / packageCell;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row[i].packingQuantity2 = 0; // 处理 packageCell 不存在的情况
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
console.log(row, 'rowrowrowrowrowrow我看看')
|
|
console.log(row, 'rowrowrowrowrowrow我看看')
|
|
|
|
|
+
|
|
|
const pNum = row.reduce((sum, item) => {
|
|
const pNum = row.reduce((sum, item) => {
|
|
|
if (item.packingQuantity2 !== undefined && item.packingQuantity2 !== null) {
|
|
if (item.packingQuantity2 !== undefined && item.packingQuantity2 !== null) {
|
|
|
return sum + Number(item.packingQuantity2);
|
|
return sum + Number(item.packingQuantity2);
|