|
@@ -1385,6 +1385,7 @@
|
|
|
warehouseName: item.warehouseName, // 仓库名称
|
|
warehouseName: item.warehouseName, // 仓库名称
|
|
|
warehouseIds: [item.warehouseId],
|
|
warehouseIds: [item.warehouseId],
|
|
|
warehouseNames: [item.warehouseName]
|
|
warehouseNames: [item.warehouseName]
|
|
|
|
|
+ // 编辑时单位选择消失bug
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
// this.$nextTick(() => {
|
|
// this.$nextTick(() => {
|
|
@@ -1402,6 +1403,10 @@
|
|
|
return new BigNumber(number).toString();
|
|
return new BigNumber(number).toString();
|
|
|
},
|
|
},
|
|
|
viewInit() {
|
|
viewInit() {
|
|
|
|
|
+ const _this = this;
|
|
|
|
|
+ // 编辑时选单位没有选项bug
|
|
|
|
|
+ let packingSpecification;
|
|
|
|
|
+
|
|
|
storageApi
|
|
storageApi
|
|
|
.getInboundDetailsById(this.$route.query.detailId)
|
|
.getInboundDetailsById(this.$route.query.detailId)
|
|
|
.then(async (data) => {
|
|
.then(async (data) => {
|
|
@@ -1411,12 +1416,33 @@
|
|
|
this.formData.id = data.id;
|
|
this.formData.id = data.id;
|
|
|
this.formData.bizNo = data.bizNo;
|
|
this.formData.bizNo = data.bizNo;
|
|
|
const batchNo = await getCode('lot_number_code');
|
|
const batchNo = await getCode('lot_number_code');
|
|
|
|
|
+
|
|
|
|
|
+ packingSpecification =
|
|
|
|
|
+ await storageApi.getCategoryPackageDisposition({
|
|
|
|
|
+ categoryIds: data.outInDetailList.map((item) => item.categoryId)
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ console.log(packingSpecification);
|
|
|
|
|
+
|
|
|
|
|
+ this.packingSpecificationOption = data.outInDetailList.map(
|
|
|
|
|
+ (item) => {
|
|
|
|
|
+ return packingSpecification
|
|
|
|
|
+ .filter((ite) => item.categoryId == ite.categoryId)
|
|
|
|
|
+ .sort((a, b) => a.sort - b.sort);
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ const newSpecificationOption = this.packingSpecificationOption;
|
|
|
this.productList = data.outInDetailList.map(
|
|
this.productList = data.outInDetailList.map(
|
|
|
(productItem, productIndex) => {
|
|
(productItem, productIndex) => {
|
|
|
return {
|
|
return {
|
|
|
...productItem,
|
|
...productItem,
|
|
|
index: this.productList.length + productIndex,
|
|
index: this.productList.length + productIndex,
|
|
|
isSave: true,
|
|
isSave: true,
|
|
|
|
|
+ // 编辑时没有单位选项
|
|
|
|
|
+ packingSpecificationOption:
|
|
|
|
|
+ newSpecificationOption[productIndex],
|
|
|
|
|
+ //
|
|
|
packingSpecificationLabel:
|
|
packingSpecificationLabel:
|
|
|
productItem.extField?.packingSpecification?.split(','),
|
|
productItem.extField?.packingSpecification?.split(','),
|
|
|
batchNo: batchNo, // 批次号
|
|
batchNo: batchNo, // 批次号
|
|
@@ -2216,110 +2242,122 @@
|
|
|
},
|
|
},
|
|
|
// 入库
|
|
// 入库
|
|
|
handleStorage(type) {
|
|
handleStorage(type) {
|
|
|
- let boolen = this.productList.every((item) => item.isSave);
|
|
|
|
|
- if (!boolen) {
|
|
|
|
|
- this.$message.warning('请先保存所有产品信息');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- // 处理包装数据
|
|
|
|
|
- this.packingList = this.packingList.map((packingItem) => {
|
|
|
|
|
- if (packingItem.modelKey) {
|
|
|
|
|
- packingItem.modelKey = packingItem.modelKey.toString();
|
|
|
|
|
- }
|
|
|
|
|
- if (packingItem.colorKey) {
|
|
|
|
|
- packingItem.colorKey = packingItem.colorKey.toString();
|
|
|
|
|
- }
|
|
|
|
|
- return {
|
|
|
|
|
- ...packingItem,
|
|
|
|
|
- materialDetailList: this.materialList.filter(
|
|
|
|
|
- (item) => item.parentIndex === packingItem.index
|
|
|
|
|
- ),
|
|
|
|
|
- taskId: this.selWWData?.taskId,
|
|
|
|
|
- workOrderId: this.selWWData?.workOrderId
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- // 处理产品数据
|
|
|
|
|
- this.productList = this.productList.map((productItem) => {
|
|
|
|
|
- if (productItem.modelKey) {
|
|
|
|
|
- productItem.modelKey = productItem.modelKey.toString();
|
|
|
|
|
- }
|
|
|
|
|
- if (productItem.colorKey) {
|
|
|
|
|
- productItem.colorKey = productItem.colorKey.toString();
|
|
|
|
|
- }
|
|
|
|
|
- return {
|
|
|
|
|
- ...productItem,
|
|
|
|
|
- outInDetailRecordRequestList: this.packingList.filter(
|
|
|
|
|
- (item) => item.parentIndex === productItem.index
|
|
|
|
|
- )
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- this.formData.outInDetailList = this.productList;
|
|
|
|
|
- let obj = deepClone(this.formData);
|
|
|
|
|
- // 处理物品类型assetType
|
|
|
|
|
- obj.extInfo.assetType = obj.extInfo.assetType.join(',');
|
|
|
|
|
- // 处理仓库id
|
|
|
|
|
- let warehouseId = [];
|
|
|
|
|
- let warehouseName = [];
|
|
|
|
|
- let warehouseIds = this.productList
|
|
|
|
|
- .map((item) => item.warehouseIds)
|
|
|
|
|
- .flat();
|
|
|
|
|
- let warehouseNames = this.productList
|
|
|
|
|
- .map((item) => item.warehouseNames)
|
|
|
|
|
- .flat();
|
|
|
|
|
- warehouseIds.forEach((item, index) => {
|
|
|
|
|
- if (!warehouseId.includes(item)) {
|
|
|
|
|
- warehouseId.push(item);
|
|
|
|
|
- warehouseName.push(warehouseNames[index]);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- obj.warehouseIds = warehouseId;
|
|
|
|
|
- obj.warehouseNames = warehouseName;
|
|
|
|
|
|
|
+ this.$refs.formName.validate(async (valid) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ if (!this.productList.length) {
|
|
|
|
|
+ return this.$message.warning('请至少添加一条产品');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- console.log('入库数据', obj);
|
|
|
|
|
|
|
+ let boolen = this.productList.every((item) => item.isSave);
|
|
|
|
|
+ console.log(boolen);
|
|
|
|
|
|
|
|
- // 是否需要审核(0审核 1跳过审核)
|
|
|
|
|
- if (obj.bizType == '12') {
|
|
|
|
|
- obj.isSkip = 1;
|
|
|
|
|
- } else {
|
|
|
|
|
- obj.isSkip = 0;
|
|
|
|
|
- }
|
|
|
|
|
- // obj.isSkip = 1;
|
|
|
|
|
- this.saveLoading = true;
|
|
|
|
|
- console.log(obj, 'objobjobjobjobjobj');
|
|
|
|
|
- let api = obj.id ? storageApi.update : storageApi.storage;
|
|
|
|
|
- api(obj)
|
|
|
|
|
- .then(async (res) => {
|
|
|
|
|
- console.log('入库成功', res);
|
|
|
|
|
- console.log('入库成功', obj.id);
|
|
|
|
|
- if (res.code == 0) {
|
|
|
|
|
- try {
|
|
|
|
|
- if (type != 'save') {
|
|
|
|
|
- if (obj.bizType == '12') {
|
|
|
|
|
- await storageApi.qualityInspectionTwo({
|
|
|
|
|
- outInIds: res.data
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- await storageApi.submitTwo({ outInIds: res.data });
|
|
|
|
|
|
|
+ if (!boolen) {
|
|
|
|
|
+ this.$message.warning('请先保存所有产品信息');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 处理包装数据
|
|
|
|
|
+ this.packingList = this.packingList.map((packingItem) => {
|
|
|
|
|
+ if (packingItem.modelKey) {
|
|
|
|
|
+ packingItem.modelKey = packingItem.modelKey.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (packingItem.colorKey) {
|
|
|
|
|
+ packingItem.colorKey = packingItem.colorKey.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...packingItem,
|
|
|
|
|
+ materialDetailList: this.materialList.filter(
|
|
|
|
|
+ (item) => item.parentIndex === packingItem.index
|
|
|
|
|
+ ),
|
|
|
|
|
+ taskId: this.selWWData?.taskId,
|
|
|
|
|
+ workOrderId: this.selWWData?.workOrderId
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ // 处理产品数据
|
|
|
|
|
+ this.productList = this.productList.map((productItem) => {
|
|
|
|
|
+ if (productItem.modelKey) {
|
|
|
|
|
+ productItem.modelKey = productItem.modelKey.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (productItem.colorKey) {
|
|
|
|
|
+ productItem.colorKey = productItem.colorKey.toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...productItem,
|
|
|
|
|
+ outInDetailRecordRequestList: this.packingList.filter(
|
|
|
|
|
+ (item) => item.parentIndex === productItem.index
|
|
|
|
|
+ )
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ this.formData.outInDetailList = this.productList;
|
|
|
|
|
+ let obj = deepClone(this.formData);
|
|
|
|
|
+ // 处理物品类型assetType
|
|
|
|
|
+ obj.extInfo.assetType = obj.extInfo.assetType.join(',');
|
|
|
|
|
+ // 处理仓库id
|
|
|
|
|
+ let warehouseId = [];
|
|
|
|
|
+ let warehouseName = [];
|
|
|
|
|
+ let warehouseIds = this.productList
|
|
|
|
|
+ .map((item) => item.warehouseIds)
|
|
|
|
|
+ .flat();
|
|
|
|
|
+ let warehouseNames = this.productList
|
|
|
|
|
+ .map((item) => item.warehouseNames)
|
|
|
|
|
+ .flat();
|
|
|
|
|
+ warehouseIds.forEach((item, index) => {
|
|
|
|
|
+ if (!warehouseId.includes(item)) {
|
|
|
|
|
+ warehouseId.push(item);
|
|
|
|
|
+ warehouseName.push(warehouseNames[index]);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ obj.warehouseIds = warehouseId;
|
|
|
|
|
+ obj.warehouseNames = warehouseName;
|
|
|
|
|
+
|
|
|
|
|
+ console.log('入库数据', obj);
|
|
|
|
|
+
|
|
|
|
|
+ // 是否需要审核(0审核 1跳过审核)
|
|
|
|
|
+ if (obj.bizType == '12') {
|
|
|
|
|
+ obj.isSkip = 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ obj.isSkip = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ // obj.isSkip = 1;
|
|
|
|
|
+ this.saveLoading = true;
|
|
|
|
|
+ console.log(obj, 'objobjobjobjobjobj');
|
|
|
|
|
+ let api = obj.id ? storageApi.update : storageApi.storage;
|
|
|
|
|
+ api(obj)
|
|
|
|
|
+ .then(async (res) => {
|
|
|
|
|
+ console.log('入库成功', res);
|
|
|
|
|
+ console.log('入库成功', obj.id);
|
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (type != 'save') {
|
|
|
|
|
+ if (obj.bizType == '12') {
|
|
|
|
|
+ await storageApi.qualityInspectionTwo({
|
|
|
|
|
+ outInIds: res.data
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ await storageApi.submitTwo({ outInIds: res.data });
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$message.success('入库成功');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ // 委外入库(非采购)
|
|
|
|
|
+
|
|
|
|
|
+ this.saveLoading = false;
|
|
|
|
|
+ this.$router.push('/warehouseManagement/stockManagement');
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.saveLoading = false;
|
|
|
|
|
+ this.$router.push('/warehouseManagement/stockManagement');
|
|
|
|
|
+ console.log('提交流程失败', error);
|
|
|
}
|
|
}
|
|
|
- this.$message.success('入库成功');
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.success('操作成功');
|
|
|
|
|
}
|
|
}
|
|
|
- // 委外入库(非采购)
|
|
|
|
|
-
|
|
|
|
|
- this.saveLoading = false;
|
|
|
|
|
- this.$router.push('/warehouseManagement/stockManagement');
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ console.log('入库失败', err);
|
|
|
this.saveLoading = false;
|
|
this.saveLoading = false;
|
|
|
- this.$router.push('/warehouseManagement/stockManagement');
|
|
|
|
|
- console.log('提交流程失败', error);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch((err) => {
|
|
|
|
|
- console.log('入库失败', err);
|
|
|
|
|
- this.saveLoading = false;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
pickingHandleScroll() {
|
|
pickingHandleScroll() {
|
|
|
// console.log('---------pickingHandleScroll------------');
|
|
// console.log('---------pickingHandleScroll------------');
|
|
@@ -2623,7 +2661,7 @@
|
|
|
categoryIds: data.map((item) => item.id)
|
|
categoryIds: data.map((item) => item.id)
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- console.log(packingSpecification, 'packingSpecification');
|
|
|
|
|
|
|
+ console.log(packingSpecification, '--packingSpecification');
|
|
|
|
|
|
|
|
this.packingSpecificationOption = data.map((item) => {
|
|
this.packingSpecificationOption = data.map((item) => {
|
|
|
return packingSpecification
|
|
return packingSpecification
|
|
@@ -2660,8 +2698,8 @@
|
|
|
categoryCode: item.code, // 物品编码
|
|
categoryCode: item.code, // 物品编码
|
|
|
categoryModel: item.modelType, // 物品型号
|
|
categoryModel: item.modelType, // 物品型号
|
|
|
specification: item.specification, // 规格
|
|
specification: item.specification, // 规格
|
|
|
- modelKey: item.modelKey?item.modelKey.split(','):'', // 机型
|
|
|
|
|
- colorKey: item.colorKey?item.colorKey.split(','):'', // 颜色
|
|
|
|
|
|
|
+ modelKey: item.modelKey ? item.modelKey.split(',') : '', // 机型
|
|
|
|
|
+ colorKey: item.colorKey ? item.colorKey.split(',') : '', // 颜色
|
|
|
color: item.color,
|
|
color: item.color,
|
|
|
brandNum: item.brandNum, // 牌号
|
|
brandNum: item.brandNum, // 牌号
|
|
|
batchNo: batchNo, // 批次号
|
|
batchNo: batchNo, // 批次号
|
|
@@ -3626,4 +3664,8 @@
|
|
|
word-break: break-all;
|
|
word-break: break-all;
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ :deep(.el-col) {
|
|
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|