123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421 |
- using LYFZ.Software.MainBusiness.DoorCityProcess;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.CustomerSatisfactionRecord
- {
- public partial class SatisfactionSurveyMain : LYFZ.Software.UI.CustomerSatisfactionRecord.SatisfactionSurveyMain
- {
- LYFZ.BLL.BLL_ErpOrder orbll = new BLL.BLL_ErpOrder();
- public SatisfactionSurveyMain()
- {
- this.Load += SatisfactionSurveyMain_Load;
- this.Shown += SatisfactionSurveyMain_Shown;
- this.btnQuery.Click += btnQuery_Click;
- this.btnSurvey.Click += btnSurvey_Click;
- this.btnSurveySet.Click += btnSurveySet_Click;
- this.btnExport.Click += btnExport_Click;
- this.btnClientServiceAnPai.Click += btnClientServiceAnPai_Click;
- this.btnClose.Click += btnClose_Click;
- this.tabPanel.SelectedIndexChanged += tabPanel_SelectedIndexChanged;
- this.Resize += SatisfactionSurveyMain_Resize;
- }
- /// <summary>
- /// 安排任务的任务类型
- /// </summary>
- public string StrClientServiceType = "";
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void SatisfactionSurveyMain_Load(object sender, EventArgs e)
- {
- DataTable dt = orbll.GetView_Custom("tb_ErpSatisfactionSurveySet", StrWhere: "Sfss_Type=7").Tables[0];
- if (dt.Rows.Count <= 0)
- { this.tabPage_Other.Parent = null; }
- this.txtTimeStart.Text = SDateTime.Now.ToString("yyyy-MM") + "-01";
- this.txtTimeEnd.Text = Convert.ToDateTime(this.txtTimeStart.Text).AddMonths(1).AddSeconds(-1).ToString();
- }
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void SatisfactionSurveyMain_Shown(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindGroupStoreName(this.cmbtreevStoreName, StrGroupKeyCode: "retailProcess", StrKeyCode: "st013");
- this.PublicFunctionRights();
- // 权限设置
- this.btnSurvey.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CustomerSatisfactionRecordCompetence, CustomAttributes.OperatingAuthority.SatisfactionSurvey);
- this.btnSurveySet.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.CustomerSatisfactionRecordCompetence, CustomAttributes.OperatingAuthority.SatisfactionSurveySet);
- if (this.StrClientServiceType.Trim().Length > 0)
- {
- TabPage strTabName = null;
- switch (this.StrClientServiceType.Trim())
- {
- case "接单回访": strTabName = this.tabPage_OrderPerson; break;
- case "选衣回访": strTabName = this.tabPage_SelectedClothing; break;
- case "拍照回访": strTabName = this.tabPage_Photograph; break;
- case "选片回访": strTabName = this.tabPage_SelectionFilm; break;
- case "看版回访": strTabName = this.tabPage_LookDesign; break;
- case "取件回访": strTabName = this.tabPage_Pickup; break;
- case "服务回访": strTabName = this.tabPage_Service; break;
- case "其它回访": strTabName = this.tabPage_Other; break;
- }
- if (strTabName != null && this.tabPanel.Contains(strTabName))
- {
- this.Location = new Point(LYFZ.EnumPublic.FormLocation_X, LYFZ.EnumPublic.FormLocation_Y);
- this.Size = new Size(LYFZ.EnumPublic.FormSize_Width, LYFZ.EnumPublic.FormSize_Height);
- this.tabPanel.SelectedTab = strTabName;
- }
- }
- this.PublicFunctionRows();
- List<Control> hideControls= new List<Control>();
- hideControls.Add(btnSurveySet);
- List<Control> moveControls= new List<Control>();
- moveControls.Add(btnClientServiceAnPai);
- moveControls.Add(btnExport);
- moveControls.Add(btnClose);
- LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(VersionControl.VersionFunctionEnum.客服中心回访调查自定义回访项目,hideControls,null,null);
- hideControls= new List<Control>();
- hideControls.Add(btnClientServiceAnPai);
- LYFZ.Software.MainBusiness.VersionControl.StaticVersion.BindVersionShowHideControl(VersionControl.VersionFunctionEnum.客服中心客服安排, hideControls,null,null);
-
- bool b = LYFZ.Software.MainBusiness.VersionControl.StaticVersion.UIFunctionVersion(VersionControl.VersionFunctionEnum.客服中心回访调查近期服务回访);
- if(!b)
- {
- this.Close();
- }
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnQuery_Click(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 调查
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSurvey_Click(object sender, EventArgs e)
- {
- if (this.dgvData.Rows.Count > 0)
- {
- if (this.dgvData.CurrentRow != null)
- {
- LYFZ.Software.MainBusiness.CustomerSatisfactionRecord.Satisfaction.SatisfactionSurveyDetailSmallForm frm = new Satisfaction.SatisfactionSurveyDetailSmallForm();
- frm.StrOrdNumber = this.dgvData.CurrentRow.Cells["Ord_Number"].Value.ToString().Trim();
- frm.StrShowOrdNumber = this.dgvData.CurrentRow.Cells["订单号"].Value.ToString().Trim();
- frm.StrClientName = this.dgvData.CurrentRow.Cells["客户姓名"].Value.ToString().Trim();
- if (this.dgvData.Columns["拍摄名称"] != null)
- { frm.StrPhotographName = this.dgvData.CurrentRow.Cells["拍摄名称"].Value.ToString().Trim(); }
- if (this.dgvData.Columns["Ordv_ViceNumber"] != null)
- { frm.StrOrdViceNumber = this.dgvData.CurrentRow.Cells["Ordv_ViceNumber"].Value.ToString().Trim(); }
- string[] strArray = this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim().Split('_');
- frm.StrSatisfactionID = strArray[1].Trim();
- frm.ShowDialog();
- if (frm.IsSaveed)
- { this.PublicFunctionRows(); }
- }
- }
- }
- /// <summary>
- /// 设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSurveySet_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.CustomerSatisfactionRecord.Satisfaction.FrmCustomerSatisfactionSet frm = new Satisfaction.FrmCustomerSatisfactionSet();
- frm.ShowDialog();
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnExport_Click(object sender, EventArgs e)
- {
- this.dgvData.ExportDataTable();
- }
- /// <summary>
- /// 安排客服
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClientServiceAnPai_Click(object sender, EventArgs e)
- {
- if (this.dgvData.SelectedRows.Count > 0)
- {
- LYFZ.Software.MainBusiness.DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm frm = new DoorCityProcess.SetSmallForm.ClientServiceTaskAnPaiSmallForm();
- frm.ShowDialog();
- if (frm.IsSaveed)
- {
- LYFZ.EnumPublic.ClientServiceTaskItem ClientServiceAnPai;
- switch (this.tabPanel.SelectedTab.Name.Trim())
- {
- case "tabPage_SelectedClothing":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选衣回访;
- break;
- case "tabPage_Photograph":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.拍照回访;
- break;
- case "tabPage_SelectionFilm":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.选片回访;
- break;
- case "tabPage_LookDesign":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.看版回访;
- break;
- case "tabPage_Pickup":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.取件回访;
- break;
- case "tabPage_Service":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.服务回访;
- break;
- case "tabPage_Other":
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.其它回访;
- break;
- default:
- ClientServiceAnPai = EnumPublic.ClientServiceTaskItem.接单回访;
- break;
- }
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.ClientServiceAnPai(this.dgvData, LYFZ.EnumPublic.ClientServiceTaskType.满意度回访, frm.model, ClientServiceAnPai);
- }
- }
- }
- /// <summary>
- /// 关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 选项卡选择事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void tabPanel_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.PublicFunctionRows();
- }
- /// <summary>
- /// 窗体大小发生变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void SatisfactionSurveyMain_Resize(object sender, EventArgs e)
- {
- switch (this.btnClose.Location.Y)
- {
- case 3:
- this.flowLayoutPanel1.Height = 36;
- break;
- case 38:
- this.flowLayoutPanel1.Height = 72;
- break;
- }
- }
- /// <summary>
- /// 点击列标头排序
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- this.PublicFunctionRows();
- }
- }
- /// <summary>
- /// 双击调查
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void dgvData_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
- {
- if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
- { this.btnSurvey_Click(this, null); }
- }
- /// <summary>
- /// 创建行
- /// </summary>
- private void PublicFunctionRows()
- {
- if (this.txtTimeStart.DateValue.Trim().Length > 0 && this.txtTimeEnd.DateValue.Trim().Length > 0)
- {
- if (Convert.ToDateTime(this.txtTimeStart.DateValue) > Convert.ToDateTime(this.txtTimeEnd.DateValue))
- { MessageBoxCustom.Show("开始日期不能大于结束日期!"); return; }
- }
- else if (this.cmbQueryText.Text.Trim().Length == 0)
- { MessageBoxCustom.Show("日期不能为空!"); return; }
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tabPage_OrderPerson":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyOrderPerson(this.dgvData, this.GetWhereStr());
- break;
- case "tabPage_SelectedClothing":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveySelectDress(this.dgvData, this.GetWhereStr());
- break;
- case "tabPage_Photograph":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyPhotograph(this.dgvData, this.GetWhereStr());
- break;
- case "tabPage_SelectionFilm":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyFilmSelection(this.dgvData, this.GetWhereStr());
- break;
- case "tabPage_LookDesign":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyLookDesign(this.dgvData, this.GetWhereStr());
- break;
- case "tabPage_Pickup":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyTotakePiece(this.dgvData, this.GetWhereStr());
- break;
- case "tabPage_Service":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyService(this.dgvData, this.GetWhereStr());
- break;
- case "tabPage_Other":
- LYFZ.ComponentLibrary.DataGridOrderView.GetData_SatisfactionSurveyOther(this.dgvData, this.GetWhereStr());
- break;
- }
- }
- void PublicFunctionRights()
- {
- //this.btnMonthPieces.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePiece);
- //this.btnNotAlreadySentBack.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePieceSentNotBack);
- //this.btnMonthRework.Enabled = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupStoreRights(this.cmbtreevStoreName, "StoresTotakePiece", LYFZ.CustomAttributes.OperatingAuthority.TotakePieceMonthRework);
- }
- /// <summary>
- /// 返回要操作的条件
- /// </summary>
- /// <returns></returns>
- private string GetWhereStr()
- {
- string StrWhere = "";
- if (!string.IsNullOrEmpty(this.cmbQueryText.Text.Trim()))
- { StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetQueryTextQueryCondition(cmbQueryText.Text.Trim()); }
- else
- {
- string StrColumnTimeName = "";
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tabPage_OrderPerson":
- StrColumnTimeName = "Ord_SaveOrderDateTime";
- break;
- case "tabPage_SelectedClothing":
- StrColumnTimeName = "Ordv_ClothingTime";
- break;
- case "tabPage_Photograph":
- StrColumnTimeName = "Ords_PhotographMaxTime";
- break;
- case "tabPage_SelectionFilm":
- StrColumnTimeName = "Ordv_FilmSelectionTime";
- break;
- case "tabPage_LookDesign":
- StrColumnTimeName = "Ordv_LookDesignTime";
- break;
- case "tabPage_Pickup":
- StrColumnTimeName = "Ords_ProductPickupTime";
- break;
- case "tabPage_Service":
- StrColumnTimeName = "Ords_ServiceMaxTime";
- break;
- case "tabPage_Other":
- StrColumnTimeName = "Ord_SaveOrderDateTime";
- break;
- }
- if (!string.IsNullOrEmpty(StrColumnTimeName))
- { StrWhere += PublicCodeClasses.GetDateTime(StrColumnTimeName, this.txtTimeStart.Text, this.txtTimeEnd.Text); }
- if(!cmbtreevStoreName.Text.Equals("全部"))
- {
- if(StrWhere!="")
- {
- StrWhere += " and ";
- }
- StrWhere += LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.GetGroupQueryWhere(this.cmbtreevStoreName, "Ord_DividedShop","");
- }
- }
- return StrWhere;
- }
- /// <summary>
- /// 定义列表属性
- /// </summary>
- public LYFZ.ComponentLibrary.DataGridViewEc dgvData
- {
- get
- {
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tabPage_SelectedClothing":
- return this.dgvData_SelectedClothing;
- case "tabPage_Photograph":
- return this.dgvData_Photograph;
- case "tabPage_SelectionFilm":
- return this.dgvData_SelectionFilm;
- case "tabPage_LookDesign":
- return this.dgvData_LookDesign;
- case "tabPage_Pickup":
- return this.dgvData_Pickup;
- case "tabPage_Service":
- return this.dgvData_Service;
- case "tabPage_Other":
- return this.dgvData_Other;
- default: return this.dgvData_OrderPerson;
- }
- }
- set
- {
- switch (this.tabPanel.TabPages[this.tabPanel.SelectedIndex].Name.Trim())
- {
- case "tabPage_OrderPerson":
- this.dgvData_OrderPerson = value;
- break;
- case "tabPage_SelectedClothing":
- this.dgvData_SelectedClothing = value;
- break;
- case "tabPage_Photograph":
- this.dgvData_Photograph = value;
- break;
- case "tabPage_SelectionFilm":
- this.dgvData_SelectionFilm = value;
- break;
- case "tabPage_LookDesign":
- this.dgvData_LookDesign = value;
- break;
- case "tabPage_Pickup":
- this.dgvData_Pickup = value;
- break;
- case "tabPage_Service":
- this.dgvData_Service = value;
- break;
- case "tabPage_Other":
- this.dgvData_Other = value;
- break;
- }
- }
- }
- }
- }
|