|
|
@@ -170,21 +170,18 @@
|
|
|
:show-overflow-tooltip="true"></el-table-column>
|
|
|
<el-table-column label="计量单位" align="center" prop="measureUnit"
|
|
|
:show-overflow-tooltip="true"></el-table-column>
|
|
|
- <el-table-column label="单重" align="center" prop="singleWeight" :show-overflow-tooltip="true" width="120">
|
|
|
+ <el-table-column label="单重" align="center" prop="singleWeight" :show-overflow-tooltip="true" width="180">
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <el-input-number :disabled="row.isSave" v-model="row.singleWeight" placeholder="请输入" :precision="2"
|
|
|
- :min="0" controls-position="right" :controls="false" style="width: 100%"></el-input-number>
|
|
|
- <template slot="append">
|
|
|
- {{ row.measureUnit }}
|
|
|
- </template>
|
|
|
+ <el-input :disabled="row.isSave" v-model="row.singleWeight" placeholder="请输入" :min="0"
|
|
|
+ style="width: 100%">
|
|
|
+ <template slot="append"> {{ row.weightUnit + '/' + row.measureUnit }} </template>
|
|
|
+ </el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="总重" align="center" prop="weight" width="120" :show-overflow-tooltip="true">
|
|
|
+ <el-table-column label="总重" align="center" prop="weight" width="150" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入"></el-input>
|
|
|
- <template slot="append">
|
|
|
- {{ row.measureUnit }}
|
|
|
- </template>
|
|
|
+ <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入">
|
|
|
+ </el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="重量单位" align="center" prop="weightUnit" :show-overflow-tooltip="true">
|
|
|
@@ -784,6 +781,7 @@ export default {
|
|
|
// },
|
|
|
// 计算最小单元数量
|
|
|
async computeNum(row, index, isClear) {
|
|
|
+ console.log('row, index', row, index);
|
|
|
// 清空仓库(包装数量输入)
|
|
|
if (isClear) {
|
|
|
if (row.packingQuantity < 0) {
|
|
|
@@ -794,6 +792,7 @@ export default {
|
|
|
}
|
|
|
//如果有包装数量和包装单位
|
|
|
if (row.packingQuantity && row.packingUnit) {
|
|
|
+
|
|
|
//获取仓库
|
|
|
const res = await warehouseDefinition.list({
|
|
|
inventoryType: row?.categoryLevelPathIdParent
|
|
|
@@ -807,6 +806,7 @@ export default {
|
|
|
|
|
|
let table1 = [];
|
|
|
table1.push({
|
|
|
+ measureQuantity: row.measureQuantity,
|
|
|
packingQuantity: row.packingQuantity,
|
|
|
warehouseName: name,
|
|
|
warehouseId: res[0].id
|
|
|
@@ -852,11 +852,13 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
let total = Number(row.packingQuantity);
|
|
|
-
|
|
|
+ console.log(total, '111')
|
|
|
if (row.packingUnit == row.measureUnit && row.measureUnit == '立方' && row.netWeight) {
|
|
|
total = Number(row.packingQuantity) * row.netWeight;
|
|
|
console.log(total, '单位是立方,计量单位也是立方,如果有单重,就计量数量x单重=总重')
|
|
|
+ console.log(total, '2222')
|
|
|
} else {
|
|
|
+ console.log(total, 333)
|
|
|
for (; startIndex < endIndex; endIndex--) {
|
|
|
total = this.$math.format(
|
|
|
row.packingSpecificationOption[endIndex].packageCell * total,
|
|
|
@@ -864,7 +866,7 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ console.log(total, '444456')
|
|
|
// 除了计量单位是KG以外计算总重 总重量 = 单重singleWeight * 数量measureQuantity(计量数量);
|
|
|
// if (row.measuringUnit != 'KG') {
|
|
|
// row.weight = Number(row.singleWeight) * Number(row.measureQuantity);
|
|
|
@@ -877,10 +879,15 @@ export default {
|
|
|
.dictValue;
|
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
.dictValue;
|
|
|
- if (packingBoolen || measureBoolen) {
|
|
|
+ console.log(packingBoolen, 'packingBoolen')
|
|
|
+ console.log(measureBoolen, 'measureBoolen')
|
|
|
+
|
|
|
+ if (packingBoolen && measureBoolen && row.packingUnit != 'L') {
|
|
|
row.weight = total;
|
|
|
+ console.log(total, '6')
|
|
|
} else {
|
|
|
row.weight = this.$math.format(total * row.netWeight, 14);
|
|
|
+ console.log(total, '7')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -2196,7 +2203,10 @@ export default {
|
|
|
num: packingBoolen ? packingNum : measureBoolen ? measureNum : num,
|
|
|
}
|
|
|
]);
|
|
|
+
|
|
|
this.generateWrappers(row, index, data);
|
|
|
+
|
|
|
+
|
|
|
this.$set(this.productList[index], 'isSave', true);
|
|
|
this.$set(this.productList[index], 'warehouseId', row.warehouseId);
|
|
|
this.$set(
|
|
|
@@ -2220,8 +2230,15 @@ export default {
|
|
|
},
|
|
|
// 生成包装
|
|
|
generateWrappers(row, productIndex, packingCodeList) {
|
|
|
- console.log('包装数据--------', row);
|
|
|
|
|
|
+ if (!row.isUnpack) {
|
|
|
+ // 直接生成物品层数据,不生成包装层
|
|
|
+ this.productList[productIndex].measureQuantity = row.measureQuantity;
|
|
|
+ this.productList[productIndex].weight = row.weight;
|
|
|
+ return; // 跳过生成包装明细
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log('包装数据--------', row);
|
|
|
// console.log('包装规格----', row.packingSpecificationOption);
|
|
|
console.log('计量单位----', row.measureUnit);
|
|
|
let packingList = [];
|
|
|
@@ -2242,6 +2259,7 @@ export default {
|
|
|
.dictValue;
|
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
.dictValue;
|
|
|
+
|
|
|
let num = row.packingQuantity;
|
|
|
let filterArr = [];
|
|
|
// 处理单位为KG类的情况
|
|
|
@@ -2532,6 +2550,8 @@ export default {
|
|
|
if (row.isSave) {
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
|
.dictValue;
|
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
@@ -2542,19 +2562,21 @@ export default {
|
|
|
if (idx > -1) {
|
|
|
if (row.packingQuantity > 0) {
|
|
|
console.log(packingBoolen, '111')
|
|
|
+ if (!row.isUnpack && row.measureUnit == row.packingUnit) {
|
|
|
+ let pNum = 0;
|
|
|
+ let mNum = row.measureQuantity
|
|
|
+ this.$refs.wareHouseDailogRef.open(
|
|
|
+ pNum,
|
|
|
+ mNum,
|
|
|
+ idx,
|
|
|
+ row.warehouseId,
|
|
|
+ row.warehouseName + '',
|
|
|
+ row.categoryLevelPathIdParent
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ if (packingBoolen) {
|
|
|
+ console.log(packingBoolen, 'packingBoolen', row.packageUnit, row.isUnpack);
|
|
|
|
|
|
- if (packingBoolen) {
|
|
|
- console.log(packingBoolen, 'packingBoolen', row.packageUnit, row.isUnpack);
|
|
|
- if (!row.isUnpack && row.packingUnit == '立方') {
|
|
|
- let num = 1
|
|
|
- this.$refs.wareHouseDailogRef.open(
|
|
|
- num,
|
|
|
- idx,
|
|
|
- row.warehouseId,
|
|
|
- row.warehouseName + '',
|
|
|
- row.categoryLevelPathIdParent
|
|
|
- );
|
|
|
- } else {
|
|
|
let filterArr = row.packingSpecificationOption.filter((item) => {
|
|
|
return (
|
|
|
item.packageUnit == row.packingUnit &&
|
|
|
@@ -2567,44 +2589,45 @@ export default {
|
|
|
);
|
|
|
this.$refs.wareHouseDailogRef.open(
|
|
|
num,
|
|
|
+ row.measureQuantity,
|
|
|
idx,
|
|
|
row.warehouseId,
|
|
|
row.warehouseName + '',
|
|
|
row.categoryLevelPathIdParent
|
|
|
);
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ console.log(measureBoolen, 'measureBoolen');
|
|
|
+ let num = row.packingQuantity;
|
|
|
+ if (measureBoolen) {
|
|
|
+ let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
+ (item) =>
|
|
|
+ item.conversionUnit == row.packingUnit &&
|
|
|
+ item.packageUnit != item.conversionUnit
|
|
|
+ );
|
|
|
+ for (; splitIndex > 1; splitIndex--) {
|
|
|
+ num = this.$math.format(
|
|
|
+ num *
|
|
|
+ row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
+ 14
|
|
|
+ );
|
|
|
+ }
|
|
|
+ this.$refs.wareHouseDailogRef.open(
|
|
|
+ num,
|
|
|
+ row.measureQuantity,
|
|
|
+ idx,
|
|
|
+ row.warehouseId,
|
|
|
+ row.warehouseName + '',
|
|
|
+ row.categoryLevelPathIdParent
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ console.log(packingBoolen, measureBoolen, '33333');
|
|
|
|
|
|
- } else {
|
|
|
- console.log(measureBoolen, 'measureBoolen');
|
|
|
- let num = row.packingQuantity;
|
|
|
- if (measureBoolen) {
|
|
|
- let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
- (item) =>
|
|
|
- item.conversionUnit == row.packingUnit &&
|
|
|
- item.packageUnit != item.conversionUnit
|
|
|
- );
|
|
|
- for (; splitIndex > 1; splitIndex--) {
|
|
|
- num = this.$math.format(
|
|
|
- num *
|
|
|
- row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
- 14
|
|
|
+ let num = Math.ceil(
|
|
|
+ row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
);
|
|
|
+ this.$refs.wareHouseDailogRef.open(num ? num : 0, row.measureQuantity, idx, row.warehouseId, row.warehouseName + '',
|
|
|
+ row.categoryLevelPathIdParent);
|
|
|
}
|
|
|
- this.$refs.wareHouseDailogRef.open(
|
|
|
- num,
|
|
|
- idx,
|
|
|
- row.warehouseId,
|
|
|
- row.warehouseName + '',
|
|
|
- row.categoryLevelPathIdParent
|
|
|
- );
|
|
|
- } else {
|
|
|
- console.log(packingBoolen, measureBoolen, '33333');
|
|
|
-
|
|
|
- let num = Math.ceil(
|
|
|
- row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
- );
|
|
|
- this.$refs.wareHouseDailogRef.open(num ? num : 0, idx, row.warehouseId, row.warehouseName + '',
|
|
|
- row.categoryLevelPathIdParent);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -2654,12 +2677,15 @@ export default {
|
|
|
let warehouseIds = [];
|
|
|
let warehouseNames = [];
|
|
|
argum.forEach((item) => {
|
|
|
+ console.log(item, 'itemitem')
|
|
|
for (let index = 0; index < item.packingQuantity; index++) {
|
|
|
warehouseIds.push(item.warehouseId);
|
|
|
warehouseNames.push(item.warehouseName);
|
|
|
}
|
|
|
});
|
|
|
console.log(argum, 'argumargumargumargumargumargum');
|
|
|
+ console.log(idx, 'idxidxidxidx')
|
|
|
+ console.log(this.productList, 'productList')
|
|
|
if (idx > -1) {
|
|
|
this.$set(
|
|
|
this.productList[idx],
|