#ifndef PACKINFO_H #define PACKINFO_H #include #include #include "configinfo.h" class PackInfo; struct BoxInfo { inline QSharedPointer parentPack() { return parent.toStrongRef(); } inline QString caseNumber() {return case_number;} int box_weight = 0;// 是 int 皮重 单位:克 int tube_number = 0;// 是 int 筒数 int bucket_weight = 0;// 是 int 总筒重 单位:克 int gross_weight = 0;// 是 int 毛重 单位:克 int net_weight = 0;// 是 int 净重 单位:克 QString sort;// 是 string 排序 QString remark;// 否 string 备注 private: BoxInfo(QSharedPointer pack,QString code); QString case_number;// 是 string 箱号 QWeakPointer parent; friend class PackInfo; }; class PackInfo : public QEnableSharedFromThis { public: PackInfo(const ProjectInfo & info); int quantity = 0;// 是 int 箱数 int level_id = 0;// 是 int 等级ID QString level; int machine_no = 0;// 是 string 机台 int packing_time = 0;// 是 string 打包时间 int packing_type = 0;// 是 string 打包类型 QString carton_type;// 是 string 纸箱 int operator_id = 0;// 是 int 操作员ID QString remark;// 否 string inline const QList> & boxes() const {return _boxes;} //array 成品详情 inline const ProjectInfo & info() const {return _info;} inline QString codeSingle() const {return code_single;} //string 码单 int tube_number(); //int 筒数 int gross_weight(); // 毛重 单位:克 int net_weight(); //单位:克 QSharedPointer addBoxInfo(); private: QString buildPackId(); QString buildBoxId(); private: QList> _boxes; ProjectInfo _info; QString code_single; int goods_id; static int lastMin; static int lastNum; }; #endif // PACKINFO_H