| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #ifndef PACKINFO_H
- #define PACKINFO_H
- #include <QString>
- #include <QSharedPointer>
- #include "configinfo.h"
- class PackInfo;
- struct BoxInfo
- {
- inline QSharedPointer<PackInfo> 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<PackInfo> pack,QString code);
- QString case_number;// 是 string 箱号
- QWeakPointer<PackInfo> parent;
- friend class PackInfo;
- };
- class PackInfo : public QEnableSharedFromThis<PackInfo>
- {
- public:
- PackInfo(const ProjectInfo & info);
- //QString code_single 是 string 码单
- int quantity = 0;// 是 int 箱数
- int level_id = 0;// 是 int 等级ID
- QString level;
- // int tube_number;// 是 int 筒数
- // int gross_weight;// 是 int 毛重 单位:克
- // int net_weight;// 是 int 净重 单位:克
- 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
- // details 是 array 成品详情
- QString remark;// 否 string
- inline const QList<QSharedPointer<BoxInfo>> & boxes() const {return _boxes;}
- inline const ProjectInfo & info() const {return _info;}
- int tube_number();
- int gross_weight();
- int net_weight();
- QSharedPointer<BoxInfo> addBoxInfo();
- private:
- QString buildPackId();
- QString buildBoxId();
- private:
- QList<QSharedPointer<BoxInfo>> _boxes;
- ProjectInfo _info;
- QString code_single;
- int goods_id;
- static int lastMin;
- static int lastNum;
- };
- #endif // PACKINFO_H
|