|
|
@@ -356,6 +356,19 @@
|
|
|
</template>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="计价方式"
|
|
|
+ align="center"
|
|
|
+ prop="pricingWay"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <span v-if="row.pricingWay == 1">数量</span>
|
|
|
+ <span v-if="row.pricingWay == 2">重量</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
label="总重"
|
|
|
align="center"
|
|
|
@@ -468,6 +481,23 @@
|
|
|
prop="supplierCode"
|
|
|
width="120"
|
|
|
:show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <template v-if="bizType == 2">{{
|
|
|
+ row.supplierMark
|
|
|
+ }}</template>
|
|
|
+ <template v-if="bizType != 2">{{
|
|
|
+ row.supplierCode
|
|
|
+ }}</template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-if="bizType == 2"
|
|
|
+ label="产地"
|
|
|
+ align="center"
|
|
|
+ prop="provenance "
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ width="120"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -654,7 +684,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="客户代号" prop="clientCode">
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
+ <template slot-scope="{ row, $index }" v-if="bizType != 2">
|
|
|
<el-input
|
|
|
v-if="!row.isPack"
|
|
|
:ref="'packing_clientCode' + $index"
|
|
|
@@ -665,6 +695,17 @@
|
|
|
></el-input>
|
|
|
<span v-else> {{ row.clientCode }}</span>
|
|
|
</template>
|
|
|
+ <template slot-scope="{ row, $index }" v-if="bizType == 2">
|
|
|
+ <el-input
|
|
|
+ v-if="!row.isPack"
|
|
|
+ :ref="'packing_clientCode' + $index"
|
|
|
+ @keyup.native="
|
|
|
+ moveFocus($event, $index, 'packing_clientCode', '包装', row)
|
|
|
+ "
|
|
|
+ v-model="row.customerMark"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else> {{ row.customerMark }}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="刻码" prop="engrave" width="140">
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
@@ -834,7 +875,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="客户代号" prop="clientCode">
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
+ <template slot-scope="{ row, $index }" v-if="bizType != 2">
|
|
|
<el-input
|
|
|
v-if="!row.isPack"
|
|
|
:ref="'material_clientCode' + $index"
|
|
|
@@ -845,6 +886,17 @@
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.clientCode }}</span>
|
|
|
</template>
|
|
|
+ <template slot-scope="{ row, $index }" v-if="bizType == 2">
|
|
|
+ <el-input
|
|
|
+ v-if="!row.isPack"
|
|
|
+ :ref="'packing_clientCode' + $index"
|
|
|
+ @keyup.native="
|
|
|
+ moveFocus($event, $index, 'packing_clientCode', '物料', row)
|
|
|
+ "
|
|
|
+ v-model="row.customerMark"
|
|
|
+ ></el-input>
|
|
|
+ <span v-else> {{ row.customerMark }}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="刻码" prop="engrave" width="140">
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
@@ -1171,7 +1223,6 @@
|
|
|
},
|
|
|
// 初始化信息
|
|
|
async initFormData() {
|
|
|
- console.log('this.form---------------', this.form);
|
|
|
this.formData.type = 1;
|
|
|
this.formData.bizType = this.bizType;
|
|
|
if (
|
|
|
@@ -1201,12 +1252,14 @@
|
|
|
|
|
|
// this.formData.extInfo.supplierName = this.form.supplierName;
|
|
|
// this.formData.extInfo.supplierId = this.form.supplierId;
|
|
|
+ console.log('this.saleProductList---------', this.saleProductList);
|
|
|
if (this.saleProductList?.length > 0) {
|
|
|
- // 物品列表 this.saleProductList
|
|
|
+ // 物品列表
|
|
|
let codeList = this.saleProductList.map((item) => {
|
|
|
return item.productCode;
|
|
|
});
|
|
|
storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
|
|
|
+ console.log('res---------', res);
|
|
|
if (res.length <= 0) {
|
|
|
this.$message.warning('未获取到物品信息!');
|
|
|
return;
|
|
|
@@ -1217,7 +1270,6 @@
|
|
|
const supplierList = await storageApi.contactQueryByCategoryIdsAPI({
|
|
|
categoryIds: res.map((item) => item.id)
|
|
|
});
|
|
|
- // console.log(supplierList[item.id])
|
|
|
// 获取包装规格
|
|
|
let packingSpecification =
|
|
|
await storageApi.getCategoryPackageDisposition({
|
|
|
@@ -1232,6 +1284,7 @@
|
|
|
let filtersItem = this.saleProductList.filter(
|
|
|
(detailItem) => detailItem.productCode == item.code
|
|
|
)[0];
|
|
|
+
|
|
|
// 显示规格
|
|
|
let packingSpecificationLabel = this.packingSpecificationOption[
|
|
|
index
|
|
|
@@ -1249,8 +1302,17 @@
|
|
|
let packingUnit = filtersItem.measuringUnit || '';
|
|
|
|
|
|
let price = filtersItem.singlePrice || 0;
|
|
|
- let singleWeight = filtersItem.singleWeight || 0; // 单重重量
|
|
|
- let weight = filtersItem.sendTotalWeight || 0;
|
|
|
+ let pricingWay = filtersItem.pricingWay || '';
|
|
|
+ // 计价方式是重量
|
|
|
+ let singleWeight =
|
|
|
+ this.detailProductList[0]?.pricingWay == 2
|
|
|
+ ? this.detailProductList[0]?.singleWeight
|
|
|
+ : filtersItem.singleWeight || 0;
|
|
|
+ let weight =
|
|
|
+ this.detailProductList[0]?.pricingWay == 2
|
|
|
+ ? this.detailProductList[0]?.singleWeight *
|
|
|
+ filtersItem.measureQuantity
|
|
|
+ : filtersItem.sendTotalWeight || 0;
|
|
|
// 获取相同仓库
|
|
|
let warehouseIds = [];
|
|
|
let warehouseNames = [];
|
|
|
@@ -1258,6 +1320,7 @@
|
|
|
warehouseIds.push(filtersItem.warehouseId);
|
|
|
warehouseNames.push(filtersItem.warehouseName);
|
|
|
}
|
|
|
+ let totalMoney = filtersItem.totalPrice || 0;
|
|
|
return {
|
|
|
index: this.productList.length + index,
|
|
|
categoryId: item.id, // 物品id
|
|
|
@@ -1266,7 +1329,7 @@
|
|
|
categoryModel: item.modelType, // 物品型号
|
|
|
specification: item.specification, // 规格
|
|
|
brandNum: item.brandNum, // 牌号
|
|
|
- batchNo: this.saleProductList[index]?.batchNo||batchNo, // 批次号
|
|
|
+ batchNo: this.saleProductList[index]?.batchNo || batchNo, // 批次号
|
|
|
supplierListOptions: supplierList[item.id], // 供应商列表
|
|
|
supplierId: this.form.supplierId, // 供应商id
|
|
|
supplierCode: this.form.supplierCode, // 供应商代号
|
|
|
@@ -1285,8 +1348,9 @@
|
|
|
singleWeight: singleWeight, // 单重重量
|
|
|
weight: weight, // 总重量
|
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
|
- totalMoney: '', // 总价
|
|
|
+ totalMoney: totalMoney, // 总价
|
|
|
price: item.price || price, // 单价
|
|
|
+ pricingWay: pricingWay, //计价方式
|
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
|
warehouseId, // 仓库id
|
|
|
@@ -1425,10 +1489,6 @@
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- console.log(
|
|
|
- item,
|
|
|
- 'itemmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm'
|
|
|
- );
|
|
|
let singleWeight = item.singleWeight || 0; // 单重重量
|
|
|
return {
|
|
|
index: this.productList.length + index,
|
|
|
@@ -1464,7 +1524,7 @@
|
|
|
weight: weight, // 重量
|
|
|
singleWeight: singleWeight,
|
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
|
- totalMoney: '', // 总价
|
|
|
+ totalMoney: item.totalPrice, // 总价
|
|
|
price: item.price, // 单价
|
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack, // 是否允许拆包
|
|
|
@@ -1603,7 +1663,7 @@
|
|
|
(val) => val.categoryCode == item.productCode
|
|
|
).index
|
|
|
: this.productList[0].index, // 产品索引
|
|
|
- batchNo: item.batchNo||this.productList[0].batchNo, // 批次号
|
|
|
+ batchNo: item.batchNo || this.productList[0].batchNo, // 批次号
|
|
|
packageNo: packingCodeList[index]?.onlyCode, // 包装编码
|
|
|
packingQuantity: 1, // 包装数量
|
|
|
packingUnit: item.packingUnit, // 单位
|
|
|
@@ -1611,6 +1671,7 @@
|
|
|
measureUnit: item.measuringUnit, // 计量单位
|
|
|
weight: item.packingWeight, // 重量
|
|
|
singleWeight: item.singleWeight,
|
|
|
+ pricingWay: item.pricingWay,
|
|
|
weightUnit: item.weightUnit || this.productList[0].weightUnit, // 重量单位
|
|
|
packingSpecificationOption: this.isMoreProduct
|
|
|
? this.productList.find(
|
|
|
@@ -1779,10 +1840,8 @@
|
|
|
|
|
|
// 向上 =38
|
|
|
if (event.keyCode === 38) {
|
|
|
- console.log('向上');
|
|
|
if (index === 0) {
|
|
|
// 第一行
|
|
|
- console.log('第一行无法向上');
|
|
|
return;
|
|
|
}
|
|
|
this.$refs[key + index].blur();
|
|
|
@@ -1796,10 +1855,8 @@
|
|
|
|
|
|
// 下 = 40
|
|
|
if (event.keyCode === 40) {
|
|
|
- console.log('向下');
|
|
|
if (index === listLength - 1) {
|
|
|
// 最后一行
|
|
|
- console.log('最后一行无法向下');
|
|
|
return;
|
|
|
}
|
|
|
this.$refs[key + index].blur();
|
|
|
@@ -1843,16 +1900,13 @@
|
|
|
|
|
|
// 右 = 39
|
|
|
if (event.keyCode === 39) {
|
|
|
- console.log('向右');
|
|
|
if (
|
|
|
index === listLength - 1 &&
|
|
|
key === keyfield[keyfield.length - 1]
|
|
|
) {
|
|
|
// 最后一行最后一个
|
|
|
- console.log('最后一行最后一个无法向左');
|
|
|
return;
|
|
|
}
|
|
|
- console.log(this.$refs);
|
|
|
this.$refs[key + index].blur();
|
|
|
if (key === keyfield[keyfield.length - 1]) {
|
|
|
// 当前行最后一个,跳转下一行第一个
|
|
|
@@ -1912,7 +1966,6 @@
|
|
|
)
|
|
|
};
|
|
|
});
|
|
|
- console.log('_处理后 _packingList', _packingList);
|
|
|
|
|
|
// 处理产品数据
|
|
|
this.productList = this.productList.map((productItem) => {
|
|
|
@@ -2018,7 +2071,6 @@
|
|
|
// 修改拆分物料
|
|
|
this.materialList.map((item, index) => {
|
|
|
if (item.parentIndex === row.index) {
|
|
|
- console.log(value / row.measureQuantity);
|
|
|
this.$set(
|
|
|
this.materialList[index],
|
|
|
'weight',
|
|
|
@@ -2121,16 +2173,20 @@
|
|
|
//计算金额
|
|
|
calcSumTotal(measureQuantity, price, row) {
|
|
|
//最小包装单元,包装数量,单价
|
|
|
- const total = {
|
|
|
- measureQuantity: Number(measureQuantity > 0 ? measureQuantity : 0),
|
|
|
- price: Number(price > 0 ? price : 0)
|
|
|
- };
|
|
|
- let number = Number(
|
|
|
- this.$math.format(total.measureQuantity * total.price, 14)
|
|
|
- );
|
|
|
+ if (this.bizType != 2) {
|
|
|
+ const total = {
|
|
|
+ measureQuantity: Number(measureQuantity > 0 ? measureQuantity : 0),
|
|
|
+ price: Number(price > 0 ? price : 0)
|
|
|
+ };
|
|
|
+ let number = Number(
|
|
|
+ this.$math.format(total.measureQuantity * total.price, 14)
|
|
|
+ );
|
|
|
|
|
|
- row.totalMoney = number;
|
|
|
- return number;
|
|
|
+ row.totalMoney = number;
|
|
|
+ return number;
|
|
|
+ } else {
|
|
|
+ return row.totalMoney;
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 包装维度最小包装单元改变——>总重量
|
|
|
@@ -2280,8 +2336,9 @@
|
|
|
netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
|
|
|
weight: 0, // 重量
|
|
|
singleWeight: item.measuringUnit != 'KG' ? item.netWeight : 0, // 单重
|
|
|
+ pricingWay: item.pricingWay,
|
|
|
weightUnit: item.weightUnit, // 重量单位
|
|
|
- totalMoney: '', // 总价
|
|
|
+ totalMoney: item.totalPrice, // 总价
|
|
|
price: item.price, // 单价
|
|
|
purpose: '', // 用途
|
|
|
isUnpack: item.isUnpack // 是否允许拆包
|
|
|
@@ -2438,7 +2495,6 @@
|
|
|
// 物品保存验证表单(单独)
|
|
|
validateFormIndividually(index) {
|
|
|
return new Promise(async (resolve) => {
|
|
|
- console.log(index);
|
|
|
let fileds = [
|
|
|
`productList.${index}.batchNo`,
|
|
|
`productList.${index}.packingQuantity`,
|
|
|
@@ -2492,7 +2548,6 @@
|
|
|
// )
|
|
|
// );
|
|
|
// }
|
|
|
- console.log(row);
|
|
|
this.deletePackingAndMaterial(row);
|
|
|
},
|
|
|
// 根据产品信息删除包装和物料
|