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-form-item>
<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 label="交换行号" prop="exchangeNumber">
<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-form-item>
<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-col>
<el-col :span="10" :offset="1">
@ -94,7 +94,7 @@
<script>
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 {
name: 'index',
components:{},
@ -184,7 +184,8 @@ export default {
},
ismoney: ismoney,
inputListen: inputListen,
checkHanzi: checkHanzi
checkHanzi: checkHanzi,
checkName: checkName
}
};
</script>

@ -27,7 +27,7 @@
</el-date-picker>
</el-form-item>
<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 label="出票日期" prop="drawBillDate">
<el-date-picker
@ -38,7 +38,7 @@
</el-date-picker>
</el-form-item>
<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-col>
<el-col :span="10" :offset="1">
@ -93,7 +93,7 @@
<script>
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 {
name: 'index',
components:{},
@ -181,7 +181,8 @@ export default {
},
ismoney: ismoney,
inputListen: inputListen,
checkHanzi: checkHanzi
checkHanzi: checkHanzi,
checkName: checkName
}
};
</script>

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

Loading…
Cancel
Save