packinfo.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. void delBoxInfoAt(int num);
  52. QSharedPointer<BoxInfo> boxInfoAt(int num);
  53. int boxInfoSize();
  54. private:
  55. QString buildPackId();
  56. QString buildBoxId();
  57. private:
  58. QList<QSharedPointer<BoxInfo>> _boxes;
  59. ProjectInfo _info;
  60. QString code_single;
  61. int goods_id;
  62. static int lastMin;
  63. static int lastNum;
  64. };
  65. #endif // PACKINFO_H