
diff --git a/src/views/customerManage/customerList/index.vue b/src/views/customerManage/customerList/index.vue
index ef9c61e..327ad6c 100644
--- a/src/views/customerManage/customerList/index.vue
+++ b/src/views/customerManage/customerList/index.vue
@@ -9,6 +9,7 @@
:data-callback="dataCallback"
row-key="advertiserId"
@row-click="handleRowClick"
+ @sort-change="handleSortChange"
>
@@ -94,6 +95,12 @@ const followUpInitParam = reactive({ customerId: "" as string | number, contactI
// 如果表格需要初始化请求参数,直接定义传给 ProTable
const initParam = reactive({});
+// 排序参数
+const sortParam = reactive({
+ orderBy: "",
+ asc: true
+});
+
// dataCallback 处理返回数据
const dataCallback = (data: any) => {
return {
@@ -105,9 +112,27 @@ const dataCallback = (data: any) => {
// 获取客户列表
const getTableList = (params: any) => {
let newParams = JSON.parse(JSON.stringify(params));
+ // 添加排序参数
+ if (sortParam.orderBy) {
+ newParams.orderBy = sortParam.orderBy;
+ newParams.asc = sortParam.asc;
+ }
return getCustomerList(newParams);
};
+// 排序变化处理
+const handleSortChange = ({ prop, order }: { prop: string; order: string | null }) => {
+ if (prop && order) {
+ sortParam.orderBy = prop;
+ sortParam.asc = order === "ascending";
+ } else {
+ sortParam.orderBy = "";
+ sortParam.asc = true;
+ }
+ // 刷新表格数据
+ proTable.value?.getTableList();
+};
+
// 获取跟进列表
const getFollowUpTableList = (params: any) => {
let newParams = JSON.parse(JSON.stringify(params));
@@ -118,27 +143,29 @@ const getFollowUpTableList = (params: any) => {
const columns = reactive[]>([
{
prop: "name",
- label: "客户名称",
+ label: "客户信息",
search: { el: "input" },
width: 280,
+ fixed: true,
+ sortable: "custom",
render: (scope: any) => {
return (
{scope.row.name}
-
ID:{scope.row.id}
+
ID: {scope.row.id}
);
}
},
- // { prop: "name", label: "客户名称", width: 160, search: { el: "input" }, isShow: false },
- { prop: "introducer", label: "介绍人", width: 160, search: { el: "input" } },
- { prop: "baseLocation", label: "base地", width: 160, search: { el: "input" } },
- { prop: "type", label: "客户类型", width: 160, enum: customerType, search: { el: "select" } },
- { prop: "createdAt", label: "创建时间", width: 160 },
+ // { prop: "name", label: "客户名称", width: 160, search: { el: "input" }, isShow: false, sortable: "custom" },
+ { prop: "introducer", label: "介绍人", width: 160, search: { el: "input" }, sortable: "custom" },
+ { prop: "baseLocation", label: "base地", width: 160, search: { el: "input" }, sortable: "custom" },
+ { prop: "type", label: "客户类型", width: 160, enum: customerType, search: { el: "select" }, sortable: "custom" },
+ { prop: "createdAt", label: "创建时间", width: 200 },
{ prop: "isValid", label: "是否有效", width: 160, enum: isValidType, search: { el: "select" } },
{ prop: "contactName", label: "联系人名称", width: 160, search: { el: "input" } },
- { prop: "nextRemindTime", label: "下次提醒时间", width: 200 },
- { prop: "lastFollowTime", label: "最后跟进时间", width: 200 },
+ { prop: "nextRemindTime", label: "下次提醒时间", width: 200, sortable: "custom" },
+ { prop: "latestFollowTime", label: "最后跟进时间", width: 200, sortable: "custom" },
{ prop: "operation", label: "操作", fixed: "right", width: 320 }
]);