20240205
luoJunYong.123 3 years ago
parent cd068026ed
commit dd440f90c4
  1. 9
      src/pages/manage/list/cityWide/cityWideIn.vue
  2. 9
      src/pages/manage/list/cityWide/cityWideOut.vue
  3. 13
      src/utils/utilFunction.js

@ -27,7 +27,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="他行收款户名" prop="otherAccountUsername"> <el-form-item label="他行收款户名" prop="otherAccountUsername">
<el-input :value="form.otherAccountUsername" @input="val => checkHanzi(val, form, 'otherAccountUsername')" ref="otherAccountUsername"></el-input> <el-input :value="form.otherAccountUsername" @input="val => checkName(val, form, 'otherAccountUsername')" ref="otherAccountUsername"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="交换行号" prop="exchangeNumber"> <el-form-item label="交换行号" prop="exchangeNumber">
<el-input :value="form.exchangeNumber" @input="val => checkHanzi(val, form, 'exchangeNumber')" ref="exchangeNumber"></el-input> <el-input :value="form.exchangeNumber" @input="val => checkHanzi(val, form, 'exchangeNumber')" ref="exchangeNumber"></el-input>
@ -36,7 +36,7 @@
<el-input :value="form.customsNumber" @input="val => checkHanzi(val, form, 'customsNumber')" ref="customsNumber"></el-input> <el-input :value="form.customsNumber" @input="val => checkHanzi(val, form, 'customsNumber')" ref="customsNumber"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收款户名" prop="accountUsername"> <el-form-item label="收款户名" prop="accountUsername">
<el-input :value="form.accountUsername" @input="val => checkHanzi(val, form, 'accountUsername')" ref="accountUsername"></el-input> <el-input :value="form.accountUsername" @input="val => checkName(val, form, 'accountUsername')" ref="accountUsername"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10" :offset="1"> <el-col :span="10" :offset="1">
@ -94,7 +94,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { myValidate, ismoney, inputListen, checkHanzi } from '@/utils/utilFunction.js' import { myValidate, ismoney, inputListen, checkHanzi, checkName } from '@/utils/utilFunction.js'
export default { export default {
name: 'index', name: 'index',
components:{}, components:{},
@ -184,7 +184,8 @@ export default {
}, },
ismoney: ismoney, ismoney: ismoney,
inputListen: inputListen, inputListen: inputListen,
checkHanzi: checkHanzi checkHanzi: checkHanzi,
checkName: checkName
} }
}; };
</script> </script>

@ -27,7 +27,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="他行收款户名" prop="otherAccountUsername"> <el-form-item label="他行收款户名" prop="otherAccountUsername">
<el-input :value="form.otherAccountUsername" @input="val => checkHanzi(val, form, 'otherAccountUsername')" ref="otherAccountUsername"></el-input> <el-input :value="form.otherAccountUsername" @input="val => checkName(val, form, 'otherAccountUsername')" ref="otherAccountUsername"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="出票日期" prop="drawBillDate"> <el-form-item label="出票日期" prop="drawBillDate">
<el-date-picker <el-date-picker
@ -38,7 +38,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="本行收款户名" prop="shroffAccountUsername"> <el-form-item label="本行收款户名" prop="shroffAccountUsername">
<el-input :value="form.shroffAccountUsername" @input="val => checkHanzi(val, form, 'shroffAccountUsername')" ref="shroffAccountUsername"></el-input> <el-input :value="form.shroffAccountUsername" @input="val => checkName(val, form, 'shroffAccountUsername')" ref="shroffAccountUsername"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10" :offset="1"> <el-col :span="10" :offset="1">
@ -93,7 +93,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { myValidate, ismoney, inputListen, checkHanzi } from '@/utils/utilFunction.js' import { myValidate, ismoney, inputListen, checkHanzi, checkName } from '@/utils/utilFunction.js'
export default { export default {
name: 'index', name: 'index',
components:{}, components:{},
@ -181,7 +181,8 @@ export default {
}, },
ismoney: ismoney, ismoney: ismoney,
inputListen: inputListen, inputListen: inputListen,
checkHanzi: checkHanzi checkHanzi: checkHanzi,
checkName: checkName
} }
}; };
</script> </script>

@ -25,11 +25,16 @@ const checkHanzi = function(val, form, prop) {
} }
const checkName = function(val, form, prop) { const checkName = function(val, form, prop) {
// // 检查符号 // 检查符号
const charReg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im; const charReg = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im;
// // 检查空格 // // 检查数字
// const tmpCheck = val.substr(val.length-1, 1); const charReg2 = /^[0-9]*$/;
if(charReg.test(val)) { const tmpCheck = val.substr(val.length-1, 1);
if(val.length<form[prop].length) {
form[prop] = val;
return;
}
if(charReg.test(val) || charReg2.test(tmpCheck)) {
return; return;
} }
form[prop] = val; form[prop] = val;

Loading…
Cancel
Save