|
@@ -173,14 +173,15 @@
|
|
|
<el-table-column label="单重" align="center" prop="singleWeight" :show-overflow-tooltip="true" width="180">
|
|
<el-table-column label="单重" align="center" prop="singleWeight" :show-overflow-tooltip="true" width="180">
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
<el-input :disabled="row.isSave" v-model="row.singleWeight" placeholder="请输入" :min="0"
|
|
<el-input :disabled="row.isSave" v-model="row.singleWeight" placeholder="请输入" :min="0"
|
|
|
- style="width: 100%">
|
|
|
|
|
|
|
+ style="width: 100%" @input="inputSingleWeight(row, $index)">
|
|
|
<template slot="append"> {{ row.weightUnit + '/' + row.measureUnit }} </template>
|
|
<template slot="append"> {{ row.weightUnit + '/' + row.measureUnit }} </template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column label="总重" align="center" prop="weight" width="150" :show-overflow-tooltip="true">
|
|
<el-table-column label="总重" align="center" prop="weight" width="150" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="{ row, $index }">
|
|
<template slot-scope="{ row, $index }">
|
|
|
- <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入">
|
|
|
|
|
|
|
+ <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入"
|
|
|
|
|
+ @input="inputAllweight(row, $index)">
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -753,20 +754,31 @@ export default {
|
|
|
(item) => item.id == val
|
|
(item) => item.id == val
|
|
|
)[0].serialNo;
|
|
)[0].serialNo;
|
|
|
},
|
|
},
|
|
|
|
|
+ inputSingleWeight(row, index) {
|
|
|
|
|
+ if (row.singleWeight < 0) {
|
|
|
|
|
+ this.$set(this.productList[index], 'singleWeight', 1);
|
|
|
|
|
+ } else if (row.packingQuantity > 9999) {
|
|
|
|
|
+ this.$set(this.productList[index], 'singleWeight', 9999);
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(row.singleWeight)
|
|
|
|
|
+ console.log(row.measureQuantity)
|
|
|
|
|
+
|
|
|
|
|
+ const weight = Number(row.measureQuantity) * Number(row.singleWeight);
|
|
|
|
|
+ this.$set(this.productList[index], 'weight', weight)
|
|
|
|
|
|
|
|
- // inputWeight(row, index) {
|
|
|
|
|
- // if (
|
|
|
|
|
- // row.weight === null ||
|
|
|
|
|
- // row.weight === undefined ||
|
|
|
|
|
- // isNaN(row.weight) ||
|
|
|
|
|
- // row.weight < 0
|
|
|
|
|
- // ) {
|
|
|
|
|
- // row.weight = 0;
|
|
|
|
|
- // }
|
|
|
|
|
- // row.singleWeight = row.measureQuantity
|
|
|
|
|
- // ? Number(row.weight) / row.measureQuantity
|
|
|
|
|
- // : 0;
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ inputAllweight(row, index) {
|
|
|
|
|
+ if (row.weight < 0) {
|
|
|
|
|
+ this.$set(this.productList[index], 'weight', 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ const singleWeight = Number(row.weight) / Number(row.measureQuantity);
|
|
|
|
|
+ this.$set(this.productList[index], 'singleWeight', singleWeight)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 仓库选择
|
|
|
|
|
+ wareHouseSelection(val, index) {
|
|
|
|
|
+ console.log('仓库选择', val);
|
|
|
|
|
+ let arr = this.productList[index].outInDetail
|
|
|
|
|
+ },
|
|
|
// 计算最小单元数量
|
|
// 计算最小单元数量
|
|
|
async computeNum(row, index, isClear) {
|
|
async computeNum(row, index, isClear) {
|
|
|
console.log('row, index', row, index);
|
|
console.log('row, index', row, index);
|
|
@@ -840,6 +852,7 @@ export default {
|
|
|
|
|
|
|
|
//计量数量
|
|
//计量数量
|
|
|
row.measureQuantity = this.changeCount(total);
|
|
row.measureQuantity = this.changeCount(total);
|
|
|
|
|
+
|
|
|
// 判断单位和计量单位是否为不拆物料层规格
|
|
// 判断单位和计量单位是否为不拆物料层规格
|
|
|
let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
|
|
|
.dictValue;
|
|
.dictValue;
|
|
@@ -849,10 +862,12 @@ export default {
|
|
|
console.log(measureBoolen, 'measureBoolen')
|
|
console.log(measureBoolen, 'measureBoolen')
|
|
|
|
|
|
|
|
if (packingBoolen && measureBoolen && row.packingUnit != 'L') {
|
|
if (packingBoolen && measureBoolen && row.packingUnit != 'L') {
|
|
|
- row.weight = total;
|
|
|
|
|
|
|
+ // row.weight = total;
|
|
|
console.log(total, '6')
|
|
console.log(total, '6')
|
|
|
|
|
+ this.$set(this.productList[index], 'weight', total);
|
|
|
} else {
|
|
} else {
|
|
|
- row.weight = this.$math.format(total * row.netWeight, 14);
|
|
|
|
|
|
|
+ this.$set(this.productList[index], 'weight', total * Number(row.singleWeight));
|
|
|
|
|
+ // row.weight = this.$math.format(total * row.netWeight, 14);
|
|
|
console.log(total, '7')
|
|
console.log(total, '7')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|