|
|
@ -18,10 +18,30 @@ |
|
|
|
|
|
|
|
<!-- 引导语 --> |
|
|
|
<GuidePage class="w-full h-full" v-if="showGuide" @quitGuide="quitGuide" /> |
|
|
|
|
|
|
|
<!-- 选择老人 --> |
|
|
|
<!-- :async-close="true" --> |
|
|
|
<u-modal v-model="showElder" title="选择老人" @confirm="confirmModel" @cancel="cancelModel" ref="uModal" :show-cancel-button="true"> |
|
|
|
<ChooseElder></ChooseElder> |
|
|
|
</u-modal> |
|
|
|
|
|
|
|
<!-- 设置使用者 --> |
|
|
|
<!-- :async-close="true" --> |
|
|
|
<u-modal |
|
|
|
v-model="showUser" |
|
|
|
title="设置使用者" |
|
|
|
@confirm="confirmSetUserModel" |
|
|
|
@cancel="cancelSetUserModel" |
|
|
|
ref="uModal" |
|
|
|
:show-cancel-button="true" |
|
|
|
> |
|
|
|
<ChooseUser></ChooseUser> |
|
|
|
</u-modal> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import toolMixin from '@/mixins/tool'; |
|
|
|
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'; |
|
|
|
import { setPlaceholderTasks, computeFillPlaceholderTaskCount } from '@/utils/task'; |
|
|
|
import Title from './components/Title/Title'; |
|
|
@ -32,6 +52,7 @@ import ConfigInfo from './components/ConfigInfo/ConfigInfo'; |
|
|
|
// import { flatten } from 'lodash'; |
|
|
|
|
|
|
|
export default { |
|
|
|
mixins: [toolMixin], |
|
|
|
components: { Title, Roles, TimeLine, ConfigInfo, GuidePage }, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -50,6 +71,7 @@ export default { |
|
|
|
...mapState('role', ['visibleRoles', 'roleId']), |
|
|
|
...mapState('task', ['timeNode', 'timeUnit', 'tasks', 'regularTask', 'newProjectInfo', 'showSkeleton', 'showScrollTo']), |
|
|
|
...mapState('project', ['project']), |
|
|
|
...mapState('yanyuan', ['scene']), |
|
|
|
...mapGetters('task', ['timeGranularity']), |
|
|
|
...mapGetters('project', ['projectId']), |
|
|
|
...mapGetters('user', ['userId']), |
|
|
@ -57,10 +79,18 @@ export default { |
|
|
|
|
|
|
|
onLoad(options) { |
|
|
|
if (options.share && options.share === '1') { |
|
|
|
console.log('0001'); |
|
|
|
this.shareInit(options); |
|
|
|
} else { |
|
|
|
console.log('0002'); |
|
|
|
this.init(options); |
|
|
|
} |
|
|
|
|
|
|
|
// 分享 |
|
|
|
wx.showShareMenu({ |
|
|
|
withShareTicket: true, |
|
|
|
menus: ['shareAppMessage', 'shareTimeline'], |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
@ -332,7 +362,7 @@ export default { |
|
|
|
* 初始化 |
|
|
|
* @param {object | null} options |
|
|
|
*/ |
|
|
|
init(options) { |
|
|
|
async init(options) { |
|
|
|
if (!this.token) { |
|
|
|
// 不论有没有token都直接从userId获取token |
|
|
|
// token有过期时间 从本地获取可能是过期 干脆直接从userId获取 |
|
|
@ -354,6 +384,14 @@ export default { |
|
|
|
} |
|
|
|
// TODO |
|
|
|
// this.getProjectById({ projectId: options.p, num: 0 }); // 根据项目id获取项目信息 |
|
|
|
console.log('options: ', options); |
|
|
|
// await this.queryFamilyIsMember(options.p); |
|
|
|
|
|
|
|
console.log('this.userId: ', this.userId); |
|
|
|
if (this.scene === 1007 || this.scene === 1008) { |
|
|
|
console.log('查询用户是否是项目成员', this.userId); |
|
|
|
await this.queryFamilyIsMember(options.p); |
|
|
|
} |
|
|
|
|
|
|
|
// 根据项目id获取角色列表 |
|
|
|
this.getRoles({ projectId: options.p, num: 0, templateCode: this.project.templateCode }); |
|
|
@ -487,6 +525,37 @@ export default { |
|
|
|
console.log('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询用户是否是项目成员 |
|
|
|
* @param {string} projectId |
|
|
|
*/ |
|
|
|
async queryFamilyIsMember(projectId) { |
|
|
|
try { |
|
|
|
const params = { projectId }; |
|
|
|
const data = await this.$u.api.familyIsMember(params); |
|
|
|
console.log('data: ', data); |
|
|
|
// 是 直接打开 否 询问是否成为家属 |
|
|
|
if ((data.familyStatus === 1 || data.familyStatus === 2) && data.keyUserId) { |
|
|
|
console.log('不是成员 询问是否成为家属'); |
|
|
|
const arr = [{ keyUserId: data.keyUserId, sex: data.sex, userName: data.userName }]; |
|
|
|
this.setElderlyInfo(arr); |
|
|
|
this.showElder = true; |
|
|
|
} |
|
|
|
// if (data.familyStatus === 1) { |
|
|
|
// console.log('是 直接打开'); |
|
|
|
// this.init(options); |
|
|
|
// } |
|
|
|
if (data.familyStatus === 0) { |
|
|
|
console.log('申请已提交,返回首页'); |
|
|
|
this.transferContent = '家属申请已提交,请等待审核'; |
|
|
|
// 申请成为家属 |
|
|
|
this.$t.page.openPage('/pagesYanyuan/transfer-page/transfer-page?type=jiashu'); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|