Commit 30be9636 authored by 黄奎's avatar 黄奎

酒店信息修改

parent fe87c6d5
<template> <template>
<div> <div>
<div class="query-box" style="border-bottom: none;"> <div style="width: 100%; overflow-x: auto;padding-bottom: 10px; " class="ownScrollbarStyle">
<ul> <table border="0" cellspacing="1" cellpadding="0" class="changeHotelDetailsTalbe">
<li v-if="isShowBtn==1"> <tr>
<input type="button" class="fr normalBtn mb30" value="批量同意" @click="ChangeHotelInfo(2)"/> <th colspan="14">酒店信息</th>
<input type="button" class="fr normalBtn mb30" value="批量拒绝" @click="ChangeHotelInfo(3)"/> </tr>
</li> <tr>
</ul> <th>
</div> 公司团号
<div style="width: 100%; overflow-x: auto;padding-bottom: 10px; " class="ownScrollbarStyle"> </th>
<table border="0" cellspacing="1" cellpadding="0" class="changeHotelDetailsTalbe"> <th colspan="12" class="tdLeft">
<tr> <a class="link" @click="goUrlT('productQuery',TCNUM,'产品查询')">{{TCNUM}}</a>
<th class="fz14" colspan="14">酒店信息</th> </th>
<!-- <th class="fz14" colspan="12">地接操作信息</th> --> <th>
</tr> <input type="button" class="fr normalBtn mb30" value="确认" @click="ChangeHotelInfo()" />
<tr> </th>
<th width="120">公司团号</th> </tr>
<th width="200">原酒店名称</th> <tr>
<th width="120">入住时间</th> <th width="120">入住时间</th>
<th width="120">机位总数/(Y/E/F)</th> <th width="80">选择酒店</th>
<th width="120">占床/不占床</th> <th width="200">原酒店名称</th>
<th width="80">实际用房数</th> <th width="120">机位数(Y/E/F)</th>
<th width="150">房间类型</th> <th width="120">占床/不占床</th>
<th width="80">房间数</th> <th width="80">实际用房数</th>
<th width="80">房间人数</th> <th width="150">房间类型</th>
<th width="200">新酒店名称</th> <th width="80">房间数</th>
<th width="150">房间预定数</th> <th width="80">房间人数</th>
<th width="120">尚差房间数</th> <th width="200">新酒店名称</th>
<th width="80">单价/每人</th> <th width="150">房间预定数</th>
<!--<th width="80">免减人数</th> <th width="120">尚差房间数</th>
<th width="80">金额小计</th> --> <th width="80">单价/每人</th>
<th width="80">操作</th> <th width="100">状态</th>
<!-- <th width="80">付款方式</th> </tr>
<th width="80">联系电话</th> <template v-for="(item,index) in DataList">
<th width="80">地址</th> <template v-for="(subItem,subIndex) in item.HotelOrderList">
<th width="80">订团号</th> <tr v-for="(childItem,childIndex) in subItem.OrderDetailsList">
<th width="80">备注</th> --> <td v-if="childIndex==0&&subIndex==0" :rowspan="5*item.HotelOrderList.length" class="tdCenter">
</tr> {{item.UseTimeStr}}
<tr v-for="(item,index) in list"> </td>
<td :rowspan="list.length" v-if="index==0"> <td v-if="childIndex==0" :rowspan="5" class="tdCenter">
<div class="w120"> <el-checkbox v-model='subItem.IsChecked'></el-checkbox>
<p class="link" @click="goUrlT('productQuery',TCNUM,'产品查询')">{{TCNUM}}</p> </td>
</div> <td v-if="childIndex==0" :rowspan="5" class="tdLeft">
</td> <p class="link" style="word-break: normal;" @click="goUrlR('HotelManagement',HotelId.HotelId,'酒店管理')">
<td><div class="w200 padding10"> {{subItem.HotelName}}</p>
<p class="link" style="word-break: normal;" @click="goUrlR('HotelManagement',item.HotelId,'酒店管理')">{{item.HotelName}}</p> </td>
</div> <td v-if="childIndex==0" :rowspan="5" class="tdCenter">
</td> <p class="link" @click="goUrlT('RegistrationList',item.TCID,'报名清单')">
<td><div class="w100">{{item.CheckInDateStr}}</div></td> {{subItem.HouseStatistics.RealityYSeatNum}}/{{subItem.HouseStatistics.RealityESeatNum}}/{{subItem.HouseStatistics.RealityFSeatNum}}
<td> </p>
<div class="w120"> </td>
<p class="link" @click="goUrlT('RegistrationList',item.TCID,'报名清单')">{{flightTotal}}/{{item.HouseStatistics.RealityYSeatNum}}/{{item.HouseStatistics.RealityESeatNum}}/{{item.HouseStatistics.RealityFSeatNum}}</p> <td v-if="childIndex==0" :rowspan="5" class="tdCenter">
</div> <p class="link" @click="goUrlT('passengerHouse',item.TCIDS,'房间分配')">
</td> {{subItem.HouseStatistics.NeedBed}}/{{subItem.HouseStatistics.NoNeedBed}}</p>
<td><div class="w120"> </td>
<p class="link" @click="goUrlT('passengerHouse',item.TCIDS,'房间分配')">{{item.HouseStatistics.NeedBed}}/{{item.HouseStatistics.NoNeedBed}}</p> <td v-if="childIndex==0" :rowspan="5" class="tdCenter">
</div></td> {{subItem.HouseStatistics.RealityRoomNum}}
<td><div class="w120">{{item.HouseStatistics.RealityRoomNum}}</div></td> </td>
<td><div class="w150"> <td class="tdCenter">
<p class="pHouseStyle" v-for="o in item.HouseStatistics.HouseTypeList"> {{subItem.HouseStatistics.HouseTypeList[childIndex].HouseTypeName}}
{{o.HouseTypeName}} </td>
</p> <td class="tdCenter">
</div></td> {{subItem.HouseStatistics.HouseTypeList[childIndex].HouseTypeCount}}
<td><div class="w80"> </td>
<p class="pHouseStyle" v-for="o in item.HouseStatistics.HouseTypeList"> <td class="tdCenter">
{{o.HouseTypeCount}} {{subItem.HouseStatistics.HouseTypeList[childIndex].HouseGuestNum}}
</p> </td>
</div></td> <td v-if="childIndex==0" :rowspan="5" class="tdLeft">
<td><div class="w80"> {{subItem.NewHotelName}}
<p class="pHouseStyle" v-for="o in item.HouseStatistics.HouseTypeList"> </td>
{{o.HouseGuestNum}} <td class="tdCenter">
</p> {{childItem.HouseTypeCount}}
</div></td> </td>
<td><div class="w150"> <td class="tdCenter">
{{item.NewHotelName}} {{childItem.HouseTypeCount-subItem.HouseStatistics.HouseTypeList[childIndex].HouseTypeCount}}
</div></td> </td>
<td> <td class="tdCenter">
<div class="w120"> {{childItem.UnitPrice}}
<p class="pHouseStyle" v-for="o in item.OrderDetailsList"> </td>
{{o.HouseTypeCount}} <td class="tdCenter" v-if="childIndex==0" :rowspan="5">
</p> <template v-if="subItem.OPState==1">
</div> OP-OK
</td> </template>
<td> <template v-else>
<div class="w120"> {{subItem.DMCState==1?"地接-OK":(subItem.DMCState==2?"地接-暂定":"地接-未操作")}}
<p class="pHouseStyle" :class="{colorRed:o.HouseTypeCount-item.HouseStatistics.HouseTypeList[index].HouseTypeCount<0}" v-for="(o,index) in item.OrderDetailsList"> </template>
{{o.HouseTypeCount-item.HouseStatistics.HouseTypeList[index].HouseTypeCount}} </td>
</p> </tr>
</div> </template>
</td> </template>
<td> </table>
<div class="w120"> </div>
<p class="pHouseStyle" v-for="(o,index) in item.OrderDetailsList" @input="calculationPrice(item)"> </div>
{{o.UnitPrice}}
</p>
</div>
</td>
<!-- <td>
<div class="w80">
<p class="pHouseStyle" v-for="(o,index) in item.OrderDetailsList" @input="calculationPrice(item)">
{{o.HotelDiscount}}
</p>
</div>
</td>
<td>
<div class="w80">
<p class="pHouseStyle" v-for="(o,index) in item.OrderDetailsList">
{{o.UnitPrice*(o.HouseGuestNum-o.HotelDiscount)}}
</p>
</div>
</td> -->
<td>
<div class="w120">
<span v-if="item.HotelChangeState==1">
<input type="button" class="normalBtn" value="同意" @click="HotelChangeState(item,2)"/>
<input type="button" class="normalBtn" value="拒绝" @click="HotelChangeState(item,3)"/>
</span>
</div>
</td>
<!-- <td><div class="w120">
<el-select class='w100 sel' v-model='item.PayStyle' :placeholder="$t('pub.pleaseSel')">
<el-option label='请选择' value='0' ></el-option>
<el-option label='现付' value='1' ></el-option>
<el-option label='签单' value='2' ></el-option>
<el-option label='实物抵扣' value='5' ></el-option>
<el-option label='预付' value='4' ></el-option>
</el-select>
</div></td>
<td><div class="w120">{{item.Tel}}</div></td>
<td><div class="w200 padding10">{{item.Address}}</div></td>
<td>
<div class="w150">
<el-input class='w120' v-model='item.ReserveNo'></el-input>
</div>
</td>
<td>
<div class="w150">
<el-input type='textarea' class='w120' v-model='item.Remarks'></el-input>
</div>
</td> -->
</tr>
</table>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
defaultSelectValue:0, DataList: [],
list:[], TCNUM: '',
roomList:[], TCIDs: "",
TCNUM:'', isShowBtn: 0,
flightTotal:0, }
GuestNum:0,
hotelList:[],
isShowBtn:0,
}
},
methods: {
goUrl(path, obj, name) {
this.$router.push({
path: path,
query: {
id: obj.HotelId,
blank: "y",
tab: name
}
});
},
goUrlR(path,obj,title){
this.$router.push({ name:path,query:{"ID":obj,blank:'y',tab:title}})
},
goUrlT(path,obj,title){
this.$router.push({ name:path,query:{"id":obj,blank:'y',tab:title}})
},
getList(){
this.apipost('dmcstatistics_get_GetHotelStaticsDetail',{TCIDs:this.$route.query.id,NewCombinationNum:this.$route.query.TCNUM},res=>{
if(res.data.resultCode==1){
this.list=res.data.data.HotelList;
this.list.forEach(item=>{
if(item.HotelChangeState>0){
this.isShowBtn=1;
}
item.PayStyle=item.PayStyle.toString()
})
}else{
this.$message.error(res.data.message)
}
},err=>{})
},
getHotelList(obj){
this.apipost('hotel_post_GetLineHotelList',{IsGetPic: 0,IsGetRemark: 0,QCity:obj.QCity},res=>{
if(res.data.resultCode==1){
obj.hotelList=res.data.data
}else{
this.$message.error(res.data.message)
}
},err=>{})
},
sendValue(obj){
if(obj.hotelList.length>0)
{
let ckedObj=obj.hotelList.find(item=>item.ID==obj.NewHotelId)
obj.Address=ckedObj.Address
obj.Tel=ckedObj.Tel
obj.NewHotelName=ckedObj.Name
}else{
obj.Address=''
obj.Tel=''
}
},
HotelChangeState(obj,State){
if(State==2){//给出提示
obj.HotelChangeState=State;
this.$confirm('是否同意?同意后将覆盖之前的信息!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.saveList(0);
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
else{
this.saveList(0);
}
},
ChangeHotelInfo(type){
if (type==2){
this.$confirm('是否同意?同意后将覆盖之前的信息!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.list.forEach(item=>{
if(item.HotelChangeState>0){
item.HotelChangeState=2
}
});
this.saveList();
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
else if (type==3){
this.list.forEach(item=>{
if(item.HotelChangeState>0){item.HotelChangeState=3}
});
this.saveList();
}
},
saveList(){
//暂时不开放此功能,测试通过后再开放
this.apipost('dmcstatistics_post_SetUpdateHotelOrder',this.list,res=>{
if(res.data.resultCode==1){
this.$message.success(res.data.message)
this.getList()
}else{
this.$message.error(res.data.message)
}
},err=>{})
},
}, },
created() { methods: {
goUrl(path, obj, name) {
this.$router.push({
path: path,
query: {
id: obj.HotelId,
blank: "y",
tab: name
}
});
},
goUrlR(path, obj, title) {
this.$router.push({
name: path,
query: {
"ID": obj,
blank: 'y',
tab: title
}
})
},
goUrlT(path, obj, title) {
this.$router.push({
name: path,
query: {
"id": obj,
blank: 'y',
tab: title
}
})
},
getList() {
this.apipost('dmcstatistics_get_GetHotelStaticsDetail', {
TCIDs: this.TCIDs,
NewCombinationNum: this.TCNUM
}, res => {
if (res.data.resultCode == 1) {
this.DataList = res.data.data.HotelOrderListReport;
} else {
this.Error(res.data.message);
}
}, err => {})
},
//更换酒店
ChangeHotelInfo() {
var that = this;
this.Confirm("是否同意替换选中酒店?同意后将覆盖之前的行程酒店信息!", function () {
that.saveList();
});
},
//保存酒店修改信息
saveList() {
this.apipost('dmcstatistics_post_SetUpdateHotelOrder', this.DataList, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
}, err => {})
},
}, },
mounted() { mounted() {
this.TCNUM=this.$route.query.TCNUM this.TCNUM = this.$route.query.TCNUM;
this.flightTotal=this.$route.query.flightTotal this.TCIDs = this.$route.query.id;
this.GuestNum=this.$route.query.GuestNum this.getList();
this.getList() },
// this.getHotelList() }
},
}
</script> </script>
<style> <style>
.changeHotelDetailsTalbe{ background: #ddd;} .changeHotelDetailsTalbe {
.changeHotelDetailsTalbe tr th{background: #eee;height:40px; font-size: 12px; color: #333;} border-collapse: collapse;
.changeHotelDetailsTalbe tr{background: #fff;text-align: center; height: 40px;} }
.changeHotelDetailsTalbe tr td{font-size: 12px;}
.changeHotelDetailsTalbe tr td .pHouseStyle{border-bottom: 1px solid #ccc; height:28px; line-height: 28px;} .changeHotelDetailsTalbe tr th {
.changeHotelDetailsTalbe tr td .colorRed{color: #E95252;} background: #eee;
.changeHotelDetailsTalbe tr td .pHouseStyle:last-child{border-bottom: none;} height: 40px;
.changeHotelDetailsTalbe tr td .sel input{height: 34px!important; padding-right: 20px!important; padding-left: 5px!important; font-size: 12px!important;} font-size: 12px;
.changeHotelDetailsTalbe tr td .link:hover{text-decoration: underline; cursor: pointer;} color: #333;
border: 1px solid #d1d1d1;
}
.changeHotelDetailsTalbe tr td {
font-size: 12px;
border: 1px solid #d1d1d1;
height: 25px;
line-height: 25px;
padding-left: 5px;
}
.changeHotelDetailsTalbe tr td .link:hover {
text-decoration: underline;
cursor: pointer;
}
.changeHotelDetailsTalbe .tdLeft {
text-align: left;
padding-left: 5px;
}
.changeHotelDetailsTalbe .tdCenter {
text-align: center;
}
</style> </style>
\ No newline at end of file
<template> <template>
<div class="flexOne"> <div class="flexOne">
<div class="att_title">工作日设置</div> <div class="att_title">工作日设置</div>
<table class="att_table" cellspacing="0" cellpadding="0"> <table class="att_table" cellspacing="0" cellpadding="0">
<tr> <tr>
<th>工作日</th> <th>工作日</th>
<th>上班时间</th> <th>上班时间</th>
<th>下班时间</th> <th>下班时间</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
<tr v-for="(item,index) in listArr"> <tr v-for="(item,index) in listArr">
<td> <td>
<el-checkbox @change='activateOrDisabled(index)' v-model='item.IsCheck'>{{item.Workday}}</el-checkbox> <el-checkbox @change='activateOrDisabled(index)' v-model='item.IsCheck'>{{item.Workday}}</el-checkbox>
</td> </td>
<td> <td>
<el-time-select v-model='item.BeOnDutyTime' :picker-options="{start: '08:00',step: '00:05',end: '22:00', maxTime: item.OffDutyTime}" :disabled='!item.IsCheck'></el-time-select> <el-time-select v-model='item.BeOnDutyTime'
</td> :picker-options="{start: '08:00',step: '00:05',end: '22:00', maxTime: item.OffDutyTime}"
<td> :disabled='!item.IsCheck'></el-time-select>
<el-time-select v-model='item.OffDutyTime' :picker-options="{start: '08:00',step: '00:05',end: '22:00', minTime: item.BeOnDutyTime}" :disabled='!item.IsCheck'></el-time-select> </td>
</td> <td>
<td> <el-time-select v-model='item.OffDutyTime'
<el-tooltip v-if='index>0' class="item" effect="dark" content="同上" placement="right"> :picker-options="{start: '08:00',step: '00:05',end: '22:00', minTime: item.BeOnDutyTime}"
<el-button type="primary" icon="el-icon-circle-plus-outline" @click='copyPrev(index)' circle></el-button> :disabled='!item.IsCheck'></el-time-select>
</el-tooltip> </td>
</td> <td>
</tr> <el-tooltip v-if='index>0' class="item" effect="dark" content="同上" placement="right">
</table> <el-button type="primary" icon="el-icon-circle-plus-outline" @click='copyPrev(index)' circle></el-button>
<div class="att_title">特殊日期</div> </el-tooltip>
</td>
<div class="att_special_dates">必须打卡的日期 <input class="att_addBtn" type="button" value="添加" @click="addSignIn"></div> </tr>
<table v-if='this.signInDates.length>=1' class="att_table" cellspacing="0" cellpadding="0"> </table>
<tr> <div class="att_title">特殊日期</div>
<th>日期</th>
<th>考勤时间</th> <div class="att_special_dates">必须打卡的日期 <input class="att_addBtn" type="button" value="添加" @click="addSignIn"></div>
<th width="80">操作</th> <table v-if='this.signInDates.length>=1' class="att_table" cellspacing="0" cellpadding="0">
</tr> <tr>
<tr v-for="(item,index) in signInDates"> <th>日期</th>
<td>{{item.Date}}</td> <th>考勤时间</th>
<td>{{item.BeOnDutyTime}}~{{item.OffDutyTime}}</td> <th width="80">操作</th>
<td> </tr>
<el-row> <tr v-for="(item,index) in signInDates">
<!--<el-tooltip class="item" effect="dark" content="修改" placement="right"> <td>{{item.Date}}</td>
<el-button type="primary" icon="el-icon-edit" @click='updateSignIn(index)' circle></el-button> <td>{{item.BeOnDutyTime}}~{{item.OffDutyTime}}</td>
</el-tooltip>--> <td>
<el-tooltip class="item" effect="dark" content="删除" placement="right"> <el-row>
<el-button type="danger" icon="el-icon-delete" @click='deleteSignIn(index)' circle></el-button> <el-tooltip class="item" effect="dark" content="删除" placement="right">
</el-tooltip> <el-button type="danger" icon="el-icon-delete" @click='deleteSignIn(index)' circle></el-button>
</el-row> </el-tooltip>
</td> </el-row>
</tr> </td>
</table> </tr>
<div class="att_special_dates">不用打卡的日期 <input class="att_addBtn" type="button" value="添加" @click="addSignOut"></div> </table>
<table v-if='this.signOutDates.length>=1' class="att_table" cellspacing="0" cellpadding="0"> <div class="att_special_dates">不用打卡的日期 <input class="att_addBtn" type="button" value="添加" @click="addSignOut"></div>
<tr> <table v-if='this.signOutDates.length>=1' class="att_table" cellspacing="0" cellpadding="0">
<th>日期</th> <tr>
<th width="80">操作</th> <th>日期</th>
</tr> <th width="80">操作</th>
<tr v-for="(item,index) in signOutDates"> </tr>
<td>{{item.Date}}</td> <tr v-for="(item,index) in signOutDates">
<td> <td>{{item.Date}}</td>
<el-row> <td>
<el-tooltip class="item" effect="dark" content="删除" placement="right"> <el-row>
<el-button type="danger" icon="el-icon-delete" @click='deleteSignOut(index)' circle></el-button> <el-tooltip class="item" effect="dark" content="删除" placement="right">
</el-tooltip> <el-button type="danger" icon="el-icon-delete" @click='deleteSignOut(index)' circle></el-button>
</el-row> </el-tooltip>
</td> </el-row>
</tr> </td>
</table> </tr>
</table>
<div class="att_title">考勤方式<span>以下方式满足一项,考勤组成员即可完成考勤</span></div>
<div class="att_title">考勤方式<span>以下方式满足一项,考勤组成员即可完成考勤</span></div>
<div class="att_type_item">
<p>1.根据地点考勤<span>(可添加多个考勤地点)</span></p> <div class="att_type_item">
<p>有效范围 <p>1.根据地点考勤<span>(可添加多个考勤地点)</span></p>
<el-select v-model='addressRange' @change='setAddressRange'> <p>有效范围
<el-option label='100米' value='100'></el-option> <el-select v-model='addressRange' @change='setAddressRange'>
<el-option label='200米' value='200'></el-option> <el-option label='100米' value='100'></el-option>
<el-option label='300米' value='300'></el-option> <el-option label='200米' value='200'></el-option>
<el-option label='400米' value='400'></el-option> <el-option label='300米' value='300'></el-option>
<el-option label='500米' value='500'></el-option> <el-option label='400米' value='400'></el-option>
</el-select> <el-option label='500米' value='500'></el-option>
</p> </el-select>
<table class="att_table" cellspacing="0" cellpadding="0"> </p>
<tr> <table class="att_table" cellspacing="0" cellpadding="0">
<th align="left" style="text-indent: 30px;">考勤地址</th> <tr>
<th width="80">操作</th> <th align="left" style="text-indent: 30px;">考勤地址</th>
</tr> <th width="80">操作</th>
<tr v-if="awListData.length==0"> </tr>
<td colspan="2">未添加办公地点!</td> <tr v-if="awListData.length==0">
</tr> <td colspan="2">未添加办公地点!</td>
<tr v-for="(item,index) in awListData"> </tr>
<td align="left"> <tr v-for="(item,index) in awListData">
<p class="awName"> <td align="left">
{{item.Name}} <p class="awName">
</p> {{item.Name}}
<p class="awAddress"> </p>
{{item.Address}} <p class="awAddress">
</p> {{item.Address}}
</td> </p>
<td> </td>
<el-row> <td>
<el-tooltip class="item" effect="dark" content="删除" placement="right"> <el-row>
<el-button type="danger" icon="el-icon-delete" @click='deleteAddress(index)' circle></el-button> <el-tooltip class="item" effect="dark" content="删除" placement="right">
</el-tooltip> <el-button type="danger" icon="el-icon-delete" @click='deleteAddress(index)' circle></el-button>
</el-row> </el-tooltip>
</td> </el-row>
</tr> </td>
</table> </tr>
</table>
</div>
<input class="att_addBtn" type="button" value="添加地点" @click="addAddress()"> </div>
<input class="att_addBtn" type="button" value="添加地点" @click="addAddress()">
<div class="att_type_item">
<p>2.根据Wifi考勤<span>(可添加多个办公wifi)</span></p> <div class="att_type_item">
<table class="att_table" cellspacing="0" cellpadding="0"> <p>2.根据Wifi考勤<span>(可添加多个办公wifi)</span></p>
<tr> <table class="att_table" cellspacing="0" cellpadding="0">
<th>名称</th> <tr>
<th>MAC地址</th> <th>名称</th>
<th width="80">操作</th> <th>MAC地址</th>
</tr> <th width="80">操作</th>
<tr v-if="awWifiListDates.length==0"> </tr>
<td colspan="3">未添加办公Wifi!</td> <tr v-if="awWifiListDates.length==0">
</tr> <td colspan="3">未添加办公Wifi!</td>
<tr v-for="(item,index) in awWifiListDates"> </tr>
<td>{{item.Name}}</td> <tr v-for="(item,index) in awWifiListDates">
<td>{{item.TargetAddress}}</td> <td>{{item.Name}}</td>
<td> <td>{{item.TargetAddress}}</td>
<el-row> <td>
<el-tooltip class="item" effect="dark" content="删除" placement="right"> <el-row>
<el-button type="danger" icon="el-icon-delete" @click='deleteWifi(index)' circle></el-button> <el-tooltip class="item" effect="dark" content="删除" placement="right">
</el-tooltip> <el-button type="danger" icon="el-icon-delete" @click='deleteWifi(index)' circle></el-button>
</el-row> </el-tooltip>
</td> </el-row>
</tr> </td>
</table> </tr>
</div> </table>
<input class="att_addBtn" type="button" value="添加WIFI" @click="addWifi"> </div>
<div class="att_saveDiv"> <input class="att_addBtn" type="button" value="添加WIFI" @click="addWifi">
<input type="button" class="normalBtn" value="保存设置" @click="addAttendance" /> <div class="att_saveDiv">
<input type="button" class="hollowFixedBtn" value="取消" @click="goBack()" /> <input type="button" class="normalBtn" value="保存设置" @click="addAttendance" />
</div> <input type="button" class="hollowFixedBtn" value="取消" @click="goBack()" />
</div>
<el-dialog custom-class='att_addDates' :title="dialogTitle" :visible.sync="outerVisible" center>
<table class="layerTable" v-if='this.signDateType==1'> <el-dialog custom-class='att_addDates' :title="dialogTitle" :visible.sync="outerVisible" center>
<tr> <table class="layerTable" v-if='this.signDateType==1'>
<td> <tr>
<span>添加方式</span> <td>
<label><input type="radio" value="one" v-model="picked">单天</label> <span>添加方式</span>
<label><input type="radio" value="two" v-model="picked">范围</label> <label><input type="radio" value="one" v-model="picked">单天</label>
</td> <label><input type="radio" value="two" v-model="picked">范围</label>
</tr> </td>
<tr v-if="picked=='one'"> </tr>
<td><span><em></em>日期</span> <tr v-if="picked=='one'">
<el-date-picker class='w275' v-model='newSignIn.Date' type="date" :picker-options="pickerOptions" value-format="yyyy-MM-dd"></el-date-picker> <td><span><em></em>日期</span>
</td> <el-date-picker class='w275' v-model='newSignIn.Date' type="date" :picker-options="pickerOptions"
</tr> value-format="yyyy-MM-dd"></el-date-picker>
<tr v-if="picked=='two'"> </td>
<td><span><em></em>日期</span> </tr>
<el-date-picker class='w135' v-model='fwStartTime' type="date" :picker-options="pickerOptions" value-format="yyyy-MM-dd" @change='getDateArr'></el-date-picker> <tr v-if="picked=='two'">
<el-date-picker class='w135' v-model='fwEndTime' type="date" :picker-options="pickerOptions" value-format="yyyy-MM-dd" @change='getDateArr'></el-date-picker> <td><span><em></em>日期</span>
</td> <el-date-picker class='w135' v-model='fwStartTime' type="date" :picker-options="pickerOptions"
</tr> value-format="yyyy-MM-dd" @change='getDateArr'></el-date-picker>
<tr> <el-date-picker class='w135' v-model='fwEndTime' type="date" :picker-options="pickerOptions"
<td><span><em></em>上班时间</span> value-format="yyyy-MM-dd" @change='getDateArr'></el-date-picker>
<el-time-select class='w275' v-model='newSignIn.BeOnDutyTime' :picker-options="{start: '08:00',step: '00:05',end: '22:00', maxTime:this.newSignIn.OffDutyTime}"></el-time-select> </td>
</td> </tr>
<tr>
</tr> <td><span><em></em>上班时间</span>
<tr> <el-time-select class='w275' v-model='newSignIn.BeOnDutyTime'
<td><span><em></em>下班时间</span> :picker-options="{start: '08:00',step: '00:05',end: '22:00', maxTime:this.newSignIn.OffDutyTime}">
<el-time-select class='w275' v-model='newSignIn.OffDutyTime' :picker-options="{start: '08:00',step: '00:05',end: '22:00', minTime:this.newSignIn.BeOnDutyTime}"></el-time-select> </el-time-select>
</td> </td>
</tr>
</table> </tr>
<tr>
<table class="layerTable" v-if='this.signDateType==2'> <td><span><em></em>下班时间</span>
<tr> <el-time-select class='w275' v-model='newSignIn.OffDutyTime'
<td> :picker-options="{start: '08:00',step: '00:05',end: '22:00', minTime:this.newSignIn.BeOnDutyTime}">
<span>添加方式</span> </el-time-select>
<label><input type="radio" value="one" v-model="picked1">单天</label> </td>
<label><input type="radio" value="two" v-model="picked1">范围</label> </tr>
</td> </table>
</tr>
<tr v-if="picked1=='one'"> <table class="layerTable" v-if='this.signDateType==2'>
<td><span><em></em>日期</span> <tr>
<el-date-picker class='w275' v-model='newSignOut.Date' :picker-options="pickerOptions" type="date" value-format="yyyy-MM-dd"></el-date-picker> <td>
</td> <span>添加方式</span>
</tr> <label><input type="radio" value="one" v-model="picked1">单天</label>
<tr v-if="picked1=='two'"> <label><input type="radio" value="two" v-model="picked1">范围</label>
<td><span><em></em>日期</span> </td>
<el-date-picker class='w135' v-model='fwStartTime1' type="date" :picker-options="pickerOptions" value-format="yyyy-MM-dd" @change='getDateArr1'></el-date-picker> </tr>
<el-date-picker class='w135' v-model='fwEndTime1' type="date" :picker-options="pickerOptions" value-format="yyyy-MM-dd" @change='getDateArr1'></el-date-picker> <tr v-if="picked1=='one'">
</td> <td><span><em></em>日期</span>
</tr> <el-date-picker class='w275' v-model='newSignOut.Date' :picker-options="pickerOptions" type="date"
</table> value-format="yyyy-MM-dd"></el-date-picker>
</td>
<div v-if='this.signDateType==3' class="amap-page-container"> </tr>
<el-amap-search-box class="search-box" :search-option="searchOption" :on-search-result="onSearchResult"></el-amap-search-box> <tr v-if="picked1=='two'">
<el-amap vid="amapDemo" :center="center" :zoom="12" style='width: 744px;height: 450px; border:1px solid #ccc;'> <td><span><em></em>日期</span>
<el-amap-marker v-for="(marker, index) in markers" :key='index' :position="marker.position" :radius="marker.radius" :fill-color="marker.fillColor" :fill-opacity="marker.fillOpacity" :events="marker.events"></el-amap-marker> <el-date-picker class='w135' v-model='fwStartTime1' type="date" :picker-options="pickerOptions"
</el-amap> value-format="yyyy-MM-dd" @change='getDateArr1'></el-date-picker>
<table style="width: 100%;"> <el-date-picker class='w135' v-model='fwEndTime1' type="date" :picker-options="pickerOptions"
<tr height="45"> value-format="yyyy-MM-dd" @change='getDateArr1'></el-date-picker>
<td align="right">名称:</td> </td>
<td><input class="att_map_input" type="text" v-model="newAwlist.Name" /></td> </tr>
<td align="right">详细地址:</td> </table>
<td><input class="att_map_input" type="text" v-model="newAwlist.Address" /></td>
</tr> <div v-if='this.signDateType==3' class="amap-page-container">
<tr height="45"> <el-amap-search-box class="search-box" :search-option="searchOption" :on-search-result="onSearchResult">
<td align="right">经纬度:</td> </el-amap-search-box>
<td><input class="att_map_input" type="text" v-model="newAwlist.TargetAddress" readonly="" /></td> <el-amap vid="amapDemo" :center="center" :zoom="12" style='width: 744px;height: 450px; border:1px solid #ccc;'>
</tr> <el-amap-marker v-for="(marker, index) in markers" :key='index' :position="marker.position"
</table> :radius="marker.radius" :fill-color="marker.fillColor" :fill-opacity="marker.fillOpacity"
</div> :events="marker.events"></el-amap-marker>
</el-amap>
<table class="layerTable" v-if='this.signDateType==4'> <table style="width: 100%;">
<tr> <tr height="45">
<td> <td align="right">名称:</td>
<span><em></em>名称</span> <td><input class="att_map_input" type="text" v-model="newAwlist.Name" /></td>
<el-input class='w200' v-model='newAwWiFi.Name'></el-input> <td align="right">详细地址:</td>
</td> <td><input class="att_map_input" type="text" v-model="newAwlist.Address" /></td>
</tr> </tr>
<tr> <tr height="45">
<td> <td align="right">经纬度:</td>
<span><em></em>MAC地址</span> <td><input class="att_map_input" type="text" v-model="newAwlist.TargetAddress" readonly="" /></td>
<el-input class='w200' v-model='newAwWiFi.TargetAddress'></el-input> </tr>
</td> </table>
</tr> </div>
</table>
<div slot="footer" class="dialog-footer"> <table class="layerTable" v-if='this.signDateType==4'>
<button class="hollowFixedBtn" @click="cancel">取 消</button> &nbsp; <tr>
<button v-if='saveBtnType==1' class="normalBtn" type="primary" @click="saveSignIn()">保存</button> <td>
<button v-if='saveBtnType==3' class="normalBtn" type="primary" @click="saveSignOut()">保存</button> <span><em></em>名称</span>
<button v-if='saveBtnType==4' class="normalBtn" type="primary" @click="saveWifi()">保存</button> <el-input class='w200' v-model='newAwWiFi.Name'></el-input>
<button v-if='saveBtnType==5' class="normalBtn" type="primary" @click="saveAddress()">保存</button> </td>
</div> </tr>
</el-dialog> <tr>
<td>
</div> <span><em></em>MAC地址</span>
<el-input class='w200' v-model='newAwWiFi.TargetAddress'></el-input>
</td>
</tr>
</table>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="cancel">取 消</button> &nbsp;
<button v-if='saveBtnType==1' class="normalBtn" type="primary" @click="saveSignIn()">保存</button>
<button v-if='saveBtnType==3' class="normalBtn" type="primary" @click="saveSignOut()">保存</button>
<button v-if='saveBtnType==4' class="normalBtn" type="primary" @click="saveWifi()">保存</button>
<button v-if='saveBtnType==5' class="normalBtn" type="primary" @click="saveAddress()">保存</button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
import VueAMap from 'vue-amap' import VueAMap from 'vue-amap'
let amapManager = new VueAMap.AMapManager(); let amapManager = new VueAMap.AMapManager();
export default { export default {
data() { data() {
return { return {
fwStartTime:'', fwStartTime: '',
fwEndTime:'', fwEndTime: '',
fwStartTime1:'', fwStartTime1: '',
fwEndTime1:'', fwEndTime1: '',
fwdateArr:[], fwdateArr: [],
fwdateArr1:[], fwdateArr1: [],
picked:'one', picked: 'one',
picked1:'one', picked1: 'one',
searchOption: {}, searchOption: {},
markers: [], markers: [],
center: [104.090588, 30.643365], center: [104.090588, 30.643365],
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7;
} }
}, },
zoom: 12, zoom: 12,
amapManager, amapManager,
events: {}, events: {},
searchData: [], searchData: [],
lnglatXY: [], lnglatXY: [],
addMapStyle: false, addMapStyle: false,
outerVisible: false, outerVisible: false,
innerVisible: false, innerVisible: false,
isRight: true, isRight: true,
dialogTitle: '', dialogTitle: '',
specialDatesIsShow: true, specialDatesIsShow: true,
wdListArr: [], wdListArr: [],
signInDates: [], signInDates: [],
newSignIn: { newSignIn: {
'Date': '', 'Date': '',
'BeOnDutyTime': '', 'BeOnDutyTime': '',
'OffDutyTime': '' 'OffDutyTime': ''
}, },
signOutDates: [], signOutDates: [],
newSignOut: { newSignOut: {
'Date': '' 'Date': ''
}, },
awWifiListDates: [], awWifiListDates: [],
newAwWiFi: { newAwWiFi: {
'Name': '', 'Name': '',
'TargetAddress': '' 'TargetAddress': ''
}, },
awListData: [], awListData: [],
newAwlist: { newAwlist: {
'Name': '', 'Name': '',
'Address': '', 'Address': '',
'TargetAddress': '', 'TargetAddress': '',
'Scope': '' 'Scope': ''
}, },
SpecialDates: [], SpecialDates: [],
signDateType: 0, signDateType: 0,
saveBtnType: 1, saveBtnType: 1,
isRepetition: false, isRepetition: false,
awListDates: [], awListDates: [],
addressRange: '300', addressRange: '300',
listArr: [{ listArr: [{
'AttendanceId': '0', 'AttendanceId': '0',
"Id": '0', "Id": '0',
'IsCheck': false, 'IsCheck': false,
"Workday": "周一", "Workday": "周一",
"BeOnDutyTime": "", "BeOnDutyTime": "",
"OffDutyTime": "" "OffDutyTime": ""
}, },
{ {
'AttendanceId': '0', 'AttendanceId': '0',
"Id": '0', "Id": '0',
'IsCheck': false, 'IsCheck': false,
"Workday": "周二", "Workday": "周二",
"BeOnDutyTime": "", "BeOnDutyTime": "",
"OffDutyTime": "" "OffDutyTime": ""
}, },
{ {
'AttendanceId': '0', 'AttendanceId': '0',
"Id": '0', "Id": '0',
'IsCheck': false, 'IsCheck': false,
"Workday": "周三", "Workday": "周三",
"BeOnDutyTime": "", "BeOnDutyTime": "",
"OffDutyTime": "" "OffDutyTime": ""
}, },
{ {
'AttendanceId': '0', 'AttendanceId': '0',
"Id": '0', "Id": '0',
'IsCheck': false, 'IsCheck': false,
"Workday": "周四", "Workday": "周四",
"BeOnDutyTime": "", "BeOnDutyTime": "",
"OffDutyTime": "" "OffDutyTime": ""
}, },
{ {
'AttendanceId': '0', 'AttendanceId': '0',
"Id": '0', "Id": '0',
'IsCheck': false, 'IsCheck': false,
"Workday": "周五", "Workday": "周五",
"BeOnDutyTime": "", "BeOnDutyTime": "",
"OffDutyTime": "" "OffDutyTime": ""
}, },
{ {
'AttendanceId': '0', 'AttendanceId': '0',
"Id": '0', "Id": '0',
'IsCheck': false, 'IsCheck': false,
"Workday": "周六", "Workday": "周六",
"BeOnDutyTime": "", "BeOnDutyTime": "",
"OffDutyTime": "" "OffDutyTime": ""
}, },
{ {
'AttendanceId': '0', 'AttendanceId': '0',
"Id": '0', "Id": '0',
'IsCheck': false, 'IsCheck': false,
"Workday": "周日", "Workday": "周日",
"BeOnDutyTime": "", "BeOnDutyTime": "",
"OffDutyTime": "" "OffDutyTime": ""
} }
], ],
//请求数据 //请求数据
addMsg: { addMsg: {
attendanceId: '-1', attendanceId: '-1',
RB_BranchId: '0', RB_BranchId: '0',
Status: '0', Status: '0',
wdList: [], //[{'Workday':周一,'BeOnDutyTime':'09:30:00','OffDutyTime':'09:30:00'},{},{}] wdList: [], //[{'Workday':周一,'BeOnDutyTime':'09:30:00','OffDutyTime':'09:30:00'},{},{}]
tdList: [], //特殊打卡 [{'Date':'2018-04-15',BeOnDutyTime':'09:30:00','OffDutyTime':'09:30:00'},{}] tdList: [], //特殊打卡 [{'Date':'2018-04-15',BeOnDutyTime':'09:30:00','OffDutyTime':'09:30:00'},{}]
NottdList: [], //[{Date:'2018-04-15'}] //特殊不打卡 NottdList: [], //[{Date:'2018-04-15'}] //特殊不打卡
awList: [], //Name,Address,TargetAddress,Scope awList:[{'Name':'xxx',Address:'xxx',TargetAddress:'xxx',Scope:'xxx'},{}] awList: [], //Name,Address,TargetAddress,Scope awList:[{'Name':'xxx',Address:'xxx',TargetAddress:'xxx',Scope:'xxx'},{}]
awWifiList: [] //awWifiList:[{'Name':'xxxx',TargetAddress:'12.51.42.32'}] awWifiList: [] //awWifiList:[{'Name':'xxxx',TargetAddress:'12.51.42.32'}]
}, },
} }
}, },
methods: { methods: {
getDateArr(){ getDateArr() {
if(this.fwStartTime!=''&&this.fwEndTime!=''){ if (this.fwStartTime != '' && this.fwEndTime != '') {
this.apipost('User_get_AttendanceGetTimeSpanValue',{StartTime:this.fwStartTime,EndTime:this.fwEndTime},res=>{ this.apipost('User_get_AttendanceGetTimeSpanValue', {
this.fwdateArr=res.data.data StartTime: this.fwStartTime,
},err=>{}) EndTime: this.fwEndTime
} }, res => {
}, this.fwdateArr = res.data.data
getDateArr1(){ }, err => {})
if(this.fwStartTime1!=''&&this.fwEndTime1!=''){ }
this.apipost('User_get_AttendanceGetTimeSpanValue',{StartTime:this.fwStartTime1,EndTime:this.fwEndTime1},res=>{ },
this.fwdateArr1=res.data.data getDateArr1() {
},err=>{}) if (this.fwStartTime1 != '' && this.fwEndTime1 != '') {
} this.apipost('User_get_AttendanceGetTimeSpanValue', {
}, StartTime: this.fwStartTime1,
onSearchResult(pois) { EndTime: this.fwEndTime1
let latSum = 0; }, res => {
let lngSum = 0; this.fwdateArr1 = res.data.data
this.markers.length = 0 }, err => {})
if(pois.length > 0) { }
pois.forEach(poi => { },
let { onSearchResult(pois) {
lng, let latSum = 0;
lat let lngSum = 0;
} = poi; this.markers.length = 0
lngSum += lng; if (pois.length > 0) {
latSum += lat; pois.forEach(poi => {
let markerItem = { let {
position: [poi.lng, poi.lat], lng,
radius: 20, lat
fillOpacity: 1, } = poi;
fillColor: 'rgba(0,0,255,1)', lngSum += lng;
events: { latSum += lat;
click: (e) => { let markerItem = {
this.newAwlist.Name = e.target.Uh.events.name; position: [poi.lng, poi.lat],
this.newAwlist.Address = e.target.Uh.events.address; radius: 20,
this.newAwlist.TargetAddress = e.lnglat.lat + ',' + e.lnglat.lng; fillOpacity: 1,
}, fillColor: 'rgba(0,0,255,1)',
address: poi.address, events: {
name: poi.name, click: (e) => {
}, this.newAwlist.Name = e.target.Uh.events.name;
this.newAwlist.Address = e.target.Uh.events.address;
} this.newAwlist.TargetAddress = e.lnglat.lat + ',' + e.lnglat.lng;
this.markers.push(markerItem); },
}); address: poi.address,
let center = { name: poi.name,
lng: lngSum / pois.length, },
lat: latSum / pois.length
}; }
this.center = [center.lng, center.lat]; this.markers.push(markerItem);
} });
}, let center = {
activateOrDisabled(index) { lng: lngSum / pois.length,
if(this.listArr[index].IsCheck == false) { lat: latSum / pois.length
this.listArr[index].BeOnDutyTime = ''; };
this.listArr[index].OffDutyTime = ''; this.center = [center.lng, center.lat];
} }
}, },
copyPrev(index) { activateOrDisabled(index) {
if(this.listArr[index].IsCheck == true) { if (this.listArr[index].IsCheck == false) {
this.listArr[index].BeOnDutyTime = this.listArr[index - 1].BeOnDutyTime; this.listArr[index].BeOnDutyTime = '';
this.listArr[index].OffDutyTime = this.listArr[index - 1].OffDutyTime; this.listArr[index].OffDutyTime = '';
} }
}, },
addSignIn() { copyPrev(index) {
this.saveBtnType = 1; if (this.listArr[index].IsCheck == true) {
this.dialogTitle = '添加必须打卡日期'; this.listArr[index].BeOnDutyTime = this.listArr[index - 1].BeOnDutyTime;
this.newSignIn = { this.listArr[index].OffDutyTime = this.listArr[index - 1].OffDutyTime;
'Date': '', }
'BeOnDutyTime': '', },
'OffDutyTime': '' addSignIn() {
}; this.saveBtnType = 1;
this.outerVisible = true; this.dialogTitle = '添加必须打卡日期';
this.signDateType = 1; this.newSignIn = {
}, 'Date': '',
updateSignIn(index) { 'BeOnDutyTime': '',
this.dialogTitle = '修改必须打卡日期'; 'OffDutyTime': ''
this.outerVisible = true; };
this.signDateType = 1; this.outerVisible = true;
this.saveBtnType = 2; this.signDateType = 1;
this.newSignIn.Date = this.signInDates[index].Date; },
this.newSignIn.BeOnDutyTime = this.signInDates[index].BeOnDutyTime; updateSignIn(index) {
this.newSignIn.OffDutyTime = this.signInDates[index].OffDutyTime; this.dialogTitle = '修改必须打卡日期';
}, this.outerVisible = true;
deleteSignIn(index) { this.signDateType = 1;
this.saveBtnType = 2;
this.$confirm('是否删除?', '提示', { this.newSignIn.Date = this.signInDates[index].Date;
confirmButtonText: '确定', this.newSignIn.BeOnDutyTime = this.signInDates[index].BeOnDutyTime;
cancelButtonText: '取消', this.newSignIn.OffDutyTime = this.signInDates[index].OffDutyTime;
type: 'warning' },
}).then(() => { deleteSignIn(index) {
this.$message({ this.$confirm('是否删除?', '提示', {
type: 'success', confirmButtonText: '确定',
message: '删除成功!' cancelButtonText: '取消',
}); type: 'warning'
this.signInDates.splice(index, 1) }).then(() => {
this.getSpecialDates()
}).catch(() => { this.$message({
this.$message({ type: 'success',
type: 'info', message: '删除成功!'
message: '已取消删除' });
}); this.signInDates.splice(index, 1)
}); this.getSpecialDates()
}).catch(() => {
}, this.$message({
saveSignIn() { type: 'info',
if(this.picked=='one'){ // 单天设置 message: '已取消删除'
this.isRepetition = false; });
this.SpecialDates.forEach(item => { });
if(this.newSignIn.Date == item) {
this.isRepetition = true; },
} saveSignIn() {
}) if (this.picked == 'one') { // 单天设置
if(this.newSignIn.Date != '' && this.newSignIn.BeOnDutyTime != '' && this.newSignIn.OffDutyTime != '') { this.isRepetition = false;
if(!this.isRepetition) { this.SpecialDates.forEach(item => {
this.signInDates.unshift(this.newSignIn); if (this.newSignIn.Date == item) {
this.newSignIn = { this.isRepetition = true;
'Date': '', }
'BeOnDutyTime': '', })
'OffDutyTime': '' if (this.newSignIn.Date != '' && this.newSignIn.BeOnDutyTime != '' && this.newSignIn.OffDutyTime != '') {
}; if (!this.isRepetition) {
this.getSpecialDates() this.signInDates.unshift(this.newSignIn);
this.outerVisible=false; this.newSignIn = {
this.$message.success('添加成功!'); 'Date': '',
'BeOnDutyTime': '',
} else { 'OffDutyTime': ''
this.$message.warning('必须打卡日期或不用打卡日期存在重复!') };
} this.getSpecialDates()
} else { this.outerVisible = false;
this.$message.warning('请填写完整信息!') this.$message.success('添加成功!');
}
} } else {
if(this.picked=='two'){ //范围设置 this.$message.warning('必须打卡日期或不用打卡日期存在重复!')
this.isRepetition = false; }
} else {
this.SpecialDates.forEach(item => { this.$message.warning('请填写完整信息!')
if(this.fwdateArr.findIndex(x=>x==item)!=-1){ }
this.isRepetition = true; //存在重复 }
} if (this.picked == 'two') { //范围设置
}) this.isRepetition = false;
if(this.isRepetition){ this.SpecialDates.forEach(item => {
this.$message.warning('必须打卡日期或不用打卡日期存在重复!') if (this.fwdateArr.findIndex(x => x == item) != -1) {
}else{ this.isRepetition = true; //存在重复
this.fwdateArr.forEach(item=>{ }
this.signInDates.push({'Date':item,'BeOnDutyTime':this.newSignIn.BeOnDutyTime,'OffDutyTime':this.newSignIn.OffDutyTime}) })
this.getSpecialDates()
this.outerVisible=false; if (this.isRepetition) {
this.$message.success('添加成功!'); this.$message.warning('必须打卡日期或不用打卡日期存在重复!')
this.fwStartTime='' } else {
this.fwEndTime='' this.fwdateArr.forEach(item => {
}) this.signInDates.push({
} 'Date': item,
'BeOnDutyTime': this.newSignIn.BeOnDutyTime,
} 'OffDutyTime': this.newSignIn.OffDutyTime
}, })
addSignOut() { this.getSpecialDates()
this.newSignOut.Date = '', this.outerVisible = false;
this.signDateType = 2; this.$message.success('添加成功!');
this.dialogTitle = '添加不用打卡日期'; this.fwStartTime = ''
this.saveBtnType = 3; this.fwEndTime = ''
this.outerVisible = true; })
}, }
saveSignOut() {
if(this.picked1=='one'){ // 单天设置 }
this.isRepetition = false; },
this.SpecialDates.forEach(item => { addSignOut() {
if(this.newSignOut.Date == item) { this.newSignOut.Date = '',
this.isRepetition = true; this.signDateType = 2;
} this.dialogTitle = '添加不用打卡日期';
}) this.saveBtnType = 3;
if(!this.isRepetition) { this.outerVisible = true;
this.signOutDates.unshift(this.newSignOut); },
this.newSignOut = { saveSignOut() {
'Date': '' if (this.picked1 == 'one') { // 单天设置
}; this.isRepetition = false;
this.getSpecialDates() this.SpecialDates.forEach(item => {
this.outerVisible=false; if (this.newSignOut.Date == item) {
this.$message.success('添加成功!'); this.isRepetition = true;
}
} else { })
this.$message.warning('必须打卡日期或不用打卡日期存在重复!') if (!this.isRepetition) {
} this.signOutDates.unshift(this.newSignOut);
} this.newSignOut = {
'Date': ''
if(this.picked1=='two'){ };
this.isRepetition = false; this.getSpecialDates()
this.outerVisible = false;
this.SpecialDates.forEach(item => { this.$message.success('添加成功!');
if(this.fwdateArr1.findIndex(x=>x==item)!=-1){
this.isRepetition = true; //存在重复 } else {
} this.$message.warning('必须打卡日期或不用打卡日期存在重复!')
}) }
}
if(this.isRepetition){
this.$message.warning('必须打卡日期或不用打卡日期存在重复!') if (this.picked1 == 'two') {
}else{ this.isRepetition = false;
this.fwdateArr1.forEach(item=>{
this.signOutDates.push({'Date':item}) this.SpecialDates.forEach(item => {
this.getSpecialDates() if (this.fwdateArr1.findIndex(x => x == item) != -1) {
this.outerVisible=false; this.isRepetition = true; //存在重复
this.$message.success('添加成功!'); }
this.fwStartTime1='' })
this.fwEndTime1=''
}) if (this.isRepetition) {
} this.$message.warning('必须打卡日期或不用打卡日期存在重复!')
} else {
} this.fwdateArr1.forEach(item => {
}, this.signOutDates.push({
deleteSignOut(index) { 'Date': item
this.$confirm('是否删除?', '提示', { })
confirmButtonText: '确定', this.getSpecialDates()
cancelButtonText: '取消', this.outerVisible = false;
type: 'warning' this.$message.success('添加成功!');
}).then(() => { this.fwStartTime1 = ''
this.$message({ this.fwEndTime1 = ''
type: 'success', })
message: '删除成功!' }
});
this.signOutDates.splice(index, 1) }
this.getSpecialDates() },
}).catch(() => { deleteSignOut(index) {
this.$message({ this.$confirm('是否删除?', '提示', {
type: 'info', confirmButtonText: '确定',
message: '已取消删除' cancelButtonText: '取消',
}); type: 'warning'
}); }).then(() => {
}, this.$message({
getSpecialDates() { //特殊天数集合 type: 'success',
this.SpecialDates=[] message: '删除成功!'
this.signInDates.forEach(item => { });
if(item.Date && item.Date != '') this.signOutDates.splice(index, 1)
this.SpecialDates.push(item.Date) this.getSpecialDates()
}) }).catch(() => {
this.signOutDates.forEach(item => { this.$message({
if(item.Date && item.Date != '') type: 'info',
this.SpecialDates.push(item.Date) message: '已取消删除'
}) });
});
}, },
addAddress() { getSpecialDates() { //特殊天数集合
document.getElementsByClassName("att_addDates")[0].style.width = '800px'; this.SpecialDates = []
this.searchData = null; this.signInDates.forEach(item => {
this.newAwlist.Name = ''; if (item.Date && item.Date != '')
this.newAwlist.Address = ''; this.SpecialDates.push(item.Date)
this.newAwlist.TargetAddress = ''; })
this.saveBtnType = 5; this.signOutDates.forEach(item => {
this.dialogTitle = '添加办公地点'; if (item.Date && item.Date != '')
this.outerVisible = true; this.SpecialDates.push(item.Date)
this.signDateType = 3; })
},
saveAddress() { },
this.newAwlist.Scope = this.addressRange; addAddress() {
if(this.newAwlist.Name!=''&&this.newAwlist.Address!=''&&this.newAwlist.TargetAddress!=''){ document.getElementsByClassName("att_addDates")[0].style.width = '800px';
this.awListData.unshift(this.newAwlist); this.searchData = null;
this.newAwlist = { this.newAwlist.Name = '';
'Name': '', this.newAwlist.Address = '';
'Address': '', this.newAwlist.TargetAddress = '';
'TargetAddress': '', this.saveBtnType = 5;
'Scope': '' this.dialogTitle = '添加办公地点';
}; this.outerVisible = true;
this.outerVisible = false; this.signDateType = 3;
this.$alert('添加成功!', '提示'); },
}else{ saveAddress() {
this.$alert('请填写完整信息!', '提示') this.newAwlist.Scope = this.addressRange;
} if (this.newAwlist.Name != '' && this.newAwlist.Address != '' && this.newAwlist.TargetAddress != '') {
}, this.awListData.unshift(this.newAwlist);
deleteAddress(index) { this.newAwlist = {
this.$confirm('是否删除?', '提示', { 'Name': '',
confirmButtonText: '确定', 'Address': '',
cancelButtonText: '取消', 'TargetAddress': '',
type: 'warning' 'Scope': ''
}).then(() => { };
this.$message({ this.outerVisible = false;
type: 'success', this.$alert('添加成功!', '提示');
message: '删除成功!' } else {
}); this.$alert('请填写完整信息!', '提示')
this.awListData.splice(index, 1) }
}).catch(() => { },
this.$message({ deleteAddress(index) {
type: 'info', this.$confirm('是否删除?', '提示', {
message: '已取消删除' confirmButtonText: '确定',
}); cancelButtonText: '取消',
}); type: 'warning'
}, }).then(() => {
setAddressRange() { this.$message({
this.awListData.forEach(item => { type: 'success',
item.Scope = this.addressRange message: '删除成功!'
}) });
}, this.awListData.splice(index, 1)
addWifi() { }).catch(() => {
this.dialogTitle = '添加WIFI'; this.$message({
this.outerVisible = true; type: 'info',
this.signDateType = 4; message: '已取消删除'
this.saveBtnType = 4; });
}, });
saveWifi() { },
if(this.newAwWiFi.Name != '' && this.newAwWiFi.TargetAddress != '') { setAddressRange() {
this.awWifiListDates.unshift(this.newAwWiFi); this.awListData.forEach(item => {
this.newAwWiFi = { item.Scope = this.addressRange
'Name': '', })
'TargetAddress': '' },
}; addWifi() {
} else { this.dialogTitle = '添加WIFI';
this.$alert('请填写完整信息!', '提示') this.outerVisible = true;
} this.signDateType = 4;
}, this.saveBtnType = 4;
deleteWifi(index) { },
this.$confirm('是否删除?', '提示', { saveWifi() {
confirmButtonText: '确定', if (this.newAwWiFi.Name != '' && this.newAwWiFi.TargetAddress != '') {
cancelButtonText: '取消', this.awWifiListDates.unshift(this.newAwWiFi);
type: 'warning' this.newAwWiFi = {
}).then(() => { 'Name': '',
this.$message({ 'TargetAddress': ''
type: 'success', };
message: '删除成功!' } else {
}); this.$alert('请填写完整信息!', '提示')
this.awWifiListDates.splice(index, 1) }
}).catch(() => { },
this.$message({ deleteWifi(index) {
type: 'info', this.$confirm('是否删除?', '提示', {
message: '已取消删除' confirmButtonText: '确定',
}); cancelButtonText: '取消',
}); type: 'warning'
}, }).then(() => {
cancel() { this.$message({
document.getElementsByClassName("att_addDates")[0].style.width = '500px'; type: 'success',
this.outerVisible = false; message: '删除成功!'
}, });
addAttendance() { this.awWifiListDates.splice(index, 1)
this.wdListArr=[] }).catch(() => {
this.listArr.forEach(item => { this.$message({
if(item.IsCheck == true && item.BeOnDutyTime != '' && item.OffDutyTime != '') { type: 'info',
this.wdListArr.push({ message: '已取消删除'
'Workday': item.Workday, });
"BeOnDutyTime": item.BeOnDutyTime, });
"OffDutyTime": item.OffDutyTime },
}) cancel() {
} document.getElementsByClassName("att_addDates")[0].style.width = '500px';
}) this.outerVisible = false;
this.addMsg.wdList = this.wdListArr; //工作日设置 },
this.addMsg.tdList = this.signInDates; //必须打卡的日期 addAttendance() {
this.addMsg.NottdList = this.signOutDates; //不用打卡的日期 this.wdListArr = []
this.addMsg.awList = this.awListData; //根据地点考勤 this.listArr.forEach(item => {
this.addMsg.awWifiList = this.awWifiListDates; //根据Wifi考勤 if (item.IsCheck == true && item.BeOnDutyTime != '' && item.OffDutyTime != '') {
this.apipost('User_post_AttendanceSet', this.addMsg, res => { this.wdListArr.push({
if(res.data.resultCode == 1) { 'Workday': item.Workday,
this.$message.success(res.data.message) "BeOnDutyTime": item.BeOnDutyTime,
this.goBack() "OffDutyTime": item.OffDutyTime
}else{ })
this.$message.error(res.data.message) }
} })
this.addMsg.wdList = this.wdListArr; //工作日设置
}, err => {}) this.addMsg.tdList = this.signInDates; //必须打卡的日期
}, this.addMsg.NottdList = this.signOutDates; //不用打卡的日期
getUpdateList() { //获取修改数据 this.addMsg.awList = this.awListData; //根据地点考勤
this.apipost('User_get_AttendanceGet', { this.addMsg.awWifiList = this.awWifiListDates; //根据Wifi考勤
attendanceId: this.addMsg.attendanceId this.apipost('User_post_AttendanceSet', this.addMsg, res => {
}, res => { if (res.data.resultCode == 1) {
this.listArr = res.data.data.WdList; this.$message.success(res.data.message)
this.listArr.forEach((item, index) => { this.goBack()
item.IsCheck = res.data.data.WdList[index].IsCheck == '1' ? true : false } else {
}) this.$message.error(res.data.message)
this.signInDates = res.data.data.TdList; }
this.signInDates.forEach(item => {
item.Date = item.Date.substring(0, 10) }, err => {})
}) },
this.signOutDates = res.data.data.NottdList; getUpdateList() { //获取修改数据
this.signOutDates.forEach(item => { this.apipost('User_get_AttendanceGet', {
item.Date = item.Date.substring(0, 10) attendanceId: this.addMsg.attendanceId
}) }, res => {
this.getSpecialDates(); this.listArr = res.data.data.WdList;
this.awListData = res.data.data.AwList; this.listArr.forEach((item, index) => {
this.awWifiListDates = res.data.data.AwWifiList; item.IsCheck = res.data.data.WdList[index].IsCheck == '1' ? true : false
if(res.data.data.AwList.length > 0) { })
this.addressRange = res.data.data.AwList[0].Scope.toString(); this.signInDates = res.data.data.TdList;
} this.signInDates.forEach(item => {
item.Date = item.Date.substring(0, 10)
}, err => {}) })
}, this.signOutDates = res.data.data.NottdList;
goBack() { this.signOutDates.forEach(item => {
history.back(-1) item.Date = item.Date.substring(0, 10)
}, })
}, this.getSpecialDates();
mounted() { this.awListData = res.data.data.AwList;
this.addMsg.RB_BranchId = this.$route.query.bId; this.awWifiListDates = res.data.data.AwWifiList;
if(this.$route.query.id != undefined) { if (res.data.data.AwList.length > 0) {
this.addMsg.attendanceId = this.$route.query.id; this.addressRange = res.data.data.AwList[0].Scope.toString();
this.getUpdateList(); }
}
}, err => {})
} },
goBack() {
} history.back(-1)
},
},
mounted() {
this.addMsg.RB_BranchId = this.$route.query.bId;
if (this.$route.query.id != undefined) {
this.addMsg.attendanceId = this.$route.query.id;
this.getUpdateList();
}
}
}
</script> </script>
<style> <style>
.search-box { .search-box {
top: 46px; top: 46px;
left: 1px; left: 1px;
} }
.amap-page-container { .amap-page-container {
position: relative; position: relative;
width: 100%; width: 100%;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
} }
.att .el-select .el-input.is-disabled .el-input__inner { .att .el-select .el-input.is-disabled .el-input__inner {
height: 34px!important; height: 34px !important;
} }
.att_mapitem { .att_mapitem {
border-bottom: 1px solid #DCDFE6; border-bottom: 1px solid #DCDFE6;
cursor: pointer; cursor: pointer;
} }
.att_mapitem:last-child { .att_mapitem:last-child {
border-bottom: none; border-bottom: none;
} }
.awName { .awName {
height: 34px!important; height: 34px !important;
font-size: 14px!important; font-size: 14px !important;
line-height: 34px!important; line-height: 34px !important;
} }
.awAddress { .awAddress {
height: 34px!important; height: 34px !important;
} }
.att_addDates { .att_addDates {
width: 500px; width: 500px;
} }
.att_map_input {width: 200px;height: 34px;border-radius: 17px;padding: 0 10px;border: 1px solid #DCDFE6;} .att_map_input {
width: 200px;
.att_addDates .el-input__inner { height: 34px;
padding-left: 30px!important; border-radius: 17px;
} padding: 0 10px;
border: 1px solid #DCDFE6;
.att_addDates .el-input__icon { }
line-height: 34px!important;
} .att_addDates .el-input__inner {
padding-left: 30px !important;
.att_amap { }
width: 800px;
height: 300px; .att_addDates .el-input__icon {
} line-height: 34px !important;
}
.att_search_box {
position: absolute; .att_amap {
top: 25px; width: 800px;
left: 20px; height: 300px;
} }
.att_title>span { .att_search_box {
color: #999; position: absolute;
font-size: 12px; top: 25px;
padding-left: 15px; left: 20px;
} }
.att_title { .att_title>span {
height: 14px; color: #999;
line-height: 14px; font-size: 12px;
padding-left: 15px; padding-left: 15px;
border-left: 3px solid #E95252; }
margin: 30px 0;
} .att_title {
height: 14px;
.att_table { line-height: 14px;
width: 800px; padding-left: 15px;
border: none; border-left: 3px solid #E95252;
text-align: center; margin: 30px 0;
font-size: 12px; }
margin: 20px 0;
} .att_table {
width: 800px;
.att_table tr { border: none;
height: 38px; text-align: center;
text-align: center; font-size: 12px;
} margin: 20px 0;
}
.att_table tr th:first-child {
border-radius: 4px 0 0 0; .att_table tr {
} height: 38px;
text-align: center;
.att_table tr th:last-child { }
border-radius: 0 4px 0 0;
} .att_table tr th:first-child {
border-radius: 4px 0 0 0;
.att_table tr th { }
background: #EAEAEA;
color: #333; .att_table tr th:last-child {
} border-radius: 0 4px 0 0;
}
.att_table tr td {
background: #fff; .att_table tr th {
} background: #EAEAEA;
color: #333;
.att_table tr td .el-date-editor.el-input { }
width: 120px;
height: 28px; .att_table tr td {
} background: #fff;
}
.att_table tr td .el-input--prefix .el-input__inner {
padding-left: 30px; .att_table tr td .el-date-editor.el-input {
height: 28px; width: 120px;
} height: 28px;
}
.att_table tr td .el-input--prefix .el-input__icon {
line-height: 28px; .att_table tr td .el-input--prefix .el-input__inner {
} padding-left: 30px;
height: 28px;
.att_special_dates { }
font-size: 12px;
color: #666; .att_table tr td .el-input--prefix .el-input__icon {
text-indent: 30px; line-height: 28px;
height: 50px; }
}
.att_special_dates {
.att_addBtn { font-size: 12px;
width: 90px; color: #666;
height: 30px; text-indent: 30px;
border: 1px solid #DCDFE6; height: 50px;
background: #fff; }
margin: 20px 0;
border-radius: 15px; .att_addBtn {
margin-left: 30px; width: 90px;
cursor: pointer; height: 30px;
} border: 1px solid #DCDFE6;
background: #fff;
.att_addBtn:hover { margin: 20px 0;
box-shadow: 2px 2px 1px rgba(0, 0, 0, .1) border-radius: 15px;
} margin-left: 30px;
cursor: pointer;
.att_addBtn:active { }
background: #f9f9f9;
} .att_addBtn:hover {
box-shadow: 2px 2px 1px rgba(0, 0, 0, .1)
.att_saveDiv { }
margin: 30px 0;
} .att_addBtn:active {
background: #f9f9f9;
.att_type_item .el-select .el-input { }
width: 120px;
margin-left: 20px; .att_saveDiv {
} margin: 30px 0;
}
.att_type_item {}
.att_type_item .el-select .el-input {
.att_type_item p { width: 120px;
height: 40px; margin-left: 20px;
font-size: 12px; }
color: #333;
padding-left: 30px; .att_type_item {}
}
.att_type_item p {
.att_type_item p>span { height: 40px;
color: #999; font-size: 12px;
} color: #333;
</style> padding-left: 30px;
\ No newline at end of file }
.att_type_item p>span {
color: #999;
}
</style>
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