check_update

20240205
luoJunYong.123 3 years ago
parent 588c7e3c3f
commit e443fc657f
  1. 11
      src/pages/manage/list/acceptanceDraft/invoice.vue
  2. 17
      src/pages/manage/list/cityWide/cityWideIn.vue
  3. 15
      src/pages/manage/list/cityWide/cityWideOut.vue
  4. 47
      src/utils/utilFunction.js

@ -11,13 +11,13 @@
<el-form ref="form" :model="form" label-width="140px">
<el-col :span="10" :offset="1">
<el-form-item prop="userName" label="出票人账号" required>
<el-input v-model="form.accountNumber"></el-input>
<el-input :value="form.accountNumber" @input="val => checkHanzi(val, form, 'accountNumber')"></el-input>
</el-form-item>
<el-form-item prop="userName" label="出票人名称">
<el-input v-model="form.accountName"></el-input>
</el-form-item>
<el-form-item prop="userName" label="收款人账号" required>
<el-input v-model="form.collectionNumber"></el-input>
<el-input :value="form.collectionNumber" @input="val => checkHanzi(val, form, 'collectionNumber')"></el-input>
</el-form-item>
<el-form-item prop="userName" label="收款人名称">
<el-input v-model="form.collectionName"></el-input>
@ -26,7 +26,7 @@
<el-input disabled v-model="form.currencyType"></el-input>
</el-form-item>
<el-form-item prop="userName" label="汇票号码" required>
<el-input v-model="form.moneyOrderNumber"></el-input>
<el-input :value="form.moneyOrderNumber" @input="val => checkHanzi(val, form, 'moneyOrderNumber')"></el-input>
</el-form-item>
<el-form-item label="到期日期" required>
<el-date-picker
@ -116,7 +116,7 @@
<script>
import { vername, vermob } from '@/utils/verify.js'
import { checkRequired, ismoney } from '@/utils/utilFunction.js'
import { checkRequired, ismoney, checkHanzi } from '@/utils/utilFunction.js'
export default {
name: 'index',
@ -159,7 +159,8 @@ export default {
console.log('校验成功')
}
},
ismoney: ismoney
ismoney: ismoney,
checkHanzi: checkHanzi
}
}
</script>

@ -13,7 +13,7 @@
<el-form ref="form" :model="form" label-width="150px">
<el-col :span="10" :offset="1">
<el-form-item label="本行收款账号" required>
<el-input v-model="form.shroffAccountNumber"></el-input>
<el-input :value="form.shroffAccountNumber" @input="val => checkHanzi(val, form, 'shroffAccountNumber')"></el-input>
</el-form-item>
<el-form-item label="金额" required>
<el-input :value="form.money" @input="val => ismoney(val, form, 'money')"></el-input>
@ -26,13 +26,13 @@
</el-date-picker>
</el-form-item>
<el-form-item label="他行收款户名">
<el-input v-model="form.otherAccountUsername"></el-input>
<el-input :value="form.otherAccountUsername" @input="val => checkHanzi(val, form, 'otherAccountUsername')"></el-input>
</el-form-item>
<el-form-item label="交换行号">
<el-input v-model="form.exchangeNumber"></el-input>
<el-input :value="form.exchangeNumber" @input="val => checkHanzi(val, form, 'exchangeNumber')"></el-input>
</el-form-item>
<el-form-item label="报单号">
<el-input v-model="form.customsNumber"></el-input>
<el-input :value="form.customsNumber" @input="val => checkHanzi(val, form, 'customsNumber')"></el-input>
</el-form-item>
<el-form-item label="收款户名" required>
<el-input v-model="form.accountUsername"></el-input>
@ -51,10 +51,10 @@
</el-select>
</el-form-item>
<el-form-item label="他行收款账号" required>
<el-input v-model="form.otherAccountNumber"></el-input>
<el-input :value="form.otherAccountNumber" @input="val => checkHanzi(val, form, 'otherAccountNumber')"></el-input>
</el-form-item>
<el-form-item label="凭证号码" required>
<el-input v-model="form.voucherNumber"></el-input>
<el-input :value="form.voucherNumber" @input="val => checkHanzi(val, form, 'voucherNumber')"></el-input>
</el-form-item>
<el-form-item label="交换行名">
<el-input v-model="form.exchangeName"></el-input>
@ -93,7 +93,7 @@
<script>
import { mapState } from 'vuex'
import { checkRequired, ismoney, inputListen } from '@/utils/utilFunction.js'
import { checkRequired, ismoney, inputListen, checkHanzi } from '@/utils/utilFunction.js'
export default {
name: 'index',
components:{},
@ -140,7 +140,8 @@ export default {
},
ismoney: ismoney,
inputListen: inputListen
inputListen: inputListen,
checkHanzi: checkHanzi
}
};
</script>

