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 范围|描述|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) - | 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) 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) - | 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'); this.$emit('setEmptyInfo');
setTimeout(() => { setTimeout(() => {
const info = this.$t.storage.getStorageSync('infoList'); const info = this.$t.storage.getStorageSync('infoList');
console.log('info: ', info);
if (info !== 'null') { if (info !== 'null') {
this.infoList = JSON.parse(info); this.infoList = JSON.parse(info);
} }

4
src/mixins/tool.js

@ -141,7 +141,7 @@ export default {
return; return;
} }
// 申请成为家属 // 申请成为家属
this.$t.page.openPage('/pagesYanyuan/transfer-page/transfer-page?type=jiashu'); await this.applyFamily();
} catch (error) { } catch (error) {
this.$refs.uModal.clearLoading(); this.$refs.uModal.clearLoading();
console.error('error: ', error); console.error('error: ', error);
@ -162,10 +162,12 @@ export default {
} }
await this.$u.api.applyFamily(params); await this.$u.api.applyFamily(params);
this.transferContent = '申请已提交,请等待审核'; this.transferContent = '申请已提交,请等待审核';
this.$t.page.openPage(`/pagesYanyuan/transfer-page/transfer-page?type=jiashu&msg=${this.transferContent}`);
} catch (error) { } catch (error) {
console.error('error: ', error); console.error('error: ', error);
const msg = error.msg || '申请失败,稍后请重新申请'; const msg = error.msg || '申请失败,稍后请重新申请';
this.transferContent = 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: { methods: {
...mapActions('yanyuan', ['getPersonalInfo']), ...mapActions('yanyuan', ['getPersonalInfo']),
@ -141,10 +145,13 @@ export default {
*/ */
async handlePersonalInfo() { async handlePersonalInfo() {
try { try {
this.$t.ui.showLoading();
const params = { projectId: this.projectId }; const params = { projectId: this.projectId };
const data = await this.$u.api.queryTrainee(params); const data = await this.$u.api.queryTrainee(params);
this.personalInfo = data; this.personalInfo = data;
this.$t.ui.hideLoading();
} catch (error) { } catch (error) {
this.$t.ui.hideLoading();
console.error('error: ', error); console.error('error: ', error);
} }
}, },

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

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

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

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

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

@ -168,8 +168,8 @@ export default {
// projectroleId // projectroleId
// projectroleId // projectroleId
changeRole(id, index, type) { changeRole(id, index, type) {
try {
this.$t.ui.showLoading(); this.$t.ui.showLoading();
try {
if (type === 'Setting') { if (type === 'Setting') {
// //
this.$emit('changeIsSetting', true); this.$emit('changeIsSetting', true);
@ -188,7 +188,9 @@ export default {
// id // id
this.setScrollToTaskId(''); this.setScrollToTaskId('');
this.setShowScrollTo(false); this.setShowScrollTo(false);
this.$t.ui.hideLoading();
} catch (error) { } catch (error) {
this.$t.ui.hideLoading();
console.error('role.vue changeRole error: ', error); 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向下查找(默认) 下查包含自己上查不包含 * @param {number} query.queryType 0向上查找 1向下查找(默认) 下查包含自己上查不包含
*/ */
getTasks(query) { getTasks(query) {
this.$t.ui.showLoading();
// this.setShowSkeleton(true); // this.setShowSkeleton(true);
const params = this.generateGetTaskParam(query); const params = this.generateGetTaskParam(query);
this.$t.$q.getRegularTask(params, (err, data) => { this.$t.$q.getRegularTask(params, (err, data) => {
this.$t.ui.hideLoading();
this.setShowSkeleton(false); this.setShowSkeleton(false);
if (err) { if (err) {
// TODO: // TODO:

15
src/pagesYanyuan/assess/assess.vue

@ -105,14 +105,12 @@ export default {
await this.calculateScore(); await this.calculateScore();
} }
} else { } else {
this.$refs.child.openLoading();
const params = { const params = {
code, code,
reportId: code === 'NLCP' ? task.id : reportId, reportId: code === 'NLCP' ? task.id : reportId,
num: questionInfo.num + 1, num: questionInfo.num + 1,
}; };
await this.handleQuestion(params); await this.handleQuestion(params);
this.$refs.child.closeLoading();
} }
}, },
@ -128,13 +126,19 @@ export default {
type: 'success', type: 'success',
duration: '3000', duration: '3000',
}); });
setTimeout(() => {
this.backProject(); this.backProject();
this.setTimeNode(Date.now()); this.setTimeNode(Date.now());
}, 1000); this.$t.ui.hideLoading();
} catch (error) { } catch (error) {
console.error('error: ', error); console.error('error: ', error);
this.$t.ui.showToast(error.msg || '提交失败'); 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', type: 'success',
duration: '3000', duration: '3000',
}); });
setTimeout(() => {
this.setIsTest(true); this.setIsTest(true);
this.$t.page.back(); this.$t.page.back();
}, 1000);
} catch (error) { } catch (error) {
console.error('error: ', error); console.error('error: ', error);
this.$t.ui.showToast(error.msg || '提交失败'); this.$t.ui.showToast(error.msg || '提交失败');
@ -162,7 +164,6 @@ export default {
// //
backProject() { backProject() {
this.setIsEvaluated(true); this.setIsEvaluated(true);
const { name, id, url, templateCode } = this.project; const { name, id, url, templateCode } = this.project;
url && (uni.$t.domain = url); url && (uni.$t.domain = url);
this.$u.route('/pagesProject/project/project', { this.$u.route('/pagesProject/project/project', {

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

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

Loading…
Cancel
Save