1
lzhe
2024-11-30 7fd74cafb955021f4f3c287d9edba969645095f1
1
已修改5个文件
211 ■■■■ 文件已修改
src/views/mdc/components/process-charts.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/first-workpiece-detail.vue 131 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/first-workpiece-process.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/first-workpiece.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/processParam/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/components/process-charts.vue
@@ -75,7 +75,7 @@
            arr.push(obj)
        }
        this.option.series = arr;
        console.log(this.option.series)
        //console.log(this.option.series)
        var recordDom = this.$refs.processCharts;
        var myChart = echarts.init(recordDom);
        myChart.setOption(this.option);
src/views/mdc/first-workpiece-detail.vue
@@ -28,24 +28,55 @@
            </div>
        </el-card>
        <el-card body-style="height: 100%;padding: 0;" style="margin-bottom: 12px;">
            <el-table :data="tableData" border @selection-change="handleSelectionChange">
                <el-table-column prop="test" label="序号" width="60"></el-table-column>
                <el-table-column prop="test" label="零件号" width="80"></el-table-column>
                <el-table-column prop="test" label="工序号" width="80"></el-table-column>
                <el-table-column prop="test" label="版次" width="60"></el-table-column>
                <el-table-column prop="test" label="机床" width="60"></el-table-column>
                <el-table-column prop="test" label="开机时间" width="80"></el-table-column>
                <el-table-column prop="test" label="结束时间" width="80"></el-table-column>
                <el-table-column prop="test" label="占机时间" width="100"></el-table-column>
                <el-table-column prop="test" label="装夹调试时间" width="100"></el-table-column>
                <el-table-column prop="test" label="首件切削时间" width="100"></el-table-column>
                <el-table-column prop="test" label="首件切削时间" width="100"></el-table-column>
                <el-table-column prop="test" label="末件拆卸时间" width="100"></el-table-column>
                <el-table-column prop="test" label="首件计量时间" width="100"></el-table-column>
                <el-table-column prop="test" label="加工时间" width="80"></el-table-column>
                <el-table-column prop="test" label="准备时间" width="80"></el-table-column>
                <el-table-column prop="test" label="单件工时" width="80"></el-table-column>
                <el-table-column prop="test" label="数量" width="60"></el-table-column>
            <el-table :data="tableData" border>
                <el-table-column prop="index" label="序号" width="60"></el-table-column>
                    <el-table-column prop="partNo" label="零件号" width="80"></el-table-column>
                    <el-table-column prop="processNo" label="工序号" width="80"></el-table-column>
                    <el-table-column prop="version" label="版次" width="60"></el-table-column>
                    <el-table-column prop="workstationName" label="机床" width="100"></el-table-column>
                    <el-table-column prop="startTime" label="开机时间" width="145"></el-table-column>
                    <el-table-column prop="endTime" label="结束时间" width="145"></el-table-column>
                    <el-table-column prop="occupancySecs" label="占机时间" width="100">
                        <template #default="scope">
                            {{ convertSeconds(scope.row.occupancySecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="clampingSecs" label="装夹调试时间" width="100">
                         <template #default="scope">
                            {{ convertSeconds(scope.row.clampingSecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="firstWorkingSecs" label="首件切削时间" width="100">
                        <template #default="scope">
                            {{ convertSeconds(scope.row.firstWorkingSecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="firstMeasureSecs" label="首件计量时间" width="100">
                        <template #default="scope">
                            {{ convertSeconds(scope.row.firstMeasureSecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="lastRemoveSecs" label="末件拆卸时间" width="100">
                        <template #default="scope">
                            {{ convertSeconds(scope.row.lastRemoveSecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="processingSecs" label="加工时间" width="80">
                        <template #default="scope">
                            {{ convertSeconds(scope.row.processingSecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="prepareSecs" label="准备时间" width="80">
                        <template #default="scope">
                            {{ convertSeconds(scope.row.prepareSecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="singleProcessSecs" label="单件工时" width="80">
                        <template #default="scope">
                            {{ convertSeconds(scope.row.singleProcessSecs || 0) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="amount" label="数量" width="60"></el-table-column>
            </el-table>
            <el-footer>
                <el-button type="primary">输出</el-button>
@@ -73,23 +104,69 @@
        }
    },
    created() {
        var idList = this.$route.query.idList.split(",");
    },
    mounted() {
        this.getTableData();
        var idList = this.$route.query.ids.split(",");
        idList.forEach(item=> {
            this.detailModelList.push({id: item});
        })
        // console.log(this.detailModelList,222);
        for(var i=0;i<10;i++) {
            this.tableData.push({test: 1})
        }
    },
    mounted() {
    },
    methods: {
        handleSelectionChange() {
        convertSeconds(seconds) {  //转换时间
            // 定义时间单位转换关系
            const daysInSeconds = 24 * 60 * 60;
            const hoursInSeconds = 60 * 60;
            const minutesInSeconds = 60;
            // 计算天数
            let days = Math.floor(seconds / daysInSeconds);
            seconds %= daysInSeconds;
            // 计算小时数
            let hours = Math.floor(seconds / hoursInSeconds);
            seconds %= hoursInSeconds;
            // 计算分钟数
            let minutes = Math.floor(seconds / minutesInSeconds);
            seconds %= minutesInSeconds;
            // 准备结果数组
            let result = [];
            // 根据需要添加天数到结果数组
            if (days > 0) {
                result.push(`${days}天`);
            }
            // 根据需要添加小时数到结果数组
            if (hours > 0) {
                result.push(`${hours}小时`);
            }
            // 根据需要添加分钟数到结果数组
            if (minutes > 0) {
                result.push(`${minutes}分钟`);
            }
            // 始终添加秒数到结果数组(因为秒数总是有意义的)
            result.push(`${seconds}秒`);
            // 返回格式化后的字符串
            return result.join(' ');
        },
        goFirstWorkProcess(item) {
            this.$router.push({path: `/mdc/first-workpiece-process`,query: {id:item.id}})
            sthis.$router.push({path: `/mdc/first-workpiece-process`,query: {id:item.id}})
        },
        getTableData() {
            this.$HTTP.post(`/api/workinghour/listByIds`, {ids: this.$route.query.ids.split(',')}).then(res => {
                if (res.code === 200) {
                    res.data.forEach((item,index)=> {
                        item.index = index + 1;
                    })
                    this.tableData = res.data;
                }
            })
        }
    }
}
src/views/mdc/first-workpiece-process.vue
@@ -9,12 +9,12 @@
<template>
    <el-main style="height: 100%;" class="timeAnalysis">
        <el-card body-style="height: 100%;padding: 0;" style="margin-bottom: 12px;">
            <el-table :data="tableData" border @selection-change="handleSelectionChange">
                <el-table-column prop="test" label="程序名称"></el-table-column>
                <el-table-column prop="test" label="开机时间"></el-table-column>
                <el-table-column prop="test" label="结束时间"></el-table-column>
                <el-table-column prop="test" label="持续时长"></el-table-column>
                <el-table-column prop="test" label="状态"></el-table-column>
            <el-table :data="tableData" border>
                <el-table-column prop="progName" label="程序名称"></el-table-column>
                <el-table-column prop="startTime" label="开机时间"></el-table-column>
                <el-table-column prop="endTime" label="结束时间"></el-table-column>
                <el-table-column prop="duration" label="持续时长"></el-table-column>
                <el-table-column prop="deviceStatus" label="状态"></el-table-column>
            </el-table>
            <el-footer>
                <el-button type="primary">输出</el-button>
@@ -40,16 +40,34 @@
        }
    },
    created() {
        for(var i=0;i<10;i++) {
            this.tableData.push({test: 1})
        }
    },
    mounted() {
        this.getTableData();
    },
    methods: {
        handleSelectionChange() {
        }
        getTableData() {
            this.$HTTP.get(`/api/workinghour/working-process`, {id: this.$route.query.id}).then(res => {
                if (res.code === 200) {
                    this.getprocess(res);
                }
            })
        },
        getprocess(res) {  //颜色状态
            this.$HTTP.get(`/api/smis/global_wcs/list?code=&name=`).then(resp => {
                if (resp.code == 200) {
                    res.data.forEach(item=> {
                        resp.data.forEach(item1=> {
                            if(item.deviceStatus == item1.code) {
                                item.deviceStatus = item1.name;
                            }
                        })
                    })
                    this.tableData = res.data;
                    console.log(res.data,111)
                }
            })
        },
    }
}
</script>
src/views/mdc/first-workpiece.vue
@@ -62,19 +62,14 @@
                                    {{ convertSeconds(scope.row.firstWorkingSecs || 0) }}
                                </template>
                            </el-table-column>
                            <el-table-column prop="firstWorkingSecs" label="首件切削时间" width="100">
                            <el-table-column prop="firstMeasureSecs" label="首件计量时间" width="100">
                                <template #default="scope">
                                    {{ convertSeconds(scope.row.firstWorkingSecs || 0) }}
                                    {{ convertSeconds(scope.row.firstMeasureSecs || 0) }}
                                </template>
                            </el-table-column>
                            <el-table-column prop="lastRemoveSecs" label="末件拆卸时间" width="100">
                                <template #default="scope">
                                    {{ convertSeconds(scope.row.lastRemoveSecs || 0) }}
                                </template>
                            </el-table-column>
                            <el-table-column prop="firstMeasureSecs" label="首件计量时间" width="100">
                                <template #default="scope">
                                    {{ convertSeconds(scope.row.firstMeasureSecs || 0) }}
                                </template>
                            </el-table-column>
                            <el-table-column prop="processingSecs" label="加工时间" width="80">
@@ -129,7 +124,7 @@
            tabPosition: "设备结构树",
            tableData: [],
            treeChecked: [],
            workstationIdList: [],
            ids: [],
            total: 0,
            current: 1,
            size: 20
@@ -142,7 +137,12 @@
        // }
    },
    mounted() {
        //this.getTableData();
        var date = new Date();
        var threeDaysInMilliseconds = 3 * 24 * 60 * 60 * 1000;
        var threeDaysAgo = new Date(date.getTime() - threeDaysInMilliseconds);
        this.searchInfo.startDate = threeDaysAgo.toLocaleDateString().replace(/\//g,"-");
        this.searchInfo.endDate = date.toLocaleDateString().replace(/\//g,"-");
        this.getTableData();
    },
    methods: {
        handleCurrentChange(val) {
@@ -212,16 +212,16 @@
            })
        },
        goFirstWorkDetail() {
            if(this.workstationIdList.length == 0) {
            if(this.ids.length == 0) {
                this.$message.error("请先选择数据");
                return;
            }
            this.$router.push({path: `/mdc/first-workpiece-detail`,query: {idList: this.workstationIdList.join(',')}})
            this.$router.push({path: `/mdc/first-workpiece-detail`,query: {ids: this.ids.join(',')}})
        },
        handleSelectionChange(val) {
            this.workstationIdList = [];
            this.ids = [];
            val.forEach(item=> {
                this.workstationIdList.push(item.workstationId);
                this.ids.push(item.id);
            })
        },
        query() {
src/views/mdc/processParam/index.vue
@@ -455,10 +455,12 @@
                }
            }).map(v => {
                if (myname === 'DeviceStatus') {
                    return {
                        ...v,
                        itemStyle: {
                            color: this.legend.find(item => item.name === v.name).color
                    if(v.name != 'undefined') {
                        return {
                            ...v,
                            itemStyle: {
                                color: this.legend.find(item => item.name === v.name).color
                            }
                        }
                    }
                }