From 2063528db72c21b80d20b99978e024831a5d077e Mon Sep 17 00:00:00 2001 From: "luoJunYong.123" Date: Fri, 17 Dec 2021 11:23:52 +0800 Subject: [PATCH] update --- src/assets/css/tablebg.scss | 1 + src/components/case/index.vue | 17 +-- src/pages/manage/index/index.vue | 17 ++- .../manage/list/client/consumerClient.vue | 137 ++++++++++++------ .../personal/callDeposits/openAccount.vue | 21 +-- src/utils/verify.js | 16 +- 6 files changed, 127 insertions(+), 82 deletions(-) diff --git a/src/assets/css/tablebg.scss b/src/assets/css/tablebg.scss index 2e90eaf..213ee9d 100644 --- a/src/assets/css/tablebg.scss +++ b/src/assets/css/tablebg.scss @@ -24,6 +24,7 @@ $inputHeight: 38px; .el-input { max-height: $mfFontSize!important; line-height: $mfFontSize; + max-width: $mfFontSize+20px; input { max-height: $inputHeight; max-width: $inputHeight+40px; diff --git a/src/components/case/index.vue b/src/components/case/index.vue index a7fd19f..6360481 100644 --- a/src/components/case/index.vue +++ b/src/components/case/index.vue @@ -208,7 +208,7 @@ export default { type: 'warning' }); // 提交 - this.sureSubmit(false) + this.sureSubmit(true) }else { } }) @@ -552,12 +552,6 @@ export default { type: 'success', message: '提交成功' }); - }else { - this.$confirm('考试已结束,已自动为您提交。', '提示', { - confirmButtonText: '确定', - type: 'info', - center: true - }) } this.requires = list } @@ -604,11 +598,10 @@ export default { this.minutes = `${m > 9 ? m : `0${m}`}`; this.seconds = `${s > 9 ? s : `0${s}`}`; } else { - this.$confirm('考试已结束,已自动为您提交。', '提示', { - confirmButtonText: '确定', - type: 'info', - center: true - }) + this.$alert('考试已结束,已自动为您提交。', '提示', { + confirmButtonText: '确定', + type: 'warning' + }); this.sss = 0 this.sureSubmit(true) this.day = '00'; diff --git a/src/pages/manage/index/index.vue b/src/pages/manage/index/index.vue index 72d99aa..98e5207 100644 --- a/src/pages/manage/index/index.vue +++ b/src/pages/manage/index/index.vue @@ -126,14 +126,21 @@ export default { // el-input变红 /deep/ .el-input input{ &:focus { - border-color: skyblue!important;; + border-color: skyblue; } } - /deep/ .el-input.need input.need{ - &:focus { - border-color: #f40; - } + + // 校验错误变红 + /deep/ .is-error input { + border-color: #f40!important;; } + // /deep/ .el-form-item__error { + // top: 105%; + // left: auto; + // right: 0; + // color: #FFA94E; + // } + @media screen and (min-width: 1200px) and (max-width: 1900px) { .box{ display: flex; diff --git a/src/pages/manage/list/client/consumerClient.vue b/src/pages/manage/list/client/consumerClient.vue index e7ac92a..4ac4eb3 100644 --- a/src/pages/manage/list/client/consumerClient.vue +++ b/src/pages/manage/list/client/consumerClient.vue @@ -8,7 +8,7 @@
- + @@ -20,10 +20,10 @@ - + - + 请刷身份证

- + - + @@ -126,8 +126,30 @@ export default { phone:'',//联系电话 }, rules: { - username: vername, - phone: vermob + userName: [ + { + required: true, + message: '请输入客户姓名', + trigger: 'blur' + }, + ...vername + ], + phone: [ + { + required: true, + message: '请输入联系电话', + trigger: 'blur' + }, + ...vermob + ], + birthday: [ + { + required: true, + message: '请输入出生日期', + trigger: 'blur' + } + ], + }, disForm:{name:'002009' ,pass:'123456'}, visible:false,// 表单 @@ -157,47 +179,72 @@ export default { }, //提交个人用户信息 submitForm(){ + this.$refs.form.validate((valid, obj) => { + console.log(valid) + console.log(obj) + let tmpObj = {}; + for(const key in obj) { + console.log(key) + tmpObj = { + key: obj[key] + } + return; + } + console.log(tmpObj) + if (valid) { + this.visible = true; + let formList = []; + if(this.form.nationality){ + formList.push({ + "emptyOne": "", + "emptyTwo": "", + "operationIds": "0,5,25,33,45", + "type": "" + }) + } + if(this.form.mailbox){ + formList.push({ + "emptyOne": "", + "emptyTwo": "", + "operationIds": "0,5,25,33,46", + "type": "" + }) + } + formList.push( + {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,40", "type": ""}, + {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,41,13", "type": ""}, + {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,42", "type": ""}, + {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,44", "type": ""}, + {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,47", "type": ""} + ); + sessionStorage.setItem('ruleReqs', JSON.stringify(formList)) + } else { + // 获取所有校验错误结果的第一项 + let tmpObj = {}; + for(const key in obj) { + tmpObj = { + [key]: obj[key] + } + return; + } + console.log(tmpObj) + // const requiredField = { + // // idNumber:'证件号码', + // userName:'客户姓名', + // sex:'性别', + // birthday:'出生日期', + // phone:'联系电话' + // } + // const judgeRef = checkRequired(this.form, requiredField) + // if(judgeRef !== '') { + // this.$refs[judgeRef].focus(); + // } + } + }); + return false let formExternalData = sessionStorage.getItem('formExternalData') let consumerClientDragList = JSON.parse(formExternalData); // - const requiredField = { - // idNumber:'证件号码', - userName:'客户姓名', - sex:'性别', - birthday:'出生日期', - phone:'联系电话' - } - const judgeRef = checkRequired(this.form, requiredField) - if(judgeRef === '') { - this.visible = true; - let formList = []; - if(this.form.nationality){ - formList.push({ - "emptyOne": "", - "emptyTwo": "", - "operationIds": "0,5,25,33,45", - "type": "" - }) - } - if(this.form.mailbox){ - formList.push({ - "emptyOne": "", - "emptyTwo": "", - "operationIds": "0,5,25,33,46", - "type": "" - }) - } - formList.push( - {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,40", "type": ""}, - {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,41,13", "type": ""}, - {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,42", "type": ""}, - {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,44", "type": ""}, - {"emptyOne": "", "emptyTwo": "", "operationIds": "0,5,25,33,47", "type": ""} - ); - sessionStorage.setItem('ruleReqs', JSON.stringify(formList)) - }else { - this.$refs[judgeRef].focus(); - } // if(this.form.idNumber && this.form.idNumber.userName && this.form.idNumber.sex && this.form.idNumber.birthday && this.form.idNumber.phone) { // this.visible = true; // let formList = []; diff --git a/src/pages/manage/list/personal/callDeposits/openAccount.vue b/src/pages/manage/list/personal/callDeposits/openAccount.vue index 1cdacfd..6719e36 100644 --- a/src/pages/manage/list/personal/callDeposits/openAccount.vue +++ b/src/pages/manage/list/personal/callDeposits/openAccount.vue @@ -13,22 +13,22 @@ - + - + - + - + @@ -38,10 +38,10 @@ - + - + @@ -51,7 +51,7 @@ - + @@ -112,8 +112,11 @@ export default{ depositTerm: '', // 存期 extendDepositTarget: '', // 续存标识 } - if(checkRequired(this.form, requiredField)) { - console.log('检验成功') + const judgeRef = checkRequired(this.form, requiredField) + if(judgeRef === '') { + console.log('submit success') + }else { + this.$refs[judgeRef].focus(); } }, diff --git a/src/utils/verify.js b/src/utils/verify.js index fc8cdf8..ede9e34 100644 --- a/src/utils/verify.js +++ b/src/utils/verify.js @@ -6,14 +6,10 @@ const vermail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2}) const vermob = [ { pattern: /^1[3456789][0-9]{9}$/, - message: '请输入正确的手机号', - trigger: 'blur' + message: '号码格式有误' }, { message: '请输入12位以下数字', max: 11 - },{ - required: true, - message: '请输入号码' } ] const vername = [ @@ -21,12 +17,9 @@ const vername = [ // pattern: /^[\u4e00-\u9fa5]{2,4}$/, // pattern: /^(?:[\u4e00-\u9fa5]+)(?:●[\u4e00-\u9fa5]+)*$|^[a-zA-Z0-9]+\s?[\.·\-()a-zA-Z]*[a-zA-Z]+$/, pattern: /(^[A-Z][a-z]*(\s[A-Z][a-z]*)*$)|(^[\u4e00-\u9fa5]{2,4}$)/, - message: '请输入正确的姓名' - },{ - required: true, - message: '请输入名字' + message: '名字格式有误' } -] +] const verrate = [ { // pattern: /\d{1,2}(\.\d{1,2})?/, @@ -35,7 +28,8 @@ const verrate = [ message: '请输入正确的年利率' },{ required: true, - message: '请输入年利率' + message: '请输入年利率', + trigger: blur } ] const requiremoney = [