@ -13,7 +13,7 @@
<el-form ref="form" :model="form" label-width="150px">
<el-col :span="10" :offset="1">
<el-form-item label="本行收款账号" required>
<el-input v-model="form.shroffAccountNumber"></el-input>
<el-input :value="form.shroffAccountNumber" @input="val => checkHanzi(val, form, 'shroffAccountNumber')"></el-input>
</el-form-item>
<el-form-item label="金额" required>
<el-input :value="form.money" @input="val => ismoney(val, form, 'money')"></el-input>
@ -26,7 +26,7 @@
</el-date-picker>
</el-form-item>
<el-form-item label="他行收款户名">
<el-input v-model="form.otherAccountUsername"></el-input>
<el-input :value="form.otherAccountUsername" @input="val => checkHanzi(val, form, 'otherAccountUsername')"></el-input>
</el-form-item>
<el-form-item label="出票日期">
<el-date-picker
@ -36,7 +36,7 @@
</el-date-picker>
</el-form-item>
<el-form-item label="本行收款户名" required>
<el-input v-model="form.shroffAccountUsername"></el-input>
<el-input :value="form.shroffAccountUsername" @input="val => checkHanzi(val, form, 'shroffAccountUsername')" ></el-input>
</el-form-item>
</el-col>
<el-col :span="10" :offset="1">
@ -52,10 +52,10 @@
</el-select>
</el-form-item>
<el-form-item label="他行收款账号" required>
<el-input v-model="form.otherAccountNumber"></el-input>
<el-input :value="form.otherAccountNumber" @input="val => checkHanzi(val, form, 'otherAccountNumber')" ></el-input>
</el-form-item>
<el-form-item label="凭证号码" required>
<el-input v-model="form.voucherNumber"></el-input>
<el-input :value="form.voucherNumber" @input="val => checkHanzi(val, form, 'voucherNumber')" ></el-input>
</el-form-item>
<el-form-item label="摘要">
<el-input v-model="form.abstract"></el-input>
@ -91,7 +91,7 @@
<script>
import { mapState } from 'vuex'
import { checkRequired, ismoney, inputListen } from '@/utils/utilFunction.js'
import { checkRequired, ismoney, inputListen, checkHanzi } from '@/utils/utilFunction.js'
export default {
name: 'index',
components:{},
@ -136,7 +136,8 @@ export default {
},
ismoney: ismoney,
inputListen: inputListen
inputListen: inputListen,
checkHanzi: checkHanzi
}
};
</script>

@ -10,21 +10,26 @@ const mailBoxListen = function(val, form, prop) {
form[prop] = val;
}
}
const checkRequired = function(form, obj) {
for(const prop in obj) {
if(form[prop] === '') {
MessageBox.alert('请填写' + obj[prop], '提示', {
type: 'info',
confirmButtonText: '确定'
});
return false
// 校验中文
const checkHanzi = function(val, form, prop) {
// 检查空格
const tmpCheck = val.substr(val.length-1, 1);
if(tmpCheck === ' ') {
return;
}
if(!/[\u4E00-\u9FA5]/i.test(val)) {
form[prop] = val;
}
return true;
}
// 监听数字
const inputListen = function(val, row, prop) {
// 检查空格
const tmpCheck = val.substr(val.length-1, 1);
if(tmpCheck === ' ') {
return;
}
if(val === '') {
row[prop] = val;
return;
@ -33,7 +38,11 @@ const inputListen = function(val, row, prop) {
}
const ismoney = function(val, row, prop) {
// 检查空格
const tmpCheck = val.substr(val.length-1, 1);
if(tmpCheck === ' ') {
return;
}
// const reg = /([1-9]\d{0,9}|0)(\.\d{1,2})?$/ // 不用保留
const reg2 = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; // 保留小数点后两位
if (reg2.test(Number(val)) || val==='') {
@ -41,14 +50,24 @@ const ismoney = function(val, row, prop) {
}
}
/*
刷卡器逻辑
*/
const checkRequired = function(form, obj) {
for(const prop in obj) {
if(form[prop] === '') {
MessageBox.alert('请填写' + obj[prop], '提示', {
type: 'info',
confirmButtonText: '确定'
});
return false
}
}
return true;
}
export {
phoneListen,
mailBoxListen,
checkRequired,
inputListen,
ismoney
ismoney,
checkHanzi
}
Loading…
Cancel
Save