ylong пре 6 месеци
родитељ
комит
7fe99c0bba

+ 171 - 165
src/components/CommonPage/CommonTable.vue

@@ -1,104 +1,159 @@
 <template>
-  <ele-card
-    :body-style="{ paddingTop: '8px', ...bodyStyle }"
-    :flex-table="flexTable"
-  >
-    <!-- 表格 -->
-    <ele-pro-table
-      ref="tableRef"
-      :row-key="pageConfig.rowKey || 'id'"
-      :columns="columns"
-      :datasource="datasource"
-      :show-overflow-tooltip="true"
-      v-model:selections="selections"
-      highlight-current-row
-      :export-config="{ fileName: pageConfig.fileName }"
-      :cache-key="pageConfig.cacheKey"
-      border
-      v-bind="$attrs"
+    <ele-card
+        :body-style="{ paddingTop: '8px', ...bodyStyle }"
+        :flex-table="flexTable"
     >
-      <template v-for="(val, key) in slotArray" v-slot:[key]="{ row }">
-        <slot :name="key" :row="row"></slot>
-      </template>
-    </ele-pro-table>
-  </ele-card>
+        <!-- 表格 -->
+        <ele-pro-table
+            ref="tableRef"
+            :row-key="pageConfig.rowKey || 'id'"
+            :columns="columns"
+            :datasource="datasource"
+            :show-overflow-tooltip="true"
+            v-model:selections="selections"
+            highlight-current-row
+            :export-config="{ fileName: pageConfig.fileName }"
+            :cache-key="pageConfig.cacheKey"
+            border
+            v-bind="$attrs"
+        >
+            <template v-for="(val, key) in slotArray" v-slot:[key]="{ row }">
+                <slot :name="key" :row="row"></slot>
+            </template>
+        </ele-pro-table>
+    </ele-card>
 </template>
 
 <script setup>
