“zhuo”
2024-01-08 bb472b43a0a58b3156a28b9cfb4ff4030932c6c5
员工数据对比
已修改2个文件
已添加1个文件
161 ■■■■■ 文件已修改
src/assets/api/controller.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/data-comparison.vue 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -37,6 +37,7 @@
    downRegistrantCountFile: "/dataReporting/downRegistrantCountFile", //导出员工数据统计
    downFansSubmitFile: "/dataReporting/downFansSubmitFile", //导出进粉上报
    inputFansSubmitCsv: "/dataReporting/inputFansSubmitCsv", //导入进粉上报
    selectDataComparisonDtoPageList: "/dataReporting/selectDataComparisonDtoPageList", //获取数据对比列表
    
    selectFansSubmitList: "/dataReporting/selectFansSubmitList", //获取进粉上报列表
    delFansSubmit: "/dataReporting/delFansSubmit", //删除进粉上报信息
src/components/view/data-comparison.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,154 @@
<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>
src/view/index.vue
@@ -371,6 +371,12 @@
                            i: "font icon-24gl-clipboardList",
                            u: "registrant-count",
                            p: "selectRegistrantCountDtoPageList"
                        },{
                            k: 12,
                            v: "员工数据对比",
                            i: "font icon-24gl-clipboardList",
                            u: "data-comparison",
                            p: "selectDataComparisonDtoPageList"
                        }]
                    },
                    {