| | |
| | | } |
| | | |
| | | function formatPrice(val) { |
| | | return Number(val || 0).toFixed(2) |
| | | return Number(val || 0).toFixed(5) |
| | | } |
| | | |
| | | // 新增/编辑 |
| | |
| | | name: `物料-${i.toString().padStart(3, '0')}`, |
| | | category: categories[i % categories.length], |
| | | stock: Math.floor(Math.random() * 1000), |
| | | price: (Math.random() * 500 + 10).toFixed(2), |
| | | price: (Math.random() * 500 + 10).toFixed(5), |
| | | status: statusOptions[i % 2], |
| | | updatedAt: nowString() |
| | | }) |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设计压力(MPa)" prop="designPressure"> |
| | | <el-input-number v-model="deviceForm.designPressure" :min="0" :precision="2" style="width: 100%" /> |
| | | <el-input-number v-model="deviceForm.designPressure" :min="0" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="容积(m³)" prop="volume"> |
| | | <el-input-number v-model="deviceForm.volume" :min="0" :precision="2" style="width: 100%" /> |
| | | <el-input-number v-model="deviceForm.volume" :min="0" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | // 计算水费金额 |
| | | const calculateWaterBill = () => { |
| | | if (form.value.waterConsumption && form.value.waterPrice) { |
| | | form.value.waterBill = (parseFloat(form.value.waterConsumption) * parseFloat(form.value.waterPrice)).toFixed(2); |
| | | form.value.waterBill = (parseFloat(form.value.waterConsumption) * parseFloat(form.value.waterPrice)).toFixed(5); |
| | | } |
| | | } |
| | | |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="设计压力"> |
| | | <el-input-number v-model="editBasicInfo.designPressure" :precision="2" style="width: 100%" /> |
| | | <el-input-number v-model="editBasicInfo.designPressure" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="工作压力"> |
| | | <el-input-number v-model="editBasicInfo.workingPressure" :precision="2" style="width: 100%" /> |
| | | <el-input-number v-model="editBasicInfo.workingPressure" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="容积"> |
| | | <el-input-number v-model="editBasicInfo.volume" :precision="2" style="width: 100%" /> |
| | | <el-input-number v-model="editBasicInfo.volume" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | return stock > waiting + original; |
| | | }; |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | return parseFloat(cellValue).toFixed(5); |
| | | }; |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | |
| | | label: "含税单价(元)", |
| | | prop: "taxInclusiveUnitPrice", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : "-"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "含税总价(元)", |
| | | prop: "taxInclusiveTotalPrice", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : "-"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "不含税总价(元)", |
| | | prop: "taxExclusiveTotalPrice", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : "-"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "本次来票金额(元)", |
| | | prop: "ticketsAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : "-"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "未来票数", |
| | |
| | | label: "未来票金额(元)", |
| | | prop: "futureTicketsAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : "-"; |
| | | }, |
| | | }, |
| | | ], |
| | | {}, |
| | |
| | | placeholder="请输入" |
| | | :min="0" |
| | | :step="0.1" |
| | | :precision="2" |
| | | clearable |
| | | style="width: 100%" |
| | | @change="invoiceNumBlur(row)" |
| | |
| | | v-model="row.ticketsAmount" |
| | | placeholder="请输入" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="0.1" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | label: "含税单价(元)", |
| | | prop: "taxInclusiveUnitPrice", |
| | | width: 150, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "含税总价(元)", |
| | | prop: "taxInclusiveTotalPrice", |
| | | width: 150, |
| | | formatData: (val) => { |
| | | return parseFloat(val).toFixed(2) ?? 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "不含税总价(元)", |
| | | prop: "taxExclusiveTotalPrice", |
| | | width: 150, |
| | | formatData: (val) => { |
| | | return parseFloat(val).toFixed(2) ?? 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "本次来票数", |
| | |
| | | if (!row.ticketsNum || row.ticketsNum === "") { |
| | | row.ticketsNum = 0; |
| | | } |
| | | row.ticketsNum = row.ticketsNum.toFixed(5); |
| | | if (Number(row.ticketsNum) > Number(row.tempFutureTickets)) { |
| | | proxy.$modal.msgWarning("本次开票数不得大于未开票数"); |
| | | row.ticketsNum = 0; |
| | | return; |
| | | } |
| | | // 计算本次来票金额 |
| | | row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(2) |
| | | row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(5) |
| | | // 计算未来票数 |
| | | row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2) |
| | | row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(5) |
| | | // 计算未来票金额 |
| | | row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2) |
| | | row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(5) |
| | | calculateinvoiceAmount(); |
| | | }; |
| | | |
| | |
| | | if (!row.ticketsAmount) { |
| | | row.ticketsAmount = 0; |
| | | } |
| | | row.ticketsAmount = row.ticketsAmount.toFixed(5); |
| | | // 计算是否超过来票总金额 |
| | | if (row.ticketsAmount > row.tempFutureTicketsAmount) { |
| | | proxy.$modal.msgWarning("本次来票金额不得大于未来票金额"); |
| | |
| | | } |
| | | // 计算本次来票数 |
| | | row.ticketsNum = Number( |
| | | (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2) |
| | | (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(5) |
| | | ); |
| | | // 计算未来票数 |
| | | row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2) |
| | | row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(5) |
| | | // 计算未来票金额 |
| | | row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2) |
| | | row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(5) |
| | | calculateinvoiceAmount(); |
| | | }; |
| | | |
| | |
| | | invoiceAmountTotal += Number(item.ticketsAmount); |
| | | } |
| | | }); |
| | | form.invoiceAmount = invoiceAmountTotal.toFixed(2); |
| | | form.invoiceAmount = invoiceAmountTotal.toFixed(5); |
| | | }; |
| | | |
| | | const open = (type, eid) => { |
| | |
| | | label: "合同金额(元)", |
| | | prop: "contractAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "已来票金额(元)", |
| | | prop: "receiptPaymentAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "待来票金额(元)", |
| | | prop: "unReceiptPaymentAmount", |
| | | width:200, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | // { |
| | | // fixed: "right", |
| | |
| | | v-model="scope.row.ticketsNum" |
| | | placeholder="请选择" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="0.1" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | v-model="scope.row.ticketsAmount" |
| | | placeholder="请选择" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="0.1" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | }); |
| | | }; |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | return parseFloat(cellValue).toFixed(2) ?? 0; |
| | | return parseFloat(cellValue).toFixed(5) ?? 0; |
| | | }; |
| | | // 表格选择数据 |
| | | const handleSelectionChange = (selection) => { |
| | |
| | | row.ticketsAmount = 0; |
| | | } |
| | | // 计算本次来票数 |
| | | row.ticketsNum = (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2); |
| | | row.ticketsNum = (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(5); |
| | | // 计算未来票数 |
| | | row.futureTickets = row.tempFutureTickets - row.ticketsNum; |
| | | // 计算未来票金额 |
| | |
| | | invoiceAmountTotal += item.ticketsAmount; |
| | | } |
| | | }); |
| | | form.value.invoiceAmount = invoiceAmountTotal.toFixed(2); |
| | | form.value.invoiceAmount = invoiceAmountTotal.toFixed(5); |
| | | } |
| | | |
| | | onMounted(() => { |
| | |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | v-model="scope.row.currentPaymentAmount" |
| | | :disabled="!scope.row.editType" |
| | | :precision="2" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="本次付款金额:" prop="currentPaymentAmount"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | :precision="2" |
| | | v-model="form.currentPaymentAmount" |
| | | placeholder="请输入" |
| | | clearable |
| | |
| | | { |
| | | label: "发票金额(元)", |
| | | prop: "invoiceAmount", |
| | | formatData: (params) => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "已付款金额(元)", |
| | | prop: "paymentAmountTotal", |
| | | formatData: (params) => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "待付款金额(元)", |
| | | prop: "unPaymentAmountTotal", |
| | | formatData: (params) => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "录入人", |
| | |
| | | { |
| | | label: "付款金额", |
| | | prop: "currentPaymentAmount", |
| | | formatData: (params) => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "付款方式", |
| | |
| | | label: "发票金额(元)", |
| | | prop: "invoiceAmount", |
| | | width: 200, |
| | | formatData: (params) => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "付款金额(元)", |
| | | prop: "currentPaymentAmount", |
| | | width: 200, |
| | | formatData: (params) => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "应付金额(元)", |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="来票数:"> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum" :precision="2"/> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="本次来票金额(元):"> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsAmount" @change="inputTicketsAmount" :precision="2"/> |
| | | <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsAmount" @change="inputTicketsAmount"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | form.createdAt = data.createdAt; |
| | | form.invoiceNumber = data.invoiceNumber; |
| | | form.ticketsNum = data.ticketsNum; |
| | | form.ticketsAmount = data.ticketsAmount.toFixed(2); |
| | | form.ticketsAmount = data.ticketsAmount.toFixed(5); |
| | | form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice; |
| | | form.futureTickets = data.futureTickets; |
| | | temFutureTickets.value = data.futureTickets; |
| | |
| | | // 确保所有数值都转换为数字类型进行计算 |
| | | const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice); |
| | | const futureTickets = Number(temFutureTickets.value) - Number(form.ticketsNum); |
| | | form.futureTickets = Number(futureTickets.toFixed(2)); |
| | | form.ticketsAmount = Number(ticketsAmount.toFixed(2)); |
| | | form.futureTickets = Number(futureTickets.toFixed(5)); |
| | | form.ticketsAmount = Number(ticketsAmount.toFixed(5)); |
| | | }; |
| | | const inputTicketsAmount = (val) => { |
| | | // 确保含税单价存在且不为零 |
| | |
| | | |
| | | if (Number(val) > Number(form.futureTickets*form.taxInclusiveUnitPrice)) { |
| | | proxy.$modal.msgWarning("本次来票金额不得大于总金额"); |
| | | form.ticketsAmount = (form.futureTickets*form.taxInclusiveUnitPrice).toFixed(2) |
| | | form.ticketsAmount = (form.futureTickets*form.taxInclusiveUnitPrice).toFixed(5) |
| | | const ticketsNum = Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice); |
| | | form.ticketsNum = Number(ticketsNum.toFixed(2)) |
| | | form.ticketsNum = Number(ticketsNum.toFixed(5)) |
| | | return; |
| | | } |
| | | |
| | | // 确保所有数值都转换为数字类型进行计算 |
| | | const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice); |
| | | form.ticketsNum = Number(ticketsNum.toFixed(2)); |
| | | form.ticketsNum = Number(ticketsNum.toFixed(5)); |
| | | }; |
| | | |
| | | defineExpose({ |
| | |
| | | > |
| | | <template #commonFilesRef="{ row }"> |
| | | <el-dropdown @command="(command) => handleCommand(command, row)"> |
| | | <el-button link :icon="Files" type="danger"> 附件 </el-button> |
| | | <el-button link :icon="Files" :type="row.commonFiles.length !== 0 ? 'success' : 'danger'"> 附件 </el-button> |
| | | <template #dropdown> |
| | | <el-dropdown-menu> |
| | | <el-dropdown-item |
| | |
| | | label: "合同金额(元)", |
| | | prop: "taxInclusiveTotalPrice", |
| | | width: 200, |
| | | formatData: (cell) => { |
| | | return cell ? parseFloat(cell).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "来票日期", |
| | |
| | | label: "开票金额", |
| | | prop: "ticketsAmount", |
| | | width: 200, |
| | | formatData: (cell) => { |
| | | return cell ? parseFloat(cell).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "不含税金额", |
| | | prop: "unTicketsPrice", |
| | | width: 200, |
| | | formatData: (cell) => { |
| | | return cell ? parseFloat(cell).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "增值税", |
| | |
| | | }); |
| | | }; |
| | | const formattedNumber = (row, column, cellValue) => { |
| | | return parseFloat(cellValue).toFixed(2); |
| | | return parseFloat(cellValue).toFixed(5); |
| | | }; |
| | | // 表格选择数据 |
| | | const expandedRowKeys = ref([]); |
| | |
| | | <el-form-item label="含税单价(元):" prop="taxInclusiveUnitPrice"> |
| | | <el-input-number |
| | | v-model="productForm.taxInclusiveUnitPrice" |
| | | :precision="2" |
| | | :step="0.1" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | <el-input-number |
| | | :step="0.1" |
| | | clearable |
| | | :precision="2" |
| | | style="width: 100%" |
| | | v-model="productForm.quantity" |
| | | placeholder="请输入" |
| | |
| | | <el-form-item label="含税总价(元):" prop="taxInclusiveTotalPrice"> |
| | | <el-input-number |
| | | v-model="productForm.taxInclusiveTotalPrice" |
| | | :precision="2" |
| | | :step="0.1" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | <el-form-item label="库存预警数量:" prop="warnNum"> |
| | | <el-input-number |
| | | v-model="productForm.warnNum" |
| | | :precision="2" |
| | | :step="0.1" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | <el-form-item label="合同金额(元):" prop="contractAmount"> |
| | | <el-input-number |
| | | v-model="scanAddForm.contractAmount" |
| | | :precision="2" |
| | | :step="0.1" |
| | | clearable |
| | | style="width: 100%" |
| | |
| | | // 已知含税总价和数量,反算含税单价 |
| | | if (productForm.value.quantity) { |
| | | productForm.value.taxInclusiveUnitPrice = |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2); |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(5); |
| | | } |
| | | // 已知含税总价和含税单价,反算数量 |
| | | else if (productForm.value.taxInclusiveUnitPrice) { |
| | | productForm.value.quantity = |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2); |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(5); |
| | | } |
| | | // 反算不含税总价 |
| | | productForm.value.taxExclusiveTotalPrice = |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)).toFixed(2); |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)).toFixed(5); |
| | | } else if (field === 'taxExclusiveTotalPrice') { |
| | | // 反算含税总价 |
| | | productForm.value.taxInclusiveTotalPrice = |
| | | (Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(2); |
| | | (Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(5); |
| | | // 已知数量,反算含税单价 |
| | | if (productForm.value.quantity) { |
| | | productForm.value.taxInclusiveUnitPrice = |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2); |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(5); |
| | | } |
| | | // 已知含税单价,反算数量 |
| | | else if (productForm.value.taxInclusiveUnitPrice) { |
| | | productForm.value.quantity = |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2); |
| | | (Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(5); |
| | | } |
| | | } |
| | | }; |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="数量:" prop="quantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" |
| | | clearable :precision="2"/> |
| | | clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | <div class="equipment-items"> |
| | | <div class="equipment-item"> |
| | | <span class="equipment-value">{{equipmentNum}}</span> |
| | | <span class="equipment-value">21</span> |
| | | <span class="equipment-label">设备总数</span> |
| | | </div> |
| | | <div class="equipment-item"> |
| | | <span class="equipment-value">{{equipmentRepair}}</span> |
| | | <span class="equipment-value">3</span> |
| | | <span class="equipment-label">待维修设备</span> |
| | | </div> |
| | | <div class="equipment-item"> |
| | | <span class="equipment-value">{{equipmentMaintain}}</span> |
| | | <span class="equipment-value">4</span> |
| | | <span class="equipment-label">待保养设备</span> |
| | | </div> |
| | | <div class="equipment-item"> |
| | | <!-- <div class="equipment-item"> |
| | | <span class="equipment-value">{{totalMeasuring}}</span> |
| | | <span class="equipment-label">计量器具总数</span> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item :label="`发票金额(元): 合同总额(${form.taxInclusiveTotalPrice}元)`" prop="invoiceTotal"> |
| | | <el-input-number :step="0.01" :min="0" :max="form.taxInclusiveTotalPrice" style="width: 100%" v-model="form.invoiceTotal" placeholder="请输入" clearable :precision="2"/> |
| | | <el-input-number :step="0.01" :min="0" :max="form.taxInclusiveTotalPrice" style="width: 100%" v-model="form.invoiceTotal" placeholder="请输入" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <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> |
| | |
| | | disabled |
| | | v-model="scope.row.noInvoiceAmount" |
| | | :formatter="formattedInputNumber" |
| | | :precision="2" |
| | | :step="0.01" |
| | | ></el-input> |
| | | </template> |
| | |
| | | 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(() => { |
| | |
| | | <span>¥{{ currentRecord.orderAmount }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="付款金额" prop="paymentAmount"> |
| | | <el-input-number v-model="paymentAmount" :precision="2" :min="0" :max="currentRecord.orderAmount" style="width: 100%"></el-input-number> |
| | | <el-input-number v-model="paymentAmount" :min="0" :max="currentRecord.orderAmount" style="width: 100%"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="付款方式" prop="paymentMethod"> |
| | | <el-select v-model="paymentMethod" placeholder="请选择付款方式" style="width: 100%"> |
| | |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | v-model="scope.row.receiptPaymentAmount" |
| | | :disabled="!scope.row.editType" |
| | | :precision="2" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="本次回款金额:" prop="receiptPaymentAmount"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" |
| | | :precision="2" |
| | | v-model="form.receiptPaymentAmount" |
| | | placeholder="请输入" |
| | | clearable |
| | |
| | | label: "回款金额(元)", |
| | | prop: "receiptPaymentAmount", |
| | | width:200, |
| | | formatData: (params) => { |
| | | return params ? parseFloat(params).toFixed(2) : 0; |
| | | }, |
| | | }, |
| | | { |
| | | label: "回款方式", |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="含税单价(元):" prop="taxInclusiveUnitPrice"> |
| | | <el-input-number :step="0.01" :min="0" v-model="productForm.taxInclusiveUnitPrice" style="width: 100%" |
| | | :precision="2" |
| | | placeholder="请输入" clearable @change="calculateFromUnitPrice" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="数量:" prop="quantity"> |
| | | <el-input-number :step="0.1" :min="0" v-model="productForm.quantity" placeholder="请输入" clearable |
| | | :precision="2" |
| | | @change="calculateFromQuantity" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.quantity) || 0); |
| | | }, 0); |
| | | return total.toFixed(2); |
| | | return total.toFixed(5); |
| | | }; |
| | | |
| | | // 计算产品总金额 |
| | |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0); |
| | | }, 0); |
| | | return total.toFixed(2); |
| | | return total.toFixed(5); |
| | | }; |
| | | |
| | | // 用于打印的计算函数 |
| | |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.quantity) || 0); |
| | | }, 0); |
| | | return total.toFixed(2); |
| | | return total.toFixed(5); |
| | | }; |
| | | |
| | | const getTotalAmountForPrint = (products) => { |
| | |
| | | const total = products.reduce((sum, product) => { |
| | | return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0); |
| | | }, 0); |
| | | return total.toFixed(2); |
| | | return total.toFixed(5); |
| | | }; |
| | | |
| | | const mathNum = () => { |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="quantity" label="数量"> |
| | | <template #default="scope"> |
| | | <el-input-number v-model="scope.row.quantity" :min="1" :precision="0" style="width: 100%" /> |
| | | <el-input-number v-model="scope.row.quantity" :min="1" style="width: 100%" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unit" label="单位"> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="unitPrice" label="单价"> |
| | | <template #default="scope"> |
| | | <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="2" style="width: 100%" @change="calculateAmount(scope.row)" /> |
| | | <el-input-number v-model="scope.row.unitPrice" :min="0" style="width: 100%" @change="calculateAmount(scope.row)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="amount" label="金额" width="120"> |