From 48355814bb047a04ed246a7699423d91c22ab355 Mon Sep 17 00:00:00 2001 From: song Date: Fri, 17 Dec 2021 17:34:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=9A=E5=A4=84bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +- rest/燕园.http | 2 +- src/apis/yanyuan.js | 3 + src/components/Info/Info.vue | 56 ++++-- src/config/yyInfo.js | 2 +- src/mixins/tool.js | 2 +- src/pages.json | 2 +- .../components/ConfigInfo/ConfigInfo.vue | 12 +- .../ConfigInfo/components/Caregiver.vue | 11 +- .../ConfigInfo/components/CaregiverDetail.vue | 33 +++- .../ConfigInfo/components/Medicine.vue | 12 +- .../ConfigInfo/components/MedicineDetail.vue | 178 +++++++++--------- .../components/NotEvaluated/NotEvaluated.vue | 46 +++-- src/pagesYanyuan/add-info/add-info.vue | 6 +- src/store/yanyuan/actions.js | 17 +- src/store/yanyuan/mutations.js | 9 + src/store/yanyuan/state.js | 1 + 17 files changed, 255 insertions(+), 140 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0d5f17..8c38ecd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-12-16) +# 0.1.0 (2021-12-17) ### 🌟 新功能 范围|描述|commitId @@ -160,6 +160,7 @@ - | 修改添加基本信息 压缩代码 | [ce20ff7](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/ce20ff7) - | 修改脑力测评+选项 展示问题 | [c0ccb4e](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/c0ccb4e) - | 修改角色栏组件 | [a54c601](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/a54c601) + - | 修改角色栏骨架屏 | [c18efb3](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/c18efb3) - | 切换到默认项目角色没有激活状态的bug | [438d448](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/438d448) - | 切换日历时查询小红点 | [7091789](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/7091789) - | 初始展示角色修改 | [2ac4053](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/2ac4053) diff --git a/rest/燕园.http b/rest/燕园.http index 773bd27..0ff8675 100644 --- a/rest/燕园.http +++ b/rest/燕园.http @@ -121,7 +121,7 @@ Authorization: Bearer {{login.response.body.$.data.token}} { "param":{ - "id":"2" + "id":"5" } } ###体验账号升级 diff --git a/src/apis/yanyuan.js b/src/apis/yanyuan.js index ab93c09..df758e3 100644 --- a/src/apis/yanyuan.js +++ b/src/apis/yanyuan.js @@ -29,6 +29,9 @@ const install = (Vue, vm) => { vm.$u.api.getQuestion = param => vm.$u.post(`${yanyuan}/question/get`, param); // 试题答案保存 vm.$u.api.saveAnswer = param => vm.$u.post(`${yanyuan}/question/saveAnswer`, param); + // 查询已经完成的试题编号 + vm.$u.api.finishNum = param => vm.$u.post(`${yanyuan}/question/finish`, param); + // 选择工具 vm.$u.api.mentalTestCalculate = param => vm.$u.post(`${yanyuan}/mentalTest/calculate`, param); diff --git a/src/components/Info/Info.vue b/src/components/Info/Info.vue index fcd2df7..1925ae0 100644 --- a/src/components/Info/Info.vue +++ b/src/components/Info/Info.vue @@ -329,6 +329,8 @@ v-model="colItem.show" @change="changeVal($event, index, itemIndex)" @backspace="backspace($event, index, itemIndex)" + @confirmText="confirmText(index, itemIndex)" + @cancelText="confirmText(index, itemIndex)" > @@ -347,7 +349,10 @@ import { infoList } from '@/config/yyInfo'; export default { name: 'Info', - props: { personalInfo: { type: Object, default: () => {} } }, + props: { + personalInfo: { type: Object, default: () => {} }, + isEdit: { type: Boolean, default: false }, + }, data() { return { @@ -365,7 +370,6 @@ export default { city: true, area: false, }, - isEdit: false, }; }, @@ -381,22 +385,40 @@ export default { }, }, + watch: { + personalInfo(val) { + if (val && val.userName) { + this.setDate(val); + } + }, + }, + mounted() { - if (this.personalInfo && this.personalInfo.userName) { - this.setDate(this.personalInfo); - this.isEdit = true; - } else { - const info = this.$t.storage.getStorageSync('infoList'); - if (info !== 'null') { - this.infoList = JSON.parse(info); + 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); + } } - } + }); }, methods: { changeVal(e, index, itemIndex) { const info = this.infoList[index][itemIndex]; - info.value += e; + + if (info.value === null) { + info.value = e.toString(); + } else { + if (typeof e === 'number') { + const str = e.toString(); + info.value += str; + } else { + info.value += e; + } + } if (this.isEdit) { this.updateTrainee(info); } @@ -410,6 +432,10 @@ export default { this.updateTrainee(info); } }, + confirmText(index, itemIndex) { + const info = this.infoList[index][itemIndex]; + info.show = false; + }, changeShow(index, itemIndex) { this.infoList[index][itemIndex].show = !this.infoList[index][itemIndex].show; @@ -431,7 +457,7 @@ export default { } case 5: { // 多选 - let checkerList = info.value; + let checkerList = info.value || []; if (checkerList.length) { const i = checkerList.findIndex(item => item === e.name || item.substring(0, 2) === e.name); if (i < 0) { @@ -498,11 +524,11 @@ export default { break; } } - - this.$t.storage.setStorageSync('infoList', this.infoList); - if (this.isEdit) { this.updateTrainee(info); + this.$t.storage.setStorageSync('infoList', null); + } else { + this.$t.storage.setStorageSync('infoList', this.infoList); } }, diff --git a/src/config/yyInfo.js b/src/config/yyInfo.js index cfb1d27..c755380 100644 --- a/src/config/yyInfo.js +++ b/src/config/yyInfo.js @@ -542,7 +542,7 @@ export const careInfo = [ label: 'carePeriod', showType: 2, type: 4, - value: null, + value: '', show: false, placeholder: '请输入照顾时长(月)', }, diff --git a/src/mixins/tool.js b/src/mixins/tool.js index 5616f7e..2018b42 100644 --- a/src/mixins/tool.js +++ b/src/mixins/tool.js @@ -158,7 +158,7 @@ export default { params = { keyUserIds: this.keyUserIds }; } await this.$u.api.applyFamily(params); - this.transferContent = '申请已提交'; + this.transferContent = '申请已提交,请等待审核'; } catch (error) { console.error('error: ', error); const msg = error.msg || '申请失败,稍后请重新申请'; diff --git a/src/pages.json b/src/pages.json index 46f9461..0bf296d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -40,7 +40,7 @@ { "path": "add-info/add-info", "style": { - "navigationBarTitleText": "基本信息", + "navigationBarTitleText": "长者信息", "navigationStyle": "default" } }, diff --git a/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue b/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue index df19cf6..b3088e2 100644 --- a/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue +++ b/src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue @@ -4,26 +4,26 @@ - - + + {{ item.head }} - + {{ personalInfo.userName }} - - + + - + diff --git a/src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue b/src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue index b2697e8..0ed7cab 100644 --- a/src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue +++ b/src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue @@ -1,7 +1,7 @@