|
@@ -10,8 +10,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="tabs adfac">
|
|
|
- <div class="t_pre" :class="{'active':tidx===1}" @click="handleChangeTab(1)">团队报告 教练版</div>
|
|
|
- <div class="t_pre" :class="{'active':tidx===2}" @click="handleChangeTab(2)">团队报告 个人版</div>
|
|
|
+ <div class="t_pre" :class="{'active':tidx===1}" @click="handleChangeTab(1)">团队报告(教练版)</div>
|
|
|
+ <div class="t_pre" :class="{'active':tidx===2}" @click="handleChangeTab(2)">团队报告(个人版)</div>
|
|
|
</div>
|
|
|
<template v-if="tidx===1">
|
|
|
<div class="query adfacjb">
|
|
@@ -71,6 +71,19 @@
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <el-dialog width="40%" :visible.sync="setShow" title="发送报告" @close="setShow=false">
|
|
|
+ <div>
|
|
|
+ <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
|
|
|
+ <div style="margin: 15px 0;"></div>
|
|
|
+ <el-checkbox-group v-model="checkedUsers" @change="handleCheckedCitiesChange">
|
|
|
+ <el-checkbox v-for="user in reportUsers" :label="user.userId" :key="user.userId">{{user.realName}}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ <div class="demo-drawer__footer" style="display: flex;justify-content: end;margin-top: 20px;">
|
|
|
+ <el-button type="primary" @click="submitForm99">保 存</el-button>
|
|
|
+ <el-button @click="setShow=false" style="margin-right: 5%;">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -86,12 +99,19 @@
|
|
|
sendReportById,
|
|
|
sendReportUserById,
|
|
|
reCreateReport,
|
|
|
- getPersonQueList
|
|
|
+ getPersonQueList,
|
|
|
+ sendReportUsers
|
|
|
} from "@/api/agent/index.js";
|
|
|
import {useAgentStore} from "@/store_v3/modules/agent";
|
|
|
import useCommonStore from "@/store_v3/modules/common";
|
|
|
useAgentStore().getQuestionnaireData();
|
|
|
useAgentStore().getTeamData();
|
|
|
+
|
|
|
+ const setShow = ref(false)
|
|
|
+ const reportUsers = ref([])
|
|
|
+ const checkedUsers = ref([])
|
|
|
+ const checkAll = ref(false)
|
|
|
+ const isIndeterminate = ref(false)
|
|
|
|
|
|
const tidx = ref(1)
|
|
|
const queryParams = ref({
|
|
@@ -185,38 +205,69 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- const deleteTeamReport = (e,idx,item) => {
|
|
|
- proxy.$modal.confirm('确认删除该报告吗?如确认会立即执行!').then(async function () {
|
|
|
+ const deleteTeamReport = async (e,idx,item) => {
|
|
|
+ await proxy.$modal.confirm('确认删除该报告吗?如确认会立即执行!')
|
|
|
let res = await deleteTeamReportWj([e]);
|
|
|
if(res.code===0){
|
|
|
proxy.$message.success('删除成功!');
|
|
|
getTeamReportWjData(useCommonStore().$state.relationId,idx)
|
|
|
} else proxy.$message.error(res.msg)
|
|
|
- }).then(() => {}).finally(() => {});
|
|
|
}
|
|
|
- const deletePersonReport = (e,idx,item) => {
|
|
|
- proxy.$modal.confirm('确认删除该报告吗?如确认会立即执行!').then(async function () {
|
|
|
+ const deletePersonReport = async (e,idx,item) => {
|
|
|
+ await proxy.$modal.confirm('确认删除该报告吗?如确认会立即执行!')
|
|
|
let res = await deleteTeamReportWj([e]);
|
|
|
if(res.code===0){
|
|
|
proxy.$message.success('删除成功!');
|
|
|
- getPersonReportWjData(useCommonStore().$state.teamQuestionnaireId,idx)
|
|
|
+ getPersonReportWjData(useCommonStore().$state.relationId,idx)
|
|
|
} else proxy.$message.error(res.msg)
|
|
|
- }).then(() => {}).finally(() => {});
|
|
|
}
|
|
|
|
|
|
+ const htce = ref('')
|
|
|
+ const htcidx = ref('')
|
|
|
const sendReportTeam = (e,idx,item) => {
|
|
|
- sendReportById(e).then(res=>{
|
|
|
- if(res.code!==0) return proxy.$message.error(res.msg)
|
|
|
- proxy.$message.success('发送成功!')
|
|
|
- getTeamReportWjData(useCommonStore().$state.relationId,idx)
|
|
|
- })
|
|
|
+ htce.value = e;
|
|
|
+ htcidx.value = idx;
|
|
|
+ setShow.value = true;
|
|
|
+ reportUsers.value = useCommonStore().$state.reportUsers;
|
|
|
}
|
|
|
const sendReportPerson = (e,idx,item) => {
|
|
|
- sendReportUserById(e,useCommonStore().$state.reportUserId).then(res=>{
|
|
|
- if(res.code!==0) return proxy.$message.error(res.msg)
|
|
|
- proxy.$message.success('发送成功!')
|
|
|
- getPersonReportWjData(useCommonStore().$state.teamQuestionnaireId,idx)
|
|
|
- })
|
|
|
+ htce.value = e;
|
|
|
+ htcidx.value = idx;
|
|
|
+ setShow.value = true;
|
|
|
+ reportUsers.value = useCommonStore().$state.reportUsers;
|
|
|
+ }
|
|
|
+ const submitForm99 = (e,idx,item,type) => {
|
|
|
+ if(checkedUsers.value.length===0) return proxy.$message.error('请选择需要发送报告的成员!')
|
|
|
+ if(tidx.value===1){
|
|
|
+ sendReportUsers({id:htce.value,userIds:checkedUsers.value}).then(res=>{
|
|
|
+ if(res.code!==0) return proxy.$message.error(res.msg)
|
|
|
+ proxy.$message.success('发送成功!')
|
|
|
+ setShow.value = false;
|
|
|
+ checkedUsers.value = [];
|
|
|
+ checkAll.value = false;
|
|
|
+ isIndeterminate.value = false;
|
|
|
+ getTeamReportWjData(useCommonStore().$state.relationId,htcidx.value)
|
|
|
+ })
|
|
|
+ }else if(tidx.value===2){
|
|
|
+ sendReportUsers({id:htce.value,userIds:checkedUsers.value}).then(res=>{
|
|
|
+ if(res.code!==0) return proxy.$message.error(res.msg)
|
|
|
+ proxy.$message.success('发送成功!')
|
|
|
+ setShow.value = false;
|
|
|
+ checkedUsers.value = [];
|
|
|
+ checkAll.value = false;
|
|
|
+ isIndeterminate.value = false;
|
|
|
+ getPersonReportWjData(useCommonStore().$state.relationId,htcidx.value)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const handleCheckAllChange = val => {
|
|
|
+ checkedUsers.value = val ? reportUsers.value.map(r=>r.userId) : [];
|
|
|
+ isIndeterminate.value = false;
|
|
|
+ }
|
|
|
+ const handleCheckedCitiesChange = value => {
|
|
|
+ const checkedCount = value.length;
|
|
|
+ checkAll.value = checkedCount === reportUsers.value.length;
|
|
|
+ isIndeterminate.value = checkedCount > 0 && checkedCount < reportUsers.value.length;
|
|
|
}
|
|
|
const reCreateReportTeam = (e,idx,item) => {
|
|
|
reCreateReport(e).then(res=>{
|
|
@@ -229,7 +280,7 @@
|
|
|
reCreateReport(e).then(res=>{
|
|
|
if(res.code!==0) return proxy.$message.error(res.msg)
|
|
|
proxy.$message.success('重新生成成功!')
|
|
|
- getPersonReportWjData(useCommonStore().$state.teamQuestionnaireId,idx)
|
|
|
+ getPersonReportWjData(useCommonStore().$state.relationId,idx)
|
|
|
})
|
|
|
}
|
|
|
const refreshReportTeamList = (e,idx) => {
|