|
|
@@ -133,9 +133,9 @@
|
|
|
{{ row.packingUnit }}
|
|
|
</template>
|
|
|
<el-form-item v-else :prop="`productList.${$index}.packingUnit`" required>
|
|
|
- <el-select v-model="row.packingUnit" placeholder="请选择" @change="computeNum(row, $index)">
|
|
|
+ <el-select v-model="row.packingUnitId" placeholder="请选择" @change="computeNum(row, $index)">
|
|
|
<el-option v-for="item in row.packingSpecificationOption" :label="`${item.conversionUnit}`"
|
|
|
- :value="item.conversionUnit" :key="item.id">
|
|
|
+ :value="item.id" :key="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -716,7 +716,8 @@ export default {
|
|
|
// 计算最小单元数量
|
|
|
async computeNum(row, index, isClear) {
|
|
|
console.log('row, index', row, index);
|
|
|
-
|
|
|
+ let data= row.packingSpecificationOption.find(item=>item.id==row.packingUnitId)
|
|
|
+ row.packingUnit=data.conversionUnit
|
|
|
// 清空仓库(包装数量输入)
|
|
|
if (isClear) {
|
|
|
if (row.packingQuantity < 0) {
|
|
|
@@ -761,7 +762,7 @@ export default {
|
|
|
);
|
|
|
});
|
|
|
let endIndex = row.packingSpecificationOption.findIndex(
|
|
|
- (ite) => row.packingUnit == ite.conversionUnit
|
|
|
+ (ite) => data.id == ite.id
|
|
|
);
|
|
|
|
|
|
console.log(row, 'rowwwwwwwwwwwwww')
|
|
|
@@ -775,7 +776,7 @@ export default {
|
|
|
console.log(total, '2222')
|
|
|
} else {
|
|
|
console.log(total, 333)
|
|
|
- for (; startIndex < endIndex; endIndex--) {
|
|
|
+ for (; 0 < endIndex; endIndex--) {
|
|
|
total = this.$math.format(
|
|
|
row.packingSpecificationOption[endIndex].packageCell * total,
|
|
|
14
|
|
|
@@ -1941,6 +1942,7 @@ export default {
|
|
|
},
|
|
|
//过滤掉单位下拉框 相同的单位
|
|
|
getNewSpecificationOption(packingSpecificationOption) {
|
|
|
+ return packingSpecificationOption
|
|
|
return packingSpecificationOption.map(arr => {
|
|
|
return arr.reduce((acc, current) => {
|
|
|
const conversionUnit = current.conversionUnit;
|
|
|
@@ -2005,7 +2007,8 @@ export default {
|
|
|
packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
|
|
|
minPackingQuantity: '', // 最小包装单元数量
|
|
|
packingQuantity: '', // 包装数量
|
|
|
- packingUnit: '', // 单位
|
|
|
+ packingUnit: item.measuringUnit, // 单位
|
|
|
+ packingUnitId:newSpecificationOption[index].find(v=>v.conversionUnit==item.measuringUnit)?.id, // 单位
|
|
|
measureQuantity: 0, // 计量数量
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
|
@@ -2337,7 +2340,7 @@ export default {
|
|
|
num: pNum,
|
|
|
}
|
|
|
]);
|
|
|
- this.generateWrappers(row, index, data)
|
|
|
+ // this.generateWrappers(row, index, data)
|
|
|
} else {
|
|
|
let pNum = 0;
|
|
|
const { data } = await storageApi.getAssetNum([
|
|
|
@@ -2354,7 +2357,7 @@ export default {
|
|
|
{
|
|
|
assetCode: row.categoryCode + row.index,
|
|
|
batchNum: row.batchNo,
|
|
|
- num: packingBoolen ? packingNum : measureBoolen ? measureNum : num,
|
|
|
+ num: row.packingQuantity
|
|
|
}
|
|
|
]);
|
|
|
|
|
|
@@ -2493,7 +2496,7 @@ export default {
|
|
|
row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
);
|
|
|
this.$refs.wareHouseDailogRef.open(
|
|
|
- num,
|
|
|
+ row.packingQuantity,
|
|
|
row.measureQuantity,
|
|
|
idx,
|
|
|
row.warehouseId,
|
|
|
@@ -2501,7 +2504,7 @@ export default {
|
|
|
);
|
|
|
} else {
|
|
|
this.$refs.wareHouseDailogRef.open(
|
|
|
- num,
|
|
|
+ row.packingQuantity,
|
|
|
row.measureQuantity,
|
|
|
idx,
|
|
|
row.warehouseId,
|
|
|
@@ -2824,7 +2827,7 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
console.log('拆包处理', row);
|
|
|
- for (let index = 0; index < num; index++) {
|
|
|
+ for (let index = 0; index < packingCodeList.length; index++) {
|
|
|
let measureQuantity = 1;
|
|
|
let packingQuantity = 1;
|
|
|
let packingUnit = row.packingUnit;
|
|
|
@@ -2865,9 +2868,7 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
} else {
|
|
|
- measureQuantity = row.packingSpecificationOption[1]?.packageCell;
|
|
|
-
|
|
|
- console.log('3 拆--------', measureQuantity)
|
|
|
+ measureQuantity = row.measureQuantity / row.packingQuantity;
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
@@ -2932,15 +2933,7 @@ export default {
|
|
|
//!row.isUnpack && row.packingUnit
|
|
|
|
|
|
|
|
|
- measureQuantity: row.isUnpack
|
|
|
- ? packingBoolen
|
|
|
- ? measureQuantity
|
|
|
- : measureBoolen
|
|
|
- ? row.packingSpecificationOption[1]
|
|
|
- ? row.packingSpecificationOption[1].packageCell
|
|
|
- : row.packingSpecificationOption[0].packageCell
|
|
|
- : measureQuantity
|
|
|
- : measureQuantity, // 计量数量
|
|
|
+ measureQuantity:measureQuantity, // 计量数量
|
|
|
measureUnit: row.isUnpack
|
|
|
? measureBoolen
|
|
|
? row.packingSpecificationOption[1]
|
|
|
@@ -2980,7 +2973,7 @@ export default {
|
|
|
const option = row.packingSpecificationOption?.[1] || row.packingSpecificationOption?.[0];
|
|
|
item.packingUnit = option?.conversionUnit;
|
|
|
} else {
|
|
|
- item.packingUnit = row.packingSpecificationOption?.[1].conversionUnit;
|
|
|
+ item.packingUnit =packingUnit
|
|
|
}
|
|
|
}
|
|
|
} else {
|