123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <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>
- <edit-customer-dialog
- v-model:visible="showEditCustomerDialog"
- :curRow="curRow"
- @success="fetchData"
- ></edit-customer-dialog>
- </div>
- </template>
- <script setup lang="jsx" name="CustomerManage">
- import { ref, reactive } from 'vue';
- import useFetchTable from '@/hooks/useFetchTable';
- import EditCustomerDialog from './edit-customer-dialog.vue';
- import { customerListApi } from '@/api/system';
- const showEditCustomerDialog = ref(false);
- const curRow = ref(null);
- const columns = [
- { colKey: 'id', title: '客户ID' },
- { colKey: 'name', title: '客户名称' },
- { colKey: 'type', title: '客户类型' },
- { colKey: 'province', title: '省份' },
- { colKey: 'city', title: '城市' },
- { colKey: 'area', title: '县区' },
- { colKey: 'address', title: '地址' },
- { colKey: 'manager', title: '客户经理' },
- { colKey: 'serviceName', title: '服务档位名称' },
- { colKey: 'roles', 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(customerListApi);
- 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 = () => {
- curRow.value = null;
- showEditCustomerDialog.value = true;
- };
- const handleImport = () => {
- console.log('import');
- };
- const handleDelete = (row) => {
- console.log(row);
- };
- const handleEdit = (row) => {
- console.log(row);
- curRow.value = row;
- showEditCustomerDialog.value = true;
- };
- </script>
- <style></style>
|