From 14ad8ee302a31ed690cbf08ad4d682039428f7c5 Mon Sep 17 00:00:00 2001 From: song Date: Tue, 28 Dec 2021 15:32:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=8D=AF=E7=89=A9?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AE=B0=E5=BD=95=E9=AA=8C=E8=AF=81=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E9=A1=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/components/Info/Info.vue | 13 ++-- .../ConfigInfo/components/MedicineDetail.vue | 70 ++++++------------- 3 files changed, 31 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dd68c0..b2ac993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -187,6 +187,7 @@ - | 提示信息显示bug及日常任务收缩问题 | [f2f06c5](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/f2f06c5) - | 插件bug解决 | [41257eb](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/41257eb) - | 收到消息修改任务状态 | [c378063](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/c378063) + - | 新建长者信息清除数据 | [df5d3f4](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/df5d3f4) - | 日历无任务时添加小绿点,时间轴刻度无任务不显示时分 | [0f90868](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/0f90868) - | 日常任务html数据查验 | [880ce5c](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/880ce5c) - | 日常任务插件遍历时的key值修改 | [cd26285](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/cd26285) diff --git a/src/components/Info/Info.vue b/src/components/Info/Info.vue index 320793a..f12f58b 100644 --- a/src/components/Info/Info.vue +++ b/src/components/Info/Info.vue @@ -391,10 +391,13 @@ export default { this.$nextTick(() => { if (!this.isEdit) { this.$emit('setEmptyInfo'); - const info = this.$t.storage.getStorageSync('infoList'); - if (info !== 'null' && !this.isEdit) { - this.infoList = JSON.parse(info); - } + setTimeout(() => { + const info = this.$t.storage.getStorageSync('infoList'); + console.log('info: ', info); + if (info !== 'null') { + this.infoList = JSON.parse(info); + } + }, 300); } }); }, @@ -668,10 +671,8 @@ export default { const info = this.infoList[i]; for (let j = 0; j < info.length; j++) { const item = info[j]; - console.log('item: ', item); if (item.type !== 5) { if (item.value === null) { - console.log('item.name', item.name); this.$emit('showToast', 'default', `请填写${item.name}`, false); isComplete = false; break; diff --git a/src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue b/src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue index 1b788c6..816b8f9 100644 --- a/src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue +++ b/src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue @@ -132,7 +132,7 @@ export default { minute: true, second: true, }, - isShow: false, + isShow: true, originalValue: null, }; }, @@ -250,11 +250,11 @@ export default { try { const params = this.params; if (!this.validationRequired(params)) return; - params.projectId = this.projectId; - await this.$u.api.addMedicine(params); - this.$emit('showToast', 'success', '药物使用添加成功'); - this.show = false; - this.$emit('closeAdd'); + // params.projectId = this.projectId; + // await this.$u.api.addMedicine(params); + // this.$emit('showToast', 'success', '药物使用添加成功'); + // this.show = false; + // this.$emit('closeAdd'); } catch (error) { console.error('error: ', error); this.$emit('showToast', 'error', '药物使用添加失败'); @@ -268,55 +268,31 @@ export default { const info = this.medicineInfo[i]; for (let j = 0; j < info.date.length; j++) { const item = info.date[j]; - switch (item.type) { - case 2: { - if (this.isShow && !item.value) { - this.$emit('showToast', 'default', '请选择测评时间', false); - isComplete = false; - } + if (item.type === 2) { + if (this.isShow && !item.value) { + this.$emit('showToast', 'default', '请选择测评时间', false); + isComplete = false; break; } - case 3: { - if (this.isShow && !item.value) { - this.$emit('showToast', 'default', `请填写${item.name}`, false); - isComplete = false; - } + } else if (item.type === 3) { + if (this.isShow && !item.value) { + this.$emit('showToast', 'default', `请填写${item.name}`, false); + isComplete = false; break; } - case 4: { - if (!item.value && !item.checked) { - this.$emit('showToast', 'default', `请填写${item.name}`, false); - isComplete = false; - } + } else if (item.type === 4) { + if (!item.value && !item.checked) { + this.$emit('showToast', 'default', `请填写${item.name}`, false); + isComplete = false; break; } - default: { - if (!item.value) { - this.$emit('showToast', 'default', `请填写${item.name}`, false); - isComplete = false; - } + } else { + if (!item.value) { + this.$emit('showToast', 'default', `请填写${item.name}`, false); + isComplete = false; break; } } - // if (item.type === 2) { - // if (item.chooseTime && !item.value) { - // this.$t.ui.showToast(`请选择测评时间`); - // isComplete = false; - // break; - // } - // } else if (item.type === 4) { - // if (!item.value && !item.checked) { - // this.$t.ui.showToast(`请填写${item.name}`); - // isComplete = false; - // break; - // } - // } else { - // if (!item.value) { - // this.$t.ui.showToast(`请填写${item.name}`); - // isComplete = false; - // break; - // } - // } } if (!isComplete) { break; @@ -335,7 +311,7 @@ export default { for (let j = 0; j < info.date.length; j++) { const item = info.date[j]; if (item.type === 2) { - this.isShow = false; + this.isShow = true; } if (item.type === 4) { item.checked = false;