|
@@ -405,29 +405,31 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
label="单价"
|
|
label="单价"
|
|
|
- prop="price"
|
|
|
|
|
|
|
+ prop="unitPrice"
|
|
|
width="200"
|
|
width="200"
|
|
|
align="center"
|
|
align="center"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
<template v-if="row.isSave">
|
|
<template v-if="row.isSave">
|
|
|
- {{ row.price }}元/{{ row.measureUnit }}
|
|
|
|
|
|
|
+ <span>{{ row.unitPrice }}</span>
|
|
|
|
|
+ <span v-if="row.unitPrice">/元</span>
|
|
|
</template>
|
|
</template>
|
|
|
<el-form-item v-else>
|
|
<el-form-item v-else>
|
|
|
<el-input
|
|
<el-input
|
|
|
type="number"
|
|
type="number"
|
|
|
- :ref="'price' + $index"
|
|
|
|
|
|
|
+ :ref="'unitPrice' + $index"
|
|
|
@keyup.native="
|
|
@keyup.native="
|
|
|
- moveFocus($event, $index, 'price', '产品', row)
|
|
|
|
|
|
|
+ moveFocus($event, $index, 'unitPrice', '产品', row)
|
|
|
"
|
|
"
|
|
|
- v-model.number="row.price"
|
|
|
|
|
|
|
+ v-model.number="row.unitPrice"
|
|
|
placeholder="非必填"
|
|
placeholder="非必填"
|
|
|
@input="
|
|
@input="
|
|
|
- (value) => (row.price = value.replace(/[^0-9.]+/g, ''))
|
|
|
|
|
|
|
+ (value) =>
|
|
|
|
|
+ (row.unitPrice = value.replace(/[^0-9.]+/g, ''))
|
|
|
"
|
|
"
|
|
|
>
|
|
>
|
|
|
<template slot="append">
|
|
<template slot="append">
|
|
|
- 元/{{ row.measureUnit }}
|
|
|
|
|
|
|
+ <span v-if="row.unitPrice">/元</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -442,7 +444,7 @@
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
{{
|
|
{{
|
|
|
changeCount(
|
|
changeCount(
|
|
|
- calcSumTotal(row.measureQuantity, row.price, row)
|
|
|
|
|
|
|
+ calcSumTotal(row.measureQuantity, row.unitPrice, row)
|
|
|
)
|
|
)
|
|
|
}}
|
|
}}
|
|
|
</template>
|
|
</template>
|
|
@@ -1236,8 +1238,6 @@
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.warning('未获取到物品类型!');
|
|
this.$message.warning('未获取到物品类型!');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- console.log('this.detailList---------', this.detailList);
|
|
|
|
|
if (this.sourceBizNo != null && this.sourceBizNo != '') {
|
|
if (this.sourceBizNo != null && this.sourceBizNo != '') {
|
|
|
this.formData.sourceBizNo = this.sourceBizNo;
|
|
this.formData.sourceBizNo = this.sourceBizNo;
|
|
|
} else {
|
|
} else {
|
|
@@ -1252,14 +1252,13 @@
|
|
|
|
|
|
|
|
// this.formData.extInfo.supplierName = this.form.supplierName;
|
|
// this.formData.extInfo.supplierName = this.form.supplierName;
|
|
|
// this.formData.extInfo.supplierId = this.form.supplierId;
|
|
// this.formData.extInfo.supplierId = this.form.supplierId;
|
|
|
- console.log('this.saleProductList---------', this.saleProductList);
|
|
|
|
|
|
|
+
|
|
|
if (this.saleProductList?.length > 0) {
|
|
if (this.saleProductList?.length > 0) {
|
|
|
// 物品列表
|
|
// 物品列表
|
|
|
let codeList = this.saleProductList.map((item) => {
|
|
let codeList = this.saleProductList.map((item) => {
|
|
|
return item.productCode;
|
|
return item.productCode;
|
|
|
});
|
|
});
|
|
|
storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
|
|
storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
|
|
|
- console.log('res---------', res);
|
|
|
|
|
if (res.length <= 0) {
|
|
if (res.length <= 0) {
|
|
|
this.$message.warning('未获取到物品信息!');
|
|
this.$message.warning('未获取到物品信息!');
|
|
|
return;
|
|
return;
|
|
@@ -1301,7 +1300,7 @@
|
|
|
let packingQuantity = filtersItem.totalCount || 0;
|
|
let packingQuantity = filtersItem.totalCount || 0;
|
|
|
let packingUnit = filtersItem.measuringUnit || '';
|
|
let packingUnit = filtersItem.measuringUnit || '';
|
|
|
|
|
|
|
|
- let price = filtersItem.singlePrice || 0;
|
|
|
|
|
|
|
+ let unitPrice = filtersItem.singlePrice || 0;
|
|
|
let pricingWay = filtersItem.pricingWay || '';
|
|
let pricingWay = filtersItem.pricingWay || '';
|
|
|
// 计价方式是重量
|
|
// 计价方式是重量
|
|
|
let singleWeight =
|
|
let singleWeight =
|
|
@@ -1349,7 +1348,7 @@
|
|
|
weight: weight, // 总重量
|
|
weight: weight, // 总重量
|
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
|
totalMoney: totalMoney, // 总价
|
|
totalMoney: totalMoney, // 总价
|
|
|
- price: item.price || price, // 单价
|
|
|
|
|
|
|
+ unitPrice: item.unitPrice || unitPrice, // 单价
|
|
|
pricingWay: pricingWay, //计价方式
|
|
pricingWay: pricingWay, //计价方式
|
|
|
purpose: '', // 用途
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
@@ -1525,7 +1524,7 @@
|
|
|
singleWeight: singleWeight,
|
|
singleWeight: singleWeight,
|
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
|
totalMoney: item.totalPrice, // 总价
|
|
totalMoney: item.totalPrice, // 总价
|
|
|
- price: item.price, // 单价
|
|
|
|
|
|
|
+ unitPrice: item.unitPrice, // 单价
|
|
|
purpose: '', // 用途
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
|
warehouseId: this.isMoreProduct
|
|
warehouseId: this.isMoreProduct
|
|
@@ -1664,7 +1663,7 @@
|
|
|
).index
|
|
).index
|
|
|
: this.productList[0].index, // 产品索引
|
|
: this.productList[0].index, // 产品索引
|
|
|
batchNo: item.batchNo || this.productList[0].batchNo, // 批次号
|
|
batchNo: item.batchNo || this.productList[0].batchNo, // 批次号
|
|
|
- packageNo: packingCodeList[index]?.onlyCode, // 包装编码
|
|
|
|
|
|
|
+ packageNo: item.packageNo||packingCodeList[index]?.onlyCode, // 包装编码
|
|
|
packingQuantity: 1, // 包装数量
|
|
packingQuantity: 1, // 包装数量
|
|
|
packingUnit: item.packingUnit, // 单位
|
|
packingUnit: item.packingUnit, // 单位
|
|
|
measureQuantity: item.quantity, // 计量数量
|
|
measureQuantity: item.quantity, // 计量数量
|
|
@@ -1733,7 +1732,7 @@
|
|
|
},
|
|
},
|
|
|
// 赋值入库时间
|
|
// 赋值入库时间
|
|
|
getNowFormatDate() {
|
|
getNowFormatDate() {
|
|
|
- if (this.bizType == '2') {
|
|
|
|
|
|
|
+ if (this.bizType == '2' || this.bizType == '6') {
|
|
|
let time = '00:00:00';
|
|
let time = '00:00:00';
|
|
|
this.formData.storageTime = this.form.receiveDate + ' ' + time;
|
|
this.formData.storageTime = this.form.receiveDate + ' ' + time;
|
|
|
} else {
|
|
} else {
|
|
@@ -1771,7 +1770,7 @@
|
|
|
switch (type) {
|
|
switch (type) {
|
|
|
case '产品':
|
|
case '产品':
|
|
|
listLength = this.productList.length;
|
|
listLength = this.productList.length;
|
|
|
- keyfield = ['batchNo', 'packingQuantity', 'price', 'purpose'];
|
|
|
|
|
|
|
+ keyfield = ['batchNo', 'packingQuantity', 'unitPrice', 'purpose'];
|
|
|
break;
|
|
break;
|
|
|
case '包装':
|
|
case '包装':
|
|
|
listLength = this.showPackingList.length;
|
|
listLength = this.showPackingList.length;
|
|
@@ -1951,10 +1950,6 @@
|
|
|
_workOrderId = this.detailProductList[0]?.workOrderId;
|
|
_workOrderId = this.detailProductList[0]?.workOrderId;
|
|
|
_taskId = this.detailProductList[0]?.taskId;
|
|
_taskId = this.detailProductList[0]?.taskId;
|
|
|
}
|
|
}
|
|
|
- // workOrderId: this.detailProductList[0]?.workOrderId,
|
|
|
|
|
- // taskId: this.detailProductList[0]?.taskId,
|
|
|
|
|
- // taskId: this.detailList[0]?.taskId,
|
|
|
|
|
- // workOrderId: this.detailList[0]?.workOrderId,
|
|
|
|
|
return {
|
|
return {
|
|
|
...packingItem,
|
|
...packingItem,
|
|
|
workOrderId: _workOrderId,
|
|
workOrderId: _workOrderId,
|
|
@@ -2171,15 +2166,15 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
//计算金额
|
|
//计算金额
|
|
|
- calcSumTotal(measureQuantity, price, row) {
|
|
|
|
|
|
|
+ calcSumTotal(measureQuantity, unitPrice, row) {
|
|
|
//最小包装单元,包装数量,单价
|
|
//最小包装单元,包装数量,单价
|
|
|
if (this.bizType != 2) {
|
|
if (this.bizType != 2) {
|
|
|
const total = {
|
|
const total = {
|
|
|
measureQuantity: Number(measureQuantity > 0 ? measureQuantity : 0),
|
|
measureQuantity: Number(measureQuantity > 0 ? measureQuantity : 0),
|
|
|
- price: Number(price > 0 ? price : 0)
|
|
|
|
|
|
|
+ unitPrice: Number(unitPrice > 0 ? unitPrice : 0)
|
|
|
};
|
|
};
|
|
|
let number = Number(
|
|
let number = Number(
|
|
|
- this.$math.format(total.measureQuantity * total.price, 14)
|
|
|
|
|
|
|
+ this.$math.format(total.measureQuantity * total.unitPrice, 14)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
row.totalMoney = number;
|
|
row.totalMoney = number;
|
|
@@ -2339,13 +2334,12 @@
|
|
|
pricingWay: item.pricingWay,
|
|
pricingWay: item.pricingWay,
|
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
|
totalMoney: item.totalPrice, // 总价
|
|
totalMoney: item.totalPrice, // 总价
|
|
|
- price: item.price, // 单价
|
|
|
|
|
|
|
+ unitPrice: item.unitPrice, // 单价
|
|
|
purpose: '', // 用途
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack // 是否允许拆包
|
|
isUnpack: item.isUnpack // 是否允许拆包
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
this.productList = this.productList.concat(productList);
|
|
this.productList = this.productList.concat(productList);
|
|
|
- console.log('this.productList--------', this.productList);
|
|
|
|
|
},
|
|
},
|
|
|
// 物品保存验证表单(批量)
|
|
// 物品保存验证表单(批量)
|
|
|
validateForm() {
|
|
validateForm() {
|
|
@@ -2796,7 +2790,7 @@
|
|
|
let num = row.packingQuantity;
|
|
let num = row.packingQuantity;
|
|
|
let filterArr = [];
|
|
let filterArr = [];
|
|
|
// 处理单位为KG类的情况
|
|
// 处理单位为KG类的情况
|
|
|
-
|
|
|
|
|
|
|
+ console.log(packingBoolen, 'packingBoolenpackingBoolen');
|
|
|
if (packingBoolen) {
|
|
if (packingBoolen) {
|
|
|
filterArr = row.packingSpecificationOption.filter((item) => {
|
|
filterArr = row.packingSpecificationOption.filter((item) => {
|
|
|
return (
|
|
return (
|
|
@@ -2834,8 +2828,9 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ console.log(row, 'row123');
|
|
|
// num = row.packingQuantity;
|
|
// num = row.packingQuantity;
|
|
|
- num = this.productList.length;
|
|
|
|
|
|
|
+ num = 1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for (let index = 0; index < num; index++) {
|
|
for (let index = 0; index < num; index++) {
|