| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="数量" prop="quantityStock" width="150"> |
| | | <template #default="scope"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.quantityStock" @change="() => calculateTotalPrice(scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="单价(元)" prop="taxInclusiveUnitPrice" width="150"> |
| | | <template #default="scope"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="() => calculateTotalPrice(scope.row)" /> |
| | |
| | | itemType: '物料', |
| | | inboundNum: 0, |
| | | inboundDate: getCurrentDate(), // 默认当天日期 |
| | | quantityStock: 0, |
| | | // quantityStock: 0, |
| | | taxInclusiveUnitPrice: 0, |
| | | taxInclusiveTotalPrice: 0, |
| | | taxRate: null, |
| | |
| | | |
| | | // 计算总价(根据数量、单价和含税单价) |
| | | const calculateTotalPrice = (row) => { |
| | | // 计算普通总价:quantityStock * taxInclusiveUnitPrice |
| | | const quantity = Number(row.quantityStock || 0); |
| | | // 计算普通总价:inboundNum * taxInclusiveUnitPrice |
| | | const quantity = Number(row.inboundNum || 0); |
| | | const taxInclusiveUnitPrice = Number(row.taxInclusiveUnitPrice || 0); |
| | | row.taxInclusiveTotalPrice = quantity * taxInclusiveUnitPrice; |
| | | calculateExclusivePrice(row); |
| | |
| | | itemType: row?.itemType ?? '', |
| | | inboundNum: Number(row?.inboundNum ?? row?.inboundQuantity ?? 0), |
| | | inboundDate: row?.inboundDate ?? row?.createTime ?? '', |
| | | quantityStock: Number(row?.quantityStock ?? 0), |
| | | taxRate: Number(row?.taxRate ?? 0), |
| | | taxInclusiveUnitPrice: Number(row?.taxInclusiveUnitPrice ?? 0), |
| | | taxInclusiveTotalPrice: Number(row?.taxInclusiveTotalPrice ?? 0), |