20230307 质量在线文档编辑修改
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.ZHGL.Plan;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Plan
|
||||
@@ -74,6 +76,7 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
HFSubPlanId.Text = SubPlanId;
|
||||
Model.Plan_SubPlan SubPlan = CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId);
|
||||
txtCode.Text = SubPlan.Code;
|
||||
|
||||
if (!string.IsNullOrEmpty(SubPlan.UnitId))
|
||||
{
|
||||
drpUnit.SelectedValue = SubPlan.UnitId;
|
||||
@@ -166,6 +169,7 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
agree.Hidden = true;
|
||||
txtEdition.Text = "0";
|
||||
options.Hidden = true;
|
||||
@@ -483,6 +487,8 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
SubPlan.UnitId = drpUnit.SelectedValue;
|
||||
}
|
||||
SubPlan.PlanName = txtPlanName.Text.Trim();
|
||||
SubPlan.FilePath = "FileUpload/CQMSSupPlan/" + SubPlan.Code + ".doc";
|
||||
|
||||
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
|
||||
{
|
||||
SubPlan.CompileDate = Convert.ToDateTime(txtCompileDate.Text.Trim());
|
||||
@@ -504,18 +510,23 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
{
|
||||
SubPlan.State = Const.SubPlan_Compile;
|
||||
}
|
||||
SubPlan.CompileMan = CurrUser.PersonId;
|
||||
SubPlan.Edition = Convert.ToInt32(txtEdition.Text);
|
||||
|
||||
if (!string.IsNullOrEmpty(HFSubPlanId.Text))
|
||||
{
|
||||
SubPlan.SubPlanId = HFSubPlanId.Text;
|
||||
SubPlanId = SubPlan.SubPlanId;
|
||||
CQMS_SubPlanService.UpdateSubPlan(SubPlan);
|
||||
}
|
||||
else
|
||||
{
|
||||
SubPlan.SubPlanId = SQLHelper.GetNewID(typeof(Model.Plan_SubPlan));
|
||||
}
|
||||
SubPlan.CompileMan = CurrUser.PersonId;
|
||||
SubPlan.Edition = Convert.ToInt32(txtEdition.Text);
|
||||
SubPlanId = SubPlan.SubPlanId;
|
||||
CQMS_SubPlanService.AddSubPlan(SubPlan);
|
||||
|
||||
CQMS_SubPlanService.AddSubPlan(SubPlan);
|
||||
}
|
||||
|
||||
if (saveType == "submit")
|
||||
{
|
||||
Model.Plan_SubPlanApprove approve1 = new Model.Plan_SubPlanApprove();
|
||||
@@ -781,5 +792,70 @@ namespace FineUIPro.Web.CQMS.Plan
|
||||
String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/Solution&menuId={2}",
|
||||
-1, fileId, Const.SubPlanMenuId)));
|
||||
}
|
||||
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
|
||||
{
|
||||
string rootPath = Funs.RootPath;
|
||||
var model = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId);
|
||||
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}|CQMSSubPlan", SubPlanId, "查看 -")));
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
|
||||
}
|
||||
protected void btnEditWord_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (!string.IsNullOrEmpty(SubPlanId))
|
||||
{
|
||||
var model = BLL.CQMS_SubPlanService.GetSubPlanBySubPlanId(SubPlanId);
|
||||
if (!File.Exists(Funs.RootPath + model.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}|CQMSSubPlan", SubPlanId, "查看 -")));
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetHideReference());
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SaveSubPlan("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, "查看 -")));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user