|
|
@ -12,6 +12,35 @@ |
|
|
|
|
|
|
|
<!-- 定期任务面板 --> |
|
|
|
<TimeLine @getTasks="getTasks" class="flex-1 overflow-hidden" ref="timeLine" /> |
|
|
|
|
|
|
|
<!-- 医院项目的问卷悬浮按钮 --> |
|
|
|
<view class="absolute bottom-10 right-5" v-if="showQuestion"> |
|
|
|
<view |
|
|
|
@click="openQuestionnaire(false)" |
|
|
|
class="relative text-white bg-blue-400 flex justify-center items-center w-12 h-12 rounded-full shadow-2xl" |
|
|
|
> |
|
|
|
问卷 |
|
|
|
<u-badge type="error" :count="count" :offset="[-8, -8]"></u-badge> |
|
|
|
</view> |
|
|
|
|
|
|
|
<u-popup v-model="showQuestionList" mode="bottom" border-radius="14"> |
|
|
|
<view class="h-64"> |
|
|
|
<view class="text-center font-bold fixed bg-white py-3 top-0 w-full">请选择</view> |
|
|
|
<view class="flex flex-col mx-3 pt-10 pb-6 h-full overflow-y-auto" :class="questionnaires.length < 5 ? 'justify-center' : ''"> |
|
|
|
<view |
|
|
|
v-for="(item, index) in questionnaires" |
|
|
|
:key="item.id" |
|
|
|
class="p-2 text-center" |
|
|
|
@click="openQuestionnaire(true)" |
|
|
|
:class="index === questionnaires.length - 1 ? '' : 'border-b'" |
|
|
|
> |
|
|
|
<view class="text-gray-500">{{ item.questionnaireName }}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="fixed bottom-0 bg-white h-6 w-full"></view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -23,7 +52,7 @@ import { flatten } from 'lodash'; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { height: '', show: false }; |
|
|
|
return { height: '', show: false, showQuestion: false, questionnaires: [], count: 0, showQuestionList: false, chooseItem: false }; |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
@ -84,6 +113,18 @@ export default { |
|
|
|
this.init(options); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 医院项目下的调查问卷 |
|
|
|
questionnaires(val) { |
|
|
|
if (val && val.length) { |
|
|
|
this.showQuestion = true; |
|
|
|
val.forEach(item => { |
|
|
|
if (!item.isWrite) { |
|
|
|
this.count += 1; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
@ -318,6 +359,8 @@ export default { |
|
|
|
} |
|
|
|
// TODO |
|
|
|
this.getProjectById({ projectId: options.p, num: 0 }); // 根据项目id获取项目信息 |
|
|
|
// 查询医院是否填写了调查问卷 |
|
|
|
this.handleQueryNotWrite(options.p); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -418,6 +461,37 @@ export default { |
|
|
|
// 到底的标志复位 |
|
|
|
this.clearEndFlag(); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询医院是否填写了调查问卷 |
|
|
|
* @param {string} projectId 项目id |
|
|
|
*/ |
|
|
|
async handleQueryNotWrite(projectId) { |
|
|
|
try { |
|
|
|
const param = { projectId }; |
|
|
|
const data = await this.$u.api.queryNotWrite(param); |
|
|
|
console.log('data: ', data); |
|
|
|
this.questionnaires = data; |
|
|
|
} catch (error) { |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 打开问卷 |
|
|
|
openQuestionnaire(value) { |
|
|
|
this.chooseItem = value; |
|
|
|
if (this.count === 1 || this.chooseItem) { |
|
|
|
window.location.href = 'https://www.baidu.com/'; |
|
|
|
} else { |
|
|
|
this.showQuestionList = true; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.border-b { |
|
|
|
border-bottom: 1px solid #e4e7ed; |
|
|
|
} |
|
|
|
</style> |
|
|
|