feat: 更新加载对话框和主窗口逻辑,调整订单号输入框回显字段为mo,优化信息表格更新逻辑

This commit is contained in:
zhu-mengmeng 2025-07-21 14:19:48 +08:00
parent e75761bc39
commit 0d216d3067
3 changed files with 7 additions and 9 deletions

Binary file not shown.

View File

@ -110,7 +110,7 @@ class LoadingDialog(LoadingDialogUI):
# 更新UI # 更新UI
# 注意此时order_data["note"]已经被修改为order_data["mo"]的值 # 注意此时order_data["note"]已经被修改为order_data["mo"]的值
self.order_input.setText(order_data.get("note", "")) self.order_input.setText(order_data.get("mo", ""))
# 更新轴型 # 更新轴型
self.axis_value.setText(order_data.get("zx_name", "--")) self.axis_value.setText(order_data.get("zx_name", "--"))

View File

@ -3734,9 +3734,6 @@ class MainWindow(MainWindowUI):
logging.info(f"主窗口接收到订单号: {order_code}") logging.info(f"主窗口接收到订单号: {order_code}")
# 存储当前订单号 # 存储当前订单号
self._current_order_code = order_code self._current_order_code = order_code
# 更新订单号输入框
self.order_no_input.setText(order_code)
# 如果是接口模式 # 如果是接口模式
if AppMode.is_api(): if AppMode.is_api():
# 获取订单的详细信息 # 获取订单的详细信息
@ -3751,6 +3748,8 @@ class MainWindow(MainWindowUI):
if gc_notes and len(gc_notes) > 0: if gc_notes and len(gc_notes) > 0:
# 更新上料区域信息表格 # 更新上料区域信息表格
self.update_info_table(gc_notes[0]) self.update_info_table(gc_notes[0])
# 订单号输入框回显 mo 字段
self.order_no_input.setText(gc_notes[0].get('mo', ''))
else: else:
# 非接口模式,获取本地数据库中的订单信息 # 非接口模式,获取本地数据库中的订单信息
from dao.inspection_dao import InspectionDAO from dao.inspection_dao import InspectionDAO
@ -3759,6 +3758,9 @@ class MainWindow(MainWindowUI):
# 更新上料区域信息表格 # 更新上料区域信息表格
self.update_info_table(order_info) self.update_info_table(order_info)
# 订单号输入框回显 mo 字段
if order_info:
self.order_no_input.setText(order_info.get('mo', ''))
def on_report(self): def on_report(self):
"""报表按钮点击处理""" """报表按钮点击处理"""
@ -4290,11 +4292,7 @@ class MainWindow(MainWindowUI):
QMessageBox.critical(self, "错误", f"处理托盘完成失败: {str(e)}") QMessageBox.critical(self, "错误", f"处理托盘完成失败: {str(e)}")
def update_info_table(self, order_info): def update_info_table(self, order_info):
"""根据订单信息更新上料区域的信息表格 """根据订单信息更新上料区域的信息表格"""
Args:
order_info: 订单信息字典
"""
try: try:
if not order_info: if not order_info:
logging.warning("订单信息为空,无法更新上料区域信息表格") logging.warning("订单信息为空,无法更新上料区域信息表格")