Mr.Shi
2023-08-22 a30af31a33908dac49a42849cacf36e9903a37e5
大屏
已修改2个文件
184 ■■■■ 文件已修改
screen_standard/src/components/AppLayout.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/views/index.vue 180 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/components/AppLayout.vue
@@ -46,7 +46,9 @@
        </div>
      </div>
    </div>
    <RouterView />
    <KeepAlive>
      <RouterView />
    </KeepAlive>
  </div>
</template>
screen_standard/src/views/index.vue
@@ -75,12 +75,13 @@
                                    <el-tooltip
                                        v-for="(child, i) in item.procedureList" :key="i"
                                        effect="dark"
                                        content="已报工良品数1000;工序计划数500"
                                        :content="'已报工良品数' + child.doneNum + ';工序计划数' + child.planNum"
                                        placement="top">
                                        <div class="scroll_item_row_item" @click="jump(child.procedureId)">
                                            <div class="scroll_item_row_item_x"></div>
                                            <img v-if="i == 0 || i == 1" src="@/assets/img/ic_complete@2x.png" alt="" />
                                            <span v-else>{{ child.rate }}%</span>
                                            <!-- <img v-if="i == 0 || i == 1" src="@/assets/img/ic_complete@2x.png" alt="" /> -->
                                            <span v-if="child.rate < 100">{{ child.rate }}%</span>
                                            <img v-else src="@/assets/img/ic_complete@2x.png" alt="" />
                                        </div>
                                    </el-tooltip>
                                </div>
@@ -189,7 +190,7 @@
</template>
<script setup>
    import { reactive, ref, onBeforeUnmount, onUnmounted, nextTick, computed, watch } from 'vue'
    import { reactive, ref, onBeforeUnmount, onUnmounted, nextTick, computed, watch, onActivated } from 'vue'
    import { getTop, getStockList, getWorkPlansList, getProcedureProcessList, getRecordLogPage, getDeviceCheckPage, getUnqualified7DayData, getUnqualifiedCateData } from '@/utils/api.js'
    import { useCounterStore } from '@/stores/counter.js'
    import * as echarts from 'echarts'
@@ -251,88 +252,99 @@
    watch(() => departId.value, (val) => {
        if (val) {
            // 当日员工产量TOP10
            getTop(companyId.value, departId.value)
                .then(res => {
                    if (res.length > 0) {
                        res.forEach((item, index) => {
                            if (index > 1) {
                                item.doneNum1 = res[0].doneNum / item.doneNum
                            }
                        })
                        data.production = res
                    }
                })
            // 仓库实时余量统计
            getStockList(companyId.value, departId.value)
                .then(res => {
                    data.marginStatistics = res
                    nextTick(() => {
                        start()
                    })
                })
            // 成品计划进度
            getWorkPlansList(companyId.value, departId.value)
                .then(res => {
                    data.plannedProgress = res
                    nextTick(() => {
                        start1()
                    })
                })
            // 报工日志
            getRecordLogPage(companyId.value, departId.value, {
                capacity: 9999,
                model: {},
                page: 1
            }).then(res => {
                data.log = res.records
                nextTick(() => {
                    start3()
                })
            })
            // 设备巡检记录
            getDeviceCheckPage(companyId.value, departId.value, {
                capacity: 9999,
                model: {},
                page: 1
            }).then(res => {
                data.patrolInspection = res.records
                nextTick(() => {
                    start4()
                })
            })
            // 近七天不良数
            getUnqualified7DayData(companyId.value, departId.value, '')
                .then(res => {
                    if (res && res.length > 0) {
                        data.dayDistribution = res.map(item => {
                            return {
                                date: item.createTime,
                                num: item.unqualifiedNum
                            }
                        })
                        setDayChart()
                    }
                })
            // 近七天不良项
            getUnqualifiedCateData(companyId.value, departId.value, '')
                .then(res => {
                    if (res && res.length > 0) {
                        data.num = 0
                        data.typeDistribution = res.map(item => {
                            data.num += item.unqualifiedNum
                            return {
                                name: item.categoryName,
                                num: item.unqualifiedNum
                            }
                        })
                        setTypeChart()
                    }
                })
            init()
        }
    })
    onActivated(() => {
        console.log('departId', departId.value)
        if (!departId.value) return
        init()
        console.log('onActivated')
    })
    start1()
    const init = () => {
        // 当日员工产量TOP10
        getTop(companyId.value, departId.value)
            .then(res => {
                if (res.length > 0) {
                    res.forEach((item, index) => {
                        if (index > 1) {
                            item.doneNum1 = res[0].doneNum / item.doneNum
                        }
                    })
                    data.production = res
                }
            })
        // 仓库实时余量统计
        getStockList(companyId.value, departId.value)
            .then(res => {
                data.marginStatistics = res
                nextTick(() => {
                    start()
                })
            })
        // 成品计划进度
        getWorkPlansList(companyId.value, departId.value)
            .then(res => {
                data.plannedProgress = res
                nextTick(() => {
                    start1()
                })
            })
        // 报工日志
        getRecordLogPage(companyId.value, departId.value, {
            capacity: 9999,
            model: {},
            page: 1
        }).then(res => {
            data.log = res.records
            nextTick(() => {
                start3()
            })
        })
        // 设备巡检记录
        getDeviceCheckPage(companyId.value, departId.value, {
            capacity: 9999,
            model: {},
            page: 1
        }).then(res => {
            data.patrolInspection = res.records
            nextTick(() => {
                start4()
            })
        })
        // 近七天不良数
        getUnqualified7DayData(companyId.value, departId.value, '')
            .then(res => {
                if (res && res.length > 0) {
                    data.dayDistribution = res.map(item => {
                        return {
                            date: item.createTime,
                            num: item.unqualifiedNum
                        }
                    })
                    setDayChart()
                }
            })
        // 近七天不良项
        getUnqualifiedCateData(companyId.value, departId.value, '')
            .then(res => {
                if (res && res.length > 0) {
                    data.num = 0
                    data.typeDistribution = res.map(item => {
                        data.num += item.unqualifiedNum
                        return {
                            name: item.categoryName,
                            num: item.unqualifiedNum
                        }
                    })
                    setTypeChart()
                }
            })
    }
    /**
     * 七日折线图
@@ -1248,8 +1260,8 @@
                    position: relative;
                    .content_right_top_nr_bottom_yuan {
                        position: absolute;
                        top: 299px;
                        left: 168px;
                        top: 63%;
                        left: 37%;
                        z-index: 999;
                        width: 114px;
                        height: 114px;