自动化立体仓库 - WCS系统
*
lsh
2025-02-24 45dd3bfd08d2c95ae284bae369507a19a2e524b7
*
2个文件已修改
57 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/RgvController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/index.html 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/RgvController.java
@@ -36,6 +36,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.rmi.CORBA.Util;
@@ -472,4 +473,15 @@
        return R.ok().add(result);
    }
    @PostMapping("/disable/rgv/status")
//    @ManagerAuth(memo = "作业信息")
    public R rgvDisableStatus(@RequestParam Integer rgvId,
                              @RequestParam Integer status){
        BasCircularShuttle basCircularShuttle = basCircularShuttleService.selectOne(new EntityWrapper<BasCircularShuttle>().eq("rgv_id", rgvId));
        basCircularShuttle.setStatus(status);
        basCircularShuttleService.updateById(basCircularShuttle);
        return R.ok();
    }
}
src/main/webapp/views/index.html
@@ -338,11 +338,18 @@
                            prop="status$"
                            label="状态">
                    </el-table-column>
<!--                    <el-table-column-->
<!--                            prop=""-->
<!--                            label="操作">-->
<!--                        <el-button type="primary" icon="el-icon-edit" circle></el-button>-->
<!--                    </el-table-column>-->
                    <el-table-column
                            label="操作"
                            type="template">
                        <template slot-scope="scope">
                            <el-button
                                    :type="scope.row.status === 0 ? 'primary' : 'danger'"
                                    size="small"
                                    @click="toggleStatus(scope.$index, scope.row)">
                                {{ scope.row.status === 0 ? '禁用' : '解除禁用' }}
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
@@ -444,6 +451,34 @@
                        }
                    }
                },
                toggleStatus(index, row) {
                    const currentStatus = row.status;
                    const targetStatus = currentStatus === 0 ? 1 : 0;
                    this.$confirm(`确认要${currentStatus === 0 ? '禁用' : '启用'}该设备吗?`, '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        $.ajax({
                            url: baseUrl + "/rgv/disable/rgv/status",
                            headers: {'token': localStorage.getItem('token')},
                            method: 'POST',
                            data: {
                                rgvId: row.rgvNo,
                                status: targetStatus
                            },
                            success: function (res) {
                                if (res.code === 200) {
                                    this.$message.success(`状态更新成功`);
                                    row.status$ = targetStatus; // 更新前端状态
                                } else {
                                    this.$message.error('状态更新失败');
                                }
                            }
                        });
                    });
                },
                handleChangeValueRight(val) {
                    console.log("33333"+val);