<style scoped>
|
.title {
|
height: 60px;
|
line-height: 60px;
|
}
|
|
.search {
|
background-color: #fff;
|
height: 80px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_thing {
|
width: 350px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_label {
|
width: 120px;
|
font-size: 14px;
|
text-align: right;
|
}
|
|
.search_input {
|
width: calc(100% - 110px);
|
}
|
|
.table {
|
margin-top: 10px;
|
background-color: #fff;
|
width: calc(100% - 40px);
|
height: calc(100% - 60px - 80px - 10px - 40px);
|
padding: 20px;
|
}
|
</style>
|
|
<template>
|
<div class="role_manage">
|
<div>
|
<el-row class="title">
|
<el-col :span="12" style="padding-left: 20px;">员工数据对比</el-col>
|
</el-row>
|
</div>
|
<div class="search">
|
<div class="search_thing">
|
<div class="search_label">账户名称:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.name"
|
></el-input></div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">对比的账户名称:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.comparisonName"
|
></el-input></div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">登记日期:</div>
|
<div class="search_input">
|
<el-date-picker size="small" v-model="componentData.entity.createTime" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" clearable></el-date-picker>
|
</div>
|
</div>
|
<div class="search_thing" style="padding-left: 30px;">
|
<el-button size="small" @click="refresh()">重 置</el-button>
|
<el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
|
</div>
|
</div>
|
<div class="table">
|
<ValueTable ref="ValueTable" :url="$api.dataReporting.selectDataComparisonDtoPageList" :componentData="componentData" :key="upIndex"/>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import ValueTable from '../tool/value-table.vue'
|
export default {
|
components: {
|
ValueTable
|
},
|
data() {
|
return {
|
componentData: {
|
entity: {
|
name: null,
|
comparisonName:null,
|
createTime: null,
|
orderBy: {
|
field: 'createTime',
|
order: 'desc'
|
}
|
},
|
isIndex: false,
|
showSelect: false,
|
select: true,
|
do: [],
|
tagField: {}
|
},
|
entityCopy: {},
|
upIndex: 0,
|
addDia: false,
|
product: [],
|
outPower: true
|
}
|
},
|
created() {
|
var today = new Date();
|
var yesterday = new Date(today);
|
yesterday.setDate(today.getDate() - 1);
|
var yyyy = yesterday.getFullYear();
|
var mm = yesterday.getMonth() + 1;
|
var dd = yesterday.getDate()
|
if (dd < 10) {
|
dd = "0" + dd;
|
}
|
if (mm < 10) {
|
mm = "0" + mm;
|
}
|
this.componentData.entity.createTime = `${yyyy}-${mm}-${dd} 00:00:00`
|
},
|
mounted() {
|
this.entityCopy = this.HaveJson(this.componentData.entity)
|
this.selectDataComparisonDtoPageList()
|
},
|
methods: {
|
refreshTable() {
|
if(this.componentData.entity.name == null || this.componentData.entity.name == '') {
|
this.$message.error('账户名称是必填项')
|
}else if(this.componentData.entity.comparisonName == null || this.componentData.entity.comparisonName == '') {
|
this.$message.error('对比的账户名称是必填项')
|
}else if(this.componentData.entity.createTime == null) {
|
this.$message.error('登记时间是必填项')
|
}else if(this.componentData.entity.name === this.componentData.entity.comparisonName) {
|
this.$message.error('对比的账户不能重复')
|
}else {
|
this.$refs['ValueTable'].selectList()
|
}
|
},
|
refresh() {
|
this.componentData.entity = this.HaveJson(this.entityCopy)
|
this.upIndex++
|
},
|
selectDataComparisonDtoPageList() {
|
this.$axios.get(this.$api.dataReporting.selectDataComparisonDtoPageList).then(res => {
|
res.data.forEach(a => {
|
a.isClick = false
|
a.look = false
|
})
|
this.menu = res.data
|
this.menuCopy = this.HaveJson(res.data)
|
})
|
}
|
}
|
}
|
</script>
|