packinfo.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef PACKINFO_H
  2. #define PACKINFO_H
  3. #include <QString>
  4. #include <QSharedPointer>
  5. #include "configinfo.h"
  6. class PackInfo;
  7. struct BoxInfo
  8. {
  9. inline QSharedPointer<PackInfo> parentPack() {
  10. return parent.toStrongRef();
  11. }
  12. inline QString caseNumber() {return case_number;}
  13. int box_weight = 0;// 是 int 皮重 单位:克
  14. int tube_number = 0;// 是 int 筒数
  15. int bucket_weight = 0;// 是 int 总筒重 单位:克
  16. int gross_weight = 0;// 是 int 毛重 单位:克
  17. int net_weight = 0;// 是 int 净重 单位:克
  18. QString Level;//等级;
  19. QString twist_type;// string 捻向
  20. QString bucket_color;// string 管色
  21. QString sort;// 是 string 排序
  22. QString remark;// 否 string 备注
  23. private:
  24. BoxInfo(QSharedPointer<PackInfo> pack,QString code);
  25. QString case_number;// 是 string 箱号
  26. QWeakPointer<PackInfo> parent;
  27. friend class PackInfo;
  28. };
  29. class PackInfo : public QEnableSharedFromThis<PackInfo>
  30. {
  31. public:
  32. PackInfo(const ProjectInfo & info);
  33. int quantity = 0;// 是 int 箱数
  34. int level_id = 0;// 是 int 等级ID
  35. QString level;
  36. QString machine_no;// 是 string 机台
  37. QString packing_time;// 是 string 打包时间
  38. QString packing_type;// 是 string 打包类型
  39. QString carton_type;// 是 string 纸箱
  40. int operator_id = 0;// 是 int 操作员ID
  41. QString remark;// 否 string
  42. inline const QList<QSharedPointer<BoxInfo>> & boxes() const {return _boxes;} //array 成品详情
  43. inline const ProjectInfo & info() const {return _info;}
  44. inline QString codeSingle() const {return code_single;} //string 码单
  45. int tube_number(); //int 筒数
  46. int gross_weight(); // 毛重 单位:克
  47. int net_weight(); //单位:克
  48. int goodsID() {return goods_id;}
  49. QSharedPointer<BoxInfo> addBoxInfo();
  50. void addBoxInfoList(QSharedPointer<BoxInfo> boxes);
  51. private:
  52. QString buildPackId();
  53. QString buildBoxId();
  54. private:
  55. QList<QSharedPointer<BoxInfo>> _boxes;
  56. ProjectInfo _info;
  57. QString code_single;
  58. int goods_id;
  59. static int lastMin;
  60. static int lastNum;
  61. };
  62. #endif // PACKINFO_H