Handy_Cao 2 роки тому
батько
коміт
959615e09d

+ 20 - 2
src/packages/pc/views/footer/goods/order/index.vue

@@ -1,7 +1,7 @@
 <!-- 商品订单- 委托 -->
 <template>
     <app-table :data="tableList" selection-type="multiple" v-model:columns="tableColumns" :loading="loading"
-        @selection-change="onTableSelect">
+        @selection-change="onTableSelect" @cell-dblclick="onCancelSumit">
         <template #headerRight>
             <div class="buttonbar">
                 <el-button type="primary" size="small" :disabled="selectedRows.length === 0"
@@ -42,9 +42,12 @@ import { useLocalPagination } from '@/hooks/pagination'
 import { getBuildTypeName, getBuyOrSellName, getOrderStatusName } from '@/constants/order'
 import { queryTradeOrderDetail } from '@/services/api/order'
 import AppTable from '@pc/components/base/table/index.vue'
-import { formatDate } from '@/filters'
+import { formatDate, handleRequestBigNumber } from '@/filters'
 import { useComponent } from '@/hooks/component'
 import eventBus from '@/services/bus'
+import { ElMessage } from 'element-plus'
+import { useCancelOrder } from '@/business/trade'
+const { cancelSubmit, formData } = useCancelOrder()
 
 const componentMap = new Map<string, unknown>([
     ['cancel', defineAsyncComponent(() => import('./cancel/index.vue'))], // 撤单
@@ -79,6 +82,21 @@ const tableColumns = ref<Model.TableColumn[]>([
     { prop: 'orderstatus', label: '状态' }
 ])
 
+/// 双击单据撤销
+const onCancelSumit = (row: Model.TradeOrderDetailRsp) => {
+    const { orderid, marketid, goodsid } = row
+    ///  参数信息
+    formData.Header = { MarketID: marketid, GoodsID: goodsid }
+    formData.OldOrderId = handleRequestBigNumber(orderid)
+    /// 提交
+    cancelSubmit().then(() => {
+        /// 刷新数据
+        run()
+    }).catch((err) => {
+        ElMessage.error('提交失败:' + err)
+    })
+}
+
 // 勾选表格行
 const onTableSelect = (rows: Model.TradeOrderDetailRsp[]) => {
     selectedRows.value = rows

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

@@ -36,6 +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'
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.HisAmountLogReq>()
 const filterDate = shallowRef<string[]>([])
@@ -54,6 +55,15 @@ filterOptons.buttonList = [
     { lable: '重置', className: 'el-button--info', onClick: () => onSearch(true) }
 ]
 
+filterOptons.selectList = [
+    {
+        key: 'OperateType',
+        selectedValue: 101,
+        options: getOperateTypeList(),
+        locked: true,
+    }
+]
+
 const onSearch = (clear = false) => {
     if (clear) {
         filterDate.value = []

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

@@ -1,6 +1,9 @@
 <!-- 资金流水-当前记录 -->
 <template>
     <app-table class="query-capital" :data="dataList" v-model:columns="tableColumns" :loading="loading">
+        <template #headerLeft>
+            <app-filter :options="filterOptons" />
+        </template>
         <template #headerRight>
             <ul class="query-capital-total">
                 <li>
@@ -26,8 +29,12 @@ import { formatDate } from '@/filters'
 import { useRequest } from '@/hooks/request'
 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'
 
-const { loading, dataList } = useRequest(queryAmountLog)
+const { loading, dataList, run } = useRequest(queryAmountLog)
+const { filterOptons, getQueryParams } = useDataFilter<Model.AmountLogReq>()
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'accountid', label: '资金账号' },
@@ -36,6 +43,19 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'createtime', label: '时间' }
 ])
 
+filterOptons.buttonList = [
+    { lable: '查询', className: 'el-button--info', onClick: () => onSearch() },
+]
+
+filterOptons.selectList = [
+    {
+        key: 'OperateType',
+        selectedValue: 101,
+        options: getOperateTypeList(),
+        locked: true,
+    }
+]
+
 // 手续费汇总
 const feeTotal = computed(() => dataList.value.reduce((pre, cur) => {
     if (cur.operatetype === 207) {
@@ -44,6 +64,7 @@ const feeTotal = computed(() => dataList.value.reduce((pre, cur) => {
     return pre
 }, 0))
 
+
 // 盈亏汇总
 const plTotal = computed(() => dataList.value.reduce((pre, cur) => {
     if (cur.operatetype === 209) {
@@ -51,6 +72,12 @@ const plTotal = computed(() => dataList.value.reduce((pre, cur) => {
     }
     return pre
 }, 0))
+
+const onSearch = (clear = false) => {
+    getQueryParams((qs) => {
+        run(qs)
+    }, clear)
+}
 </script>
 
 <style lang="less">

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

@@ -238,7 +238,8 @@ declare namespace Model {
         page?: number
         // 每页条数
         pagesize?: number
-        pageflag?: number; // 分页标志 0-page从0开始 1-page从1开始
+         // 分页标志 0-page从0开始 1-page从1开始
+        pageflag?: number;
         // 资金账户 - 格式:1,2,3
         accountID?: string
         // 资金操作类型 - 格式:1,2,3