20240125本部检查调整
This commit is contained in:
@@ -17,15 +17,16 @@
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" AllowCellEditing="true" ClicksToEdit="1"
|
||||
ForceFit="true" EnableCollapse="true" EnableColumnLines="true" EnableColumnMove="true" runat="server" BoxFlex="1"
|
||||
DataKeyNames="RectifyItemId,IsRectify" DataIDField="RectifyItemId" AllowSorting="true" SortField="RectifyItemId"
|
||||
SortDirection="ASC" EnableTextSelection="True" MinHeight="240px" PageSize="500"
|
||||
DataKeyNames="RectifyItemId" DataIDField="RectifyItemId" AllowSorting="true" SortField="RectifyCode"
|
||||
SortDirection="DESC" EnableTextSelection="True" MinHeight="240px" PageSize="500"
|
||||
EnableRowDoubleClickEvent="true" OnRowCommand="Grid1_RowCommand">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Left" runat="server">
|
||||
<Items>
|
||||
<f:RadioButtonList ID="rbStates" runat="server" Label="状态" LabelAlign="Right" Width="400px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
|
||||
<f:RadioItem Text="待整改" Value="1" Selected="true" />
|
||||
<f:RadioItem Text="已完成" Value="3" />
|
||||
<f:RadioButtonList ID="rbStates" runat="server" Label="状态"
|
||||
LabelAlign="Right" Width="400px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
|
||||
<f:RadioItem Text="不合格" Value="0" Selected="true" />
|
||||
<f:RadioItem Text="合格" Value="1" />
|
||||
</f:RadioButtonList>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
@@ -34,6 +35,12 @@
|
||||
<f:RenderField HeaderText="主键" ColumnID="RectifyItemId" DataField="RectifyItemId"
|
||||
SortField="RectifyItemId" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
|
||||
Hidden="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="StatesName" DataField="StatesName" FieldType="string"
|
||||
HeaderText="状态">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RectifyCode" DataField="RectifyCode" FieldType="string"
|
||||
HeaderText="整改单">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="300px" ColumnID="WrongContent" DataField="WrongContent" FieldType="string"
|
||||
HeaderText="具体位置及隐患内容">
|
||||
@@ -52,6 +59,10 @@
|
||||
<f:LinkButtonField ColumnID="ReAttachUrl" HeaderText="整改后" ConfirmTarget="Top" Width="80" CommandName="ReAttachUrl"
|
||||
TextAlign="Center" ToolTip="整改照片" Text="整改后" />
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
@@ -59,6 +70,26 @@
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<Items>
|
||||
<f:MenuButton ID="btnSubmit" EnablePostBack="true" runat="server"
|
||||
Text="提交" Icon="TableEdit" OnClick="btnSubmit_Click">
|
||||
</f:MenuButton>
|
||||
</Items>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['RectifyCode'], { depends: true });
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Check
|
||||
{
|
||||
@@ -21,22 +22,16 @@ namespace FineUIPro.Web.HSSE.Check
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT Item.RectifyItemId,
|
||||
Item.RectifyId,
|
||||
Item.WrongContent,
|
||||
Item.Requirement,
|
||||
Item.LimitTime,
|
||||
Item.RectifyResults,
|
||||
Item.IsRectify,
|
||||
Rectify.States,
|
||||
Rectify.ProjectId "
|
||||
+ @" FROM ProjectSupervision_RectifyItem AS Item "
|
||||
+ @" LEFT JOIN ProjectSupervision_Rectify AS Rectify ON Rectify.RectifyId=Item.RectifyId";
|
||||
string strSql = @"SELECT (CASE WHEN Rectify.States=1 THEN '待整改' WHEN Rectify.States=2 THEN '待确认' WHEN Rectify.States=3 THEN '已完成' ELSE '待签发' END) AS StatesName,
|
||||
Rectify.RectifyCode,Item.RectifyItemId,Item.RectifyId,Item.WrongContent,Item.Requirement,Item.LimitTime,Item.RectifyResults,Item.IsRectify,Rectify.States,Rectify.ProjectId
|
||||
FROM ProjectSupervision_RectifyItem AS Item
|
||||
LEFT JOIN ProjectSupervision_Rectify AS Rectify ON Rectify.RectifyId=Item.RectifyId
|
||||
WHERE Rectify.States !='0' AND Rectify.States IS NOT NULL ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " WHERE Rectify.ProjectId = @ProjectId";
|
||||
strSql += " AND Rectify.States = @States";
|
||||
strSql += " AND Rectify.ProjectId = @ProjectId";
|
||||
strSql += " AND Item.IsRectify = @IsRectify";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue));
|
||||
listStr.Add(new SqlParameter("@IsRectify", this.rbStates.SelectedValue));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
@@ -52,6 +47,14 @@ namespace FineUIPro.Web.HSSE.Check
|
||||
protected void rbStates_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
if (this.rbStates.SelectedValue == "1")
|
||||
{
|
||||
this.btnSubmit.Hidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnSubmit.Hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -95,5 +98,34 @@ namespace FineUIPro.Web.HSSE.Check
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString().Split(',')[0];
|
||||
var getV = Funs.DB.ProjectSupervision_RectifyItem.FirstOrDefault(x => x.RectifyItemId == rowID);
|
||||
if (getV != null)
|
||||
{
|
||||
var getR = Funs.DB.ProjectSupervision_Rectify.FirstOrDefault(x => x.RectifyId == getV.RectifyId);
|
||||
if (getR != null && getR.States != Const.State_3)
|
||||
{
|
||||
getR.States = BLL.Const.State_2;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid();
|
||||
ShowNotify("数据已提交成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
-11
@@ -7,11 +7,13 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Check {
|
||||
|
||||
|
||||
public partial class OfficeCheck {
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Check
|
||||
{
|
||||
|
||||
|
||||
public partial class OfficeCheck
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// rbStates 控件。
|
||||
/// </summary>
|
||||
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rbStates;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
@@ -74,5 +76,23 @@ namespace FineUIPro.Web.HSSE.Check {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnSubmit;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user