2025-11-08 18:25:16 +08:00
|
|
|
|
from PySide6.QtWidgets import (
|
|
|
|
|
|
QApplication,
|
|
|
|
|
|
QDialog,
|
|
|
|
|
|
QVBoxLayout,
|
|
|
|
|
|
QHBoxLayout,
|
|
|
|
|
|
QGridLayout,
|
|
|
|
|
|
QLabel,
|
|
|
|
|
|
QWidget,
|
|
|
|
|
|
QPushButton,
|
|
|
|
|
|
)
|
|
|
|
|
|
from PySide6.QtGui import QPixmap, QFont, QPainter, QIcon
|
|
|
|
|
|
from PySide6.QtCore import Qt, QEvent, Signal
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
from utils.image_paths import ImagePaths
|
|
|
|
|
|
|
|
|
|
|
|
from view.widgets.value_adjuster import ValueAdjuster
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
派单任务的详情按钮点击之后弹出, 显示派单任务的详情
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
class DispatchDetailsDialog(QDialog):
|
|
|
|
|
|
# 确认修改了派单任务的方量,发送任务名(task1、task2等)和最终确认修改的方量值
|
|
|
|
|
|
confirm_modify_volume = Signal(str, float)
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, dispatch_task_name:str, parent=None):
|
|
|
|
|
|
super().__init__(parent)
|
|
|
|
|
|
self.setAttribute(Qt.WA_TranslucentBackground)
|
|
|
|
|
|
|
|
|
|
|
|
# 派单任务名 (task1、task2、 task3)
|
|
|
|
|
|
self.dispatch_task_name = dispatch_task_name
|
|
|
|
|
|
|
|
|
|
|
|
# 初始化存储需要修改的控件
|
|
|
|
|
|
self.id_value_label = None # 对应管片ID值标签
|
|
|
|
|
|
self.rows = [] # 所有行的单元格列表(包含label、value)
|
|
|
|
|
|
|
|
|
|
|
|
# 派单方量调整控件,用于修改派单方量
|
|
|
|
|
|
self.volume_value_adjuster = None
|
|
|
|
|
|
|
|
|
|
|
|
self._init_ui()
|
|
|
|
|
|
|
|
|
|
|
|
def _init_ui(self):
|
|
|
|
|
|
self.setWindowFlags(Qt.FramelessWindowHint)
|
|
|
|
|
|
self._load_background()
|
|
|
|
|
|
|
|
|
|
|
|
main_layout = QVBoxLayout(self)
|
|
|
|
|
|
main_layout.setContentsMargins(32, 20, 32, 50)
|
|
|
|
|
|
main_layout.setSpacing(0)
|
|
|
|
|
|
|
|
|
|
|
|
# 1. 顶部区域(标题 + 关闭按钮)
|
|
|
|
|
|
self._add_top_area(main_layout)
|
|
|
|
|
|
|
|
|
|
|
|
# 2. 对应管片ID区域
|
|
|
|
|
|
self._add_segment_id_area(main_layout)
|
|
|
|
|
|
|
|
|
|
|
|
# 3. 网格信息区域(单列7行)
|
|
|
|
|
|
self._add_grid_info_area(main_layout)
|
|
|
|
|
|
|
|
|
|
|
|
# 4. 修改方量按钮
|
|
|
|
|
|
self.modify_btn = QPushButton("修改方量", parent=self)
|
|
|
|
|
|
self.modify_btn.setFixedSize(89, 32)
|
|
|
|
|
|
self.modify_btn.setStyleSheet(
|
|
|
|
|
|
"""
|
|
|
|
|
|
QPushButton {
|
|
|
|
|
|
background-color: #001c82;
|
|
|
|
|
|
color: #9fbfd4;
|
|
|
|
|
|
border: 1px solid #017cbc;
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
font-weight: Bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
QPushButton:hover {
|
|
|
|
|
|
color: #2dcedb;
|
|
|
|
|
|
}
|
|
|
|
|
|
"""
|
|
|
|
|
|
)
|
|
|
|
|
|
# modify_btn.move(860, 446) # 移动到第五行,派单方量的位置
|
|
|
|
|
|
self.modify_btn.move(860, 442) # 移动到第五行,派单方量的位置
|
|
|
|
|
|
self.modify_btn.clicked.connect(self.onModifyVolume)
|
|
|
|
|
|
|
|
|
|
|
|
# 确认修改方量按钮,表示 派单方量的修改已经确定
|
|
|
|
|
|
self.confirm_btn = QPushButton("确定", parent=self)
|
|
|
|
|
|
self.confirm_btn.setStyleSheet(
|
|
|
|
|
|
"""
|
|
|
|
|
|
QPushButton {
|
|
|
|
|
|
background-color: #001c82;
|
|
|
|
|
|
color: #9fbfd4;
|
|
|
|
|
|
border: 1px solid #017cbc;
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
font-weight: Bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
QPushButton:hover {
|
|
|
|
|
|
color: #2dcedb;
|
|
|
|
|
|
}
|
|
|
|
|
|
"""
|
|
|
|
|
|
)
|
|
|
|
|
|
self.confirm_btn.move(860, 442)
|
|
|
|
|
|
self.confirm_btn.hide() # 初始隐藏
|
|
|
|
|
|
self.confirm_btn.setFixedSize(42, 32)
|
|
|
|
|
|
self.confirm_btn.clicked.connect(self.onConfirmModifyVolume)
|
|
|
|
|
|
|
|
|
|
|
|
# 取消修改方量按钮,表示 派单方量的修改已经取消
|
|
|
|
|
|
self.cancel_btn = QPushButton("取消", parent=self)
|
|
|
|
|
|
self.cancel_btn.setStyleSheet(
|
|
|
|
|
|
"""
|
|
|
|
|
|
QPushButton {
|
|
|
|
|
|
background-color: #001c82;
|
|
|
|
|
|
color: #9fbfd4;
|
|
|
|
|
|
border: 1px solid #017cbc;
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
font-weight: Bold;
|
|
|
|
|
|
}
|
|
|
|
|
|
QPushButton:hover {
|
|
|
|
|
|
color: #2dcedb;
|
|
|
|
|
|
}
|
|
|
|
|
|
"""
|
|
|
|
|
|
)
|
|
|
|
|
|
self.cancel_btn.hide()
|
|
|
|
|
|
self.cancel_btn.setFixedSize(42, 32)
|
|
|
|
|
|
self.cancel_btn.move(907, 442)
|
|
|
|
|
|
self.cancel_btn.clicked.connect(self.onCancelModifyVolume)
|
|
|
|
|
|
|
|
|
|
|
|
def _load_background(self):
|
|
|
|
|
|
self.bg_pixmap = QPixmap(ImagePaths.DESPATCH_DETAILS_POPUP_BG)
|
|
|
|
|
|
if self.bg_pixmap.isNull():
|
|
|
|
|
|
print("错误:派单任务背景.png 加载失败,请检查路径!")
|
|
|
|
|
|
self.setFixedSize(800, 600)
|
|
|
|
|
|
else:
|
|
|
|
|
|
self.setFixedSize(self.bg_pixmap.size())
|
|
|
|
|
|
|
|
|
|
|
|
def _add_top_area(self, parent_layout):
|
|
|
|
|
|
top_layout = QHBoxLayout()
|
|
|
|
|
|
top_layout.setContentsMargins(0, 0, 0, 36)
|
|
|
|
|
|
|
|
|
|
|
|
top_layout.addStretch()
|
|
|
|
|
|
|
|
|
|
|
|
# 标题改为“任务派单”
|
|
|
|
|
|
title_label = QLabel("派单任务")
|
|
|
|
|
|
font = QFont()
|
|
|
|
|
|
font.setPixelSize(24)
|
|
|
|
|
|
font.setLetterSpacing(QFont.AbsoluteSpacing, 2)
|
|
|
|
|
|
font.setBold(True)
|
|
|
|
|
|
title_label.setFont(font)
|
|
|
|
|
|
title_label.setStyleSheet("color: #13fffc; font-weight: Bold;")
|
|
|
|
|
|
title_label.setAlignment(Qt.AlignCenter)
|
|
|
|
|
|
top_layout.addWidget(title_label)
|
|
|
|
|
|
|
|
|
|
|
|
# 关闭按钮(保持原逻辑)
|
|
|
|
|
|
self._create_close_button(top_layout)
|
|
|
|
|
|
|
|
|
|
|
|
parent_layout.addLayout(top_layout)
|
|
|
|
|
|
|
|
|
|
|
|
def _create_close_button(self, parent_layout):
|
|
|
|
|
|
self.close_btn = QPushButton()
|
|
|
|
|
|
self.close_btn.setFixedSize(36, 36)
|
|
|
|
|
|
|
|
|
|
|
|
close_icon = QPixmap(ImagePaths.DESPATCH_DETAILS_CLOSE_ICON)
|
|
|
|
|
|
if not close_icon.isNull():
|
|
|
|
|
|
self.close_btn.setIcon(QIcon(close_icon))
|
|
|
|
|
|
|
|
|
|
|
|
self.close_btn.setStyleSheet(
|
|
|
|
|
|
"""
|
|
|
|
|
|
QPushButton {
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
padding: 0px;
|
|
|
|
|
|
}
|
|
|
|
|
|
QPushButton:hover {
|
|
|
|
|
|
background-color: red;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
}
|
|
|
|
|
|
"""
|
|
|
|
|
|
)
|
2026-02-28 11:45:25 +08:00
|
|
|
|
self.close_btn.clicked.connect(self._on_close_button_clicked)
|
2025-11-08 18:25:16 +08:00
|
|
|
|
|
|
|
|
|
|
parent_layout.addStretch()
|
|
|
|
|
|
parent_layout.addWidget(self.close_btn)
|
|
|
|
|
|
|
2026-02-28 11:45:25 +08:00
|
|
|
|
def _on_close_button_clicked(self):
|
|
|
|
|
|
"""关闭按钮点击后的处理逻辑"""
|
|
|
|
|
|
# 1. 执行取消修改方量的逻辑
|
|
|
|
|
|
self.onCancelModifyVolume()
|
|
|
|
|
|
# 2. 执行关闭窗口的逻辑
|
|
|
|
|
|
self.close()
|
|
|
|
|
|
|
2025-11-08 18:25:16 +08:00
|
|
|
|
def _add_segment_id_area(self, parent_layout):
|
|
|
|
|
|
id_layout = QHBoxLayout()
|
|
|
|
|
|
|
|
|
|
|
|
id_label = QLabel("对应管片ID") # 标签文字修改
|
|
|
|
|
|
id_label.setFixedSize(318, 32)
|
|
|
|
|
|
id_font = QFont()
|
|
|
|
|
|
id_font.setPixelSize(18)
|
|
|
|
|
|
id_font.setLetterSpacing(QFont.AbsoluteSpacing, 2)
|
|
|
|
|
|
id_font.setBold(True)
|
|
|
|
|
|
id_label.setFont(id_font)
|
|
|
|
|
|
id_label.setStyleSheet(
|
|
|
|
|
|
f"""
|
|
|
|
|
|
background-image: url({ImagePaths.DESPATCH_DETAILS_TITLE_BG});
|
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
|
background-position: center;
|
|
|
|
|
|
color: #13ffff;
|
|
|
|
|
|
"""
|
|
|
|
|
|
)
|
|
|
|
|
|
id_label.setContentsMargins(16, 0, 0, 0)
|
|
|
|
|
|
id_label.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
|
|
|
|
|
|
|
|
|
|
|
self.id_value_label = QLabel("222232454352452") # 初始管片ID值
|
|
|
|
|
|
value_font = QFont()
|
|
|
|
|
|
value_font.setPixelSize(18)
|
|
|
|
|
|
value_font.setBold(True)
|
|
|
|
|
|
value_font.setLetterSpacing(QFont.AbsoluteSpacing, 2)
|
|
|
|
|
|
self.id_value_label.setFont(value_font)
|
|
|
|
|
|
self.id_value_label.setStyleSheet("color: #13ffff;")
|
|
|
|
|
|
self.id_value_label.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
|
|
|
|
|
|
|
|
|
|
|
|
id_layout.addWidget(id_label)
|
|
|
|
|
|
id_layout.addStretch()
|
|
|
|
|
|
id_layout.addWidget(self.id_value_label)
|
|
|
|
|
|
id_layout.setContentsMargins(0, 0, 0, 16)
|
|
|
|
|
|
parent_layout.addLayout(id_layout)
|
|
|
|
|
|
|
|
|
|
|
|
def _add_grid_info_area(self, parent_layout):
|
|
|
|
|
|
grid_layout = QGridLayout()
|
|
|
|
|
|
grid_layout.setSpacing(12)
|
|
|
|
|
|
|
|
|
|
|
|
# 初始化信息条目(7行)
|
|
|
|
|
|
info_items = [
|
|
|
|
|
|
("创建时间", "2025年10月10日 10:10:10"),
|
|
|
|
|
|
("派单时间", "2025年10月10日 10:10:10"),
|
|
|
|
|
|
("任务编号", "20251010-10"),
|
|
|
|
|
|
("配比编号", "20251010-10"),
|
|
|
|
|
|
("派单方量", "2.0"),
|
|
|
|
|
|
("派单状态", "未下发"),
|
|
|
|
|
|
("派单类型", "自动派单"),
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
self.rows.clear()
|
|
|
|
|
|
for row, (label_text, value_text) in enumerate(info_items):
|
|
|
|
|
|
cell_widget = self._create_info_cell(label_text, value_text)
|
|
|
|
|
|
self.rows.append(cell_widget)
|
|
|
|
|
|
grid_layout.addWidget(cell_widget, row, 0)
|
|
|
|
|
|
|
|
|
|
|
|
parent_layout.addLayout(grid_layout)
|
|
|
|
|
|
|
|
|
|
|
|
def _create_info_cell(self, label_text, value_text):
|
|
|
|
|
|
cell_widget = QWidget()
|
|
|
|
|
|
cell_bg = QPixmap(ImagePaths.DESPATCH_DETAILS_INFO_BAR_NORMAL) # 正常背景图
|
|
|
|
|
|
cell_widget.setObjectName("infoCell")
|
|
|
|
|
|
if not cell_bg.isNull():
|
|
|
|
|
|
cell_widget.setFixedSize(cell_bg.size())
|
|
|
|
|
|
cell_widget.setStyleSheet(
|
|
|
|
|
|
f"""
|
|
|
|
|
|
QWidget {{
|
|
|
|
|
|
background-image: url({ImagePaths.DESPATCH_DETAILS_INFO_BAR_NORMAL});
|
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
|
background-position: Center;
|
|
|
|
|
|
}}
|
|
|
|
|
|
QWidget:hover {{
|
|
|
|
|
|
background-image: url({ImagePaths.DESPATCH_DETAILS_INFO_BAR_HOVER});
|
|
|
|
|
|
}}
|
|
|
|
|
|
QWidget QLabel#valueLabel {{
|
|
|
|
|
|
color: #9fbfd4;
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
}}
|
|
|
|
|
|
"""
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
cell_layout = QHBoxLayout(cell_widget)
|
|
|
|
|
|
cell_layout.setContentsMargins(0, 0, 0, 0)
|
|
|
|
|
|
|
|
|
|
|
|
# 左侧标签
|
|
|
|
|
|
label = QLabel(label_text)
|
|
|
|
|
|
label.setFixedSize(136, 60)
|
|
|
|
|
|
label_font = QFont()
|
|
|
|
|
|
label_font.setPixelSize(16)
|
|
|
|
|
|
label_font.setLetterSpacing(QFont.AbsoluteSpacing, 2)
|
|
|
|
|
|
label.setFont(label_font)
|
|
|
|
|
|
label.setStyleSheet("background: none;color: #fffffd; font-weight:Bold;")
|
|
|
|
|
|
label.setAlignment(Qt.AlignCenter)
|
|
|
|
|
|
cell_widget.label = label
|
|
|
|
|
|
|
|
|
|
|
|
# 右侧值标签(设置objectName以便样式选择)
|
|
|
|
|
|
value = QLabel(value_text)
|
|
|
|
|
|
value.setObjectName("valueLabel")
|
|
|
|
|
|
value_font = QFont()
|
|
|
|
|
|
value_font.setPixelSize(20)
|
|
|
|
|
|
value.setFont(value_font)
|
|
|
|
|
|
value.setAlignment(Qt.AlignCenter)
|
|
|
|
|
|
cell_widget.value = value
|
|
|
|
|
|
|
|
|
|
|
|
cell_layout.addWidget(label) # 左侧的标题标签
|
|
|
|
|
|
cell_layout.addSpacing(60)
|
|
|
|
|
|
cell_layout.addWidget(value) # 右侧的值标签
|
|
|
|
|
|
|
|
|
|
|
|
cell_widget.installEventFilter(self)
|
|
|
|
|
|
return cell_widget
|
|
|
|
|
|
|
|
|
|
|
|
# 实现事件过滤器,动态修改右侧值颜色
|
|
|
|
|
|
def eventFilter(self, obj, event):
|
|
|
|
|
|
# 只处理父控件(infoCell)的事件
|
|
|
|
|
|
if obj.objectName() == "infoCell":
|
|
|
|
|
|
# 鼠标进入父控件 → 改#13f0f3
|
|
|
|
|
|
if event.type() == QEvent.Enter:
|
|
|
|
|
|
if hasattr(obj, "value"): # 确保存在value控件
|
|
|
|
|
|
obj.value.setStyleSheet("background: none; color: #13f0f3;")
|
|
|
|
|
|
# 鼠标离开父控件 → 恢复默认色
|
|
|
|
|
|
elif event.type() == QEvent.Leave:
|
|
|
|
|
|
if hasattr(obj, "value"):
|
|
|
|
|
|
obj.value.setStyleSheet("background: none; color: #9fbfd4;")
|
|
|
|
|
|
return super().eventFilter(obj, event)
|
|
|
|
|
|
|
|
|
|
|
|
def onModifyVolume(self):
|
|
|
|
|
|
"""修改派单方量的逻辑"""
|
|
|
|
|
|
volume_label = self.rows[4].value
|
|
|
|
|
|
current_value = float(volume_label.text())
|
|
|
|
|
|
|
|
|
|
|
|
# 1、调整派单方量,创建派单方量调整控件
|
|
|
|
|
|
if not self.volume_value_adjuster:
|
|
|
|
|
|
self.volume_value_adjuster = ValueAdjuster(self)
|
|
|
|
|
|
self.volume_value_adjuster.move(551, 442) # 移动到当前显示派单方量的标签处
|
|
|
|
|
|
|
|
|
|
|
|
# 2、更新派单方量调整控件的值, 并显示
|
|
|
|
|
|
self.volume_value_adjuster.set_value(current_value)
|
|
|
|
|
|
self.volume_value_adjuster.show()
|
|
|
|
|
|
|
|
|
|
|
|
# 3、显示确定按钮、显示取消按钮、隐藏修改方量按钮
|
|
|
|
|
|
self.confirm_btn.show()
|
|
|
|
|
|
self.cancel_btn.show()
|
|
|
|
|
|
self.modify_btn.hide()
|
|
|
|
|
|
|
|
|
|
|
|
def onConfirmModifyVolume(self):
|
|
|
|
|
|
"""确定 修改派单方量"""
|
|
|
|
|
|
# 显示相关的:
|
|
|
|
|
|
# 1、隐藏确认按钮、隐藏取消按钮、显示修改方量按钮
|
|
|
|
|
|
self.confirm_btn.hide()
|
|
|
|
|
|
self.cancel_btn.hide()
|
|
|
|
|
|
self.modify_btn.show()
|
|
|
|
|
|
|
|
|
|
|
|
# 2、修改 派单方量标签的值
|
2026-03-06 18:33:58 +08:00
|
|
|
|
# volume_label = self.rows[4].value
|
2025-11-08 18:25:16 +08:00
|
|
|
|
# modifyed_value 为float类型, 一位小数
|
|
|
|
|
|
modifyed_value = self.volume_value_adjuster.get_value()
|
2026-03-06 18:33:58 +08:00
|
|
|
|
# volume_label.setText(str(modifyed_value))
|
2025-11-08 18:25:16 +08:00
|
|
|
|
|
|
|
|
|
|
# 3、发送派单方量确定修改的信号 (发送派单任务名 + 确认修改之后的派单方量)
|
|
|
|
|
|
self.confirm_modify_volume.emit(self.dispatch_task_name, modifyed_value)
|
|
|
|
|
|
|
|
|
|
|
|
# 4、关闭派单方量调整控件
|
|
|
|
|
|
self.volume_value_adjuster.close()
|
|
|
|
|
|
|
|
|
|
|
|
def onCancelModifyVolume(self):
|
|
|
|
|
|
# 显示相关的:
|
|
|
|
|
|
# 1、隐藏确认按钮、隐藏取消按钮、显示修改方量按钮
|
|
|
|
|
|
self.confirm_btn.hide()
|
|
|
|
|
|
self.cancel_btn.hide()
|
|
|
|
|
|
self.modify_btn.show()
|
|
|
|
|
|
|
|
|
|
|
|
# 2、关闭派单方量调整控件
|
2026-02-28 11:45:25 +08:00
|
|
|
|
if hasattr(self, "volume_value_adjuster") and self.volume_value_adjuster:
|
|
|
|
|
|
self.volume_value_adjuster.close()
|
2025-11-08 18:25:16 +08:00
|
|
|
|
|
|
|
|
|
|
def paintEvent(self, event):
|
|
|
|
|
|
if not self.bg_pixmap.isNull():
|
|
|
|
|
|
painter = QPainter(self)
|
|
|
|
|
|
painter.drawPixmap(self.rect(), self.bg_pixmap)
|
|
|
|
|
|
super().paintEvent(event)
|
|
|
|
|
|
|
|
|
|
|
|
# ------------------- 对外修改接口 -------------------
|
|
|
|
|
|
# row 对应行号(0-6),从0开始
|
|
|
|
|
|
# --------------------------------------------------
|
|
|
|
|
|
def set_segment_id(self, new_id):
|
|
|
|
|
|
"""修改上方的 对应的管片ID的值"""
|
|
|
|
|
|
if self.id_value_label:
|
|
|
|
|
|
self.id_value_label.setText(str(new_id))
|
|
|
|
|
|
|
|
|
|
|
|
def set_row_label(self, row, new_label_text: str):
|
|
|
|
|
|
"""修改左侧的显示的标签的文本,如: 创建时间、派单时间等"""
|
|
|
|
|
|
if 0 <= row < len(self.rows):
|
2026-02-28 11:45:25 +08:00
|
|
|
|
self.rows[row].label.setText(str(new_label_text) if new_label_text is not None else "")
|
2025-11-08 18:25:16 +08:00
|
|
|
|
|
|
|
|
|
|
def set_row_value(self, row, new_value_text: str):
|
|
|
|
|
|
"""修改右侧的显示的值, 如: 2025年9月9日 9:9:9"""
|
|
|
|
|
|
if 0 <= row < len(self.rows):
|
2026-02-28 11:45:25 +08:00
|
|
|
|
self.rows[row].value.setText(str(new_value_text) if new_value_text is not None else "")
|
2025-11-08 18:25:16 +08:00
|
|
|
|
|
2026-03-06 18:33:58 +08:00
|
|
|
|
def set_dispatch_task_name(self, task_name:str):
|
|
|
|
|
|
"""设置/刷新 派单任务名"""
|
|
|
|
|
|
self.dispatch_task_name = task_name
|
|
|
|
|
|
|
|
|
|
|
|
def set_modify_volume_status(self, status:bool):
|
|
|
|
|
|
"""设置是否能够在派单详情界面修改方量,
|
|
|
|
|
|
status为False即不能修改方量, 为True表示能够修改方量
|
|
|
|
|
|
"""
|
|
|
|
|
|
self.modify_btn.setVisible(status)
|
|
|
|
|
|
|
2025-11-08 18:25:16 +08:00
|
|
|
|
|
|
|
|
|
|
# 测试代码
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
|
app = QApplication(sys.argv)
|
|
|
|
|
|
dialog = DispatchDetailsDialog()
|
|
|
|
|
|
|
|
|
|
|
|
# 测试修改接口
|
|
|
|
|
|
dialog.set_segment_id("999999999999999")
|
|
|
|
|
|
dialog.set_row_label(0, "新创建时间")
|
|
|
|
|
|
dialog.set_row_value(0, "2025年09月09日 09:09:09")
|
|
|
|
|
|
dialog.set_row_value(4, "3.0") # 初始派单方量修改
|
|
|
|
|
|
|
|
|
|
|
|
dialog.show()
|
|
|
|
|
|
sys.exit(app.exec())
|