|
@@ -173,8 +173,7 @@
|
|
|
<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="120">
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
<el-input-number :disabled="row.isSave" v-model="row.singleWeight" placeholder="请输入" :precision="2"
|
|
<el-input-number :disabled="row.isSave" v-model="row.singleWeight" placeholder="请输入" :precision="2"
|
|
|
- :min="0" controls-position="right" @input="inputsingleWeight(row, $index)" :controls="false"
|
|
|
|
|
- style="width: 100%"></el-input-number>
|
|
|
|
|
|
|
+ :min="0" controls-position="right" :controls="false" style="width: 100%"></el-input-number>
|
|
|
<template slot="append">
|
|
<template slot="append">
|
|
|
{{ row.measureUnit }}
|
|
{{ row.measureUnit }}
|
|
|
</template>
|
|
</template>
|
|
@@ -182,8 +181,7 @@
|
|
|
</el-table-column>
|
|
</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="120" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入"
|
|
|
|
|
- @input="inputWeight(row, $index)"></el-input>
|
|
|
|
|
|
|
+ <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入"></el-input>
|
|
|
<template slot="append">
|
|
<template slot="append">
|
|
|
{{ row.measureUnit }}
|
|
{{ row.measureUnit }}
|
|
|
</template>
|
|
</template>
|
|
@@ -298,9 +296,9 @@
|
|
|
<el-table-column label="编码" prop="categoryCode" width="130" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column label="编码" prop="categoryCode" width="130" :show-overflow-tooltip="true"></el-table-column>
|
|
|
<el-table-column label="名称" prop="categoryName" width="150" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column label="名称" prop="categoryName" width="150" :show-overflow-tooltip="true"></el-table-column>
|
|
|
<el-table-column label="批次号" prop="batchNo" width="70"></el-table-column>
|
|
<el-table-column label="批次号" prop="batchNo" width="70"></el-table-column>
|
|
|
- <el-table-column :label="`包装编码`" prop="packageNo" width="200" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column label="包装编码" prop="packageNo" width="200" :show-overflow-tooltip="true"></el-table-column>
|
|
|
<el-table-column label="包装数量" prop="packingQuantity" width="80"></el-table-column>
|
|
<el-table-column label="包装数量" prop="packingQuantity" width="80"></el-table-column>
|
|
|
- <el-table-column label="单位" prop="packingUnit"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column label="包装单位" prop="packingUnit"></el-table-column>
|
|
|
<el-table-column label="计量数量" prop="measureQuantity" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column label="计量数量" prop="measureQuantity" :show-overflow-tooltip="true"></el-table-column>
|
|
|
<el-table-column label="计量单位" prop="measureUnit"></el-table-column>
|
|
<el-table-column label="计量单位" prop="measureUnit"></el-table-column>
|
|
|
<!-- <el-table-column label="允许拆包" prop="isUnpack">
|
|
<!-- <el-table-column label="允许拆包" prop="isUnpack">
|
|
@@ -309,6 +307,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column> -->
|
|
</el-table-column> -->
|
|
|
<el-table-column label="仓库" :show-overflow-tooltip="true" prop="warehouseName" width="200"></el-table-column>
|
|
<el-table-column label="仓库" :show-overflow-tooltip="true" prop="warehouseName" width="200"></el-table-column>
|
|
|
|
|
+ <el-table-column label="供应商" align="center" prop="supplierName" width="200" :show-overflow-tooltip="true">
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="供应商代号" prop="supplierCode" width="130">
|
|
<el-table-column label="供应商代号" prop="supplierCode" width="130">
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="物料代号" prop="materielDesignation" width="130">
|
|
<el-table-column label="物料代号" prop="materielDesignation" width="130">
|
|
@@ -768,61 +768,29 @@ export default {
|
|
|
(item) => item.id == val
|
|
(item) => item.id == val
|
|
|
)[0].serialNo;
|
|
)[0].serialNo;
|
|
|
},
|
|
},
|
|
|
- inputsingleWeight(row, index) {
|
|
|
|
|
- if (
|
|
|
|
|
- row.weight === null ||
|
|
|
|
|
- row.weight === undefined ||
|
|
|
|
|
- isNaN(row.weight) ||
|
|
|
|
|
- row.weight < 0
|
|
|
|
|
- ) {
|
|
|
|
|
- row.weight = 0;
|
|
|
|
|
- } else {
|
|
|
|
|
- if (row.singleWeight && row.singleWeight > 0) {
|
|
|
|
|
- console.log(row.singleWeight, row.measureQuantity)
|
|
|
|
|
- this.productList[index].weight = Number(row.singleWeight) * Number(row.measureQuantity);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.productList[index].weight = 0;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- inputWeight(row, index) {
|
|
|
|
|
- if (
|
|
|
|
|
- row.weight === null ||
|
|
|
|
|
- row.weight === undefined ||
|
|
|
|
|
- isNaN(row.weight) ||
|
|
|
|
|
- row.weight < 0
|
|
|
|
|
- ) {
|
|
|
|
|
- row.weight = 0;
|
|
|
|
|
- }
|
|
|
|
|
- row.singleWeight = row.measureQuantity
|
|
|
|
|
- ? Number(row.weight) / row.measureQuantity
|
|
|
|
|
- : 0;
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // inputWeight(row, index) {
|
|
|
|
|
+ // if (
|
|
|
|
|
+ // row.weight === null ||
|
|
|
|
|
+ // row.weight === undefined ||
|
|
|
|
|
+ // isNaN(row.weight) ||
|
|
|
|
|
+ // row.weight < 0
|
|
|
|
|
+ // ) {
|
|
|
|
|
+ // row.weight = 0;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // row.singleWeight = row.measureQuantity
|
|
|
|
|
+ // ? Number(row.weight) / row.measureQuantity
|
|
|
|
|
+ // : 0;
|
|
|
|
|
+ // },
|
|
|
// 计算最小单元数量
|
|
// 计算最小单元数量
|
|
|
async computeNum(row, index, isClear) {
|
|
async computeNum(row, index, isClear) {
|
|
|
// 清空仓库(包装数量输入)
|
|
// 清空仓库(包装数量输入)
|
|
|
if (isClear) {
|
|
if (isClear) {
|
|
|
- // this.$set(this.productList[index], 'warehouseId', '');
|
|
|
|
|
- // this.$set(this.productList[index], 'warehouseName', '');
|
|
|
|
|
-
|
|
|
|
|
if (row.packingQuantity < 0) {
|
|
if (row.packingQuantity < 0) {
|
|
|
this.$set(this.productList[index], 'packingQuantity', 1);
|
|
this.$set(this.productList[index], 'packingQuantity', 1);
|
|
|
} else if (row.packingQuantity > 9999) {
|
|
} else if (row.packingQuantity > 9999) {
|
|
|
this.$set(this.productList[index], 'packingQuantity', 9999);
|
|
this.$set(this.productList[index], 'packingQuantity', 9999);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // else {
|
|
|
|
|
- // const reg = /^[0-9]+\.[0-9]+$/;
|
|
|
|
|
- // console.log(reg.test(row.packingQuantity));
|
|
|
|
|
- // if (reg.test(row.packingQuantity)) {
|
|
|
|
|
- // this.$set(this.productList[index], 'packingQuantity', '');
|
|
|
|
|
- // }
|
|
|
|
|
- // // this.$set(
|
|
|
|
|
- // // this.productList[index],
|
|
|
|
|
- // // 'packingQuantity',
|
|
|
|
|
- // // row.packingQuantity.replace(/[^\d\.{2,}]/g, '')
|
|
|
|
|
- // // );
|
|
|
|
|
- // }
|
|
|
|
|
}
|
|
}
|
|
|
//如果有包装数量和包装单位
|
|
//如果有包装数量和包装单位
|
|
|
if (row.packingQuantity && row.packingUnit) {
|
|
if (row.packingQuantity && row.packingUnit) {
|
|
@@ -872,9 +840,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
console.log(total, 'total');
|
|
console.log(total, 'total');
|
|
|
// 除了计量单位是KG以外计算总重 总重量 = 单重singleWeight * 数量measureQuantity(计量数量);
|
|
// 除了计量单位是KG以外计算总重 总重量 = 单重singleWeight * 数量measureQuantity(计量数量);
|
|
|
- if (row.measuringUnit != 'KG') {
|
|
|
|
|
- row.weight = Number(row.singleWeight) * Number(row.measureQuantity);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (row.measuringUnit != 'KG') {
|
|
|
|
|
+ // row.weight = Number(row.singleWeight) * Number(row.measureQuantity);
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
//计量数量
|
|
//计量数量
|
|
|
row.measureQuantity = this.changeCount(total);
|
|
row.measureQuantity = this.changeCount(total);
|
|
@@ -1973,11 +1941,16 @@ export default {
|
|
|
num
|
|
num
|
|
|
};
|
|
};
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ console.log('拆包情况------:', row.measureQuantity, row.packingSpecificationOption[1]?.packageCell);
|
|
|
|
|
+
|
|
|
// 处理拆包到最小包装单元数量的情况
|
|
// 处理拆包到最小包装单元数量的情况
|
|
|
|
|
+ let num = Math.ceil(
|
|
|
|
|
+ row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
|
|
+ );
|
|
|
return {
|
|
return {
|
|
|
assetCode: row.categoryCode + row.index,
|
|
assetCode: row.categoryCode + row.index,
|
|
|
batchNum: row.batchNo,
|
|
batchNum: row.batchNo,
|
|
|
- num: row.measureQuantity
|
|
|
|
|
|
|
+ num: num
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -2006,6 +1979,9 @@ export default {
|
|
|
if (!row.isSave) {
|
|
if (!row.isSave) {
|
|
|
this.generateWrappers(row, index, packingCodeList[index]);
|
|
this.generateWrappers(row, index, packingCodeList[index]);
|
|
|
this.$set(this.productList[index], 'isSave', true);
|
|
this.$set(this.productList[index], 'isSave', true);
|
|
|
|
|
+ console.log('this.productList[index]----', this.productList[index]);
|
|
|
|
|
+ console.log('row----', row);
|
|
|
|
|
+
|
|
|
this.$set(
|
|
this.$set(
|
|
|
this.productList[index],
|
|
this.productList[index],
|
|
|
'warehouseId',
|
|
'warehouseId',
|
|
@@ -2020,12 +1996,12 @@ export default {
|
|
|
this.$set(
|
|
this.$set(
|
|
|
this.productList[index],
|
|
this.productList[index],
|
|
|
'warehouseIds',
|
|
'warehouseIds',
|
|
|
- row.warehouseId
|
|
|
|
|
|
|
+ [row.warehouseId]
|
|
|
);
|
|
);
|
|
|
this.$set(
|
|
this.$set(
|
|
|
this.productList[index],
|
|
this.productList[index],
|
|
|
'warehouseNames',
|
|
'warehouseNames',
|
|
|
- row.warehouseName
|
|
|
|
|
|
|
+ [row.warehouseName]
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -2138,6 +2114,8 @@ export default {
|
|
|
.dictValue;
|
|
.dictValue;
|
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
.dictValue;
|
|
.dictValue;
|
|
|
|
|
+ console.log('packingBoolen---------', packingBoolen);
|
|
|
|
|
+ console.log('measureBoolen---------', measureBoolen);
|
|
|
let packingNum = 0;
|
|
let packingNum = 0;
|
|
|
// 处理单位为KG类的情况
|
|
// 处理单位为KG类的情况
|
|
|
if (packingBoolen) {
|
|
if (packingBoolen) {
|
|
@@ -2153,6 +2131,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
// 处理单位不为KG类,计量单位为KG类的情况
|
|
// 处理单位不为KG类,计量单位为KG类的情况
|
|
|
let measureNum = row.packingQuantity;
|
|
let measureNum = row.packingQuantity;
|
|
|
|
|
+ let num = 0;
|
|
|
|
|
+
|
|
|
if (measureBoolen) {
|
|
if (measureBoolen) {
|
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
(item) =>
|
|
(item) =>
|
|
@@ -2166,13 +2146,13 @@ export default {
|
|
|
14
|
|
14
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ num = Math.ceil(
|
|
|
|
|
+ row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
|
|
+ );
|
|
|
|
|
+ console.log(num, 'numnumnumnumnumnumnumnumnumnumnumnumnumnumnumnumnumnum33')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let num = Math.ceil(
|
|
|
|
|
- row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
|
|
- );
|
|
|
|
|
- console.log(num, 'numnumnumnumnumnumnumnumnumnumnumnumnumnumnumnumnumnum')
|
|
|
|
|
-
|
|
|
|
|
if (row.packingSpecificationLabel?.length < 1) {
|
|
if (row.packingSpecificationLabel?.length < 1) {
|
|
|
return this.$message.error('请到主数据维护包装组信息!')
|
|
return this.$message.error('请到主数据维护包装组信息!')
|
|
|
} else {
|
|
} else {
|
|
@@ -2206,167 +2186,12 @@ export default {
|
|
|
// this.materielFetchData();
|
|
// this.materielFetchData();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- //入库明细删除
|
|
|
|
|
- listDel(row, index) {
|
|
|
|
|
- this.productList.splice(index, 1);
|
|
|
|
|
- this.deletePackingAndMaterial(row);
|
|
|
|
|
- },
|
|
|
|
|
- // 打开仓库弹框
|
|
|
|
|
- handleWareHouse(row, idx) {
|
|
|
|
|
- if (row.isSave) {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
|
|
|
- .dictValue;
|
|
|
|
|
- let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
|
|
- .dictValue;
|
|
|
|
|
- if (idx > -1) {
|
|
|
|
|
- if (row.packingQuantity > 0) {
|
|
|
|
|
- console.log(packingBoolen, '111')
|
|
|
|
|
- if (packingBoolen) {
|
|
|
|
|
- let filterArr = row.packingSpecificationOption.filter((item) => {
|
|
|
|
|
- return (
|
|
|
|
|
- item.packageUnit == row.packingUnit &&
|
|
|
|
|
- item.packageUnit != item.conversionUnit
|
|
|
|
|
- );
|
|
|
|
|
- });
|
|
|
|
|
- console.log(filterArr);
|
|
|
|
|
- let num = Math.ceil(
|
|
|
|
|
- row.packingQuantity / filterArr[0].packageCell
|
|
|
|
|
- );
|
|
|
|
|
- this.$refs.wareHouseDailogRef.open(
|
|
|
|
|
- num,
|
|
|
|
|
- idx,
|
|
|
|
|
- row.warehouseId,
|
|
|
|
|
- row.warehouseName + ''
|
|
|
|
|
- );
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log(measureBoolen, '222')
|
|
|
|
|
- let num = row.packingQuantity;
|
|
|
|
|
- if (measureBoolen) {
|
|
|
|
|
-
|
|
|
|
|
- let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
|
|
- (item) =>
|
|
|
|
|
- item.conversionUnit == row.packingUnit &&
|
|
|
|
|
- item.packageUnit != item.conversionUnit
|
|
|
|
|
- );
|
|
|
|
|
- for (; splitIndex > 1; splitIndex--) {
|
|
|
|
|
- console.log(splitIndex);
|
|
|
|
|
- num = this.$math.format(
|
|
|
|
|
- num *
|
|
|
|
|
- row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
|
|
- 14
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- this.$refs.wareHouseDailogRef.open(
|
|
|
|
|
- num,
|
|
|
|
|
- idx,
|
|
|
|
|
- row.warehouseId,
|
|
|
|
|
- row.warehouseName + ''
|
|
|
|
|
- );
|
|
|
|
|
- } else {
|
|
|
|
|
- let num = Math.ceil(
|
|
|
|
|
- row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
|
|
- );
|
|
|
|
|
- this.$refs.wareHouseDailogRef.open(num, idx, row.warehouseId, row.warehouseName + '');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error('请先填写包装数量!');
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- // 批量设置
|
|
|
|
|
- let boolen = this.productList.every(
|
|
|
|
|
- (item) =>
|
|
|
|
|
- item.packingQuantity == this.productList[0].packingQuantity
|
|
|
|
|
- );
|
|
|
|
|
- if (boolen) {
|
|
|
|
|
- if (row.packingQuantity > 0) {
|
|
|
|
|
- if (packingBoolen) {
|
|
|
|
|
- let filterArr = row.packingSpecificationOption.filter(
|
|
|
|
|
- (item) => {
|
|
|
|
|
- return (
|
|
|
|
|
- item.packingUnit == row.packingUnit &&
|
|
|
|
|
- item.packingUnit != item.conversionUnit
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- );
|
|
|
|
|
- let num = Math.ceil(
|
|
|
|
|
- row.packingQuantity / filterArr[0].packageCell
|
|
|
|
|
- );
|
|
|
|
|
- this.$refs.wareHouseDailogRef.open(num, idx);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$refs.wareHouseDailogRef.open(
|
|
|
|
|
- row.isUnpack
|
|
|
|
|
- ? measureBoolen
|
|
|
|
|
- ? row.packingQuantity
|
|
|
|
|
- : row.measureQuantity
|
|
|
|
|
- : row.packingQuantity,
|
|
|
|
|
- idx
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error('请先填写包装数量!');
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error('请保证产品包装数量一致!');
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- wareHouseSelection(argum, idx) {
|
|
|
|
|
- // 方便包装遍历获取仓库id和名称
|
|
|
|
|
- let warehouseIds = [];
|
|
|
|
|
- let warehouseNames = [];
|
|
|
|
|
- argum.forEach((item) => {
|
|
|
|
|
- for (let index = 0; index < item.packingQuantity; index++) {
|
|
|
|
|
- warehouseIds.push(item.warehouseId);
|
|
|
|
|
- warehouseNames.push(item.warehouseName);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- console.log(argum, 'argumargumargumargumargumargum');
|
|
|
|
|
- if (idx > -1) {
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.productList[idx],
|
|
|
|
|
- 'warehouseId',
|
|
|
|
|
- argum.map((item) => item.warehouseId).join(',')
|
|
|
|
|
- );
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.productList[idx],
|
|
|
|
|
- 'warehouseName',
|
|
|
|
|
- argum.map((item) => item.warehouseName).join(',')
|
|
|
|
|
- );
|
|
|
|
|
- this.$set(this.productList[idx], 'warehouseIds', warehouseIds);
|
|
|
|
|
- this.$set(this.productList[idx], 'warehouseNames', warehouseNames);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.productList.map((item, index) => {
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.productList[index],
|
|
|
|
|
- 'warehouseId',
|
|
|
|
|
- argum.map((item) => item.warehouseId).join(',')
|
|
|
|
|
- );
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.productList[index],
|
|
|
|
|
- 'warehouseName',
|
|
|
|
|
- argum.map((item) => item.warehouseName).join(',')
|
|
|
|
|
- );
|
|
|
|
|
- this.$set(this.productList[index], 'warehouseIds', warehouseIds);
|
|
|
|
|
- this.$set(
|
|
|
|
|
- this.productList[index],
|
|
|
|
|
- 'warehouseNames',
|
|
|
|
|
- warehouseNames
|
|
|
|
|
- );
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- this.$forceUpdate();
|
|
|
|
|
- },
|
|
|
|
|
// 生成包装
|
|
// 生成包装
|
|
|
generateWrappers(row, productIndex, packingCodeList) {
|
|
generateWrappers(row, productIndex, packingCodeList) {
|
|
|
console.log('包装数据--------', row);
|
|
console.log('包装数据--------', row);
|
|
|
|
|
|
|
|
- // console.log('是否拆包----', row.isUnpack);
|
|
|
|
|
- console.log('包装规格----', row.packingSpecificationOption);
|
|
|
|
|
|
|
+ // console.log('包装规格----', row.packingSpecificationOption);
|
|
|
console.log('计量单位----', row.measureUnit);
|
|
console.log('计量单位----', row.measureUnit);
|
|
|
- console.log('包装编码----', packingCodeList);
|
|
|
|
|
let packingList = [];
|
|
let packingList = [];
|
|
|
let obj = this.getNowDate();
|
|
let obj = this.getNowDate();
|
|
|
let productionDate = '';
|
|
let productionDate = '';
|
|
@@ -2423,12 +2248,13 @@ export default {
|
|
|
// 14
|
|
// 14
|
|
|
// );
|
|
// );
|
|
|
// }
|
|
// }
|
|
|
- let num = Math.ceil(
|
|
|
|
|
|
|
+ num = Math.ceil(
|
|
|
row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- num = this.productList.length;
|
|
|
|
|
|
|
+ num = row.packingQuantity;
|
|
|
|
|
+ console.log('计量单位KG 不拆--------', num)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
console.log('num-----------', num);
|
|
console.log('num-----------', num);
|
|
@@ -2473,17 +2299,16 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- measureQuantity = row.measureQuantity;
|
|
|
|
|
|
|
+ if (row.packingQuantity) {
|
|
|
|
|
+ measureQuantity = row.measureQuantity / row.packingQuantity;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(measureQuantity, 'measureQuantity')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let item = {
|
|
let item = {
|
|
|
index: row.index + '-' + index, // 包装索引
|
|
index: row.index + '-' + index, // 包装索引
|
|
|
- warehouseId: row.warehouseIds
|
|
|
|
|
- ? row.warehouseIds[index]
|
|
|
|
|
- : row.warehouseIds, // 仓库id
|
|
|
|
|
- warehouseName: row.warehouseNames
|
|
|
|
|
- ? row.warehouseNames[index]
|
|
|
|
|
- : row.warehouseNames, // 仓库名称
|
|
|
|
|
|
|
+ warehouseId: row.warehouseId, // 仓库id
|
|
|
|
|
+ warehouseName: row.warehouseName, // 仓库名称
|
|
|
categoryName: row.categoryName, // 产品名称
|
|
categoryName: row.categoryName, // 产品名称
|
|
|
categoryCode: row.categoryCode, // 产品编码
|
|
categoryCode: row.categoryCode, // 产品编码
|
|
|
categoryModel: row.categoryModel, // 物品型号
|
|
categoryModel: row.categoryModel, // 物品型号
|
|
@@ -2494,19 +2319,18 @@ export default {
|
|
|
batchNo: row.batchNo, // 批次号
|
|
batchNo: row.batchNo, // 批次号
|
|
|
packageNo: packingCodeList[index]?.onlyCode, // 包装编码
|
|
packageNo: packingCodeList[index]?.onlyCode, // 包装编码
|
|
|
packingQuantity: 1, // 包装数量
|
|
packingQuantity: 1, // 包装数量
|
|
|
- // packingUnit: row.isUnpack
|
|
|
|
|
- // ? packingBoolen
|
|
|
|
|
- // ? filterArr[0].conversionUnit
|
|
|
|
|
- // : measureBoolen
|
|
|
|
|
- // ? row.packingSpecificationOption[1]
|
|
|
|
|
- // ? row.packingSpecificationOption[1].conversionUnit
|
|
|
|
|
- // : row.packingSpecificationOption[0].conversionUnit
|
|
|
|
|
- // : row.measureUnit
|
|
|
|
|
- // : packingBoolen
|
|
|
|
|
- // ? filterArr[0].conversionUnit
|
|
|
|
|
- // : row.packingUnit,
|
|
|
|
|
- // packingUnit: row.packingUnit,
|
|
|
|
|
- packingUnit: row.packingSpecificationOption[1]?.conversionUnit,
|
|
|
|
|
|
|
+ packingUnit: row.isUnpack
|
|
|
|
|
+ ? packingBoolen
|
|
|
|
|
+ ? filterArr[0].conversionUnit
|
|
|
|
|
+ : measureBoolen
|
|
|
|
|
+ ? row.packingSpecificationOption[1]
|
|
|
|
|
+ ? row.packingSpecificationOption[1].conversionUnit
|
|
|
|
|
+ : row.packingSpecificationOption[0].conversionUnit
|
|
|
|
|
+ : row.measureUnit
|
|
|
|
|
+ : packingBoolen
|
|
|
|
|
+ ? filterArr[0].conversionUnit
|
|
|
|
|
+ : row.packingUnit,
|
|
|
|
|
+
|
|
|
measureQuantity: row.isUnpack
|
|
measureQuantity: row.isUnpack
|
|
|
? packingBoolen
|
|
? packingBoolen
|
|
|
? measureQuantity
|
|
? measureQuantity
|
|
@@ -2642,6 +2466,166 @@ export default {
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
},
|
|
},
|
|
|
|
|
+ //入库明细删除
|
|
|
|
|
+ listDel(row, index) {
|
|
|
|
|
+ this.productList.splice(index, 1);
|
|
|
|
|
+ this.deletePackingAndMaterial(row);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 打开仓库弹框
|
|
|
|
|
+ handleWareHouse(row, idx) {
|
|
|
|
|
+ console.log(row, `rowrowrowrow打开仓库弹框`)
|
|
|
|
|
+ if (row.isSave) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
|
|
|
+ .dictValue;
|
|
|
|
|
+ let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
|
|
+ .dictValue;
|
|
|
|
|
+ if (idx > -1) {
|
|
|
|
|
+ if (row.packingQuantity > 0) {
|
|
|
|
|
+ console.log(packingBoolen, '111')
|
|
|
|
|
+ if (packingBoolen) {
|
|
|
|
|
+ let filterArr = row.packingSpecificationOption.filter((item) => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ item.packageUnit == row.packingUnit &&
|
|
|
|
|
+ item.packageUnit != item.conversionUnit
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(filterArr, 'ffff');
|
|
|
|
|
+ console.log(row, 'rrrrr');
|
|
|
|
|
+ let num = Math.ceil(
|
|
|
|
|
+ row.packingQuantity / filterArr[0].packageCell
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$refs.wareHouseDailogRef.open(
|
|
|
|
|
+ num,
|
|
|
|
|
+ idx,
|
|
|
|
|
+ row.warehouseId,
|
|
|
|
|
+ row.warehouseName + '',
|
|
|
|
|
+ row.categoryLevelPathIdParent
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log(measureBoolen, '222')
|
|
|
|
|
+ let num = row.packingQuantity;
|
|
|
|
|
+ if (measureBoolen) {
|
|
|
|
|
+
|
|
|
|
|
+ let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
|
|
+ (item) =>
|
|
|
|
|
+ item.conversionUnit == row.packingUnit &&
|
|
|
|
|
+ item.packageUnit != item.conversionUnit
|
|
|
|
|
+ );
|
|
|
|
|
+ for (; splitIndex > 1; splitIndex--) {
|
|
|
|
|
+ console.log(splitIndex);
|
|
|
|
|
+ num = this.$math.format(
|
|
|
|
|
+ num *
|
|
|
|
|
+ row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
|
|
+ 14
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$refs.wareHouseDailogRef.open(
|
|
|
|
|
+ num,
|
|
|
|
|
+ idx,
|
|
|
|
|
+ row.warehouseId,
|
|
|
|
|
+ row.warehouseName + '',
|
|
|
|
|
+ row.categoryLevelPathIdParent
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+
|
|
|
|
|
+ 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 {
|
|
|
|
|
+ this.$message.error('请先填写包装数量!');
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 批量设置
|
|
|
|
|
+ let boolen = this.productList.every(
|
|
|
|
|
+ (item) =>
|
|
|
|
|
+ item.packingQuantity == this.productList[0].packingQuantity
|
|
|
|
|
+ );
|
|
|
|
|
+ if (boolen) {
|
|
|
|
|
+ if (row.packingQuantity > 0) {
|
|
|
|
|
+ if (packingBoolen) {
|
|
|
|
|
+ let filterArr = row.packingSpecificationOption.filter(
|
|
|
|
|
+ (item) => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ item.packingUnit == row.packingUnit &&
|
|
|
|
|
+ item.packingUnit != item.conversionUnit
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ let num = Math.ceil(
|
|
|
|
|
+ row.packingQuantity / filterArr[0].packageCell
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$refs.wareHouseDailogRef.open(num, idx);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$refs.wareHouseDailogRef.open(
|
|
|
|
|
+ row.isUnpack
|
|
|
|
|
+ ? measureBoolen
|
|
|
|
|
+ ? row.packingQuantity
|
|
|
|
|
+ : row.measureQuantity
|
|
|
|
|
+ : row.packingQuantity,
|
|
|
|
|
+ idx
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('请先填写包装数量!');
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('请保证产品包装数量一致!');
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ wareHouseSelection(argum, idx) {
|
|
|
|
|
+ // 方便包装遍历获取仓库id和名称
|
|
|
|
|
+ let warehouseIds = [];
|
|
|
|
|
+ let warehouseNames = [];
|
|
|
|
|
+ argum.forEach((item) => {
|
|
|
|
|
+ for (let index = 0; index < item.packingQuantity; index++) {
|
|
|
|
|
+ warehouseIds.push(item.warehouseId);
|
|
|
|
|
+ warehouseNames.push(item.warehouseName);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(argum, 'argumargumargumargumargumargum');
|
|
|
|
|
+ if (idx > -1) {
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.productList[idx],
|
|
|
|
|
+ 'warehouseId',
|
|
|
|
|
+ argum.map((item) => item.warehouseId).join(',')
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.productList[idx],
|
|
|
|
|
+ 'warehouseName',
|
|
|
|
|
+ argum.map((item) => item.warehouseName).join(',')
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(this.productList[idx], 'warehouseIds', warehouseIds);
|
|
|
|
|
+ this.$set(this.productList[idx], 'warehouseNames', warehouseNames);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.productList.map((item, index) => {
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.productList[index],
|
|
|
|
|
+ 'warehouseId',
|
|
|
|
|
+ argum.map((item) => item.warehouseId).join(',')
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.productList[index],
|
|
|
|
|
+ 'warehouseName',
|
|
|
|
|
+ argum.map((item) => item.warehouseName).join(',')
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(this.productList[index], 'warehouseIds', warehouseIds);
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.productList[index],
|
|
|
|
|
+ 'warehouseNames',
|
|
|
|
|
+ warehouseNames
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
// 生成物料
|
|
// 生成物料
|
|
|
generateMaterial(row) {
|
|
generateMaterial(row) {
|
|
|
let materialList = [];
|
|
let materialList = [];
|