ClientServiceArrangementFormMain.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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. namespace LYFZ.Software.MainBusiness.DoorCityProcess
  10. {
  11. public partial class ClientServiceArrangementFormMain : LYFZ.Software.UI.DoorCityProcess.ClientServiceArrangementFormMain
  12. {
  13. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  14. LYFZ.BLL.BLL_ErpClientServiceTask cstbll = new BLL.BLL_ErpClientServiceTask();
  15. public ClientServiceArrangementFormMain()
  16. {
  17. this.Load += ClientServiceArrangementFormMain_Load;
  18. this.Shown += ClientServiceArrangementFormMain_Shown;
  19. this.Resize += ClientServiceArrangementFormMain_Resize;
  20. this.btnQuery.Click += btnQuery_Click;
  21. this.btnTaskAnPai.Click += btnTaskAnPai_Click;
  22. this.btnTaskStatistics.Click += btnTaskStatistics_Click;
  23. this.btnTaskUpdate.Click += btnTaskUpdate_Click;
  24. this.btnTaskEcex.Click += btnTaskEcex_Click;
  25. this.btnCloseed.Click += btnCloseed_Click;
  26. this.cmbtreevTaskType.ComboBoxTree_NodeMouseClick += cmbtreevTaskType_ComboBoxTree_NodeMouseClick;
  27. this.tabControlEx1.SelectedIndexChanged += tabControlEx1_SelectedIndexChanged;
  28. }
  29. /// <summary>
  30. /// 员工编号
  31. /// </summary>
  32. string StrUserID = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
  33. /// <summary>
  34. /// 窗体加载事件
  35. /// </summary>
  36. /// <param name="sender"></param>
  37. /// <param name="e"></param>
  38. void ClientServiceArrangementFormMain_Load(object sender, EventArgs e)
  39. {
  40. this.btnTaskAnPai.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StoresClientService, CustomAttributes.OperatingAuthority.ClientServiceTaskAnPai);
  41. this.btnTaskUpdate.Enabled = this.btnTaskAnPai.Enabled;
  42. this.dtDateTimeStart.DateValue = SDateTime.Now.AddMonths(-1).ToString("yyyy-MM-01");
  43. this.dtDateTimeEnd.DateValue = SDateTime.Now.ToString("yyyy-MM-dd");
  44. this.panelDateTime.Visible = false;
  45. this.cmbtreevTaskItem.Enabled = false;
  46. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevTaskType, StrBindData: "全部," + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetTaskItem());
  47. this.cmbtreevTaskType.TextFindTag("全部");
  48. }
  49. /// <summary>
  50. /// 窗体加载事件
  51. /// </summary>
  52. /// <param name="sender"></param>
  53. /// <param name="e"></param>
  54. void ClientServiceArrangementFormMain_Shown(object sender, EventArgs e)
  55. {
  56. //LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbtreevClientServicePerson, IsFirstNodeNull: true, IsFirstNodeName: "全部", IsShowResign: false);
  57. this.BindComboBoxTreeViewPerson(0);
  58. if (!LYFZ.BLL.BLL_ErpUser.IsAdministrator())
  59. {
  60. this.cmbtreevClientServicePerson.TagFindText(StrUserID);
  61. this.cmbtreevClientServicePerson.Enabled = false;
  62. //this.tabPage_TimeoutCompleted.Parent = null;
  63. //this.tabPage_Completed.Parent = null;
  64. this.cmbtreevClientServicePerson.Text = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name;
  65. }
  66. else
  67. { this.cmbtreevClientServicePerson.TextFindTag("全部"); }
  68. this.PublicFunctionRows();
  69. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.客服中心客服安排);
  70. if (!b)
  71. {
  72. this.Close();
  73. }
  74. }
  75. /// <summary>
  76. /// 获取人员
  77. /// </summary>
  78. /// <param name="IndexCount"></param>
  79. void BindComboBoxTreeViewPerson(int IndexCount)
  80. {
  81. this.cmbtreevClientServicePerson.Nodes.Clear();
  82. string StrWhere = "User_Name is not null";
  83. switch (IndexCount)
  84. {
  85. case 0:
  86. StrWhere += " And Cst_CompletionIntStatus = 0";
  87. break;
  88. case 1:
  89. StrWhere += " And Cst_CompletionIntStatus = 0 And (Cst_TaskTermTime+1) < getdate()";
  90. break;
  91. case 2:
  92. StrWhere += " And Cst_CompletionIntStatus = 1 And Cst_TaskTermTime < Cst_CompletionTime";
  93. break;
  94. case 3:
  95. StrWhere += " And Cst_CompletionIntStatus = 1";
  96. break;
  97. }
  98. DataTable dt = orbll.GetView_Custom("tb_ErpClientServiceTask Left Join tb_ErpUser on User_EmployeeID = Cst_ServicePerson", StrWhere: StrWhere, ShowColumnName: "Cst_ServicePerson,User_Name", GroupBy: "Cst_ServicePerson,User_Name").Tables[0];
  99. TreeNode root = null;
  100. root = new TreeNode();
  101. root.Text = "全部";
  102. root.Tag = "";
  103. root.Name = "";
  104. this.cmbtreevClientServicePerson.Nodes.Add(root);
  105. for (int i = 0; i < dt.Rows.Count; i++)
  106. {
  107. root = new TreeNode();
  108. root.Text = dt.Rows[i]["User_Name"].ToString().Trim();
  109. root.Tag = dt.Rows[i]["Cst_ServicePerson"].ToString().Trim();
  110. root.Name = dt.Rows[i]["Cst_ServicePerson"].ToString().Trim();
  111. this.cmbtreevClientServicePerson.Nodes.Add(root);
  112. }
  113. }
  114. /// <summary>
  115. /// 窗体大小发生变化
  116. /// </summary>
  117. /// <param name="sender"></param>
  118. /// <param name="e"></param>
  119. void ClientServiceArrangementFormMain_Resize(object sender, EventArgs e)
  120. {
  121. switch (this.btnQuery.Location.Y)
  122. {
  123. case 3:
  124. this.flowLayoutPanel1.Height = 38;
  125. break;
  126. case 38:
  127. this.flowLayoutPanel1.Height = 72;
  128. break;
  129. case 73:
  130. this.flowLayoutPanel1.Height = 107;
  131. break;
  132. }
  133. }
  134. /// <summary>
  135. /// 查询
  136. /// </summary>
  137. /// <param name="sender"></param>
  138. /// <param name="e"></param>
  139. void btnQuery_Click(object sender, EventArgs e)
  140. {
  141. this.PublicFunctionRows();
  142. }
  143. /// <summary>
  144. /// 任务安排
  145. /// </summary>
  146. /// <param name="sender"></param>
  147. /// <param name="e"></param>
  148. void btnTaskAnPai_Click(object sender, EventArgs e)
  149. {
  150. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskStatisticsSmallForm frm = new SetSmallForm.ClientServiceTaskStatisticsSmallForm();
  151. frm.IsWorkAnPai = true;
  152. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  153. frm.Size = new System.Drawing.Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  154. frm.StartPosition = FormStartPosition.Manual;
  155. frm.ShowDialog();
  156. }
  157. /// <summary>
  158. /// 任务统计
  159. /// </summary>
  160. /// <param name="sender"></param>
  161. /// <param name="e"></param>
  162. void btnTaskStatistics_Click(object sender, EventArgs e)
  163. {
  164. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskStatisticsSmallForm frm = new SetSmallForm.ClientServiceTaskStatisticsSmallForm();
  165. frm.IsWorkAnPai = false;
  166. frm.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  167. frm.Size = new System.Drawing.Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  168. frm.StartPosition = FormStartPosition.Manual;
  169. frm.ShowDialog();
  170. }
  171. /// <summary>
  172. /// 任务修改
  173. /// </summary>
  174. /// <param name="sender"></param>
  175. /// <param name="e"></param>
  176. void btnTaskUpdate_Click(object sender, EventArgs e)
  177. {
  178. if (this.dgvData.SelectedRows.Count > 0)
  179. {
  180. LYFZ.Model.ClientServiceTaskAnPaiModel model = new Model.ClientServiceTaskAnPaiModel();
  181. model.StrDateTime = this.dgvData.CurrentRow.Cells["任务时间"].Value.ToString().Trim();
  182. model.StrRemark = this.dgvData.CurrentRow.Cells["任务说明"].Value.ToString().Trim();
  183. model.StrUserName = this.dgvData.CurrentRow.Cells["客服人员"].Value.ToString().Trim();
  184. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new SetSmallForm.ClientServiceTaskAnPaiSmallForm();
  185. frm.model = model;
  186. frm.ShowDialog();
  187. if (frm.IsSaveed)
  188. {
  189. model = frm.model;
  190. DataTable dt = orbll.GetView_Custom("tb_ErpClientServiceTask", StrWhere: "ID = '" + this.dgvData.CurrentRow.Cells["ID"].Value.ToString().Trim() + "'", ShowColumnName: "*").Tables[0];
  191. LYFZ.Model.Model_ErpClientServiceTask modelCst = cstbll.DataRowToModel(dt.Rows[0]);
  192. modelCst.Cst_TaskTermTime = Convert.ToDateTime(model.StrDateTime);
  193. modelCst.Cst_ServicePerson = model.StrUserID;
  194. modelCst.Cst_TaskRemark = model.StrRemark;
  195. if (cstbll.Update(modelCst))
  196. {
  197. MessageBoxCustom.Show("安排成功!");
  198. int SelectIndex = this.dgvData.CurrentRow.Index;
  199. this.PublicFunctionRows();
  200. this.dgvData.Rows[SelectIndex].Selected = true;
  201. }
  202. else
  203. { MessageBoxCustom.Show("安排失败!"); }
  204. }
  205. }
  206. else
  207. { MessageBoxCustom.Show("请选择您要转接的任务!"); return; }
  208. }
  209. /// <summary>
  210. /// 任务执行
  211. /// </summary>
  212. /// <param name="sender"></param>
  213. /// <param name="e"></param>
  214. void btnTaskEcex_Click(object sender, EventArgs e)
  215. {
  216. if (this.dgvData.SelectedRows.Count > 0)
  217. {
  218. if (this.dgvData.SelectedRows.Count > 1)
  219. { MessageBoxCustom.Show("执行的任务不能选择多条!"); return; }
  220. if (!this.dgvData.SelectedRows[0].Cells["客服人员"].Value.ToString().Trim().Equals(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_Name.Trim()) && !LYFZ.BLL.BLL_ErpUser.IsAdministrator())
  221. { MessageBoxCustom.Show("只能执行自己的任务!"); return; }
  222. string StrClientGroupNumber = "";
  223. string StrClientNumber = "";
  224. string StrHospitalNumber = "";
  225. switch ((LYFZ.EnumPublic.ClientServiceTaskItem)Enum.Parse(typeof(LYFZ.EnumPublic.ClientServiceTaskItem), this.dgvData.SelectedRows[0].Cells["具体事项"].Value.ToString().Trim()))
  226. {
  227. case EnumPublic.ClientServiceTaskItem.选衣服客人:
  228. case EnumPublic.ClientServiceTaskItem.拍照客人:
  229. case EnumPublic.ClientServiceTaskItem.选片客人:
  230. case EnumPublic.ClientServiceTaskItem.看版客人:
  231. case EnumPublic.ClientServiceTaskItem.取件客人:
  232. case EnumPublic.ClientServiceTaskItem.服务客人:
  233. case EnumPublic.ClientServiceTaskItem.已定未拍:
  234. case EnumPublic.ClientServiceTaskItem.已拍未拍完:
  235. case EnumPublic.ClientServiceTaskItem.已拍未选:
  236. case EnumPublic.ClientServiceTaskItem.已修未选:
  237. case EnumPublic.ClientServiceTaskItem.已设计未看:
  238. case EnumPublic.ClientServiceTaskItem.部分回件未取:
  239. case EnumPublic.ClientServiceTaskItem.全部回件未取:
  240. case EnumPublic.ClientServiceTaskItem.接单回访:
  241. case EnumPublic.ClientServiceTaskItem.选衣回访:
  242. case EnumPublic.ClientServiceTaskItem.拍照回访:
  243. case EnumPublic.ClientServiceTaskItem.选片回访:
  244. case EnumPublic.ClientServiceTaskItem.看版回访:
  245. case EnumPublic.ClientServiceTaskItem.取件回访:
  246. case EnumPublic.ClientServiceTaskItem.服务回访:
  247. case EnumPublic.ClientServiceTaskItem.其它回访:
  248. case EnumPublic.ClientServiceTaskItem.订单意向:
  249. StrClientGroupNumber = this.dgvData.SelectedRows[0].Cells["Cst_ClientGroupNumber"].Value.ToString().Trim();
  250. break;
  251. case EnumPublic.ClientServiceTaskItem.结婚客人:
  252. case EnumPublic.ClientServiceTaskItem.结婚纪念日:
  253. case EnumPublic.ClientServiceTaskItem.客户生日:
  254. case EnumPublic.ClientServiceTaskItem.宝贝生日:
  255. case EnumPublic.ClientServiceTaskItem.转介绍客户:
  256. case EnumPublic.ClientServiceTaskItem.会员积分:
  257. case EnumPublic.ClientServiceTaskItem.孕妇周期:
  258. case EnumPublic.ClientServiceTaskItem.意向客户:
  259. StrClientNumber = this.dgvData.SelectedRows[0].Cells["Cst_ViceNumber"].Value.ToString().Trim();
  260. break;
  261. case EnumPublic.ClientServiceTaskItem.摄控医院客人:
  262. StrHospitalNumber = this.dgvData.SelectedRows[0].Cells["Cst_OrderNumber"].Value.ToString().Trim();
  263. StrClientNumber = this.dgvData.SelectedRows[0].Cells["Cst_ViceNumber"].Value.ToString().Trim();
  264. break;
  265. case EnumPublic.ClientServiceTaskItem.医院意向:
  266. StrHospitalNumber = this.dgvData.SelectedRows[0].Cells["Cst_OrderNumber"].Value.ToString().Trim();
  267. StrClientNumber = "0";
  268. break;
  269. }
  270. bool IsSaveed = false;
  271. string StrClientServiceDateTime = "";
  272. string StrCompletionRemark = "";
  273. switch ((LYFZ.EnumPublic.ClientServiceTaskItem)Enum.Parse(typeof(LYFZ.EnumPublic.ClientServiceTaskItem), this.dgvData.SelectedRows[0].Cells["具体事项"].Value.ToString().Trim()))
  274. {
  275. case EnumPublic.ClientServiceTaskItem.医院意向:
  276. case EnumPublic.ClientServiceTaskItem.摄控医院客人:
  277. LYFZ.Software.MainBusiness.HospitalTrackingSystem.AddingTrackRecord frm2 = new HospitalTrackingSystem.AddingTrackRecord();
  278. frm2.IsShowDatimeRemind = false;
  279. frm2.StrOrderNumber = StrHospitalNumber;
  280. frm2.IsGoForm = false;
  281. frm2.intDispatchDoorID = Convert.ToInt32(StrClientNumber);
  282. frm2.ShowDialog();
  283. StrClientServiceDateTime = frm2.StrClientServiceDateTime;
  284. StrCompletionRemark = frm2.StrCompletionRemark;
  285. IsSaveed = frm2.IsSaveed;
  286. break;
  287. case EnumPublic.ClientServiceTaskItem.接单回访:
  288. case EnumPublic.ClientServiceTaskItem.选衣回访:
  289. case EnumPublic.ClientServiceTaskItem.拍照回访:
  290. case EnumPublic.ClientServiceTaskItem.选片回访:
  291. case EnumPublic.ClientServiceTaskItem.看版回访:
  292. case EnumPublic.ClientServiceTaskItem.取件回访:
  293. case EnumPublic.ClientServiceTaskItem.服务回访:
  294. case EnumPublic.ClientServiceTaskItem.其它回访:
  295. LYFZ.Software.MainBusiness.CustomerSatisfactionRecord.Satisfaction.SatisfactionSurveyDetailSmallForm frm3 = new CustomerSatisfactionRecord.Satisfaction.SatisfactionSurveyDetailSmallForm();
  296. frm3.StrOrdNumber = this.dgvData.CurrentRow.Cells["Cst_OrderNumber"].Value.ToString().Trim();
  297. frm3.StrShowOrdNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  298. frm3.StrClientName = this.dgvData.CurrentRow.Cells["客户姓名"].Value.ToString().Trim();
  299. frm3.StrPhotographName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim();
  300. frm3.StrOrdViceNumber = this.dgvData.CurrentRow.Cells["Cst_ViceNumber"].Value.ToString().Trim();
  301. frm3.StrSatisfactionName = this.dgvData.SelectedRows[0].Cells["具体事项"].Value.ToString().Trim();
  302. frm3.ShowDialog();
  303. StrClientServiceDateTime = frm3.StrClientServiceDateTime;
  304. IsSaveed = frm3.IsSaveed;
  305. break;
  306. default:
  307. LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm.AddClientServiceExecTaskSuperSmallForm frm = new CameraControlBook.SuperSmallForm.AddClientServiceExecTaskSuperSmallForm();
  308. frm.StrClientNumber = StrClientNumber;
  309. frm.StrHospitalNumber = StrHospitalNumber;
  310. frm.StrClientGroupNumber = StrClientGroupNumber;
  311. frm.StrTaskType = this.dgvData.SelectedRows[0].Cells["任务类型"].Value.ToString().Trim();
  312. frm.StrTaskItem = this.dgvData.SelectedRows[0].Cells["具体事项"].Value.ToString().Trim();
  313. frm.StrTaskNumber = this.dgvData.SelectedRows[0].Cells["Cst_Number"].Value.ToString().Trim();
  314. frm.ShowDialog();
  315. StrClientServiceDateTime = frm.StrClientServiceDateTime;
  316. StrCompletionRemark = frm.StrCompletionRemark;
  317. IsSaveed = frm.IsSaveed;
  318. break;
  319. }
  320. if (IsSaveed)
  321. {
  322. DataTable dt = orbll.GetView_Custom("tb_ErpClientServiceTask", StrWhere: "ID = '" + this.dgvData.CurrentRow.Cells["ID"].Value.ToString().Trim() + "'", ShowColumnName: "*").Tables[0];
  323. LYFZ.Model.Model_ErpClientServiceTask modelCst = cstbll.DataRowToModel(dt.Rows[0]);
  324. modelCst.Cst_CompletionStatus = "OK";
  325. modelCst.Cst_CompletionIntStatus = 1;
  326. modelCst.Cst_CompletionPerson = this.StrUserID;
  327. modelCst.Cst_CompletionTime = Convert.ToDateTime(StrClientServiceDateTime);
  328. modelCst.Cst_CompletionRemark = StrCompletionRemark;
  329. modelCst.Cst_UpdateDateTime = SDateTime.Now;
  330. modelCst.Cst_UpdateName = this.StrUserID;
  331. if (cstbll.Update(modelCst))
  332. {
  333. MessageBoxCustom.Show("执行完成!");
  334. this.PublicFunctionRows();
  335. }
  336. else
  337. { MessageBoxCustom.Show("执行失败!"); }
  338. }
  339. }
  340. else
  341. { MessageBoxCustom.Show("请选择您要执行的任务!"); return; }
  342. }
  343. /// <summary>
  344. /// 关闭
  345. /// </summary>
  346. /// <param name="sender"></param>
  347. /// <param name="e"></param>
  348. void btnCloseed_Click(object sender, EventArgs e)
  349. {
  350. this.Close();
  351. }
  352. /// <summary>
  353. /// 沟通类型选项
  354. /// </summary>
  355. /// <param name="sender"></param>
  356. /// <param name="e"></param>
  357. void cmbtreevTaskType_ComboBoxTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  358. {
  359. if (!this.cmbtreevTaskType.Text.Trim().Equals("全部") && this.cmbtreevTaskType.Text.Trim().Length > 0)
  360. {
  361. string StrNodes = "全部," + LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetTaskItemSelect(this.cmbtreevTaskType.Text.Trim());
  362. if (!this.cmbtreevTaskItem.Enabled)
  363. { this.cmbtreevTaskItem.Enabled = true; }
  364. this.cmbtreevTaskItem.SetTextAndTag_ValueNull();
  365. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboxTreeView(this.cmbtreevTaskItem, StrNodes);
  366. this.cmbtreevTaskItem.TextFindTag("全部");
  367. }
  368. }
  369. /// <summary>
  370. /// 选项卡选择事件
  371. /// </summary>
  372. /// <param name="sender"></param>
  373. /// <param name="e"></param>
  374. void tabControlEx1_SelectedIndexChanged(object sender, EventArgs e)
  375. {
  376. switch (this.tabControlEx1.SelectedTab.Name.Trim())
  377. {
  378. case "tabPage_ExecIn":
  379. case "tabPage_Timeout":
  380. this.btnTaskEcex.Enabled = true;
  381. this.btnTaskUpdate.Enabled = true;
  382. this.panelDateTime.Visible = false;
  383. break;
  384. case "tabPage_TimeoutCompleted":
  385. case "tabPage_Completed":
  386. this.btnTaskEcex.Enabled = false;
  387. this.btnTaskUpdate.Enabled = false;
  388. this.panelDateTime.Visible = true;
  389. break;
  390. }
  391. this.BindComboBoxTreeViewPerson(this.tabControlEx1.SelectedIndex);
  392. this.PublicFunctionRows();
  393. }
  394. /// <summary>
  395. /// 创建行
  396. /// </summary>
  397. void PublicFunctionRows()
  398. {
  399. string StrWhere = "";
  400. bool IsShowCompletionRemark = false;
  401. switch (this.tabControlEx1.SelectedTab.Name.Trim())
  402. {
  403. case "tabPage_ExecIn": StrWhere += " And Cst_CompletionIntStatus = 0"; break;
  404. case "tabPage_Timeout": StrWhere += " And Cst_CompletionIntStatus = 0 And (Cst_TaskTermTime + 1) < getdate()"; break;
  405. case "tabPage_TimeoutCompleted": StrWhere += " And Cst_CompletionIntStatus = 1 And Cst_TaskTermTime < Cst_CompletionTime"; IsShowCompletionRemark = true; break;
  406. case "tabPage_Completed": StrWhere += " And Cst_CompletionIntStatus = 1"; IsShowCompletionRemark = true; break;
  407. }
  408. if (this.panelDateTime.Visible)
  409. {
  410. if (this.tabControlEx1.SelectedTab.Name.Trim() == "tabPage_TimeoutCompleted")
  411. {
  412. StrWhere += " And (Cst_CompletionTime between '" + this.dtDateTimeStart.DateValue + "' And '" + this.dtDateTimeEnd.DateValue + "')";
  413. }
  414. else
  415. {
  416. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetDateTime("Cst_CompletionTime", this.dtDateTimeStart.DateValue, this.dtDateTimeEnd.DateValue);
  417. }
  418. }
  419. if (this.cmbtreevTaskType.Text.Trim().Length > 0 && !this.cmbtreevTaskType.Text.Trim().Equals("全部"))
  420. { StrWhere += " And Cst_TaskModule = '" + this.cmbtreevTaskType.Text.Trim() + "'"; }
  421. if (this.cmbtreevTaskItem.Text.Trim().Length > 0 && !this.cmbtreevTaskItem.Text.Trim().Equals("全部"))
  422. { StrWhere += " And Cst_TaskItem = '" + this.cmbtreevTaskItem.Text.Trim() + "'"; }
  423. if (this.cmbtreevClientServicePerson.Text.Trim().Length > 0 && this.cmbtreevClientServicePerson.Tag != null && !this.cmbtreevClientServicePerson.Text.Trim().Equals("全部"))
  424. {
  425. StrWhere += " And Cst_ServicePerson = '" + this.cmbtreevClientServicePerson.Tag.ToString().Trim() + "'";
  426. //LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetTreeViewSelectPersonTagQueryConditionEqual(this.cmbtreevClientServicePerson, ref StrWhere, "Cst_ServicePerson", ConnectWord: "And");
  427. }
  428. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition(this.cmbQueryText.Text.Trim());
  429. DataTable dt = LYFZ.BLL.BLL_ErpOrderView.GetData_ClientServiceTask(StrWhere, IsShowCompletionRemark);
  430. this.dgvData.DataSource(dt, strHideField: "ID,Cst_Number,Cst_ClientGroupNumber,Cst_OrderNumber,Cst_ViceNumber");
  431. this.dgvData.Columns["套系价格"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
  432. this.dgvData.Columns["客户姓名"].Frozen = true;
  433. this.dgvData.Columns["拍摄名称"].Width = 180;
  434. this.dgvData.Columns["订单类型"].Width = 70;
  435. this.dgvData.Columns["客户电话"].Width = 150;
  436. this.dgvData.Columns["年龄"].Width = 50;
  437. this.dgvData.Columns["客户性别"].Width = 70;
  438. this.dgvData.Columns["客服人员"].Width = 70;
  439. this.dgvData.Columns["任务时间"].Width = 70;
  440. this.dgvData.Columns["完成状态"].Width = 70;
  441. this.dgvData.Columns["完成时间"].Width = 70;
  442. this.dgvData.Columns["套系价格"].Width = 70;
  443. if (IsShowCompletionRemark)
  444. {
  445. this.dgvData.Columns["任务说明"].Width = 250;
  446. this.dgvData.Columns["完成说明"].Width = 250;
  447. }
  448. else
  449. { this.dgvData.FillLastColumn(false); }
  450. }
  451. }
  452. }