DlgScanBarCode.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. ///************************************************************************/
  2. /* Copyright (C), 2016-2020, [IT], 保留所有权利;
  3. /* 模 块 名:;
  4. /* 描 述:;
  5. /*
  6. /* 版 本:[V];
  7. /* 作 者:[IT];
  8. /* 日 期:[4/26/2016];
  9. /*
  10. /*
  11. /* 注 意:;
  12. /*
  13. /* 修改记录:[IT];
  14. /* 修改日期:;
  15. /* 修改版本:;
  16. /* 修改内容:;
  17. /************************************************************************/
  18. #ifndef __DLG_SCAN_BARCODE__
  19. #define __DLG_SCAN_BARCODE__
  20. #include "afxwin.h"
  21. #include ".\list\SortListCtrl.h"
  22. #pragma once
  23. class CEnEdit : public CEdit
  24. {
  25. DECLARE_DYNAMIC(CEnEdit)
  26. public:
  27. CEnEdit();
  28. virtual ~CEnEdit();
  29. int m_nLines;
  30. CDialog* m_pParent;
  31. BOOL m_bLockKbdLayout;
  32. protected:
  33. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  34. DECLARE_MESSAGE_MAP()
  35. HKL m_DefaultHKL;
  36. HKL m_Save_KbdLayout;
  37. HKL GetDefaultKbdLayout();
  38. public:
  39. afx_msg void OnEnKillfocus();
  40. afx_msg void OnEnSetfocus();
  41. //afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  42. };
  43. typedef struct __OrderItems__ {
  44. int nIndex;
  45. CString strOrder; // 1.订单号;
  46. CString strAutoId; // 2.商品autoid;
  47. CString strSPId; // 3.商品序列号;
  48. CString strSPName; // 4.商品名称;
  49. CString strSPLb; // 5.商品类别;
  50. CString strBackStatus; // 6.单个商品完成状态;
  51. CString strPickupStatus; // 7.单个商品取件状态;
  52. CString strShuliang; // 8.商品数量;
  53. CString strBackCot; // 9.完成数量;
  54. CString strPickupCot; // 10.取件数量;
  55. __OrderItems__()
  56. {
  57. nIndex = -1;
  58. strOrder = _T("");
  59. strAutoId = _T("");
  60. strSPId = _T("");
  61. strSPName = _T("");
  62. strSPLb = _T("");
  63. strBackStatus = _T("");
  64. strPickupStatus = _T("");
  65. strShuliang = _T("");
  66. strBackCot = _T("");
  67. strPickupCot = _T("");
  68. }
  69. const __OrderItems__& operator=(const __OrderItems__ &others)
  70. {
  71. if ( &others == this )
  72. return *this;
  73. nIndex = others.nIndex;
  74. strOrder = others.strOrder;
  75. strAutoId = others.strAutoId;
  76. strSPId = others.strSPId;
  77. strSPName = others.strSPName;
  78. strSPLb = others.strSPLb;
  79. strBackStatus = others.strBackStatus;
  80. strPickupStatus = others.strPickupStatus;
  81. strShuliang = others.strShuliang;
  82. strBackCot = others.strBackCot;
  83. strPickupCot = others.strPickupCot;
  84. return *this;
  85. }
  86. }OrderItems, *pOrderItems;
  87. typedef struct __OUTWAREHOUSE__
  88. {
  89. int nIndex;
  90. CString strOrder;
  91. CString strSPLB;
  92. CString strSPName;
  93. CString strCount;
  94. CString strDate;
  95. CString strClerk;
  96. CString strRemark;
  97. __OUTWAREHOUSE__()
  98. {
  99. nIndex = -1;
  100. strOrder = _T("");
  101. strSPLB = _T("");
  102. strSPName = _T("");
  103. strCount = _T("");
  104. strDate = _T("");
  105. strClerk = _T("");
  106. strRemark = _T("");
  107. }
  108. const __OUTWAREHOUSE__& operator=(const __OUTWAREHOUSE__& others)
  109. {
  110. if ( &others == this )
  111. return *this;
  112. nIndex = others.nIndex;
  113. strOrder = others.strOrder;
  114. strSPLB = others.strSPLB;
  115. strSPName = others.strSPName;
  116. strCount = others.strCount;
  117. strDate = others.strDate;
  118. strClerk = others.strClerk;
  119. strRemark = others.strRemark;
  120. return *this;
  121. }
  122. }OutWarehouse, *pOutWarehouse;
  123. typedef struct __WITHIN__
  124. {
  125. int nIndex;
  126. CString strBarCode;
  127. }WithIn, *pWithIn;
  128. // CDlgScanBarCode 对话框
  129. class CDlgScanBarCode : public CDialog
  130. {
  131. DECLARE_DYNAMIC(CDlgScanBarCode)
  132. public:
  133. CDlgScanBarCode(CWnd* pParent = NULL); // 标准构造函数
  134. virtual ~CDlgScanBarCode();
  135. // 对话框数据
  136. enum { IDD = IDD_DLG_SCANBARCODE };
  137. protected:
  138. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  139. DECLARE_MESSAGE_MAP()
  140. public:
  141. virtual BOOL OnInitDialog();
  142. protected:
  143. virtual void OnOK();
  144. public:
  145. // 扫描类型; == 0 表示扫描回件; 1== 表示扫描取件;
  146. int m_nScanMode;
  147. // 条码枪扫描的条形码;
  148. CEnEdit m_EtBarCode;
  149. // 没有查找到的商品记录;
  150. CStringArray m_AryWithOut;
  151. // 已存在的商品记录;
  152. vector<WithIn> m_vtWithIn;
  153. // 订单商品;
  154. CArray<CStringArray, CStringArray> m_AryOrderItems;
  155. // 出库表;
  156. CArray<CStringArray, CStringArray> m_AryOutWarehouse;
  157. //
  158. void DealScanBarCode(const int& nlines);
  159. // 初始化list;
  160. void InitSortList();
  161. // 扫描结果;
  162. CSortListCtrl m_ScanResult;
  163. protected:
  164. virtual void OnCancel();
  165. };
  166. #endif // __DLG_SCAN_BARCODE__