mkl_power_box/components/amplify/Company/jixieguanli/amplify-dkgkts.js

167 lines
6.5 KiB
JavaScript
Raw Normal View History

2024-11-19 00:17:04 +08:00
var vms = Vue.component("Company-amplify-dkgkts", {
template: `
<div>
<div class="amplify-title-icon">
<img src="https://fileimg.makalu.cc/WEB_DBD5893450984E50AFF356EF44FF4139.png" @click="openAmplify">
</div>
<transition name="el-zoom-in-top">
<div class="amplify-fixed" v-show="show" style="display: none" @click="closeAmplifyAll">
<div class="amplify-max">
<div class="amplify-title">
<div>打卡管控提示</div>
<div class="amplify-close" @click="closeAmplify"><i class="el-icon-close"></i></div>
</div>
<div class="amplify-content">
<!--内容区域-->
<div class="amplify-warning-info-title">
<div :class="abnormalNav==0?'active':''" @click="onAbnormalNav(0)">位置异常</div>
<div :class="abnormalNav==1?'active':''" @click="onAbnormalNav(1)">工时异常</div>
<div :class="abnormalNav==2?'active':''" @click="onAbnormalNav(2)">操作证到期</div>
</div>
<div class="amplify-warning-info-table">
<el-table ref="wgzp" :data="showTableData" height="460" :header-row-style="headerRow" :row-style="rowStyle" @cell-mouse-enter="MouseEnter" @cell-mouse-leave="MouseLeave" class="elTable">
<el-table-column v-for="st in showTableTile" :prop="st.value" :label="st.name" width="200" show-overflow-tooltip></el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</transition>
</div>
`,
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:{
},
})