| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using com.hnshituo.pur.vo;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Infragistics.Win.UltraWinGrid;
- using Pur.configure;
- using Pur.Entity;
- using Pur.Entity.configureEntity;
- using Pur.Entity.pur_orderEntiy;
- using Pur.Entity.pur_planEntity;
- namespace Pur.pur_plan
- {
- public partial class FrmTaskRecordManage : FrmPmsBase
- {
- public FrmTaskRecordManage()
- {
- InitializeComponent();
- }
- private void FrmTaskRecordManage_Load(object sender, EventArgs e)
- {
- if (this.CustomInfo == "2")//评单人员
- {
- //this.ToolBarItemEnable(this, "doChange", false);
- //this.ToolBarItemEnable(this, "doDelete", false);
- ultraExpandableGroupBox3.Visible = false;
- }
- if (this.CustomInfo == "1")//公开采购管理员
- {
- //this.ToolBarItemEnable(this, "doQuery", true);
- //this.ToolBarItemEnable(this, "doChange", true);
- //this.ToolBarItemEnable(this, "doDelete", true);
- this.ToolBarItemEnable(this, "doRecord", true);
- this.ToolBarItemEnable(this, "cancelRecord", true);
- //this.ToolBarItemEnable(this, "doExit", true);
- //this.ToolBarItemEnable(this, "doPrint", true);
- //this.ToolBarItemEnable(this, "doCreate", true);
- //this.ToolBarItemEnable(this, "cancelCreate", true);
- jy_negDate.ReadOnly = false;
- jy_procRecord.ReadOnly = false;
- //ultraExpandableGroupBox3.Visible = false;
- ultraExpandableGroupBox3.Expanded = true;
- }
- //初始化查询区域
- txt_createTimeStart.Value = DateTime.Now.AddMonths(-1);
- txt_createTimeEnd.Value = DateTime.Now.AddDays(1);
- ck_ctime.Checked = false;
- ck_isAll.Checked = false;
- txt_createTimeStart.Enabled = false;
- txt_createTimeEnd.Enabled = false;
- GridHelper.SetExcludeColumnsActive(ultraGrid1.DisplayLayout.Bands[0], new string[] { });
- GridHelper.SetExcludeColumnsActive(ultraGrid2.DisplayLayout.Bands[0], new string[] { });
- GridHelper.SetExcludeColumnsActive(ultraGrid3.DisplayLayout.Bands[0], new string[] { });
- GridHelper.SetExcludeColumnsActive(ultraGrid3.DisplayLayout.Bands[1], new string[] { });
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "doQuery": // 查询
- doQuery();
- break;
- case "doChange": // 修改
- doChange();
- break;
- case "doDelete": // 删除
- doDelete();
- break;
- case "doRecord": // 评单
- doRecord();
- break;
- case "cancelRecord": // 撤销评单
- cancelRecord();
- break;
- case "doExit": // 退出
- this.Close();
- break;
- case "doPrint": // 打印
- doPrint();
- break;
- case "doCreate": // 纪要确认
- doCreate();
- break;
- case "doAddRecord": // 纪要生成
- doAddRecord();
- break;
- case "cancelCreate": // 取消纪要生成
- cancelCreate();
- break;
- }
- }
- //查询
- private void doQuery()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- ClearTab1();
- ClearTab2();
- dataSet1.Clear();
- dataSet2.Clear();
- dataSet3.Clear();
- PurTaskMEntity entity = new PurTaskMEntity();
- if (txt_taskId.Text.Trim() != "")
- {
- entity.TaskId = txt_taskId.Text.Trim();
- }
- if (ck_isAll.Checked==false)
- {
- entity.Status = "1";//查询评审中和生成采购纪要
- }
- if (txt_taskName.Text.Trim()!="")
- {
- entity.TaskName = txt_taskName.Text.Trim();
- }
- entity.Validflag = "1";
- if (ck_ctime.Checked)
- {
- if (txt_createTimeStart.Text != "")
- {
- entity.CreateTime = Convert.ToDateTime(txt_createTimeStart.Value);
- }
- if (txt_createTimeEnd.Text != "")
- {
- entity.UpdateTime = Convert.ToDateTime(txt_createTimeEnd.Value);
- }
- }
- if (this.CustomInfo == "2")//评单人员
- {
- entity.DeleteName = "2";
- entity.CreateUserid = UserInfo.GetUserID();
- }
- if (this.CustomInfo == "1")//公开采购管理员
- {
- entity.DeleteName = "1";
- }
- //PurTaskRecordEntity record = new PurTaskRecordEntity();
- //record.TaskId = txt_taskId.Text.ToString().Trim();
- //record.Id = txt_taskName.Text.ToString().Trim();
- //if (ck_ctime.Checked)
- //{
- // if (txt_createTimeStart.Text != "")
- // {
- // record.CreateTime = Convert.ToDateTime(txt_createTimeStart.Value);
- // }
- // if (txt_createTimeEnd.Text != "")
- // {
- // record.UpdateTime = Convert.ToDateTime(txt_createTimeEnd.Value);
- // }
- //}
- //record.CreateUserid = UserInfo.GetUserID();
- //if (this.CustomInfo == "2")//评单人员
- //{
- // record.DeleteName = "2";
- //}
- //if (this.CustomInfo == "1")//公开采购管理员
- //{
- // record.DeleteName = "1";
- //}
- DataTable taskList = this.execute<DataTable>("com.hnshituo.pur.purplan.service.TaskMService", "getTaskList", new object[] { entity });
- GridHelper.CopyDataToDatatable(taskList, dataTable1, true);
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("初始化加载数据失败:"+ex.Message);
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- //新增纪要
- private void doAddRecord()
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择待评审任务单!");
- }
- string strTaskid = ultraGrid1.ActiveRow.GetCellValue("Taskid").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskid))
- {
- MessageUtil.ShowTips("选择的评审任务单单号为空!");
- }
- if (testStatus(strTaskid, 0) == false)
- {
- return;
- }
- PurTaskRecordEntity TkR = new PurTaskRecordEntity();
- TkR.Validflag = "1";
- TkR.Status = "2";
- TkR.CreateName = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
- TkR.CreateTime = DateTime.Now;
- TkR.CreateUserid = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserID();
- TkR.BuyerUserid = UserInfo.GetUserID();
- TkR.BuyerUsername = UserInfo.GetUserName();
- TkR.MngOrgId = UserInfo.GetDeptid();
- TkR.MngOrgName = UserInfo.GetDepartment();
- if (jy_negDate.Text == "")
- {
- MessageUtil.ShowTips("谈判日期不能为空!");
- jy_negDate.Focus();
- return;
- }
- TkR.NegDate = Convert.ToDateTime(jy_negDate.Value);
- TkR.TaskId = jy_taskId.Text.Trim();
- TkR.TaskName = jy_taskName.Text.Trim();
- if (String.IsNullOrEmpty(jy_procRecord.Text.Trim()))
- {
- MessageUtil.ShowTips("纪要过程不能为空!");
- jy_procRecord.Focus();
- return;
- }
- TkR.ProcRecord = jy_procRecord.Text.Trim();
- if (MessageUtil.ShowYesNoAndQuestion("确定为该任务单生成采购纪要?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskRecordService", "doInsert_Record", new object[] { TkR });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("新增采购纪要失败!" + crt.Resultmsg);
- return;
- }
- else
- {
- MessageUtil.ShowTips("操作成功:生成采购纪要:" + crt.Resultmsg);
- doQuery();
- require_plan.comm.doActiveSelRow(ultraGrid1, "taskId", TkR.TaskId);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败!" + ex.Message);
- }
- }
- //修改纪要
- private void doChange()
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择评审单!");
- }
- string strTaskId = ultraGrid1.ActiveRow.GetCellValue("TaskId").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskId))
- {
- MessageUtil.ShowTips("选择的任务单单号为空!");
- }
- if (testStatus(strTaskId, 2) == false)
- {
- return;
- }
- PurTaskRecordEntity record = new PurTaskRecordEntity();
- record.Id = jy_RecordId.Text.Trim();
- if(jy_negDate.Text=="")
- {
-
- MessageUtil.ShowTips("谈判日期不能为空!");
- jy_negDate.Focus();
- }
- record.NegDate = Convert.ToDateTime(jy_negDate.Value);
- if (String.IsNullOrEmpty(jy_procRecord.Text))
- {
- MessageUtil.ShowTips("纪要内容不能为空!");
- jy_procRecord.Focus();
- }
- record.ProcRecord = jy_procRecord.Text.ToString().Trim();
- record.UpdateName = UserInfo.GetUserName();
- record.UpdateTime = DateTime.Now;
- record.UpdateUserid = UserInfo.GetUserID();
- if (MessageUtil.ShowYesNoAndQuestion("确定修改纪要:" + record.Id + "?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskRecordService", "doUpdate", new object[] { record });
- if (crt.Resultcode == 0)
- {
- MessageUtil.ShowTips("操作成功!");
- doQuery();
- require_plan.comm.doActiveSelRow(ultraGrid1, "taskId", strTaskId);
- }
- else
- {
- MessageUtil.ShowTips("操作失败!" + crt.Resultmsg);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败!" + ex.Message);
- }
- }
- //纪要生效
- private void doCreate()
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择任务单!");
- }
- string strTaskId = ultraGrid1.ActiveRow.GetCellValue("TaskId").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskId))
- {
- MessageUtil.ShowTips("选择的任务单单号为空!");
- }
- if (testStatus(strTaskId, 2) == false)
- {
- return;
- }
- PurTaskRecordEntity record = new PurTaskRecordEntity();
- record.Id = jy_RecordId.Text.Trim();
- record.Status = "3";
- if (MessageUtil.ShowYesNoAndQuestion("确定生效该采购纪要?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskRecordService", "doEffect_Record", new object[] { record });
- if (crt.Resultcode == 0)
- {
- MessageUtil.ShowTips("操作成功!");
- doQuery();
- require_plan.comm.doActiveSelRow(ultraGrid1, "taskId", strTaskId);
- }
- else
- {
- MessageUtil.ShowTips("操作失败!" + crt.Resultmsg);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败!" + ex.Message);
- }
- }
- //纪要撤回
- private void cancelCreate()
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择评审单!");
- }
- string strTaskId = ultraGrid1.ActiveRow.GetCellValue("TaskId").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskId))
- {
- MessageUtil.ShowTips("选择的任务单单号为空!");
- }
- if (testStatus(strTaskId, 4) == false)
- {
- return;
- }
- PurTaskRecordEntity record = new PurTaskRecordEntity();
- record.Id = jy_RecordId.Text.Trim();
- record.Status = "2";
- if (MessageUtil.ShowYesNoAndQuestion("确定撤销该采购纪要?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskRecordService", "doEffect_Record", new object[] { record});
- if (crt.Resultcode == 0)
- {
- MessageUtil.ShowTips("撤销采购纪要成功!");
- doQuery();
- require_plan.comm.doActiveSelRow(ultraGrid1, "taskId", strTaskId);
- }
- else
- {
- MessageUtil.ShowTips("操作失败!" + crt.Resultmsg);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败!" + ex.Message);
- }
- }
- //删除纪要
- private void doDelete()
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择任务单!");
- }
- string strTaskId = ultraGrid1.ActiveRow.GetCellValue("TaskId").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskId))
- {
- MessageUtil.ShowTips("选择的任务单单号为空!");
- }
- if (testStatus(strTaskId, 3) == false)
- {
- return;
- }
- PurTaskRecordEntity record = new PurTaskRecordEntity();
- record.Id = jy_RecordId.Text.Trim();
- record.Status = "9";
- record.Validflag = "0";
- record.DeleteName = UserInfo.GetUserName();
- record.DeleteTime = DateTime.Now;
- record.DeleteUserid = UserInfo.GetUserID();
- if (MessageUtil.ShowYesNoAndQuestion("确定删作废纪要:" + record.Id + "?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskRecordService", "doDelete_Record", new object[] { record });
- if (crt.Resultcode == 0)
- {
- MessageUtil.ShowTips("操作成功!");
- doQuery();
- require_plan.comm.doActiveSelRow(ultraGrid1, "taskId", strTaskId);
- }
- else
- {
- MessageUtil.ShowTips("操作失败!" + crt.Resultmsg);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败!" + ex.Message);
- }
- }
- //评单
- private void doRecord()
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择评审单!");
- }
- string strTaskId = ultraGrid1.ActiveRow.GetCellValue("TaskId").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskId))
- {
- MessageUtil.ShowTips("选择的评审单单号为空!");
- }
- if (testStatus(strTaskId, 1) == false)
- {
- return;
- }
- TaskEva taskEva = new TaskEva();
- taskEva.TaskRecordId = strTaskId;
- taskEva.Validflag = "1";
- taskEva.CreateName = UserInfo.GetUserName();
- taskEva.CreateTime = DateTime.Now;
- taskEva.CreateUserId = UserInfo.GetUserID();
- if (radioButton1.Checked)
- {
- taskEva.EvaResult = "1";//审批通过
- }
- else if (radioButton2.Checked)
- {
- taskEva.EvaResult = "0";//审批不通过
- }
- taskEva.IsLatest = "1";
- taskEva.EvaMsg = txt_msg.Text.ToString().Trim();
- if (MessageUtil.ShowYesNoAndQuestion("确定提价评单?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskEvaService", "doInsert_Eva", new object[] { taskEva });
- if (crt.Resultcode == 0)
- {
- MessageUtil.ShowTips("评单成功! 新增评单:" + crt.Resultmsg);
- ClearTab2();
- doQueryTaskEva(strTaskId);
- require_plan.comm.doActiveSelRow(ultraGrid2, "EVAID", crt.Resultmsg);
- }
- else
- {
- MessageUtil.ShowTips("操作失败:" + crt.Resultmsg);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败:" + ex.Message);
- }
- }
- //撤销评单
- private void cancelRecord()
- {
- try
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择任务单!");
- }
- string strTaskId = ultraGrid1.ActiveRow.GetCellValue("TaskId").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskId))
- {
- MessageUtil.ShowTips("选择的任务单单号为空!");
- }
- if (ultraGrid2.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择任务单评审意见!");
- }
- string strTaskEvaId = ultraGrid2.ActiveRow.GetCellValue("evaid").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskEvaId))
- {
- MessageUtil.ShowTips("选择的评审意见主键为空!");
- }
- if (testStatusEva(strTaskEvaId, 1) == false)
- {
- return;
- }
- TaskEva taskEva = new TaskEva();
- taskEva.EvaId = strTaskEvaId;
- taskEva.Validflag = "0";
- taskEva.DeleteName = UserInfo.GetUserName();
- taskEva.DeleteTime = DateTime.Now;
- taskEva.DeleteUserId = UserInfo.GetUserID();
- if (MessageUtil.ShowYesNoAndQuestion("确定撤销该评单:" + strTaskEvaId + "?") != DialogResult.Yes)
- {
- return;
- }
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskEvaService", "doUpdate", new object[] { taskEva });
- if (crt.Resultcode == 0)
- {
- MessageUtil.ShowTips("撤销成功");
- ClearTab2();
- doQueryTaskEva(strTaskId);
- }
- else
- {
- MessageUtil.ShowTips("操作失败:" + crt.Resultmsg);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("操作失败:" + ex.Message);
- }
- }
- //打印
- private void doPrint()
- {
- try
- {
- this.Cursor = Cursors.WaitCursor;
- String strRecordId = jy_RecordId.Text.Trim();
- if (String.IsNullOrEmpty(strRecordId))
- {
- MessageUtil.ShowWarning("纪要号空!");
- jy_RecordId.Focus();
- return;
- }
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("请选择任务单!");
- }
- string strTaskId = ultraGrid1.ActiveRow.GetCellValue("TaskId").ToString().Trim();
- if (String.IsNullOrEmpty(strTaskId))
- {
- MessageUtil.ShowTips("选择的任务单单号为空!");
- }
- if (testStatus(strTaskId, 5) == false)
- {
- return;
- }
- //string ordLnPk = ugr.Cells["ORD_LN_PK"].Value.ToString();
- //string saleOrg = ugr.Cells["SALE_ORG"].Value.ToString();
- //string ordPk = ugr.Cells["ORD_PK"].Value.ToString();
- string strurl = "";
- DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1223" }, this.ob);
- DataRow[] drArr = dt.Select("validflag='1'");
- if (drArr.Length != 1)
- {
- MessageUtil.ShowTips("基础数据维护错误:报表系统需维护有效的Ip且只能维护一个有效ip!");
- return;
- }
- String TipsEnv = drArr[0]["baseName"].ToString();
- String strUrlPort = "http://172.54.10.42:8080";//报表系统IP
- String[] str = strUrlPort.Split(':');
- String strUrl = str[0] + ":" + str[1];
- if (ob.MainUrl.StartsWith(strUrl))
- {
- //测试环境
- if (TipsEnv == "2")
- {
- strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepTaskRecordDev.cpt&__bypagesize__=false" + "&cmbTaskRecordId=" + strRecordId;
- }
- else
- {
- strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepTaskRecord.cpt&__bypagesize__=false" + "&cmbTaskRecordId=" + strRecordId;
- }
- }
- else
- {
- //测试环境
- if (TipsEnv == "2")
- {
- strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepTaskRecordDev.cpt&__bypagesize__=false" + "&cmbTaskRecordId=" + strRecordId;
- }
- else
- {
- strurl = strUrlPort + "/webroot/decision/view/report?viewlet=RepTaskRecord.cpt&__bypagesize__=false" + "&cmbTaskRecordId=" + strRecordId;
- }
- }
- //if (ob.MainUrl.StartsWith("http://127.0.0.1"))
- //{
- // strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=RepTaskRecord.cpt&__bypagesize__=false" + "&cmbTaskRecordId=" + strTaskRecordId;
- //}
- //else
- //{
- // strurl = "http://localhost:8075/webroot/decision/view/report?viewlet=RepTaskRecord.cpt&__bypagesize__=false" + "&cmbTaskRecordId=" + strTaskRecordId;
- //}
- FrmRepExcel fBug = new FrmRepExcel(ob, strurl);
- fBug.AutoSize = true;
- fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
- fBug.WindowState = FormWindowState.Maximized;
- fBug.Text = "TPCO采购纪要查询";
- fBug.Show();
- }
- finally
- {
- this.Cursor = Cursors.Default;
- }
- }
- //点击纪要号查询明细和评审意见
- private void ultraGrid1_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)
- {
- }
- //获取纪要号查询明细和评审意见
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- dataSet2.Clear();
- dataSet3.Clear();
- UltraGridRow Row = ultraGrid1.ActiveRow;
- if (Row != null)
- {
- if (Row.Cells["TaskId"].Value != null)
- {
- //加载采购纪要数据
- string strTaskId = Row.Cells["TaskId"].Value.ToString().Trim();
- doQueryTaskRecord(strTaskId);
- //加载采购纪要评单记录表
- doQueryTaskEva(strTaskId);
- //加载中标记录
- doQueryTaskBidRecord(strTaskId);
- }
- }
- }
- //加载中标明细
- private void doQueryTaskBidRecord(string strTaskId)
- {
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.purplan.service.TaskOfferMService", "getSuppResM", new object[] { strTaskId });
- GridHelper.CopyDataToDatatable(dt, dataTable4, true);
- PurTaskOfferCEntity TkoC = new PurTaskOfferCEntity();
- TkoC.TaskId = strTaskId;
- TkoC.Validflag = "1";
- TkoC.IsBid = "1";
- DataTable dt1 = this.execute<DataTable>("com.hnshituo.pur.purplan.service.TaskOfferCService", "findTaskOfferC", new object[] { TkoC });
- GridHelper.CopyDataToDatatable(dt1, dataTable3, true);
- }
- //加载评单明细
- private void doQueryTaskRecord(string strTaskId)
- {
- ClearTab1();
- PurTaskRecordEntity taskR = new PurTaskRecordEntity();
- taskR.TaskId = strTaskId;
- taskR.Validflag = "1";
- List<PurTaskRecordEntity> taskRecordList = this.execute<List<PurTaskRecordEntity>>("com.hnshituo.pur.purplan.service.TaskRecordService", "getTaskRecord", new object[] { taskR});
- if (taskRecordList != null )
- {
- if (taskRecordList.Count > 0)
- {
- jy_buyerUsername.Text = taskRecordList[0].BuyerUsername;
- jy_mngOrgName.Text = taskRecordList[0].MngOrgName;
- jy_negDate.Value = taskRecordList[0].NegDate;
- jy_procRecord.Text = taskRecordList[0].ProcRecord;
- jy_taskId.Text = taskRecordList[0].TaskId;
- jy_taskName.Text = taskRecordList[0].TaskName;
- jy_RecordId.Text = taskRecordList[0].Id;
- jy_status.Text = taskRecordList[0].Status;
- }
- else
- {
- jy_buyerUsername.Text = UserInfo.GetUserName();
- jy_mngOrgName.Text = UserInfo.GetDepartment();
- jy_negDate.Value = DateTime.Now;
- jy_procRecord.Text = "";
- jy_taskId.Text = strTaskId;
- jy_taskName.Text = ultraGrid1.ActiveRow.GetCellValue("taskName").ToString().Trim();
- jy_RecordId.Clear();
- jy_status.Clear();
- }
- }
- else
- {
- jy_buyerUsername.Text = UserInfo.GetUserName();
- jy_mngOrgName.Text = UserInfo.GetDepartment();
- jy_negDate.Value = DateTime.Now;
- jy_procRecord.Text = "";
- jy_taskId.Text = strTaskId;
- jy_taskName.Text = ultraGrid1.ActiveRow.GetCellValue("taskName").ToString().Trim();
- jy_RecordId.Clear();
- jy_status.Clear();
- }
- }
- //加载评单意见表
- private void doQueryTaskEva(string strTaskId)
- {
- dataSet2.Clear();
- DataTable dt6 = this.execute<DataTable>("com.hnshituo.pur.purplan.service.TaskEvaService", "doQueryEva", new object[] { strTaskId });
- GridHelper.CopyDataToDatatable(dt6, dataTable2, true);
- }
- //清空评审明细区
- private void ClearTab1()
- {
- ConfigureClassCommon.clearOldData(ultraPanel1);
- jy_procRecord.Clear();
- }
- //清空评审意见区
- private void ClearTab2()
- {
- txt_msg.Clear();
- }
- //纪要权限判断
- private bool testStatus(string strTaskId, int p)
- {
- PurTaskMEntity PurTaskM = this.execute<PurTaskMEntity>("com.hnshituo.pur.purplan.service.TaskMService", "findById", new object[] { strTaskId });
- if (PurTaskM == null)
- {
- MessageUtil.ShowTips("未发现任务单号:" + strTaskId + "信息记录,可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (PurTaskM.Validflag == "0")
- {
- MessageUtil.ShowTips("任务单号:" + strTaskId + "信息记录可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- //新增纪要判断
- else if (p == 0)
- {
- if (PurTaskM.Status != "7")
- {
- MessageUtil.ShowTips("任务单号:" + strTaskId + "信息还未初拟中标或已经生成采购纪要,无法进行纪要新增操作!或请刷新界面重新操作!");
- return false;
- }
- //判断是否所有人都有评审记录
- CoreResult crt = this.execute<CoreResult>("com.hnshituo.pur.purplan.service.TaskEvaService", "checkIsAllreview", new object[] { strTaskId });
- if (crt.Resultcode != 0)
- {
- MessageUtil.ShowTips("新增失败:"+crt.Resultmsg);
- return false;
- }
- }
- //评单权限判断
- else if (p == 1)
- {
- if (PurTaskM.Status != "7")
- {
- MessageUtil.ShowTips("任务单号:" + strTaskId + "信息还未初拟中标或已经生成采购纪要,无法进行纪要生成和评单操作!或请刷新界面重新操作!");
- return false;
- }
- }
- //采购纪要生效权限判断和改权限判断
- else if (p == 2)
- {
- String strRecordId = jy_RecordId.Text.Trim();
- PurTaskRecordEntity taskRecord = this.execute<PurTaskRecordEntity>("com.hnshituo.pur.purplan.service.TaskRecordService", "findById", new object[] { strRecordId });
- if (taskRecord == null)
- {
- MessageUtil.ShowTips("未发现纪要:" + strRecordId + "信息记录,可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskRecord.Validflag == "0")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "信息记录可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskRecord.BuyerUserid!=UserInfo.GetUserID())
- {
- MessageUtil.ShowTips("非纪要:" + strRecordId + "创建本人操作,无权限!");
- return false;
- }
- if (taskRecord.Status != "2")
- {
- MessageUtil.ShowTips("非纪要:" + strRecordId + "信息不在“评审中”状态!或请刷新界面重新操作!");
- return false;
- }
- }
- //删权限判断
- else if (p == 3)
- {
- String strRecordId = jy_RecordId.Text.Trim();
- PurTaskRecordEntity taskRecord = this.execute<PurTaskRecordEntity>("com.hnshituo.pur.purplan.service.TaskRecordService", "findById", new object[] { strRecordId });
- if (taskRecord == null)
- {
- MessageUtil.ShowTips("未发现纪要:" + strRecordId + "信息记录,可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskRecord.Validflag == "0")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "信息记录可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskRecord.BuyerUserid != UserInfo.GetUserID())
- {
- MessageUtil.ShowTips("非纪要:" + strRecordId + "创建本人操作,无权限!");
- return false;
- }
- if (taskRecord.Status != "2" && taskRecord.Status != "3")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "信息不在“评审中”或者“已生效”状态,无法进行删除操作!或请刷新界面重新操作!");
- return false;
- }
- //判断合同状态
- OrderM Odm = new OrderM();
- Odm.TaskRecordId = strRecordId;
- Odm.Validflag = "1";
- List<OrderM> list = this.execute<List<OrderM>>("com.hnshituo.pur.order.service.OrderMService", "find", new object[] { Odm, 0, 0 });
- foreach (OrderM tempOdm in list)
- {
- if (tempOdm.Status != "1" && tempOdm.Status != "4")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "相关的合同:" + tempOdm.OrderId + "已审批或者已审批完,无法进行作废操作!或请刷新界面重新操作!");
- return false;
- }
- }
- }
- //撤销权限判断
- else if (p == 4)
- {
- String strRecordId = jy_RecordId.Text.Trim();
- PurTaskRecordEntity taskRecord = this.execute<PurTaskRecordEntity>("com.hnshituo.pur.purplan.service.TaskRecordService", "findById", new object[] { strRecordId });
- if (taskRecord == null)
- {
- MessageUtil.ShowTips("未发现纪要:" + strRecordId + "信息记录,可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskRecord.Validflag == "0")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "信息记录可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskRecord.BuyerUserid != UserInfo.GetUserID())
- {
- MessageUtil.ShowTips("非纪要:" + strRecordId + "创建本人操作,无权限!");
- return false;
- }
- if (taskRecord.Status != "3")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "信息不在“已生效”状态,无法进行撤回操作!或请刷新界面重新操作!");
- return false;
- }
- //判断合同状态
- OrderM Odm = new OrderM();
- Odm.TaskRecordId = strRecordId;
- Odm.Validflag = "1";
- List<OrderM> list = this.execute<List<OrderM>>("com.hnshituo.pur.order.service.OrderMService", "find", new object[] { Odm, 0, 0 });
- foreach (OrderM tempOdm in list)
- {
- if (tempOdm.Status != "1" && tempOdm.Status != "4")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "相关的合同:" + tempOdm.OrderId + "已审批或者已审批完,无法进行撤回操作!或请刷新界面重新操作!");
- return false;
- }
- }
- }
- //打印操作
- else if (p == 5)
- {
- String strRecordId = jy_RecordId.Text.Trim();
- PurTaskRecordEntity taskRecord = this.execute<PurTaskRecordEntity>("com.hnshituo.pur.purplan.service.TaskRecordService", "findById", new object[] { strRecordId });
- if (taskRecord == null)
- {
- MessageUtil.ShowTips("未发现纪要:" + strRecordId + "信息记录,可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskRecord.Validflag == "0")
- {
- MessageUtil.ShowTips("纪要:" + strRecordId + "信息记录可能已被作废!或请刷新界面重新操作!");
- return false;
- }
-
- }
- else
- {
- MessageUtil.ShowTips("未知参数!");
- return false;
- }
- return true;
- }
- //评审意见权限判断
- private bool testStatusEva(string strTaskEvaId, int p)
- {
- TaskEva taskEva = this.execute<TaskEva>("com.hnshituo.pur.purplan.service.TaskEvaService", "findById", new object[] { strTaskEvaId });
- if (taskEva == null)
- {
- MessageUtil.ShowTips("未发现评审意见:" + strTaskEvaId + "信息记录,可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskEva.Validflag == "0")
- {
- MessageUtil.ShowTips("评审意见:" + strTaskEvaId + "信息记录可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (taskEva.CreateUserId != UserInfo.GetUserID())
- {
- MessageUtil.ShowTips("非本人提交的评审意见,暂无权限进行删改操作!或请刷新界面重新操作!");
- return false;
- }
- //撤销评单权限判断
- if (p == 1)
- {
- string strTaskId = taskEva.TaskRecordId;
- PurTaskMEntity PurTaskM = this.execute<PurTaskMEntity>("com.hnshituo.pur.purplan.service.TaskMService", "findById", new object[] { strTaskId });
- if (PurTaskM == null)
- {
- MessageUtil.ShowTips("未发现任务单号:" + strTaskId + "信息记录,可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (PurTaskM.Validflag == "0")
- {
- MessageUtil.ShowTips("未发现任务单号:" + strTaskId + "信息记录可能已被作废!或请刷新界面重新操作!");
- return false;
- }
- if (PurTaskM.Status != "7")
- {
- MessageUtil.ShowTips("任务单号:" + strTaskId + "信息记录已生成采购纪要,暂无法撤销评单意见!或请刷新界面重新操作!");
- return false;
- }
- }
- else
- {
- MessageUtil.ShowTips("未知参数!");
- return false;
- }
- return true;
- }
- private void ck_ctime_CheckedChanged(object sender, EventArgs e)
- {
- txt_createTimeEnd.Enabled = ck_ctime.Checked;
- txt_createTimeStart.Enabled = ck_ctime.Checked;
- }
- private void btn_SubmitLun_Click(object sender, EventArgs e)
- {
- doRecord();
- }
- }
- }
|