ZengTao
2024-03-18 5a427c9d36d3712ec6185e14637cb8b4d0183fe8
修改主页面
6个文件已修改
98 ■■■■ 已修改文件
Albania_Mes-ui/src/api/home.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/lang/locales/en-US.json 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/home/index.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/api/home.js
@@ -302,9 +302,9 @@
    })
}
export function FinishTask(tasktype,id) {
export function FinishTask(id) {
    return request({
        url: '/home/FinishTask?tasktype='+tasktype+'&id='+id,
        url: '/home/FinishTask?id='+id,
        method: 'post',
        data:""
    })
Albania_Mes-ui/src/lang/locales/en-US.json
@@ -1,4 +1,6 @@
{
  "Operation failed":"Operation canceled",
  "Flowcard":"Flowcard",
  "Glasstype":"Glasstype",
  "Mode Change":"Mode Change",
Albania_Mes-ui/src/views/home/index.vue
@@ -252,20 +252,21 @@
                </div>
            </div>
            <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState"
                <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    {{ $t('Import order') }}</el-button>
                <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState"
                <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    {{ $t('Measure') }}</el-button>
                <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState"
                <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    {{ $t('StorageCage') }}</el-button>
                <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState"
                <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState" style="z-index: 999;"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    {{ $t('Task queue') }}</el-button>
            </div>
            <div style="display: flex;align-items: center;">
                <div class="blocks" style="position: relative;width: 100%;">
@@ -331,15 +332,18 @@
            <div>
                <!--功能-->
                <div>
                    <button v-on:click="ManualMatching" style="width: 120px;height: 60px;background-color: aquamarine;border: 0px;border-radius: 5px;">人工匹配</button>
                        <el-button type="primary" @click="ManualMatching()" :disabled="SoftEmergencyStopState" style="z-index: 999;">
                    人工匹配</el-button>
                </div>
                <!--显示-->
                <div style="width:100%;height: 600px;border: 1px solid black;">
                    <!--玻璃图-->
                    <div style="top:0;bottom: 0;left: 0;right: 0;margin: auto;position:absolute;width: 100px;height: 200px;background-color: aqua;line-height: 200px;text-align: center;">
                    <div
                        style="top:0;bottom: 0;left: 0;right: 0;margin: auto;position:absolute;width: 100px;height: 200px;background-color: aqua;line-height: 200px;text-align: center;">
                        100*200
                    </div>
                </div>
            </div>
        </el-dialog>
@@ -406,7 +410,7 @@
                </el-table-column>
                <el-table-column prop="state" :label="$t('Task State')">
                    <template slot-scope='scope'>
                        {{ scope.state == 0 ? $t('Start') : $t('Finished') }}
                        {{ scope.row.state >= 0?scope.row.state == 0 ? $t('Start') : $t('Stop'):"" }}
                    </template>
                </el-table-column>
                <el-table-column prop="method" :label="$t('Task Method')">
@@ -478,7 +482,7 @@
    name: "Home",
    data() {
        return {
            tableData1:[],
            tableData1: [],
            Measuermode: false,
            confirm1: false,
            confirm2: false,
@@ -632,7 +636,6 @@
                    this.cagelist4 = obj.cagelist4[0];
                    this.tasklist2 = obj.StoragTaskeTaskFeed[0];
                    this.tasklist1 = obj.StoragTaskeTaskOut[0];
                    console.log(this.tasklist1);
                    this.alarm = obj.alarmmg[0];
                    this.tableData1 = obj.OrderTask[0];
@@ -725,14 +728,16 @@
        StorageCageAddGlass(index) {
            if (this.Measuermode == true) {
                StorageCageAddGlass(this.cell, this.StorageCageAddInfo[index]).then(res => {
                    if (res.data.code == 200) {
                    if (res.data.message == 200) {
                        this.$message.success(this.$t('Operation successful'));
                    }
                })
            } else {
                UpdateQueue(this.StorageCageAddInfo[index]).then(res => {
                    if (res.data.code == 200) {
                    if (res.data.message == 200) {
                        this.$message.success(this.$t('Operation successful'));
                    }else{
                        this.$message.error(this.$t('Operation failed'));
                    }
                });
            }
@@ -740,9 +745,8 @@
        },
        //领取/暂停任务
        ClaimTasks(flowcard, state) {
            console.log(flowcard, state);
            ClaimTasks(flowcard, state).then(res => {
                if (res.data.code == 200) {
                if (res.data.message == 200) {
                    this.$message.success(this.$t('Operation successful'));
                }
            });
@@ -750,7 +754,7 @@
        //修改出片方式
        ModeChange(flowcard, method) {
            ModeChange(flowcard, method).then(res => {
                if (res.data.code == 200) {
                if (res.data.message == 200) {
                    this.$message.success(this.$t('Operation successful'));
                }
            });
@@ -850,7 +854,7 @@
        },
        //人工匹配
        ManualMatching() {
            console.log(11111111);
            this.StorageCageAdd=true;
        }
    }
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -140,32 +140,32 @@
                String PlcRequest = "1";
                double width = 402;
                double height = 402;
                // String PlcRequest = "1";
                // double width = 0;
                // double height = 0;
                
                //获取匹配设置
                if ("1".equals(PlcRequest)) {
                    List<GlassInfo> Result=HomeService.NormalGlassInfo(width, height, "1");
                    if(Result.size()==1){
                        //匹配成功  就一种类型  添加数据
                        GlassInfo GlassInfo=Result.get(0);
                        QueueMapper.insert(GlassInfo.getGlassid(),width,height,1);
                        System.out.println("匹配成功");
                        //S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(), (short) 1);
                        System.out.println(GlassInfo.getGlassid());
                    }else if(Result.size()>1){
                        //匹配失败 匹配到多条符合的数据  添加数据
                        QueueMapper.insert(null,width,height,2);
                        System.out.println("匹配失败");
                    }
                    else{
                        //匹配失败 未找到符合的数据 添加数据
                        QueueMapper.insert(null,width,height,3);
                        System.out.println("未找到符合的数据");
                    }
                // //获取匹配设置
                // if ("1".equals(PlcRequest)) {
                //     List<GlassInfo> Result=HomeService.NormalGlassInfo(width, height, "1");
                //     if(Result.size()==1){
                //         //匹配成功  就一种类型  添加数据
                //         GlassInfo GlassInfo=Result.get(0);
                //         QueueMapper.insert(GlassInfo.getGlassid(),width,height,1);
                //         System.out.println("匹配成功");
                //         //S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(), (short) 1);
                //         System.out.println(GlassInfo.getGlassid());
                //     }else if(Result.size()>1){
                //         //匹配失败 匹配到多条符合的数据  添加数据
                //         QueueMapper.insert(null,width,height,2);
                //         System.out.println("匹配失败");
                //     }
                //     else{
                //         //匹配失败 未找到符合的数据 添加数据
                //         QueueMapper.insert(null,width,height,3);
                //         System.out.println("未找到符合的数据");
                //     }
                    
                }
                // }
                // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16));
                // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14));
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -455,8 +455,8 @@
  //手动完成任务
  @PostMapping("/FinishTask")
  public Result FinishTask(Integer tasktype,Integer id) {
    return storageCageService.FinishTask(tasktype,id);
  public Result FinishTask(Integer id) {
    return storageCageService.FinishTask(id);
  }
  
  //查询玻璃信息
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -237,7 +237,7 @@
    }
    //手动完成任务
    public Result FinishTask(Integer tasktype, Integer id) {
    public Result FinishTask(Integer id) {
        StorageTask storageTask = homeMapper.SelectStorageTaskById(id);//获取任务信息
        homeMapper.FinishTask(storageTask.getId());//完成任务
        if(storageTask.getTaskType().equals("0")){