|
@@ -8,6 +8,7 @@ PackDetailForm::PackDetailForm(QWidget *parent) :
|
|
|
ui->setupUi(this);
|
|
ui->setupUi(this);
|
|
|
// connect(&packConfig,&RemotePackConfig::configUpdate,this,&PackDetailForm::upconfig);
|
|
// connect(&packConfig,&RemotePackConfig::configUpdate,this,&PackDetailForm::upconfig);
|
|
|
productList();
|
|
productList();
|
|
|
|
|
+ detailsList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
PackDetailForm::~PackDetailForm()
|
|
PackDetailForm::~PackDetailForm()
|
|
@@ -15,10 +16,14 @@ PackDetailForm::~PackDetailForm()
|
|
|
delete ui;
|
|
delete ui;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void PackDetailForm::on_pushBack_clicked()
|
|
|
|
|
+{
|
|
|
|
|
+ emit back();
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
void PackDetailForm::on_pushButton_clicked()
|
|
void PackDetailForm::on_pushButton_clicked()
|
|
|
{
|
|
{
|
|
|
- changeTable(database.GetValues(dataname,productSqlList));
|
|
|
|
|
|
|
+ changeTable(database.GetValues("product",productSqlList));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//往QTableWidget里添加数据
|
|
//往QTableWidget里添加数据
|
|
@@ -27,7 +32,9 @@ void PackDetailForm::changeTable(QList<QMap<QString,QString>> productList)
|
|
|
// qDebug()<<productList.at(0).value("goods_id");
|
|
// qDebug()<<productList.at(0).value("goods_id");
|
|
|
if(productList.isEmpty()){
|
|
if(productList.isEmpty()){
|
|
|
QMessageBox::information(this,tr("提示"),tr("数据为空"));
|
|
QMessageBox::information(this,tr("提示"),tr("数据为空"));
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+ product = productList;
|
|
|
ui->tableWidget->setColumnCount(11);
|
|
ui->tableWidget->setColumnCount(11);
|
|
|
for(int i = 0;i<productList.size();i++){
|
|
for(int i = 0;i<productList.size();i++){
|
|
|
ui->tableWidget->insertRow(i);
|
|
ui->tableWidget->insertRow(i);
|
|
@@ -39,19 +46,42 @@ void PackDetailForm::changeTable(QList<QMap<QString,QString>> productList)
|
|
|
ui->tableWidget->setItem(i,5,new QTableWidgetItem(productList.at(i).value("quantity")));
|
|
ui->tableWidget->setItem(i,5,new QTableWidgetItem(productList.at(i).value("quantity")));
|
|
|
ui->tableWidget->setItem(i,6,new QTableWidgetItem(productList.at(i).value("packing_time")));
|
|
ui->tableWidget->setItem(i,6,new QTableWidgetItem(productList.at(i).value("packing_time")));
|
|
|
auto tongbu_btn = new QPushButton("同步");
|
|
auto tongbu_btn = new QPushButton("同步");
|
|
|
- connect(tongbu_btn, SIGNAL(clicked(bool)), this, SLOT(tongbu_clicked()));
|
|
|
|
|
|
|
+ connect(tongbu_btn,&QPushButton::clicked,[i,this](){this->tongbu_clicked(i);});
|
|
|
|
|
+// connect(tongbu_btn, SIGNAL(clicked(bool)), this, SLOT(tongbu_clicked()));
|
|
|
auto code_single_btn = new QPushButton("打印码单");
|
|
auto code_single_btn = new QPushButton("打印码单");
|
|
|
|
|
+ connect(code_single_btn,SIGNAL(clicked(bool)),this,SLOT(code_single_clicked()));
|
|
|
auto case_nember_btn = new QPushButton("打印箱单");
|
|
auto case_nember_btn = new QPushButton("打印箱单");
|
|
|
|
|
+ connect(case_nember_btn,SIGNAL(clicked(bool)),this,SLOT(case_number_clicked()));
|
|
|
|
|
+ auto details = new QTreeWidget(this);
|
|
|
ui->tableWidget->setCellWidget(i,7,tongbu_btn);
|
|
ui->tableWidget->setCellWidget(i,7,tongbu_btn);
|
|
|
ui->tableWidget->setCellWidget(i,8,code_single_btn);
|
|
ui->tableWidget->setCellWidget(i,8,code_single_btn);
|
|
|
ui->tableWidget->setCellWidget(i,9,case_nember_btn);
|
|
ui->tableWidget->setCellWidget(i,9,case_nember_btn);
|
|
|
|
|
+ ui->tableWidget->setCellWidget(i,10,details);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//同步
|
|
//同步
|
|
|
-void PackDetailForm::tongbu_clicked()
|
|
|
|
|
|
|
+void PackDetailForm::tongbu_clicked(int row)
|
|
|
|
|
+{
|
|
|
|
|
+// qDebug()<<"行数:" << row;
|
|
|
|
|
+ if(ui->tableWidget->item(row,0)->text()!="未同步"){
|
|
|
|
|
+ QMessageBox::information(this,tr("垃圾"),tr("打我啊"));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ QString condition = " where code_single="+product.at(row).value("code_single");
|
|
|
|
|
+ details = database.GetValues("details",detailSqlList,condition);
|
|
|
|
|
+ autoPack.doSend(autoPack.toJsonMap(product.at(row),details));
|
|
|
|
|
+ ui->tableWidget->setItem(row,0,new QTableWidgetItem("请刷新"));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void PackDetailForm::code_single_clicked()
|
|
|
{
|
|
{
|
|
|
- qDebug()<<"";
|
|
|
|
|
|
|
+ qDebug()<<"打印码单";
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void PackDetailForm::case_number_clicked()
|
|
|
|
|
+{
|
|
|
|
|
+ qDebug()<<"打印箱单";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void PackDetailForm::productList()
|
|
void PackDetailForm::productList()
|
|
@@ -72,3 +102,16 @@ void PackDetailForm::productList()
|
|
|
productSqlList.append("operator_id");
|
|
productSqlList.append("operator_id");
|
|
|
productSqlList.append("remark");
|
|
productSqlList.append("remark");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+void PackDetailForm::detailsList()
|
|
|
|
|
+{
|
|
|
|
|
+ detailSqlList.append("code_single");
|
|
|
|
|
+ detailSqlList.append("case_number");
|
|
|
|
|
+ detailSqlList.append("box_weight");
|
|
|
|
|
+ detailSqlList.append("tube_number");
|
|
|
|
|
+ detailSqlList.append("bucket_weight");
|
|
|
|
|
+ detailSqlList.append("gross_weight");
|
|
|
|
|
+ detailSqlList.append("net_weight");
|
|
|
|
|
+ detailSqlList.append("sort");
|
|
|
|
|
+ detailSqlList.append("remark");
|
|
|
|
|
+}
|