Handy_Cao 2 jaren geleden
bovenliggende
commit
452e7dc3d3

+ 8 - 0
src/constants/order.ts

@@ -529,4 +529,12 @@ export function getOperateTypeList() {
 export function getOperateTypeName(value: number) {
     const enums = getOperateTypeList()
     return getEnumTypeName(enums, value)
+}
+
+/**
+ * 获取操作类型查询列表
+ * @returns 
+ */
+export function getOperateTypeSearchList() {
+    return getEnumTypeList('operatetypesearch')
 }

+ 37 - 8
src/packages/mobile/views/bank/capital/statement/history/index.vue

@@ -2,10 +2,14 @@
     <app-modal direction="right" height="100%" v-model:show="showModal">
         <app-view class="bank-hisstatement">
             <template #header>
-                <app-navbar title="历史资金流水" @back="closed" />
+                <app-navbar title="历史资金流水" @back="closed">
+                    <template #footer>
+                        <Cell title="查询日期" :value="dateRange.join('-')" @click="showCalendar = true" is-link />
+                    </template>
+                </app-navbar>
             </template>
-            <app-pull-refresh v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
-                :page-count="pageCount" @refresh="run">
+            <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+                :page-count="pageCount" @refresh="onRefresh">
                 <app-list class="bank-hisstatement__table" :columns="columns" :data-list="dataList">
                     <template #createtime="{ value }">
                         <span>{{ formatDate(value, 'YYYY-MM-DD') }}</span>
@@ -13,22 +17,35 @@
                     </template>
                 </app-list>
             </app-pull-refresh>
+            <Calendar v-model:show="showCalendar" type="range" :max-date="new Date()" :min-date="moment().subtract(1, 'years').toDate()" @confirm="onConfirm" />
+            <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
         </app-view>
     </app-modal>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, ref } from 'vue'
 import { formatDate } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryHisAmountLog } from '@/services/api/bank'
 import AppModal from '@/components/base/modal/index.vue'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
+import moment from 'moment'
+import { Calendar, Cell } from 'vant'
+import { useComponent } from '@/hooks/component'
+
+const { componentRef, componentId, closeComponent } = useComponent(() => {
+    pullRefreshRef.value?.refresh()
+})
 
+const componentMap = new Map<string, unknown>([])
 const showModal = shallowRef(true)
 const dataList = shallowRef<Model.HisAmountLogRsp[]>([])
 const error = shallowRef(false)
