|
|
@@ -13,7 +13,8 @@ FixedWeightPackForm::FixedWeightPackForm(QWidget *parent) :
|
|
|
connect(timer,&QTimer::timeout,this,&FixedWeightPackForm::calcData);
|
|
|
timer->start(500);
|
|
|
connect(glo,&GlobalInfo::dbConfigUpdated,this,&FixedWeightPackForm::upconfig);
|
|
|
-// connect(&packConfig,&RemotePackConfig::dengJIConfigUp,this,&FixedWeightPackForm::upDengjiInfo);
|
|
|
+ connect(glo,&GlobalInfo::dengJiUped,this,&FixedWeightPackForm::upDengjiInfo);
|
|
|
+ connect(glo,&GlobalInfo::doInited,this,&FixedWeightPackForm::changeSpecs);
|
|
|
auto dt = CacheFile::readFile("dingzhongInfo.cache");
|
|
|
auto list = QString::fromUtf8(dt).split("[,]");
|
|
|
if(list.size() == 2){
|
|
|
@@ -22,6 +23,7 @@ FixedWeightPackForm::FixedWeightPackForm(QWidget *parent) :
|
|
|
}
|
|
|
ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
ui->pushStart->hide();
|
|
|
+ packServer = new PackInfoSeed2Server(Manger);
|
|
|
}
|
|
|
|
|
|
FixedWeightPackForm::~FixedWeightPackForm()
|
|
|
@@ -65,8 +67,11 @@ void FixedWeightPackForm::on_addPackList_clicked()
|
|
|
packinfo->customer = ui->taitou->text();
|
|
|
packinfo->telephone = ui->taiPhone->text();
|
|
|
}
|
|
|
-
|
|
|
+// qDebug()<<packinfo->boxes().at(0)->tube_number;
|
|
|
packServer->send(packinfo);
|
|
|
+ GlobalInfo::this_()->packInfoManger()->savePackInfo(packinfo);
|
|
|
+ GlobalInfo::this_()->packInfoManger()->setPackInfoSync(packinfo->codeSingle(),packinfo->time(),true);
|
|
|
+ GlobalInfo::this_()->printerPack(packinfo);
|
|
|
|
|
|
// //把数据添加到数据库里
|
|
|
// aputils.insertProductSQL(packinfo);
|
|
|
@@ -90,7 +95,7 @@ void FixedWeightPackForm::on_pushStart_clicked()
|
|
|
ui->widget_2->setEnabled(false);
|
|
|
ui->pushPiLiang->setDisabled(false);
|
|
|
} else {
|
|
|
- init();
|
|
|
+// init();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -124,6 +129,7 @@ void FixedWeightPackForm::on_addBoxList_clicked()
|
|
|
|
|
|
// 把box数据添加到packinfo的boxes数据表里;
|
|
|
packinfo->addBoxInfoList(box);
|
|
|
+ GlobalInfo::this_()->printerBox(box);
|
|
|
|
|
|
//添加数据库
|
|
|
// aputils.insertDetailsSQL(box,packinfo->codeSingle());
|
|
|
@@ -151,6 +157,7 @@ void FixedWeightPackForm::setTableWidget()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//往tablewidget里添加数据
|
|
|
void FixedWeightPackForm::addTableWidget(QSharedPointer<BoxInfo> box)
|
|
|
{
|
|
|
ui->tableWidget->setItem(ui->tableWidget->rowCount()-1,0,new QTableWidgetItem(QString::number(ui->tableWidget->rowCount())));
|
|
|
@@ -186,11 +193,17 @@ void FixedWeightPackForm::init()
|
|
|
// ui->pushPiLiang->setDisabled(true);
|
|
|
// ui->widget_2->setEnabled(true);
|
|
|
|
|
|
+ ui->pizhong->setCurrentText(QString(_info->box_weight));
|
|
|
+ ui->guanse->setCurrentText(_info->bucket_color);
|
|
|
+ ui->zhixiang->setCurrentText(_info->carton_type);
|
|
|
+ ui->tongzhong->setCurrentText(_info->bucket_weight);
|
|
|
+
|
|
|
ui->comboBox->clear();
|
|
|
for(int i = 1;i<=20;i++){
|
|
|
ui->comboBox->addItem(QString::number(i));
|
|
|
}
|
|
|
ui->comboBox->setCurrentText("20");
|
|
|
+ setTableWidget();
|
|
|
// specs.getInfo(0,20);
|
|
|
// setTableWidget();//检查packinfo isNull
|
|
|
}
|
|
|
@@ -270,23 +283,28 @@ void FixedWeightPackForm::changeSpecs()
|
|
|
{
|
|
|
ui->tableWidget_2->clearContents();
|
|
|
ui->tableWidget_2->setRowCount(0);
|
|
|
-// for(int i = 0; i < specs.currtInfo.size(); ++i){
|
|
|
-// auto & v = specs.currtInfo.at(i);
|
|
|
-// ui->tableWidget_2->insertRow(i);
|
|
|
-// auto xuanze_btn = new QRadioButton();
|
|
|
-// connect(xuanze_btn,&QPushButton::clicked,[i,this](){this->xuanZe_clicked(i);});
|
|
|
-// ui->tableWidget_2->setCellWidget(i,0,xuanze_btn);
|
|
|
-// ui->tableWidget_2->setItem(i,1,new QTableWidgetItem(v.specs));
|
|
|
-// ui->tableWidget_2->setItem(i,2,new QTableWidgetItem(v.category));
|
|
|
-// ui->tableWidget_2->setItem(i,3,new QTableWidgetItem(v.batch_no));
|
|
|
-// ui->tableWidget_2->setItem(i,4,new QTableWidgetItem(v.color));
|
|
|
-// }
|
|
|
+ prolist = GlobalInfo::this_()->project().values();
|
|
|
+ for(int i = 0; i < prolist.size(); ++i){
|
|
|
+ auto & v = prolist.at(i);
|
|
|
+ ui->tableWidget_2->insertRow(i);
|
|
|
+ auto xuanze_btn = new QRadioButton();
|
|
|
+ QString batchno = prolist.at(i)->batch_no;
|
|
|
+ connect(xuanze_btn,&QPushButton::clicked,[batchno,this](){this->xuanZe_clicked(batchno);});
|
|
|
+ ui->tableWidget_2->setCellWidget(i,0,xuanze_btn);
|
|
|
+ ui->tableWidget_2->setItem(i,1,new QTableWidgetItem(v->specs));
|
|
|
+ ui->tableWidget_2->setItem(i,2,new QTableWidgetItem(v->category));
|
|
|
+ ui->tableWidget_2->setItem(i,3,new QTableWidgetItem(v->batch_no));
|
|
|
+ ui->tableWidget_2->setItem(i,4,new QTableWidgetItem(v->color));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-void FixedWeightPackForm::xuanZe_clicked(int row)
|
|
|
+void FixedWeightPackForm::xuanZe_clicked(QString batchno)
|
|
|
{
|
|
|
// setProInfo(specs.currtInfo.at(row));
|
|
|
- packConfig.refConfig();
|
|
|
+// packConfig.refConfig();
|
|
|
+// qDebug()<<batchno;
|
|
|
+ setProInfo(GlobalInfo::this_()->project().value(batchno));
|
|
|
+ init();
|
|
|
}
|
|
|
|
|
|
void FixedWeightPackForm::del_clicked(int row)
|
|
|
@@ -303,5 +321,5 @@ void FixedWeightPackForm::del_clicked(int row)
|
|
|
|
|
|
void FixedWeightPackForm::Makeup_clicked(int row)
|
|
|
{
|
|
|
- djmb.printBoxInfo(packinfo->boxInfoAt(row)->caseNumber(),packinfo->boxInfoAt(row));
|
|
|
+
|
|
|
}
|