Commit b92c788d authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/luochao/confucius into master

parents 76b8090e e3cdf48e
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
</script> </script>
<style> <style>
@import url("//at.alicdn.com/t/font_2077629_ou0hmd4zmr8.css"); @import url("//at.alicdn.com/t/font_2077629_wob6liq2kxn.css");
.q-scrollarea__thumb { .q-scrollarea__thumb {
z-index: 999999 !important; z-index: 999999 !important;
} }
......
...@@ -312,7 +312,7 @@ export function SetSynvEduEmployee(data) { ...@@ -312,7 +312,7 @@ export function SetSynvEduEmployee(data) {
*/ */
export function getWeChatChannelInfo(data) { export function getWeChatChannelInfo(data) {
return request({ return request({
url: '/QYWeChat/GetWeChatChannelInfo', url: '/QYWeChat/GetWeChatChannelInfo_V2',
method: 'post', method: 'post',
data data
}) })
......
...@@ -93,11 +93,11 @@ ...@@ -93,11 +93,11 @@
<el-form-item label="固定时段:" v-if="peopletype==1"> <el-form-item label="固定时段:" v-if="peopletype==1">
<div v-for="(x,y) in addMsg " :key="y" <div v-for="(x,y) in addMsg " :key="y"
style="display: flex;align-items: center;margin-top: 10px;"> style="display: flex;align-items: center;margin-top: 10px;">
<el-time-select :disabled="y==0" placeholder="起始时间" v-model="x.SrartHours" <el-time-select :disabled="y==0" placeholder="起始时间" v-model="x.StartHours"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', }"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select> </el-time-select>
<el-time-select :disabled="y==0" placeholder="结束时间" v-model="x.EndHours" <el-time-select :disabled="y==0" placeholder="结束时间" v-model="x.EndHours"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.SrartHours}"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
</el-time-select> </el-time-select>
<el-select v-model="x.EmpId" placeholder="请选择" @change="selectPersonnel(y)"> <el-select v-model="x.EmpId" placeholder="请选择" @change="selectPersonnel(y)">
<el-option filterable v-for="item in Employeelist" :key="item.Id" <el-option filterable v-for="item in Employeelist" :key="item.Id"
...@@ -112,11 +112,11 @@ ...@@ -112,11 +112,11 @@
<el-form-item label="固定时段:" v-if="peopletype==2"> <el-form-item label="固定时段:" v-if="peopletype==2">
<div v-for="(x,y) in addMsg " :key="y" > <div v-for="(x,y) in addMsg " :key="y" >
<div style="display: flex;align-items: flex-start;margin-top: 10px;"> <div style="display: flex;align-items: flex-start;margin-top: 10px;">
<el-time-select :disabled="y==0" placeholder="起始时间" v-model="x.SrartHours" <el-time-select :disabled="y==0" placeholder="起始时间" v-model="x.StartHours"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', }"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select> </el-time-select>
<el-time-select :disabled="y==0" placeholder="结束时间" v-model="x.EndHours" <el-time-select :disabled="y==0" placeholder="结束时间" v-model="x.EndHours"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.SrartHours}"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
</el-time-select> </el-time-select>
<div style="max-width: 320px;"> <div style="max-width: 320px;">
<div> <div>
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
default: '', default: '',
}, },
peopletype: { peopletype: {
type: String, type: Number,
default: 1, default: 1,
}, },
...@@ -212,11 +212,11 @@ ...@@ -212,11 +212,11 @@
created() { created() {
if (this.peopletype == 1) {//单人模式 if (this.peopletype == 1) {//单人模式
this.addMsg = [ this.addMsg = [
{ Id: 0, Week: '', IsDefault: 1, SrartHours: '00:00', EndHours: "00:00", EmpId: '', EmpName: '', } { Id: 0, Week: '', IsDefault: 1, StartHours: '00:00', EndHours: "00:00", EmpId: '', EmpName: '', }
] ]
} else { } else {
this.addMsg = [ this.addMsg = [
{ Id: 0, Week: '', IsDefault: 1, SrartHours: '00:00', EndHours: "00:00", EmpList: [], DeptList: [], returnString:[],} { Id: 0, Week: '', IsDefault: 1, StartHours: '00:00', EndHours: "00:00", EmpList: [], DeptList: [], returnString:[],}
] ]
} }
if (this.lsday != '') {//修改单独周几 if (this.lsday != '') {//修改单独周几
...@@ -271,10 +271,10 @@ ...@@ -271,10 +271,10 @@
}, },
adddata() { adddata() {
if (this.peopletype == 1) {//单人模式 if (this.peopletype == 1) {//单人模式
let obj = { Id: 0, Week: '', IsDefault: 2, SrartHours: '', EndHours: "", EmpId: '', EmpName: '', } let obj = { Id: 0, Week: '', IsDefault: 2, StartHours: '', EndHours: "", EmpId: '', EmpName: '', }
this.addMsg.push(obj) this.addMsg.push(obj)
} else { } else {
let obj = { Id: 0, Week: '', IsDefault: 2, SrartHours: '', EndHours: "", EmpList: [], DeptList: [], returnString:[],} let obj = { Id: 0, Week: '', IsDefault: 2, StartHours: '', EndHours: "", EmpList: [], DeptList: [], returnString:[],}
this.addMsg.push(obj) this.addMsg.push(obj)
} }
}, },
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
let isHours = false; let isHours = false;
this.addMsg.map((x, i) => { this.addMsg.map((x, i) => {
if (i > 0) { if (i > 0) {
if (x.SrartHours == '' || x.EndHours == '') { if (x.StartHours == '' || x.EndHours == '') {
isHours = true; isHours = true;
return return
} }
...@@ -386,7 +386,7 @@ ...@@ -386,7 +386,7 @@
let isHours = false; let isHours = false;
this.addMsg.map((x, i) => { this.addMsg.map((x, i) => {
if (i > 0) { if (i > 0) {
if (x.SrartHours == '' || x.EndHours == '') { if (x.StartHours == '' || x.EndHours == '') {
isHours = true; isHours = true;
return return
} }
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="添加内容:"> <el-form-item label="添加内容:">
<div v-if="addMsg.MediumModel.length>0"> <div v-if="addMsg.MediumModel && addMsg.MediumModel.length>0">
<div class="row items-center" v-for="(x,y) in addMsg.MediumModel" :key="y"> <div class="row items-center" v-for="(x,y) in addMsg.MediumModel" :key="y">
<i class="el-icon-link"></i> <i class="el-icon-link"></i>
<span style="margin-left: 10px;cursor: pointer;" >{{getType(x,'title')}}</span> <span style="margin-left: 10px;cursor: pointer;" >{{getType(x,'title')}}</span>
...@@ -229,7 +229,6 @@ ...@@ -229,7 +229,6 @@
if(type==1){ if(type==1){
this.outerVisible = true this.outerVisible = true
} }
this.dialogTitle = this.$t('fnc.xzrenyuan');
queryEmployee({}).then(res => { queryEmployee({}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.memberList = res.Data; this.memberList = res.Data;
......
<style>
.TreeCked {
margin: 20px 20px 0 20px;
color: #A8A8B3;
font-size: 14px;
}
.SendContent {
display: flex;
height: 450px;
}
.SendOne_Left {
width: 60%;
}
.SendOne_Right {
width: 40%;
}
.object_tit {
font-size: 14px;
color: #A8A8B3;
line-height: 35px;
margin-top: 12px;
overflow: hidden;
padding-right: 30px;
display: flex;
justify-content: space-between;
}
.object_tit span {
display: inline-block;
}
.objectList {
width: 100%;
height: 380px;
overflow: auto;
outline: none;
margin-right: 15px;
}
.objectList::-webkit-scrollbar {
width: 3px;
height: 3px;
background-color: #F5F5F5;
}
/*!*定义滚动条轨道 内阴影+圆角*!*/
.objectList::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
}
/*!*定义滑块 内阴影+圆角*!*/
.objectList::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));
background-color: #0ae;
}
.objectList ul {
padding: 0;
}
.objectList ul li {
list-style-type: none;
}
.objectList ul li div {
height: 40px;
line-height: 40px;
font-size: 14px;
cursor: pointer;
position: relative;
z-index: 3;
}
.objectList ul li a {
display: block;
padding-left: 16px;
width: 80%;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
float: left;
height: 40px;
line-height: 40px;
font-size: 14px;
color: #181E33;
text-decoration: none;
}
.objectList ul li a i {
color: #cad5e6;
}
.manageTitl:hover {
background: #F7FAFC;
}
.stuChilden {
display: none;
overflow-y: auto;
}
.showChild {
display: block;
}
.selectedCon {
height: 380px;
overflow: auto;
}
.selectedCon ul {
margin: 0;
padding: 0;
}
.selectedCon ul li {
height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
margin-left: 8px;
}
.selectedCon ul li i {
font-size: 18px;
cursor: pointer;
display: none;
}
.selectedCon ul li:hover i {
display: block;
}
.selectedCon ul li:hover {
background-color: #F7FAFC;
}
.selectedCon::-webkit-scrollbar {
width: 3px;
height: 3px;
background-color: #F5F5F5;
}
/*!*定义滚动条轨道 内阴影+圆角*!*/
.selectedCon::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
}
/*!*定义滑块 内阴影+圆角*!*/
.selectedCon::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));
background-color: #0ae;
}
</style>
<template> <template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale"> <q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 850px;max-width:900px;"> <q-card style="width:800px;max-width:800px;">
<q-card-section> <q-card-section>
<div class="text-h6">选择学员</div> <div class="text-h6">选择学员</div>
</q-card-section> </q-card-section>
...@@ -21,9 +188,56 @@ ...@@ -21,9 +188,56 @@
</div> </div>
</div> </div>
<q-card-section class="q-pt-none scroll" style="max-height: 50vh"> <q-card-section class="q-pt-none scroll" style="max-height: 50vh">
<el-tree :data="dataList" show-checkbox node-key="GuestId" ref="classStuTree" highlight-current <div class="SendContent">
:props="defaultProps"> <div class="SendOne_Left">
</el-tree> <div class="object_tit">
<span style="margin-left:20px;">班级/学生</span>
<span>全选</span>
</div>
<div class="objectList">
<ul>
<li v-for="(item,index) in dataList" :key="index">
<div class="manageTitl" @click="getChildShow(item)">
<a href="javascript:;" :title="item.Name">
<i class="iconfont icon-arrow-down" v-if="item.isShowChild"></i>
<i class="iconfont icon-arrow-right3" v-else></i>
{{item.Name}}
</a>
<span style="float:right;margin-right:35px;">
<el-checkbox v-model="item.IsCheck" @change="getFatherCheck(item)"></el-checkbox>
</span>
</div>
<ul class="stuChilden" :class="{'showChild':item.isShowChild}">
<li v-for="(subItem,subIndex) in item.SubList" :key="subIndex">
<div class="manageTitl" style="display:flex;justify-content:space-between;">
<div style="padding-left:40px;">{{subItem.Name}}</div>
<div style="padding-right:35px;">
<el-checkbox v-model="subItem.IsCheck" @change="getchildCheck(item)">
</el-checkbox>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="SendOne_Right">
<div class="TreeCked">
已选 {{checkedStu.length}}
</div>
<div class="selectedCon">
<ul>
<li v-for="(item,index) in checkedStu" :key="index">
<div>{{item.Name}}</div>
<div>
<i class="iconfont icon-shanchu2" @click="delChecked(item,index)"></i>
</div>
</li>
</ul>
</div>
</div>
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
...@@ -38,6 +252,12 @@ ...@@ -38,6 +252,12 @@
queryClassStudentTree, queryClassStudentTree,
} from '../../api/course/class'; } from '../../api/course/class';
export default { export default {
props: {
sendStudent: {
type: Array,
default: null
}
},
data() { data() {
return { return {
persistent: true, persistent: true,
...@@ -52,12 +272,59 @@ ...@@ -52,12 +272,59 @@
}, //查询参数 }, //查询参数
loading: false, //表格加载进度条 loading: false, //表格加载进度条
dataList: [], //数据列表 dataList: [], //数据列表
checkedStu: [], //选中数据
checked: false,
} }
}, },
mounted() { mounted() {
this.getClassStudentTree(); this.getClassStudentTree();
}, },
methods: { methods: {
//点击父级全选或取消
getFatherCheck(item) {
if (item && item.SubList && item.SubList.length > 0) {
item.SubList.forEach(y => {
y.IsCheck = item.IsCheck;
})
}
this.setStuChecked();
},
//点击子节点选中或取消
getchildCheck(item) {
let num = 0;
if (item && item.SubList && item.SubList.length > 0) {
item.SubList.forEach(x => {
if (x.IsCheck) {
num++
}
})
if (num == item.SubList.length) {
item.IsCheck = true;
} else {
item.IsCheck = false;
}
}
this.setStuChecked();
},
//删除选中名单
delChecked(item, index) {
this.checkedStu.splice(index, 1);
this.dataList.forEach(rootItem => {
if (rootItem.SubList && rootItem.SubList.length > 0) {
var chooseClassId = 0;
rootItem.SubList.forEach(sItem => {
if (sItem.GuestId == item.GuestId) {
sItem.IsCheck = false;
chooseClassId = sItem.ClassId
}
})
if (chooseClassId > 0 && chooseClassId == rootItem.ClassId) {
rootItem.IsCheck = false;
}
}
})
this.setStuChecked();
},
//重新查询 //重新查询
research() { research() {
this.getClassStudentTree(); this.getClassStudentTree();
...@@ -67,27 +334,76 @@ ...@@ -67,27 +334,76 @@
queryClassStudentTree(this.msg).then(res => { queryClassStudentTree(this.msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data; this.dataList = res.Data;
this.dataList.forEach(x => {
x.isShowChild = false;
})
this.initStuCheck();
} }
}) })
}, },
//设置选中或取消选中
setStuChecked() {
this.checkedStu = [];
if (this.dataList && this.dataList.length > 0) {
this.dataList.forEach(rootItem => {
if (rootItem.SubList && rootItem.SubList.length > 0) {
rootItem.SubList.forEach(sItem => {
if (sItem.IsCheck) {
this.checkedStu.push(sItem);
}
})
}
})
}
},
//初始化选中
initStuCheck() {
if (this.sendStudent) {
if (this.sendStudent && this.sendStudent.length > 0 && this.dataList && this.dataList.length > 0) {
this.dataList.forEach(rootItem => {
if (rootItem.SubList && rootItem.SubList.length > 0) {
var num = 0;
rootItem.SubList.forEach(sItem => {
this.sendStudent.forEach(item => {
if (sItem.GuestId == item.GuestId) {
sItem.IsCheck = true;
num++;
this.checkedStu.push(sItem);
}
})
})
if (num == rootItem.SubList.length) {
rootItem.IsCheck = true;
} else {
rootItem.IsCheck = false;
}
}
})
}
}
},
//关闭弹窗 //关闭弹窗
closeSaveForm() { closeSaveForm() {
this.$emit('close') this.$emit('close')
}, },
//确认选择 //确认选择
sureQuestionBank() { sureQuestionBank() {
var tempArray = []; this.$emit('success', this.checkedStu);
var checkArray = this.$refs.classStuTree.getCheckedNodes();
if (checkArray && checkArray.length > 0) {
checkArray.forEach(item => {
if (item.SubList && item.SubList.length > 0) {} else {
tempArray.push(item);
}
})
}
this.$emit('success', tempArray);
}, },
//点击父级
getChildShow(item) {
item.isShowChild = !item.isShowChild;
this.$forceUpdate();
}
}, },
watch: {
sendStudent: {
handler(newValue) {
this.initStuCheck();
},
deep: true
},
}
} }
</script> </script>
......
...@@ -116,13 +116,12 @@ ...@@ -116,13 +116,12 @@
ref="Id" :options="GroupList" label="分组" :dense="false" emit-value map-options /> ref="Id" :options="GroupList" label="分组" :dense="false" emit-value map-options />
</el-form-item> </el-form-item>
<el-form-item label="活码名称:"> <el-form-item label="活码名称:">
<q-input v-model="addMsg.Name" filled clearable label="活码名称" :rules="[val => !!val || '请输入活码名称']" /> <q-input v-model="addMsg.Name" filled clearable label="活码名称" :rules="[val => !!val || '请输入活码名称']" :disable='Nameforbid' />
<div style="color: red;">(一旦创建,不可修改)</div> <div style="color: red;">(一旦创建,不可修改)</div>
</el-form-item> </el-form-item>
<el-form-item label="自动添加好友:"> <el-form-item label="自动添加好友:">
<div class="q-gutter-sm" style="align-items: center;display: flex;"> <div class="q-gutter-sm" style="align-items: center;display: flex;width: 160%;">
<q-radio v-model="addMsg.SkipVerify" val="1" label="需验证" /> <q-radio v-model="addMsg.SkipVerify" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist2" :key='y' />
<q-radio v-model="addMsg.SkipVerify" val="2" label="自动添加" />
<span style="color: red;">(开启时,客户添加时无需企业成员确认,自动成为好友)</span> <span style="color: red;">(开启时,客户添加时无需企业成员确认,自动成为好友)</span>
</div> </div>
</el-form-item> </el-form-item>
...@@ -163,7 +162,7 @@ ...@@ -163,7 +162,7 @@
</el-form> </el-form>
</div> </div>
<div class="page-body"> <div class="page-body" v-show="!loading">
<div class="ant-card-head"> <div class="ant-card-head">
引流成员设置 引流成员设置
</div> </div>
...@@ -173,8 +172,7 @@ ...@@ -173,8 +172,7 @@
<el-form label-width="120px" style="padding: 15px 0 ;"> <el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="类型:"> <el-form-item label="类型:">
<div class="q-gutter-sm" style="align-items: center;display: flex;"> <div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.Type" val="1" label="单人" @input="btnType" /> <q-radio :disable = 'Nameforbid' v-model="addMsg.Type" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist3" :key='y' @input="btnType" />
<q-radio v-model="addMsg.Type" val="2" label="多人" @input="btnType" />
<span style="color: red;">(一旦创建,不可修改)</span> <span style="color: red;">(一旦创建,不可修改)</span>
</div> </div>
</el-form-item> </el-form-item>
...@@ -193,9 +191,10 @@ ...@@ -193,9 +191,10 @@
<div v-for="(x,y) in lsweeklist" :key="y+'b'" class="weekstyle2"> <div v-for="(x,y) in lsweeklist" :key="y+'b'" class="weekstyle2">
<div v-for="(item,index) in x.lsMsg" :key="index+'a1'" <div v-for="(item,index) in x.lsMsg" :key="index+'a1'"
style="width: 100%;;display: flex;flex-direction: column;align-items: center;border-bottom: 1px solid #e8e8e8;"> style="width: 100%;;display: flex;flex-direction: column;align-items: center;border-bottom: 1px solid #e8e8e8;">
<div>{{item.SrartHours}}~{{item.EndHours}}</div> <div>{{item.StartHours}}~{{item.EndHours}}</div>
<div> <div>
<q-btn outline color="primary" disable :label="item.EmpName" size="sm" /> <q-btn v-if="item.EmpId!=0" outline color="primary" disable :label="item.EmpName" size="sm" />
<q-btn v-if="item.EmpId==0" outline color="#FF0080" disable :label="item.EmpName" size="sm" />
</div> </div>
</div> </div>
</div> </div>
...@@ -204,7 +203,7 @@ ...@@ -204,7 +203,7 @@
<div v-for="(x,y) in lsweeklist" :key="y+'b'" class="weekstyle2"> <div v-for="(x,y) in lsweeklist" :key="y+'b'" class="weekstyle2">
<div v-for="(item,index) in x.lsMsg" :key="index+'a1'" <div v-for="(item,index) in x.lsMsg" :key="index+'a1'"
style="width: 100%;;display: flex;flex-direction: column;align-items: center;border-bottom: 1px solid #e8e8e8;"> style="width: 100%;;display: flex;flex-direction: column;align-items: center;border-bottom: 1px solid #e8e8e8;">
<div>{{item.SrartHours}}~{{item.EndHours}}</div> <div>{{item.StartHours}}~{{item.EndHours}}</div>
<el-tooltip class="item" effect="dark" :content="item.EmpName" placement="top"> <el-tooltip class="item" effect="dark" :content="item.EmpName" placement="top">
<div <div
style="width: 100%; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;cursor: pointer;text-align: center;"> style="width: 100%; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;cursor: pointer;text-align: center;">
...@@ -225,8 +224,7 @@ ...@@ -225,8 +224,7 @@
</el-form-item> </el-form-item>
<el-form-item label="特殊时期:"> <el-form-item label="特殊时期:">
<div class="q-gutter-sm" style="align-items: center;display: flex;"> <div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.SpecialDateEnable" val="1" label="开启" /> <q-radio v-model="addMsg.SpecialDateEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<q-radio v-model="addMsg.SpecialDateEnable" val="2" label="关闭" />
<span style="color: red;">(如遇到国家节假日或是企业自身重要日子,在特殊时期内,需要更换活码成员)</span> <span style="color: red;">(如遇到国家节假日或是企业自身重要日子,在特殊时期内,需要更换活码成员)</span>
</div> </div>
<div v-if="addMsg.SpecialDateEnable==1"> <div v-if="addMsg.SpecialDateEnable==1">
...@@ -240,13 +238,13 @@ ...@@ -240,13 +238,13 @@
</el-date-picker> </el-date-picker>
<div class="tsbox" v-for="(item,index) in x.list" :key='index'> <div class="tsbox" v-for="(item,index) in x.list" :key='index'>
<div style="display: flex;align-items: flex-start;margin-top: 10px;"> <div style="display: flex;align-items: flex-start;margin-top: 10px;">
<el-time-select :disabled="index==0" placeholder="起始时间" <el-time-select :disabled="item.IsDefault==1" placeholder="起始时间"
v-model="item.SrartHours" size="small" v-model="item.StartHours" size="small"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', }"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select> </el-time-select>
<el-time-select :disabled="index==0" placeholder="结束时间" <el-time-select :disabled="item.IsDefault==1" placeholder="结束时间"
v-model="item.EndHours" size="small" v-model="item.EndHours" size="small"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: item.SrartHours}"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: item.StartHours}">
</el-time-select> </el-time-select>
<el-select v-model="item.EmpList[0].Id" placeholder="请选择" size="small" <el-select v-model="item.EmpList[0].Id" placeholder="请选择" size="small"
v-if="addMsg.Type==1" @change="selectPersonnel(y,index)"> v-if="addMsg.Type==1" @change="selectPersonnel(y,index)">
...@@ -264,11 +262,11 @@ ...@@ -264,11 +262,11 @@
<el-button <el-button
@click="outerVisible=true,outerindex0=y,outerindex=index,byval=item.EmpList" @click="outerVisible=true,outerindex0=y,outerindex=index,byval=item.EmpList"
size="small">选择企业成员</el-button> size="small">选择企业成员</el-button>
<q-btn flat color="red" v-if="index>0" label="删除" <q-btn flat color="red" v-if="item.IsDefault!=1" label="删除"
@click="spweeklist[y].list.splice(index,1),getalluser()" /> @click="spweeklist[y].list.splice(index,1),getalluser()" />
</div> </div>
</div> </div>
<q-btn flat color="red" v-if="index>0 && addMsg.Type==1" label="删除" <q-btn flat color="red" v-if="item.IsDefault!=1 && addMsg.Type==1" label="删除"
@click="spweeklist[y].list.splice(index,1),getalluser()" /> @click="spweeklist[y].list.splice(index,1),getalluser()" />
</div> </div>
<div v-if="addMsg.Type==2"> <div v-if="addMsg.Type==2">
...@@ -299,8 +297,7 @@ ...@@ -299,8 +297,7 @@
<el-form-item label="员工添加上限:"> <el-form-item label="员工添加上限:">
<div class="q-gutter-sm" style="align-items: center;display: flex;"> <div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.EmpAddLimit" val="1" label="开启" /> <q-radio v-model="addMsg.EmpAddLimit" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<q-radio v-model="addMsg.EmpAddLimit" val="2" label="关闭" />
<span style="color: red;">(因受官方限制,无法对动态部门的员工设置添加好友上限,只可针对指定活码成员进行设置)</span> <span style="color: red;">(因受官方限制,无法对动态部门的员工设置添加好友上限,只可针对指定活码成员进行设置)</span>
</div> </div>
<div style="width: 70%;" v-if="addMsg.EmpAddLimit==1"> <div style="width: 70%;" v-if="addMsg.EmpAddLimit==1">
...@@ -343,8 +340,7 @@ ...@@ -343,8 +340,7 @@
<el-form label-width="120px" style="padding: 15px 0 ;"> <el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="扫码推送:"> <el-form-item label="扫码推送:">
<div class="q-gutter-sm" style="align-items: center;display: flex;"> <div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.WelcomeEnable" val="1" label="开启" /> <q-radio v-model="addMsg.WelcomeEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<q-radio v-model="addMsg.WelcomeEnable" val="2" label="关闭" />
<span style="color: red;">(关闭后,客户扫该渠道活码,依然可对该客户自动打标签,但仅收到系统的【欢迎语】消息)</span> <span style="color: red;">(关闭后,客户扫该渠道活码,依然可对该客户自动打标签,但仅收到系统的【欢迎语】消息)</span>
</div> </div>
</el-form-item> </el-form-item>
...@@ -373,8 +369,8 @@ ...@@ -373,8 +369,8 @@
<el-form label-width="120px" style="padding: 15px 0 ;"> <el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="状态:"> <el-form-item label="状态:">
<div class="q-gutter-sm" style="align-items: center;display: flex;"> <div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.WelcomeWeekEnable" val="1" label="开启" /> <q-radio v-model="addMsg.WelcomeWeekEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<q-radio v-model="addMsg.WelcomeWeekEnable" val="2" label="关闭" />
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -399,12 +395,12 @@ ...@@ -399,12 +395,12 @@
<div > <div >
<div style="display: flex;align-items: flex-start;" class="tsbox"> <div style="display: flex;align-items: flex-start;" class="tsbox">
<el-time-select placeholder="起始时间" <el-time-select placeholder="起始时间"
v-model="x.SrartHours" size="small" v-model="x.StartHours" size="small"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', }"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select> </el-time-select>
<el-time-select placeholder="结束时间" <el-time-select placeholder="结束时间"
v-model="x.EndHours" size="small" v-model="x.EndHours" size="small"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.SrartHours}"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
</el-time-select> </el-time-select>
<q-btn flat color="red" v-if="y>0" label="删除" <q-btn flat color="red" v-if="y>0" label="删除"
@click="abv(index,y,x)" /> @click="abv(index,y,x)" />
...@@ -431,8 +427,7 @@ ...@@ -431,8 +427,7 @@
<el-form label-width="120px" style="padding: 15px 0 ;"> <el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="状态:"> <el-form-item label="状态:">
<div class="q-gutter-sm" style="align-items: center;display: flex;"> <div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.WelcomeSpecialEnable" val="1" label="开启" /> <q-radio v-model="addMsg.WelcomeSpecialEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<q-radio v-model="addMsg.WelcomeSpecialEnable" val="2" label="关闭" />
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -457,12 +452,12 @@ ...@@ -457,12 +452,12 @@
<div > <div >
<div style="display: flex;align-items: flex-start;" class="tsbox"> <div style="display: flex;align-items: flex-start;" class="tsbox">
<el-time-select placeholder="起始时间" <el-time-select placeholder="起始时间"
v-model="x.SrartHours" size="small" v-model="x.StartHours" size="small"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', }"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select> </el-time-select>
<el-time-select placeholder="结束时间" <el-time-select placeholder="结束时间"
v-model="x.EndHours" size="small" v-model="x.EndHours" size="small"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.SrartHours}"> :picker-options="{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
</el-time-select> </el-time-select>
<q-btn flat color="red" v-if="y>0" label="删除" <q-btn flat color="red" v-if="y>0" label="删除"
@click="abv(index,y,x,2)" /> @click="abv(index,y,x,2)" />
...@@ -535,24 +530,27 @@ ...@@ -535,24 +530,27 @@
data() { data() {
return { return {
loading: false, loading: false,
radiolist:[{Id:1,Name:"开启"},{Id:2,Name:'关闭'}],
radiolist2:[{Id:1,Name:"需验证"},{Id:2,Name:'自动添加'}],
radiolist3:[{Id:1,Name:"单人"},{Id:2,Name:'多人'}],
addMsg: { addMsg: {
Id: 0, Id: 0,
ChannelGroupId: '',//分组Id ChannelGroupId: '',//分组Id
Name: '',//渠道活码名称 Name: '',//渠道活码名称
SkipVerify: "1",//自动添加好友 1需验证 2自动添加 SkipVerify: 1,//自动添加好友 1需验证 2自动添加
LabelIdList: [],//标签 LabelIdList: [],//标签
Type: '1',//类型 1单人 2多人 Type: 1,//类型 1单人 2多人
SpecialDateEnable: '2',//特殊时期 1开启 2未开启 SpecialDateEnable: 2,//特殊时期 1开启 2未开启
EmpAddLimit: '2',//员工添加上限 1开启 2未开启 EmpAddLimit: 2,//员工添加上限 1开启 2未开启
WeekList: [],//人员周期 WeekList: [],//人员周期
SpecialWeekList: [],//特殊周期 SpecialWeekList: [],//特殊周期
LimitList: [],//员工添加上限 LimitList: [],//员工添加上限
EmpBackUp:'',//备用员工 多人的话 英文逗号分隔 EmpBackUp:'',//备用员工 多人的话 英文逗号分隔
WelcomeEnable:'1',//是否启用欢迎语 1是 WelcomeEnable:2,//是否启用欢迎语 1是
WelcomeList:[{Id:0,Content:'',MediumIds:'',MediumModel:[]}],//通用欢迎语 WelcomeList:[{Id:0,Content:'',MediumIds:'',MediumModel:[]}],//通用欢迎语
WelcomeWeekEnable:'2',//周期欢迎语 1启用 WelcomeWeekEnable:2,//周期欢迎语 1启用
WelcomeWeekList:[], WelcomeWeekList:[],
WelcomeSpecialEnable:'2',//特殊时期欢迎语 1启用 WelcomeSpecialEnable:2,//特殊时期欢迎语 1启用
WelcomeSpecialList:[], WelcomeSpecialList:[],
}, },
GroupList: [],//分组数据 GroupList: [],//分组数据
...@@ -560,11 +558,11 @@ ...@@ -560,11 +558,11 @@
Lableshow: false, Lableshow: false,
ismember: false,//成员弹窗 ismember: false,//成员弹窗
lsMsg: [],//人员临时的msg lsMsg: [],//人员临时的msg
lsweeklist: [{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }],//周末 lsweeklist: [{ Id: 1, Name: '周一', chek: false ,lsMsg:[]}, { Id: 2, Name: '周二', chek: false ,lsMsg:[]}, { Id: 3, Name: '周三', chek: false ,lsMsg:[]}, { Id: 4, Name: '周四', chek: false ,lsMsg:[]}, { Id: 5, Name: '周五', chek: false ,lsMsg:[]}, { Id: 6, Name: '周六', chek: false ,lsMsg:[]}, { Id: 0, Name: '周日', chek: false ,lsMsg:[]}],//周末
editType: '',//选中修改 editType: '',//选中修改
lsday: '',//修改的时候记录是哪天的 lsday: '',//修改的时候记录是哪天的
spweeklist: [ spweeklist: [
{ Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, SrartHours: '00:00', EndHours: '00:00', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] }] } { Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, StartHours: '00:00', EndHours: '00:00', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] }] }
], ],
Employeelist: [],//人员单选数据 Employeelist: [],//人员单选数据
deptl: [],//部门下拉 deptl: [],//部门下拉
...@@ -578,12 +576,19 @@ ...@@ -578,12 +576,19 @@
splitterModel: 13, splitterModel: 13,
welcomeindex:'0', welcomeindex:'0',
wwlist:[{weeklist:[{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }], wwlist:[{weeklist:[{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }],
childrenlist:[{SrartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}] childrenlist:[{StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}]
}],//周期欢迎语 }],//周期欢迎语
editableTabsValue:'0', editableTabsValue:'0',
editableTabsValue2:'0', editableTabsValue2:'0',
wsplist:[{StartDate:'',EndDate:'', value:[],childrenlist:[{SrartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}] }],//特殊欢迎语 wsplist:[{StartDate:'',EndDate:'', value:[],childrenlist:[{StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}] }],//特殊欢迎语
isall:false,//验证通过 isall:false,//验证通过
Nameforbid:false,//渠道名称 修改时不能改变
}
},
mounted(){
if(this.$route.query && this.$route.query.Id){
this.getqudaodetails()//获取详情
this.Nameforbid=true
} }
}, },
created() { created() {
...@@ -591,31 +596,210 @@ ...@@ -591,31 +596,210 @@
this.getLableList()//获取标签列表 this.getLableList()//获取标签列表
this.queryEmployee()//单选 this.queryEmployee()//单选
this.getDepartList()//部门下拉 this.getDepartList()//部门下拉
if(this.$route.query && this.$route.query.Id){
this.getqudaodetails()//获取详情
}
}, },
methods: { methods: {
getqudaodetails(){//渠道详情 getqudaodetails(){//渠道详情
getWeChatChannelInfo({ChannelId:this.$route.query.Id}).then(res => { getWeChatChannelInfo({ChannelId:this.$route.query.Id}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.loading = true
this.addMsg = res.Data this.addMsg = res.Data
console.log(this.addMsg.LabelIdList) if(this.addMsg.LabelIdList && this.addMsg.LabelIdList.length>0){
this.addMsg.LabelIdList.map(z=>{ this.addMsg.LabelIdList.map(z=>{//处理标签
this.LableList.map(x => { this.LableList.map(x => {
let isexist = false let isexist = false
x.ChildList.map(j => { x.ChildList.map(j => {
if(z == x.Id){ if(z == j.Id){
j.chek = true j.chek = true
isexist=true isexist=true
}
})
if(isexist == true){
return
} }
}) })
if(isexist == true){ })
return }
if(this.addMsg.Type ==1){
this.addMsg.WeekList.map(x=>{//单人模式处理 人员
this.lsweeklist.map(j=>{
if(x.Week == j.Id){
j.chek = true;
// j.lsMsg= []
if(x.EmpList && x.EmpList.length>0){
x.EmpList.forEach(z=>{
let obj={
EmpId: z.Id,
EmpName: z.Name,
Id: x.Id,
IsDefault: x.IsDefault,
StartHours:x.StartHours,
EndHours:x.EndHours,
}
j.lsMsg.push(obj)
})
}else{
let obj={
EmpId: 0,
EmpName: '离职',
Id: x.Id,
IsDefault: x.IsDefault,
StartHours:x.StartHours,
EndHours:x.EndHours,
}
j.lsMsg.push(obj)
}
return
}
})
})
}else{
this.lsweeklist.map(x=>{//多人模式
this.addMsg.WeekList.map(j=>{
if(x.Id == j.Week){
x.chek = true;
// x.lsMsg = []
let eplist = [];
let EmpName = '';
j.EmpList.forEach(z=>{
let obj = {
DeptId:z.Id,
DeptName:z.Name,
}
eplist.push(obj)
EmpName = EmpName + z.Name + ','
})
let obj = {
Id:j.Id,
IsDefault:j.IsDefault,
StartHours:j.StartHours,
EndHours:j.EndHours,
EmpList:eplist,
DeptList:j.DeptList,
EmpName:EmpName,
returnString:[]
}
x.lsMsg.push(obj)
}
})
})
//多人的时候 备用员工处理处理
if(this.addMsg.EmpBackUp !='' ){
let data = this.addMsg.EmpBackUp.split(',')
this.EmpBackUpList =[]
data.forEach(x=>{
this.Employeelist.map(j=>{
if(x == j.Id){
let obj = {
DeptId:j.Id,
DeptName:j.EmployeeName
}
this.EmpBackUpList.push(obj)
return
}
})
})
}
}
//特殊时期 数据处理
if(this.addMsg.SpecialDateEnable==1 && this.addMsg.SpecialWeekList.length>0){
this.spweeklist= [];
this.addMsg.SpecialWeekList.forEach((x,y)=>{
let list = JSON.parse(JSON.stringify(x.ChlidList))
if(this.addMsg.Type==2){
setTimeout(()=>{
list = [];
x.ChlidList.forEach(j=>{
let returnString = []
let a = []
j.EmpList.forEach(z=>{
let epobj={
DeptId:z.Id,
DeptName:z.Name,
}
a.push(epobj)
})
j.DeptList.forEach(z=>{
returnString.push(z.Id)
})
let obj = {
DeptList:j.DeptList,
EmpList:a,
EndHours:j.EndHours,
IsDefault:j.IsDefault,
StartHours:j.StartHours,
returnString:returnString,
}
list.push(obj)
})
this.spweeklist[y].list = JSON.parse(JSON.stringify(list))
},10)
}
let obj= {
StartDate:x.StartDate,
EndDate:x.EndDate,
value:[x.StartDate,x.EndDate],
list:list
}
this.spweeklist.push(obj)
})
}
if(this.addMsg.EmpAddLimit==1 ){
this.addMsg.EmpBackUp = Number(this.addMsg.EmpBackUp)
}
//欢迎语通用处理
if(this.addMsg.WelcomeList==null || this.addMsg.WelcomeList.length==0){
this.addMsg.WelcomeList=[{Id:0,Content:'',MediumIds:'',MediumModel:[]}]//通用欢迎语
}else if(this.addMsg.WelcomeList.length>0){
this.addMsg.WelcomeList[0].MediumModel = this.addMsg.WelcomeList[0].MediumList?this.addMsg.WelcomeList[0].MediumList:[]
}
//周期欢迎语的处理
if(this.addMsg.WelcomeWeekList && this.addMsg.WelcomeWeekList.length>0){
let data = this.addMsg.WelcomeWeekList
data.forEach(x=>{
x.weeklist = [{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }]
x.childrenlist = x.ChildList
if(x.weeklist && x.weeklist.length>0){
x.weeklist.forEach(j=>{
if(x.Weeks.indexOf(j.Id) !=-1){
j.chek = true
}
})
}
if(x.childrenlist && x.childrenlist.length>0){
x.childrenlist.forEach(j=>{
j.MediumModel = j.MediumList?j.MediumList:[]
})
} }
}) })
}) this.wwlist = data
}
// wsplist:[{StartDate:'',EndDate:'', value:[],childrenlist:[{StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}] }],//特殊欢迎语
//特殊欢迎语的处理
if(this.addMsg.WelcomeSpecialList && this.addMsg.WelcomeSpecialList.length>0){
let data = this.addMsg.WelcomeSpecialList
data.forEach(x=>{
x.value = [x.StartDate,x.EndDate]
x.childrenlist = x.ChildList
if(x.childrenlist && x.childrenlist.length>0){
x.childrenlist.forEach(j=>{
j.MediumModel = j.MediumList?j.MediumList:[]
})
}
})
this.wsplist = data
}
this.loading = false
} }
}).catch(() => { }).catch(() => {
...@@ -640,6 +824,7 @@ ...@@ -640,6 +824,7 @@
this.deptl = res.Data; this.deptl = res.Data;
} }
}) })
}, },
getChannelGroupList() { getChannelGroupList() {
getWeChatChannelGroupList({}).then(res => { getWeChatChannelGroupList({}).then(res => {
...@@ -680,6 +865,7 @@ ...@@ -680,6 +865,7 @@
getsuccess(msg, lsweeklist) {//人员选择返回数据 getsuccess(msg, lsweeklist) {//人员选择返回数据
this.lsMsg = JSON.parse(JSON.stringify(msg)) this.lsMsg = JSON.parse(JSON.stringify(msg))
this.lsweeklist = lsweeklist; this.lsweeklist = lsweeklist;
console.log(lsweeklist)
if (this.addMsg.Type == 2) {//如果选择多人的时候 if (this.addMsg.Type == 2) {//如果选择多人的时候
this.lsweeklist.forEach(x => { this.lsweeklist.forEach(x => {
if (x.chek == true) { if (x.chek == true) {
...@@ -697,10 +883,12 @@ ...@@ -697,10 +883,12 @@
}, },
getsuccess2(list,type) { getsuccess2(list,type) {
console.log(list)
if(type==1){ if(type==1){
this.spweeklist[this.outerindex0].list[this.outerindex].EmpList = JSON.parse(JSON.stringify(list)) this.spweeklist[this.outerindex0].list[this.outerindex].EmpList = JSON.parse(JSON.stringify(list))
this.outerVisible = false; this.outerVisible = false;
this.getalluser() this.getalluser()
console.log(this.spweeklist)
}else{ }else{
console.log(list) console.log(list)
this.EmpBackUpList = list this.EmpBackUpList = list
...@@ -720,9 +908,9 @@ ...@@ -720,9 +908,9 @@
this.lsweeklist = [{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }] this.lsweeklist = [{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }]
if (this.addMsg.Type == 1) {//单人模式 if (this.addMsg.Type == 1) {//单人模式
this.spweeklist = [{ Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, SrartHours: '00:00', EndHours: '00:00', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] }] }] this.spweeklist = [{ Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, StartHours: '00:00', EndHours: '00:00', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] }] }]
} else { } else {
this.spweeklist = [{ Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, SrartHours: '00:00', EndHours: '00:00', EmpList: [], DeptList: [], returnString: [] }] }] this.spweeklist = [{ Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, StartHours: '00:00', EndHours: '00:00', EmpList: [], DeptList: [], returnString: [] }] }]
} }
this.addMsg.LimitList=[]; this.addMsg.LimitList=[];
this.addMsg.EmpBackUp = ''; this.addMsg.EmpBackUp = '';
...@@ -733,7 +921,7 @@ ...@@ -733,7 +921,7 @@
this.$router.go(-1);//返回上一层 this.$router.go(-1);//返回上一层
}, },
savemove() { savemove() {
this.isall == false//初始化 this.isall = false//初始化
if(this.addMsg.ChannelGroupId==''){ if(this.addMsg.ChannelGroupId==''){
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -761,10 +949,13 @@ ...@@ -761,10 +949,13 @@
}) })
this.addMsg.WeekList = []; this.addMsg.WeekList = [];
this.getWeekListdata()//处理企业人员的数据 给予后台 this.getWeekListdata()//处理企业人员的数据 给予后台
if (this.addMsg.SpecialDateEnable == 1) { console.log('特殊验证',this.isall)
if (this.addMsg.SpecialDateEnable == 1 && this.isall == false) {
this.getSpecialWeekListdata()//特殊时期的数据 this.getSpecialWeekListdata()//特殊时期的数据
} }
if(this.addMsg.Type==2 && this.addMsg.EmpAddLimit==1){//多人 备用开启 处理备用人员数据 console.log('处理备用人员数据',this.isall)
if(this.addMsg.Type==2 && this.addMsg.EmpAddLimit==1 && this.isall == false){//多人 备用开启 处理备用人员数据
if(this.EmpBackUpList.length>0){ if(this.EmpBackUpList.length>0){
let data = [] let data = []
this.EmpBackUpList.forEach(x=>{ this.EmpBackUpList.forEach(x=>{
...@@ -774,7 +965,9 @@ ...@@ -774,7 +965,9 @@
} }
} }
//验证欢迎语 //验证欢迎语
if(this.addMsg.WelcomeEnable==1){ console.log('验证欢迎语',this.isall)
if(this.addMsg.WelcomeEnable==1 && this.isall == false){
this.welcometverification() this.welcometverification()
} }
if(this.isall == false){ if(this.isall == false){
...@@ -798,7 +991,7 @@ ...@@ -798,7 +991,7 @@
}, },
welcometverification(){//欢迎语的验证 welcometverification(){//欢迎语的验证
//1 通用验证 //1 通用验证
if(this.addMsg.WelcomeList[0].Content==''){ if(this.addMsg.WelcomeList[0].Content=='' || this.addMsg.WelcomeList[0].Content==null){
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
message: `请输入通用欢迎语的内容`, message: `请输入通用欢迎语的内容`,
...@@ -807,12 +1000,21 @@ ...@@ -807,12 +1000,21 @@
this.isall = true this.isall = true
return return
} }
if(this.addMsg.WelcomeList[0].MediumModel && this.addMsg.WelcomeList[0].MediumModel .length>0){
let ids= []
this.addMsg.WelcomeList[0].MediumModel.forEach(z=>{
ids.push(z.Id)
})
this.addMsg.WelcomeList[0].MediumIds = ids.join(',');
}
//2 周期欢迎语 //2 周期欢迎语
if(this.addMsg.WelcomeWeekEnable==1){ if(this.addMsg.WelcomeWeekEnable==1){
let isweek = false; let isweek = false;
let isContent = false; let isContent = false;
let isHours = false; let isHours = false;
let data=[] let data=[]
this.wwlist.map(x=>{ this.wwlist.map(x=>{
isweek = false; isweek = false;
let obj={} let obj={}
...@@ -834,7 +1036,7 @@ ...@@ -834,7 +1036,7 @@
return return
} }
x.childrenlist.map(j=>{ x.childrenlist.map(j=>{
if (j.SrartHours == '' || j.EndHours == '') { if (j.StartHours == '' || j.EndHours == '') {
isHours = true; isHours = true;
return return
} }
...@@ -842,7 +1044,7 @@ ...@@ -842,7 +1044,7 @@
isContent = true isContent = true
return return
} }
obj.SrartHours = j.SrartHours; obj.StartHours = j.StartHours;
obj.EndHours = j.EndHours; obj.EndHours = j.EndHours;
obj.Id = j.Id; obj.Id = j.Id;
obj.Content = j.Content; obj.Content = j.Content;
...@@ -900,7 +1102,7 @@ ...@@ -900,7 +1102,7 @@
obj.StartDate = x.value[0] obj.StartDate = x.value[0]
obj.EndDate = x.value[1] obj.EndDate = x.value[1]
x.childrenlist.map(j=>{ x.childrenlist.map(j=>{
if (j.SrartHours == '' || j.EndHours == '') { if (j.StartHours == '' || j.EndHours == '') {
isHours = true; isHours = true;
return return
} }
...@@ -908,7 +1110,7 @@ ...@@ -908,7 +1110,7 @@
isContent = true isContent = true
return return
} }
obj.SrartHours = j.SrartHours; obj.StartHours = j.StartHours;
obj.EndHours = j.EndHours; obj.EndHours = j.EndHours;
obj.Id = j.Id; obj.Id = j.Id;
obj.Content = j.Content; obj.Content = j.Content;
...@@ -960,7 +1162,7 @@ ...@@ -960,7 +1162,7 @@
x.list.map((j, ji) => { x.list.map((j, ji) => {
if (isEmpId) return if (isEmpId) return
if (ji > 0) { if (ji > 0) {
if (j.SrartHours == '' || j.EndHours == '') { if (j.StartHours == '' || j.EndHours == '') {
isHours = true; isHours = true;
return return
} }
...@@ -1009,6 +1211,7 @@ ...@@ -1009,6 +1211,7 @@
list.push(obj) list.push(obj)
}) })
eplist= list eplist= list
console.log(eplist)
} }
let obj = { let obj = {
...@@ -1016,7 +1219,7 @@ ...@@ -1016,7 +1219,7 @@
StartDate: x.value[0], StartDate: x.value[0],
EndDate: x.value[1], EndDate: x.value[1],
IsDefault: j.IsDefault, IsDefault: j.IsDefault,
SrartHours: j.SrartHours, StartHours: j.StartHours,
EndHours: j.EndHours, EndHours: j.EndHours,
EmpList: eplist, EmpList: eplist,
DeptList: dlist, DeptList: dlist,
...@@ -1056,15 +1259,39 @@ ...@@ -1056,15 +1259,39 @@
}, },
getWeekListdata() { getWeekListdata() {
this.lsweeklist.forEach(x => { let show = false
let show2 = false
console.log(this.isall,'进入判断')
this.lsweeklist.map(x => {
if(show == true){
return
}
if(show2 == true){
return
}
if (x.chek == true) { if (x.chek == true) {
if (this.addMsg.Type == 1) { if (this.addMsg.Type == 1) {
x.lsMsg.forEach(j => { x.lsMsg.map(j => {
if(j.EmpId==0){//判断是否是离职的员工
this.isall = true
console.log(this.isall,'修改值 1 ')
show2 = true
this.$q.notify({
type: 'negative',
message: `周期人员有人离职,请重新选择`,
position: 'top'
})
return
}
if(show2== true){
return
}
let obj = { let obj = {
Id: j.Id, Id: j.Id,
Week: x.Id, Week: x.Id,
IsDefault: j.IsDefault, IsDefault: j.IsDefault,
SrartHours: j.SrartHours, StartHours: j.StartHours,
EndHours: j.EndHours, EndHours: j.EndHours,
EmpList: [ EmpList: [
{ Id: j.EmpId, Name: j.EmpName } { Id: j.EmpId, Name: j.EmpName }
...@@ -1074,29 +1301,51 @@ ...@@ -1074,29 +1301,51 @@
this.addMsg.WeekList.push(obj) this.addMsg.WeekList.push(obj)
}) })
} else { } else {
x.lsMsg.forEach(j => { x.lsMsg.forEach(j => {
let eplist = []
j.EmpList.forEach(z=>{
let epobj={
Id:z.DeptId,
Name:z.DeptName,
}
eplist.push(epobj)
})
let obj = { let obj = {
Id: j.Id, Id: j.Id,
Week: x.Id, Week: x.Id,
IsDefault: j.IsDefault, IsDefault: j.IsDefault,
SrartHours: j.SrartHours, StartHours: j.StartHours,
EndHours: j.EndHours, EndHours: j.EndHours,
EmpList: j.EmpList, EmpList: eplist,
DeptList: j.DeptList, DeptList: j.DeptList,
}; };
this.addMsg.WeekList.push(obj) this.addMsg.WeekList.push(obj)
}) })
} }
}else{
console.log(this.isall,'修改值 2 ')
this.$q.notify({
type: 'negative',
message: `请完善周期数据`,
position: 'top'
})
this.isall = true
show = true
return
} }
}) })
}, },
adddata(y) {//特殊时期的内部添加 adddata(y) {//特殊时期的内部添加
let obj let obj
if (this.addMsg.Type == 1) {//单人模式 if (this.addMsg.Type == 1) {//单人模式
obj = { IsDefault: 2, SrartHours: '', EndHours: '', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] } obj = { IsDefault: 2, StartHours: '', EndHours: '', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] }
} else { } else {
obj = { IsDefault: 2, SrartHours: '', EndHours: '', EmpList: [], DeptList: [], returnString: [] } obj = { IsDefault: 2, StartHours: '', EndHours: '', EmpList: [], DeptList: [], returnString: [] }
} }
this.spweeklist[y].list.push(obj) this.spweeklist[y].list.push(obj)
...@@ -1104,9 +1353,9 @@ ...@@ -1104,9 +1353,9 @@
addalldata() {//特殊时期的外部添加 addalldata() {//特殊时期的外部添加
let obj let obj
if (this.addMsg.Type == 1) {//单人模式 if (this.addMsg.Type == 1) {//单人模式
obj = { Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, SrartHours: '00:00', EndHours: '00:00', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] }] } obj = { Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, StartHours: '00:00', EndHours: '00:00', EmpList: [{ Id: '', Name: '' }], DeptList: [], returnString: [] }] }
} else { } else {
obj = { Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, SrartHours: '00:00', EndHours: '00:00', EmpList: [], DeptList: [], returnString: [] }] } obj = { Id: 0, StartDate: '', EndDate: '', value: '', list: [{ IsDefault: 1, StartHours: '00:00', EndHours: '00:00', EmpList: [], DeptList: [], returnString: [] }] }
} }
this.spweeklist.push(obj) this.spweeklist.push(obj)
...@@ -1204,18 +1453,19 @@ ...@@ -1204,18 +1453,19 @@
this.getalluser() this.getalluser()
}, },
getalluser() {//获取所以选择的成员的 上限处理 getalluser() {//获取所以选择的成员的 上限处理
this.addMsg.LimitList=[] let temporaryList = JSON.parse(JSON.stringify(this.addMsg.LimitList))
let newList = []
this.lsweeklist.forEach(x=>{//企业成员 this.lsweeklist.forEach(x=>{//企业成员
if(x.chek == true){ if(x.chek == true){
x.lsMsg.forEach(j=>{ x.lsMsg.forEach(j=>{
if(this.addMsg.Type==1){ if(this.addMsg.Type==1){
let obj = { Id: 0, EmpId: j.EmpId, EmpName: j.EmpName, LimitNum: '0' } let obj = { Id: 0, EmpId: j.EmpId, EmpName: j.EmpName, LimitNum: '0' }
this.addMsg.LimitList.push(obj) newList.push(obj)
}else{ }else{
j.EmpList.forEach(z=>{ j.EmpList.forEach(z=>{
let obj = { Id: 0, EmpId: z.DeptId, EmpName: z.DeptName, LimitNum: '0' } let obj = { Id: 0, EmpId: z.DeptId, EmpName: z.DeptName, LimitNum: '0' }
this.addMsg.LimitList.push(obj) newList.push(obj)
}) })
} }
...@@ -1225,7 +1475,7 @@ ...@@ -1225,7 +1475,7 @@
this.Employeelist.map(z=>{ this.Employeelist.map(z=>{
if(item.Id == z.Dept_Id){ if(item.Id == z.Dept_Id){
let obj = { Id: 0, EmpId: z.Id, EmpName: z.EmployeeName, LimitNum: '0' } let obj = { Id: 0, EmpId: z.Id, EmpName: z.EmployeeName, LimitNum: '0' }
this.addMsg.LimitList.push(obj) newList.push(obj)
} }
}) })
}) })
...@@ -1242,11 +1492,11 @@ ...@@ -1242,11 +1492,11 @@
if(this.addMsg.Type==1){ if(this.addMsg.Type==1){
if(item.Id!=''){ if(item.Id!=''){
obj = { Id: 0, EmpId: item.Id, EmpName: item.Name, LimitNum: '0' } obj = { Id: 0, EmpId: item.Id, EmpName: item.Name, LimitNum: '0' }
this.addMsg.LimitList.push(obj) newList.push(obj)
} }
}else{ }else{
obj = { Id: 0, EmpId: item.DeptId, EmpName: item.DeptName, LimitNum: '0' } obj = { Id: 0, EmpId: item.DeptId, EmpName: item.DeptName, LimitNum: '0' }
this.addMsg.LimitList.push(obj) newList.push(obj)
} }
}) })
...@@ -1256,7 +1506,7 @@ ...@@ -1256,7 +1506,7 @@
this.Employeelist.map(z=>{ this.Employeelist.map(z=>{
if(item.Id == z.Dept_Id){ if(item.Id == z.Dept_Id){
let obj = { Id: 0, EmpId: z.Id, EmpName: z.EmployeeName, LimitNum: '0' } let obj = { Id: 0, EmpId: z.Id, EmpName: z.EmployeeName, LimitNum: '0' }
this.addMsg.LimitList.push(obj) newList.push(obj)
} }
}) })
}) })
...@@ -1266,9 +1516,16 @@ ...@@ -1266,9 +1516,16 @@
}) })
} }
this.addMsg.LimitList = this.filterArr(this.addMsg.LimitList,'EmpId') newList = this.filterArr(newList,'EmpId')//去重
// console.log(this.addMsg.LimitList) this.addMsg.LimitList = JSON.parse(JSON.stringify(newList))
newList.forEach((x,y)=>{//如果人员没变动不修改输入值
temporaryList.map(j=>{
if(x.EmpId == j.EmpId){
this.addMsg.LimitList[y] = JSON.parse(JSON.stringify(j))
return
}
})
})
}, },
filterArr(Arr, data) {//根据参数去重 filterArr(Arr, data) {//根据参数去重
let newarr = {}; let newarr = {};
...@@ -1290,14 +1547,14 @@ ...@@ -1290,14 +1547,14 @@
handleTabsEdit(targetName, action){ handleTabsEdit(targetName, action){
if(action=='add'){ if(action=='add'){
this.wwlist.push({weeklist:[{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }], this.wwlist.push({weeklist:[{ Id: 1, Name: '周一', chek: false }, { Id: 2, Name: '周二', chek: false }, { Id: 3, Name: '周三', chek: false }, { Id: 4, Name: '周四', chek: false }, { Id: 5, Name: '周五', chek: false }, { Id: 6, Name: '周六', chek: false }, { Id: 0, Name: '周日', chek: false }],
childrenlist:[{SrartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}] childrenlist:[{StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}]
}) })
this.$forceUpdate(); this.$forceUpdate();
} }
}, },
handleTabsEdit2(targetName, action){ handleTabsEdit2(targetName, action){
if(action=='add'){ if(action=='add'){
this.wsplist.push({StartDate:'',EndDate:'', value:[],childrenlist:[{SrartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}] }) this.wsplist.push({StartDate:'',EndDate:'', value:[],childrenlist:[{StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}] })
this.$forceUpdate(); this.$forceUpdate();
} }
}, },
...@@ -1317,7 +1574,7 @@ ...@@ -1317,7 +1574,7 @@
}, },
addwelcomesjd(index,type=1){//周期添加欢迎语时间段 addwelcomesjd(index,type=1){//周期添加欢迎语时间段
let obj={SrartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]} let obj={StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}
if(type==1){//周期 if(type==1){//周期
this.wwlist[index].childrenlist.push(obj) this.wwlist[index].childrenlist.push(obj)
}else{//特殊 }else{//特殊
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<q-radio v-model="item.ChooseType" :val="1" label="从题库选题" /> <q-radio v-model="item.ChooseType" :val="1" label="从题库选题" />
<template v-if="item.ChooseType==1"> <template v-if="item.ChooseType==1">
<span style="position:relative;top:2px;">{{item.QuestionTypeNum}} 道 抽 <span style="position:relative;top:2px;">{{item.QuestionTypeNum}} 道 抽
<el-input style="width:100px;" size="small" :disabled="item.QuestionTypeNum<=0" v-model="item.ChooseNum" @keyup.native="checkInteger(item,'ChooseNum')" maxlength="5"></el-input> <el-input style="width:100px;" size="small" :disabled="item.QuestionTypeNum<=0" @input="getMaxInput(item)" v-model="item.ChooseNum" @keyup.native="checkInteger(item,'ChooseNum')" maxlength="5"></el-input>
&nbsp;&nbsp;</span> &nbsp;&nbsp;</span>
</template> </template>
</span> </span>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.ChooseList" :key="subIndex"> <div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.ChooseList" :key="subIndex">
{{subItem.DifficultyTypeName}} (共 {{subItem.DifficultyTypeName}} (共
{{subItem.DifficultyTypeCount}} 道) 抽 {{subItem.DifficultyTypeCount}} 道) 抽
<el-input style="width:100px;" size="small" :disabled="subItem.DifficultyTypeCount<=0" @keyup.native="checkInteger(subItem,'ChooseNum')" v-model="subItem.ChooseNum" maxlength="5"></el-input> <el-input style="width:100px;" size="small" :disabled="subItem.DifficultyTypeCount<=0" @input="getMaxMiniInput(subItem)" @keyup.native="checkInteger(subItem,'ChooseNum')" v-model="subItem.ChooseNum" maxlength="5"></el-input>
&nbsp;&nbsp; &nbsp;&nbsp;
</div> </div>
</template> </template>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<br /> <br />
<div class="row"> <div class="row">
<q-btn color="accent" size="sm" @click="setPaperTemplate" class="q-mr-md" label="保存"  /> <q-btn color="accent" size="sm" @click="setPaperTemplate" class="q-mr-md" label="保存" :loading="saveLoading" />
</div> </div>
<questionbankForm v-if="isShowQuestionBank"  @close="closeExamForm"  @success="getBankData"> <questionbankForm v-if="isShowQuestionBank"  @close="closeExamForm"  @success="getBankData">
</questionbankForm> </questionbankForm>
...@@ -132,6 +132,7 @@ ...@@ -132,6 +132,7 @@
BankList: [], BankList: [],
MoreQuestionTypeId: "", //更多题型 MoreQuestionTypeId: "", //更多题型
questionTypeList: [], //问题列表 questionTypeList: [], //问题列表
saveLoading:false
} }
}, },
created() { created() {
...@@ -142,6 +143,17 @@ ...@@ -142,6 +143,17 @@
}, },
methods: { methods: {
//设置最大值
getMaxInput(item){
if(item.ChooseNum>item.QuestionTypeNum){
item.ChooseNum='';
}
},
getMaxMiniInput(item){
if(item.ChooseNum>item.DifficultyTypeCount){
item.ChooseNum='';
}
},
//获取题型列表 //获取题型列表
getQuestionType() { getQuestionType() {
queryQuestionTypeList({}).then(res => { queryQuestionTypeList({}).then(res => {
...@@ -345,7 +357,7 @@ ...@@ -345,7 +357,7 @@
if (!this.$refs.TemplateNum.hasError) { if (!this.$refs.TemplateNum.hasError) {
let TotalNum = 0; let TotalNum = 0;
for(let i=0;i<this.templateMsg.TemplateData.length;i++){ for(let i=0;i<this.templateMsg.TemplateData.length;i++){
if(this.templateMsg.TemplateData[i].ChooseType==1&&this.templateMsg.TemplateData[i].ChooseNum==''){ if(this.templateMsg.TemplateData[i].ChooseType==1&&this.templateMsg.TemplateData[i].ChooseNum===''){
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
...@@ -363,7 +375,9 @@ ...@@ -363,7 +375,9 @@
}) })
return return
} }
this.saveLoading=true;
savePaperTemplate(this.templateMsg).then(res => { savePaperTemplate(this.templateMsg).then(res => {
this.saveLoading=false;
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
......
...@@ -235,7 +235,8 @@ ...@@ -235,7 +235,8 @@
</div> </div>
<div style="width:20%;text-align:right;"> <div style="width:20%;text-align:right;">
<q-btn color="accent" size="sm" class="q-mr-md" label="预览" /> <q-btn color="accent" size="sm" class="q-mr-md" label="预览" />
<q-btn color="accent" size="sm" class="q-mr-md" label="保存并返回" @click="SavePaper()" /> <q-btn color="accent" size="sm" class="q-mr-md" label="保存并返回" :loading="savePaperLoading"
@click="SavePaper()" />
</div> </div>
</div> </div>
<div class="Exam-main"> <div class="Exam-main">
...@@ -250,7 +251,7 @@ ...@@ -250,7 +251,7 @@
<div class="List-bt"> <div class="List-bt">
<strong class="f1"> <strong class="f1">
<template v-if="!gItem.isShowEdit">{{gIndex+1}}&nbsp;{{gItem.GroupName}} <template v-if="!gItem.isShowEdit">{{gIndex+1}}&nbsp;{{gItem.GroupName}}
(共{{gItem.DetailsList.length}}题,{{gItem.GScore}}分)</template> (共{{ gItem.DetailsList?gItem.DetailsList.length:0 }}题,{{gItem.GScore}}分)</template>
<template v-else> <template v-else>
<input style="width:160px;margin-right:10px;" v-model="gItem.GroupName" /> <input style="width:160px;margin-right:10px;" v-model="gItem.GroupName" />
<input style="width:40px;" filled v-model="gItem.GScore" @input="changeGroupScore(gItem)" /> <input style="width:40px;" filled v-model="gItem.GScore" @input="changeGroupScore(gItem)" />
...@@ -384,7 +385,7 @@ ...@@ -384,7 +385,7 @@
</div> </div>
<div class="col-12"> <div class="col-12">
<span class="difficulty_Degree">知识点:</span> <span class="difficulty_Degree">知识点:</span>
<a class="addKnowledge" @click="isShowPoint=true"> <a class="addKnowledge" @click="isShowPoint=true" style="cursor:pointer;">
<i class="iconfont icon-add" style="position:relative;top:1px;"></i>选择知识点 <i class="iconfont icon-add" style="position:relative;top:1px;"></i>选择知识点
</a> </a>
<span class="knowledge_List" v-for="(x, i) in choosePointArray" :key="i"> <span class="knowledge_List" v-for="(x, i) in choosePointArray" :key="i">
...@@ -395,6 +396,10 @@ ...@@ -395,6 +396,10 @@
</div> </div>
</div> </div>
<questionForm v-if="isShowQuestion" @close="closeQuestForm" @success="getQuestionList"></questionForm> <questionForm v-if="isShowQuestion" @close="closeQuestForm" @success="getQuestionList"></questionForm>
<!--选择知识点-->
<questionpoint v-if="isShowPoint" CourseId="0" :openDialog="isShowPoint" @closed="closeQuestionPoint"
:multiple="true" @selected="getPointList">
</questionpoint>
</div> </div>
</div> </div>
</template> </template>
...@@ -453,20 +458,26 @@ ...@@ -453,20 +458,26 @@
watch: { watch: {
'ChooseItem.Title': { 'ChooseItem.Title': {
handler(newValue) { handler(newValue) {
this.ChooseItem.ShowTitle = this.getRegItem(newValue); if (this.ChooseItem) {
this.ChooseItem.ShowTitle = this.getRegItem(newValue);
}
}, },
deep: true deep: true
}, },
'ChooseItem.Score': { 'ChooseItem.Score': {
handler(newValue) { handler(newValue) {
this.ChooseItem.Score = newValue; if (this.ChooseItem) {
this.calcPaper(); this.ChooseItem.Score = newValue;
this.calcPaper();
}
}, },
deep: true deep: true
}, },
'ChooseItem.QuestionContentObj': { 'ChooseItem.QuestionContentObj': {
handler(newValue) { handler(newValue) {
this.ChooseItem.QuestionContentObj = newValue; if (this.ChooseItem) {
this.ChooseItem.QuestionContentObj = newValue;
}
}, },
deep: true deep: true
} }
...@@ -493,7 +504,7 @@ ...@@ -493,7 +504,7 @@
GroupList: [], //试卷答题分类 GroupList: [], //试卷答题分类
}, },
//点击问题对象 //点击问题对象
ChooseItem: {}, ChooseItem: null,
questionDifficultyTypeList: [], //难易程度列表 questionDifficultyTypeList: [], //难易程度列表
questionLevalTypeList: [], questionLevalTypeList: [],
questionCategoryList: [], //分类 questionCategoryList: [], //分类
...@@ -506,7 +517,9 @@ ...@@ -506,7 +517,9 @@
examNum: 0, //题量 examNum: 0, //题量
examScore: 0, //总分 examScore: 0, //总分
ComOneIndex: -1, ComOneIndex: -1,
ComCheckIndex: -1 ComCheckIndex: -1,
savePaperLoading: false,
isShowPoint: false, //选择知识点
} }
}, },
created() { created() {
...@@ -524,6 +537,29 @@ ...@@ -524,6 +537,29 @@
} }
}, },
methods: { methods: {
//关闭知识点弹窗
closeQuestionPoint() {
this.isShowPoint = false;
},
//获取知识点列表
getPointList(obj) {
if (obj && obj.length > 0) {
if (this.choosePointArray && this.choosePointArray.length > 0) {
this.choosePointArray = this.choosePointArray.concat(obj);
} else {
this.choosePointArray = obj;
}
}
var pointIds = "";
if (this.choosePointArray && this.choosePointArray.length > 0) {
this.choosePointArray.forEach(item => {
pointIds += ',' + item.PointId
});
}
if (pointIds != '') {
this.ChooseItem.Knowledge = pointIds.substring(1);
}
},
//大类改变分数 //大类改变分数
changeGroupScore(gItem) { changeGroupScore(gItem) {
var subScore = 0; var subScore = 0;
...@@ -624,7 +660,8 @@ ...@@ -624,7 +660,8 @@
} else { } else {
let msg = { let msg = {
GId: item.GId, GId: item.GId,
QuestionTypeId: item.QuestionTypeId QuestionTypeId: item.QuestionTypeId,
PaperId: this.msg.PaperId,
} }
DeletePaperGroup(msg).then(res => { DeletePaperGroup(msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
...@@ -820,7 +857,7 @@ ...@@ -820,7 +857,7 @@
}, },
//点击问题 //点击问题
ClickItem(questionItem, index, index2) { ClickItem(questionItem, index, index2) {
this.ChooseItem = {}; this.ChooseItem = null;
this.ComOneIndex = index; this.ComOneIndex = index;
this.ComCheckIndex = index2; this.ComCheckIndex = index2;
this.ChooseItem = questionItem; this.ChooseItem = questionItem;
...@@ -832,6 +869,11 @@ ...@@ -832,6 +869,11 @@
this.$refs.UE_AnswerParse.reloadNewValue(); this.$refs.UE_AnswerParse.reloadNewValue();
} }
this.ChooseItem.AnswerParse = questionItem.AnswerParse; this.ChooseItem.AnswerParse = questionItem.AnswerParse;
if (questionItem.QuestionPointList) {
this.choosePointArray = questionItem.QuestionPointList;
} else {
this.choosePointArray = []
}
this.$forceUpdate(); this.$forceUpdate();
}, },
//正则匹配替换 //正则匹配替换
...@@ -842,7 +884,9 @@ ...@@ -842,7 +884,9 @@
//保存题目 //保存题目
SavePaper() { SavePaper() {
if (this.validateType()) { if (this.validateType()) {
this.savePaperLoading = true;
savePaperInfo(this.DataObj).then(res => { savePaperInfo(this.DataObj).then(res => {
this.savePaperLoading = false;
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
...@@ -851,11 +895,12 @@ ...@@ -851,11 +895,12 @@
message: '操作成功!', message: '操作成功!',
position: 'top' position: 'top'
}) })
// this.$router.push({ this.$router.push({
// path: '/exam/examPaper', path: '/exam/examPaper',
// query: {} query: {}
// }); });
this.GetPaperInfo(); // this.ChooseItem = null;
// this.GetPaperInfo();
} else { } else {
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
...@@ -869,186 +914,334 @@ ...@@ -869,186 +914,334 @@
//验证 //验证
validateType() { validateType() {
var result = true; var result = true;
for (let k = 0; k < this.DataObj.GroupList.length; k++) { if (this.DataObj && this.DataObj.GroupList && this.DataObj.GroupList.length > 0) {
//连线题 for (let k = 0; k < this.DataObj.GroupList.length; k++) {
if (this.DataObj.GroupList[k].QuestionTypeKey == 'matching') { var gIndex = k;
for (let j = 0; j < this.DataObj.GroupList[k].DetailsList.length; j++) { var newKey = this.DataObj.GroupList[k].QuestionTypeKey;
if (this.DataObj.GroupList[k].DetailsList[j].Title == '') { var gName = this.DataObj.GroupList[k].GroupName;
this.$q.notify({ var detailsList = this.DataObj.GroupList[k].DetailsList;
type: 'negative', var retMessage = "";
position: "top", switch (newKey) {
message: `${this.DataObj.GroupList[k].GroupName}${j+1}题标题为空!` //单选题
}) case "single":
result = false; retMessage = this.chooseValidate(gName, detailsList);
return; break;
//多选题
case 'multiple':
retMessage = this.chooseValidate(gName, detailsList);
break;
//填空题
case "fill-in":
retMessage = this.fillInValidate(gName, detailsList);
break;
//判断题
case "judge":
retMessage = this.judgeValidate(gName, detailsList);
break;
//简答题
case "short-answer":
retMessage = this.shortanswerValidate(gName, detailsList);
break;
//名词解释
case "noun-explanation":
retMessage = this.shortanswerValidate(gName, detailsList);
break;
//论述题
case "essay-question":
retMessage = this.shortanswerValidate(gName, detailsList);
break;
//计算题
case "calculation":
retMessage = this.shortanswerValidate(gName, detailsList);
break;
//分录题
case "entry-problem":
retMessage = this.fillInValidate(gName, detailsList);
break;
//资料题
case "data-question":
retMessage = this.fillInValidate(gName, detailsList);
break;
//连线题
case "matching":
retMessage = this.matchingValidate(gName, detailsList);
break;
//排序题
case "sorting-problem":
retMessage = this.sortingproblemValidate(gName, detailsList);
break;
//完型填空
case "cloze":
retMessage = this.clozeValidate(gName, detailsList);
break;
//阅读理解
case "reading-comprehensio":
retMessage = this.readingcomprehensioValidate(gName, detailsList);
break;
//口语题
case "spoken":
retMessage = this.shortanswerValidate(gName, detailsList);
break;
//听力题
case "listening":
retMessage = this.readingcomprehensioValidate(gName, detailsList);
break;
//公用选项题
case "sharing-choose":
retMessage = this.sharingchooseValidate(gName, detailsList);
break;
//其它题
case "other":
retMessage = this.shortanswerValidate(gName, detailsList);
break;
//单选题-数字
case "single-number":
retMessage = this.chooseValidate(gName, detailsList);
break;
}
if (retMessage != '') {
this.$q.notify({
type: 'negative',
position: "top",
message: retMessage
});
result = false;
return;
}
}
}
return result;
},
//【单选题、多选题、数字选择题】验证
chooseValidate(gName, detailsList) {
var message = "";
//单选题 多选题
if (detailsList && detailsList.length > 0) {
for (let i = 0; i < detailsList.length; i++) {
var Num = 0;
if (detailsList[i].Title == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return message;
}
for (let j = 0; j < detailsList[i].QuestionContentObj.length; j++) {
if (detailsList[i].QuestionContentObj[j].Content == '') {
message = `请填写【${gName}】第 ${i+1} 题,选项 ${detailsList[i].QuestionContentObj[j].Name} 内容!`;
return message;
} }
if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj.length > 0) { if (detailsList[i].QuestionContentObj[j].IsAnswer) {
for (let p = 0; p < this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0].length; p++) { Num++
if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[0][p].Content == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `${this.DataObj.GroupList[k].GroupName}${j+1}题第一组第${p+1}行数据内容为空!`
})
result = false;
return;
}
}
} }
if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj.length > 0) { }
for (let p = 0; p < this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[1].length; p++) { if (Num == 0) {
if (this.DataObj.GroupList[k].DetailsList[j].QuestionContentObj[1][p].Content == '') { message = `请设置【${gName}】第 ${i+1} 题 正确答案!`;
this.$q.notify({ return message;
type: 'negative', }
position: "top", }
message: `${this.DataObj.GroupList[k].GroupName}${j+1}题第二组第${p+1}行数据内容为空!` }
}) return message;
result = false; },
return; //【填空题、分录题、资料题】验证
} fillInValidate(gName, detailsList) {
} var message = "";
for (let i = 0; i < detailsList.length; i++) {
if (detailsList[i].Title == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return message;
}
for (let j = 0; j < detailsList[i].QuestionContentObj.length; j++) {
if (detailsList[i].QuestionContentObj[j].Content == '') {
message = `请填写【${gName}】第 ${i+1} 题,第 ${j+1} 空 答案!`;
return message;
}
}
}
return message;
},
//【判断题】验证
judgeValidate(gName, detailsList) {
var message = "";
for (let i = 0; i < detailsList.length; i++) {
if (detailsList[i].Title == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return message;
}
}
return message;
},
//【简答题、名词解释、论述题、计算题、其它题】验证
shortanswerValidate(gName, detailsList) {
var message = "";
for (let i = 0; i < detailsList.length; i++) {
if (detailsList[i].Title == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return message;
}
if (detailsList[i].Answer == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题答案!`;
return message;
}
}
return message;
},
//【连线题】验证
matchingValidate(gName, detailsList) {
var message = "";
for (let i = 0; i < detailsList.length; i++) {
if (detailsList[i].Title == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return message;
}
if (detailsList[i].QuestionContentObj.length > 0) {
for (let p = 0; p < detailsList[i].QuestionContentObj[0].length; p++) {
if (detailsList[i].QuestionContentObj[0][p].Content == '') {
message = `请填写【${gName}】第 ${i+1} 题 第一组 选项 ${detailsList[i].QuestionContentObj[0][p].Name} 内容!`
return message;
} }
} }
} }
//单选题 多选题 if (detailsList[i].QuestionContentObj.length > 0) {
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single' || for (let p = 0; p < detailsList[i].QuestionContentObj[1].length; p++) {
this.DataObj.GroupList[k].QuestionTypeKey == 'multiple' if (detailsList[i].QuestionContentObj[1][p].Content == '') {
) { message = `请填写【${gName}】第 ${i+1} 题 第二组 选项 ${detailsList[i].QuestionContentObj[1][p].Name} 内容!`
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) { return message;
var Num = 0; }
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') { }
this.$q.notify({ }
type: 'negative', }
position: "top", return message;
message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!` },
}) //【排序题】验证
result = false; sortingproblemValidate(gName, detailsList) {
return; var message = "";
if (detailsList && detailsList.length > 0) {
for (let i = 0; i < detailsList.length; i++) {
if (detailsList[i].Title == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return message;
}
for (let j = 0; j < detailsList[i].QuestionContentObj[0].length; j++) {
if (detailsList[i].QuestionContentObj[0][j].Content == '') {
message = `请填写【${gName}】第 ${i+1} 题 选项 ${detailsList[i].QuestionContentObj[0][j].Name} 内容!`
return message;
} }
for (let j = 0; j < this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj.length; j++) { }
if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].Content == '') { }
this.$q.notify({ }
type: 'negative', return message;
position: "top", },
message: `请填写${this.DataObj.GroupList[k].GroupName}${i+1}题选项!` //【完型填空】验证
}) clozeValidate(gName, detailsList) {
result = false; var message = "";
return; if (detailsList && detailsList.length > 0) {
for (let i = 0; i < detailsList.length; i++) {
if (detailsList[i].Title == '') {
message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return message;
}
for (let j = 0; j < detailsList[i].QuestionContentObj.length; j++) {
var Num = 0;
for (var k = 0; k < detailsList[i].QuestionContentObj[j].length; k++) {
if (detailsList[i].QuestionContentObj[j][k].Content == '') {
message =
`请填写【${gName}】第 ${i+1} 题,第 ${j+1} 小题 选项 ${detailsList[i].QuestionContentObj[j][k].Name} 内容!`;
return message;
} }
if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].IsAnswer) { if (detailsList[i].QuestionContentObj[j][k].IsAnswer) {
Num++ Num++
} }
} }
if (Num == 0) { if (Num == 0) {
this.$q.notify({ message = `请设置【${gName}】第 ${i+1} 题,第 ${j+1} 小题 正确答案!`;
type: 'negative', return message;
position: "top",
message: `请设置${this.DataObj.GroupList[k].GroupName}${i+1}题答案选项`
})
result = false;
return;
} }
} }
} }
//填空题 }
if (this.DataObj.GroupList[k].QuestionTypeKey == 'fill-in') { return message;
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) { },
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') { //【阅读理解、听力题】验证
this.$q.notify({ readingcomprehensioValidate(gName, detailsList) {
type: 'negative', var message = "";
position: "top", if (detailsList && detailsList.length > 0) {
message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!` for (let i = 0; i < detailsList.length; i++) {
}) if (detailsList[i].Title == '') {
result = false; message = `请填写【${gName}】第 ${i+1} 题 问题内容!`;
return; return message;
}
for (let j = 0; j < this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj.length; j++) {
if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].Content == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写${this.DataObj.GroupList[k].GroupName}${i+1}空!`
})
result = false;
return;
}
}
} }
} for (let j = 0; j < detailsList[i].QuestionContentObj.length; j++) {
//判断题 var subQuestion = detailsList[i].QuestionContentObj[j];
if (this.DataObj.GroupList[k].QuestionTypeKey == 'judge' || if (subQuestion) {
this.DataObj.GroupList[k].QuestionTypeKey == 'reading-comprehensio' || if (subQuestion.SubTitle == '') {
this.DataObj.GroupList[k].QuestionTypeKey == 'spoken' || message = `请填写【${gName}】第 ${i+1} 题,第 ${j+1} 小题 问题内容!`;
this.DataObj.GroupList[k].QuestionTypeKey == 'other' || return message;
this.DataObj.GroupList[k].QuestionTypeKey == 'noun-explanation') { }
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) { //单选题、多选题
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') { if (subQuestion.QuestionKey == 'single' || subQuestion.QuestionKey == "multiple") {
this.$q.notify({ var singleNum = 0;
type: 'negative', for (var k = 0; k < subQuestion.SubAnwser.length; k++) {
position: "top", if (subQuestion.SubAnwser[k].Content == '') {
message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!` message = `请填写【${gName}】第 ${i+1} 题,第 ${j+1} 小题 选项 ${subQuestion.SubAnwser[k].Name} 内容!`;
}) return message;
result = false; }
return; if (subQuestion.SubAnwser[k].IsAnswer) {
singleNum++
}
}
if (singleNum == 0) {
message = `请设置【${gName}】第 ${i+1} 题,第 ${j+1} 小题 正确答案!`;
return message;
}
}
//填空题
if (subQuestion.QuestionKey == "fill-in") {
for (var k = 0; k < subQuestion.SubAnwser.length; k++) {
if (subQuestion.SubAnwser[k].Content == '') {
message = `请填写【${gName}】第 ${i+1} 题,第 ${j+1} 小题 第 ${k+1} 空答案!`;
return message;
}
}
}
//简答题
if (subQuestion.QuestionKey == "short-answer") {
for (var k = 0; k < subQuestion.SubAnwser.length; k++) {
if (subQuestion.SubAnwser[k].Content == '') {
message = `请填写【${gName}】第 ${i+1} 题,第 ${j+1} 小题答案!`;
return message;
}
}
}
} }
} }
} }
//简答题 论述题 }
if (this.DataObj.GroupList[k].QuestionTypeKey == 'short-answer' || return message;
this.DataObj.GroupList[k].QuestionTypeKey == 'essay-question' || },
this.DataObj.GroupList[k].QuestionTypeKey == 'calculation' || //【公用选项题】验证
this.DataObj.GroupList[k].QuestionTypeKey == 'entry-problem' || sharingchooseValidate(gName, detailsList) {
this.DataObj.GroupList[k].QuestionTypeKey == 'data-question' var message = "";
) { if (detailsList && detailsList.length > 0) {
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) { for (var i = 0; i < detailsList.length; i++) {
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') { for (var j = 0; j < detailsList[i].QuestionContentObj[0].length; j++) {
this.$q.notify({ if (detailsList[i].QuestionContentObj[0][j].Content == '') {
type: 'negative', message = `请填写【${gName}】第 ${i+1} 题 第一组 选项 ${detailsList[i].QuestionContentObj[0][j].Name} 内容!`;
position: "top", return message;
message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!`
})
result = false;
return;
}
if (this.DataObj.GroupList[k].DetailsList[i].Answer == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入${this.DataObj.GroupList[k].GroupName}${i+1}题答案`
})
result = false;
return;
} }
} }
} for (var j = 0; j < detailsList[i].QuestionContentObj[1].length; j++) {
//排序题 if (detailsList[i].QuestionContentObj[1][j].Content == '') {
if (this.DataObj.GroupList[k].QuestionTypeKey == 'sorting-problem') { message = `请填写【${gName}】第 ${i+1} 题 第二组 题干 ${j+1} 内容!`;
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) { return message;
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!`
})
result = false;
return;
} }
for (let j = 0; j < this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[0].length; j++) { if (detailsList[i].QuestionContentObj[1][j].Name == '') {
if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[0][j].Content == '') { message = `请选择【${gName}】第 ${i+1} 题 第二组 题干 ${j+1} 答案!`;
this.$q.notify({ return message;
type: 'negative',
position: "top",
message: `请填写${this.DataObj.GroupList[k].GroupName}${i+1}题选项!`
})
result = false;
return;
}
} }
} }
} }
} }
return result; return message;
}, },
//关闭弹窗
closeQuestForm() { closeQuestForm() {
this.isShowQuestion = false; this.isShowQuestion = false;
}, },
......
...@@ -445,7 +445,7 @@ ...@@ -445,7 +445,7 @@
this.examNum += x.DetailsList.length; this.examNum += x.DetailsList.length;
x.DetailsList.forEach(y => { x.DetailsList.forEach(y => {
if (y.Score) { if (y.Score) {
this.examScore += parseInt(y.Score); this.examScore += Number(y.Score);
} }
}) })
} }
......
...@@ -231,7 +231,7 @@ ...@@ -231,7 +231,7 @@
<div class="row"> <div class="row">
<q-btn color="accent" @click="setPublishExam" class="q-mr-md" label="发布考试"  /> <q-btn color="accent" @click="setPublishExam" class="q-mr-md" label="发布考试"  />
</div> </div>
<classstutreeForm v-if="isShowClassStu"  @close="closeClassStuForm"  @success="getClassStuList"> <classstutreeForm v-if="isShowClassStu" :sendStudent="sendStudent"  @close="closeClassStuForm"  @success="getClassStuList">
</classstutreeForm> </classstutreeForm>
</div> </div>
</template> </template>
...@@ -282,6 +282,7 @@ ...@@ -282,6 +282,7 @@
}, },
isShowClassStu: false, //是否显示学员弹窗 isShowClassStu: false, //是否显示学员弹窗
sendStudent:[], //传送已选学生
} }
}, },
created() { created() {
...@@ -295,6 +296,23 @@ ...@@ -295,6 +296,23 @@
}, },
mounted() { mounted() {
},
watch:{
"postMsg.StudentList":{
handler(val){
this.sendStudent = [];
val.forEach(x=>{
let obj={
ClassId:x.ClassId,
CourseId:x.CourseId,
GuestId:x.GuestId,
Name:x.GuestName,
OrderId:x.OrderId
}
this.sendStudent.push(obj);
})
}
}
}, },
methods: { methods: {
//删除发放对象 //删除发放对象
...@@ -305,7 +323,6 @@ ...@@ -305,7 +323,6 @@
queryExamPublish({ queryExamPublish({
Id: this.postMsg.Id Id: this.postMsg.Id
}).then(res => { }).then(res => {
console.log("res", res);
if (res.Code == 1) { if (res.Code == 1) {
var tempData = res.Data; var tempData = res.Data;
if (tempData) { if (tempData) {
...@@ -347,6 +364,7 @@ ...@@ -347,6 +364,7 @@
}, },
//获取选中的需要列表 //获取选中的需要列表
getClassStuList(array) { getClassStuList(array) {
this.postMsg.StudentList=[];
if (array && array.length > 0) { if (array && array.length > 0) {
array.forEach(item => { array.forEach(item => {
this.postMsg.StudentList.push({ this.postMsg.StudentList.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment