|
|
@@ -229,7 +229,7 @@
|
|
|
width="100"
|
|
|
prop="ifPackageOk"
|
|
|
v-if="isShowPackage"
|
|
|
- >
|
|
|
+ >
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
<!-- <template v-if="row.isSave">
|
|
|
{{ row.ifPackageOk == 1 ? '是' : row.ifPackageOk == 0 ? '否' : '' }}
|
|
|
@@ -238,7 +238,12 @@
|
|
|
:prop="`productList.${$index}.ifPackageOk`"
|
|
|
required
|
|
|
>
|
|
|
- <el-select v-model="row.ifPackageOk" placeholder="请选择" clearable style="width: 100%">
|
|
|
+ <el-select
|
|
|
+ v-model="row.ifPackageOk"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<el-option label="是" :value="1" />
|
|
|
<el-option label="否" :value="0" />
|
|
|
</el-select>
|
|
|
@@ -260,8 +265,11 @@
|
|
|
:prop="`productList.${$index}.unpackUserName`"
|
|
|
required
|
|
|
>
|
|
|
- <el-input @click.native="handHead(row, $index)" v-model="row.unpackUserName"
|
|
|
- placeholder="请选择"></el-input>
|
|
|
+ <el-input
|
|
|
+ @click.native="handHead(row, $index)"
|
|
|
+ v-model="row.unpackUserName"
|
|
|
+ placeholder="请选择"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -405,7 +413,8 @@
|
|
|
:precision="2"
|
|
|
:min="0"
|
|
|
controls-position="right"
|
|
|
- @input="inputsingleWeight(row, $index)"
|
|
|
+ @change="inputsingleWeight(row, $index)"
|
|
|
+ :disabled="row.weightUnit == row.packingUnit"
|
|
|
:controls="false"
|
|
|
style="width: 100%"
|
|
|
></el-input-number>
|
|
|
@@ -444,6 +453,7 @@
|
|
|
placeholder="请输入"
|
|
|
type="number"
|
|
|
@input="inputWeight(row, $index)"
|
|
|
+ :disabled="row.weightUnit == row.packingUnit"
|
|
|
></el-input>
|
|
|
<template slot="append">
|
|
|
{{ row.measureUnit }}
|
|
|
@@ -461,7 +471,7 @@
|
|
|
<template slot="append"> </template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <el-table-column
|
|
|
label="生产要求"
|
|
|
align="center"
|
|
|
width="200"
|
|
|
@@ -1274,7 +1284,7 @@
|
|
|
detailProductList: { type: Array, default: () => [] },
|
|
|
isMoreProduct: { type: Boolean, default: false }, //多产品包装明细
|
|
|
processInstance: { type: Object, default: () => {} },
|
|
|
- isShowPackage: { type: Boolean, default: false } //售后退货单仓管审批显示
|
|
|
+ isShowPackage: { type: Boolean, default: false } //售后退货单仓管审批显示
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -1403,15 +1413,22 @@
|
|
|
},
|
|
|
inputsingleWeight(row, index) {
|
|
|
if (row.measureUnit == row.weightUnit) {
|
|
|
- row.weight = row.measureQuantity;
|
|
|
+ row.weight = row.singleWeight * row.packingQuantity;
|
|
|
+ row.measureQuantity = row.weight;
|
|
|
} else {
|
|
|
row.weight = row.singleWeight * row.measureQuantity;
|
|
|
}
|
|
|
},
|
|
|
inputWeight(row, index) {
|
|
|
- row.singleWeight = row.measureQuantity
|
|
|
- ? row.weight / row.measureQuantity
|
|
|
- : 0;
|
|
|
+ if (row.measureUnit == row.weightUnit) {
|
|
|
+ row.measureQuantity = row.weight;
|
|
|
+ row.singleWeight =
|
|
|
+ Math.trunc((row.measureQuantity / row.packingQuantity) * 100) / 100;
|
|
|
+ } else {
|
|
|
+ row.singleWeight = row.measureQuantity
|
|
|
+ ? row.weight / row.measureQuantity
|
|
|
+ : 0;
|
|
|
+ }
|
|
|
},
|
|
|
// 计算最小单元数量
|
|
|
async computeNum(row, index, isClear) {
|
|
|
@@ -1508,6 +1525,9 @@
|
|
|
let weight = 0;
|
|
|
if (row.measureUnit == row.weightUnit) {
|
|
|
weight = row.measureQuantity;
|
|
|
+ row.singleWeight =
|
|
|
+ Math.trunc((row.measureQuantity / row.packingQuantity) * 100) /
|
|
|
+ 100;
|
|
|
} else if (row.singleWeight) {
|
|
|
weight = row.measureQuantity * Number(row.singleWeight);
|
|
|
}
|
|
|
@@ -1548,20 +1568,27 @@
|
|
|
// this.formData.extInfo.deliveryPhone = this.$store.state.user.info.phone;
|
|
|
// this.formData.createUserId = this.$store.state.user.info.userId;
|
|
|
// this.formData.extInfo.deptName = this.$store.state.user.info.deptName;
|
|
|
-
|
|
|
- // 入库登记人
|
|
|
+
|
|
|
+ // 入库登记人
|
|
|
// const startUser = this.processInstance?.startUser || {};
|
|
|
const userInfo = this.$store.state.user.info || {};
|
|
|
|
|
|
// 确保所有值都是原始类型,防止对象被绑定到DOM属性
|
|
|
- this.formData.extInfo.createUserId = this.form.createUserId || userInfo.userId || '';
|
|
|
- this.formData.extInfo.createUserName = this.form.createUserName || userInfo.name || '';
|
|
|
+ this.formData.extInfo.createUserId =
|
|
|
+ this.form.createUserId || userInfo.userId || '';
|
|
|
+ this.formData.extInfo.createUserName =
|
|
|
+ this.form.createUserName || userInfo.name || '';
|
|
|
this.formData.extInfo.deliveryPhone = userInfo.phone || '';
|
|
|
- this.formData.createUserId = this.form.createUserId || userInfo.userId || '';
|
|
|
- this.formData.createUserName = this.form.createUserName || userInfo.name || '';
|
|
|
- this.formData.extInfo.deptName = this.form.deptName || userInfo.deptName || '';
|
|
|
- this.formData.approvalUserName = this.form.approvalUserName ||userInfo.name;
|
|
|
- this.formData.approvalUserId = this.form.approvalUserId || userInfo.userId;
|
|
|
+ this.formData.createUserId =
|
|
|
+ this.form.createUserId || userInfo.userId || '';
|
|
|
+ this.formData.createUserName =
|
|
|
+ this.form.createUserName || userInfo.name || '';
|
|
|
+ this.formData.extInfo.deptName =
|
|
|
+ this.form.deptName || userInfo.deptName || '';
|
|
|
+ this.formData.approvalUserName =
|
|
|
+ this.form.approvalUserName || userInfo.name;
|
|
|
+ this.formData.approvalUserId =
|
|
|
+ this.form.approvalUserId || userInfo.userId;
|
|
|
// this.formData.extInfo.supplierName = this.form.supplierName;
|
|
|
// this.formData.extInfo.supplierId = this.form.supplierId;
|
|
|
console.log('saleProductList-------------------', this.saleProductList);
|
|
|
@@ -1642,21 +1669,34 @@
|
|
|
let warehouseId = filtersItem.warehouseId;
|
|
|
let warehouseName = filtersItem.warehouseName;
|
|
|
let measureQuantity = filtersItem.totalCount || 0;
|
|
|
- let packingQuantity = filtersItem.totalCount || 0;
|
|
|
- let packingUnit = filtersItem.measuringUnit || '';
|
|
|
+ // let measureQuantityOld = filtersItem.totalCount || 0;
|
|
|
+ if (
|
|
|
+ (filtersItem.sendTotalWeight ||
|
|
|
+ filtersItem.receiveTotalWeight) &&
|
|
|
+ item.weightUnit == item.measuringUnit
|
|
|
+ ) {
|
|
|
+ measureQuantity =
|
|
|
+ filtersItem.sendTotalWeight || filtersItem.receiveTotalWeight;
|
|
|
+ }
|
|
|
+ let packingQuantity =
|
|
|
+ filtersItem.purchaseCount || filtersItem.totalCount || 0;
|
|
|
+ let packingUnit =
|
|
|
+ filtersItem.purchaseUnit || filtersItem.measuringUnit || '';
|
|
|
|
|
|
let unitPrice = filtersItem.singlePrice || 0;
|
|
|
let pricingWay = filtersItem.pricingWay || '';
|
|
|
- // 计价方式是重量
|
|
|
let singleWeight =
|
|
|
- this.detailProductList[0]?.pricingWay == 2
|
|
|
- ? this.detailProductList[0]?.singleWeight
|
|
|
- : filtersItem.singleWeight || 0;
|
|
|
+ filtersItem.singleWeight ||
|
|
|
+ this.detailProductList[0]?.singleWeight ||
|
|
|
+ 0;
|
|
|
let weight =
|
|
|
- this.detailProductList[0]?.pricingWay == 2
|
|
|
- ? this.detailProductList[0]?.singleWeight *
|
|
|
- filtersItem.measureQuantity
|
|
|
- : filtersItem.sendTotalWeight || 0;
|
|
|
+ filtersItem.sendTotalWeight ||
|
|
|
+ filtersItem.receiveTotalWeight ||
|
|
|
+ singleWeight * filtersItem.measureQuantity;
|
|
|
+ console.log(weight, 'weight');
|
|
|
+ // if(weight){
|
|
|
+
|
|
|
+ // }
|
|
|
// 获取相同仓库
|
|
|
let warehouseIds = [];
|
|
|
let warehouseNames = [];
|
|
|
@@ -1688,7 +1728,7 @@
|
|
|
batchNo: batchNo, // 批次号
|
|
|
supplierListOptions: supplierList[item.id], // 供应商列表
|
|
|
supplierId: this.form.supplierId, // 供应商id
|
|
|
- productionRequirements:filtersItem.productionRequirements,//生产要求
|
|
|
+ productionRequirements: filtersItem.productionRequirements, //生产要求
|
|
|
supplierCode:
|
|
|
this.bizType == 2 || this.bizType == 7
|
|
|
? filtersItem.supplierMark
|
|
|
@@ -1717,12 +1757,15 @@
|
|
|
this.saleProductList[index].isAllPackageData == 1
|
|
|
? this.saleProductList[index].quantity
|
|
|
: measureQuantity, // 计量数量
|
|
|
+ // measureQuantityOld,
|
|
|
measureUnit:
|
|
|
this.saleProductList[index] &&
|
|
|
this.saleProductList[index].isAllPackageData &&
|
|
|
this.saleProductList[index].isAllPackageData == 1
|
|
|
? this.saleProductList[index].measuringUnit
|
|
|
: item.measuringUnit, // 计量单位
|
|
|
+ packingUnitId:
|
|
|
+ filtersItem.purchaseUnitId || filtersItem.saleUnitId,
|
|
|
modelKey: filtersItem.modelKey
|
|
|
? filtersItem.modelKey.split(',')
|
|
|
: '', // 机型
|
|
|
@@ -1926,9 +1969,9 @@
|
|
|
categoryModel: item.modelType, // 物品型号
|
|
|
specification: item.specification, // 规格
|
|
|
brandNum: item.brandNum, // 牌号
|
|
|
- batchNo:[1,3,6].includes(this.bizType)
|
|
|
- ? this.detailList[0]?.batchNo || batchNo
|
|
|
- : batchNo, // 批次号
|
|
|
+ batchNo: [1, 3, 6].includes(this.bizType)
|
|
|
+ ? this.detailList[0]?.batchNo || batchNo
|
|
|
+ : batchNo, // 批次号
|
|
|
supplierListOptions: supplierList[item.id], // 供应商列表
|
|
|
supplierId:
|
|
|
this.detailList.find((val) => val.categoryCode == item.code)
|
|
|
@@ -1940,7 +1983,7 @@
|
|
|
this.detailList.find((val) => val.categoryCode == item.code)
|
|
|
?.supplierName || item.supplierName, // 供应商名称
|
|
|
approvalNumber: item.approvalNumber, // 批准文号
|
|
|
- productionRequirements:this.form.productionRequirements,
|
|
|
+ productionRequirements: this.form.productionRequirements,
|
|
|
packingSpecification: item.packingSpecification, // 包装规格
|
|
|
packingSpecificationOption: newSpecificationOption[index], // 包装规格选项
|
|
|
packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
|
|
|
@@ -2209,7 +2252,7 @@
|
|
|
});
|
|
|
return obj;
|
|
|
},
|
|
|
- //选择负责人
|
|
|
+ //选择负责人
|
|
|
handHead(row, index) {
|
|
|
let item = {
|
|
|
id: row.unpackUserId
|
|
|
@@ -2436,10 +2479,14 @@
|
|
|
this.$message.error('请先保存所有产品信息');
|
|
|
return;
|
|
|
}
|
|
|
- if(this.isShowPackage) {
|
|
|
- const userNameLength = this.productList.filter(item => !item.unpackUserName).length
|
|
|
- const packgeLength = this.productList.filter(item => !item.ifPackageOk).length
|
|
|
- if(userNameLength || packgeLength) {
|
|
|
+ if (this.isShowPackage) {
|
|
|
+ const userNameLength = this.productList.filter(
|
|
|
+ (item) => !item.unpackUserName
|
|
|
+ ).length;
|
|
|
+ const packgeLength = this.productList.filter(
|
|
|
+ (item) => !item.ifPackageOk
|
|
|
+ ).length;
|
|
|
+ if (userNameLength || packgeLength) {
|
|
|
this.$message.error('请先填写拆包装责任人和包装完好与否');
|
|
|
return;
|
|
|
}
|
|
|
@@ -2939,8 +2986,7 @@
|
|
|
`productList.${index}.batchNo`,
|
|
|
`productList.${index}.packingQuantity`,
|
|
|
`productList.${index}.packingUnit`,
|
|
|
- `productList.${index}.warehouseId`,
|
|
|
-
|
|
|
+ `productList.${index}.warehouseId`
|
|
|
];
|
|
|
if (row.isSave) {
|
|
|
return Promise.resolve(true);
|
|
|
@@ -3087,7 +3133,6 @@
|
|
|
`productList.${index}.warehouseId`
|
|
|
];
|
|
|
|
|
|
-
|
|
|
Promise.all(
|
|
|
fileds.map(
|
|
|
(item) =>
|
|
|
@@ -3267,11 +3312,34 @@
|
|
|
}
|
|
|
} else {
|
|
|
if (!packingNum) {
|
|
|
- packingNum = Math.ceil(
|
|
|
- row.measureQuantity /
|
|
|
- row.packingSpecificationOption[1]?.packageCell
|
|
|
- );
|
|
|
+ if (row.packingUnitId) {
|
|
|
+ let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
+ (item) => item.id == row.packingUnitId
|
|
|
+ );
|
|
|
+ if (splitIndex == 0) {
|
|
|
+ packingNum = Math.ceil(
|
|
|
+ row.measureQuantity /
|
|
|
+ row.packingSpecificationOption[1]?.packageCell
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (splitIndex == 1) {
|
|
|
+ packingNum = row.packingQuantity;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (; splitIndex > 1; splitIndex--) {
|
|
|
+ packingNum = Math.ceil(
|
|
|
+ row.packingQuantity *
|
|
|
+ row.packingSpecificationOption[splitIndex].packageCell
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ packingNum = Math.ceil(
|
|
|
+ row.measureQuantity /
|
|
|
+ row.packingSpecificationOption[1]?.packageCell
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log(packingNum, 'packingNum');
|
|
|
|
|
|
//拆包
|
|
|
const { data } = await storageApi.getAssetNum([
|
|
|
@@ -3661,24 +3729,31 @@
|
|
|
? filterArr[0].packageCell
|
|
|
: Number(row.packingQuantity) -
|
|
|
this.$math.format(filterArr[0].packageCell * index, 14);
|
|
|
- console.log(measureQuantity, 'measureQuantity');
|
|
|
+ console.log(measureQuantity, 'measureQuantit1111y');
|
|
|
}
|
|
|
} else {
|
|
|
if (row.isUnpack == 1) {
|
|
|
console.log('1 拆--------', measureBoolen);
|
|
|
if (measureBoolen) {
|
|
|
- // 处理单位不为KG类,计量单位为KG类的情况
|
|
|
- let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
- (item) =>
|
|
|
- item.conversionUnit == row.packingUnit &&
|
|
|
- item.packageUnit != item.conversionUnit
|
|
|
- );
|
|
|
- for (; splitIndex > 0; splitIndex--) {
|
|
|
- measureQuantity = this.$math.format(
|
|
|
- measureQuantity *
|
|
|
- row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
- 14
|
|
|
+ //计量单位等于重量单位并且有总重 计量数量=总重/包装数
|
|
|
+ if (row.weightUnit == row.measureUnit && row.weight) {
|
|
|
+ measureQuantity =
|
|
|
+ Math.trunc((row.weight / packingCodeList.length) * 100) /
|
|
|
+ 100;
|
|
|
+ } else {
|
|
|
+ // 处理单位不为KG类,计量单位为KG类的情况
|
|
|
+ let splitIndex = row.packingSpecificationOption.findIndex(
|
|
|
+ (item) =>
|
|
|
+ item.conversionUnit == row.packingUnit &&
|
|
|
+ item.packageUnit != item.conversionUnit
|
|
|
);
|
|
|
+ for (; splitIndex > 0; splitIndex--) {
|
|
|
+ measureQuantity = this.$math.format(
|
|
|
+ measureQuantity *
|
|
|
+ row.packingSpecificationOption[splitIndex].packageCell,
|
|
|
+ 14
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
measureQuantity = row.packingSpecificationOption[1].packageCell;
|
|
|
@@ -3799,9 +3874,11 @@
|
|
|
.dictValue;
|
|
|
if (outBoolen) {
|
|
|
// 计量单位为KG类,直接替换
|
|
|
- item.weight = item.measureQuantity
|
|
|
- ? Number(item.measureQuantity)
|
|
|
- : 0;
|
|
|
+
|
|
|
+ item.weight = item.measureQuantity
|
|
|
+ ? Number(item.measureQuantity)
|
|
|
+ : 0;
|
|
|
+
|
|
|
} else {
|
|
|
console.log('计量单位为不为KG类======================');
|
|
|
// 计量单位为不为KG类,重新统计计算
|
|
|
@@ -3872,8 +3949,13 @@
|
|
|
);
|
|
|
this.packingList.splice(packingIndex + 1, 0, ...packingList);
|
|
|
}
|
|
|
- let remainder =
|
|
|
- row.measureQuantity % row.packingSpecificationOption[1]?.packageCell;
|
|
|
+ let remainder = 0;
|
|
|
+ if (row.weightUnit != row.measureUnit) {
|
|
|
+ remainder =
|
|
|
+ row.measureQuantity %
|
|
|
+ row.packingSpecificationOption[1]?.packageCell;
|
|
|
+ }
|
|
|
+
|
|
|
if (remainder > 0) {
|
|
|
let onlyCode = packingCodeList[packingCodeList.length - 1]?.onlyCode;
|
|
|
let index = this.packingList.findIndex(
|