|
@@ -97,6 +97,10 @@ QJsonObject PackInfo::toObject()
|
|
|
{
|
|
{
|
|
|
QJsonObject ret;
|
|
QJsonObject ret;
|
|
|
ret.insert("time",QString::number(this->time()));
|
|
ret.insert("time",QString::number(this->time()));
|
|
|
|
|
+ ret.insert("tube_number",QString::number(this->tube_number()));
|
|
|
|
|
+ ret.insert("gross_weight",QString::number(this->gross_weight()));
|
|
|
|
|
+ ret.insert("net_weight",QString::number(this->net_weight()));
|
|
|
|
|
+ ret.insert("goods_id",QString::number(this->goodsID()));
|
|
|
|
|
|
|
|
//todo: 小宋 ? _boxes存那里去了?
|
|
//todo: 小宋 ? _boxes存那里去了?
|
|
|
ret.insert("quantity",quantity);
|
|
ret.insert("quantity",quantity);
|
|
@@ -112,6 +116,12 @@ QJsonObject PackInfo::toObject()
|
|
|
ret.insert("customer",customer);
|
|
ret.insert("customer",customer);
|
|
|
ret.insert("batch_no",_info->batch_no);
|
|
ret.insert("batch_no",_info->batch_no);
|
|
|
|
|
|
|
|
|
|
+ QJsonArray det;
|
|
|
|
|
+ for(int i = 0;i<_boxes.size();i++){
|
|
|
|
|
+ det.append(_boxes.at(i)->toObject());
|
|
|
|
|
+ }
|
|
|
|
|
+ ret.insert("details",det);
|
|
|
|
|
+
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -138,6 +148,14 @@ QSharedPointer<PackInfo> PackInfo::fromObject(QJsonObject &obj)
|
|
|
ret->remark = obj.value("remark").toString();
|
|
ret->remark = obj.value("remark").toString();
|
|
|
ret->telephone = obj.value("telephone").toString();
|
|
ret->telephone = obj.value("telephone").toString();
|
|
|
ret->customer = obj.value("customer").toString();
|
|
ret->customer = obj.value("customer").toString();
|
|
|
|
|
+
|
|
|
|
|
+ QJsonArray det = obj.value("details").toArray();
|
|
|
|
|
+
|
|
|
|
|
+ for(int i = 0;i<det.size();i++){
|
|
|
|
|
+ QJsonObject obj = det.at(i).toObject();
|
|
|
|
|
+ ret->_boxes.append(BoxInfo::fromObject(ret,obj));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|