lxr 3 месяцев назад
Родитель
Сommit
1be15d16bb

+ 1 - 1
src/views/lawyerManagement/lawyer/index.vue

@@ -122,7 +122,7 @@ const columns = reactive<ColumnProps<any>[]>([
   { label: "联系电话", prop: "phone", width: 140, search: { el: "input", props: { placeholder: "请输入联系电话" } } },
   {
     label: "从业时间",
-    prop: "time",
+    prop: "practiceStartDate",
     isShow: false,
     search: {
       el: "date-picker",

+ 31 - 11
src/views/lawyerManagement/reconciliation/detailDialog.vue

@@ -8,7 +8,16 @@
     @close="handleClose"
   >
     <div class="detail-table">
-      <ProTable ref="proTable" :data="detailList" :columns="columns" :tool-button="false" :border="true" height="360" />
+      <ProTable
+        ref="proTable"
+        :columns="columns"
+        :request-api="getTableList"
+        :data-callback="dataCallback"
+        :request-auto="false"
+        :tool-button="false"
+        :border="true"
+        height="360"
+      />
     </div>
 
     <template #footer>
@@ -23,11 +32,11 @@
 import { ref, defineExpose } from "vue";
 import { ElMessage } from "element-plus";
 import ProTable from "@/components/ProTable/index.vue";
-import type { ColumnProps } from "@/components/ProTable/interface";
+import type { ProTableInstance, ColumnProps } from "@/components/ProTable/interface";
 import { getLawyerDetails } from "@/api/modules/lawyer";
 
 const dialogShow = ref(false);
-const detailList = ref<any[]>([]);
+const proTable = ref<ProTableInstance>();
 const currentQuery = ref<String>("");
 
 const columns: ColumnProps[] = [
@@ -39,27 +48,38 @@ const columns: ColumnProps[] = [
   { label: "购买时间", prop: "orderTime", minWidth: 180 }
 ];
 
-const fetchDetails = async () => {
+const getTableList = async (params: any) => {
   try {
-    const res: any = await getLawyerDetails({
-      lawyerId: currentQuery.value
-    });
-    detailList.value = res.data?.records;
+    const queryParams = {
+      lawyerId: currentQuery.value,
+      pageNum: params.pageNum || 1,
+      pageSize: params.pageSize || 10
+    };
+    const res: any = await getLawyerDetails(queryParams);
+    return res;
   } catch (error) {
-    detailList.value = [];
     ElMessage.error("加载详情失败,请稍后重试");
+    throw error;
   }
 };
 
+const dataCallback = (data: any) => {
+  return {
+    list: data.records || [],
+    total: data.total || 0
+  };
+};
+
 const open = async (lawyerId: String) => {
   currentQuery.value = lawyerId;
   dialogShow.value = true;
-  await fetchDetails();
+  // 等待对话框显示后再刷新表格数据
+  await new Promise(resolve => setTimeout(resolve, 100));
+  proTable.value?.getTableList();
 };
 
 const handleClose = () => {
   dialogShow.value = false;
-  detailList.value = [];
   currentQuery.value = "";
 };