Browse Source

fix: 解决error

develop
song 4 years ago
parent
commit
00d96c42cf
  1. 3
      CHANGELOG.md
  2. 2
      src/components/Info/Info.vue
  3. 11
      src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue
  4. 48
      src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue
  5. 12
      src/pagesProject/project/components/ConfigInfo/components/Medicine.vue
  6. 15
      src/pagesYanyuan/assess/assess.vue

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-12-17)
# 0.1.0 (2021-12-20)
### 🌟 新功能
范围|描述|commitId
@ -161,6 +161,7 @@
- | 修改脑力测评+选项 展示问题 | [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)
- | 修改试题查询判断 | [4128f3d](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/4128f3d)
- | 切换到默认项目角色没有激活状态的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)

2
src/components/Info/Info.vue

@ -262,7 +262,7 @@
<view v-if="colItem.type === 4">
<view @click="changeShow(index, itemIndex)" class="text-sm">
<text :class="colItem.value ? '' : 'text-gray-350'">{{ colItem.value || '请选择' }} </text>
<u-icon name="arrow-right" class="mx-2" color="#909399"></u-icon>
<u-icon name="arrow-right" class="ml-2" color="#909399"></u-icon>
</view>
<u-select
v-model="colItem.show"

11
src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue

@ -1,7 +1,7 @@
<template>
<view>
<CaregiverDetail :detail="zaritDetail" :disabled="false" @showToast="showToast" v-if="show" @closeAdd="closeAdd" />
<view v-if="!loading">
<view>
<view v-for="(item, index) in itemList" :key="index" :style="headStyle" class="py-3">
<!-- 头部 -->
<view class="w-full flex flex-row items-center justify-between text-sm text-gray-500" @click="changeOpen(index)">
@ -25,20 +25,16 @@
</view>
</view>
</view>
<view v-else>
<skeleton :banner="false" :loading="true" :row="7" title="随访" animate class="my-2 u-line-2 skeleton"></skeleton>
</view>
</view>
</template>
<script>
import { mapState, mapGetters, mapMutations } from 'vuex';
import CaregiverDetail from './CaregiverDetail';
import Skeleton from '../../Skeleton/Skeleton';
export default {
name: 'Info',
components: { CaregiverDetail, Skeleton },
components: { CaregiverDetail },
data() {
return {
show: false,
@ -50,7 +46,6 @@ export default {
},
index: 0,
zaritDetail: null,
loading: false,
};
},
@ -117,10 +112,8 @@ export default {
*/
async queryZaritList() {
try {
this.loading = true;
const params = { projectId: this.projectId };
const date = await this.$u.api.queryZaritList(params);
this.loading = false;
if (!date.length) {
await this.queryZaritHistory();
} else {

48
src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue

@ -78,7 +78,7 @@
</view>
<view v-else :key="itemIndex">
<view class="flex justify-between text-sm py-3 px-4 border-b items-center">
<view class="flex justify-between text-sm py-3 border-b items-center">
{{ colItem.name }}
<view>{{ colItem.value }}</view>
</view>
@ -86,8 +86,10 @@
</template>
</view>
<view class="p-4">
<u-button type="primary" @click="submit(0)" v-if="!disabled">开始填表</u-button>
<u-button type="primary" @click="submit(1)" v-if="disabled && detail.zaritPoint === null">继续填表</u-button>
<u-button type="primary" @click="submit" v-if="!disabled">开始填表</u-button>
<u-button type="primary" @click="handleFinishNum(detail.id)" v-if="disabled && detail.zaritPoint === null && detail.selfFill === 1">
继续填表
</u-button>
</view>
</view>
</template>
@ -128,7 +130,7 @@ export default {
methods: {
...mapMutations('yanyuan', ['setCode', 'setReportId']),
...mapActions('yanyuan', ['handleQuestion']),
...mapActions('yanyuan', ['handleQuestion', 'getFinishNum']),
changeVal(e, index, itemIndex) {
const info = this.careInfo[index][itemIndex];
@ -214,16 +216,14 @@ export default {
* 添加负担量表
* @param { Object } params
*/
async submit(type) {
async submit() {
try {
if (!this.validationRequired(this.params)) return;
const params = this.params;
params.projectId = this.projectId;
const data = await this.$u.api.addZarit(params);
if (data) {
this.setReportId(data);
this.setCode('ZARIT');
await this.startAssess(data, type);
await this.handleFinishNum(data);
}
} catch (error) {
console.error('error: ', error);
@ -268,20 +268,46 @@ export default {
}
},
/**
* 查询已经完成的试题编号
* @param { string } code 题目code NLCP:脑力测评 ZARIT:照顾者负担量表
* @param { string } reportId 测评ID 脑力测评ID或zaritID
*/
async handleFinishNum(id) {
try {
this.setReportId(id);
this.setCode('ZARIT');
const params = {
code: 'ZARIT',
reportId: id,
};
const data = await this.getFinishNum(params);
this.startAssess(id, data);
} catch (error) {
console.error('error: ', error);
}
},
/**
* 开始填表
* @param { string } code 题目code NLCP:脑力测评 ZARIT:照顾者负担量表
* @param { number } num 题号
* @param { string } reportId 测评ID 脑力测评ID或zaritID
*/
async startAssess(id, type) {
console.log('type: ', type);
async startAssess(id, data) {
try {
let num = 0;
if (data.finishNum - 0 < data.totalNum - 0) {
num = data.finishNum - 0 + 1;
} else if (data.finishNum - 0 === data.totalNum - 0) {
num = data.finishNum - 0;
} else {
num = 1;
}
const params = {
code: 'ZARIT',
reportId: id,
num: num ? num - 0 + 1 : 1,
num,
};
await this.handleQuestion(params);
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' });

12
src/pagesProject/project/components/ConfigInfo/components/Medicine.vue

@ -1,7 +1,7 @@
<template>
<view>
<MedicineDetail :detail="detail" @showToast="showToast" v-if="show" @closeAdd="closeAdd" />
<view v-if="!loading">
<view>
<view v-for="(item, index) in itemList" :key="index" :style="headStyle" class="py-3">
<!-- 头部 -->
<view class="w-full flex flex-row items-center justify-between text-sm text-gray-500" @click="changeOpen(index)">
@ -19,21 +19,16 @@
</view>
</view>
</view>
<view v-else>
<skeleton :banner="false" :loading="true" :row="5" title="随访" animate class="my-2 u-line-2 skeleton"></skeleton>
<skeleton :banner="false" :loading="true" :row="5" title="随访" animate class="my-2 u-line-2 skeleton"></skeleton>
</view>
</view>
</template>
<script>
import { mapGetters } from 'vuex';
import MedicineDetail from './MedicineDetail';
import Skeleton from '../../Skeleton/Skeleton';
export default {
name: 'Info',
components: { MedicineDetail, Skeleton },
components: { MedicineDetail },
data() {
return {
show: false,
@ -45,7 +40,6 @@ export default {
},
detail: null,
index: 0,
loading: false,
};
},
@ -98,10 +92,8 @@ export default {
*/
async queryMedicine() {
try {
this.loading = true;
const params = { projectId: this.projectId };
const date = await this.$u.api.queryMedicine(params);
this.loading = false;
if (!date.length) {
this.show = true;
} else {

15
src/pagesYanyuan/assess/assess.vue

@ -42,7 +42,6 @@ export default {
...mapState('yanyuan', ['questionInfo', 'optionId', 'code', 'reportId']),
...mapState('task', ['task']),
...mapGetters('user', ['userId']),
...mapGetters('project', ['projectId']),
},
methods: {
@ -84,13 +83,6 @@ export default {
const param = this.setParams();
await this.$u.api.saveAnswer(param);
this.$refs.child.closeLoading();
//
if (this.code === 'NLCP') {
this.$t.storage.setStorageSync('NLCPNum', this.projectId + '+' + this.questionInfo.num);
}
if (this.code === 'ZARIT') {
this.$t.storage.setStorageSync('ZARITNum', this.projectId + '+' + this.questionInfo.num);
}
await this.next();
} catch (error) {
this.$refs.child.closeLoading();
@ -124,13 +116,6 @@ export default {
const params = { mentalTestId: this.task.id };
const data = await this.$u.api.mentalTestCalculate(params);
this.setAssessResult(data);
//
if (this.code === 'NLCP') {
this.$t.storage.setStorageSync('NLCPNum', this.projectId + '+' + 0);
}
if (this.code === 'ZARIT') {
this.$t.storage.setStorageSync('ZARITNum', this.projectId + '+' + 0);
}
this.$refs.uTips.show({
title: '答案提交成功, 即将返回上一页',
type: 'success',

Loading…
Cancel
Save