| | |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | | <template #amount="{ row }"> |
| | | <span class="text-primary">¥{{ formatMoney(row.amount) }}</span> |
| | | <template #invoiceAmount="{ row }"> |
| | | <span class="text-primary">¥{{ formatMoney(row.invoiceAmount) }}</span> |
| | | </template> |
| | | <template #taxRate="{ row }"> |
| | | <span>{{ row.taxRate }}%</span> |
| | |
| | | <el-input-number |
| | | v-model="form.amount" |
| | | :min="0" |
| | | :precision="2" |
| | | :precision="4" |
| | | :disabled="isView" |
| | | style="width: 100%;" |
| | | placeholder="根据所选出库单自动汇总,可修改" |
| | |
| | | }); |
| | | |
| | | const columns = [ |
| | | { label: "申请单号", prop: "applyCode", width: "150" }, |
| | | { label: "申请单号", prop: "invoiceApplicationNo", width: "150" }, |
| | | { label: "客户名称", prop: "customerName", width: "180" }, |
| | | { label: "开票金额", prop: "amount", dataType: "slot", slot: "amount" }, |
| | | { label: "开票金额", prop: "invoiceAmount", dataType: "slot", slot: "invoiceAmount" }, |
| | | { label: "税率", prop: "taxRate", dataType: "slot", slot: "taxRate" }, |
| | | { label: "发票类型", prop: "invoiceType", width: "130" }, |
| | | { label: "申请日期", prop: "applyDate", width: "120" }, |
| | |
| | | const sum = outboundBatchOptions.value |
| | | .filter((opt) => selected.some((id) => isSameOutboundId(id, opt.value))) |
| | | .reduce((acc, opt) => acc + (Number(opt.outboundAmount) || 0), 0); |
| | | form.amount = sum > 0 ? Number(sum.toFixed(2)) : 0; |
| | | form.amount = sum > 0 ? Number(sum.toFixed(4)) : 0; |
| | | }; |
| | | |
| | | const getOutboundRowId = (row) => row?.id ?? row?.stockOutRecordId; |
| | |
| | | |
| | | const normalizeTableRow = (row) => ({ |
| | | ...row, |
| | | applyCode: row.invoiceApplicationNo ?? row.applyCode, |
| | | amount: row.invoiceAmount ?? row.amount, |
| | | content: row.invoiceContent ?? row.content, |
| | | status: normalizeStatus(row.status ?? row.auditStatus), |
| | | stockOutRecordIds: row.stockOutRecordIds ?? row.stockOutRecordId ?? "", |
| | |
| | | |
| | | const formatMoney = (value) => { |
| | | if (value === undefined || value === null) return "0.00"; |
| | | return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
| | | const parts = Number(value).toFixed(4).split("."); |
| | | parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
| | | return parts.join("."); |
| | | }; |
| | | |
| | | const getStatusLabel = (status) => { |
| | |
| | | : parseStockOutRecordIds(row.stockOutRecordIds ?? row.stockOutRecordId); |
| | | Object.assign(form, { |
| | | ...row, |
| | | applyCode: row.applyCode ?? row.invoiceApplicationNo ?? "", |
| | | amount: Number(row.amount ?? row.invoiceAmount ?? 0), |
| | | applyCode: row.invoiceApplicationNo ?? row.applyCode ?? "", |
| | | amount: Number(row.invoiceAmount ?? row.amount ?? 0), |
| | | content: row.content ?? row.invoiceContent, |
| | | status: normalizeStatus(row.status ?? row.auditStatus), |
| | | outboundBatchNos, |
| | |
| | | }; |
| | | |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm(`确认删除申请单「${row.applyCode ?? row.invoiceApplicationNo}」吗?`, "提示", { |
| | | ElMessageBox.confirm(`确认删除申请单「${row.invoiceApplicationNo ?? row.applyCode}」吗?`, "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |