| | |
| | | </el-form-item> |
| | | <el-form-item label="收款方式:"> |
| | | <el-select |
| | | v-model="filters.incomeMethod" |
| | | v-model="filters.incomeMethodLabel" |
| | | placeholder="请选择" |
| | | clearable |
| | | style="width: 200px;" |
| | | > |
| | | <el-option |
| | | v-for="item in payment_methods" |
| | | v-for="item in incomeMethodOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="changePage" |
| | | > |
| | | <template #incomeMethodSlot="{ row }"> |
| | | <el-tag> |
| | | {{ getIncomeMethodLabel(row) }} |
| | | </el-tag> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | |
| | | const { proxy } = getCurrentInstance(); |
| | | const modalRef = ref(); |
| | | const { payment_methods } = proxy.useDict("payment_methods"); |
| | | const { receipt_payment_type } = proxy.useDict("receipt_payment_type"); |
| | | const { income_types } = proxy.useDict("income_types"); |
| | | const fileListRef = ref(null); |
| | | const fileListDialogVisible = ref(false); |
| | | const currentFileRow = ref(null); |
| | | const accountType = ref('收入'); |
| | | |
| | | const incomeMethodOptions = computed(() => { |
| | | const merged = [...(payment_methods.value || []), ...(receipt_payment_type.value || [])]; |
| | | const uniqueMap = new Map(); |
| | | merged.forEach((item) => { |
| | | const label = item?.label; |
| | | if (!label) return; |
| | | if (!uniqueMap.has(label)) { |
| | | uniqueMap.set(label, { label, value: label }); |
| | | } |
| | | }); |
| | | return Array.from(uniqueMap.values()); |
| | | }); |
| | | |
| | | const { |
| | | filters, |
| | |
| | | } = usePaginationApi( |
| | | listPage, |
| | | { |
| | | incomeMethod: undefined, |
| | | incomeMethodLabel: undefined, |
| | | entryDate: undefined, |
| | | }, |
| | | [ |
| | |
| | | }, |
| | | { |
| | | label: "收款方式", |
| | | prop: "incomeMethod", |
| | | prop: "incomeMethodLabel", |
| | | align: 'center', |
| | | width: '100', |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (payment_methods.value.find((m) => m.value == params)) { |
| | | return payment_methods.value.find((m) => m.value == params).label; |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | dataType: "slot", |
| | | slot: "incomeMethodSlot", |
| | | }, |
| | | { |
| | | label: "发票号码", |
| | |
| | | align: "center", |
| | | width: "160px", |
| | | }, |
| | | ] |
| | | ], |
| | | undefined, |
| | | { |
| | | incomeMethodLabel: (value) => ({ |
| | | incomeMethodLabel: value || undefined, |
| | | }), |
| | | } |
| | | ); |
| | | |
| | | // 表格合计:收入金额 |
| | |
| | | return proxy.summarizeTable(param, ["incomeMoney"]); |
| | | }; |
| | | |
| | | const getIncomeMethodLabel = (row) => { |
| | | const methodValue = row?.incomeMethod; |
| | | const dictList = String(row?.businessType) === "1" |
| | | ? receipt_payment_type.value |
| | | : payment_methods.value; |
| | | return dictList.find((item) => item.value == methodValue)?.label || "--"; |
| | | }; |
| | | |
| | | // 多选后做什么 |
| | | const handleSelectionChange = (selectionList) => { |
| | | multipleList.value = selectionList; |