-  import { ref, getCurrentInstance, useSlots } from 'vue';
-  import { ElMessageBox } from 'element-plus/es';
-  import { EleMessage } from 'ele-admin-plus/es';
-  import { useDictData } from '@/utils/use-dict-data';
-  import { download, toFormData, checkDownloadRes } from '@/utils/common';
-
-  const slotArray = useSlots();
-
-  let props = defineProps({
-    pageConfig: {
-      type: Object,
-      default: () => ({
-        cacheKey: 'recycleOrderTable',
-        fileName: '回收订单查询',
-        rowKey: 'id'
+    import { ref, getCurrentInstance, useSlots } from 'vue';
+    import { ElMessageBox } from 'element-plus/es';
+    import { EleMessage } from 'ele-admin-plus/es';
+    import { useDictData } from '@/utils/use-dict-data';
+    import { download, toFormData, checkDownloadRes } from '@/utils/common';
+
+    const slotArray = useSlots();
+
+    let props = defineProps({
+      pageConfig: {
+        type: Object,
+        default: () => ({
+          cacheKey: 'recycleOrderTable',
+          fileName: '回收订单查询',
+          rowKey: 'id'
+        })
+      },
+      pageUrl: { type: String, default: '/system/post/list' },
+      columns: { type: Array, default: () => [] },
+      bodyStyle: { type: Object, default: () => ({}) },
+      flexTable: { type: Boolean, default: true }
+    });
+    let { proxy } = getCurrentInstance();
+
+    /** 表格实例 */
+    const tableRef = ref(null);
+
+    /** 表格选中数据 */
+    const selections = ref([]);
+
+    async function queryPage(params) {
+      let url = props.pageConfig.pageUrl || props.pageUrl;
+      const res = await proxy.$http.get(url, { params });
+      if (res.data.code === 200) {
+        return res.data;
+      }
+      return Promise.reject(new Error(res.data.msg));
+    }
+
+    /** 表格数据源 */
+    const datasource = (table) => {
+      let { pages, where, orders,sorter    } = table
+      let initKeys = props.pageConfig.params || {};
+      
+      let tempOrders = {}
+      if(orders && orders.orderByColumn){
+        tempOrders.orderType = sorter.column.columnKey;
+        tempOrders.orderWay = orders.isAsc === 'ascending' ? 'asc' : 'desc';
+      }
+
+      return queryPage({ ...initKeys, ...where, ...tempOrders, ...pages });
+    };
+
+    /** 搜索 */
+    const reload = (where) => {
+      tableRef.value?.reload?.({ where, pageNum: 1 });
+    };
+
+    /** 批量操作 */
+    const operatBatch = ({ method, row, url, title, data = {} }) => {
+      const rows = row == null ? selections.value : [row];
+      if (!rows.length) {
+        EleMessage.error('请至少选择一条数据');
+        return;
+      }
+      title = title || '是否确认当前操作?';
+      ElMessageBox.confirm(title, '提示', {
+        type: 'warning',
+        draggable: true
       })
-    },
-    pageUrl: { type: String, default: '/system/post/list' },
-    columns: { type: Array, default: () => [] },
-    bodyStyle: { type: Object, default: () => ({}) },
-    flexTable: { type: Boolean, default: true }
-  });
-  let { proxy } = getCurrentInstance();
-
-  /** 表格实例 */
-  const tableRef = ref(null);
-
-  /** 表格选中数据 */
-  const selections = ref([]);
-
-  async function queryPage(params) {
-    let url = props.pageConfig.pageUrl || props.pageUrl;
-    const res = await proxy.$http.get(url, { params });
-    if (res.data.code === 200) {
-      return res.data;
+        .then(() => {
+          const loading = EleMessage.loading({
+            message: '请求中..',
+            plain: true
+          });
+          proxy.$http[method](url, data)
+            .then((res) => {
+              if (res.data.code === 200) {
+                EleMessage.success('操作成功');
+                reload();
+              } else {
+                EleMessage.error(res.data.msg);
+              }
+              loading.close();
+            })
+            .catch((e) => {
+              loading.close();
+              EleMessage.error(e.message);
+            });
+        })
+        .catch(() => {});
+    };
+
+    /// 导出数据
+    async function exportPage(params, name, method = 'POST') {
+      const res = await proxy.$http({
+        url: props.pageConfig.exportUrl,
+        method,
+        data: toFormData(params),
+        responseType: 'blob'
+      });
+      await checkDownloadRes(res);
+      download(
+        res.data,
+        name ? `${name}_${Date.now()}.xlsx` : `post_${Date.now()}.xlsx`
+      );
     }
-    return Promise.reject(new Error(res.data.msg));
-  }
-
-  /** 表格数据源 */
-  const datasource = ({ pages, where, orders }) => {
-    let initKeys = props.pageConfig.params || {};
-    console.log(initKeys, 'initKeys');
-
-    return queryPage({ ...initKeys, ...where, ...orders, ...pages });
-  };
-
-  /** 搜索 */
-  const reload = (where) => {
-    tableRef.value?.reload?.({ where, pageNum: 1 });
-  };
-
-  /** 批量操作 */
-  const operatBatch = ({ method, row, url, title, data = {} }) => {
-    const rows = row == null ? selections.value : [row];
-    if (!rows.length) {
-      EleMessage.error('请至少选择一条数据');
-      return;
+
+    //导出数据 进导出记录
+    function exportRecord(params, method = 'POST') {
+      return proxy.$http({
+        url: props.pageConfig.exportUrl,
+        method,
+        data: params
+      }); // 导出记录
     }
-    title = title || '是否确认当前操作?';
-    ElMessageBox.confirm(title, '提示', {
-      type: 'warning',
-      draggable: true
-    })
-      .then(() => {
-        const loading = EleMessage.loading({
-          message: '请求中..',
-          plain: true
-        });
-        proxy.$http[method](url, data)
+
+    /** 导出数据 */
+    const exportData = (name, method = 'POST') => {
+      const loading = EleMessage.loading({
+        message: '请求中..',
+        plain: true
+      });
+      tableRef.value?.fetch?.(({ where, orders }) => {
+        let initKeys = props.pageConfig.params || {};
+        exportRecord({ ...where, ...orders,...initKeys }, method)
           .then((res) => {
             if (res.data.code === 200) {
-              EleMessage.success('操作成功');
-              reload();
+              EleMessage.success('操作成功,请前往导出记录下载');
             } else {
               EleMessage.error(res.data.msg);
             }
@@ -108,85 +163,36 @@
             loading.close();
             EleMessage.error(e.message);
           });
-      })
-      .catch(() => {});
-  };
-
-  /// 导出数据
-  async function exportPage(params, name, method = 'POST') {
-    const res = await proxy.$http({
-      url: props.pageConfig.exportUrl,
-      method,
-      data: toFormData(params),
-      responseType: 'blob'
-    });
-    await checkDownloadRes(res);
-    download(
-      res.data,
-      name ? `${name}_${Date.now()}.xlsx` : `post_${Date.now()}.xlsx`
-    );
-  }
-
-  //导出数据 进导出记录
-  function exportRecord(params, method = 'POST') {
-    return proxy.$http({
-      url: props.pageConfig.exportUrl,
-      method,
-      data: params
-    }); // 导出记录
-  }
-
-  /** 导出数据 */
-  const exportData = (name, method = 'POST') => {
-    const loading = EleMessage.loading({
-      message: '请求中..',
-      plain: true
-    });
-    tableRef.value?.fetch?.(({ where, orders }) => {
-      let initKeys = props.pageConfig.params || {};
-      exportRecord({ ...where, ...orders,...initKeys }, method)
-        .then((res) => {
+      });
+    };
+
+    function messageBoxConfirm({ message, fetch }) {
+      ElMessageBox.confirm(message, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '关闭',
+        type: 'warning'
+      }).then(() => {
+        fetch().then((res) => {
           if (res.data.code === 200) {
-            EleMessage.success('操作成功,请前往导出记录下载');
+            EleMessage.success('操作成功');
+            reload();
           } else {
             EleMessage.error(res.data.msg);
           }
-          loading.close();
-        })
-        .catch((e) => {
-          loading.close();
-          EleMessage.error(e.message);
         });
-    });
-  };
-
-  function messageBoxConfirm({ message, fetch }) {
-    ElMessageBox.confirm(message, '提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '关闭',
-      type: 'warning'
-    }).then(() => {
-      fetch().then((res) => {
-        if (res.data.code === 200) {
-          EleMessage.success('操作成功');
-          reload();
-        } else {
-          EleMessage.error(res.data.msg);
-        }
       });
+    }
+
+    function getSelections() {
+      console.log(selections.value, 'selections.value');
+      return selections.value;
+    }
+
+    defineExpose({
+      reload,
+      exportData,
+      operatBatch,
+      getSelections,
+      messageBoxConfirm
     });
-  }
-
-  function getSelections() {
-    console.log(selections.value, 'selections.value');
-    return selections.value;
-  }
-
-  defineExpose({
-    reload,
-    exportData,
-    operatBatch,
-    getSelections,
-    messageBoxConfirm
-  });
 </script>

+ 261 - 242
src/views/finance/withdrawal/index.vue

@@ -1,271 +1,290 @@
 <template>
-  <ele-page flex-table>
-    <page-search @search="reload" :status="useStatus"></page-search>
+    <ele-page flex-table>
+        <page-search @search="reload" :status="useStatus"></page-search>
 
-    <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
-      <template #toolbar>
-        <div class="flex items-center mb-4">
-          <el-statistic
-            :value="statistics.totalWithdrawMoney"
-            title="提现累计金额"
-            :precision="2"
-            value-style="font-size:30px"
-            class="mr-10"
-          ></el-statistic>
-          <el-statistic
-            :value="statistics.unWithdrawMoney"
-            title="待提现金额"
-            :precision="2"
-            value-style="font-size:30px"
-            class="mr-10"
-          ></el-statistic>
-          <el-statistic
-            :value="statistics.auditWithdrawMoney"
-            title="提现中金额"
-            value-style="font-size:30px"
-            class="mr-10"
-            :precision="2"
-          ></el-statistic>
-          <el-statistic
-            :value="statistics.withdrawSuccessMoney"
-            title="已提现金额"
-            :precision="2"
-            value-style="font-size:30px"
-            class="mr-10"
-          ></el-statistic>
-          <el-statistic
-            :value="statistics.averageWithdrawDuration"
-            title="平均提现时长"
-            value-style="font-size:30px"
-            class="mr-10"
-            :precision="2"
-          ></el-statistic>
-          <el-statistic
-            :value="statistics.noWithdrawMoney"
-            title="长期不提现金额"
-            value-style="font-size:30px"
-            class="mr-10"
-            :precision="2"
-          ></el-statistic>
-        </div>
+        <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
+            <template #toolbar>
+                <div class="flex items-center mb-4">
+                    <el-statistic
+                        :value="statistics.totalWithdrawMoney"
+                        title="提现累计金额"
+                        :precision="2"
+                        value-style="font-size:30px"
+                        class="mr-10"
+                    ></el-statistic>
+                    <el-statistic
+                        :value="statistics.unWithdrawMoney"
+                        title="待提现金额"
+                        :precision="2"
+                        value-style="font-size:30px"
+                        class="mr-10"
+                    ></el-statistic>
+                    <el-statistic
+                        :value="statistics.auditWithdrawMoney"
+                        title="提现中金额"
+                        value-style="font-size:30px"
+                        class="mr-10"
+                        :precision="2"
+                    ></el-statistic>
+                    <el-statistic
+                        :value="statistics.withdrawSuccessMoney"
+                        title="已提现金额"
+                        :precision="2"
+                        value-style="font-size:30px"
+                        class="mr-10"
+                    ></el-statistic>
+                    <el-statistic
+                        :value="statistics.averageWithdrawDuration"
+                        title="平均提现时长"
+                        value-style="font-size:30px"
+                        class="mr-10"
+                        :precision="2"
+                    ></el-statistic>
+                    <el-statistic
+                        :value="statistics.noWithdrawMoney"
+                        title="长期不提现金额"
+                        value-style="font-size:30px"
+                        class="mr-10"
+                        :precision="2"
+                    ></el-statistic>
+                </div>
 
-        <div class="flex items-center mb-6">
-          <div class="common-title mr-10">交易记录</div>
-          <el-button
-            type="primary"
-            v-permission="'finance:withdrawal:batchAudit'"
-            @click="handleStepAudit()"
-          >
-            一键审核
-          </el-button>
-        </div>
+                <div class="flex items-center mb-6">
+                    <div class="common-title mr-10">交易记录</div>
+                    <el-button
+                        type="primary"
+                        v-permission="'finance:withdrawal:batchAudit'"
+                        @click="handleStepAudit()"
+                    >
+                        一键审核
+                    </el-button>
+                </div>
 
-        <el-radio-group @change="handleStatusChange" v-model="useStatus">
-          <el-radio-button label="全部" value="" />
-          <el-radio-button label="待审核" value="1" />
-          <el-radio-button label="待确认" value="2" />
-          <el-radio-button label="提现完成" value="4" />
-          <el-radio-button label="提现失败" value="5" />
-          <el-radio-button label="长期不提现用户" value="6" />
-        </el-radio-group>
-      </template>
+                <el-radio-group
+                    @change="handleStatusChange"
+                    v-model="useStatus"
+                >
+                    <el-radio-button label="全部" value="" />
+                    <el-radio-button label="待审核" value="1" />
+                    <el-radio-button label="待确认" value="2" />
+                    <el-radio-button label="提现完成" value="4" />
+                    <el-radio-button label="提现失败" value="5" />
+                    <el-radio-button label="长期不提现用户" value="6" />
+                </el-radio-group>
+            </template>
 
-      <template #status="{ row }">
-        {{ statusDicts.find((d) => d.value == row.status)?.label }}
-      </template>
-      <template #nickName="{ row }">
-        <el-button type="primary" link @click="handleDetail(row)">
-          {{ row.nickName }}
-        </el-button>
-      </template>
+            <template #status="{ row }">
+                {{ statusDicts.find((d) => d.value == row.status)?.label }}
+            </template>
+            <template #nickName="{ row }">
+                <el-button type="primary" link @click="handleDetail(row)">
+                    {{ row.nickName }}
+                </el-button>
+            </template>
 
-      <template #action="{ row }">
-        <div>
-          <el-button
-            type="primary"
-            link
-            v-permission="'finance:withdrawal:detail'"
-            @click="handleUpdate(row)"
-          >
-            [详情]
-          </el-button>
-          <el-button
-            type="primary"
-            link
-            v-if="row.status == 1"
-            v-permission="'finance:withdrawal:audit'"
-            @click="handleChangeStatus(row)"
-          >
-            [审核]
-          </el-button>
-        </div>
-      </template>
-    </common-table>
+            <template #action="{ row }">
+                <div>
+                    <el-button
+                        type="primary"
+                        link
+                        v-permission="'finance:withdrawal:detail'"
+                        @click="handleUpdate(row)"
+                    >
+                        [详情]
+                    </el-button>
+                    <el-button
+                        type="primary"
+                        link
+                        v-if="row.status == 1"
+                        v-permission="'finance:withdrawal:audit'"
+                        @click="handleChangeStatus(row)"
+                    >
+                        [审核]
+                    </el-button>
+                </div>
+            </template>
+        </common-table>
 
-    <!-- 审核弹窗 -->
-    <audit-dialog ref="auditDialogRef" @success="reload" />
+        <!-- 审核弹窗 -->
+        <audit-dialog ref="auditDialogRef" @success="reload" />
 
-    <!-- 详情弹窗 -->
-    <detail-dialog ref="detailDialogRef" />
-    <customer-detail ref="detailRef"></customer-detail>
-  </ele-page>
+        <!-- 详情弹窗 -->
+        <detail-dialog ref="detailDialogRef" />
+        <customer-detail ref="detailRef"></customer-detail>
+    </ele-page>
 </template>
 
 <script setup>
-  import { ref, reactive, onMounted } from 'vue';
-  import CommonTable from '@/components/CommonPage/CommonTable.vue';
-  import pageSearch from './components/page-search.vue';
-  import { useDictData } from '@/utils/use-dict-data';
-  import request from '@/utils/request';
-  import auditDialog from './components/audit-dialog.vue';
-  import detailDialog from './components/detail-dialog.vue';
-  import customerDetail from '@/views/customer/list/components/customer-detail.vue';
+    import { ref, reactive, onMounted } from 'vue';
+    import CommonTable from '@/components/CommonPage/CommonTable.vue';
+    import pageSearch from './components/page-search.vue';
+    import { useDictData } from '@/utils/use-dict-data';
+    import request from '@/utils/request';
+    import auditDialog from './components/audit-dialog.vue';
+    import detailDialog from './components/detail-dialog.vue';
+    import customerDetail from '@/views/customer/list/components/customer-detail.vue';
 
-  defineOptions({ name: 'withdrawal' });
+    defineOptions({ name: 'withdrawal' });
 
-  // 添加统计数据的响应式对象
-  const statistics = reactive({
-    totalWithdrawMoney: 0,
-    unWithdrawMoney: 0,
-    auditWithdrawMoney: 0,
-    withdrawSuccessMoney: 0,
-    averageWithdrawDuration: 0,
-    noWithdrawMoney: 0
-  });
+    // 添加统计数据的响应式对象
+    const statistics = reactive({
+        totalWithdrawMoney: 0,
+        unWithdrawMoney: 0,
+        auditWithdrawMoney: 0,
+        withdrawSuccessMoney: 0,
+        averageWithdrawDuration: 0,
+        noWithdrawMoney: 0
+    });
 
-  // 获取统计数据
-  async function fetchStatistics() {
-    try {
-      const res = await request.get('/sys/finance/withdrawSum');
-      if (res.data.code === 200) {
-        Object.assign(statistics, res.data.data);
-      }
-    } catch (error) {
-      console.error('获取统计数据失败:', error);
+    // 获取统计数据
+    async function fetchStatistics() {
+        try {
+            const res = await request.get('/sys/finance/withdrawSum');
+            if (res.data.code === 200) {
+                Object.assign(statistics, res.data.data);
+            }
+        } catch (error) {
+            console.error('获取统计数据失败:', error);
+        }
     }
-  }
 
-  onMounted(() => {
-    fetchStatistics();
-  });
+    onMounted(() => {
+        fetchStatistics();
+    });
 
-  const [statusDicts] = useDictData(['withdrawal_status']);
+    const [statusDicts] = useDictData(['withdrawal_status']);
 
-  const useStatus = ref('');
-  function handleStatusChange(value) {
-    if (value === '6') {
-      pageConfig.pageUrl = '/sys/finance/noWithdrawList';
-      pageConfig.params.status = value;
-      pageRef.value?.reload();
-    } else {
-      pageConfig.pageUrl = '/sys/finance/withdrawList';
-      pageConfig.params.status = value;
-      pageRef.value?.reload();
+    const useStatus = ref('');
+    function handleStatusChange(value) {
+        if (value === '6') {
+            pageConfig.pageUrl = '/sys/finance/noWithdrawList';
+            pageConfig.params.status = value;
+            pageRef.value?.reload();
+        } else {
+            pageConfig.pageUrl = '/sys/finance/withdrawList';
+            pageConfig.params.status = value;
+            pageRef.value?.reload();
+        }
     }
-  }
 
-  //提现类型 	string
-  const withdrawTypeDicts = ref([
-    { label: '微信', value: 1 },
-    { label: '支付宝', value: 2 }
-  ]);
-  /** 表格列配置 */
-  const columns = ref([
-    {
-      type: 'selection',
-      columnKey: 'selection',
-      width: 50,
-      align: 'center',
-      fixed: 'left'
-    },
-    { label: '提现时间', prop: 'createTime', align: 'center', width: 180 },
-    {
-      label: '用户名',
-      prop: 'nickName',
-      align: 'center',
-      minWidth: 140,
-      slot: 'nickName'
-    },
-    {
-      label: '支付单号/流水号',
-      prop: 'transferNo',
-      align: 'center',
-      minWidth: 160
-    },
-    {
-      label: '对方账户',
-      prop: 'withdrawType',
-      align: 'center',
-      formatter: (row) =>
-        withdrawTypeDicts.value.find((d) => d.value == row.withdrawType)?.label
-    },
-    { label: '金额', prop: 'withdrawMoney', align: 'center' },
-    {
-      label: '交易状态',
-      prop: 'status',
-      align: 'center',
-      formatter: (row) =>
-        statusDicts.value.find((d) => d.dictValue == row.status)?.dictLabel
-    },
-    {
-      label: '交易类型',
-      prop: 'withdrawType',
-      align: 'center',
-      formatter: (row) => '提现'
-    },
-    {
-      columnKey: 'action',
-      label: '操作',
-      width: 140,
-      align: 'center',
-      slot: 'action',
-      fixed: 'right'
-    }
-  ]);
+    //提现类型 	string
+    const withdrawTypeDicts = ref([
+        { label: '微信', value: 1 },
+        { label: '支付宝', value: 2 }
+    ]);
+    /** 表格列配置 */
+    const columns = ref([
+        {
+            type: 'selection',
+            columnKey: 'selection',
+            width: 50,
+            align: 'center',
+            fixed: 'left'
+        },
+        {
+            label: '提现时间',
+            prop: 'createTime',
+            align: 'center',
+            width: 180,
+            formatter: (row) => row.createTime || '--'
+        },
+        {
+            label: '用户名',
+            prop: 'nickName',
+            align: 'center',
+            minWidth: 140,
+            slot: 'nickName'
+        },
+        {
+            label: '支付单号/流水号',
+            prop: 'transferNo',
+            align: 'center',
+            minWidth: 160,
+            formatter: (row) => row.transferNo || '--'
+        },
+        {
+            label: '对方账户',
+            prop: 'withdrawType',
+            align: 'center',
+            formatter: (row) =>
+                withdrawTypeDicts.value.find((d) => d.value == row.withdrawType)
+                    ?.label || '--'
+        },
+        // restmoney
+        {
+            label: '金额',
+            prop: 'withdrawMoney',
+            align: 'center',
+            formatter: (row) =>
+                useStatus.value == 6 ? row.restMoney : row.withdrawMoney
+        },
+        {
+            label: '交易状态',
+            prop: 'status',
+            align: 'center',
+            formatter: (row) =>
+                statusDicts.value.find((d) => d.dictValue == row.status)
+                    ?.dictLabel || '--'
+        },
+        {
+            label: '交易类型',
+            prop: 'withdrawType',
+            align: 'center',
+            formatter: (row) => '提现'
+        },
+        {
+            columnKey: 'action',
+            label: '操作',
+            width: 140,
+            align: 'center',
+            slot: 'action',
+            fixed: 'right'
+        }
+    ]);
 
-  /** 页面组件实例 */
-  const pageRef = ref(null);
-  const auditDialogRef = ref(null);
-  const detailDialogRef = ref(null);
+    /** 页面组件实例 */
+    const pageRef = ref(null);
+    const auditDialogRef = ref(null);
+    const detailDialogRef = ref(null);
 
-  const pageConfig = reactive({
-    pageUrl: '/sys/finance/withdrawList',
-    fileName: '提现管理',
-    cacheKey: 'withdrawalTable',
-    params: {
-      status: ''
-    }
-  });
+    const pageConfig = reactive({
+        pageUrl: '/sys/finance/withdrawList',
+        fileName: '提现管理',
+        cacheKey: 'withdrawalTable',
+        params: {
+            status: ''
+        }
+    });
 
-  //详情页面
-  const detailRef = ref(null);
-  function handleDetail(row, type) {
-    row.id = row.userId;
-    detailRef.value?.handleOpen(row, type);
-  }
+    //详情页面
+    const detailRef = ref(null);
+    function handleDetail(row, type) {
+        row.id = row.userId;
+        detailRef.value?.handleOpen(row, type);
+    }
 
-  //刷新表格
-  function reload(where) {
-    pageRef.value?.reload(where);
-  }
+    //刷新表格
+    function reload(where) {
+        pageRef.value?.reload(where);
+    }
 
-  //审核
-  function handleChangeStatus(row) {
-    auditDialogRef.value?.handleOpen(row.id);
-  }
+    //审核
+    function handleChangeStatus(row) {
+        auditDialogRef.value?.handleOpen(row.id);
+    }
 
-  //详情
-  function handleUpdate(row) {
-    detailDialogRef.value?.handleOpen(row);
-  }
+    //详情
+    function handleUpdate(row) {
+        detailDialogRef.value?.handleOpen(row);
+    }
 
-  //一键审核
-  function handleStepAudit() {
-    const selections = pageRef.value?.getSelections();
-    if (!selections?.length) {
-      ElMessage.warning('请至少选择一条数据');
-      return;
+    //一键审核
+    function handleStepAudit() {
+        const selections = pageRef.value?.getSelections();
+        if (!selections?.length) {
+            ElMessage.warning('请至少选择一条数据');
+            return;
+        }
+        auditDialogRef.value?.handleOpen(selections.map((item) => item.id));
     }
-    auditDialogRef.value?.handleOpen(selections.map((item) => item.id));
-  }
 </script>

+ 11 - 12
src/views/recycle/bookStat/index.vue

@@ -7,7 +7,6 @@
             :pageConfig="pageConfig"
             :columns="columns"
             :tools="false"
-            @sort-change="handleSortChange"
         >
             <template #toolbar>
                 <el-radio-group
@@ -124,7 +123,7 @@
             </template>
 
             <template #action="{ row }">
-                <div class="flex flex-wrap gap-1">
+                <div class="flex flex-wrap gap-1 button-group">
                     <el-button
                         color="#f37607"
                         v-permission="'recycle:bookStat:viewUrl'"
@@ -242,14 +241,6 @@
         pageRef.value.reload({ searchType: value });
     }
 
-    function handleSortChange({ column, order }) {
-        // 1 扫描次数 2总回收量 3最后一次扫描时间
-        reload({
-            orderType: column.columnKey,
-            orderWay: order === 'ascending' ? 'asc' : 'desc'
-        });
-    }
-
     /** 表格列配置 */
     const columns = ref([
         {
@@ -274,7 +265,7 @@
         {
             label: '总回收数量',
             minWidth: 120,
-            prop: 'recycleTotalNumTime',
+            prop: 'recycleTotalNum',
             sortable: true,
             columnKey: '2'
         },
@@ -282,7 +273,9 @@
             label: '回收量',
             prop: 'recycleTotalNumTime',
             minWidth: 100,
-            formatter: (row) => row?.recycleTotalNumTime || 0
+            formatter: (row) => row?.recycleTotalNumTime || 0,
+            sortable: true,
+            columnKey: '4'
         },
         {
             label: '最大回收量',
@@ -356,3 +349,9 @@
         window.open(url, '_blank');
     }
 </script>
+
+<style lang="scss">
+.button-group .el-button{
+    width: calc(50% - 8px);
+}
+</style>

+ 0 - 9
src/views/recycle/bookTypes/index.vue

@@ -7,7 +7,6 @@
             :pageConfig="pageConfig"
             :columns="columns"
             :tools="false"
-            @sort-change="handleSortChange"
         >
             <template #toolbar>
                 <el-radio-group @change="handleStatusChange" v-model="bookTag">
@@ -224,14 +223,6 @@
         }
     });
 
-    function handleSortChange({ column, order }) {
-        // 1 扫描次数 2总回收量 3最后一次扫描时间
-        reload({
-            orderType: column.columnKey,
-            orderWay: order === 'ascending' ? 'asc' : 'desc'
-        });
-    }
-
     //导出excel
     function handleExportExcel() {
         pageRef.value?.exportData('图书类型管理');

+ 0 - 9
src/views/recycle/booklist/index.vue

@@ -7,7 +7,6 @@
       :pageConfig="pageConfig"
       :columns="columns"
       :tools="false"
-      @sort-change="handleSortChange"
     >
       <template #toolbar>
         <el-radio-group @change="handleStatusChange" v-model="searchType">
@@ -313,14 +312,6 @@
     }
   });
 
-  function handleSortChange({ column, order }) {
-    // 1 扫描次数 2总回收量 3最后一次扫描时间
-    reload({
-      orderType: column.columnKey,
-      orderWay: order === 'ascending' ? 'asc' : 'desc'
-    });
-  }
-
   //刷新表格
   function reload(where) {
     pageRef.value?.reload(where);

+ 0 - 9
src/views/recycle/scanLog/index.vue

@@ -7,7 +7,6 @@
       :pageConfig="pageConfig"
       :columns="columns"
       :tools="false"
-      @sort-change="handleSortChange"
     >
       <template #toolbar>
         <el-radio-group @change="handleStatusChange" v-model="searchType">
@@ -214,14 +213,6 @@
     pageRef.value.reload();
   }
 
-  function handleSortChange({ column, order }) {
-    // 1 扫描次数 2总回收量 3最后一次扫描时间
-    reload({
-      orderType: column.columnKey,
-      orderWay: order === 'ascending' ? 'asc' : 'desc'
-    });
-  }
-
   /** 表格列配置 */
   const columns = ref([
     {

+ 7 - 10
src/views/recycle/workbench/index.vue

@@ -7,7 +7,6 @@
             :pageConfig="pageConfig"
             :columns="columns"
             :tools="false"
-            @sort-change="handleSortChange"
         >
             <template #toolbar>
                 <el-radio-group
@@ -123,7 +122,7 @@
             </template>
 
             <template #action="{ row }">
-                <div class="flex flex-wrap gap-1">
+                <div class="flex flex-wrap gap-1 button-group">
                     <el-button
                         color="#f37607"
                         v-permission="'recycle:workbench:viewUrl'"
@@ -242,14 +241,6 @@
         pageRef.value.reload({ searchType: value });
     }
 
-    function handleSortChange({ column, order }) {
-        // 1 扫描次数 2总回收量 3最后一次扫描时间
-        reload({
-            orderType: column.columnKey,
-            orderWay: order === 'ascending' ? 'asc' : 'desc'
-        });
-    }
-
     /** 表格列配置 */
     const columns = ref([
         {
@@ -368,3 +359,9 @@
         window.open(url, '_blank');
     }
 </script>
+
+<style lang="scss">
+.button-group .el-button{
+    width: calc(50% - 8px);
+}
+</style>