Browse Source

客户档案-名称/简称/曾用名-小写字母自动转为大写

jingbb 3 months ago
parent
commit
58272fbb23
1 changed files with 48 additions and 6 deletions
  1. 48 6
      src/views/cuspCode/CustomerProfile/CuspCustomerProfile.data.ts

+ 48 - 6
src/views/cuspCode/CustomerProfile/CuspCustomerProfile.data.ts

@@ -264,8 +264,22 @@ export const formSchema: FormSchema[] = [
     colProps: {span: 12},
     labelWidth: 250,
     required: true,
-    componentProps:{
-      AutoComplete:'off'
+    componentProps:  ({ formModel }) =>{
+      return {
+        AutoComplete:'off',
+        onblur: ({currentTarget}) => {
+          var stringLog = currentTarget.value;
+          var newString = ''
+          for (let i = 0; i < stringLog.length; i++) {
+              if( (/^[A-Za-z]$/.test(stringLog[i]))&&(/^[a-z]$/.test(stringLog[i]))){
+                newString=newString+stringLog[i].toUpperCase()
+              }else{
+                newString =newString+stringLog[i]
+              }
+          }
+          formModel.name = newString
+        },
+      }
     },
   },
   {
@@ -274,8 +288,22 @@ export const formSchema: FormSchema[] = [
     component: 'Input',
     labelWidth: 200,
     colProps: {span: 12},
-    componentProps:{
-      AutoComplete:'off'
+    componentProps:  ({ formModel }) =>{
+      return {
+        AutoComplete:'off',
+        onblur: ({currentTarget}) => {
+          var stringLog = currentTarget.value;
+          var newString = ''
+          for (let i = 0; i < stringLog.length; i++) {
+              if( (/^[A-Za-z]$/.test(stringLog[i]))&&(/^[a-z]$/.test(stringLog[i]))){
+                newString=newString+stringLog[i].toUpperCase()
+              }else{
+                newString =newString+stringLog[i]
+              }
+          }
+          formModel.abbreviation = newString
+        },
+      }
     },
   },
   {
@@ -284,8 +312,22 @@ export const formSchema: FormSchema[] = [
     component: 'Input',
     labelWidth: 250,
     colProps: {span: 12},
-    componentProps:{
-      AutoComplete:'off'
+    componentProps:  ({ formModel }) =>{
+      return {
+        AutoComplete:'off',
+        onblur: ({currentTarget}) => {
+          var stringLog = currentTarget.value;
+          var newString = ''
+          for (let i = 0; i < stringLog.length; i++) {
+              if( (/^[A-Za-z]$/.test(stringLog[i]))&&(/^[a-z]$/.test(stringLog[i]))){
+                newString=newString+stringLog[i].toUpperCase()
+              }else{
+                newString =newString+stringLog[i]
+              }
+          }
+          formModel.abbreviation = newString
+        },
+      }
     },
   },
   {