From 0ba94de45dfb5db51bceb104d68db1d7cca6f6a9 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 17 Mar 2022 10:46:41 +0800 Subject: [PATCH] BUG 28299 --- src/saas/AppSpecialPeople/add.vue | 78 ++++++++++++++----------------- 1 file changed, 35 insertions(+), 43 deletions(-) diff --git a/src/saas/AppSpecialPeople/add.vue b/src/saas/AppSpecialPeople/add.vue index 5ac785a7..99b10a1a 100644 --- a/src/saas/AppSpecialPeople/add.vue +++ b/src/saas/AppSpecialPeople/add.vue @@ -5,7 +5,7 @@ *类型
{{ + :class="form.userType === '' ? 'color-999' : ''">{{ $dict.getLabel('appSpecialTypeFive', form.userType) || '请选择' }} @@ -16,7 +16,7 @@
+ placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15" :clearable="false"/>
@@ -24,36 +24,36 @@
+ @input="changeIdNumber"/>
*性别
+ placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15" :clearable="false"/>
*出生日期
+ placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="19" :clearable="false"/>
*联系电话
+ placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="11" :clearable="false"/>
*所属区域
- + {{ form.areaName }} - 请选择 + 请选择
@@ -62,10 +62,10 @@ 详细地址
+ placeholder-style="color:#999;font-size:16px;" :maxlength="20" auto-height/>
- +
所属网格
@@ -83,7 +83,8 @@ {{ item.label }}
+ placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="item.maxlength" + :clearable="false"/>
@@ -91,7 +92,8 @@ {{ item.label }}
+ placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="item.maxlength" + :clearable="false"/>
@@ -99,7 +101,8 @@ {{ item.label }}
+ placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="item.maxlength" + :clearable="false" @input="changeMoney" style="font-size: 16px"/>
@@ -107,7 +110,7 @@ {{ item.label }}
{{ + :class="form[item.formDbName] === '' ? 'color-999' : ''">{{ $dict.getLabel(item.dict, form[item.formDbName]) || '请选择' }} @@ -117,7 +120,7 @@
{{ item.label }}
- {{ + {{ $dateFormat(form[item.formDbName], 'YYYY-MM-DD') || '请选择' }} @@ -128,7 +131,7 @@
请选择 @@ -395,9 +398,9 @@ export default { onLoad(o) { this.$dict.load('appSpecialSituation', 'appSpecialPlacement', 'appSpecialDenger', 'appSpecialCrime', 'appSpecialControl', 'appSpecialDebug', 'appSpecialDrug', 'appSpecialChangeType', 'appSpecialCure', 'appSpecialDengerLevel', - 'appSpecialDisableLevel', 'appSpecialDisableType', 'appSpecialHealth', 'appSpecialMarriage', 'appSpecialTypeFive','isReflection','yesOrNo').then(() => { + 'appSpecialDisableLevel', 'appSpecialDisableType', 'appSpecialHealth', 'appSpecialMarriage', 'appSpecialTypeFive', 'isReflection', 'yesOrNo').then(() => { }), - this.gridName() + this.gridName() if (o) { this.isEdit = true this.id = o.id @@ -432,23 +435,11 @@ export default { } }) }, - - changeIdNumber() { - if (this.form.idNumber.length != 18) { - return this.$u.toast('请输入正确的身份证号码') - } else { - var people = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber) - this.form.birth = people.birthday - this.form.gender = people.gender - - let reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; - if (!reg.test(this.form.idNumber)) { - return this.$u.toast('请输入正确的身份证号码') - } - } + let people = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber) + this.form.birth = people.birthday + this.form.gender = people.gender }, - changeMoney() { let moneyReg = /^([0-9]{1,5})(\.[0-9]{1,3}){0,1}$/ if (!moneyReg.test(this.form.income)) { @@ -484,7 +475,7 @@ export default { return this.$u.toast('请输入身份证号') } if ( - !/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber) + !/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber) ) { return this.$u.toast("请输入正确的身份证账号"); } @@ -495,35 +486,35 @@ export default { return this.$u.toast('请选择区域') } if (this.form.userType == 1) { - if (!/^([0-9]{1,5})(\.[0-9]{1,3}){0,1}$/.test(this.form.income)){ + if (!/^([0-9]{1,5})(\.[0-9]{1,3}){0,1}$/.test(this.form.income)) { return this.$u.toast('输入的数字不能超过10万') } } var urlList = ['app/appspecialdisabled/addOrUpdate', 'app/appspecialmental/addOrUpdate', 'app/appspecialadjustment/addOrUpdate', - 'app/appspecialdrug/addOrUpdate','app/appspecialprison/addOrUpdate'] + 'app/appspecialdrug/addOrUpdate', 'app/appspecialprison/addOrUpdate'] this.$http.post(urlList[this.form.userType], { ...this.form, id: this.isEdit ? this.id : '' - }).then(res => { - if(res.code == 0) { + }).then(res => { + if (res.code == 0) { this.$u.toast(this.isEdit ? '信息保存成功' : '信息提交成功') uni.$emit('specialPeopleList') setTimeout(() => { uni.navigateBack() }, 600) this.isEdit = !this.isEdit - } else if(res.code == 1) { + } else if (res.code == 1) { this.$u.toast('保存失败,信息未填写') } else { - this.$confirm('是否放弃编辑当前信息').then(()=>{ + this.$confirm('是否放弃编辑当前信息').then(() => { uni.navigateBack() }) } }) }, - areaSelect(e){ + areaSelect(e) { this.form.areaId = e }, @@ -579,6 +570,7 @@ export default { display: flex; justify-content: flex-end; font-size: 32px; + .u-icon { margin-left: 16px; } @@ -626,9 +618,9 @@ export default { } ::v-deep .uni-input-form, - ::v-deep .uni-textarea-textarea, + ::v-deep .uni-textarea-textarea, ::v-deep .uni-input-input, - ::v-deep .uni-input-placeholder, + ::v-deep .uni-input-placeholder, ::v-deep .uni-input-wrapper { font-size: 32px; }