outsourcing4.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. // outsourcing4.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "outsourcing4.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // outsourcing4
  13. outsourcing4::outsourcing4(CWnd* pParent /*=NULL*/)
  14. : CDialog(outsourcing4::IDD)
  15. {
  16. //{{AFX_DATA_INIT(outsourcing4)
  17. m_year = atoi(g_date.Mid (0,4));
  18. m_month = atoi(g_date.Mid (5,2));
  19. m_day = atoi(g_date.Mid (8,2));
  20. m_check1 = FALSE;
  21. m_bInit=0;
  22. m_timestmap=0;
  23. m_radio = 0;
  24. //}}AFX_DATA_INIT
  25. }
  26. void outsourcing4::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(outsourcing4)
  30. DDX_Control(pDX, IDC_COMBObranch, m_combobranch);
  31. DDX_Control(pDX, IDC_COMBOsplb3, m_waiter1);
  32. DDX_Control(pDX, IDC_COMBOsplb2, m_combosplb2);
  33. DDX_Control(pDX, IDC_COMBOsp2, m_combosp2);
  34. DDX_Control(pDX, IDC_COMBOsp, m_combosp);
  35. DDX_Control(pDX, IDC_COMBOsplb, m_combosplb);
  36. DDX_Control(pDX, IDC_SPIN3, m_spinday);
  37. DDX_Control(pDX, IDC_SPIN2, m_spinmonth);
  38. DDX_Control(pDX, IDC_SPIN1, m_spinyear);
  39. DDX_Control(pDX, IDC_LIST2, m_List1);
  40. DDX_Control(pDX, IDC_STATIC1, m_static1);
  41. DDX_Text(pDX, IDC_EDITyear, m_year);
  42. DDV_MinMaxUInt(pDX, m_year, 1900, 3000);
  43. DDX_Text(pDX, IDC_EDITmonth, m_month);
  44. DDV_MinMaxUInt(pDX, m_month, 1, 12);
  45. DDX_Text(pDX, IDC_EDITday, m_day);
  46. DDV_MinMaxUInt(pDX, m_day, 1, 31);
  47. DDX_Check(pDX, IDC_CHECK1, m_check1);
  48. DDX_Radio(pDX, IDC_RADIO3, m_radio);
  49. //}}AFX_DATA_MAP
  50. }
  51. BEGIN_MESSAGE_MAP(outsourcing4, CDialog)
  52. //{{AFX_MSG_MAP(outsourcing4)
  53. ON_BN_CLICKED(IDC_BUTclose, OnBUTclose)
  54. ON_EN_CHANGE(IDC_EDITyear, OnChangeEDITyear)
  55. ON_EN_CHANGE(IDC_EDITmonth, OnChangeEDITmonth)
  56. ON_EN_CHANGE(IDC_EDITday, OnChangeEDITday)
  57. ON_CBN_SELCHANGE(IDC_COMBOsplb, OnSelchangeCOMBOsplb)
  58. ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
  59. ON_CBN_SELCHANGE(IDC_COMBOsplb2, OnSelchangeCOMBOsplb2)
  60. ON_CBN_SELCHANGE(IDC_COMBOsp2, OnSelchangeCOMBOsp2)
  61. ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
  62. ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
  63. ON_BN_CLICKED(IDC_BUTprint, OnBUTprint)
  64. ON_CBN_SELCHANGE(IDC_COMBOsplb3, OnSelchangeCOMBOsplb3)
  65. ON_BN_CLICKED(IDC_RADIO5, OnRadio5)
  66. ON_CBN_CLOSEUP(IDC_COMBOsplb3, OnCloseupCOMBOsplb3)
  67. ON_CBN_SELCHANGE(IDC_COMBObranch, OnSelchangeCOMBObranch)
  68. //}}AFX_MSG_MAP
  69. END_MESSAGE_MAP()
  70. /////////////////////////////////////////////////////////////////////////////
  71. // outsourcing4 diagnostics
  72. #ifdef _DEBUG
  73. void outsourcing4::AssertValid() const
  74. {
  75. CDialog::AssertValid();
  76. }
  77. void outsourcing4::Dump(CDumpContext& dc) const
  78. {
  79. CDialog::Dump(dc);
  80. }
  81. #endif //_DEBUG
  82. /////////////////////////////////////////////////////////////////////////////
  83. // outsourcing4 message handlers
  84. extern BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam);
  85. BOOL outsourcing4::OnInitDialog()
  86. {
  87. CDialog::OnInitDialog();
  88. // TODO: Add your specialized code here and/or call the base class
  89. if(g_bAllBranch)
  90. {
  91. GetDlgItem(IDC_STATIC3)->ShowWindow(SW_SHOW);
  92. GetDlgItem(IDC_COMBObranch)->ShowWindow(SW_SHOW);
  93. // m_combobranch.AddString ("");
  94. for(int i=0; i<g_brancharray.GetSize (); i++)
  95. {
  96. m_combobranch.AddString (g_brancharray.ElementAt (i).ElementAt (0));
  97. }
  98. }
  99. CRect rc2;
  100. GetWindowRect(rc2);
  101. ::MoveWindow(m_hWnd,g_rc.left,g_rc.top,g_rc.Width(),g_rc.Height(),TRUE);
  102. g_WidthScale2 = (float)g_rc.Width()/(float)rc2.Width(); // new/Old
  103. g_HeightScale2 = (float)g_rc.Height()/(float)rc2.Height();
  104. EnumChildWindows(m_hWnd,(WNDENUMPROC)EnumChildProc2,0);
  105. m_waiter1.RefDroppedWidth();
  106. m_combosplb.GetWindowRect (rc2);
  107. ScreenToClient(rc2);
  108. rc2.bottom +=200;
  109. m_combosplb.MoveWindow (rc2);
  110. m_combosp.GetWindowRect (rc2);
  111. ScreenToClient(rc2);
  112. rc2.bottom +=200;
  113. m_combosp.MoveWindow (rc2);
  114. m_combosplb2.GetWindowRect (rc2);
  115. ScreenToClient(rc2);
  116. rc2.bottom +=200;
  117. m_combosplb2.MoveWindow (rc2);
  118. m_combosp2.GetWindowRect (rc2);
  119. ScreenToClient(rc2);
  120. rc2.bottom +=200;
  121. m_combosp2.MoveWindow (rc2);
  122. m_static1.SetFont (&g_titlefont);
  123. #ifdef CHILD_VERSION
  124. m_List1.SetHeadings("订单号,100;家长姓名,100;宝宝姓名,100;产品名称,100;数量,100;是否发出,100;是否返工,100;返工日期,100;是否完成,100;完成日期,100" );
  125. #else
  126. m_List1.SetHeadings("订单号,100;男宾姓名,100;女宾姓名,100;产品名称,100;数量,100;是否发出,100;是否返工,100;返工日期,100;是否完成,100;完成日期,100" );
  127. #endif
  128. m_List1.m_bSortSupport=0;
  129. m_List1.LoadColumnInfo (180);
  130. m_spinyear.SetRange (1900, 3000);
  131. m_spinmonth.SetRange (1, 12);
  132. m_spinday.SetRange (1, 31);
  133. m_bInit=1;
  134. DateChange();
  135. g_sendhead.bsql=0;
  136. g_sendhead.code[0]=2;
  137. g_sendhead.code[1]=4;
  138. g_sendhead.code[2]=9;
  139. g_sendhead.tabcount=3;
  140. g_pMainWnd->ProcessChatMessageRequest2(1);
  141. if(g_bSendOK==0)
  142. {
  143. CDialog::OnOK();
  144. return 0;
  145. }
  146. CArray<CStringArray, CStringArray>g_List2array;
  147. DataToArray(&g_List1array, &m_List3array, &g_List2array);
  148. m_combosplb2.ResetContent ();
  149. m_combosplb2.AddString ("全部");
  150. for(int i=0; i<g_List1array.GetSize (); i++)
  151. m_combosplb2.AddString (g_List1array.ElementAt (i).ElementAt (0));
  152. m_combosplb.ResetContent ();m_combosplb.AddString("全部");
  153. for( i=0; i<g_List2array.GetSize (); i++)
  154. {
  155. m_combosplb.AddString (g_List2array.ElementAt (i).ElementAt (1));
  156. }
  157. m_combosplb.SetCurSel (0);
  158. return TRUE; // return TRUE unless you set the focus to a control
  159. // EXCEPTION: OCX Property Pages should return FALSE
  160. }
  161. void outsourcing4::FillGrid()
  162. {
  163. UpdateData();
  164. if(m_radio==1)
  165. {
  166. FillGrid2();return;
  167. }
  168. else if(m_radio==2)
  169. {
  170. FillGrid3();return;
  171. }
  172. m_List1.DeleteAllItems2 ();
  173. int ii=0;
  174. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  175. int count=0;
  176. CString str;
  177. CString splb="全部";
  178. int pos=m_combosplb.GetCurSel ();
  179. if(pos!=-1)
  180. {
  181. m_combosplb.GetLBText (pos, splb);
  182. }
  183. if(splb=="全部")
  184. {
  185. if(!m_check1)
  186. {
  187. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  188. {
  189. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  190. }
  191. }
  192. else
  193. {
  194. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  195. {
  196. if(m_List1array.ElementAt (ii).ElementAt (7) =="OK")continue;
  197. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  198. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  199. {
  200. int aa=ii;
  201. while(aa)
  202. {
  203. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  204. aa--;
  205. }
  206. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  207. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  208. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  209. }
  210. }
  211. }
  212. }
  213. else
  214. {
  215. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  216. {
  217. if(m_List1array.ElementAt (ii).ElementAt (5).GetLength ()<4)continue;
  218. if(m_List1array.ElementAt (ii).ElementAt (5).Right (m_List1array.ElementAt (ii).ElementAt (5).GetLength ()-4)!=splb)continue;
  219. if(m_List1array.ElementAt (ii).ElementAt (6).Find("工厂")==-1)continue;
  220. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  221. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  222. {
  223. int aa=ii;
  224. while(aa)
  225. {
  226. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  227. aa--;
  228. }
  229. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  230. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  231. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  232. }
  233. }
  234. }
  235. m_List1.m_arLabels.SetSize(count, 1);
  236. ii=count;
  237. m_List1.m_LabelCount=ii;
  238. m_List1.SetItemCountEx (ii);
  239. str.Format ("项目:%d", ii);
  240. SetDlgItemText(IDC_STATIC2, str);
  241. }
  242. void outsourcing4::OnBUTclose()
  243. {
  244. // TODO: Add your control notification handler code here
  245. CDialog::OnCancel ();
  246. }
  247. void outsourcing4::OnChangeEDITyear()
  248. {
  249. // TODO: If this is a RICHEDIT control, the control will not
  250. // send this notification unless you override the CDialog::OnInitDialog()
  251. // function and call CRichEditCtrl().SetEventMask()
  252. // with the ENM_CHANGE flag ORed into the mask.
  253. DateChange();
  254. // TODO: Add your control notification handler code here
  255. }
  256. void outsourcing4::OnChangeEDITmonth()
  257. {
  258. // TODO: If this is a RICHEDIT control, the control will not
  259. // send this notification unless you override the CDialog::OnInitDialog()
  260. // function and call CRichEditCtrl().SetEventMask()
  261. // with the ENM_CHANGE flag ORed into the mask.
  262. DateChange();
  263. // TODO: Add your control notification handler code here
  264. }
  265. void outsourcing4::OnChangeEDITday()
  266. {
  267. // TODO: If this is a RICHEDIT control, the control will not
  268. // send this notification unless you override the CDialog::OnInitDialog()
  269. // function and call CRichEditCtrl().SetEventMask()
  270. // with the ENM_CHANGE flag ORed into the mask.
  271. // DateChange();
  272. // TODO: Add your control notification handler code here
  273. }
  274. void outsourcing4::DateChange()
  275. {
  276. if(m_bInit==0)return;
  277. m_spinyear.EnableWindow(0);
  278. m_spinmonth.EnableWindow(0);
  279. m_spinday.EnableWindow(0);
  280. UpdateData();
  281. if(m_branch!="")
  282. {
  283. g_pMainWnd->OnDisconnect();
  284. g_branchip=GetIP(m_branch);
  285. g_pMainWnd->OnDisconnect();
  286. g_branchname=m_branch;
  287. g_bBranchModify=1;
  288. }
  289. int i;
  290. int g_nYearposTemp=g_nYearpos;
  291. BOOL bLastYear=0;
  292. BOOL bThisYear=0;
  293. #if JEFF_TEST_ON // 2015开始禁用跨年数据;
  294. int g_nYearposPre = -1;
  295. if (m_year >= 2014 && m_year <= atoi(g_date.Left(4)) && g_hisyeararray.GetSize())
  296. {
  297. g_nYearpos = -1;
  298. bThisYear = 1;
  299. if (m_year == 2014)
  300. {
  301. g_nYearposPre = GetYearPos(m_year - 1);
  302. }
  303. }
  304. else if (m_year <= 2013 && g_hisyeararray.GetSize())
  305. {
  306. g_nYearpos = GetYearPos(m_year);
  307. if (g_nYearpos != -1)
  308. g_nYearposPre = GetYearPos(m_year - 1);
  309. bLastYear = 1;
  310. }
  311. #else
  312. if(m_year==atoi(g_date.Left (4)) && g_hisyeararray.GetSize () )
  313. bThisYear=1;
  314. else if(m_year<=atoi(g_date.Left (4))-1 && g_hisyeararray.GetSize ())
  315. bLastYear=1;
  316. g_nYearpos=GetYearPos(m_year);
  317. int g_nYearposPre=GetYearPos(m_year-1);
  318. #endif
  319. g_sendhead.bsql=0;
  320. g_sendhead.code[0]=219;
  321. g_sendhead.tabcount=1;
  322. CString sql,strdate,strdate2;
  323. strdate.Format ("%04d-%02d-%02d", m_year, m_month, 1);
  324. strdate2.Format ("%04d-%02d-%02d", m_year, m_month, 31);
  325. m_static1.SetWindowText (strdate.Left (7)+"返工资料");
  326. sql.Format ("[date2]>='"+strdate+"' and [date2]<='"+strdate2+"' and [status4] like '返';");
  327. g_pMainWnd->ProcessChatMessageRequest2(sql);
  328. if(g_bSendOK==0)
  329. {
  330. m_spinyear.EnableWindow(1);
  331. m_spinmonth.EnableWindow(1);
  332. m_spinday.EnableWindow(1);
  333. g_nYearpos=g_nYearposTemp;
  334. return;
  335. }
  336. DataToArray(&m_List1array);
  337. if(bLastYear)//如果是去年, 则加今年的补款
  338. {
  339. g_nYearpos=-1;//今年
  340. g_sendhead.bsql=0;
  341. g_sendhead.code[0]=219;
  342. g_sendhead.tabcount=1;
  343. g_pMainWnd->ProcessChatMessageRequest2(sql);
  344. if(g_bSendOK==0)
  345. {
  346. m_spinyear.EnableWindow(1);
  347. m_spinmonth.EnableWindow(1);
  348. m_spinday.EnableWindow(1);
  349. g_nYearpos=g_nYearposTemp;
  350. return;
  351. }
  352. CArray<CStringArray, CStringArray>ThisYearList1array;
  353. DataToArray(&ThisYearList1array);
  354. int oldsize=m_List1array.GetSize ();
  355. m_List1array.SetSize(oldsize+ThisYearList1array.GetSize ());
  356. for(i=oldsize; i<oldsize+ThisYearList1array.GetSize (); i++)
  357. {
  358. m_List1array.ElementAt (i).Copy(ThisYearList1array.ElementAt (i-oldsize));
  359. }
  360. }
  361. if(g_nYearposPre!=-1)//如果是今年, 则加去年的补款
  362. {
  363. g_nYearpos=g_nYearposPre;//去年
  364. g_sendhead.bsql=0;
  365. g_sendhead.code[0]=219;
  366. g_sendhead.tabcount=1;
  367. g_pMainWnd->ProcessChatMessageRequest2(sql);
  368. if(g_bSendOK==0)
  369. {
  370. m_spinyear.EnableWindow(1);
  371. m_spinmonth.EnableWindow(1);
  372. m_spinday.EnableWindow(1);
  373. g_nYearpos=g_nYearposTemp;
  374. return;
  375. }
  376. CArray<CStringArray, CStringArray>ThisYearList1array;
  377. DataToArray(&ThisYearList1array);
  378. int oldsize=m_List1array.GetSize ();
  379. m_List1array.SetSize(oldsize+ThisYearList1array.GetSize ());
  380. for(i=oldsize; i<oldsize+ThisYearList1array.GetSize (); i++)
  381. {
  382. m_List1array.ElementAt (i).Copy(ThisYearList1array.ElementAt (i-oldsize));
  383. }
  384. }
  385. g_nYearpos=g_nYearposTemp;
  386. FillGrid();
  387. m_spinyear.EnableWindow(1);
  388. m_spinmonth.EnableWindow(1);
  389. m_spinday.EnableWindow(1);
  390. }
  391. void outsourcing4::OnSelchangeCOMBOsplb()
  392. {
  393. // TODO: Add your control notification handler code here
  394. FillGrid();
  395. }
  396. void outsourcing4::OnCheck1()
  397. {
  398. // TODO: Add your control notification handler code here
  399. FillGrid();
  400. }
  401. void outsourcing4::OnSelchangeCOMBOsplb2()
  402. {
  403. // TODO: Add your control notification handler code here
  404. int pos=m_combosplb2.GetCurSel ();
  405. if(pos==-1)return;
  406. CString str;
  407. m_combosplb2.GetLBText (pos, str);
  408. m_combosp2.ResetContent ();
  409. m_combosp2.AddString ("全部");
  410. for(int ii=0; ii<m_List3array.GetSize (); ii++)
  411. {
  412. if(m_List3array.ElementAt (ii).ElementAt (6)==str)
  413. {
  414. m_combosp2.AddString (m_List3array.ElementAt (ii).ElementAt (1));
  415. }
  416. }
  417. m_combosp2.SetCurSel (0); FillGrid();
  418. }
  419. void outsourcing4::FillGrid2()
  420. {
  421. m_List1.DeleteAllItems2 ();
  422. int ii=0;
  423. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  424. int count=0;
  425. CString str;
  426. CString splb="全部";
  427. CString sp="全部";
  428. int pos=m_combosplb2.GetCurSel ();
  429. if(pos!=-1)
  430. {
  431. m_combosplb2.GetLBText (pos, splb);
  432. }
  433. pos=m_combosp2.GetCurSel ();
  434. if(pos!=-1)
  435. {
  436. m_combosp2.GetLBText (pos, sp);
  437. }
  438. if(splb=="全部")
  439. {
  440. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  441. {
  442. if(m_check1)
  443. {
  444. if(m_List1array.ElementAt (ii).ElementAt (7) =="OK")continue;
  445. }
  446. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  447. }
  448. }
  449. else
  450. {
  451. if(sp!="全部")
  452. {
  453. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  454. {
  455. if(sp!=m_List1array.ElementAt (ii).ElementAt (3))continue;
  456. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  457. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  458. {
  459. int aa=ii;
  460. while(aa)
  461. {
  462. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  463. aa--;
  464. }
  465. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  466. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  467. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  468. }
  469. }
  470. }
  471. else
  472. {
  473. CStringArray cursparray;
  474. for(int aa=0; aa<m_combosp2.GetCount (); aa++)
  475. {
  476. m_combosp2.GetLBText (aa, str);
  477. cursparray.Add(str);
  478. }
  479. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  480. {
  481. BOOL bFind=0;
  482. for(int aa=0; aa<cursparray.GetSize(); aa++)
  483. {
  484. if(cursparray.ElementAt(aa)==m_List1array.ElementAt (ii).ElementAt (3))
  485. {
  486. bFind=1;break;
  487. }
  488. }
  489. if(bFind==0)continue;
  490. if(m_check1)
  491. {
  492. if(m_List1array.ElementAt (ii).ElementAt (7) =="OK")continue;
  493. }
  494. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  495. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  496. {
  497. int aa=ii;
  498. while(aa)
  499. {
  500. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  501. aa--;
  502. }
  503. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  504. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  505. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  506. }
  507. }
  508. }
  509. }
  510. m_List1.m_arLabels.SetSize(count, 1);
  511. ii=count;
  512. m_List1.m_LabelCount=ii;
  513. m_List1.SetItemCountEx (ii);
  514. str.Format ("项目:%d", ii);
  515. SetDlgItemText(IDC_STATIC2, str);
  516. }
  517. void outsourcing4::OnSelchangeCOMBOsp2()
  518. {
  519. // TODO: Add your control notification handler code here
  520. FillGrid();
  521. }
  522. void outsourcing4::OnRadio3()
  523. {
  524. // TODO: Add your control notification handler code here
  525. UpdateData();
  526. GetDlgItem(IDC_STATIC5)->ShowWindow(m_radio==0);
  527. GetDlgItem(IDC_COMBOsplb)->ShowWindow(m_radio==0);
  528. GetDlgItem(IDC_STATIC6)->ShowWindow(m_radio==1);
  529. GetDlgItem(IDC_STATIC7)->ShowWindow(m_radio==1);
  530. GetDlgItem(IDC_COMBOsplb2)->ShowWindow(m_radio==1);
  531. GetDlgItem(IDC_COMBOsp2)->ShowWindow(m_radio==1);
  532. GetDlgItem(IDC_STATIC8)->ShowWindow(m_radio==2);
  533. GetDlgItem(IDC_COMBOsplb3)->ShowWindow(m_radio==2);
  534. FillGrid();
  535. }
  536. void outsourcing4::OnRadio4()
  537. {
  538. // TODO: Add your control notification handler code here
  539. OnRadio3();
  540. }
  541. void outsourcing4::OnBUTprint()
  542. {
  543. // TODO: Add your control notification handler code here
  544. UpdateData();
  545. CString str;
  546. str.Format ("c:\\%d%02d返工资料.xls", m_year, m_month);
  547. ListToXLS(&m_List1, str, 0);
  548. }
  549. void outsourcing4::OnSelchangeCOMBOsplb3()
  550. {
  551. // TODO: Add your control notification handler code here
  552. }
  553. void outsourcing4::OnCloseupCOMBOsplb3()
  554. {
  555. // TODO: Add your control notification handler code here
  556. FillGrid();
  557. }
  558. void outsourcing4::OnRadio5()
  559. {
  560. // TODO: Add your control notification handler code here
  561. OnRadio3();
  562. }
  563. void outsourcing4::FillGrid3()
  564. {
  565. UpdateData();
  566. m_List1.DeleteAllItems2 ();
  567. int ii=0;
  568. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  569. int count=0;
  570. CString str;
  571. CString splb="全部";
  572. int pos=m_waiter1.GetCurSel ();
  573. if(pos!=-1)
  574. {
  575. m_waiter1.GetLBText (pos, splb);
  576. }
  577. if(splb=="全部"||splb=="")
  578. {
  579. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  580. {
  581. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  582. }
  583. }
  584. else
  585. {
  586. splb="员工:"+splb;
  587. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  588. {
  589. // if(m_List1array.ElementAt (ii).ElementAt (5).GetLength ()<4)continue;
  590. // if(m_List1array.ElementAt (ii).ElementAt (5).Right (m_List1array.ElementAt (ii).ElementAt (5).GetLength ()-4)!=splb)continue;
  591. if(m_List1array.ElementAt (ii).ElementAt (6).Find(splb)==-1)continue;
  592. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  593. if(m_List1.m_arLabels.ElementAt (count-1).ElementAt (0)=="")
  594. {
  595. int aa=ii;
  596. while(aa)
  597. {
  598. if(m_List1array.ElementAt(aa).ElementAt (0)!="")break;
  599. aa--;
  600. }
  601. m_List1.m_arLabels.ElementAt (count-1).SetAt (0, m_List1array.ElementAt(aa).ElementAt (0) );
  602. m_List1.m_arLabels.ElementAt (count-1).SetAt (1, m_List1array.ElementAt(aa).ElementAt (1) );
  603. m_List1.m_arLabels.ElementAt (count-1).SetAt (2, m_List1array.ElementAt(aa).ElementAt (2) );
  604. }
  605. }
  606. }
  607. m_List1.m_arLabels.SetSize(count, 1);
  608. ii=count;
  609. m_List1.m_LabelCount=ii;
  610. m_List1.SetItemCountEx (ii);
  611. str.Format ("项目:%d", ii);
  612. SetDlgItemText(IDC_STATIC2, str);
  613. }
  614. void outsourcing4::OnSelchangeCOMBObranch()
  615. {
  616. // TODO: Add your control notification handler code here
  617. int pos=m_combobranch.GetCurSel();
  618. if(pos==-1)return;
  619. m_combobranch.GetLBText(pos, m_branch);
  620. DateChange();
  621. g_sendhead.bsql=0;
  622. g_sendhead.code[0]=2;
  623. g_sendhead.code[1]=4;
  624. g_sendhead.code[2]=9;
  625. g_sendhead.tabcount=3;
  626. g_pMainWnd->ProcessChatMessageRequest2(1);
  627. if(g_bSendOK==0)
  628. {
  629. return ;
  630. }
  631. CArray<CStringArray, CStringArray>g_List2array;
  632. DataToArray(&g_List1array, &m_List3array, &g_List2array);
  633. m_combosplb2.ResetContent ();
  634. m_combosplb2.AddString ("全部");
  635. for(int i=0; i<g_List1array.GetSize (); i++)
  636. m_combosplb2.AddString (g_List1array.ElementAt (i).ElementAt (0));
  637. m_combosplb.ResetContent ();m_combosplb.AddString("全部");
  638. for( i=0; i<g_List2array.GetSize (); i++)
  639. {
  640. m_combosplb.AddString (g_List2array.ElementAt (i).ElementAt (1));
  641. }
  642. m_combosplb.SetCurSel (0);
  643. }