|
@@ -0,0 +1,160 @@
|
|
|
+<template>
|
|
|
+ <div class="registration-query flex flex-col h-full">
|
|
|
+ <SearchForm :fields="fields" :params="params"></SearchForm>
|
|
|
+ <div class="flex-1 page-wrap">
|
|
|
+ <div class="btn-group">
|
|
|
+ <t-button theme="success" @click="handleAdd">新增</t-button>
|
|
|
+ <t-button theme="success" @click="handleImport">批量导入</t-button>
|
|
|
+ </div>
|
|
|
+ <t-table
|
|
|
+ size="small"
|
|
|
+ row-key="id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="tableData"
|
|
|
+ bordered
|
|
|
+ :pagination="{
|
|
|
+ defaultCurrent: 1,
|
|
|
+ defaultPageSize: 10,
|
|
|
+ onChange,
|
|
|
+ total: pagination.total,
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ </t-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="jsx" name="CustomerManage">
|
|
|
+import { ref, reactive } from 'vue';
|
|
|
+import { getTableData } from '@/api/test';
|
|
|
+import useFetchTable from '@/hooks/useFetchTable';
|
|
|
+
|
|
|
+const columns = [
|
|
|
+ { colKey: 'a', title: '客户ID' },
|
|
|
+ { colKey: 'b', title: '客户名称' },
|
|
|
+ { colKey: 'c', title: '客户类型' },
|
|
|
+ { colKey: 'd', title: '省份' },
|
|
|
+ { colKey: 'e', title: '城市' },
|
|
|
+ { colKey: 'f', title: '县区' },
|
|
|
+ { colKey: 'g', title: '地址' },
|
|
|
+ { colKey: 'h', title: '客户经理' },
|
|
|
+ { colKey: 'i', title: '服务档位名称' },
|
|
|
+ { colKey: 'j', title: '项目角色配置' },
|
|
|
+ { colKey: 'k', title: '标准人天' },
|
|
|
+ { colKey: 'l', title: '创建人' },
|
|
|
+ { colKey: 'm', title: '创建时间' },
|
|
|
+ {
|
|
|
+ title: '管理',
|
|
|
+ colKey: 'operate',
|
|
|
+ fixed: 'right',
|
|
|
+ width: 120,
|
|
|
+ align: 'center',
|
|
|
+ cell: (h, { row }) => {
|
|
|
+ return (
|
|
|
+ <div class="table-operations">
|
|
|
+ <t-link
|
|
|
+ theme="primary"
|
|
|
+ hover="color"
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ handleEdit(row);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </t-link>
|
|
|
+ <t-link
|
|
|
+ theme="danger"
|
|
|
+ hover="color"
|
|
|
+ onClick={(e) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ handleDelete(row);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </t-link>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+];
|
|
|
+const {
|
|
|
+ loading: tableLoading,
|
|
|
+ pagination,
|
|
|
+ tableData,
|
|
|
+ fetchData,
|
|
|
+ onChange,
|
|
|
+} = useFetchTable(getTableData);
|
|
|
+
|
|
|
+const refresh = async () => {};
|
|
|
+
|
|
|
+const fields = ref([
|
|
|
+ {
|
|
|
+ prop: 'a',
|
|
|
+ label: '客户类型',
|
|
|
+ type: 'select',
|
|
|
+ labelWidth: 100,
|
|
|
+ colSpan: 5,
|
|
|
+ options: [
|
|
|
+ { value: 1, label: '研究生' },
|
|
|
+ { value: 2, label: '高校教务处' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'b',
|
|
|
+ label: '客户经理',
|
|
|
+ type: 'select',
|
|
|
+ labelWidth: 100,
|
|
|
+ colSpan: 5,
|
|
|
+ options: [{ value: 1, label: '张三' }],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'd',
|
|
|
+ label: '客户名称',
|
|
|
+ labelWidth: 100,
|
|
|
+ colSpan: 5,
|
|
|
+ attrs: {
|
|
|
+ placeholder: '消息名称模糊查询',
|
|
|
+ clearable: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'b',
|
|
|
+ label: '服务档位',
|
|
|
+ type: 'select',
|
|
|
+ labelWidth: 100,
|
|
|
+ colSpan: 5,
|
|
|
+ options: [{ value: 1, label: '一档' }],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'buttons',
|
|
|
+ colSpan: 2,
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ type: 'button',
|
|
|
+ text: '查询',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+]);
|
|
|
+const params = reactive({
|
|
|
+ a: '',
|
|
|
+ b: '',
|
|
|
+ c: [],
|
|
|
+ d: '',
|
|
|
+});
|
|
|
+
|
|
|
+const handleAdd = () => {
|
|
|
+ console.log('add');
|
|
|
+};
|
|
|
+const handleImport = () => {
|
|
|
+ console.log('import');
|
|
|
+};
|
|
|
+const handleDelete = (row) => {
|
|
|
+ console.log(row);
|
|
|
+};
|
|
|
+const handleEdit = (row) => {
|
|
|
+ console.log(row);
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style></style>
|