laiqi 1 год назад
Родитель
Сommit
47c3257629

+ 1 - 1
apps/web-ele/.env.production

@@ -1,7 +1,7 @@
 VITE_BASE=/
 
 # 接口地址
-VITE_GLOB_API_URL=/prod-api
+VITE_GLOB_API_URL=http://211.149.199.65:5012/
 
 # 是否开启压缩,可以设置为 none, brotli, gzip
 VITE_COMPRESS=none

+ 1 - 0
apps/web-ele/src/adapter/vxe-table.ts

@@ -9,6 +9,7 @@ import { useVbenForm } from './form';
 setupVbenVxeTable({
   configVxeTable: (vxeUI) => {
     vxeUI.setConfig({
+      emptyCell: '--',
       grid: {
         align: 'center',
         border: false,

+ 2 - 2
apps/web-ele/src/api/coupon/coupon1.ts

@@ -1,6 +1,6 @@
 import type { Coupon1Entity, PageConfig } from '@vben/types';
 
-import { adaptBackendRequest } from '@vben/utils';
+import { parseQueryValues } from '@vben/utils';
 
 import { requestClient } from '#/api/request';
 
@@ -27,7 +27,7 @@ export async function getCoupon1DetailApi(data: { couponid: string }) {
   return requestClient.post<any>(
     '/api/query/view?pagevalue=34',
     {
-      ...adaptBackendRequest(data),
+      ...parseQueryValues(data),
     },
     { formatData: true }, // 格式化返回数据
   );

+ 2 - 2
apps/web-ele/src/api/coupon/coupon2.ts

@@ -1,6 +1,6 @@
 import type { Coupon2Entity, PageConfig } from '@vben/types';
 
-import { adaptBackendRequest } from '@vben/utils';
+import { parseQueryValues } from '@vben/utils';
 
 import { requestClient } from '#/api/request';
 
@@ -27,7 +27,7 @@ export async function getCoupon2DetailApi(data: { coupon2sid: string }) {
   return requestClient.post<any>(
     '/api/query/view?pagevalue=39',
     {
-      ...adaptBackendRequest(data),
+      ...parseQueryValues(data),
     },
     { formatData: true }, // 格式化返回数据
   );

+ 2 - 2
apps/web-ele/src/api/orders/index.ts

@@ -1,6 +1,6 @@
 import type { OrdersEntity, PageConfig } from '@vben/types';
 
-import { adaptBackendRequest } from '@vben/utils';
+import { parseQueryValues } from '@vben/utils';
 
 import { requestClient } from '#/api/request';
 
@@ -27,7 +27,7 @@ export async function getOrdersDetailApi(data: { ordersid: string }) {
   return requestClient.post<any>(
     '/api/query/view?pagevalue=52',
     {
-      ...adaptBackendRequest(data),
+      ...parseQueryValues(data),
     },
     { formatData: true }, // 格式化返回数据
   );

+ 2 - 2
apps/web-ele/src/api/product/index.ts

@@ -1,6 +1,6 @@
 import type { PageConfig, ProductEntity } from '@vben/types';
 
-import { adaptBackendRequest } from '@vben/utils';
+import { parseQueryValues } from '@vben/utils';
 
 import { requestClient } from '#/api/request';
 
@@ -27,7 +27,7 @@ export async function getProductDetailApi(data: { productsid: string }) {
   return requestClient.post<any>(
     '/api/query/view?pagevalue=24',
     {
-      ...adaptBackendRequest(data),
+      ...parseQueryValues(data),
     },
     { formatData: true }, // 格式化返回数据
   );

+ 2 - 2
apps/web-ele/src/api/scqy/index.ts

@@ -1,6 +1,6 @@
 import type { PageConfig, ScqyEntity } from '@vben/types';
 
-import { adaptBackendRequest } from '@vben/utils';
+import { parseQueryValues } from '@vben/utils';
 
 import { requestClient } from '#/api/request';
 
@@ -26,7 +26,7 @@ export async function getScqyDetailApi(data: { scqyinfoid: string }) {
   return requestClient.post<any>(
     '/api/query/view?pagevalue=29',
     {
-      ...adaptBackendRequest(data),
+      ...parseQueryValues(data),
     },
     { formatData: true }, // 格式化返回数据
   );

+ 2 - 2
apps/web-ele/src/api/subsidyapplications/index.ts

@@ -1,6 +1,6 @@
 import type { PageConfig, SubsidyApplicationsEntity } from '@vben/types';
 
-import { adaptBackendRequest } from '@vben/utils';
+import { parseQueryValues } from '@vben/utils';
 
 import { requestClient } from '#/api/request';
 
@@ -39,7 +39,7 @@ export async function getSubsidyApplicationsDetailApi(data: {
   return requestClient.post<any>(
     '/api/query/view?pagevalue=47',
     {
-      ...adaptBackendRequest(data),
+      ...parseQueryValues(data),
     },
     { formatData: true }, // 格式化返回数据
   );

+ 2 - 2
apps/web-ele/src/api/user/index.ts

@@ -1,6 +1,6 @@
 import type { CustomerEntity, PageConfig } from '@vben/types';
 
-import { adaptBackendRequest } from '@vben/utils';
+import { parseQueryValues } from '@vben/utils';
 
 import { requestClient } from '#/api/request';
 
@@ -28,7 +28,7 @@ export async function getCustomerDetailApi(data: { usersid: string }) {
   return requestClient.post<any>(
     '/api/query/view?pagevalue=19',
     {
-      ...adaptBackendRequest(data),
+      ...parseQueryValues(data),
     },
     { formatData: true }, // 格式化返回数据
   );

+ 131 - 58
apps/web-ele/src/views/customer-manage/form.vue

@@ -30,7 +30,7 @@ const [BaseForm, baseFormApi] = useVbenForm({
   showDefaultActions: false,
   // 所有表单项共用,可单独在表单内覆盖
   commonConfig: {
-    labelWidth: 120,
+    labelWidth: 130,
     // 所有表单项
     componentProps: {
       class: 'w-full',
@@ -50,6 +50,20 @@ const [BaseForm, baseFormApi] = useVbenForm({
     // { title: '用户联系手机号', field: 'userscontactphone' },
     // { title: '用户联系邮箱', field: 'userscontactemail' },
     // { title: '用户联系地址', field: 'userscontactaddress' },
+    // { title: '备注', field: 'usersbz' },
+    // { title: '用户微信openid', field: 'usersopenid' },
+    // { title: '用户是否实名', field: 'usersauthstatus' },
+    // { title: '用户创建时间', field: 'usersdate' },
+    // { title: '用户类型', field: 'userstype' },
+    // { title: '法人代表电话(座机)', field: 'usersfrdbdh' },
+    // { title: '法人代表手机号', field: 'usersfrdbsjh' },
+    // { title: '销售手机号', field: 'usersxssjh' },
+    // { title: '销售电话(座机)', field: 'usersxsdh' },
+    // { title: '社会统一企业代码', field: 'usersshtyxydm' },
+    // { title: '企业注册地', field: 'userszcd' },
+    // { title: '传真', field: 'userscz' },
+    // { title: '备注', field: 'usersbz' },
+
     {
       component: 'Input',
       fieldName: 'usersname',
@@ -65,20 +79,14 @@ const [BaseForm, baseFormApi] = useVbenForm({
       fieldName: 'usersnature',
       label: '用户性质',
       componentProps: {
-        placeholder: '请输入用户性质',
+        placeholder: '请选择用户性质',
         allowClear: true,
         options: [
-          {
-            label: '用户',
-            value: '用户',
-          },
-          {
-            label: '渠道',
-            value: '渠道',
-          },
+          { label: '用户', value: '用户' },
+          { label: '渠道', value: '渠道' },
         ],
       },
-      rules: z.string().min(1, { message: '请输入用户性质' }),
+      rules: z.string().min(1, { message: '请选择用户性质' }),
     },
     {
       component: 'Select',
@@ -86,132 +94,197 @@ const [BaseForm, baseFormApi] = useVbenForm({
       label: '用户类型',
       defaultValue: '个人',
       componentProps: {
-        placeholder: '请输入用户类型',
+        placeholder: '请选择用户类型',
         allowClear: true,
         options: [
-          {
-            label: '个人',
-            value: '个人',
-          },
-          {
-            label: '企业',
-            value: '企业',
-          },
+          { label: '个人', value: '个人' },
+          { label: '企业', value: '企业' },
         ],
       },
-      rules: z.string().min(1, { message: '请输入用户类型' }),
+      rules: z.string().min(1, { message: '请选择用户类型' }),
     },
+    // 个人用户显示身份证号
     {
       component: 'Input',
       fieldName: 'usersidcardnumber',
-      label: '用户身份证号码',
+      label: '身份证号码',
       componentProps: {
-        placeholder: '请输入用户身份证号码',
+        placeholder: '请输入身份证号码',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户身份证号码' }),
+      rules: z.string().min(1, { message: '请输入身份证号码' }),
       dependencies: {
         if(values) {
-          return values.userstype && values.userstype === '个人';
+          return values.userstype === '个人';
         },
         triggerFields: ['userstype'],
       },
     },
+    // 企业用户显示的字段
     {
       component: 'Input',
-      fieldName: 'usersidcardnumber',
-      label: '纳税人识别号',
+      fieldName: 'usersshtyxydm',
+      label: '统一社会信用代码',
+      componentProps: {
+        placeholder: '请输入统一社会信用代码',
+        allowClear: true,
+      },
+      rules: z.string().min(1, { message: '请输入统一社会信用代码' }),
+      dependencies: {
+        if(values) {
+          return values.userstype === '企业';
+        },
+        triggerFields: ['userstype'],
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'userszcd',
+      label: '企业注册地',
       componentProps: {
-        placeholder: '请输入纳税人识别号',
+        placeholder: '请输入企业注册地',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入纳税人识别号' }),
       dependencies: {
         if(values) {
-          return values.userstype && values.userstype === '企业';
+          return values.userstype === '企业';
         },
         triggerFields: ['userstype'],
       },
     },
     {
       component: 'Input',
+      fieldName: 'usersfrdbdh',
+      label: '法人代表电话(座机)',
+      componentProps: {
+        placeholder: '请输入法人代表电话',
+        allowClear: true,
+      },
+      dependencies: {
+        if(values) {
+          return values.userstype === '企业';
+        },
+        triggerFields: ['userstype'],
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'usersfrdbsjh',
+      label: '法人代表手机号',
+      componentProps: {
+        placeholder: '请输入法人代表手机号',
+        allowClear: true,
+      },
+      dependencies: {
+        if(values) {
+          return values.userstype === '企业';
+        },
+        triggerFields: ['userstype'],
+      },
+    },
+    // 通用字段
+    {
+      component: 'Input',
       fieldName: 'usersbankname',
-      label: '用户开户银行名称',
+      label: '开户银行名称',
       componentProps: {
-        placeholder: '请输入用户开户银行名称',
+        placeholder: '请输入开户银行名称',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户开户银行名称' }),
+      rules: z.string().min(1, { message: '请输入开户银行名称' }),
     },
     {
       component: 'Input',
       fieldName: 'usersbanknumber',
-      label: '用户开户银行账号',
+      label: '开户银行账号',
       componentProps: {
-        placeholder: '请输入用户开户银行账号',
+        placeholder: '请输入开户银行账号',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户开户银行账号' }),
+      rules: z.string().min(1, { message: '请输入开户银行账号' }),
     },
     {
       component: 'Input',
       fieldName: 'usersphone',
-      label: '用户手机号',
+      label: '手机号',
       componentProps: {
-        placeholder: '请输入用户手机号',
+        placeholder: '请输入手机号',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户手机号' }),
+      rules: z.string().min(1, { message: '请输入手机号' }),
     },
     {
       component: 'Input',
       fieldName: 'usersemail',
-      label: '用户邮箱',
+      label: '邮箱',
       componentProps: {
-        placeholder: '请输入用户邮箱',
+        placeholder: '请输入邮箱',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户邮箱' }),
+      rules: z.string().email({ message: '请输入正确的邮箱格式' }),
     },
     {
       component: 'Input',
       fieldName: 'usersaddress',
-      label: '用户地址',
+      label: '地址',
       componentProps: {
-        placeholder: '请输入用户地址',
+        placeholder: '请输入地址',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户地址' }),
     },
     {
       component: 'Input',
       fieldName: 'userscontactphone',
-      label: '用户联系手机号',
+      label: '联系手机号',
       componentProps: {
-        placeholder: '请输入用户联系手机号',
+        placeholder: '请输入联系手机号',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户联系手机号' }),
     },
     {
       component: 'Input',
       fieldName: 'userscontactemail',
-      label: '用户联系邮箱',
+      label: '联系邮箱',
       componentProps: {
-        placeholder: '请输入用户联系邮箱',
+        placeholder: '请输入联系邮箱',
         allowClear: true,
       },
-      rules: z.string().min(1, { message: '请输入用户联系邮箱' }),
+      rules: z.string().email({ message: '请输入正确的邮箱格式' }),
     },
     {
       component: 'Input',
       fieldName: 'userscontactaddress',
-      label: '用户联系地址',
+      label: '联系地址',
+      componentProps: {
+        placeholder: '请输入联系地址',
+        allowClear: true,
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'userscz',
+      label: '传真',
+      componentProps: {
+        placeholder: '请输入传真',
+        allowClear: true,
+      },
+      dependencies: {
+        if(values) {
+          return values.userstype === '企业';
+        },
+        triggerFields: ['userstype'],
+      },
+    },
+    {
+      component: 'Input',
+      fieldName: 'usersbz',
+      label: '备注',
       componentProps: {
-        placeholder: '请输入用户联系地址',
+        placeholder: '请输入备注',
         allowClear: true,
+        type: 'textarea',
+        rows: 4,
       },
-      rules: z.string().min(1, { message: '请输入用户联系地址' }),
     },
   ],
 });
@@ -223,20 +296,20 @@ const [Modal, modalApi] = useVbenModal({
   },
   async onConfirm() {
     // 校验输入的数据
+    const formValues = await baseFormApi.getValues();
     const validate = await baseFormApi.validate();
     if (!validate.valid) {
       return;
     }
 
     try {
-      // 调用新增或编辑接口
       const apiMap = {
-        create: () => addCustomerApi(validate.values as CustomerEntity),
+        create: () => addCustomerApi(formValues as unknown as CustomerEntity),
         edit: () =>
           editCustomerApi({
-            ...validate.values,
+            ...formValues,
             'usersid.value': data.value.row.usersid,
-          } as any),
+          } as unknown as CustomerEntity),
       };
 
       if (formType.value === 'detail') {

+ 23 - 7
apps/web-ele/src/views/customer-manage/index.vue

@@ -5,6 +5,7 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
 
 import { Page, useVbenModal } from '@vben/common-ui';
 import { MdiDetail, MdiEdit } from '@vben/icons';
+import { parseQueryValues } from '@vben/utils';
 
 import { useVbenVxeGrid } from '#/adapter/vxe-table';
 import { getCustomerListApi } from '#/api/user';
@@ -38,6 +39,19 @@ const formOptions: VbenFormProps = {
         allowClear: true,
       },
     },
+    {
+      component: 'Select',
+      fieldName: 'usersnature',
+      label: '用户性质',
+      componentProps: {
+        placeholder: $t('ui.placeholder.select'),
+        allowClear: true,
+        options: [
+          { label: '用户', value: '用户' },
+          { label: '渠道', value: '渠道' },
+        ],
+      },
+    },
   ],
   wrapperClass: 'grid-cols-1 md:grid-cols-3 lg:grid-cols-5',
 };
@@ -68,25 +82,27 @@ const gridOptions: VxeGridProps<any> = {
         return await getCustomerListApi({
           pageindex: page.currentPage,
           rows: page.pageSize,
-          ...formValues,
+          ...parseQueryValues(formValues),
         });
       },
     },
   },
 
   columns: [
+    { title: '用户id', field: 'usersid' },
+    { title: '微信openid', field: 'usersopenid' },
     { title: '用户名称', field: 'usersname' },
     { title: '用户性质', field: 'usersnature' },
     { title: '用户类型', field: 'userstype' },
-    { title: '用户证件号码', field: 'usersidcardnumber' },
-    { title: '用户开户银行名称', field: 'usersbankname' },
-    { title: '用户开户银行账号', field: 'usersbanknumber' },
+    // { title: '用户证件号码', field: 'usersidcardnumber' },
+    // { title: '用户开户银行名称', field: 'usersbankname' },
+    // { title: '用户开户银行账号', field: 'usersbanknumber' },
     { title: '用户手机号', field: 'usersphone' },
     { title: '用户邮箱', field: 'usersemail' },
     { title: '用户地址', field: 'usersaddress' },
-    { title: '用户联系手机号', field: 'userscontactphone' },
-    { title: '用户联系邮箱', field: 'userscontactemail' },
-    { title: '用户联系地址', field: 'userscontactaddress' },
+    // { title: '用户联系手机号', field: 'userscontactphone' },
+    // { title: '用户联系邮箱', field: 'userscontactemail' },
+    // { title: '用户联系地址', field: 'userscontactaddress' },
     {
       title: '操作',
       field: 'action',

+ 10 - 10
apps/web-ele/src/views/product-manage/form.vue

@@ -53,6 +53,16 @@ const [BaseForm, baseFormApi] = useVbenForm({
     // { title: '机具类型', field: 'productsjjlx' },
     {
       component: 'Input',
+      fieldName: 'productsjjlx',
+      label: '机具类型',
+      componentProps: {
+        placeholder: '请输入机具类型',
+        allowClear: true,
+      },
+      rules: z.string().min(1, { message: '请输入机具类型' }),
+    },
+    {
+      component: 'Input',
       fieldName: 'productsname',
       label: '产品名称',
       componentProps: {
@@ -174,16 +184,6 @@ const [BaseForm, baseFormApi] = useVbenForm({
       },
       rules: z.number().min(0, { message: '请输入正确的特殊县中央补贴金额' }),
     },
-    {
-      component: 'Input',
-      fieldName: 'productsjjlx',
-      label: '机具类型',
-      componentProps: {
-        placeholder: '请输入机具类型',
-        allowClear: true,
-      },
-      rules: z.string().min(1, { message: '请输入机具类型' }),
-    },
   ],
 });
 

+ 1 - 1
apps/web-ele/src/views/product-manage/index.vue

@@ -66,6 +66,7 @@ const gridOptions: VxeGridProps<any> = {
   },
 
   columns: [
+    { title: '机具类型', field: 'productsjjlx' },
     { title: '产品名称', field: 'productsname' },
     { title: '产品类别', field: 'productscategory' },
     { title: '产品型号', field: 'productsmodel' },
@@ -83,7 +84,6 @@ const gridOptions: VxeGridProps<any> = {
       formatter: formatMoney,
       width: 150,
     },
-    { title: '机具类型', field: 'productsjjlx' },
     { title: '创建时间', field: 'productsdate' },
     {
       title: '操作',

+ 6 - 7
apps/web-ele/src/views/system-manage/data-dictionary/form.vue

@@ -4,7 +4,7 @@ import { computed, ref } from 'vue';
 import { useVbenModal } from '@vben/common-ui';
 
 import { useVbenForm, z } from '#/adapter/form';
-import { getCustomerDetailApi } from '#/api/customer-manage';
+// import { getCustomerDetailApi } from '#/api/customer-manage';
 
 const data = ref();
 
@@ -170,12 +170,11 @@ const [Modal, modalApi] = useVbenModal({
       }
 
       try {
-        modalApi.setState({ loading: true });
-        const detailData = await getCustomerDetailApi({
-          usersid: data.value.row.usersid,
-        });
-
-        baseFormApi.setValues(detailData);
+        // modalApi.setState({ loading: true });
+        // const detailData = await getCustomerDetailApi({
+        //   usersid: data.value.row.usersid,
+        // });
+        // baseFormApi.setValues(detailData);
       } catch {
         // console.log(error);
       }

+ 6 - 7
apps/web-ele/src/views/system-manage/menu-manage/form.vue

@@ -4,7 +4,7 @@ import { computed, ref } from 'vue';
 import { useVbenModal } from '@vben/common-ui';
 
 import { useVbenForm, z } from '#/adapter/form';
-import { getCustomerDetailApi } from '#/api/customer-manage';
+// import { getCustomerDetailApi } from '#/api/customer-manage';
 
 const data = ref();
 
@@ -170,12 +170,11 @@ const [Modal, modalApi] = useVbenModal({
       }
 
       try {
-        modalApi.setState({ loading: true });
-        const detailData = await getCustomerDetailApi({
-          usersid: data.value.row.usersid,
-        });
-
-        baseFormApi.setValues(detailData);
+        // modalApi.setState({ loading: true });
+        // const detailData = await getCustomerDetailApi({
+        //   usersid: data.value.row.usersid,
+        // });
+        // baseFormApi.setValues(detailData);
       } catch {
         // console.log(error);
       }

+ 6 - 7
apps/web-ele/src/views/system-manage/operation-logs/form.vue

@@ -4,7 +4,7 @@ import { computed, ref } from 'vue';
 import { useVbenModal } from '@vben/common-ui';
 
 import { useVbenForm, z } from '#/adapter/form';
-import { getCustomerDetailApi } from '#/api/customer-manage';
+// import { getCustomerDetailApi } from '#/api/customer-manage';
 
 const data = ref();
 
@@ -170,12 +170,11 @@ const [Modal, modalApi] = useVbenModal({
       }
 
       try {
-        modalApi.setState({ loading: true });
-        const detailData = await getCustomerDetailApi({
-          usersid: data.value.row.usersid,
-        });
-
-        baseFormApi.setValues(detailData);
+        // modalApi.setState({ loading: true });
+        // const detailData = await getCustomerDetailApi({
+        //   usersid: data.value.row.usersid,
+        // });
+        // baseFormApi.setValues(detailData);
       } catch {
         // console.log(error);
       }

+ 6 - 7
apps/web-ele/src/views/system-manage/role-manage/form.vue

@@ -4,7 +4,7 @@ import { computed, ref } from 'vue';
 import { useVbenModal } from '@vben/common-ui';
 
 import { useVbenForm, z } from '#/adapter/form';
-import { getCustomerDetailApi } from '#/api/customer-manage';
+// import { getCustomerDetailApi } from '#/api/customer-manage';
 
 const data = ref();
 
@@ -170,12 +170,11 @@ const [Modal, modalApi] = useVbenModal({
       }
 
       try {
-        modalApi.setState({ loading: true });
-        const detailData = await getCustomerDetailApi({
-          usersid: data.value.row.usersid,
-        });
-
-        baseFormApi.setValues(detailData);
+        // modalApi.setState({ loading: true });
+        // const detailData = await getCustomerDetailApi({
+        //   usersid: data.value.row.usersid,
+        // });
+        // baseFormApi.setValues(detailData);
       } catch {
         // console.log(error);
       }

+ 6 - 7
apps/web-ele/src/views/system-manage/user-manage/form.vue

@@ -4,7 +4,7 @@ import { computed, ref } from 'vue';
 import { useVbenModal } from '@vben/common-ui';
 
 import { useVbenForm, z } from '#/adapter/form';
-import { getCustomerDetailApi } from '#/api/customer-manage';
+// import { getCustomerDetailApi } from '#/api/customer-manage';
 
 const data = ref();
 
@@ -170,12 +170,11 @@ const [Modal, modalApi] = useVbenModal({
       }
 
       try {
-        modalApi.setState({ loading: true });
-        const detailData = await getCustomerDetailApi({
-          usersid: data.value.row.usersid,
-        });
-
-        baseFormApi.setValues(detailData);
+        // modalApi.setState({ loading: true });
+        // const detailData = await getCustomerDetailApi({
+        //   usersid: data.value.row.usersid,
+        // });
+        // baseFormApi.setValues(detailData);
       } catch {
         // console.log(error);
       }

+ 1 - 0
apps/web-ele/vite.config.mts

@@ -37,6 +37,7 @@ export default defineConfig(async () => {
             rewrite: (path) => path.replace(/^\/dev-api/, ''),
             // mock代理目标地址
             target: 'http://211.149.199.65:5012/',
+            // target: 'https://dz.kdboss.cn/',
             ws: true,
           },
         },

+ 30 - 6
packages/types/src/user.ts

@@ -9,9 +9,9 @@ interface UserInfo extends BasicUserInfo {
 // CREATE TABLE `users` (
 //   `usersid` varchar(50) NOT NULL COMMENT '用户id',
 //   `usersname` varchar(50) DEFAULT NULL COMMENT '用户名称',
-//   `usersnature` tinyint(2) DEFAULT NULL COMMENT '用户性质(用户/渠道)',
+//   `usersnature` varchar(50) DEFAULT NULL COMMENT '用户性质(用户/渠道)',
 //   `userssuperiorid` varchar(50) DEFAULT NULL COMMENT '用户关联上级id',
-//   `usersidcardnumber` varchar(50) DEFAULT NULL COMMENT '用户证件号码(个人用户-身份证号,企业-纳税号)',
+//   `usersidcardnumber` varchar(50) DEFAULT NULL COMMENT '用户证件号码',
 //   `usersbankname` varchar(50) DEFAULT NULL COMMENT '用户开户银行名称',
 //   `usersbanknumber` varchar(50) DEFAULT NULL COMMENT '用户开户银行账号',
 //   `usersphone` varchar(50) DEFAULT NULL COMMENT '用户手机号',
@@ -24,6 +24,14 @@ interface UserInfo extends BasicUserInfo {
 //   `usersauthstatus` tinyint(2) DEFAULT NULL COMMENT '用户是否实名(0:未认证,1:已认证)',
 //   `usersdate` datetime DEFAULT NULL COMMENT '用户创建时间',
 //   `userstype` varchar(50) DEFAULT NULL COMMENT '用户类型(个人/企业)\n)',
+//   `usersfrdbdh` varchar(50) DEFAULT NULL COMMENT '法人代表电话(座机)',
+//   `usersfrdbsjh` varchar(50) DEFAULT NULL COMMENT '法人代表手机号',
+//   `usersxssjh` varchar(50) DEFAULT NULL COMMENT '销售手机号',
+//   `usersxsdh` varchar(50) DEFAULT NULL COMMENT '销售电话(座机)',
+//   `usersshtyxydm` varchar(50) DEFAULT NULL COMMENT '社会统一企业代码',
+//   `userszcd` varchar(100) DEFAULT NULL COMMENT '企业注册地',
+//   `userscz` varchar(50) DEFAULT NULL COMMENT '传真',
+//   `usersbz` varchar(1000) DEFAULT NULL COMMENT '备注',
 //   PRIMARY KEY (`usersid`)
 // ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户信息';
 
@@ -32,13 +40,11 @@ type UserAuthStatusType = 0 | 1;
 
 interface CustomerEntity {
   /** 用户id */
-  usersid: number;
+  usersid: string;
   /** 用户名称 */
   usersname: string;
-  /** 用户类型 */
-  userstype: string;
   /** 用户性质 */
-  usersnature: number;
+  usersnature: string;
   /** 用户关联上级id */
   userssuperiorid: string;
   /** 用户证件号码 */
@@ -65,6 +71,24 @@ interface CustomerEntity {
   usersauthstatus: UserAuthStatusType;
   /** 用户创建时间 */
   usersdate: string;
+  /** 用户类型 */
+  userstype: string;
+  /** 法人代表电话(座机) */
+  usersfrdbdh: string;
+  /** 法人代表手机号 */
+  usersfrdbsjh: string;
+  /** 销售手机号 */
+  usersxssjh: string;
+  /** 销售电话(座机) */
+  usersxsdh: string;
+  /** 社会统一企业代码 */
+  usersshtyxydm: string;
+  /** 企业注册地 */
+  userszcd: string;
+  /** 传真 */
+  userscz: string;
+  /** 备注 */
+  usersbz: string;
 }
 
 export type { CustomerEntity, UserAuthStatusType, UserInfo };

+ 14 - 13
packages/utils/src/helpers/index.ts

@@ -9,19 +9,7 @@ export * from './storage';
 export * from './unmount-global-loading';
 
 /**
- * 适配后端接口请求
- * 将 {key: value} 转换为 {`${key}.value`: value}
- */
-export const adaptBackendRequest = (obj: Record<string, any>) => {
-  const result: Record<string, any> = {};
-  for (const key in obj) {
-    result[`${key}.value`] = obj[key];
-  }
-  return result;
-};
-
-/**
- * 后端json数据格式化
+ * 后端数据格式化为json数据
  * {
       "usersid": {
           "label": "用户id",
@@ -47,3 +35,16 @@ export const formatBackendJson = (obj: Record<string, any>) => {
   }
   return result;
 };
+
+/**
+ * 将请求的参数{key: value}转换为{key.value: value}  兼容  后端list的条件查询 和 详情请求
+ * @param obj
+ * @returns obj
+ */
+export const parseQueryValues = (obj: Record<string, any>) => {
+  const result: Record<string, any> = {};
+  for (const key in obj) {
+    result[`${key}.value`] = obj[key];
+  }
+  return result;
+};