20230307 质量在线文档编辑修改

This commit is contained in:
2023-03-07 11:24:59 +08:00
parent f42d330b00
commit 1bbab53e2f
22 changed files with 532 additions and 104 deletions
@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using AspNet = System.Web.UI.WebControls;
using System.IO;
namespace FineUIPro.Web.CQMS.Plan
{
@@ -46,6 +47,7 @@ namespace FineUIPro.Web.CQMS.Plan
{
if (!IsPostBack)
{
MainPlanId = Request.Params["MainPlanId"];
this.drpHandleType.DataTextField = "Text";
this.drpHandleType.DataValueField = "Value";
@@ -62,6 +64,7 @@ namespace FineUIPro.Web.CQMS.Plan
hdId.Text = this.MainPlanId;
txtPlanCode.Text = MainPlan.PlanCode;
txtFileName.Text = MainPlan.FileName;
List<string> list = BLL.CQMS_MainPlanApproveService.GetAudit3PersonIds(MainPlanId);
if (list.Count > 0)
{
@@ -107,6 +110,7 @@ namespace FineUIPro.Web.CQMS.Plan
this.btnSubmit.Visible = false;
this.next.Hidden = true;
}
drpHandleType_SelectedIndexChanged(null, null);
}
else
@@ -323,6 +327,7 @@ namespace FineUIPro.Web.CQMS.Plan
MainPlan.ProjectId = this.CurrUser.LoginProjectId;
MainPlan.PlanCode = this.txtPlanCode.Text.Trim();
MainPlan.FileName = this.txtFileName.Text.Trim();
MainPlan.FilePath = "FileUpload/CQMSMainPlan/" + txtPlanCode.Text + ".doc";
if (saveType == "submit")
{
MainPlan.State = this.drpHandleType.SelectedValue;
@@ -373,6 +378,7 @@ namespace FineUIPro.Web.CQMS.Plan
if (string.IsNullOrEmpty(hdId.Text))
{
MainPlan.MainPlanId = SQLHelper.GetNewID();
MainPlanId = MainPlan.MainPlanId;
}
else
{
@@ -408,8 +414,11 @@ namespace FineUIPro.Web.CQMS.Plan
}
}
LogService.AddSys_Log(CurrUser, MainPlan.PlanCode, MainPlan.MainPlanId, Const.MainPlanMenuId, "修改总包施工质量计划");
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
if (saveType== "submit")
{
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
/// <summary>
/// 表格数据验证
@@ -464,5 +473,70 @@ namespace FineUIPro.Web.CQMS.Plan
}
return str;
}
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
string rootPath = Funs.RootPath;
var model = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(MainPlanId);
string filepath = model.FilePath;
string path = rootPath + filepath;
DirectoryInfo pathInfo = new DirectoryInfo(path);
string newPath = pathInfo.Parent.FullName;
if (!Directory.Exists(newPath))
{
Directory.CreateDirectory(newPath);
}
if (e.EventArgument == "Yes")
{
if (!File.Exists(path))
{
File.Copy(rootPath + Const.CQMSPlanTemplateUrl, path);
}
}
else if (e.EventArgument == "No")
{
if (!File.Exists(path))
{
var stream= File.Create(path);
stream.Close();
}
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSMainPlan", MainPlanId, "查看 -")));
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
}
protected void btnEditWord_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(MainPlanId))
{
Model.Plan_MainPlan MainPlan = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(MainPlanId);
if (!File.Exists(Funs.RootPath + MainPlan.FilePath))
{
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
String.Empty,
MessageBoxIcon.Question,
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
PageManager1.GetCustomEventReference("No")));
}
else
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}|CQMSMainPlan", MainPlanId, "查看 -")));
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
}
}
else
{
SaveMainPlan("save");
PageContext.RegisterStartupScript(Confirm.GetShowReference("是否使用公司模板?",
String.Empty,
MessageBoxIcon.Question,
PageManager1.GetCustomEventReference("Yes"), // 第一个参数 false 用来指定当前不是AJAX请求
PageManager1.GetCustomEventReference("No")));
}
//PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/IndexOffice.aspx?cmd={0}", filepath, "查看 -")));
}
}
}