diff --git a/src/apps/AppMonitoringObject/Add.vue b/src/apps/AppMonitoringObject/Add.vue index df58615a..799c72c2 100644 --- a/src/apps/AppMonitoringObject/Add.vue +++ b/src/apps/AppMonitoringObject/Add.vue @@ -35,10 +35,8 @@ 选择人员
- - 请选择 - {{ userList[0].name }} - + +
@@ -75,7 +73,7 @@
+ placeholder-style="color: #999; font-size: 30rpx;" @input="changeIdNumber" :disabled="!!userList.length"/>
@@ -523,13 +521,11 @@ export default { }, watch: { userList: { - handler: function (newValue, oldValue) { + handler: function (v) { this.isEdit = true; - this.form.name = newValue[0].name; - this.form.idNumber = newValue[0].idNumber; - this.form.sex = this.form.idNumber.substr(16, 1) % 2 == 0 ? '1' : '0' - this.form.currentAreaId = newValue[0].currentAreaId - this.form.currentAreaName = newValue[0].currentAreaName + let {name, idNumber, currentAreaId, currentAreaName} = v?.[0] || {} + this.form = {...this.form, name, idNumber, currentAreaId, currentAreaName} + this.form.sex = this.idCardNoUtil.getIdCardInfo(idNumber)?.sex }, deep: true, }, @@ -565,9 +561,7 @@ export default { onShow() { document.title = this.id ? '编辑监测对象' : '添加监测对象' - console.log(this.userList); }, - methods: { rules() { return {