tangning 8 ヶ月 前
コミット
220025f7fe

+ 18 - 10
src/views/account/overview/AddModal.vue

@@ -240,7 +240,7 @@
 
       const [
         registerForm,
-        { validate, getFieldsValue, resetFields, setFieldsValue, updateSchema },
+        { validate, getFieldsValue, resetFields, setFieldsValue, updateSchema, validateFields, scrollToField },
       ] = useForm({
         labelWidth: 120,
         schemas: [...Addschemas, ...schemas, ...remarkschemas],
@@ -324,7 +324,22 @@
         return arr || [];
       }
       async function handleConfirm() {
-        await validate();
+        try {
+          await validate();
+          createConfirm({
+            iconType: 'warning',
+            title: () => h('span', '温馨提示'),
+            content: () => h('span', `确定要${title.value}吗?`),
+            onOk: async () => {
+              handleSubmit();
+            },
+          });
+        } catch (error) {
+          console.log('validate', error);
+          let errorFields = error?.errorFields[0];
+          createMessage.error(errorFields?.errors[0]);
+          // scrollToField(errorFields.name[0])
+        }
         // let text = record.id ? `您确定给权益ID${record.id}续期${record.validTimeType == 1?'1月':'1年'}!`:`确定要${title.value}吗?`
         // createConfirm({
         //   iconType: 'warning',
@@ -337,14 +352,6 @@
         //     reload()
         //   },
         // });
-        createConfirm({
-          iconType: 'warning',
-          title: () => h('span', '温馨提示'),
-          content: () => h('span', `确定要${title.value}吗?`),
-          onOk: async () => {
-            handleSubmit();
-          },
-        });
       }
       const useTypeChange = (value) => {
         updateSchema([
@@ -375,6 +382,7 @@
           emit('update');
         } catch (error) {
           console.log('not passing', error);
+
         }
       };
       function handleVisibleChange(v) {

+ 3 - 3
src/views/empower/AddCameraModal.vue

@@ -20,7 +20,7 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { useMessage } from '/@/hooks/web/useMessage';
-  import { remarkschemas, Addschemas } from './data';
+  import { remarkschemas, Addschemas, newAddschemas } from './data';
   import { InvoiceRegister } from '/@/api/order';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { uploadApi } from '/@/api/product/index';
@@ -87,7 +87,7 @@
 
       const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
         labelWidth: 120,
-        schemas: [...Addschemas, ...schemas, ...remarkschemas],
+        schemas: [...newAddschemas, ...Addschemas, ...schemas, ...remarkschemas],
         showActionButtonGroup: false,
         actionColOptions: {
           span: 24,
@@ -155,7 +155,7 @@
       const handleSubmit = async () => {
         try {
           const params = await validate();
-          console.log('params', )
+          console.log('params', params)
           // let authorizeTime = params.authorizeTime.split('_');
           const apiData = {
             ...params,

+ 4 - 1
src/views/empower/data.ts

@@ -14,7 +14,7 @@ export const remarkschemas: FormSchema[] = [
     colProps: { span: 20 },
   },
 ];
-export const Addschemas: FormSchema[] = [
+export const newAddschemas: FormSchema[] = [
   {
     field: 'useType',
     component: 'ApiSelect',
@@ -140,6 +140,9 @@ export const Addschemas: FormSchema[] = [
       format: 'YYYY-MM-DD',
     },
   },
+];
+
+export const Addschemas: FormSchema[] = [
   {
     field: 'customerName',
     component: 'Input',

+ 3 - 3
src/views/invoice/data.tsx

@@ -59,7 +59,7 @@ export const columns: BasicColumn[] = [
     }
   },
   {
-    title: '发票抬头',
+    title: '客户名称',
     dataIndex: 'title',
     // slots: { customRender: 'orderType' },
     width: 150,
@@ -101,7 +101,7 @@ export const columns: BasicColumn[] = [
     width: 120,
   },
   {
-    title: '收件人电话',
+    title: '联系人电话',
     dataIndex: 'shipMobile',
     // slots: { customRender: 'orderStatus' },
     width: 110,
@@ -113,7 +113,7 @@ export const columns: BasicColumn[] = [
     width: 130,
   },
   {
-    title: '邮箱',
+    title: '接收邮箱',
     dataIndex: 'email',
     // slots: { customRender: 'orderStatus' },
     width: 150,