| | |
| | | v-model="form.invoiceAmount" |
| | | placeholder="自动填充" |
| | | clearable |
| | | :disabled="true" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | style="width: 100%" |
| | | v-model="form.entryDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | |
| | | style="width: 100%" |
| | | v-model="form.enterDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | |
| | | </PIMTable> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button type="primary" :loading="modalLoading" @click="submitForm"> |
| | | {{ modalOptions.confirmText }} |
| | | </el-button> |
| | | <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button> |
| | | <el-button type="primary" :loading="modalLoading" @click="submitForm"> |
| | | {{ modalOptions.confirmText }} |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | |
| | | const rules = ref({ |
| | | invoiceNumber: [ |
| | | { required: true, message: "请输入发票号", trigger: "blur" }, |
| | | { type: "string" }, |
| | | { required: false, message: "请输入发票号", trigger: "blur" }, |
| | | ], |
| | | invoiceAmount: [ |
| | | { required: true, message: "请输入发票金额", trigger: "blur" }, |
| | |
| | | { |
| | | label: "产品大类", |
| | | prop: "productCategory", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "规格型号", |
| | | prop: "specificationModel", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "单位", |
| | |
| | | prop: "taxInclusiveUnitPrice", |
| | | width: 150, |
| | | formatData: (val) => { |
| | | return val ? parseFloat(val).toFixed(2) : 0; |
| | | return val ? parseFloat(val).toFixed(5) : 0; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | prop: "taxInclusiveTotalPrice", |
| | | width: 150, |
| | | formatData: (val) => { |
| | | return parseFloat(val).toFixed(2) ?? 0; |
| | | return parseFloat(val).toFixed(5) ?? 0; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | prop: "taxExclusiveTotalPrice", |
| | | width: 150, |
| | | formatData: (val) => { |
| | | return parseFloat(val).toFixed(2) ?? 0; |
| | | return parseFloat(val).toFixed(5) ?? 0; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | 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) => { |
| | |
| | | const submitForm = () => { |
| | | formRef.value.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | modalLoading.value = true; |
| | | // modalLoading.value = true; |
| | | const { code } = await addOrUpdateRegistration({ |
| | | purchaseLedgerId: id.value, |
| | | purchaseContractNumber: form.purchaseLedgerNo, |