|
@@ -9,8 +9,8 @@
|
|
</div>
|
|
</div>
|
|
<div class="content">
|
|
<div class="content">
|
|
<div class="c_top adfacjb">
|
|
<div class="c_top adfacjb">
|
|
- <span>企业员工培训需求调查问卷</span>
|
|
|
|
- <el-button type="primary">预览问卷</el-button>
|
|
|
|
|
|
+ <span>{{ title }}</span>
|
|
|
|
+ <el-button type="primary" @click="reviewWj">预览问卷</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="c_set">
|
|
<div class="c_set">
|
|
<div class="cs_title" style="margin-top: 0;">选择项目成员</div>
|
|
<div class="cs_title" style="margin-top: 0;">选择项目成员</div>
|
|
@@ -29,18 +29,18 @@
|
|
<div class="cs_title">问卷回答设置</div>
|
|
<div class="cs_title">问卷回答设置</div>
|
|
<div class="cs_zd adfac">
|
|
<div class="cs_zd adfac">
|
|
<span>只允许作答</span>
|
|
<span>只允许作答</span>
|
|
- <el-input-number v-model="params.times" :min="1" controls-position="right" style="margin: 0 9px;"></el-input-number>
|
|
|
|
|
|
+ <el-input-number v-model="params.answerSetting" :min="1" controls-position="right" style="margin: 0 9px;"></el-input-number>
|
|
<span>次</span>
|
|
<span>次</span>
|
|
</div>
|
|
</div>
|
|
<div class="cs_title">问卷作答时间设置</div>
|
|
<div class="cs_title">问卷作答时间设置</div>
|
|
<div class="cs_time">
|
|
<div class="cs_time">
|
|
<div class="ct_pre adfac">
|
|
<div class="ct_pre adfac">
|
|
<span>开始时间</span>
|
|
<span>开始时间</span>
|
|
- <el-date-picker v-model="params.startTime" type="datetime" placeholder="选择开始时间" style="width:311px;"></el-date-picker>
|
|
|
|
|
|
+ <el-date-picker v-model="params.startTime" type="datetime" placeholder="选择开始时间" style="width:311px;" @change="e=>handleChangeDatetime(e,'startTime')"></el-date-picker>
|
|
</div>
|
|
</div>
|
|
<div class="ct_pre adfac">
|
|
<div class="ct_pre adfac">
|
|
<span>截止时间</span>
|
|
<span>截止时间</span>
|
|
- <el-date-picker v-model="params.endTime" type="datetime" placeholder="选择截止时间" style="width:311px;"></el-date-picker>
|
|
|
|
|
|
+ <el-date-picker v-model="params.endTime" type="datetime" placeholder="选择截止时间" style="width:311px;" @change="e=>handleChangeDatetime(e,'endTime')"></el-date-picker>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cs_btn adfac">
|
|
<div class="cs_btn adfac">
|
|
@@ -56,7 +56,7 @@
|
|
<template v-if="!checkShow">
|
|
<template v-if="!checkShow">
|
|
<div class="ecl_gs">
|
|
<div class="ecl_gs">
|
|
<div class="eg_title">按项目选</div>
|
|
<div class="eg_title">按项目选</div>
|
|
- <div class="egt_item adfacjb" v-for="(item,index) in companyList" :key="index" @click="handleSelectCompany(item.name,item.id)">
|
|
|
|
|
|
+ <div class="egt_item adfacjb" v-for="(item,index) in companyList" :key="index">
|
|
<div class="ei_l adfac">
|
|
<div class="ei_l adfac">
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.num }}人</span>
|
|
<span>{{ item.num }}人</span>
|
|
@@ -97,33 +97,33 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="">
|
|
<script setup name="">
|
|
- import { ref, getCurrentInstance } from 'vue'
|
|
|
|
|
|
+ import { ref, getCurrentInstance,onMounted } from 'vue'
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
+ import { getCoachProgramList,getCoachList,sendQuestionnaire } from '@/api/agent/index.js'
|
|
|
|
|
|
|
|
+ const questionnaireId = ref('')
|
|
|
|
+ const title = ref('')
|
|
|
|
+ const type = ref('')
|
|
const params = ref({
|
|
const params = ref({
|
|
- persons:[{name:'张三'},{name:'李四'}],
|
|
|
|
- times:1,
|
|
|
|
|
|
+ questionnaireId:'',
|
|
|
|
+ teamId:'',
|
|
|
|
+ userIds:[],
|
|
|
|
+ persons:[],
|
|
|
|
+ answerSetting:1,
|
|
startTime:'',
|
|
startTime:'',
|
|
endTime:''
|
|
endTime:''
|
|
})
|
|
})
|
|
|
|
+ const typecfg = {
|
|
|
|
+ 1: '初级',
|
|
|
|
+ 2: '中级',
|
|
|
|
+ 3: '高级'
|
|
|
|
+ }
|
|
const userShow = ref(false)
|
|
const userShow = ref(false)
|
|
const checkShow = ref(false)
|
|
const checkShow = ref(false)
|
|
const companyName = ref('')
|
|
const companyName = ref('')
|
|
const userName = ref('')
|
|
const userName = ref('')
|
|
- const companyList = ref([
|
|
|
|
- {id:1,name:'合肥市传秀科技有限公司',num:5},
|
|
|
|
- {id:2,name:'合肥市恰恰科技有限公司',num:20},
|
|
|
|
- {id:3,name:'上海明国实业有限公司',num:17},
|
|
|
|
- {id:4,name:'上特斯拉上海有限公司',num:37}
|
|
|
|
- ])
|
|
|
|
-
|
|
|
|
- const userList = ref([
|
|
|
|
- {id:1,name:'张三',checked:false},
|
|
|
|
- {id:2,name:'李四',checked:false},
|
|
|
|
- {id:3,name:'王五',checked:false},
|
|
|
|
- {id:4,name:'赵六',checked:false},
|
|
|
|
- {id:5,name:'田七',checked:false}
|
|
|
|
- ])
|
|
|
|
|
|
+ const companyList = ref([])
|
|
|
|
+ const userList = ref([])
|
|
const selectedUsers = ref([])
|
|
const selectedUsers = ref([])
|
|
const checkAll = ref(false)
|
|
const checkAll = ref(false)
|
|
const isIndeterminate = ref(false)
|
|
const isIndeterminate = ref(false)
|
|
@@ -131,6 +131,17 @@
|
|
|
|
|
|
const handleAddUser = () => {
|
|
const handleAddUser = () => {
|
|
userShow.value = true
|
|
userShow.value = true
|
|
|
|
+ getCoachProgramList({page:1,limit:-1}).then(res=>{
|
|
|
|
+ if(res.code !==0) return proxy.$message({type:'warning',message:res.msg});
|
|
|
|
+ companyList.value = res.data.map(l=>{
|
|
|
|
+ return {
|
|
|
|
+ id:l.id,
|
|
|
|
+ name:l.enterpriseName,
|
|
|
|
+ num:l.teams.reduce((a,b)=>a+b.teamNum,0),
|
|
|
|
+ teamId:l.teams[0].teamId
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
const handleBack = () => {
|
|
const handleBack = () => {
|
|
@@ -138,15 +149,29 @@
|
|
}
|
|
}
|
|
|
|
|
|
const handleRemoveUser = (item,index) => {
|
|
const handleRemoveUser = (item,index) => {
|
|
- params.value.persons.splice(index,1)
|
|
|
|
|
|
+ params.value.persons.splice(index,1);
|
|
|
|
+ params.value.userIds = params.value.persons.map(l=>l.id);
|
|
}
|
|
}
|
|
|
|
|
|
const handleConfirm = () => {
|
|
const handleConfirm = () => {
|
|
- if(params.value.persons.length === 0) return proxy.$message({type:'warning',message:'请选择项目成员'});
|
|
|
|
|
|
+ if(params.value.userIds.length === 0) return proxy.$message({type:'warning',message:'请选择项目成员'});
|
|
if(!params.value.startTime || !params.value.endTime) return proxy.$message({type:'warning',message:'请设置问卷作答时间'});
|
|
if(!params.value.startTime || !params.value.endTime) return proxy.$message({type:'warning',message:'请设置问卷作答时间'});
|
|
|
|
+ sendQuestionnaire(params.value).then(res=>{
|
|
|
|
+ if(res.code!==0) return proxy.$message({type:'warning',message:res.msg});
|
|
|
|
+ proxy.$message({type:'success',message:'问卷已发送,请等待成员作答!'});
|
|
|
|
+ setTimeout(()=>{proxy.$router.go(-1)},1500)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
const handleChooseUser = (item) => {
|
|
const handleChooseUser = (item) => {
|
|
|
|
+ params.value.teamId = item.teamId;
|
|
|
|
+ getCoachList({teamId:item.teamId,page:1,limit:-1}).then(res=>{
|
|
|
|
+ if(res.code!==0) return proxy.$message({type:'warning',message:res.msg});
|
|
|
|
+ userList.value = res.data.list.map(l=>{
|
|
|
|
+ return {id:l.id,name:l.realName,checked:false}
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
checkShow.value = true
|
|
checkShow.value = true
|
|
companyName.value = item.name
|
|
companyName.value = item.name
|
|
}
|
|
}
|
|
@@ -155,7 +180,20 @@
|
|
companyName.value = ''
|
|
companyName.value = ''
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const handleChangeDatetime = (e,key) => {
|
|
|
|
+ params.value[key] = proxy.parseTime(new Date(e), '{yy}-{mm}-{dd} {hh}:{ii}:{ss}');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
const submitForm = () => {
|
|
const submitForm = () => {
|
|
|
|
+ if(selectedUsers.value.length===0) return proxy.$message.warning('请至少选择一位成员')
|
|
|
|
+ params.value.persons = JSON.parse(JSON.stringify(selectedUsers.value));
|
|
|
|
+ params.value.userIds = params.value.persons.map(l=>l.id);
|
|
|
|
+ checkAll.value = false;
|
|
|
|
+ isIndeterminate.value = false;
|
|
|
|
+ selectedUsers.value = [];
|
|
|
|
+ userList.value = [];
|
|
|
|
+ checkShow.value = false;
|
|
userShow.value = false;
|
|
userShow.value = false;
|
|
}
|
|
}
|
|
const cancel = () => {
|
|
const cancel = () => {
|
|
@@ -187,6 +225,18 @@
|
|
if(trues===userList.value.length) checkAll.value = true;
|
|
if(trues===userList.value.length) checkAll.value = true;
|
|
else checkAll.value = false;
|
|
else checkAll.value = false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ const reviewWj = () => {
|
|
|
|
+ proxy.$router.push({path:'/agentQuestionnaireDetail',query:{id:questionnaireId.value,title:title.value,type:typecfg[type.value]}});
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ onMounted(()=>{
|
|
|
|
+ questionnaireId.value = proxy.$route.query.id;
|
|
|
|
+ params.value.questionnaireId = proxy.$route.query.id;
|
|
|
|
+ title.value = proxy.$route.query.title;
|
|
|
|
+ type.value = proxy.$route.query.type;
|
|
|
|
+ })
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|