Browse Source

fix(修改部分bug): 修改部分bug

develop
song 4 years ago
parent
commit
92bdab1577
  1. 3
      CHANGELOG.md
  2. 1
      src/components/Info/Info.vue
  3. 4
      src/mixins/tool.js
  4. 7
      src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue
  5. 21
      src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue
  6. 12
      src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue
  7. 4
      src/pagesProject/project/components/Roles/Roles.vue
  8. 2
      src/pagesProject/project/project.vue
  9. 15
      src/pagesYanyuan/assess/assess.vue
  10. 7
      src/pagesYanyuan/transfer-page/transfer-page.vue

3
CHANGELOG.md

@ -1,8 +1,9 @@
# 0.1.0 (2021-12-30)
# 0.1.0 (2021-12-31)
### 🌟 新功能
范围|描述|commitId
--|--|--
- | 1.添加时间轴工具箱折叠功能 2.添加联网超时时间 | [327b72e](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/327b72e)
- | api封装 | [7d4edfc](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/7d4edfc)
bind phone | 图形验证码;短信验证码;绑定手机号 | [93ffea2](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/93ffea2)
- | cache indexedDB处理 | [3388967](http://101.201.226.163:3000/binbin0314/yanyuan_js/commits/3388967)

1
src/components/Info/Info.vue

@ -393,7 +393,6 @@ export default {
this.$emit('setEmptyInfo');
setTimeout(() => {
const info = this.$t.storage.getStorageSync('infoList');
console.log('info: ', info);
if (info !== 'null') {
this.infoList = JSON.parse(info);
}

4
src/mixins/tool.js

@ -141,7 +141,7 @@ export default {
return;
}
// 申请成为家属
this.$t.page.openPage('/pagesYanyuan/transfer-page/transfer-page?type=jiashu');
await this.applyFamily();
} catch (error) {
this.$refs.uModal.clearLoading();
console.error('error: ', error);
@ -162,10 +162,12 @@ export default {
}
await this.$u.api.applyFamily(params);
this.transferContent = '申请已提交,请等待审核';
this.$t.page.openPage(`/pagesYanyuan/transfer-page/transfer-page?type=jiashu&msg=${this.transferContent}`);
} catch (error) {
console.error('error: ', error);
const msg = error.msg || '申请失败,稍后请重新申请';
this.transferContent = msg;
this.$t.page.openPage(`/pagesYanyuan/transfer-page/transfer-page?type=jiashu&msg=${this.transferContent}`);
}
},

7
src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue

@ -96,6 +96,10 @@ export default {
}
},
destroyed() {
this.$t.ui.hideLoading();
},
methods: {
...mapActions('yanyuan', ['getPersonalInfo']),
@ -141,10 +145,13 @@ export default {
*/
async handlePersonalInfo() {
try {
this.$t.ui.showLoading();
const params = { projectId: this.projectId };
const data = await this.$u.api.queryTrainee(params);
this.personalInfo = data;
this.$t.ui.hideLoading();
} catch (error) {
this.$t.ui.hideLoading();
console.error('error: ', error);
}
},

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

@ -86,8 +86,13 @@
</template>
</view>
<view class="p-4">
<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 type="primary" @click="submit" v-if="!disabled" :loading="loading">保存并开始填表</u-button>
<u-button
type="primary"
@click="handleFinishNum(detail.id)"
v-if="disabled && detail.zaritPoint === null && detail.selfFill === 1"
:loading="loading"
>
继续填表
</u-button>
</view>
@ -114,6 +119,7 @@ export default {
careInfo,
show: true,
params: {},
loading: false,
};
},
@ -218,14 +224,17 @@ export default {
*/
async submit() {
try {
this.loading = true;
if (!this.validationRequired(this.params)) return;
const params = this.params;
params.projectId = this.projectId;
const data = await this.$u.api.addZarit(params);
this.loading = false;
if (data) {
await this.handleFinishNum(data);
}
} catch (error) {
this.loading = false;
console.error('error: ', error);
}
},
@ -277,6 +286,7 @@ export default {
*/
async handleFinishNum(id) {
try {
this.loading = true;
this.setReportId(id);
this.setCode('ZARIT');
const params = {
@ -284,8 +294,10 @@ export default {
reportId: id,
};
const data = await this.getFinishNum(params);
this.startAssess(id, data);
this.loading = false;
await this.startAssess(id, data);
} catch (error) {
this.loading = false;
console.error('error: ', error);
}
},
@ -298,6 +310,7 @@ export default {
*/
async startAssess(id, data) {
try {
this.loading = true;
let num = 0;
if (data.finishNum - 0 < data.totalNum - 0) {
num = data.finishNum - 0 + 1;
@ -312,8 +325,10 @@ export default {
num,
};
await this.handleQuestion(params);
this.loading = false;
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' });
} catch (error) {
this.loading = false;
console.error('error: ', error);
}
},

12
src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue

@ -6,7 +6,7 @@
</view>
<view v-if="task.data.type === 0 && task.data.mentalTest.finishStatus === 0">
<view class="flex flex-nowrap my-2" v-if="task.data.mentalTest.finishStatus !== 2">
<u-button type="primary" class="mx-0" @click="handleFinishNum">开始测评</u-button>
<u-button type="primary" class="mx-0" @click="handleFinishNum" :loading="loading">开始测评</u-button>
<view class="flex-1"></view>
</view>
<text class="text-xs text-gray-300">每两个周可进行一次测评</text>
@ -20,6 +20,10 @@ import { mapActions, mapMutations, mapGetters } from 'vuex';
export default {
props: { task: { type: Object, default: () => {} } },
data() {
return { loading: false };
},
computed: mapGetters('project', ['projectId']),
methods: {
@ -34,6 +38,7 @@ export default {
*/
async handleFinishNum() {
try {
this.loading = true;
const { task } = this;
this.setTask(task);
this.setCode('NLCP');
@ -41,9 +46,11 @@ export default {
code: 'NLCP',
reportId: task.id,
};
this.loading = false;
const data = await this.getFinishNum(params);
this.startAssess(data);
} catch (error) {
this.loading = false;
console.error('error: ', error);
}
},
@ -56,6 +63,7 @@ export default {
*/
async startAssess(data) {
try {
this.loading = true;
let num = 0;
if (data.finishNum - 0 < data.totalNum - 0) {
num = data.finishNum - 0 + 1;
@ -71,8 +79,10 @@ export default {
num,
};
await this.handleQuestion(params);
this.loading = false;
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' });
} catch (error) {
this.loading = false;
this.$t.ui.showToast(error.msg || '查询失败');
console.error('error: ', error);
}

4
src/pagesProject/project/components/Roles/Roles.vue

@ -168,8 +168,8 @@ export default {
// projectroleId
// projectroleId
changeRole(id, index, type) {
try {
this.$t.ui.showLoading();
try {
if (type === 'Setting') {
//
this.$emit('changeIsSetting', true);
@ -188,7 +188,9 @@ export default {
// id
this.setScrollToTaskId('');
this.setShowScrollTo(false);
this.$t.ui.hideLoading();
} catch (error) {
this.$t.ui.hideLoading();
console.error('role.vue changeRole error: ', error);
}
},

2
src/pagesProject/project/project.vue

@ -231,9 +231,11 @@ export default {
* @param {number} query.queryType 0向上查找 1向下查找(默认) 下查包含自己上查不包含
*/
getTasks(query) {
this.$t.ui.showLoading();
// this.setShowSkeleton(true);
const params = this.generateGetTaskParam(query);
this.$t.$q.getRegularTask(params, (err, data) => {
this.$t.ui.hideLoading();
this.setShowSkeleton(false);
if (err) {
// TODO:

15
src/pagesYanyuan/assess/assess.vue

@ -105,14 +105,12 @@ export default {
await this.calculateScore();
}
} else {
this.$refs.child.openLoading();
const params = {
code,
reportId: code === 'NLCP' ? task.id : reportId,
num: questionInfo.num + 1,
};
await this.handleQuestion(params);
this.$refs.child.closeLoading();
}
},
@ -128,13 +126,19 @@ export default {
type: 'success',
duration: '3000',
});
setTimeout(() => {
this.backProject();
this.setTimeNode(Date.now());
}, 1000);
this.$t.ui.hideLoading();
} catch (error) {
console.error('error: ', error);
this.$t.ui.showToast(error.msg || '提交失败');
if (error.msg === '脑力测评分数计算中,请勿重复提交。') {
setTimeout(() => {
this.backProject();
this.setTimeNode(Date.now());
}, 1500);
}
this.$t.ui.hideLoading();
}
},
@ -149,10 +153,8 @@ export default {
type: 'success',
duration: '3000',
});
setTimeout(() => {
this.setIsTest(true);
this.$t.page.back();
}, 1000);
} catch (error) {
console.error('error: ', error);
this.$t.ui.showToast(error.msg || '提交失败');
@ -162,7 +164,6 @@ export default {
//
backProject() {
this.setIsEvaluated(true);
const { name, id, url, templateCode } = this.project;
url && (uni.$t.domain = url);
this.$u.route('/pagesProject/project/project', {

7
src/pagesYanyuan/transfer-page/transfer-page.vue

@ -21,7 +21,7 @@ export default {
this.content = '工具箱已绑定';
}
if (options.type === 'jiashu') {
this.openApplyModal(1);
this.openApplyModal(1, options.msg);
}
if (options.type === 'isjiashu') {
this.openApplyModal(0);
@ -38,10 +38,9 @@ export default {
methods: {
//
async openApplyModal(type) {
async openApplyModal(type, msg) {
if (type === 1) {
await this.applyFamily();
this.content = this.transferContent;
this.content = msg;
} else {
this.content = '家属申请已提交,请等待审核';
}

Loading…
Cancel
Save