SatisfactionSurveyMain.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. using LYFZ.Software.MainBusiness.DoorCityProcess;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace LYFZ.Software.MainBusiness.CustomerSatisfactionRecord
  12. {
  13. public partial class SatisfactionSurveyMain : LYFZ.Software.UI.CustomerSatisfactionRecord.SatisfactionSurveyMain
  14. {
  15. LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
  16. public SatisfactionSurveyMain()
  17. {
  18. this.Load += SatisfactionSurveyMain_Load;
  19. this.Shown += SatisfactionSurveyMain_Shown;
  20. this.btnQuery.Click += btnQuery_Click;
  21. this.btnSurvey.Click += btnSurvey_Click;
  22. this.btnSurveySet.Click += btnSurveySet_Click;
  23. this.btnExport.Click += btnExport_Click;
  24. this.btnClientServiceAnPai.Click += btnClientServiceAnPai_Click;
  25. this.btnClose.Click += btnClose_Click;
  26. this.tabPanel.SelectedIndexChanged += tabPanel_SelectedIndexChanged;
  27. this.Resize += SatisfactionSurveyMain_Resize;
  28. }
  29. /// <summary>
  30. /// 安排任务的任务类型
  31. /// </summary>
  32. public string StrClientServiceType = "";
  33. /// <summary>
  34. /// 窗体加载
  35. /// </summary>
  36. /// <param name="sender"></param>
  37. /// <param name="e"></param>
  38. void SatisfactionSurveyMain_Load(object sender, EventArgs e)
  39. {
  40. DataTable dt = orbll.GetView_Custom("tb_ErpSatisfactionSurveySet", StrWhere: "Sfss_Type=7").Tables[0];
  41. if (dt.Rows.Count <= 0)
  42. { this.tabPage_Other.Parent = null; }
  43. this.txtTimeStart.Text = SDateTime.Now.ToString("yyyy-MM") + "-01";
  44. this.txtTimeEnd.Text = Convert.ToDateTime(this.txtTimeStart.Text).AddMonths(1).AddSeconds(-1).ToString();
  45. }
  46. /// <summary>
  47. /// 窗体加载
  48. /// </summary>
  49. /// <param name="sender"></param>
  50. /// <param name="e"></param>
  51. void SatisfactionSurveyMain_Shown(object sender, EventArgs e)
  52. {
  53. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st013");
  54. this.PublicFunctionRights();
  55. // 权限设置
  56. this.btnSurvey.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CustomerSatisfactionRecordCompetence, CustomAttributes.OperatingAuthority.SatisfactionSurvey);
  57. this.btnSurveySet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CustomerSatisfactionRecordCompetence, CustomAttributes.OperatingAuthority.SatisfactionSurveySet);
  58. if (this.StrClientServiceType.Trim().Length > 0)
  59. {
  60. TabPage strTabName = null;
  61. switch (this.StrClientServiceType.Trim())
  62. {
  63. case "接单回访": strTabName = this.tabPage_OrderPerson; break;
  64. case "选衣回访": strTabName = this.tabPage_SelectedClothing; break;
  65. case "拍照回访": strTabName = this.tabPage_Photograph; break;
  66. case "选片回访": strTabName = this.tabPage_SelectionFilm; break;
  67. case "看版回访": strTabName = this.tabPage_LookDesign; break;
  68. case "取件回访": strTabName = this.tabPage_Pickup; break;
  69. case "服务回访": strTabName = this.tabPage_Service; break;
  70. case "其它回访": strTabName = this.tabPage_Other; break;
  71. }
  72. if (strTabName != null && this.tabPanel.Contains(strTabName))
  73. {
  74. this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
  75. this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
  76. this.tabPanel.SelectedTab = strTabName;
  77. }
  78. }
  79. this.PublicFunctionRows();
  80. List<Control> hideControls= new List<Control>();
  81. hideControls.Add(btnSurveySet);
  82. List<Control> moveControls= new List<Control>();
  83. moveControls.Add(btnClientServiceAnPai);
  84. moveControls.Add(btnExport);
  85. moveControls.Add(btnClose);
  86. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(VersionControl.VersionFunctionEnum.客服中心回访调查自定义回访项目,hideControls,null,null);
  87. hideControls= new List<Control>();
  88. hideControls.Add(btnClientServiceAnPai);
  89. LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(VersionControl.VersionFunctionEnum.客服中心客服安排, hideControls,null,null);
  90. bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.客服中心回访调查近期服务回访);
  91. if(!b)
  92. {
  93. this.Close();
  94. }
  95. }
  96. /// <summary>
  97. /// 查询
  98. /// </summary>
  99. /// <param name="sender"></param>
  100. /// <param name="e"></param>
  101. void btnQuery_Click(object sender, EventArgs e)
  102. {
  103. this.PublicFunctionRows();
  104. }
  105. /// <summary>
  106. /// 调查
  107. /// </summary>
  108. /// <param name="sender"></param>
  109. /// <param name="e"></param>
  110. void btnSurvey_Click(object sender, EventArgs e)
  111. {
  112. if (this.dgvData.Rows.Count > 0)
  113. {
  114. if (this.dgvData.CurrentRow != null)
  115. {
  116. LYFZ.Software.MainBusiness.CustomerSatisfactionRecord.Satisfaction.SatisfactionSurveyDetailSmallForm frm = new Satisfaction.SatisfactionSurveyDetailSmallForm();
  117. frm.StrOrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
  118. frm.StrShowOrdNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
  119. frm.StrClientName = this.dgvData.CurrentRow.Cells["客户姓名"].Value.ToString().Trim();
  120. if (this.dgvData.Columns["拍摄名称"] != null)
  121. { frm.StrPhotographName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
  122. if (this.dgvData.Columns["Ordv_ViceNumber"] != null)
  123. { frm.StrOrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(); }
  124. string[] strArray = this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim().Split('_');
  125. frm.StrSatisfactionID = strArray[1].Trim();
  126. frm.ShowDialog();
  127. if (frm.IsSaveed)
  128. { this.PublicFunctionRows(); }
  129. }
  130. }
  131. }
  132. /// <summary>
  133. /// 设置
  134. /// </summary>
  135. /// <param name="sender"></param>
  136. /// <param name="e"></param>
  137. void btnSurveySet_Click(object sender, EventArgs e)
  138. {
  139. LYFZ.Software.MainBusiness.CustomerSatisfactionRecord.Satisfaction.FrmCustomerSatisfactionSet frm = new Satisfaction.FrmCustomerSatisfactionSet();
  140. frm.ShowDialog();
  141. }
  142. /// <summary>
  143. /// 导出
  144. /// </summary>
  145. /// <param name="sender"></param>
  146. /// <param name="e"></param>
  147. void btnExport_Click(object sender, EventArgs e)
  148. {
  149. this.dgvData.ExportDataTable();
  150. }
  151. /// <summary>
  152. /// 安排客服
  153. /// </summary>
  154. /// <param name="sender"></param>
  155. /// <param name="e"></param>
  156. void btnClientServiceAnPai_Click(object sender, EventArgs e)
  157. {
  158. if (this.dgvData.SelectedRows.Count > 0)
  159. {
  160. LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
  161. frm.ShowDialog();
  162. if (frm.IsSaveed)
  163. {
  164. LYFZ.EnumPublic.ClientServiceTaskItem ClientServiceAnPai;
  165. switch (this.tabPanel.SelectedTab.Name.Trim())
  166. {
  167. case "tabPage_SelectedClothing":
  168. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选衣回访;
  169. break;
  170. case "tabPage_Photograph":
  171. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.拍照回访;
  172. break;
  173. case "tabPage_SelectionFilm":
  174. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选片回访;
  175. break;
  176. case "tabPage_LookDesign":
  177. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.看版回访;
  178. break;
  179. case "tabPage_Pickup":
  180. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.取件回访;
  181. break;
  182. case "tabPage_Service":
  183. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.服务回访;
  184. break;
  185. case "tabPage_Other":
  186. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.其它回访;
  187. break;
  188. default:
  189. ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.接单回访;
  190. break;
  191. }
  192. LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ClientServiceAnPai(this.dgvData, LYFZ.EnumPublic.ClientServiceTaskType.满意度回访, frm.model, ClientServiceAnPai);
  193. }
  194. }
  195. }
  196. /// <summary>
  197. /// 关闭
  198. /// </summary>
  199. /// <param name="sender"></param>
  200. /// <param name="e"></param>
  201. void btnClose_Click(object sender, EventArgs e)
  202. {
  203. this.Close();
  204. }
  205. /// <summary>
  206. /// 选项卡选择事件
  207. /// </summary>
  208. /// <param name="sender"></param>
  209. /// <param name="e"></param>
  210. void tabPanel_SelectedIndexChanged(object sender, EventArgs e)
  211. {
  212. this.PublicFunctionRows();
  213. }
  214. /// <summary>
  215. /// 窗体大小发生变化
  216. /// </summary>
  217. /// <param name="sender"></param>
  218. /// <param name="e"></param>
  219. void SatisfactionSurveyMain_Resize(object sender, EventArgs e)
  220. {
  221. switch (this.btnClose.Location.Y)
  222. {
  223. case 3:
  224. this.flowLayoutPanel1.Height = 36;
  225. break;
  226. case 38:
  227. this.flowLayoutPanel1.Height = 72;
  228. break;
  229. }
  230. }
  231. /// <summary>
  232. /// 点击列标头排序
  233. /// </summary>
  234. /// <param name="sender"></param>
  235. /// <param name="e"></param>
  236. void dgvData_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
  237. {
  238. if (e.Button == MouseButtons.Left)
  239. {
  240. this.PublicFunctionRows();
  241. }
  242. }
  243. /// <summary>
  244. /// 双击调查
  245. /// </summary>
  246. /// <param name="sender"></param>
  247. /// <param name="e"></param>
  248. void dgvData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  249. {
  250. if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
  251. { this.btnSurvey_Click(this, null); }
  252. }
  253. /// <summary>
  254. /// 创建行
  255. /// </summary>
  256. private void PublicFunctionRows()
  257. {
  258. if (this.txtTimeStart.DateValue.Trim().Length > 0 && this.txtTimeEnd.DateValue.Trim().Length > 0)
  259. {
  260. if (Convert.ToDateTime(this.txtTimeStart.DateValue) > Convert.ToDateTime(this.txtTimeEnd.DateValue))
  261. { MessageBoxCustom.Show("开始日期不能大于结束日期!"); return; }
  262. }
  263. else if (this.cmbQueryText.Text.Trim().Length == 0)
  264. { MessageBoxCustom.Show("日期不能为空!"); return; }
  265. switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
  266. {
  267. case "tabPage_OrderPerson":
  268. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyOrderPerson(this.dgvData, this.GetWhereStr());
  269. break;
  270. case "tabPage_SelectedClothing":
  271. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveySelectDress(this.dgvData, this.GetWhereStr());
  272. break;
  273. case "tabPage_Photograph":
  274. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyPhotograph(this.dgvData, this.GetWhereStr());
  275. break;
  276. case "tabPage_SelectionFilm":
  277. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyFilmSelection(this.dgvData, this.GetWhereStr());
  278. break;
  279. case "tabPage_LookDesign":
  280. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyLookDesign(this.dgvData, this.GetWhereStr());
  281. break;
  282. case "tabPage_Pickup":
  283. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyTotakePiece(this.dgvData, this.GetWhereStr());
  284. break;
  285. case "tabPage_Service":
  286. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyService(this.dgvData, this.GetWhereStr());
  287. break;
  288. case "tabPage_Other":
  289. LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyOther(this.dgvData, this.GetWhereStr());
  290. break;
  291. }
  292. }
  293. void PublicFunctionRights()
  294. {
  295. //this.btnMonthPieces.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePiece);
  296. //this.btnNotAlreadySentBack.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePieceSentNotBack);
  297. //this.btnMonthRework.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePieceMonthRework);
  298. }
  299. /// <summary>
  300. /// 返回要操作的条件
  301. /// </summary>
  302. /// <returns></returns>
  303. private string GetWhereStr()
  304. {
  305. string StrWhere = "";
  306. if (!string.IsNullOrEmpty(this.cmbQueryText.Text.Trim()))
  307. { StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition(cmbQueryText.Text.Trim()); }
  308. else
  309. {
  310. string StrColumnTimeName = "";
  311. switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
  312. {
  313. case "tabPage_OrderPerson":
  314. StrColumnTimeName = "Ord_SaveOrderDateTime";
  315. break;
  316. case "tabPage_SelectedClothing":
  317. StrColumnTimeName = "Ordv_ClothingTime";
  318. break;
  319. case "tabPage_Photograph":
  320. StrColumnTimeName = "Ords_PhotographMaxTime";
  321. break;
  322. case "tabPage_SelectionFilm":
  323. StrColumnTimeName = "Ordv_FilmSelectionTime";
  324. break;
  325. case "tabPage_LookDesign":
  326. StrColumnTimeName = "Ordv_LookDesignTime";
  327. break;
  328. case "tabPage_Pickup":
  329. StrColumnTimeName = "Ords_ProductPickupTime";
  330. break;
  331. case "tabPage_Service":
  332. StrColumnTimeName = "Ords_ServiceMaxTime";
  333. break;
  334. case "tabPage_Other":
  335. StrColumnTimeName = "Ord_SaveOrderDateTime";
  336. break;
  337. }
  338. if (!string.IsNullOrEmpty(StrColumnTimeName))
  339. { StrWhere += PublicCodeClasses.GetDateTime(StrColumnTimeName, this.txtTimeStart.Text, this.txtTimeEnd.Text); }
  340. if(!cmbtreevStoreName.Text.Equals("全部"))
  341. {
  342. if(StrWhere!="")
  343. {
  344. StrWhere += " and ";
  345. }
  346. StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop","");
  347. }
  348. }
  349. return StrWhere;
  350. }
  351. /// <summary>
  352. /// 定义列表属性
  353. /// </summary>
  354. public LYFZ.ComponentLibrary.DataGridViewEc dgvData
  355. {
  356. get
  357. {
  358. switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
  359. {
  360. case "tabPage_SelectedClothing":
  361. return this.dgvData_SelectedClothing;
  362. case "tabPage_Photograph":
  363. return this.dgvData_Photograph;
  364. case "tabPage_SelectionFilm":
  365. return this.dgvData_SelectionFilm;
  366. case "tabPage_LookDesign":
  367. return this.dgvData_LookDesign;
  368. case "tabPage_Pickup":
  369. return this.dgvData_Pickup;
  370. case "tabPage_Service":
  371. return this.dgvData_Service;
  372. case "tabPage_Other":
  373. return this.dgvData_Other;
  374. default: return this.dgvData_OrderPerson;
  375. }
  376. }
  377. set
  378. {
  379. switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
  380. {
  381. case "tabPage_OrderPerson":
  382. this.dgvData_OrderPerson = value;
  383. break;
  384. case "tabPage_SelectedClothing":
  385. this.dgvData_SelectedClothing = value;
  386. break;
  387. case "tabPage_Photograph":
  388. this.dgvData_Photograph = value;
  389. break;
  390. case "tabPage_SelectionFilm":
  391. this.dgvData_SelectionFilm = value;
  392. break;
  393. case "tabPage_LookDesign":
  394. this.dgvData_LookDesign = value;
  395. break;
  396. case "tabPage_Pickup":
  397. this.dgvData_Pickup = value;
  398. break;
  399. case "tabPage_Service":
  400. this.dgvData_Service = value;
  401. break;
  402. case "tabPage_Other":
  403. this.dgvData_Other = value;
  404. break;
  405. }
  406. }
  407. }
  408. }
  409. }