Просмотр исходного кода

✨ feat(contacts): 优化联系人编辑表单

- 移除联系人编辑表单中的冗余字段:ID、创建用户ID和创建时间
- 删除创建时间格式化代码,避免不必要的日期处理

✨ feat(order-records): 优化订单记录页面数据展示和表单

- 修改表格数据展示方式,通过关联对象获取公司名称、联系人和业务员信息
- 为关联字段添加默认显示"-",优化空数据展示效果
- 优化搜索框提示文字,明确仅支持订单编号搜索
- 移除订单表单中的冗余字段:公司名称、联系人姓名和业务员姓名
- 通过选择器组件替代手动输入,提升数据准确性和用户体验
yourname 8 месяцев назад
Родитель
Сommit
c1ab240671
2 измененных файлов с 10 добавлено и 61 удалено
  1. 0 30
      src/client/admin/pages/Contacts.tsx
  2. 10 31
      src/client/admin/pages/OrderRecords.tsx

+ 0 - 30
src/client/admin/pages/Contacts.tsx

@@ -101,8 +101,6 @@ const Contacts: React.FC = () => {
         alww: record.alww,
         birthday: record.birthday ? dayjs(record.birthday) : null,
         description: record.description,
-        createdUserId: record.createdUserId,
-        createdTime: record.createdTime ? dayjs(record.createdTime) : null,
       });
     } else {
       setEditingKey(null);
@@ -173,7 +171,6 @@ const Contacts: React.FC = () => {
       
       // 处理日期字段
       if (values.birthday) values.birthday = values.birthday.format('YYYY-MM-DD');
-      if (values.createdTime) values.createdTime = values.createdTime.format('YYYY-MM-DD HH:mm:ss');
       
       if (editingKey) {
         // 更新操作
@@ -300,16 +297,6 @@ const Contacts: React.FC = () => {
         width={800}
       >
         <Form form={form} layout="vertical">
-          {!editingKey && (
-            <Form.Item
-              name="id"
-              label="联系人ID"
-              rules={[{ required: true, message: '请输入联系人ID' }]}
-            >
-              <Input placeholder="请输入联系人ID" />
-            </Form.Item>
-          )}
-          
           <Form.Item
             name="clientId"
             label="客户"
@@ -407,13 +394,6 @@ const Contacts: React.FC = () => {
             >
               <DatePicker format="YYYY-MM-DD" />
             </Form.Item>
-            
-            <Form.Item
-              name="createdUserId"
-              label="创建用户ID"
-            >
-              <Input placeholder="请输入创建用户ID" />
-            </Form.Item>
           </div>
           
           <Form.Item
@@ -422,16 +402,6 @@ const Contacts: React.FC = () => {
           >
             <Input.TextArea rows={4} placeholder="请输入详细信息" />
           </Form.Item>
-          
-          {!editingKey && (
-            <Form.Item
-              name="createdTime"
-              label="创建时间"
-              rules={[{ required: true, message: '请选择创建时间' }]}
-            >
-              <DatePicker showTime format="YYYY-MM-DD HH:mm:ss" />
-            </Form.Item>
-          )}
         </Form>
       </Modal>
     </div>

+ 10 - 31
src/client/admin/pages/OrderRecords.tsx

@@ -36,9 +36,10 @@ const OrderRecords: React.FC = () => {
     },
     {
       title: '公司名称',
-      dataIndex: 'companyName',
-      key: 'companyName',
+      dataIndex: ['client', 'companyName'],
+      key: 'client.companyName',
       width: 200,
+      render: (text: string) => text || '-',
     },
     {
       title: '订单编号',
@@ -48,9 +49,10 @@ const OrderRecords: React.FC = () => {
     },
     {
       title: '联系人',
-      dataIndex: 'contactPerson',
-      key: 'contactPerson',
+      dataIndex: ['linkman', 'name'],
+      key: 'linkman.name',
       width: 100,
+      render: (text: string) => text || '-',
     },
     {
       title: '下单日期',
@@ -100,9 +102,10 @@ const OrderRecords: React.FC = () => {
     },
     {
       title: '业务员',
-      dataIndex: 'salesperson',
-      key: 'salesperson',
+      dataIndex: ['user', 'name'],
+      key: 'user.name',
       width: 100,
+      render: (text: string) => text || '-',
     },
     {
       title: '录入时间',
@@ -302,7 +305,7 @@ const OrderRecords: React.FC = () => {
       <div className="mb-6 p-4 bg-gray-50 rounded-lg">
         <Form form={searchForm} layout="inline">
           <Form.Item name="keyword" label="关键词">
-            <Input placeholder="公司名称/订单编号/联系人" />
+            <Input placeholder="订单编号" />
           </Form.Item>
           <Form.Item name="orderDate" label="下单日期">
             <RangePicker />
@@ -351,14 +354,6 @@ const OrderRecords: React.FC = () => {
         destroyOnClose
       >
         <Form form={form} layout="vertical">
-          <Form.Item
-            name="companyName"
-            label="公司名称"
-            rules={[{ required: true, message: '请输入公司名称' }]}
-          >
-            <Input placeholder="请输入公司名称" />
-          </Form.Item>
-          
           <Form.Item
             name="clientId"
             label="选择客户"
@@ -382,14 +377,6 @@ const OrderRecords: React.FC = () => {
             <LinkmanSelect placeholder="请选择联系人" />
           </Form.Item>
           
-          <Form.Item
-            name="contactPerson"
-            label="联系人"
-            rules={[{ required: true, message: '请输入联系人姓名' }]}
-          >
-            <Input placeholder="请输入联系人姓名" />
-          </Form.Item>
-          
           <Form.Item
             name="userId"
             label="选择业务员"
@@ -398,14 +385,6 @@ const OrderRecords: React.FC = () => {
             <UserSelect placeholder="请选择业务员" />
           </Form.Item>
           
-          <Form.Item
-            name="salesperson"
-            label="业务员姓名"
-            rules={[{ required: true, message: '请输入业务员姓名' }]}
-          >
-            <Input placeholder="请输入业务员姓名" />
-          </Form.Item>
-          
           <Form.Item
             name="orderDate"
             label="下单日期"