fix cancel order payment
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<div v-can="permissionCodes.fundRecord.read" class="sales-order-record-list">
|
||||
<div v-can="pageAccess" class="sales-order-record-list">
|
||||
<div class="filters">
|
||||
<t-dropdown-menu class="menus">
|
||||
<t-dropdown-item
|
||||
v-if="!isSelfReceiveOnly"
|
||||
v-model="operationType"
|
||||
label="操作类型"
|
||||
:options="operationOptions"
|
||||
@@ -82,6 +83,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type DropdownValue } from "tdesign-mobile-vue";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import SalesOrderAPI from "@/api/SalesOrderAPI";
|
||||
import { useNavBarStore } from "@/store/navBarStore";
|
||||
import type { FundOperationType, FundRecord, FundRecordStatus } from "@/types/SalesOrder";
|
||||
@@ -97,6 +99,7 @@ defineOptions({ name: "FundRecordList" });
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const navBarStore = useNavBarStore();
|
||||
const userStore = useUserStore();
|
||||
const recordList = ref<FundRecord[]>([]);
|
||||
const operationType = ref(route.query.operationType === "RECEIVE" ? "RECEIVE" : "ALL");
|
||||
const status = ref(route.query.status === "PENDING" ? "PENDING" : "ALL");
|
||||
@@ -105,6 +108,9 @@ const total = ref(0);
|
||||
const loading = ref(false);
|
||||
const isRefreshing = ref(false);
|
||||
const noMore = ref(false);
|
||||
const isSelfReceiveOnly = computed(() => !userStore.hasPermissions(permissionCodes.fundRecord.read)
|
||||
&& userStore.hasPermissions(permissionCodes.fundReceive.create));
|
||||
const pageAccess = computed(() => [permissionCodes.fundRecord.read, permissionCodes.fundReceive.create]);
|
||||
const operationOptions = [
|
||||
{ label: "全部类型", value: "ALL" },
|
||||
{ label: "线下收款", value: "RECEIVE" },
|
||||
@@ -127,13 +133,16 @@ async function loadMore(): Promise<void> {
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const result = await SalesOrderAPI.fundRecordList({
|
||||
const page = {
|
||||
index: pageIndex.value,
|
||||
size: 15,
|
||||
salesOrderId: String(route.query.salesOrderId || "") || undefined,
|
||||
operationType: operationType.value === "ALL" ? undefined : operationType.value as FundOperationType,
|
||||
operationType: isSelfReceiveOnly.value || operationType.value === "ALL" ? undefined : operationType.value as FundOperationType,
|
||||
status: status.value === "ALL" ? undefined : status.value as FundRecordStatus
|
||||
});
|
||||
};
|
||||
const result = isSelfReceiveOnly.value
|
||||
? await SalesOrderAPI.myReceiveRecordList(page)
|
||||
: await SalesOrderAPI.fundRecordList(page);
|
||||
const list = result.list || [];
|
||||
recordList.value = recordList.value.concat(list);
|
||||
total.value = result.total || 0;
|
||||
|
||||
Reference in New Issue
Block a user