表单
This commit is contained in:
@@ -60,9 +60,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-btn">
|
||||
<div class="confirm" @click="confirm('保存成功')">保存内容</div>
|
||||
<!-- <div class="confirm" @click="confirm('保存成功')">保存内容</div> -->
|
||||
<div class="confirm" @click="confirm('提交成功')">提交</div>
|
||||
<div class="cancel">取消</div>
|
||||
<div class="cancel" @click="back">返回录制</div>
|
||||
</div>
|
||||
<u-picker mode="time" v-model="showDate" :params="deteParams" start-year="1930" @confirm="dateConfirm">请选择</u-picker>
|
||||
<u-select v-model="showSex" :list="$dict.getDict('sex')" label-name="dictName" value-name="dictValue" @confirm="confirmSex"/>
|
||||
@@ -89,9 +89,9 @@ export default {
|
||||
...mapState(['user']),
|
||||
},
|
||||
onLoad(option) {
|
||||
this.word = option.word
|
||||
this.info = JSON.parse(option.info)
|
||||
this.$dict.load('sex', 'nation').then(() => {
|
||||
this.getInfo()
|
||||
// this.getInfo()
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
@@ -99,7 +99,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getInfo() {
|
||||
uni.showLoading({title: '加载中'})
|
||||
uni.showLoading({title: '读取中'})
|
||||
this.$http.post(`/app/appbaiduai/queryByInfo?word=${this.word}`).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.info = {...res.data}
|
||||
@@ -120,25 +120,28 @@ export default {
|
||||
this.info.birthday = `${e.year}-${e.month}-${e.day}`
|
||||
},
|
||||
confirm(successText) {
|
||||
if(this.info.name == null || !this.info.name) {
|
||||
return this.$u.toast('请输入户主姓名')
|
||||
}
|
||||
if(this.info.sex == null) {
|
||||
return this.$u.toast('请选择性别')
|
||||
}
|
||||
if(this.info.phone == null || !this.info.phone) {
|
||||
return this.$u.toast('请输入联系电话')
|
||||
}
|
||||
if(this.info.birthday == null) {
|
||||
return this.$u.toast('请选择出生日期')
|
||||
}
|
||||
if(this.info.nation == null) {
|
||||
return this.$u.toast('请选择民族')
|
||||
}
|
||||
if(this.info.householdNumber == null || !this.info.householdNumber) {
|
||||
return this.$u.toast('请输入家庭人口数')
|
||||
}
|
||||
// if(this.info.name == null || !this.info.name) {
|
||||
// return this.$u.toast('请输入户主姓名')
|
||||
// }
|
||||
// if(this.info.sex == null) {
|
||||
// return this.$u.toast('请选择性别')
|
||||
// }
|
||||
// if(this.info.phone == null || !this.info.phone) {
|
||||
// return this.$u.toast('请输入联系电话')
|
||||
// }
|
||||
// if(this.info.birthday == null) {
|
||||
// return this.$u.toast('请选择出生日期')
|
||||
// }
|
||||
// if(this.info.nation == null) {
|
||||
// return this.$u.toast('请选择民族')
|
||||
// }
|
||||
// if(this.info.householdNumber == null || !this.info.householdNumber) {
|
||||
// return this.$u.toast('请输入家庭人口数')
|
||||
// }
|
||||
this.$u.toast(successText)
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack({delta: 2})
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -227,5 +230,8 @@ uni-page-body {
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
}
|
||||
::v-deep .u-input__right-icon {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user