|
|
@@ -267,6 +267,7 @@
|
|
|
<el-input
|
|
|
:ref="'packingQuantity' + $index"
|
|
|
type="number"
|
|
|
+ placeholder="请输入"
|
|
|
@keyup.native="
|
|
|
moveFocus(
|
|
|
$event,
|
|
|
@@ -284,7 +285,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- label="包装单位"
|
|
|
+ label="单位"
|
|
|
align="center"
|
|
|
prop="packingUnit"
|
|
|
width="100"
|
|
|
@@ -578,10 +579,7 @@
|
|
|
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"
|
|
|
@@ -1001,7 +999,8 @@
|
|
|
pageSize: 20, // 物料和包装列表条数
|
|
|
pickingPageNum: 1, // 包装虚拟分页页数
|
|
|
materielPageNum: 1, // 物料虚拟分页页数
|
|
|
- packingSpecificationOption: [] // 包装规格下拉
|
|
|
+ packingSpecificationOption: [], // 包装规格下拉
|
|
|
+ proData: {}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -1065,7 +1064,7 @@
|
|
|
batchNo: batchNo, // 批次号
|
|
|
minPackingQuantity: item.quantity, // 最小包装单元数量
|
|
|
packingQuantity: 1, // 包装数量
|
|
|
- packingUnit: item.packingUnit, // 包装单位
|
|
|
+ packingUnit: item.packingUnit, // 单位
|
|
|
measureQuantity: 0, // 计量数量
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
|
@@ -1183,14 +1182,11 @@
|
|
|
)[0].name;
|
|
|
},
|
|
|
// 计算最小单元数量
|
|
|
- computeNum(row, index, isClear) {
|
|
|
- console.log(row);
|
|
|
- console.log(row.packingQuantity);
|
|
|
- console.log(row.packingUnit);
|
|
|
+ async computeNum(row, index, isClear) {
|
|
|
// 清空仓库(包装数量输入)
|
|
|
if (isClear) {
|
|
|
- this.$set(this.productList[index], 'warehouseId', '');
|
|
|
- this.$set(this.productList[index], 'warehouseName', '');
|
|
|
+ // this.$set(this.productList[index], 'warehouseId', '');
|
|
|
+ // this.$set(this.productList[index], 'warehouseName', '');
|
|
|
if (row.packingQuantity < 0) {
|
|
|
this.$set(this.productList[index], 'packingQuantity', 1);
|
|
|
} else if (row.packingQuantity > 9999) {
|
|
|
@@ -1210,8 +1206,16 @@
|
|
|
// }
|
|
|
}
|
|
|
if (row.packingQuantity && row.packingUnit) {
|
|
|
- console.log(index);
|
|
|
- console.log(row.packingSpecificationOption);
|
|
|
+ //获取仓库
|
|
|
+ const res = await warehouseDefinition.list({
|
|
|
+ inventoryType: this.proData[0]?.categoryLevelPathIdParent
|
|
|
+ });
|
|
|
+ if (res.length > 0) {
|
|
|
+ let name = res[0]?.factoryName + '-' + res[0]?.name;
|
|
|
+ console.log('仓库-----------------------------', res);
|
|
|
+ this.$set(this.productList[index], 'warehouseId', res[0].id);
|
|
|
+ this.$set(this.productList[index], 'warehouseName', name);
|
|
|
+ }
|
|
|
let startIndex = row.packingSpecificationOption.findIndex((ite) => {
|
|
|
return (
|
|
|
row.measuringUnit == ite.packingUnit &&
|
|
|
@@ -1231,7 +1235,7 @@
|
|
|
);
|
|
|
}
|
|
|
row.measureQuantity = this.changeCount(total);
|
|
|
- // 判断包装单位和计量单位是否为不拆物料层规格
|
|
|
+ // 判断单位和计量单位是否为不拆物料层规格
|
|
|
let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
|
.dictValue;
|
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
@@ -1409,8 +1413,8 @@
|
|
|
},
|
|
|
// 获取物品列表
|
|
|
async getListItems() {
|
|
|
- const { data } = await getTreeByGroup({ type: 2 });
|
|
|
- this.goodsLists = data;
|
|
|
+ const res2 = await warehouseDefinition.getTreeByGroup({ type: 1 });
|
|
|
+ this.goodsLists = res2;
|
|
|
},
|
|
|
// 打开单据来源弹窗
|
|
|
openDocumentSourceDialog() {
|
|
|
@@ -1689,7 +1693,7 @@
|
|
|
batchNo: batchNo, // 批次号
|
|
|
minPackingQuantity: 1, // 最小包装单元数量
|
|
|
packingQuantity: filterArray[0]['数量'], // 包装数量
|
|
|
- packingUnit: item.packingUnit, // 包装单位
|
|
|
+ packingUnit: item.packingUnit, // 单位
|
|
|
measureQuantity: 0, // 计量数量
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
|
@@ -1757,6 +1761,20 @@
|
|
|
});
|
|
|
obj.warehouseIds = warehouseId;
|
|
|
obj.warehouseNames = warehouseName;
|
|
|
+
|
|
|
+ obj.outInDetailList.map((item) => {
|
|
|
+ item.outInDetailRecordRequestList =
|
|
|
+ item.outInDetailRecordRequestList.map((packingItem) => {
|
|
|
+ delete packingItem.warehouseId;
|
|
|
+ delete packingItem.warehouseName;
|
|
|
+ return {
|
|
|
+ ...packingItem
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log('入库数据', obj);
|
|
|
+
|
|
|
// 是否需要审核(0审核 1跳过审核)
|
|
|
if (obj.bizType == '12') {
|
|
|
obj.isSkip = 1;
|
|
|
@@ -2065,6 +2083,7 @@
|
|
|
},
|
|
|
// 添加物品明细
|
|
|
async addGoods(data) {
|
|
|
+ this.proData = data;
|
|
|
// 获取批次号
|
|
|
const batchNo = await getCode('lot_number_code');
|
|
|
// 获取供应商
|
|
|
@@ -2118,7 +2137,7 @@
|
|
|
packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
|
|
|
minPackingQuantity: '', // 最小包装单元数量
|
|
|
packingQuantity: '', // 包装数量
|
|
|
- packingUnit: '', // 包装单位
|
|
|
+ packingUnit: '', // 单位
|
|
|
measureQuantity: 0, // 计量数量
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
|
@@ -2182,7 +2201,7 @@
|
|
|
.then(async () => {
|
|
|
// 批量获取包装编码并处理
|
|
|
let packingCodePrams = this.productList.map((row) => {
|
|
|
- // 判断包装单位和计量单位是否为不拆物料层规格
|
|
|
+ // 判断单位和计量单位是否为不拆物料层规格
|
|
|
let packingBoolen = !!this.getDict(
|
|
|
'不拆物料层规格',
|
|
|
row.packingUnit
|
|
|
@@ -2206,7 +2225,7 @@
|
|
|
if (row.isSave) {
|
|
|
return {};
|
|
|
} else {
|
|
|
- // 处理包装单位为KG类的情况
|
|
|
+ // 处理单位为KG类的情况
|
|
|
if (packingBoolen) {
|
|
|
return {
|
|
|
assetCode: row.categoryCode + row.index,
|
|
|
@@ -2216,7 +2235,7 @@
|
|
|
} else {
|
|
|
if (row.isUnpack) {
|
|
|
if (measureBoolen) {
|
|
|
- // 处理包装单位不为KG类,计量单位为KG类的情况
|
|
|
+ // 处理单位不为KG类,计量单位为KG类的情况
|
|
|
let num = row.packingQuantity;
|
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
(item) =>
|
|
|
@@ -2376,13 +2395,13 @@
|
|
|
// 产品保存操作
|
|
|
listSave(row, index) {
|
|
|
this.validateFormIndividually(index).then(async () => {
|
|
|
- // 判断包装单位和计量单位是否为不拆物料层规格
|
|
|
+ // 判断单位和计量单位是否为不拆物料层规格
|
|
|
let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
|
.dictValue;
|
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
.dictValue;
|
|
|
let packingNum = 0;
|
|
|
- // 处理包装单位为KG类的情况
|
|
|
+ // 处理单位为KG类的情况
|
|
|
if (packingBoolen) {
|
|
|
let filterArr = row.packingSpecificationOption.filter((item) => {
|
|
|
return (
|
|
|
@@ -2394,7 +2413,7 @@
|
|
|
row.packingQuantity / filterArr[0].packageCell
|
|
|
);
|
|
|
}
|
|
|
- // 处理包装单位不为KG类,计量单位为KG类的情况
|
|
|
+ // 处理单位不为KG类,计量单位为KG类的情况
|
|
|
let measureNum = row.packingQuantity;
|
|
|
if (measureBoolen) {
|
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
@@ -2426,6 +2445,20 @@
|
|
|
]);
|
|
|
this.generateWrappers(row, index, data);
|
|
|
this.$set(this.productList[index], 'isSave', true);
|
|
|
+ this.$set(this.productList[index], 'warehouseId', row.warehouseId);
|
|
|
+ this.$set(
|
|
|
+ this.productList[index],
|
|
|
+ 'warehouseName',
|
|
|
+ row.warehouseName
|
|
|
+ );
|
|
|
+
|
|
|
+ this.$set(this.productList[index], 'warehouseIds', row.warehouseId);
|
|
|
+ this.$set(
|
|
|
+ this.productList[index],
|
|
|
+ 'warehouseNames',
|
|
|
+ row.warehouseName
|
|
|
+ );
|
|
|
+
|
|
|
// 加载虚拟列表数据(分页)
|
|
|
// this.pickingFetchData();
|
|
|
// this.materielFetchData();
|
|
|
@@ -2458,7 +2491,12 @@
|
|
|
let num = Math.ceil(
|
|
|
row.packingQuantity / filterArr[0].packageCell
|
|
|
);
|
|
|
- this.$refs.wareHouseDailogRef.open(num, idx);
|
|
|
+ this.$refs.wareHouseDailogRef.open(
|
|
|
+ num,
|
|
|
+ idx,
|
|
|
+ row.warehouseId,
|
|
|
+ row.warehouseName + ''
|
|
|
+ );
|
|
|
} else {
|
|
|
let num = row.packingQuantity;
|
|
|
if (measureBoolen) {
|
|
|
@@ -2484,7 +2522,9 @@
|
|
|
? num
|
|
|
: row.measureQuantity
|
|
|
: row.packingQuantity,
|
|
|
- idx
|
|
|
+ idx,
|
|
|
+ row.warehouseId,
|
|
|
+ row.warehouseName + ''
|
|
|
);
|
|
|
}
|
|
|
} else {
|
|
|
@@ -2599,14 +2639,14 @@
|
|
|
purchaseDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`;
|
|
|
this.curDateType = 'purchaseDate';
|
|
|
}
|
|
|
- // 判断包装单位和计量单位是否为不拆物料层规格
|
|
|
+ // 判断单位和计量单位是否为不拆物料层规格
|
|
|
let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
|
.dictValue;
|
|
|
let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
|
|
|
.dictValue;
|
|
|
let num = row.packingQuantity;
|
|
|
let filterArr = [];
|
|
|
- // 处理包装单位为KG类的情况
|
|
|
+ // 处理单位为KG类的情况
|
|
|
if (packingBoolen) {
|
|
|
filterArr = row.packingSpecificationOption.filter((item) => {
|
|
|
return (
|
|
|
@@ -2618,7 +2658,7 @@
|
|
|
} else {
|
|
|
if (row.isUnpack) {
|
|
|
if (measureBoolen) {
|
|
|
- // 处理包装单位不为KG类,计量单位为KG类的情况
|
|
|
+ // 处理单位不为KG类,计量单位为KG类的情况
|
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
(item) =>
|
|
|
item.conversionUnit == row.packingUnit &&
|
|
|
@@ -2653,7 +2693,7 @@
|
|
|
console.log('num-----------', num);
|
|
|
for (let index = 0; index < num; index++) {
|
|
|
let measureQuantity = 1;
|
|
|
- // 处理包装单位为KG类,计算每桶KG值
|
|
|
+ // 处理单位为KG类,计算每桶KG值
|
|
|
if (packingBoolen) {
|
|
|
console.log(
|
|
|
this.$math.format(filterArr[0].packageCell * (index + 1), 14)
|
|
|
@@ -2668,7 +2708,7 @@
|
|
|
} else {
|
|
|
if (!row.isUnpack) {
|
|
|
if (measureBoolen) {
|
|
|
- // 处理包装单位不为KG类,计量单位为KG类的情况
|
|
|
+ // 处理单位不为KG类,计量单位为KG类的情况
|
|
|
let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
(item) =>
|
|
|
item.conversionUnit == row.packingUnit &&
|
|
|
@@ -2700,8 +2740,12 @@
|
|
|
}
|
|
|
let item = {
|
|
|
index: row.index + '-' + index, // 包装索引
|
|
|
- warehouseId: row.warehouseIds[index], // 仓库id
|
|
|
- warehouseName: row.warehouseNames[index], // 仓库名称
|
|
|
+ warehouseId: row.warehouseIds
|
|
|
+ ? row.warehouseIds[index]
|
|
|
+ : row.warehouseIds, // 仓库id
|
|
|
+ warehouseName: row.warehouseNames
|
|
|
+ ? row.warehouseNames[index]
|
|
|
+ : row.warehouseNames, // 仓库名称
|
|
|
categoryName: row.categoryName, // 产品名称
|
|
|
categoryCode: row.categoryCode, // 产品编码
|
|
|
categoryModel: row.categoryModel, // 物品型号
|