Commit e3cdf48e authored by Mac's avatar Mac

1

parent 45462d72
......@@ -312,7 +312,7 @@ export function SetSynvEduEmployee(data) {
*/
export function getWeChatChannelInfo(data) {
return request({
url: '/QYWeChat/GetWeChatChannelInfo',
url: '/QYWeChat/GetWeChatChannelInfo_V2',
method: 'post',
data
})
......
......@@ -93,11 +93,11 @@
<el-form-item label="固定时段:" v-if="peopletype==1">
<div v-for="(x,y) in addMsg " :key="y"
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', }">
</el-time-select>
<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-select v-model="x.EmpId" placeholder="请选择" @change="selectPersonnel(y)">
<el-option filterable v-for="item in Employeelist" :key="item.Id"
......@@ -112,11 +112,11 @@
<el-form-item label="固定时段:" v-if="peopletype==2">
<div v-for="(x,y) in addMsg " :key="y" >
<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', }">
</el-time-select>
<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>
<div style="max-width: 320px;">
<div>
......@@ -184,7 +184,7 @@
default: '',
},
peopletype: {
type: String,
type: Number,
default: 1,
},
......@@ -212,11 +212,11 @@
created() {
if (this.peopletype == 1) {//单人模式
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 {
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 != '') {//修改单独周几
......@@ -271,10 +271,10 @@
},
adddata() {
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)
} 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)
}
},
......@@ -306,7 +306,7 @@
let isHours = false;
this.addMsg.map((x, i) => {
if (i > 0) {
if (x.SrartHours == '' || x.EndHours == '') {
if (x.StartHours == '' || x.EndHours == '') {
isHours = true;
return
}
......@@ -386,7 +386,7 @@
let isHours = false;
this.addMsg.map((x, i) => {
if (i > 0) {
if (x.SrartHours == '' || x.EndHours == '') {
if (x.StartHours == '' || x.EndHours == '') {
isHours = true;
return
}
......
......@@ -98,7 +98,7 @@
</div>
</el-form-item>
<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">
<i class="el-icon-link"></i>
<span style="margin-left: 10px;cursor: pointer;" >{{getType(x,'title')}}</span>
......@@ -229,7 +229,6 @@
if(type==1){
this.outerVisible = true
}
this.dialogTitle = this.$t('fnc.xzrenyuan');
queryEmployee({}).then(res => {
if (res.Code == 1) {
this.memberList = res.Data;
......
......@@ -116,13 +116,12 @@
ref="Id" :options="GroupList" label="分组" :dense="false" emit-value map-options />
</el-form-item>
<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>
</el-form-item>
<el-form-item label="自动添加好友:">
<div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.SkipVerify" val="1" label="需验证" />
<q-radio v-model="addMsg.SkipVerify" val="2" label="自动添加" />
<div class="q-gutter-sm" style="align-items: center;display: flex;width: 160%;">
<q-radio v-model="addMsg.SkipVerify" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist2" :key='y' />
<span style="color: red;">(开启时,客户添加时无需企业成员确认,自动成为好友)</span>
</div>
</el-form-item>
......@@ -163,7 +162,7 @@
</el-form>
</div>
<div class="page-body">
<div class="page-body" v-show="!loading">
<div class="ant-card-head">
引流成员设置
</div>
......@@ -173,8 +172,7 @@
<el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="类型:">
<div class="q-gutter-sm" style="align-items: center;display: flex;">
<q-radio v-model="addMsg.Type" val="1" label="单人" @input="btnType" />
<q-radio v-model="addMsg.Type" val="2" 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" />
<span style="color: red;">(一旦创建,不可修改)</span>
</div>
</el-form-item>
......@@ -193,9 +191,10 @@
<div v-for="(x,y) in lsweeklist" :key="y+'b'" class="weekstyle2">
<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;">
<div>{{item.SrartHours}}~{{item.EndHours}}</div>
<div>{{item.StartHours}}~{{item.EndHours}}</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>
......@@ -204,7 +203,7 @@
<div v-for="(x,y) in lsweeklist" :key="y+'b'" class="weekstyle2">
<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;">
<div>{{item.SrartHours}}~{{item.EndHours}}</div>
<div>{{item.StartHours}}~{{item.EndHours}}</div>
<el-tooltip class="item" effect="dark" :content="item.EmpName" placement="top">
<div
style="width: 100%; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;cursor: pointer;text-align: center;">
......@@ -225,8 +224,7 @@
</el-form-item>
<el-form-item label="特殊时期:">
<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="2" label="关闭" />
<q-radio v-model="addMsg.SpecialDateEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<span style="color: red;">(如遇到国家节假日或是企业自身重要日子,在特殊时期内,需要更换活码成员)</span>
</div>
<div v-if="addMsg.SpecialDateEnable==1">
......@@ -240,13 +238,13 @@
</el-date-picker>
<div class="tsbox" v-for="(item,index) in x.list" :key='index'>
<div style="display: flex;align-items: flex-start;margin-top: 10px;">
<el-time-select :disabled="index==0" placeholder="起始时间"
v-model="item.SrartHours" size="small"
<el-time-select :disabled="item.IsDefault==1" placeholder="起始时间"
v-model="item.StartHours" size="small"
:picker-options="{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select>
<el-time-select :disabled="index==0" placeholder="结束时间"
<el-time-select :disabled="item.IsDefault==1" placeholder="结束时间"
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-select v-model="item.EmpList[0].Id" placeholder="请选择" size="small"
v-if="addMsg.Type==1" @change="selectPersonnel(y,index)">
......@@ -264,11 +262,11 @@
<el-button
@click="outerVisible=true,outerindex0=y,outerindex=index,byval=item.EmpList"
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()" />
</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()" />
</div>
<div v-if="addMsg.Type==2">
......@@ -299,8 +297,7 @@
<el-form-item label="员工添加上限:">
<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="2" label="关闭" />
<q-radio v-model="addMsg.EmpAddLimit" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<span style="color: red;">(因受官方限制,无法对动态部门的员工设置添加好友上限,只可针对指定活码成员进行设置)</span>
</div>
<div style="width: 70%;" v-if="addMsg.EmpAddLimit==1">
......@@ -343,8 +340,7 @@
<el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="扫码推送:">
<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="2" label="关闭" />
<q-radio v-model="addMsg.WelcomeEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
<span style="color: red;">(关闭后,客户扫该渠道活码,依然可对该客户自动打标签,但仅收到系统的【欢迎语】消息)</span>
</div>
</el-form-item>
......@@ -373,8 +369,8 @@
<el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="状态:">
<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="2" label="关闭" />
<q-radio v-model="addMsg.WelcomeWeekEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
</div>
</el-form-item>
</el-form>
......@@ -399,12 +395,12 @@
<div >
<div style="display: flex;align-items: flex-start;" class="tsbox">
<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', }">
</el-time-select>
<el-time-select placeholder="结束时间"
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>
<q-btn flat color="red" v-if="y>0" label="删除"
@click="abv(index,y,x)" />
......@@ -431,8 +427,7 @@
<el-form label-width="120px" style="padding: 15px 0 ;">
<el-form-item label="状态:">
<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="2" label="关闭" />
<q-radio v-model="addMsg.WelcomeSpecialEnable" :val="x.Id" :label="x.Name" v-for="(x,y) in radiolist" :key='y' />
</div>
</el-form-item>
</el-form>
......@@ -457,12 +452,12 @@
<div >
<div style="display: flex;align-items: flex-start;" class="tsbox">
<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', }">
</el-time-select>
<el-time-select placeholder="结束时间"
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>
<q-btn flat color="red" v-if="y>0" label="删除"
@click="abv(index,y,x,2)" />
......@@ -535,24 +530,27 @@
data() {
return {
loading: false,
radiolist:[{Id:1,Name:"开启"},{Id:2,Name:'关闭'}],
radiolist2:[{Id:1,Name:"需验证"},{Id:2,Name:'自动添加'}],
radiolist3:[{Id:1,Name:"单人"},{Id:2,Name:'多人'}],
addMsg: {
Id: 0,
ChannelGroupId: '',//分组Id
Name: '',//渠道活码名称
SkipVerify: "1",//自动添加好友 1需验证 2自动添加
SkipVerify: 1,//自动添加好友 1需验证 2自动添加
LabelIdList: [],//标签
Type: '1',//类型 1单人 2多人
SpecialDateEnable: '2',//特殊时期 1开启 2未开启
EmpAddLimit: '2',//员工添加上限 1开启 2未开启
Type: 1,//类型 1单人 2多人
SpecialDateEnable: 2,//特殊时期 1开启 2未开启
EmpAddLimit: 2,//员工添加上限 1开启 2未开启
WeekList: [],//人员周期
SpecialWeekList: [],//特殊周期
LimitList: [],//员工添加上限
EmpBackUp:'',//备用员工 多人的话 英文逗号分隔
WelcomeEnable:'1',//是否启用欢迎语 1是
WelcomeEnable:2,//是否启用欢迎语 1是
WelcomeList:[{Id:0,Content:'',MediumIds:'',MediumModel:[]}],//通用欢迎语
WelcomeWeekEnable:'2',//周期欢迎语 1启用
WelcomeWeekEnable:2,//周期欢迎语 1启用
WelcomeWeekList:[],
WelcomeSpecialEnable:'2',//特殊时期欢迎语 1启用
WelcomeSpecialEnable:2,//特殊时期欢迎语 1启用
WelcomeSpecialList:[],
},
GroupList: [],//分组数据
......@@ -560,11 +558,11 @@
Lableshow: false,
ismember: false,//成员弹窗
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: '',//选中修改
lsday: '',//修改的时候记录是哪天的
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: [],//人员单选数据
deptl: [],//部门下拉
......@@ -578,12 +576,19 @@
splitterModel: 13,
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 }],
childrenlist:[{SrartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}]
childrenlist:[{StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}]
}],//周期欢迎语
editableTabsValue:'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,//验证通过
Nameforbid:false,//渠道名称 修改时不能改变
}
},
mounted(){
if(this.$route.query && this.$route.query.Id){
this.getqudaodetails()//获取详情
this.Nameforbid=true
}
},
created() {
......@@ -591,31 +596,210 @@
this.getLableList()//获取标签列表
this.queryEmployee()//单选
this.getDepartList()//部门下拉
if(this.$route.query && this.$route.query.Id){
this.getqudaodetails()//获取详情
}
},
methods: {
getqudaodetails(){//渠道详情
getWeChatChannelInfo({ChannelId:this.$route.query.Id}).then(res => {
if (res.Code == 1) {
this.loading = true
this.addMsg = res.Data
console.log(this.addMsg.LabelIdList)
this.addMsg.LabelIdList.map(z=>{
this.LableList.map(x => {
let isexist = false
x.ChildList.map(j => {
if(z == x.Id){
j.chek = true
isexist=true
if(this.addMsg.LabelIdList && this.addMsg.LabelIdList.length>0){
this.addMsg.LabelIdList.map(z=>{//处理标签
this.LableList.map(x => {
let isexist = false
x.ChildList.map(j => {
if(z == j.Id){
j.chek = 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(() => {
......@@ -640,6 +824,7 @@
this.deptl = res.Data;
}
})
},
getChannelGroupList() {
getWeChatChannelGroupList({}).then(res => {
......@@ -680,6 +865,7 @@
getsuccess(msg, lsweeklist) {//人员选择返回数据
this.lsMsg = JSON.parse(JSON.stringify(msg))
this.lsweeklist = lsweeklist;
console.log(lsweeklist)
if (this.addMsg.Type == 2) {//如果选择多人的时候
this.lsweeklist.forEach(x => {
if (x.chek == true) {
......@@ -697,10 +883,12 @@
},
getsuccess2(list,type) {
console.log(list)
if(type==1){
this.spweeklist[this.outerindex0].list[this.outerindex].EmpList = JSON.parse(JSON.stringify(list))
this.outerVisible = false;
this.getalluser()
console.log(this.spweeklist)
}else{
console.log(list)
this.EmpBackUpList = list
......@@ -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 }]
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 {
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.EmpBackUp = '';
......@@ -733,7 +921,7 @@
this.$router.go(-1);//返回上一层
},
savemove() {
this.isall == false//初始化
this.isall = false//初始化
if(this.addMsg.ChannelGroupId==''){
this.$q.notify({
type: 'negative',
......@@ -761,10 +949,13 @@
})
this.addMsg.WeekList = [];
this.getWeekListdata()//处理企业人员的数据 给予后台
if (this.addMsg.SpecialDateEnable == 1) {
console.log('特殊验证',this.isall)
if (this.addMsg.SpecialDateEnable == 1 && this.isall == false) {
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){
let data = []
this.EmpBackUpList.forEach(x=>{
......@@ -774,7 +965,9 @@
}
}
//验证欢迎语
if(this.addMsg.WelcomeEnable==1){
console.log('验证欢迎语',this.isall)
if(this.addMsg.WelcomeEnable==1 && this.isall == false){
this.welcometverification()
}
if(this.isall == false){
......@@ -798,7 +991,7 @@
},
welcometverification(){//欢迎语的验证
//1 通用验证
if(this.addMsg.WelcomeList[0].Content==''){
if(this.addMsg.WelcomeList[0].Content=='' || this.addMsg.WelcomeList[0].Content==null){
this.$q.notify({
type: 'negative',
message: `请输入通用欢迎语的内容`,
......@@ -807,12 +1000,21 @@
this.isall = true
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 周期欢迎语
if(this.addMsg.WelcomeWeekEnable==1){
let isweek = false;
let isContent = false;
let isHours = false;
let data=[]
this.wwlist.map(x=>{
isweek = false;
let obj={}
......@@ -834,7 +1036,7 @@
return
}
x.childrenlist.map(j=>{
if (j.SrartHours == '' || j.EndHours == '') {
if (j.StartHours == '' || j.EndHours == '') {
isHours = true;
return
}
......@@ -842,7 +1044,7 @@
isContent = true
return
}
obj.SrartHours = j.SrartHours;
obj.StartHours = j.StartHours;
obj.EndHours = j.EndHours;
obj.Id = j.Id;
obj.Content = j.Content;
......@@ -900,7 +1102,7 @@
obj.StartDate = x.value[0]
obj.EndDate = x.value[1]
x.childrenlist.map(j=>{
if (j.SrartHours == '' || j.EndHours == '') {
if (j.StartHours == '' || j.EndHours == '') {
isHours = true;
return
}
......@@ -908,7 +1110,7 @@
isContent = true
return
}
obj.SrartHours = j.SrartHours;
obj.StartHours = j.StartHours;
obj.EndHours = j.EndHours;
obj.Id = j.Id;
obj.Content = j.Content;
......@@ -960,7 +1162,7 @@
x.list.map((j, ji) => {
if (isEmpId) return
if (ji > 0) {
if (j.SrartHours == '' || j.EndHours == '') {
if (j.StartHours == '' || j.EndHours == '') {
isHours = true;
return
}
......@@ -1009,6 +1211,7 @@
list.push(obj)
})
eplist= list
console.log(eplist)
}
let obj = {
......@@ -1016,7 +1219,7 @@
StartDate: x.value[0],
EndDate: x.value[1],
IsDefault: j.IsDefault,
SrartHours: j.SrartHours,
StartHours: j.StartHours,
EndHours: j.EndHours,
EmpList: eplist,
DeptList: dlist,
......@@ -1056,15 +1259,39 @@
},
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 (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 = {
Id: j.Id,
Week: x.Id,
IsDefault: j.IsDefault,
SrartHours: j.SrartHours,
StartHours: j.StartHours,
EndHours: j.EndHours,
EmpList: [
{ Id: j.EmpId, Name: j.EmpName }
......@@ -1074,29 +1301,51 @@
this.addMsg.WeekList.push(obj)
})
} else {
x.lsMsg.forEach(j => {
let eplist = []
j.EmpList.forEach(z=>{
let epobj={
Id:z.DeptId,
Name:z.DeptName,
}
eplist.push(epobj)
})
let obj = {
Id: j.Id,
Week: x.Id,
IsDefault: j.IsDefault,
SrartHours: j.SrartHours,
StartHours: j.StartHours,
EndHours: j.EndHours,
EmpList: j.EmpList,
EmpList: eplist,
DeptList: j.DeptList,
};
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) {//特殊时期的内部添加
let obj
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 {
obj = { IsDefault: 2, SrartHours: '', EndHours: '', EmpList: [], DeptList: [], returnString: [] }
obj = { IsDefault: 2, StartHours: '', EndHours: '', EmpList: [], DeptList: [], returnString: [] }
}
this.spweeklist[y].list.push(obj)
......@@ -1104,9 +1353,9 @@
addalldata() {//特殊时期的外部添加
let obj
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 {
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)
......@@ -1204,18 +1453,19 @@
this.getalluser()
},
getalluser() {//获取所以选择的成员的 上限处理
this.addMsg.LimitList=[]
let temporaryList = JSON.parse(JSON.stringify(this.addMsg.LimitList))
let newList = []
this.lsweeklist.forEach(x=>{//企业成员
if(x.chek == true){
x.lsMsg.forEach(j=>{
if(this.addMsg.Type==1){
let obj = { Id: 0, EmpId: j.EmpId, EmpName: j.EmpName, LimitNum: '0' }
this.addMsg.LimitList.push(obj)
newList.push(obj)
}else{
j.EmpList.forEach(z=>{
let obj = { Id: 0, EmpId: z.DeptId, EmpName: z.DeptName, LimitNum: '0' }
this.addMsg.LimitList.push(obj)
newList.push(obj)
})
}
......@@ -1225,7 +1475,7 @@
this.Employeelist.map(z=>{
if(item.Id == z.Dept_Id){
let obj = { Id: 0, EmpId: z.Id, EmpName: z.EmployeeName, LimitNum: '0' }
this.addMsg.LimitList.push(obj)
newList.push(obj)
}
})
})
......@@ -1242,11 +1492,11 @@
if(this.addMsg.Type==1){
if(item.Id!=''){
obj = { Id: 0, EmpId: item.Id, EmpName: item.Name, LimitNum: '0' }
this.addMsg.LimitList.push(obj)
newList.push(obj)
}
}else{
obj = { Id: 0, EmpId: item.DeptId, EmpName: item.DeptName, LimitNum: '0' }
this.addMsg.LimitList.push(obj)
newList.push(obj)
}
})
......@@ -1256,7 +1506,7 @@
this.Employeelist.map(z=>{
if(item.Id == z.Dept_Id){
let obj = { Id: 0, EmpId: z.Id, EmpName: z.EmployeeName, LimitNum: '0' }
this.addMsg.LimitList.push(obj)
newList.push(obj)
}
})
})
......@@ -1266,9 +1516,16 @@
})
}
this.addMsg.LimitList = this.filterArr(this.addMsg.LimitList,'EmpId')
// console.log(this.addMsg.LimitList)
newList = this.filterArr(newList,'EmpId')//去重
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) {//根据参数去重
let newarr = {};
......@@ -1290,14 +1547,14 @@
handleTabsEdit(targetName, action){
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 }],
childrenlist:[{SrartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}]
childrenlist:[{StartHours:'',EndHours:'',Id:0,Content:'',MediumIds:'',MediumModel:[]}]
})
this.$forceUpdate();
}
},
handleTabsEdit2(targetName, action){
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();
}
},
......@@ -1317,7 +1574,7 @@
},
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){//周期
this.wwlist[index].childrenlist.push(obj)
}else{//特殊
......
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