119 lines
4.0 KiB
C++
119 lines
4.0 KiB
C++
#include "DialogTaskOrder.h"
|
|
#include "ui_DialogTaskOrder.h"
|
|
#include <QMessageBox>
|
|
#include <QJsonDocument>
|
|
#include "LAMPWBDDManager.h"
|
|
|
|
namespace WBFZTASK {
|
|
DialogTaskOrder::DialogTaskOrder(QWidget* parent)
|
|
: QDialog(parent)
|
|
, ui(new Ui::DialogTaskOrder)
|
|
{
|
|
ui->setupUi(this);
|
|
QObject::connect(ui->pushButtonUpdateOrderState, SIGNAL(clicked()), this, SLOT(onpushButtonUpdateOrderState_clicked()));
|
|
QObject::connect(ui->comboBoxStateSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(oncomboBoxStateSelect_currentIndexChanged(int)));
|
|
}
|
|
|
|
DialogTaskOrder::~DialogTaskOrder()
|
|
{}
|
|
|
|
void DialogTaskOrder::SetTaskOrder(WBFZTASK::TaskOrder* task)
|
|
{
|
|
this->task = task;
|
|
this->ui->lineEdit_applicant->setText(task->getApplicant());
|
|
this->ui->lineEdit_company->setText(task->getCompany());
|
|
this->ui->lineEdit_contactinfo->setText(task->getContactInfo());
|
|
this->ui->lineEdit_createtime->setText(task->getCreateTime());
|
|
this->ui->lineEdit_ordercode->setText(task->getOrderCode());
|
|
this->ui->lineEdit_orderid->setText(task->getOrderId());
|
|
this->ui->lineEdit_ordermode->setText(task->getOrderMode());
|
|
this->ui->lineEdit_ordersource->setText(task->getOrderSource());
|
|
this->ui->lineEdit_ordertype->setText(task->getOrderType());
|
|
this->ui->lineEdit_updatetime->setText(task->getUpdateTime());
|
|
this->ui->lineEdit_userid->setText(task->getUserId());
|
|
this->ui->plainTextEdit_demand->setPlainText(task->getDemand());
|
|
this->ui->plainTextEdit_intention->setPlainText(task->getIntention());
|
|
this->ui->plainTextEdit_orderdetails->setPlainText(task->getOrderDetails());
|
|
this->ui->plainTextEdit_orderstoreprocess->setPlainText(task->getOrderStoreProcess());
|
|
|
|
// 状态处理
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
QString orderStatusStr = task->getOrderStatus().trimmed();
|
|
if (orderStatusStr.contains(u8"等待处理")) {
|
|
this->ui->comboBoxStateSelect->setCurrentText(u8"等待处理");
|
|
}
|
|
else if (orderStatusStr.contains(u8"已拒绝")) {
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
this->ui->comboBoxStateSelect->setCurrentText(u8"已拒绝");
|
|
this->ui->lineEdit_Orderstatus->setText(orderStatusStr);
|
|
}
|
|
else if (orderStatusStr.contains(u8"正在处理中")) {
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
this->ui->comboBoxStateSelect->setCurrentText(u8"正在处理中");
|
|
}
|
|
else if (orderStatusStr.contains(u8"已完成")) {
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
this->ui->comboBoxStateSelect->setCurrentText(u8"已完成");
|
|
}
|
|
else {
|
|
this->ui->comboBoxStateSelect->setCurrentText(u8"等待处理");
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
}
|
|
|
|
|
|
//->setText(task->getOrderStatus());
|
|
}
|
|
|
|
void DialogTaskOrder::onpushButtonUpdateOrderState_clicked()
|
|
{
|
|
|
|
|
|
QString orderStatusStr = this->ui->comboBoxStateSelect->currentText();;
|
|
|
|
if (orderStatusStr.contains(u8"等待处理")) {
|
|
|
|
}
|
|
else if (orderStatusStr.contains(u8"已拒绝")) {
|
|
orderStatusStr = QString(u8"%1:%2").arg(u8"已拒绝").arg(this->ui->lineEdit_Orderstatus->text());
|
|
|
|
}
|
|
else if (orderStatusStr.contains(u8"正在处理中")) {
|
|
}
|
|
else if (orderStatusStr.contains(u8"已完成")) {
|
|
}
|
|
else {
|
|
}
|
|
LAMPWBCONNECT::LAMPWBDDManager::updateTaskoderStatus(this->ui->lineEdit_orderid->text(),
|
|
orderStatusStr
|
|
);
|
|
}
|
|
|
|
void DialogTaskOrder::oncomboBoxStateSelect_currentIndexChanged(int)
|
|
{
|
|
QString orderStatusStr = this->ui->comboBoxStateSelect->currentText();;
|
|
if (orderStatusStr.contains(u8"等待处理")) {
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
}
|
|
else if (orderStatusStr.contains(u8"已拒绝")) {
|
|
this->ui->lineEdit_Orderstatus->setEnabled(true);
|
|
this->ui->lineEdit_Orderstatus->setText(orderStatusStr);
|
|
}
|
|
else if (orderStatusStr.contains(u8"正在处理中")) {
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
}
|
|
else if (orderStatusStr.contains(u8"已完成")) {
|
|
this->ui->lineEdit_Orderstatus->setEnabled(false);
|
|
}
|
|
else {
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
void DialogTaskOrder::accept() {
|
|
this->onpushButtonUpdateOrderState_clicked();
|
|
this->close();
|
|
//QMessageBox::information(this, u8"信息", u8"信息更新成功");
|
|
}
|
|
} |