+const showCalendar = shallowRef(false) // 是否显示日期选择器
+const dateRange = ref<string[]>([]) // 日期范围
+const pullRefreshRef = shallowRef()
 
 const columns: Model.TableColumn[] = [
     { prop: 'createtime', label: '时间' },
@@ -38,10 +55,6 @@ const columns: Model.TableColumn[] = [
 
 const { loading, pageIndex, pageCount, run } = useRequest(queryHisAmountLog, {
     manual: true,
-    params: {
-        pagesize: 20,
-        pageflag: 1,
-    },
     onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
@@ -53,6 +66,22 @@ const { loading, pageIndex, pageCount, run } = useRequest(queryHisAmountLog, {
     }
 })
 
+// 选择日期
+const onConfirm = ([start, end]: Date[]) => {
+    showCalendar.value = false
+    dateRange.value = [formatDate(start.toISOString(), 'YYYY-MM-DD'), formatDate(end.toISOString(), 'YYYY-MM-DD')]
+    pageIndex.value = 1
+    pullRefreshRef.value?.refresh()
+}
+
+const onRefresh = () => {
+    const [begindate, enddate] = dateRange.value
+    run({
+        startDate: begindate,
+        endDate: enddate,
+    })
+}
+
 // 关闭弹窗
 const closed = () => {
     showModal.value = false

+ 4 - 4
src/packages/pc/views/query/capital/history/index.vue

@@ -4,7 +4,7 @@
         <template #headerLeft>
             <app-filter :options="filterOptons">
                 <template #before>
-                    <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYYMMDD"
+                    <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD"
                         v-model="filterDate" />
                 </template>
             </app-filter>
@@ -36,7 +36,7 @@ import { useRequest } from '@/hooks/request'
 import { queryHisAmountLog } from '@/services/api/bank'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
-import { getOperateTypeList } from '@/constants/order'
+import { getOperateTypeSearchList } from '@/constants/order'
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.HisAmountLogReq>()
 const filterDate = shallowRef<string[]>([])
@@ -57,9 +57,9 @@ filterOptons.buttonList = [
 
 filterOptons.selectList = [
     {
-        key: 'OperateType',
+        key: 'operateType',
         selectedValue: 101,
-        options: getOperateTypeList(),
+        options: getOperateTypeSearchList(),
         locked: true,
     }
 ]

+ 3 - 3
src/packages/pc/views/query/capital/list/index.vue

@@ -31,7 +31,7 @@ import { queryAmountLog } from '@/services/api/bank'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 import { useDataFilter } from '@/hooks/datatable'
-import { getOperateTypeList } from '@/constants/order'
+import { getOperateTypeSearchList } from '@/constants/order'
 
 const { loading, dataList, run } = useRequest(queryAmountLog)
 const { filterOptons, getQueryParams } = useDataFilter<Model.AmountLogReq>()
@@ -49,9 +49,9 @@ filterOptons.buttonList = [
 
 filterOptons.selectList = [
     {
-        key: 'OperateType',
+        key: 'operateType',
         selectedValue: 101,
-        options: getOperateTypeList(),
+        options: getOperateTypeSearchList(),
         locked: true,
     }
 ]

+ 0 - 2
src/services/api/bank/index.ts

@@ -125,7 +125,6 @@ export function queryHisAmountLog(config: RequestConfig<Model.HisAmountLogReq> =
         url: '/TaAccount/QueryHisAmountLog',
         params: {
             accountID: accountStore.currentAccountId.toString(),
-            pageflag: 1,
             ...config.data
         },
     })
@@ -139,7 +138,6 @@ export function queryAmountLog(config: RequestConfig<Model.AmountLogReq> = {}) {
         url: '/TaAccount/QueryAmountLog',
         params: {
             accountID: accountStore.currentAccountId.toString(),
-            pageflag: 1,
             ...config.data
         },
     })

+ 1 - 0
src/services/http/index.ts

@@ -135,6 +135,7 @@ export default new (class {
         const baseUrl = service.getConfig('goCommonSearchUrl')
         config.url = baseUrl + config.url
         const res = await this.request<CommonResult<T>>(config, errMsg)
+        console.log(useLoginStore().token)
         switch (res.code) {
             case ResultCode.InvalidToken: {
                 return Promise.reject('令牌无效')

+ 1 - 1
src/stores/modules/enum.ts

@@ -12,7 +12,7 @@ export interface EnumType {
     disabled?: boolean;
 }
 
-const enumKeys = ['confirmStatus', 'executetype', 'deliveryPayMode', 'applystatus', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus'] as const
+const enumKeys = ['confirmStatus', 'executetype', 'operatetypesearch', 'deliveryPayMode', 'applystatus', 'deliveryStatus', 'operateType', 'WRPresaleStatus', 'clientType', 'stepStatus', 'scoreConfigType', 'GZBSCPayStatus', 'performanceStatus', 'handlestatus', 'performanceType', 'accountBusinessCode', 'certificatetype', 'signstatus', 'thjOrderStatus', 'THJDeliveryMode', 'goodsunit', 'WROutInApplyStatus2', 'THJTransferStatus', 'WRTradeOrderStatus', 'THJMarket', 'THJProfitRoleType', 'appointmentModelOut', 'orderstatus', 'Pricemode2', 'buildtype', 'listingselecttype', 'certypeperson', 'runstatus'] as const
 
 const enumMap = new Map<typeof enumKeys[number], ShallowRef<Model.EnumRsp[]>>()
 

+ 2 - 2
src/types/model/bank.d.ts

@@ -158,7 +158,7 @@ declare namespace Model {
         page?: number; // 页码
         pagesize?: number; // 每页条数
         pageflag?: number; // 分页标志 0-page从0开始 1-page从1开始
-        OperateType?: string; // 资金操作类型 - 格式:1,2,3
+        operateType?: string; // 资金操作类型 - 格式:1,2,3
         startDate?: string; // 开始时间 - 闭区间,格式:yyyy-MM-dd
         endDate?: string; // 结束时间 - 闭区间,格式:yyyy-MM-dd
     }
@@ -243,7 +243,7 @@ declare namespace Model {
         // 资金账户 - 格式:1,2,3
         accountID?: string
         // 资金操作类型 - 格式:1,2,3
-        OperateType?: string
+        operateType?: string
     }
 
     /** 资金流水查询(当前) 响应 */