frmCallCenterList.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Collections;
  10. using System.IO;
  11. using LYFZ.ComponentLibrary;
  12. using LYFZ.Helper;
  13. using System.Web.UI.WebControls;
  14. namespace LYFZ.Software.MainBusiness.OAShopManagement
  15. {
  16. public partial class frmCallCenterList : LYFZ.Software.UI.OAShopManagement.frmCallCenterList
  17. {
  18. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  19. public frmCallCenterList()
  20. {
  21. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cbtCustomerSupportStaff, IsFirstNodeNull: true, IsShowAdmin: true);
  22. this.Load += frmCallCenterList_Load;
  23. this.btnClose.Click += btnClose_Click;
  24. this.btnSelect.Click += btnSelect_Click;
  25. this.btnAudioPlayback.Click += btnAudioPlayback_Click;
  26. this.comboBoxType.SelectedIndexChanged += comboBoxType_SelectedIndexChanged;
  27. this.Resize += frmCallCenterList_Resize;
  28. this.cbxConcreteMatters.SelectedIndexChanged += cbxConcreteMatters_SelectedIndexChanged;
  29. this.cbxTalkMode.SelectedIndexChanged += cbxTalkMode_SelectedIndexChanged;
  30. this.cbtCustomerSupportStaff.ComboBoxTree_NodeMouseClick += cbtCustomerSupportStaff_ComboBoxTree_NodeMouseClick;
  31. this.txtKey.KeyDown += txtKey_KeyDown;
  32. }
  33. /// <summary>
  34. /// 订单编号
  35. /// </summary>
  36. public string StrOrdNumber = "";
  37. /// <summary>
  38. /// 是否第一次加载运行
  39. /// </summary>
  40. bool IsFirstRun = true;
  41. /// <summary>
  42. /// 窗体加载事件
  43. /// </summary>
  44. /// <param name="sender"></param>
  45. /// <param name="e"></param>
  46. void frmCallCenterList_Load(object sender, EventArgs e)
  47. {
  48. this.dateTimePickerStart.DateValue = SDateTime.Now.ToString("yyyy-MM-01");
  49. this.dateTimePickerEnd.DateValue = Convert.ToDateTime(this.dateTimePickerStart.DateValue).AddMonths(1).AddSeconds(-1).ToString("yyyy-MM-dd");
  50. this.PublicFunctionRows();
  51. this.IsFirstRun = false;
  52. this.frmCallCenterList_Resize(this, null);
  53. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.通话中心);
  54. if (!b)
  55. {
  56. this.Close();
  57. return;
  58. }
  59. }
  60. /// <summary>
  61. /// 关键字查询
  62. /// </summary>
  63. /// <param name="sender"></param>
  64. /// <param name="e"></param>
  65. void txtKey_KeyDown(object sender, KeyEventArgs e)
  66. {
  67. if (e.KeyCode == Keys.Enter)
  68. { this.btnSelect_Click(this, null); }
  69. }
  70. /// <summary>
  71. /// 客服人员下拉框选择查询事件
  72. /// </summary>
  73. /// <param name="sender"></param>
  74. /// <param name="e"></param>
  75. void cbtCustomerSupportStaff_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  76. {
  77. this.btnSelect_Click(this, null);
  78. }
  79. /// <summary>
  80. /// 通话方式下拉框选择查询事件
  81. /// </summary>
  82. /// <param name="sender"></param>
  83. /// <param name="e"></param>
  84. void cbxTalkMode_SelectedIndexChanged(object sender, EventArgs e)
  85. {
  86. this.btnSelect_Click(this, null);
  87. }
  88. /// <summary>
  89. /// 具体事项下拉框选择查询事件
  90. /// </summary>
  91. /// <param name="sender"></param>
  92. /// <param name="e"></param>
  93. void cbxConcreteMatters_SelectedIndexChanged(object sender, EventArgs e)
  94. {
  95. this.btnSelect_Click(this, null);
  96. }
  97. ListItem item;
  98. /// <summary>
  99. /// 选择下拉框
  100. /// </summary>
  101. /// <param name="sender"></param>
  102. /// <param name="e"></param>
  103. void comboBoxType_SelectedIndexChanged(object sender, EventArgs e)
  104. {
  105. string selectValue = this.comboBoxType.SelectedItem.ToString();
  106. this.cbxConcreteMatters.Items.Clear();
  107. this.cbxConcreteMatters.Text = "";
  108. switch (selectValue)
  109. {
  110. case "流程把控":
  111. item = new ListItem();
  112. item.Text = "";
  113. item.Value = "";
  114. this.cbxConcreteMatters.Items.Add(item);
  115. item = new ListItem();
  116. item.Text = "已定未拍";
  117. item.Value = "已定未拍";
  118. this.cbxConcreteMatters.Items.Add(item);
  119. item = new ListItem();
  120. item.Text = "已拍未修";
  121. item.Value = "已拍未修";
  122. this.cbxConcreteMatters.Items.Add(item);
  123. item = new ListItem();
  124. item.Text = "已拍未选";
  125. item.Value = "已拍未选";
  126. this.cbxConcreteMatters.Items.Add(item);
  127. item = new ListItem();
  128. item.Text = "已修未选";
  129. item.Value = "已修未选";
  130. this.cbxConcreteMatters.Items.Add(item);
  131. item = new ListItem();
  132. item.Text = "已选未设计";
  133. item.Value = "已选未设计";
  134. this.cbxConcreteMatters.Items.Add(item);
  135. item = new ListItem();
  136. item.Text = "已选未发片";
  137. item.Value = "已选未发片";
  138. this.cbxConcreteMatters.Items.Add(item);
  139. item = new ListItem();
  140. item.Text = "已设计未看";
  141. item.Value = "已设计未看";
  142. this.cbxConcreteMatters.Items.Add(item);
  143. item = new ListItem();
  144. item.Text = "已看未发片";
  145. item.Value = "已看未发片";
  146. this.cbxConcreteMatters.Items.Add(item);
  147. item = new ListItem();
  148. item.Text = "已发未回件";
  149. item.Value = "已发未回件";
  150. this.cbxConcreteMatters.Items.Add(item);
  151. item = new ListItem();
  152. item.Text = "已回件未取";
  153. item.Value = "已回件未取";
  154. this.cbxConcreteMatters.Items.Add(item);
  155. break;
  156. case "流程按排":
  157. item = new ListItem();
  158. item.Text = "";
  159. item.Value = "";
  160. this.cbxConcreteMatters.Items.Add(item);
  161. item = new ListItem();
  162. item.Text = "按排摄影拍照";
  163. item.Value = "安排拍照";
  164. this.cbxConcreteMatters.Items.Add(item);
  165. item = new ListItem();
  166. item.Text = "按排选片时间";
  167. item.Value = "安排选片";
  168. this.cbxConcreteMatters.Items.Add(item);
  169. item = new ListItem();
  170. item.Text = "按排取件时间";
  171. item.Value = "安排取件";
  172. this.cbxConcreteMatters.Items.Add(item);
  173. break;
  174. case "业务咨询":
  175. item = new ListItem();
  176. item.Text = "";
  177. item.Value = "";
  178. this.cbxConcreteMatters.Items.Add(item);
  179. item = new ListItem();
  180. item.Text = "婚纱套系";
  181. item.Value = "婚纱套系";
  182. this.cbxConcreteMatters.Items.Add(item);
  183. item = new ListItem();
  184. item.Text = "写真套系";
  185. item.Value = "写真套系";
  186. this.cbxConcreteMatters.Items.Add(item);
  187. item = new ListItem();
  188. item.Text = "最新活动";
  189. item.Value = "最新活动";
  190. this.cbxConcreteMatters.Items.Add(item);
  191. break;
  192. case "满意度调查":
  193. item = new ListItem();
  194. item.Text = "";
  195. item.Value = "";
  196. this.cbxConcreteMatters.Items.Add(item);
  197. item = new ListItem();
  198. item.Text = "回访接单";
  199. item.Value = "回访接单";
  200. this.cbxConcreteMatters.Items.Add(item);
  201. item = new ListItem();
  202. item.Text = "回访拍摄";
  203. item.Value = "回访拍摄";
  204. this.cbxConcreteMatters.Items.Add(item);
  205. break;
  206. case "意向跟踪":
  207. item = new ListItem();
  208. item.Text = "";
  209. item.Value = "";
  210. this.cbxConcreteMatters.Items.Add(item);
  211. item = new ListItem();
  212. item.Text = "意向客户跟踪";
  213. item.Value = "意向客户跟踪";
  214. this.cbxConcreteMatters.Items.Add(item);
  215. item = new ListItem();
  216. item.Text = "溜单追回";
  217. item.Value = "溜单追回";
  218. this.cbxConcreteMatters.Items.Add(item);
  219. break;
  220. case "关系维护":
  221. item = new ListItem();
  222. item.Text = "";
  223. item.Value = "";
  224. this.cbxConcreteMatters.Items.Add(item);
  225. item = new ListItem();
  226. item.Text = "结婚纪念祝福";
  227. item.Value = "结婚纪念祝福";
  228. this.cbxConcreteMatters.Items.Add(item);
  229. item = new ListItem();
  230. item.Text = "生日祝福";
  231. item.Value = "生日祝福";
  232. this.cbxConcreteMatters.Items.Add(item);
  233. item = new ListItem();
  234. item.Text = "节日问候";
  235. item.Value = "节日问候";
  236. this.cbxConcreteMatters.Items.Add(item);
  237. break;
  238. }
  239. this.btnSelect_Click(this, null);
  240. }
  241. /// <summary>
  242. /// 录音回放
  243. /// </summary>
  244. /// <param name="sender"></param>
  245. /// <param name="e"></param>
  246. void btnAudioPlayback_Click(object sender, EventArgs e)
  247. {
  248. MessageBoxCustom.Show("暂时没有通话录音!");
  249. }
  250. /// <summary>
  251. /// 查询按钮
  252. /// </summary>
  253. /// <param name="sender"></param>
  254. /// <param name="e"></param>
  255. void btnSelect_Click(object sender, EventArgs e)
  256. {
  257. this.dgvGridview.ClearSelection();
  258. if (string.IsNullOrEmpty(this.txtKey.Text.Trim()) && !string.IsNullOrEmpty(this.StrOrdNumber))
  259. { this.StrOrdNumber = ""; }
  260. this.PublicFunctionRows();
  261. }
  262. /// <summary>
  263. /// 关闭
  264. /// </summary>
  265. /// <param name="sender"></param>
  266. /// <param name="e"></param>
  267. void btnClose_Click(object sender, EventArgs e)
  268. {
  269. this.Close();
  270. }
  271. /// <summary>
  272. /// 窗体大小发生变化事件
  273. /// </summary>
  274. /// <param name="sender"></param>
  275. /// <param name="e"></param>
  276. void frmCallCenterList_Resize(object sender, EventArgs e)
  277. {
  278. if (!this.IsFirstRun)
  279. {
  280. int ControlsWidth = 0;
  281. int ForCount = 0;
  282. for (int i = 0; i < this.flowLayoutPanel1.Controls.Count; i++)
  283. {
  284. if (this.flowLayoutPanel1.Controls[i].Visible)
  285. {
  286. ForCount++;
  287. ControlsWidth += this.flowLayoutPanel1.Controls[i].Width;
  288. }
  289. }
  290. ControlsWidth += ForCount * 6;
  291. int strWidth = this.Width;
  292. int IntCount = ControlsWidth / strWidth;
  293. if ((ControlsWidth % strWidth) > 0)
  294. { IntCount++; }
  295. if (IntCount == 1)
  296. { this.flowLayoutPanel1.Height = 33; }
  297. else
  298. {
  299. ControlsWidth += 110;
  300. IntCount = ControlsWidth / strWidth;
  301. if ((ControlsWidth % strWidth) > 0)
  302. { IntCount++; }
  303. if (IntCount == 2)
  304. { this.flowLayoutPanel1.Height = 65; }
  305. else
  306. { this.flowLayoutPanel1.Height = 95; }
  307. }
  308. }
  309. }
  310. /// <summary>
  311. /// 创建行
  312. /// </summary>
  313. void PublicFunctionRows()
  314. {
  315. if (!string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()) && string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()))
  316. { MessageBoxCustom.Show("开始日期不能为空!"); return; }
  317. else if (string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()) && !string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()))
  318. { MessageBoxCustom.Show("结束日期不能为空!"); return; }
  319. if (string.IsNullOrEmpty(this.txtKey.Text.Trim()) && (string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim()) || string.IsNullOrEmpty(this.dateTimePickerStart.DateValue.Trim())))
  320. { MessageBoxCustom.Show("开始日期不能为空!"); return; }
  321. string StrWhere = "";
  322. if (!string.IsNullOrEmpty(this.txtKey.Text.Trim()) || !String.IsNullOrEmpty(this.StrOrdNumber))
  323. {
  324. if (!String.IsNullOrEmpty(this.StrOrdNumber))
  325. {
  326. string StrSQL = "";
  327. string StrText = "";
  328. DataTable dt = orbll.GetView_Custom("select Cus_CustomerNumber,Cus_Name from tb_ErpCustomerGroupMembers Left Join tb_ErpCustomerGroup on GP_CustomerGroupID = GM_CustomerGroupID Left Join tb_ErpCustomer on Cus_CustomerNumber = GM_CustomerID where Cus_Type != '儿童' And Cus_CustomerNumber is not null And GP_OrderNumber = '" + StrOrdNumber + "'").Tables[0];
  329. for (int i = 0; i < dt.Rows.Count; i++)
  330. {
  331. StrSQL += "'" + dt.Rows[i]["Cus_CustomerNumber"].ToString().Trim() + "',";
  332. StrText += dt.Rows[i]["Cus_Name"].ToString().Trim() + ",";
  333. }
  334. this.txtKey.Text = StrText.TrimEnd(',');
  335. if (!string.IsNullOrEmpty(StrSQL))
  336. { StrWhere += " And Cus_CustomerNumber in (" + StrSQL.TrimEnd(',') + ")"; }
  337. }
  338. else
  339. { StrWhere += " And (Cus_Telephone like '%" + this.txtKey.Text.Trim() + "%' or Cus_Name like '%" + this.txtKey.Text.Trim() + "%')"; }
  340. }
  341. else
  342. {
  343. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("TR_TraceDateTime", this.dateTimePickerStart.DateValue.Trim(), this.dateTimePickerEnd.DateValue.Trim());
  344. if (!string.IsNullOrEmpty(this.comboBoxType.Text.Trim()))
  345. { StrWhere += " And TR_TraceType = '" + this.comboBoxType.Text.Trim() + "'"; }
  346. if (!string.IsNullOrEmpty(this.cbxConcreteMatters.Text.Trim()))
  347. {
  348. item = cbxConcreteMatters.SelectedItem as ListItem;
  349. StrWhere += " And TR_SpecificMatters = '" + item.Value.Trim() + "'";
  350. }
  351. if (!string.IsNullOrEmpty(this.cbxTalkMode.Text.Trim()))
  352. { StrWhere += " And TR_TraceWay = '" + this.cbxTalkMode.Text.Trim() + "'"; }
  353. if (!string.IsNullOrEmpty(this.cbtCustomerSupportStaff.Text.Trim()))
  354. { StrWhere += " And User_Name = '" + this.cbtCustomerSupportStaff.Text.Trim() + "'"; }
  355. }
  356. DataTable newTable = new DataTable();
  357. LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
  358. {
  359. newTable = LYFZ.BLL.BLL_ErpOrderView.GetData_StoreManagementCallCenter(StrWhere);
  360. });
  361. this.dgvGridview.DataSource(newTable, strHideField: "AutoID,客户编号");
  362. this.dgvGridview.FillLastColumn();
  363. }
  364. }
  365. }