| | |
| | | <el-table-column label="本次开票数" prop="currentInvoiceNum" width="180"> |
| | | <template #default="scope"> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" |
| | | :precision="2" |
| | | v-model="scope.row.currentInvoiceNum" |
| | | @change="invoiceNumBlur(scope.row)" |
| | | ></el-input-number> |
| | |
| | | > |
| | | <template #default="scope"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | :precision="2" |
| | | v-model="scope.row.currentInvoiceAmount" |
| | | @change="invoiceAmountBlur(scope.row)" |
| | | ></el-input-number> |
| | |
| | | |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | if (cellValue == 0) { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | return parseFloat(cellValue).toFixed(5); |
| | | } |
| | | if (cellValue) { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | return parseFloat(cellValue).toFixed(5); |
| | | } else { |
| | | return cellValue; |
| | | } |
| | | }; |
| | | |
| | | const formattedInputNumber = (value) => { |
| | | return value ? parseFloat(value).toFixed(2) : 0; |
| | | return value ? parseFloat(value).toFixed(5) : 0; |
| | | }; |
| | | |
| | | // 查询列表 |
| | |
| | | if (!row.currentInvoiceNum) { |
| | | row.currentInvoiceNum = 0; |
| | | } |
| | | row.currentInvoiceNum = row.currentInvoiceNum.toFixed(5); |
| | | if (row.currentInvoiceNum > row.tempNoInvoiceNum) { |
| | | proxy.$modal.msgWarning("本次开票数不得大于未开票数"); |
| | | row.currentInvoiceNum = 0; |
| | |
| | | // 计算本次开票金额 |
| | | row.currentInvoiceAmount = ( |
| | | row.currentInvoiceNum * row.taxInclusiveUnitPrice |
| | | ).toFixed(2); |
| | | ).toFixed(5); |
| | | // 计算未开票数 |
| | | row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed( |
| | | 2 |
| | | 5 |
| | | ); |
| | | // 计算未开票金额 |
| | | row.noInvoiceAmount = ( |
| | | row.tempnoInvoiceAmount - row.currentInvoiceAmount |
| | | ).toFixed(2); |
| | | ).toFixed(5); |
| | | }; |
| | | // 本次开票金额失焦操作 |
| | | const invoiceAmountBlur = (row) => { |
| | | if (!row.currentInvoiceAmount) { |
| | | row.currentInvoiceAmount = 0; |
| | | } |
| | | row.currentInvoiceAmount = row.currentInvoiceAmount.toFixed(5); |
| | | // 计算是否超过开票总金额 |
| | | if (row.currentInvoiceAmount > row.tempnoInvoiceAmount) { |
| | | proxy.$modal.msgWarning("本次开票金额不得大于未开票金额"); |
| | |
| | | // 计算本次开票数 |
| | | row.currentInvoiceNum = ( |
| | | row.currentInvoiceAmount / row.taxInclusiveUnitPrice |
| | | ).toFixed(2); |
| | | ).toFixed(5); |
| | | console.log("row.currentInvoiceNum ", row.currentInvoiceNum); |
| | | console.log(" row.originalNoInvoiceNum ", row.originalNoInvoiceNum); |
| | | // 计算未开票数 |
| | | row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed( |
| | | 2 |
| | | 5 |
| | | ); |
| | | // 计算未开票金额 |
| | | row.noInvoiceAmount = ( |
| | | row.tempnoInvoiceAmount - row.currentInvoiceAmount |
| | | ).toFixed(2); |
| | | ).toFixed(5); |
| | | }; |
| | | |
| | | onMounted(() => { |