|
|
@@ -144,10 +144,10 @@
|
|
|
{{ row.packingUnit }}
|
|
|
</template>
|
|
|
<el-form-item v-else :prop="`productList.${$index}.packingUnit`" required>
|
|
|
- <el-select :disabled="row.isSave" v-model="row.packingUnit" placeholder="请选择"
|
|
|
+ <el-select :disabled="row.isSave" 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>
|
|
|
@@ -696,6 +696,7 @@ export default {
|
|
|
...productItem,
|
|
|
index: this.productList.length + productIndex,
|
|
|
isSave: true,
|
|
|
+ packingSpecificationLabel:productItem.extField?.packingSpecification?.split(','),
|
|
|
batchNo: batchNo, // 批次号
|
|
|
warehouseIds: [productItem.warehouseId], // 仓库Id
|
|
|
warehouseNames: [productItem.warehouseName], // 仓库名称
|
|
|
@@ -815,7 +816,8 @@ export default {
|
|
|
// 计算最小单元数量
|
|
|
async computeNum(row, index, isClear) {
|
|
|
console.log('row,', row);
|
|
|
-
|
|
|
+ let data= row.packingSpecificationOption.find(item=>item.id==row.packingUnitId)
|
|
|
+ row.packingUnit=data.conversionUnit
|
|
|
// 清空仓库(包装数量输入)
|
|
|
if (isClear) {
|
|
|
if (row.packingQuantity < 0) {
|
|
|
@@ -852,20 +854,20 @@ export default {
|
|
|
this.$set(this.productList[index], 'warehouseName', '');
|
|
|
}
|
|
|
// -----------------------------------------------------------------
|
|
|
-
|
|
|
- let startIndex = row.packingSpecificationOption.findIndex((ite) => {
|
|
|
- return (
|
|
|
- row.measuringUnit == ite.packingUnit &&
|
|
|
- ite.packingUnit != ite.conversionUnit
|
|
|
- );
|
|
|
- });
|
|
|
+ // let startIndex = row.packingSpecificationOption.findIndex((ite) => {
|
|
|
+ // return (
|
|
|
+ // data.id == ite.id &&
|
|
|
+ // ite.packingUnit != ite.conversionUnit
|
|
|
+ // );
|
|
|
+ // });
|
|
|
+
|
|
|
let endIndex = row.packingSpecificationOption.findIndex(
|
|
|
- (ite) => row.packingUnit == ite.conversionUnit
|
|
|
+ (ite) => data.id == ite.id
|
|
|
);
|
|
|
- console.log(endIndex);
|
|
|
+ console.log(endIndex,'endIndex');
|
|
|
let total = Number(row.packingQuantity);
|
|
|
|
|
|
- for (; startIndex < endIndex; endIndex--) {
|
|
|
+ for (; 0 < endIndex; endIndex--) {
|
|
|
total = this.$math.format(
|
|
|
row.packingSpecificationOption[endIndex].packageCell * total,
|
|
|
14
|
|
|
@@ -874,8 +876,6 @@ export default {
|
|
|
//计量数量
|
|
|
row.measureQuantity = this.changeCount(total);
|
|
|
|
|
|
- console.log(row.measureQuantity, '计量数量')
|
|
|
- console.log(total, '包装数量')
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
//计量单位不是数量时,配置了单重的重量计算
|
|
|
@@ -1862,9 +1862,12 @@ export default {
|
|
|
});
|
|
|
console.log('yeyyeyey----------------', data);
|
|
|
|
|
|
- const newSpecificationOption = this.getNewSpecificationOption(this.packingSpecificationOption)
|
|
|
+ const newSpecificationOption = this.packingSpecificationOption
|
|
|
+
|
|
|
|
|
|
let productList = data.map((item, index) => {
|
|
|
+
|
|
|
+
|
|
|
// 显示规格
|
|
|
let packingSpecificationLabel = this.packingSpecificationOption[index]
|
|
|
.map((item) => {
|
|
|
@@ -1904,6 +1907,7 @@ export default {
|
|
|
minPackingQuantity: '', // 最小包装单元数量
|
|
|
packingQuantity: '', // 包装数量
|
|
|
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, // 净重
|
|
|
@@ -2069,7 +2073,7 @@ export default {
|
|
|
let pNum = row.packingQuantity;
|
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
(item) =>
|
|
|
- item.conversionUnit == row.packingUnit &&
|
|
|
+ item.conversionUnit == row.packingUnit &&
|
|
|
item.packageUnit != item.conversionUnit
|
|
|
);
|
|
|
for (; splitIndex > 1; splitIndex--) {
|
|
|
@@ -2087,7 +2091,7 @@ export default {
|
|
|
num: Math.ceil(pNum),
|
|
|
}
|
|
|
]);
|
|
|
- this.generateWrappers(row, index, data)
|
|
|
+ // this.generateWrappers(row, index, data)
|
|
|
} else {
|
|
|
let pNum = 0;
|
|
|
const { data } = await storageApi.getAssetNum([
|
|
|
@@ -2110,6 +2114,7 @@ export default {
|
|
|
num: Math.ceil(pNum),
|
|
|
}
|
|
|
]);
|
|
|
+ console.log(data,'data')
|
|
|
|
|
|
this.generateWrappers(row, index, data);
|
|
|
}
|
|
|
@@ -2331,8 +2336,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;
|
|
|
@@ -2355,37 +2359,7 @@ export default {
|
|
|
this.$math.format(filterArr[0].packageCell * index, 14);
|
|
|
}
|
|
|
} else {
|
|
|
- if (row.isUnpack == 1) {
|
|
|
-
|
|
|
- console.log('1 拆--------', measureBoolen)
|
|
|
- if (measureBoolen) {
|
|
|
- // 处理单位不为KG类,计量单位为KG类的情况
|
|
|
- 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
|
|
|
- );
|
|
|
- }
|
|
|
- console.log('2 拆--------', measureQuantity)
|
|
|
- } else {
|
|
|
- measureQuantity = row.packingSpecificationOption[1]?.packageCell;
|
|
|
-
|
|
|
- console.log('3 拆--------', measureQuantity)
|
|
|
-
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log('4 拆--------')
|
|
|
- if (row.packingQuantity) {
|
|
|
- measureQuantity = row.measureQuantity / row.packingQuantity;
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(measureQuantity, 'measureQuantity')
|
|
|
+ measureQuantity = row.measureQuantity / row.packingQuantity;
|
|
|
}
|
|
|
console.log(filterArr[0], 'filterArr[0]')
|
|
|
let item = {
|
|
|
@@ -2403,15 +2377,7 @@ export default {
|
|
|
batchNo: row.batchNo, // 批次号
|
|
|
packageNo: packingCodeList[index]?.onlyCode, // 包装编码
|
|
|
packingQuantity: packingQuantity, // 包装数量
|
|
|
- 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]
|
|
|
@@ -2447,7 +2413,7 @@ export default {
|
|
|
const option = row.packingSpecificationOption?.[1] || row.packingSpecificationOption?.[0];
|
|
|
item.packingUnit = option?.conversionUnit;
|
|
|
} else {
|
|
|
- item.packingUnit = row.packingSpecificationOption?.[1].conversionUnit;
|
|
|
+ item.packingUnit = row.packingUnit
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -2628,7 +2594,7 @@ export default {
|
|
|
);
|
|
|
console.log(num, 'num')
|
|
|
this.$refs.wareHouseDailogRef.open(
|
|
|
- num,
|
|
|
+ row.packingQuantity,
|
|
|
row.measureQuantity,
|
|
|
idx,
|
|
|
row.warehouseId,
|