|
@@ -933,7 +933,7 @@
|
|
|
detailList: { type: Array, default: () => [] },
|
|
detailList: { type: Array, default: () => [] },
|
|
|
saleProductList: { type: Array, default: () => [] },
|
|
saleProductList: { type: Array, default: () => [] },
|
|
|
detailProductList: { type: Array, default: () => [] },
|
|
detailProductList: { type: Array, default: () => [] },
|
|
|
- isMoreProduct: { type: Boolean, default:false }, //多产品包装明细
|
|
|
|
|
|
|
+ isMoreProduct: { type: Boolean, default: false } //多产品包装明细
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -1270,18 +1270,19 @@
|
|
|
warehouseIds.push(this.form.warehouseId);
|
|
warehouseIds.push(this.form.warehouseId);
|
|
|
warehouseNames.push(this.form.warehouseName);
|
|
warehouseNames.push(this.form.warehouseName);
|
|
|
}
|
|
}
|
|
|
- if(this.isMoreProduct){
|
|
|
|
|
- this.formData.extInfo.assetType=[]
|
|
|
|
|
- res.map(item=>{
|
|
|
|
|
- this.formData.extInfo.assetType.push(item.categoryLevelPathIdParent)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (this.isMoreProduct) {
|
|
|
|
|
+ this.formData.extInfo.assetType = [];
|
|
|
|
|
+ res.map((item) => {
|
|
|
|
|
+ this.formData.extInfo.assetType.push(
|
|
|
|
|
+ item.categoryLevelPathIdParent
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
this.formData.extInfo.assetType = Array.from(
|
|
this.formData.extInfo.assetType = Array.from(
|
|
|
- new Set(...this.formData.extInfo.assetType)
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ new Set(...this.formData.extInfo.assetType)
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
// 生成产品列表
|
|
// 生成产品列表
|
|
|
this.productList = res.map((item, index) => {
|
|
this.productList = res.map((item, index) => {
|
|
|
-
|
|
|
|
|
// 显示规格
|
|
// 显示规格
|
|
|
let packingSpecificationLabel = this.packingSpecificationOption[
|
|
let packingSpecificationLabel = this.packingSpecificationOption[
|
|
|
index
|
|
index
|
|
@@ -1342,9 +1343,15 @@
|
|
|
this.packingSpecificationOption[index], // 包装规格选项
|
|
this.packingSpecificationOption[index], // 包装规格选项
|
|
|
packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
|
|
packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
|
|
|
// minPackingQuantity: 1, // 最小包装单元数量
|
|
// minPackingQuantity: 1, // 最小包装单元数量
|
|
|
- packingQuantity:this.isMoreProduct?this.detailList.filter(val=>val.productCode==item.code).length:this.detailList.length || this.form.detailList.length, // 包装数量
|
|
|
|
|
|
|
+ packingQuantity: this.isMoreProduct
|
|
|
|
|
+ ? this.detailList.filter(
|
|
|
|
|
+ (val) => val.productCode == item.code
|
|
|
|
|
+ ).length
|
|
|
|
|
+ : this.detailList.length || this.form.detailList.length, // 包装数量
|
|
|
packingUnit: item.packingUnit, // 单位
|
|
packingUnit: item.packingUnit, // 单位
|
|
|
- measureQuantity: this.isMoreProduct?this.getMeasureQuantity(item.code):this.form.totalCount, // 计量数量
|
|
|
|
|
|
|
+ measureQuantity: this.isMoreProduct
|
|
|
|
|
+ ? this.getMeasureQuantity(item.code)
|
|
|
|
|
+ : this.form.totalCount, // 计量数量
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
|
weight: weight, // 重量
|
|
weight: weight, // 重量
|
|
@@ -1353,26 +1360,43 @@
|
|
|
price: item.price, // 单价
|
|
price: item.price, // 单价
|
|
|
purpose: '', // 用途
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
|
- warehouseId:this.isMoreProduct?this.detailList.find(val=>val.productCode==item.code)?.warehouseId:this.form.warehouseId, // 仓库id
|
|
|
|
|
- warehouseName: this.isMoreProduct?this.detailList.find(val=>val.productCode==item.code)?.warehouseName:this.form.warehouseName, // 仓库名称
|
|
|
|
|
- warehouseIds:this.isMoreProduct?this.detailList.filter(val=>val.productCode==item.code).map(item=>item.warehouseId):warehouseIds,
|
|
|
|
|
- warehouseNames:this.isMoreProduct?this.detailList.filter(val=>val.productCode==item.code).map(item=>item.warehouseName):warehouseNames,
|
|
|
|
|
|
|
+ warehouseId: this.isMoreProduct
|
|
|
|
|
+ ? this.detailList.find((val) => val.productCode == item.code)
|
|
|
|
|
+ ?.warehouseId
|
|
|
|
|
+ : this.form.warehouseId, // 仓库id
|
|
|
|
|
+ warehouseName: this.isMoreProduct
|
|
|
|
|
+ ? this.detailList.find((val) => val.productCode == item.code)
|
|
|
|
|
+ ?.warehouseName
|
|
|
|
|
+ : this.form.warehouseName, // 仓库名称
|
|
|
|
|
+ warehouseIds: this.isMoreProduct
|
|
|
|
|
+ ? this.detailList
|
|
|
|
|
+ .filter((val) => val.productCode == item.code)
|
|
|
|
|
+ .map((item) => item.warehouseId)
|
|
|
|
|
+ : warehouseIds,
|
|
|
|
|
+ warehouseNames: this.isMoreProduct
|
|
|
|
|
+ ? this.detailList
|
|
|
|
|
+ .filter((val) => val.productCode == item.code)
|
|
|
|
|
+ .map((item) => item.warehouseName)
|
|
|
|
|
+ : warehouseNames
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
- let getAssetNumPr=this.isMoreProduct? this.detailList.map(val=>{
|
|
|
|
|
- return {
|
|
|
|
|
- assetCode:val.productCode,
|
|
|
|
|
- batchNum: val.productBrand,
|
|
|
|
|
- num: 1
|
|
|
|
|
- }
|
|
|
|
|
- }):[
|
|
|
|
|
- {
|
|
|
|
|
- assetCode:
|
|
|
|
|
- this.productList[0].categoryCode + this.productList[0].index,
|
|
|
|
|
- batchNum: this.productList[0].batchNo,
|
|
|
|
|
- num: this.detailList.length
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ let getAssetNumPr = this.isMoreProduct
|
|
|
|
|
+ ? this.detailList.map((val) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ assetCode: val.productCode,
|
|
|
|
|
+ batchNum: val.productBrand,
|
|
|
|
|
+ num: 1
|
|
|
|
|
+ };
|
|
|
|
|
+ })
|
|
|
|
|
+ : [
|
|
|
|
|
+ {
|
|
|
|
|
+ assetCode:
|
|
|
|
|
+ this.productList[0].categoryCode +
|
|
|
|
|
+ this.productList[0].index,
|
|
|
|
|
+ batchNum: this.productList[0].batchNo,
|
|
|
|
|
+ num: this.detailList.length
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
// 生成包装编码
|
|
// 生成包装编码
|
|
|
const { data } = await storageApi.getAssetNum(getAssetNumPr);
|
|
const { data } = await storageApi.getAssetNum(getAssetNumPr);
|
|
|
let packingCodeList = data;
|
|
let packingCodeList = data;
|
|
@@ -1418,30 +1442,52 @@
|
|
|
this.curDateType = 'purchaseDate';
|
|
this.curDateType = 'purchaseDate';
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
- index: this.isMoreProduct?this.productList.find(val=>val.categoryCode==item.productCode).index+'-'+index:this.productList[0].index + '-' + index, // 包装索引
|
|
|
|
|
- warehouseId:item.warehouseId|| this.productList[0].warehouseIds[index], // 仓库id
|
|
|
|
|
- warehouseName:item.warehouseName|| this.productList[0].warehouseNames[index], // 仓库名称
|
|
|
|
|
- categoryName: item.productName||this.productList[0].categoryName, // 产品名称
|
|
|
|
|
- categoryCode: item.productCode||this.productList[0].categoryCode, // 产品编码
|
|
|
|
|
- categoryModel:item.modelType|| this.productList[0].categoryModel, // 物品型号
|
|
|
|
|
- specification: item.specification||this.productList[0].specification, // 规格
|
|
|
|
|
- brandNum: item.productBrand||this.productList[0].brandNum, // 牌号
|
|
|
|
|
- parentIndex: this.isMoreProduct?this.productList.find(val=>val.categoryCode==item.productCode).index:this.productList[0].index, // 产品索引
|
|
|
|
|
|
|
+ index: this.isMoreProduct
|
|
|
|
|
+ ? this.productList.find(
|
|
|
|
|
+ (val) => val.categoryCode == item.productCode
|
|
|
|
|
+ ).index +
|
|
|
|
|
+ '-' +
|
|
|
|
|
+ index
|
|
|
|
|
+ : this.productList[0].index + '-' + index, // 包装索引
|
|
|
|
|
+ warehouseId:
|
|
|
|
|
+ item.warehouseId || this.productList[0].warehouseIds[index], // 仓库id
|
|
|
|
|
+ warehouseName:
|
|
|
|
|
+ item.warehouseName ||
|
|
|
|
|
+ this.productList[0].warehouseNames[index], // 仓库名称
|
|
|
|
|
+ categoryName:
|
|
|
|
|
+ item.productName || this.productList[0].categoryName, // 产品名称
|
|
|
|
|
+ categoryCode:
|
|
|
|
|
+ item.productCode || this.productList[0].categoryCode, // 产品编码
|
|
|
|
|
+ categoryModel:
|
|
|
|
|
+ item.modelType || this.productList[0].categoryModel, // 物品型号
|
|
|
|
|
+ specification:
|
|
|
|
|
+ item.specification || this.productList[0].specification, // 规格
|
|
|
|
|
+ brandNum: item.productBrand || this.productList[0].brandNum, // 牌号
|
|
|
|
|
+ parentIndex: this.isMoreProduct
|
|
|
|
|
+ ? this.productList.find(
|
|
|
|
|
+ (val) => val.categoryCode == item.productCode
|
|
|
|
|
+ ).index
|
|
|
|
|
+ : this.productList[0].index, // 产品索引
|
|
|
batchNo: this.productList[0].batchNo, // 批次号
|
|
batchNo: this.productList[0].batchNo, // 批次号
|
|
|
- packageNo:packingCodeList[index].onlyCode, // 包装编码
|
|
|
|
|
|
|
+ packageNo: packingCodeList[index].onlyCode, // 包装编码
|
|
|
packingQuantity: 1, // 包装数量
|
|
packingQuantity: 1, // 包装数量
|
|
|
packingUnit: item.packingUnit, // 单位
|
|
packingUnit: item.packingUnit, // 单位
|
|
|
measureQuantity: item.quantity, // 计量数量
|
|
measureQuantity: item.quantity, // 计量数量
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
weight: item.packingWeight, // 重量
|
|
weight: item.packingWeight, // 重量
|
|
|
- weightUnit: item.weightUnit||this.productList[0].weightUnit, // 重量单位
|
|
|
|
|
- packingSpecificationOption:this.isMoreProduct?this.productList.find(val=>val.categoryCode==item.productCode)?.packingSpecificationOption:this.productList[0].packingSpecificationOption, // 包装规格
|
|
|
|
|
-
|
|
|
|
|
|
|
+ weightUnit: item.weightUnit || this.productList[0].weightUnit, // 重量单位
|
|
|
|
|
+ packingSpecificationOption: this.isMoreProduct
|
|
|
|
|
+ ? this.productList.find(
|
|
|
|
|
+ (val) => val.categoryCode == item.productCode
|
|
|
|
|
+ )?.packingSpecificationOption
|
|
|
|
|
+ : this.productList[0].packingSpecificationOption, // 包装规格
|
|
|
|
|
+
|
|
|
netWeight: this.productList[0].netWeight, // 净重
|
|
netWeight: this.productList[0].netWeight, // 净重
|
|
|
- barcodes: item.barcodes||item.sendCode, // 发货条码
|
|
|
|
|
- clientCode: item.clientCode||item.extInfo?.clientCode, // 客户代号
|
|
|
|
|
- materielDesignation:item.materielDesignation|| item.extInfo?.materielCode, // 物料代号
|
|
|
|
|
- engrave: item.engrave||item.extInfo?.engrave, // 刻码
|
|
|
|
|
|
|
+ barcodes: item.barcodes || item.sendCode, // 发货条码
|
|
|
|
|
+ clientCode: item.clientCode || item.extInfo?.clientCode, // 客户代号
|
|
|
|
|
+ materielDesignation:
|
|
|
|
|
+ item.materielDesignation || item.extInfo?.materielCode, // 物料代号
|
|
|
|
|
+ engrave: item.engrave || item.extInfo?.engrave, // 刻码
|
|
|
isUnpack: this.productList[0].isUnpack, // 是否允许拆包
|
|
isUnpack: this.productList[0].isUnpack, // 是否允许拆包
|
|
|
productionDate: productionDate, // 生产日期
|
|
productionDate: productionDate, // 生产日期
|
|
|
purchaseDate: purchaseDate, // 采购时间
|
|
purchaseDate: purchaseDate, // 采购时间
|
|
@@ -1453,28 +1499,27 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- //获取计量数量
|
|
|
|
|
- getMeasureQuantity(code){
|
|
|
|
|
- let measureQuantity=0
|
|
|
|
|
- this.detailList.forEach(item=>{
|
|
|
|
|
- if(code==item.productCode){
|
|
|
|
|
- measureQuantity+=item.quantity
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
- return measureQuantity
|
|
|
|
|
- },
|
|
|
|
|
- //多产品明细数据转换
|
|
|
|
|
- async getDetailsVal(code,productBrand) {
|
|
|
|
|
- const {data} =await storageApi.getAssetNum([
|
|
|
|
|
- {
|
|
|
|
|
- assetCode:code,
|
|
|
|
|
- batchNum: 1,
|
|
|
|
|
- num: 1
|
|
|
|
|
- }
|
|
|
|
|
- ]);
|
|
|
|
|
- console.log(data)
|
|
|
|
|
- return data[0].onlyCode
|
|
|
|
|
|
|
+ //获取计量数量
|
|
|
|
|
+ getMeasureQuantity(code) {
|
|
|
|
|
+ let measureQuantity = 0;
|
|
|
|
|
+ this.detailList.forEach((item) => {
|
|
|
|
|
+ if (code == item.productCode) {
|
|
|
|
|
+ measureQuantity += item.quantity;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return measureQuantity;
|
|
|
|
|
+ },
|
|
|
|
|
+ //多产品明细数据转换
|
|
|
|
|
+ async getDetailsVal(code, productBrand) {
|
|
|
|
|
+ const { data } = await storageApi.getAssetNum([
|
|
|
|
|
+ {
|
|
|
|
|
+ assetCode: code,
|
|
|
|
|
+ batchNum: 1,
|
|
|
|
|
+ num: 1
|
|
|
|
|
+ }
|
|
|
|
|
+ ]);
|
|
|
|
|
+ console.log(data);
|
|
|
|
|
+ return data[0].onlyCode;
|
|
|
},
|
|
},
|
|
|
// 获取当前时间函数
|
|
// 获取当前时间函数
|
|
|
getNowDate() {
|
|
getNowDate() {
|
|
@@ -1772,7 +1817,7 @@
|
|
|
});
|
|
});
|
|
|
obj.warehouseIds = warehouseId;
|
|
obj.warehouseIds = warehouseId;
|
|
|
obj.warehouseNames = warehouseName;
|
|
obj.warehouseNames = warehouseName;
|
|
|
- obj._packingList=_packingList
|
|
|
|
|
|
|
+ obj._packingList = _packingList;
|
|
|
console.log('yyyyy', obj);
|
|
console.log('yyyyy', obj);
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
resolve(obj);
|
|
resolve(obj);
|