var vms = Vue.component("Company-amplify-dkgkts", {
template: `
`,
props: {
businessdata:{
type:Object
}
},
data() {
return {
show:false,
//打卡管控提示
abnormalNav:0,
showTableData:[],
showTableTile: [],
interval:'',
rowStyle:{
color:'#ffffff',
fontSize:'24px',
height:'64px'
},
headerRow:{
fontSize: '20px'
},
tableData:[
{
projectName:'泾河新城荟锦坊二期',
id: 0,
name:'张三三',
equipment:'轮胎式轮胎式胎式',
time:'10.21 11:44:44'
},
{
projectName:'西安地铁2号线二期2标',
id: 1,
name:'张三三',
equipment:'轮胎式轮胎式轮胎胎式',
time:'10.21 11:44:44'
},
{
projectName:'苏州桑田岛项目',
id: 2,
name:'张三三',
equipment:'轮胎式式',
time:'10.21 11:44:44'
},
{
projectName:'苏州桑田岛项目',
id: 3,
name:'张三三',
equipment:'轮胎式轮胎式轮胎式轮胎式',
time:'10.21 11:44:44'
},
{
projectName:'西安地铁2号线二期2标',
id: 4,
name:'张三三',
equipment:'轮胎式轮胎式轮胎式轮胎式',
time:'10.21 11:44:44'
},
],
tableTile:[],
}
},
mounted(){
// //打卡管控提示 自动滚动
this.interval = setInterval(this.scroll,50);
},
methods: {
openAmplify(){
this.show = true
this.getClockInException()
},
closeAmplify(){
this.show = false
},
closeAmplifyAll(e){
if(e.target.className == 'amplify-fixed'){
this.show = false
}
},
//打卡管控提示
onAbnormalNav(n){
this.abnormalNav = n;
this.showTableData = this.tableData[n];
this.showTableTile = this.tableTile[n];
},
//打卡管控提示
getClockInException(){
axios.post(this.businessdata.requestUrl+"getClockInException?deptId="+this.businessdata.deptId+"&pageSize=50"+"&projectId="+this.businessdata.projectIdStr, {
}).then(res => {
this.tableData = [
res.data.data.signExceptionList,
res.data.data.workTimeExceptionList,
res.data.data.certExceptionList
]
this.tableTile = [
[{name:"项目名称",value:"projectName"},{name:"姓名",value:"userName"},{name:"打卡设备",value:"deviceName"},{name:"打卡时间",value:"dataTime"}],
[{name:"项目名称",value:"projectName"},{name:"设备名称",value:"deviceName"},{name:"异常原因",value:"errorReason"},{name:"打卡时间",value:"date"}],
[{name:"项目名称",value:"projectAbbreviation"},{name:"姓名",value:"certificateName"},{name:"过期天数",value:"date"},{name:"到期时间",value:"validityDate"}]
];
this.showTableData = this.tableData[0];
this.showTableTile = this.tableTile[0];
}).catch(err => {
})
},
// 表格滚动 方法 --------- 开始
scroll(){
let maxHeight=this.$refs.wgzp.$el.querySelectorAll ('.el-table__body')[0].offsetHeight;
let clientHeight=this.$refs.wgzp.bodyWrapper.clientHeight;
if(Math.abs(this.$refs.wgzp.bodyWrapper.scrollTop-(maxHeight-clientHeight))<5){ //预留5像素误差
this.$refs.wgzp.bodyWrapper.scrollTop=0;
}else{
this.$refs.wgzp.bodyWrapper.scrollTop+= 1;//32是每一行表格的高度,每秒滚一行
}
},
MouseEnter(){//鼠标移入停止滚动
clearInterval(this.interval);
},
MouseLeave(){//鼠标离开继续滚动
this.interval=setInterval(this.scroll,30);
},
// 表格滚动 方法 ------ 结束
},
watch:{
},
})