| | |
| | | using System.Threading.Tasks; |
| | | using DIXWeb.Entity.DIX; |
| | | using DIXWeb.Entity.GlobalM; |
| | | using NPOI.HSSF.UserModel; |
| | | using NPOI.SS.UserModel; |
| | | using NPOI.SS.Util; |
| | | |
| | | namespace DIXWeb.Business.DIX |
| | | { |
| | | public class ExcelHelper |
| | | { |
| | | public static void CreateExcel(List<ExcelEntity> list, string excelRealPath,string sheetName) { |
| | | private bool IsXlsx=false; |
| | | public static void CreateExcel(List<ExcelEntity> list, string excelRealPath, string sheetName) |
| | | { |
| | | new ToExcelTemplate(excelRealPath, sheetName).ExportTemplate(list); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public void Create(string excelRealPath, string sheetName,bool IsXlsx) |
| | | { |
| | | this.IsXlsx = IsXlsx; |
| | | HSSFWorkbook workbook = new HSSFWorkbook(); |
| | | ISheet sheet = workbook.CreateSheet("Sheet1"); |
| | | SetDefaultStyle(workbook, sheet); |
| | | |
| | | ToExcelTemplate data = new ToExcelTemplate(); |
| | | string[] orgArr = data.GetOrg(); |
| | | string[] iotArr = data.GetInspectObjectType(); |
| | | string[] iaArr = data.GetInspectArea(); |
| | | string[] itArr = data.GetInspectType(); |
| | | string[] ifArr = data.GetInspectFrequency(); |
| | | string[] isArr = data.GetInspectStatu(); |
| | | string InspectObjectIsNeedStr = System.Configuration.ConfigurationManager.AppSettings["InspectObjectIsNeedStr"].ToString(); |
| | | string[] iNArr = InspectObjectIsNeedStr.Split(','); |
| | | |
| | | SetCellDropdownList(workbook, sheet, "Org", 1, 0, 0, orgArr,1); |
| | | SetCellDropdownList(workbook, sheet, "InspectObjectType", 1, 1, 1, iotArr,2); |
| | | SetCellDropdownList(workbook, sheet, "InspectArea", 1, 4, 4, iaArr,3); |
| | | SetCellDropdownList(workbook, sheet, "InspectType", 1, 6, 6, itArr,4); |
| | | SetCellDropdownList(workbook, sheet, "InspectFrequency", 1, 7, 7, ifArr,5); |
| | | SetCellDropdownList(workbook, sheet, "InspectStatu", 1, 8, 8, isArr,6); |
| | | SetCellDropdownList(workbook, sheet, "IsNeed", 1, 9, 9, iNArr,7); |
| | | |
| | | WriteToFile(excelRealPath, workbook); |
| | | } |
| | | |
| | | |
| | | public static void SetCellDropdownList(HSSFWorkbook workbook, ISheet sheet, string name,int firstRow, int firstcol, int lastcol, string[] vals, int sheetindex = 1) |
| | | { |
| | | //先创建一个Sheet专门用于存储下拉项的值 |
| | | ISheet sheet2 = workbook.CreateSheet(name); |
| | | //隐藏 |
| | | workbook.SetSheetHidden(sheetindex, true); |
| | | int index = 0; |
| | | foreach (var item in vals) |
| | | { |
| | | sheet2.CreateRow(index).CreateCell(0).SetCellValue(item); |
| | | index++; |
| | | } |
| | | //创建的下拉项的区域: |
| | | var rangeName = name + "Range"; |
| | | IName range = workbook.CreateName(); |
| | | range.RefersToFormula = name + "!$A$1:$A$" + index; |
| | | range.NameName = rangeName; |
| | | CellRangeAddressList regions = new CellRangeAddressList(firstRow, 65535, firstcol, lastcol); |
| | | DVConstraint constraint = DVConstraint.CreateFormulaListConstraint(rangeName); |
| | | HSSFDataValidation dataValidate = new HSSFDataValidation(regions, constraint); |
| | | dataValidate.CreateErrorBox("输入不合法", "请输入或选择下拉列表中的值。"); |
| | | dataValidate.ShowPromptBox = true; |
| | | sheet.AddValidationData(dataValidate); |
| | | } |
| | | |
| | | private string WriteToFile(string fileName, HSSFWorkbook workbook) |
| | | { |
| | | string result = string.Empty; |
| | | try |
| | | { |
| | | using (System.IO.FileStream file = new System.IO.FileStream(fileName, System.IO.FileMode.Create)) |
| | | { |
| | | workbook.Write(file); |
| | | } |
| | | result = "SUCCESS,"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result = "ERROR," + ex.Message; |
| | | } |
| | | return result; |
| | | } |
| | | private void SetDefaultStyle(IWorkbook workbook, ISheet sheet) |
| | | { |
| | | Dictionary<String, ICellStyle> styles = createCellStyles(workbook); |
| | | if (!IsXlsx) |
| | | sheet.TabColorIndex = NPOI.HSSF.Util.HSSFColor.CornflowerBlue.Index; |
| | | NPOI.SS.UserModel.IPrintSetup printSetup = sheet.PrintSetup; |
| | | sheet.DisplayGridlines = false; |
| | | SetDefaultRowHeight(sheet, 28.0F); |
| | | |
| | | sheet.FitToPage = (true); |
| | | sheet.HorizontallyCenter = (true); //设置Sheet缩放 |
| | | sheet.SetZoom(82, 100); // 100 percent magnification |
| | | SetColumnWidth(sheet, 00, 25.00); |
| | | SetColumnWidth(sheet, 01, 25.00); |
| | | SetColumnWidth(sheet, 02, 25.00); |
| | | SetColumnWidth(sheet, 03, 25.00); |
| | | SetColumnWidth(sheet, 04, 25.00); |
| | | SetColumnWidth(sheet, 05, 25.00); |
| | | SetColumnWidth(sheet, 06, 25.00); |
| | | SetColumnWidth(sheet, 07, 25.00); |
| | | SetColumnWidth(sheet, 08, 25.00); |
| | | SetColumnWidth(sheet, 09, 25.00); |
| | | SetColumnWidth(sheet, 10, 25.00); |
| | | |
| | | sheet.SetColumnHidden(24, true); |
| | | |
| | | IRow curRow = sheet.CreateRow(0); |
| | | ICell curCel = null; |
| | | SetRowHeight(curRow, 33);//第一行行高 |
| | | //第一行 列头 |
| | | curCel = curRow.CreateCell(0); |
| | | SetColumnWidth(sheet, 00, 15.00); |
| | | curCel.SetCellValue("组织ID"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(1); |
| | | SetColumnWidth(sheet, 01, 25.00); |
| | | curCel.SetCellValue("设备类型ID"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(2); |
| | | SetColumnWidth(sheet, 02, 15.00); |
| | | curCel.SetCellValue("设备编号"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(3); |
| | | SetColumnWidth(sheet, 03, 15.00); |
| | | curCel.SetCellValue("设备名称"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(4); |
| | | SetColumnWidth(sheet, 04, 25.00); |
| | | curCel.SetCellValue("设备区域ID"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(5); |
| | | SetColumnWidth(sheet, 05, 15.00); |
| | | curCel.SetCellValue("设备位置"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(6); |
| | | SetColumnWidth(sheet, 06, 25.00); |
| | | curCel.SetCellValue("点检周期ID"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(7); |
| | | SetColumnWidth(sheet, 07, 20.00); |
| | | curCel.SetCellValue("点检频率ID"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(8); |
| | | SetColumnWidth(sheet, 08, 20.00); |
| | | curCel.SetCellValue("设备状态ID"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(9); |
| | | SetColumnWidth(sheet, 09, 30.00); |
| | | curCel.SetCellValue("是否需要点检"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(10); |
| | | SetColumnWidth(sheet, 10, 25.00); |
| | | curCel.SetCellValue("导入日期"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | curCel = curRow.CreateCell(11); |
| | | SetColumnWidth(sheet, 11, 25.00); |
| | | curCel.SetCellValue("有效期(年)"); |
| | | curCel.CellStyle = styles["Bold_13_Black_Font"]; |
| | | |
| | | |
| | | } |
| | | protected void SetDefaultRowHeight(ISheet sheet, float rowHeight) |
| | | { |
| | | sheet.DefaultRowHeight = Convert.ToInt16(rowHeight * 20); |
| | | } |
| | | protected void SetColumnWidth(ISheet sheet, int columnIndex, double width) |
| | | { |
| | | sheet.SetColumnWidth(columnIndex, (int)((width + 0.72) * 256)); |
| | | } |
| | | protected void SetRowHeight(IRow targetRow, float rowHeight) |
| | | { |
| | | targetRow.Height = Convert.ToInt16(rowHeight * 20); |
| | | } |
| | | protected void SetFontHeight(IFont targetFont, double fontHeight) |
| | | { |
| | | if (IsXlsx == true) |
| | | { |
| | | targetFont.FontHeightInPoints = Convert.ToInt16(fontHeight); |
| | | } |
| | | else |
| | | { |
| | | targetFont.FontHeight = fontHeight * 20; |
| | | } |
| | | } |
| | | |
| | | protected Dictionary<string, ICellStyle> createCellStyles(IWorkbook wb) |
| | | { |
| | | //return base.createCellStyles(wb); |
| | | Dictionary<string, ICellStyle> styles = new Dictionary<string, ICellStyle>(); |
| | | IDataFormat df = wb.CreateDataFormat(); |
| | | NPOI.SS.UserModel.IFont MsFont_9_Black_Font = wb.CreateFont(); |
| | | MsFont_9_Black_Font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Normal; |
| | | SetFontHeight(MsFont_9_Black_Font, 9); |
| | | MsFont_9_Black_Font.FontName = "微软雅黑"; |
| | | |
| | | NPOI.SS.UserModel.IFont MsFont_9_Blue_Font = wb.CreateFont(); |
| | | MsFont_9_Blue_Font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Normal; |
| | | MsFont_9_Blue_Font.Color = NPOI.HSSF.Util.HSSFColor.Blue.Index; |
| | | SetFontHeight(MsFont_9_Blue_Font, 9); |
| | | MsFont_9_Blue_Font.FontName = "微软雅黑"; |
| | | |
| | | NPOI.SS.UserModel.IFont MsFont_9_Red_Font = wb.CreateFont(); |
| | | MsFont_9_Red_Font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Normal; |
| | | MsFont_9_Red_Font.Color = NPOI.HSSF.Util.HSSFColor.Red.Index; |
| | | SetFontHeight(MsFont_9_Red_Font, 9); |
| | | MsFont_9_Red_Font.FontName = "微软雅黑"; |
| | | |
| | | |
| | | NPOI.SS.UserModel.ICellStyle cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | styles.Add("微黑_9_V中H中_换行_全框细", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Right; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | styles.Add("微黑_9_V中H右_换行_全框细", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Blue_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | styles.Add("微黑_9_V中H左_换行_全框细_蓝字", cellStyle); |
| | | |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = true; //上锁 |
| | | styles.Add("微黑_9_V中H中_换行_全框细_上锁", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Red_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | styles.Add("微黑_红9_V中H中_换行_全框细", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.PaleBlue.Index; |
| | | styles.Add("微黑_9_V中H中_换行_全框细_蓝背景", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = true; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.PaleBlue.Index; |
| | | styles.Add("微黑_9_V中H中_换行_全框细_蓝背景_上锁", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Blue_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = true; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.PaleBlue.Index; |
| | | styles.Add("微黑_9蓝_V中H中_换行_全框细_蓝背景_上锁", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Right; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.BrightGreen.Index; |
| | | styles.Add("微黑_9_V中H右_换行_全框细_绿背景", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.LemonChiffon.Index; |
| | | styles.Add("微黑_9_V中H中_换行_全框细_柠檬黄背景", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Right; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.LemonChiffon.Index; |
| | | styles.Add("微黑_9_V中H右_换行_全框细_柠檬黄背景", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = true; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.LemonChiffon.Index; |
| | | styles.Add("微黑_9_V中H中_换行_全框细_柠檬黄背景_上锁", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (false); |
| | | cellStyle.IsLocked = false; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.DataFormat = (df.GetFormat("m-d h:mm")); |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.LemonChiffon.Index; |
| | | styles.Add("微黑_9_V中H中_不换行_全框细_柠檬黄背景_日期", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (true); |
| | | cellStyle.IsLocked = false; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.LightTurquoise.Index; |
| | | styles.Add("微黑_9_V中H中_换行_全框细_淡蓝背景", cellStyle); |
| | | |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_9_Black_Font); |
| | | cellStyle.WrapText = (false); |
| | | cellStyle.IsLocked = false; |
| | | cellStyle.FillPattern = FillPattern.SolidForeground; |
| | | cellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.LightTurquoise.Index; |
| | | cellStyle.DataFormat = (df.GetFormat("m-d h:mm")); |
| | | styles.Add("微黑_9_V中H中_不换行_全框细_淡蓝背景_日期", cellStyle); |
| | | |
| | | |
| | | NPOI.SS.UserModel.IFont Bold_13_Black_Font = wb.CreateFont(); |
| | | Bold_13_Black_Font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Bold; |
| | | Bold_13_Black_Font.FontHeight = 13 * 20; //字体高度,XLSX下有字体大小问题 |
| | | //Bold_15_Black_Font.FontHeightInPoints = 10; //字体高度,XLS下有大小问题 |
| | | Bold_13_Black_Font.FontName = "黑体"; |
| | | |
| | | NPOI.SS.UserModel.IFont Bold_15_Black_Font = wb.CreateFont(); |
| | | Bold_15_Black_Font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Bold; |
| | | Bold_15_Black_Font.FontHeight = 15 * 20; //字体高度,XLSX下有字体大小问题 |
| | | //Bold_15_Black_Font.FontHeightInPoints = 10; //字体高度,XLS下有大小问题 |
| | | Bold_15_Black_Font.FontName = "黑体"; |
| | | |
| | | NPOI.SS.UserModel.IFont MsFont_12_Black_Font = wb.CreateFont(); |
| | | MsFont_12_Black_Font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.Normal; |
| | | SetFontHeight(MsFont_12_Black_Font, 12); |
| | | MsFont_12_Black_Font.FontName = "微软雅黑"; |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(Bold_13_Black_Font); |
| | | //cellStyle.WrapText = (false);//换行 |
| | | styles.Add("Bold_13_Black_Font", cellStyle); |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(Bold_15_Black_Font); |
| | | //cellStyle.WrapText = (false); |
| | | styles.Add("Bold_15_Black_Font", cellStyle); |
| | | |
| | | |
| | | cellStyle = CreateBorderedStyle(wb, BorderStyle.Thin); |
| | | cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; |
| | | cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; |
| | | cellStyle.SetFont(MsFont_12_Black_Font); |
| | | //cellStyle.WrapText = (true);//换行 |
| | | cellStyle.IsLocked = true; |
| | | styles.Add("微黑_12_V中H中_全框细_上锁", cellStyle); |
| | | |
| | | return styles; |
| | | } |
| | | |
| | | protected NPOI.SS.UserModel.ICellStyle CreateBorderedStyle(NPOI.SS.UserModel.IWorkbook wb, |
| | | NPOI.SS.UserModel.BorderStyle defaltBorderStyle = NPOI.SS.UserModel.BorderStyle.Thin) |
| | | { |
| | | NPOI.SS.UserModel.ICellStyle style = wb.CreateCellStyle(); |
| | | style.BorderRight = defaltBorderStyle; |
| | | style.BorderBottom = defaltBorderStyle; |
| | | style.BorderLeft = defaltBorderStyle; |
| | | style.BorderTop = defaltBorderStyle; |
| | | style.RightBorderColor = (NPOI.SS.UserModel.IndexedColors.Black.Index); |
| | | style.BottomBorderColor = (NPOI.SS.UserModel.IndexedColors.Black.Index); |
| | | style.LeftBorderColor = (NPOI.SS.UserModel.IndexedColors.Black.Index); |
| | | style.TopBorderColor = (NPOI.SS.UserModel.IndexedColors.Black.Index); |
| | | return style; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | public class ToExcelTemplate:ExcelBaseNPOI |
| | | { |
| | | private ToExcelTemplate() { } |
| | | public ToExcelTemplate() { } |
| | | public ToExcelTemplate(string filePath, string sheetName = "") : base(filePath, sheetName) { } |
| | | |
| | | public static string FileName |
| | |
| | | #endregion |
| | | |
| | | |
| | | private string[] GetOrg() { |
| | | public string[] GetOrg() { |
| | | List<string> list = new List<string>(); |
| | | using (DBContext db = new DBContext()) |
| | | { |
| | | list = db.Database.SqlQuery<string>("select CONVERT(varchar,Id)+'>'+[Name] as text from DIX.dbo.OrgInfo with(nolock) order by Id asc ").ToList(); |
| | | list = db.Database.SqlQuery<string>("select CONVERT(varchar,Id)+'>'+[Name] as text from DIX.dbo.OrgInfo with(nolock) where parentId = 0 order by Id asc ").ToList(); |
| | | } |
| | | string[] arr = list.ToArray<string>(); |
| | | return arr; |
| | | } |
| | | |
| | | private string[] GetInspectObjectType() |
| | | public string[] GetInspectObjectType() |
| | | { |
| | | string GetInspectObjectTypeExcel = System.Configuration.ConfigurationManager.AppSettings["GetInspectObjectTypeExcel"].ToString(); |
| | | List<string> list = new List<string>(); |
| | | using (DBContext db = new DBContext()) |
| | | { |
| | | list = db.Database.SqlQuery<string>("select CONVERT(varchar,Id)+'>'+[Name] as text from DIX.meta.InspectObjectType with(nolock) order by Id asc ").ToList(); |
| | | list = db.Database.SqlQuery<string>("meta.p_GetInspectObjectTypeExcel '"+ GetInspectObjectTypeExcel + "' ").ToList(); |
| | | } |
| | | string[] arr = list.ToArray<string>(); |
| | | return arr; |
| | | } |
| | | |
| | | private string[] GetInspectArea() |
| | | public string[] GetInspectArea() |
| | | { |
| | | List<string> list = new List<string>(); |
| | | using (DBContext db = new DBContext()) |
| | |
| | | return arr; |
| | | } |
| | | |
| | | private string[] GetInspectType() |
| | | public string[] GetInspectType() |
| | | { |
| | | List<string> list = new List<string>(); |
| | | using (DBContext db = new DBContext()) |
| | |
| | | return arr; |
| | | } |
| | | |
| | | private string[] GetInspectFrequency() |
| | | public string[] GetInspectFrequency() |
| | | { |
| | | List<string> list = new List<string>(); |
| | | using (DBContext db = new DBContext()) |
| | |
| | | return arr; |
| | | } |
| | | |
| | | private string[] GetInspectStatu() |
| | | public string[] GetInspectStatu() |
| | | { |
| | | List<string> list = new List<string>(); |
| | | using (DBContext db = new DBContext()) |
| | |
| | | { |
| | | public class StatementBusiness |
| | | { |
| | | public Receive GetICS(int InspectObjectTypeId, int InspectTypeId, DateTime TimeBegin, DateTime TimeEnd, int PageIndex, int PageSize) |
| | | public Receive GetICS(int OrgId,int InspectObjectTypeId, int InspectTypeId, DateTime TimeBegin, DateTime TimeEnd, int PageIndex, int PageSize) |
| | | { |
| | | Receive receive = new Receive(); |
| | | try |
| | |
| | | using (DBContext db = new DBContext()) |
| | | { |
| | | System.Data.SqlClient.SqlParameter[] paramList = new System.Data.SqlClient.SqlParameter[] { |
| | | new System.Data.SqlClient.SqlParameter("@OrgId", OrgId), |
| | | new System.Data.SqlClient.SqlParameter("@IspectObjectTypeId", InspectObjectTypeId), |
| | | new System.Data.SqlClient.SqlParameter("@InspectTypeId", InspectTypeId), |
| | | new System.Data.SqlClient.SqlParameter("@TimeBegin", TimeBegin), |
| | |
| | | }; |
| | | int index = paramList.Length - 1; |
| | | paramList[index].Direction = ParameterDirection.Output; |
| | | List<EntityISC> list = db.Database.SqlQuery<EntityISC>("exec dbo.zp_GetICS @IspectObjectTypeId,@InspectTypeId,@TimeBegin,@TimeEnd,@pageIndex,@pageSize,@Total output ", paramList).ToList(); |
| | | List<EntityISC> list = db.Database.SqlQuery<EntityISC>("exec dbo.zp_GetICS @OrgId,@IspectObjectTypeId,@InspectTypeId,@TimeBegin,@TimeEnd,@pageIndex,@pageSize,@Total output ", paramList).ToList(); |
| | | receive.rows = list; |
| | | receive.total = int.Parse(paramList[index].Value.ToString()); |
| | | |
| | |
| | | System.Data.SqlClient.SqlParameter[] paramList = new System.Data.SqlClient.SqlParameter[2]; |
| | | paramList[0] = new System.Data.SqlClient.SqlParameter("@UserCode", UserNo); |
| | | paramList[1] = new System.Data.SqlClient.SqlParameter("@Password", psdTemp); |
| | | r = db.Database.SqlQuery<RSP>("EXEC dbo.p_SonyUserUpload @UserCode,@Password ", paramList).FirstOrDefault(); |
| | | paramList[1] = new System.Data.SqlClient.SqlParameter("@PasswordStr", password); |
| | | r = db.Database.SqlQuery<RSP>("EXEC dbo.p_SonyUserUpload @UserCode,@Password,@PasswordStr ", paramList).FirstOrDefault(); |
| | | } |
| | | return r; |
| | | } |
| | |
| | | return record; |
| | | } |
| | | |
| | | public Receive GetInspectBook(string InspectObjectCode, DateTime TimeBegin, DateTime TimeEnd, int Status, int rows, int page,string filterType ) |
| | | public Receive GetInspectBook(string InspectObjectCode, DateTime TimeBegin, DateTime TimeEnd, int Status, int rows, int page,string filterType,int UserId ) |
| | | { |
| | | int Total = 0; |
| | | Receive record = new Receive(); |
| | |
| | | new System.Data.SqlClient.SqlParameter("@pageSize", rows), |
| | | new System.Data.SqlClient.SqlParameter("@pageIndex", page), |
| | | new System.Data.SqlClient.SqlParameter("@FilterType", filterType), |
| | | new System.Data.SqlClient.SqlParameter("@UserId", UserId), |
| | | new System.Data.SqlClient.SqlParameter("@Total", Total), |
| | | }; |
| | | int index = paramList.Length - 1; |
| | | paramList[index].Direction = ParameterDirection.Output; |
| | | record.rows = db.Database.SqlQuery<ReceiveInspectBook>("exec biz.p_getInspectBook @InspectObjectCode,@TimeBegin,@TimeEnd,@Status,@pageSize,@pageIndex,@FilterType,@Total output ", paramList).ToList(); |
| | | record.rows = db.Database.SqlQuery<ReceiveInspectBook>("exec biz.p_getInspectBook @InspectObjectCode,@TimeBegin,@TimeEnd,@Status,@pageSize,@pageIndex,@FilterType,@UserId,@Total output ", paramList).ToList(); |
| | | record.total = int.Parse(paramList[index].Value.ToString()); |
| | | } |
| | | record.Code = 200; |
| | |
| | | return record; |
| | | } |
| | | |
| | | public Receive ApproveAgreeAll(int UserId, string Remark, string AppendixUrl) |
| | | { |
| | | Receive record = null; |
| | | using (DBContext db = new DBContext()) |
| | | { |
| | | System.Data.SqlClient.SqlParameter[] paramList = new System.Data.SqlClient.SqlParameter[] { |
| | | new System.Data.SqlClient.SqlParameter("@UserId", UserId), |
| | | new System.Data.SqlClient.SqlParameter("@Remark", Remark), |
| | | new System.Data.SqlClient.SqlParameter("@AppendixUrl", AppendixUrl), |
| | | }; |
| | | record = db.Database.SqlQuery<Receive>("EXEC meta.p_ApproveAgreeAll @UserId,@Remark,@AppendixUrl ", paramList).FirstOrDefault(); |
| | | } |
| | | return record; |
| | | } |
| | | |
| | | public Receive ApproveRefuse(int[] BillflowIdArr, int UserId,string Remark) |
| | | { |
| | | Receive record = null; |
| | |
| | | WorkflowNode tempRecord = db.WorkflowNode.Find(record.Id); |
| | | tempRecord.Code = record.Code; |
| | | tempRecord.Name = record.Name; |
| | | //tempRecord.WorkflowId = record.WorkflowId; |
| | | tempRecord.WorkflowId = record.WorkflowId; |
| | | tempRecord.NodeTypeId = record.NodeTypeId; |
| | | //tempRecord.NextNodeTypeId = record.NextNodeTypeId; |
| | | tempRecord.NextNodeTypeId = record.NextNodeTypeId; |
| | | tempRecord.MinRoleId = record.MinRoleId; |
| | | tempRecord.MaxRoleId = record.MaxRoleId; |
| | | tempRecord.OrderNo = record.OrderNo; |
| | |
| | | tempRecord.RoleTypeId = record.RoleTypeId; |
| | | tempRecord.RoleId = record.RoleId; |
| | | tempRecord.DetailLevel = record.DetailLevel; |
| | | tempRecord.ActiveType = record.ActiveType; |
| | | tempRecord.ChTime = record.ChTime; |
| | | tempRecord.ChUserId = record.ChUserId; |
| | | db.SaveChanges(); |
| | |
| | | public DBContext() |
| | | : base(_ConnectionString) |
| | | { |
| | | this.Database.CommandTimeout = 5184000; |
| | | //关闭初始化策略(Code First连接现有数据库) |
| | | try { System.Data.Entity.Database.SetInitializer<DBContext>(null); } catch (Exception er) { throw new Exception("数据库连接失败:" + _ConnectionString + "," + er.Message); } |
| | | |
| | |
| | | public string Remark { get; set; } |
| | | public string AppendixUrl { get; set; } |
| | | public string ApproveTimeStr { get; set; } |
| | | public string ActiveTimeStr { get; set; } |
| | | } |
| | | } |
| | |
| | | public string RoleName { get; set; } |
| | | |
| | | public int DetailLevel { get; set; } |
| | | public string ActiveType { get; set; } |
| | | |
| | | public DateTime CreateTime { get; set; } |
| | | public int CreateUserId { get; set; } |
| | |
| | | public int CreateUserId { get; set; } |
| | | public DateTime ChTime { get; set; } |
| | | public int ChUserId { get; set; } |
| | | |
| | | |
| | | public string ActiveType { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | string fileName = "InspectObjectTemplate.xls"; |
| | | string fullName = dir + fileName; |
| | | if (System.IO.File.Exists(fullName)) System.IO.File.Delete(fullName); |
| | | ExcelHelper.CreateExcel(fullName, "Sheet1"); |
| | | //ExcelHelper.CreateExcel(fullName, "Sheet1"); |
| | | new ExcelHelper().Create(fullName, "Sheet1", false); |
| | | return File(fullName, "application/ms-excel", fileName); |
| | | } |
| | | |
| | |
| | | /// <param name="page"></param> |
| | | /// <param name="rows"></param> |
| | | /// <returns></returns> |
| | | public ActionResult GetICS(int InspectObjectTypeId, int InspectTypeId, DateTime TimeBegin, DateTime TimeEnd, int page = 1, int rows = 200) |
| | | public ActionResult GetICS(int OrgId,int InspectObjectTypeId, int InspectTypeId, DateTime TimeBegin, DateTime TimeEnd, int page = 1, int rows = 200) |
| | | { |
| | | Receive receive = this._statementBusiness.GetICS(InspectObjectTypeId, InspectTypeId, TimeBegin, TimeEnd, page, rows); |
| | | Receive receive = this._statementBusiness.GetICS(OrgId,InspectObjectTypeId, InspectTypeId, TimeBegin, TimeEnd, page, rows); |
| | | return Json(receive); |
| | | } |
| | | |
| | |
| | | return View(); |
| | | } |
| | | |
| | | public ActionResult StartDIXQuality() { |
| | | return View(); |
| | | } |
| | | |
| | | public ActionResult InspectDetail(int InspectBookId = 0,int ShowBtn = 0) |
| | | { |
| | | //<input id="tbxInspectBookId" readonly="readonly" value='@ViewData["InspectBookId"]' /> |
| | |
| | | |
| | | |
| | | public ActionResult GetInspectBook(string InspectObjectCode, DateTime TimeBegin,DateTime TimeEnd,int Status,string filterType, int rows, int page) { |
| | | object obj = this._billBusiness.GetInspectBook(InspectObjectCode,TimeBegin, TimeEnd, Status, rows, page, filterType); |
| | | UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; |
| | | object obj = this._billBusiness.GetInspectBook(InspectObjectCode,TimeBegin, TimeEnd, Status, rows, page, filterType, ui.Id); |
| | | return Json(obj); |
| | | } |
| | | |
| | |
| | | using System.IO; |
| | | using System.Web; |
| | | using System.Web.Mvc; |
| | | using System.Web.Script.Serialization; |
| | | |
| | | namespace DIXWeb.Web |
| | | { |
| | |
| | | { |
| | | UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; |
| | | Receive receive = this._workListBusiness.GetMyNeedDealt(Code, ui.Id, page, rows); |
| | | return Json(receive); |
| | | return GetResultMax(receive); |
| | | } |
| | | public ActionResult ApproveAgree(int[] BillflowIdArr, string Remark,string AppendixUrl = "") |
| | | { |
| | |
| | | } |
| | | return Json(record); |
| | | } |
| | | |
| | | public ActionResult ApproveAgreeAll(string Remark, string AppendixUrl = "") |
| | | { |
| | | Receive record = null; |
| | | try |
| | | { |
| | | DateTime now = DateTime.Now; |
| | | UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; |
| | | record = this._workListBusiness.ApproveAgreeAll(ui.Id, Remark, AppendixUrl); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | record = new Receive() |
| | | { |
| | | Code = 500, |
| | | Message = ex.Message |
| | | }; |
| | | } |
| | | return Json(record); |
| | | } |
| | | |
| | | public ActionResult ApproveRefuse(int[] BillflowIdArr, string Remark) |
| | | { |
| | | Receive record = null; |
| | |
| | | } |
| | | return Json(receive); |
| | | } |
| | | |
| | | private ContentResult GetResultMax(Receive receive) { |
| | | JavaScriptSerializer serializer = new JavaScriptSerializer(); |
| | | serializer.MaxJsonLength = Int32.MaxValue; |
| | | ContentResult result = new ContentResult |
| | | { |
| | | Content = serializer.Serialize(receive), |
| | | ContentType = "application/json" |
| | | }; |
| | | return result; |
| | | } |
| | | } |
| | | } |
| | | //5105955045 张小东 5105955047 |
| | |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(record.ActiveType)) record.ActiveType = ""; |
| | | DateTime now = DateTime.Now; |
| | | UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; |
| | | record.ChUserId = ui.Id; |
| | |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(record.ActiveType)) record.ActiveType = ""; |
| | | DateTime now = DateTime.Now; |
| | | UserInfo ui = Util.SessionHelper.Session["UserInfo"] as UserInfo; |
| | | record.ChUserId = ui.Id; |
New file |
| | |
| | | |
| | | @{ |
| | | ViewBag.Title = "StartDIXQuality"; |
| | | Layout = "~/Views/Shared/_Layout_List.cshtml"; |
| | | } |
| | | |
| | | <link href="~/Scripts/TimePluggable/jquery.datetimepicker.css" rel="stylesheet" /> |
| | | <script src="~/Scripts/TimePluggable/jquery.datetimepicker.full.min.js"></script> |
| | | <script src="~/Scripts/Bill/StartDIXQuality.js"></script> |
| | | <div id="divStartDIXQualityWhere"> |
| | | <a id="btnStartDIXQualitySubmit" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-ok'">提交审批</a> |
| | | |
| | | 设备编号:<input name="code" style="width:120px;" type="text" /> |
| | | |
| | | 点检日期: |
| | | <input name="timeBegin" style="width:140px;" type="text" class="some_class" /> |
| | | 至 |
| | | <input name="timeEnd" style="width:140px;" type="text" class="some_class" /> |
| | | |
| | | 状态:<input type="radio" name="StatuSubmit" value="0" checked="checked" />未提交 <input type="radio" name="StatuSubmit" value="1" />已提交 |
| | | |
| | | <a id="btnStartDIXQualitySearch" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-search'">查询</a> |
| | | </div> |
| | | |
| | | <input id="selectStartDIXQualitySelected" type="text" style="overflow:hidden;display:block;width:0px;height:0px;border:none;" /> |
| | | <table id="tabStartDIXQualityTable" class="easyui-datagrid"></table> |
| | | |
| | | <div id="StartDIXQualityDialog" style="width:80%;margin:auto;"></div> |
| | | |
| | | |
| | |
| | | |
| | | <table id="tabICSSearch"> |
| | | <tr> |
| | | <td class="tabTitle">组织:</td> |
| | | <td class="tabCBB"> |
| | | <select id="searchICSInspectOrgId"></select> |
| | | |
| | | </td> |
| | | <td class="tabTitle">设备类别:</td> |
| | | <td class="tabCBB"> |
| | | <select id="searchICSInspectObjectType"></select> |
| | |
| | | <td></td> |
| | | </tr> |
| | | </table> |
| | | <table id="tabOIDTable" class="easyui-datagrid"></table> |
| | | |
| | | <div id="divOIDShow"> |
| | | <table id="tabOIDTable" class="easyui-datagrid"></table> |
| | | </div> |
| | | |
| | | <style type="text/css"> |
| | | #tabOIDSearch td { |
| | |
| | | <script src="~/Scripts/Workflow/MyNeedDealt.js"></script> |
| | | |
| | | <div id="searchMyNeedDealtToolBar"> |
| | | <a id="btnMyNeedDealtAgree" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-ok'">审批同意</a> |
| | | <a id="btnMyNeedDealtAgree" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-ok'">审批同意选中</a> |
| | | <a id="btnMyNeedDealtRefuse" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-no'">审批拒绝</a> |
| | | <a id="btnMyNeedDealtProcess" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-filter'">审批履历</a> |
| | | |
| | | <a id="btnMyNeedDealtAgreeAll" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-ok'">审批同意全部</a> |
| | | |
| | | <input id="searchMyNeedDealtCode" type="text" style="" class="easyui-textbox" data-options="prompt:'编号'" /> |
| | | <a id="btnMyNeedDealtSearch" class="easyui-linkbutton" href="#" data-options="iconCls:'icon-search'">搜索</a> |
| | |
| | | <td><input style="width:100%" type="number" id="dgWorkflowNDetailLevel" class="easyui-textbox" data-options="prompt:'执行顺序'" /></td> |
| | | <td><div class="errorMsg"></div></td> |
| | | </tr> |
| | | <tr> |
| | | <th>激活类型:</th> |
| | | <td><input style="width:100%" type="text" id="dgWorkflowNDetailActiveType" class="easyui-textbox" data-options="prompt:'激活类型'" /></td> |
| | | <td><div class="errorMsg"></div></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | |
| | | <add key="UnobtrusiveJavaScriptEnabled" value="true"/> |
| | | <add key="TwoDCodeSize" value="160"/> |
| | | <add key="InspectObjectIsNeedStr" value="1>是,0>否"/> |
| | | <add key="GetInspectObjectTypeExcel" value="2"/> |
| | | </appSettings> |
| | |
| | | <Content Include="Scripts\Bill\PartialInspectFalseDetail.js" /> |
| | | <Content Include="Scripts\Bill\ReckUpdateHistory.js" /> |
| | | <Content Include="Scripts\Bill\StartDIX.js" /> |
| | | <Content Include="Scripts\Bill\StartDIXQuality.js" /> |
| | | <Content Include="Scripts\Bill\StartFCDIX.js" /> |
| | | <Content Include="Scripts\Bill\StartIndex.js" /> |
| | | <Content Include="Scripts\bootstrap.js" /> |
| | |
| | | <Content Include="Areas\GlobalM\Views\Bill\InspectFalseDetail.cshtml" /> |
| | | <Content Include="Areas\GlobalM\Views\Statement\ObjectInspectDetail.cshtml" /> |
| | | <Content Include="Areas\GlobalM\Views\WorkflowRoute\EntrustIndex.cshtml" /> |
| | | <Content Include="Areas\GlobalM\Views\Bill\StartDIXQuality.cshtml" /> |
| | | <None Include="Scripts\jquery-1.10.2.intellisense.js" /> |
| | | <Content Include="Scripts\Download\TwoDCodeView.js" /> |
| | | <Content Include="Scripts\echarts.common.min.js" /> |
| | |
| | | <Content Include="Static\All.css" /> |
| | | <Content Include="Static\Css\All.css" /> |
| | | <Content Include="Static\Css\MinMaxImg.css" /> |
| | | <Content Include="Template\InspectObjectTemplate.xls" /> |
| | | <Content Include="Upload\FIle\_.txt" /> |
| | | <Content Include="Upload\Img\_.txt" /> |
| | | <Content Include="Upload\_.txt" /> |
| | |
| | | <Content Include="Views\User\Search.cshtml" /> |
| | | <Content Include="Scripts\jquery-1.10.2.min.map" /> |
| | | <Content Include="Views\UserInRole\Index.cshtml" /> |
| | | <Content Include="Template\InspectObjectTemplate.xls" /> |
| | | <Content Include="Views\MotifInfo\Form.cshtml" /> |
| | | <Content Include="Views\MotifInfo\Index.cshtml" /> |
| | | <Content Include="Views\MotifInfo\warningForm.cshtml" /> |
| | |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ApproveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ActiveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | //将tr添加到表格 |
| | | $table.append($tr); |
| | | } |
| | |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ApproveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ActiveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | //将tr添加到表格 |
| | | $table.append($tr); |
| | | } |
| | |
| | | pagination: true, |
| | | rownumbers: true, |
| | | pagePosition: 'bottom', |
| | | pageSize: 10000, |
| | | pageSize: 1000, |
| | | pageNumber: 1, |
| | | fitColumns: true, |
| | | pageList: [2, 10, 15, 20, 30, 50,100,1000,10000], |
New file |
| | |
| | | $(function () { |
| | | initTimeControl(); |
| | | initStartDIXQualityTable(); |
| | | //initStartDIXQualityDialog(); |
| | | initStartDIXQualityClick(); |
| | | }) |
| | | |
| | | |
| | | |
| | | function initStartDIXQualityTable() { |
| | | $('#tabStartDIXQualityTable').empty(); |
| | | var param = getStartDIXQualitySearchParam(); |
| | | $('#tabStartDIXQualityTable').datagrid({ |
| | | singleSelect: false, |
| | | url: '../../GlobalM/Bill/GetInspectBook', |
| | | queryParams: param, |
| | | idField: 'Id', |
| | | animate: true, |
| | | pagination: true, |
| | | rownumbers: true, |
| | | pagePosition: 'bottom', |
| | | pageSize: 1000, |
| | | pageNumber: 1, |
| | | fitColumns: true, |
| | | pageList: [2, 10, 15, 20, 30, 50, 100, 1000, 10000], |
| | | toolbar: '#searchPowerToolBar', |
| | | //数据格式 |
| | | columns: [[ |
| | | { title: '序号', width: 30, field: 'Id', hidden: true, }, |
| | | { checkbox: true, field: 'CreateDIXId', }, |
| | | { title: '设备类别', width: 80, field: 'MachineTypeName', }, |
| | | { title: '设备编码', width: 80, field: 'MachineCode', }, |
| | | { title: '设备名称', width: 80, field: 'MachineName', }, |
| | | { title: '设备区域', width: 80, field: 'MachineArea', }, |
| | | { title: '设备位置', width: 80, field: 'MachineLocation', }, |
| | | { title: '点检类别', width: 80, field: 'DIXTypeName', }, |
| | | { title: '点检频率', width: 80, field: 'DIXFrequencyName', }, |
| | | { |
| | | title: '设备状态', width: 80, field: 'MachinaStatu', formatter: function (value, row, index) { |
| | | if (value == '1') { |
| | | return "使用中"; |
| | | } else if (value == '2') { |
| | | return "备用中"; |
| | | } else if (value == '3') { |
| | | return "维修中"; |
| | | } else if (value == '4') { |
| | | return "闲置中"; |
| | | } else if (value == '5') { |
| | | return "报废"; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | title: '点检时间', width: 160, field: 'DIXTime', fixed: true, |
| | | formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | | }, |
| | | }, |
| | | { |
| | | title: '总判定', width: 80, field: 'FinalJudge', formatter: function (value, row, index) { |
| | | if (value == 1) { |
| | | return '<span>OK</span>'; |
| | | } else if (value == 2) { |
| | | return '<span style="color:red;font-weight:bold;">NG</span>'; |
| | | } else if (value == 3) { |
| | | return '<span style="color:gray;">维修</span>'; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | title: '状态', width: 80, field: 'Status', formatter: function (value, row, index) { |
| | | if (value == 1) { |
| | | return '已提交'; |
| | | } else if (value == 0) { |
| | | return '未提交'; |
| | | } |
| | | }, |
| | | }, |
| | | ]], |
| | | loadFilter: function (data) { |
| | | if (data.Code == 200) { |
| | | return data; |
| | | } else { |
| | | alert(data.Message); |
| | | } |
| | | }, |
| | | onLoadSuccess: function () { |
| | | var selectedList = $('#selectStartDIXQualitySelected').val(); |
| | | var powerArray = selectedList.split(','); |
| | | for (var i = 0; i < powerArray.length; i++) { |
| | | if (powerArray[i] == '') continue; |
| | | $(this).datagrid('selectRecord', powerArray[i]); |
| | | } |
| | | }, |
| | | onCheck: function (index, row) { |
| | | var selectedList = $('#selectStartDIXQualitySelected').val(); |
| | | var oldStr = ',' + row.Id; |
| | | if (isContainsArr(selectedList, oldStr, ',')) return;//当包含字串时,不再新增 |
| | | selectedList = selectedList + oldStr; |
| | | $('#selectStartDIXQualitySelected').val(selectedList); |
| | | }, |
| | | onUncheck: function (index, row) { |
| | | var selectedList = $('#selectStartDIXQualitySelected').val(); |
| | | var oldStr = ',' + row.Id; |
| | | if (isContainsArr(selectedList, oldStr, ',')) selectedList = arrStrRemoveStr(selectedList, oldStr, ','); |
| | | $('#selectStartDIXQualitySelected').val(selectedList); |
| | | }, |
| | | onSelectAll: function (rows) { |
| | | var selectedList = $('#selectStartDIXQualitySelected').val(); |
| | | var oldStr = ''; |
| | | for (var i in rows) { |
| | | oldStr = ',' + rows[i].Id; |
| | | if (isContainsArr(selectedList, oldStr, ',')) continue; |
| | | selectedList = selectedList + oldStr; |
| | | } |
| | | $('#selectStartDIXQualitySelected').val(selectedList); |
| | | }, |
| | | onUnselectAll: function (rows) { |
| | | var selectedList = $('#selectStartDIXQualitySelected').val(); |
| | | var oldStr = ''; |
| | | for (var i in rows) { |
| | | oldStr = ',' + rows[i].Id; |
| | | if (isContainsArr(selectedList, oldStr, ',')) selectedList = arrStrRemoveStr(selectedList, oldStr, ','); |
| | | } |
| | | $('#selectStartDIXQualitySelected').val(selectedList); |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function initStartDIXQualityClick() { |
| | | //点击提交按钮 |
| | | $('#btnStartDIXQualitySubmit').click(function () { |
| | | if (confirm('确认提交单据?')) { |
| | | var rows = $('#tabStartDIXQualityTable').datagrid('getSelections'); |
| | | var bookIdArr = new Array(); |
| | | var billTypeIdArr = new Array(); |
| | | if (rows.length <= 0) { |
| | | alert('请选择至少一行数据!'); |
| | | return; |
| | | } |
| | | for (var i = 0; i < rows.length; i++) { |
| | | if (!bookIdArr.includes(rows[i].Id)) { |
| | | bookIdArr.push(rows[i].Id); |
| | | billTypeIdArr.push(rows[i].BillTypeId); |
| | | } |
| | | } |
| | | debugger; |
| | | var param = { BookIdArr: bookIdArr, BillTypeArr: billTypeIdArr }; |
| | | var data = ajaxSame('../../GlobalM/Bill/StartDIXWorkflow', param, 'POST', 'json'); |
| | | if (data.Code == 200) { |
| | | $('#selectStartDIXQualitySelected').val(''); |
| | | $('#tabStartDIXQualityTable').datagrid('clearSelections'); |
| | | } else { |
| | | alert(data.Message); |
| | | } |
| | | initStartDIXQualityTable(); |
| | | reloadHomeIndexAttention(); |
| | | } |
| | | }); |
| | | |
| | | //点击查询按钮 |
| | | $('#btnStartDIXQualitySearch').click(function () { |
| | | var param = getStartDIXQualitySearchParam(); |
| | | $('#tabStartDIXQualityTable').datagrid('reload', param); |
| | | }); |
| | | |
| | | //点击是否提交 |
| | | $('#divStartDIXQualityWhere input[type="radio"]').dblclick(function () { |
| | | var isCheck = $(this).is(':checked'); |
| | | if (isCheck) { |
| | | $(this).attr('checked', false); |
| | | } else { |
| | | $(this).attr('checked', true); |
| | | } |
| | | }); |
| | | } |
| | | function getStartDIXQualitySearchParam() { |
| | | var $div = $('div#divStartDIXQualityWhere'); |
| | | var code = $div.find('input[name=code]').first().val(); |
| | | var timeBegin = $div.find('input[name=timeBegin]').first().val(); |
| | | var timeEnd = $div.find('input[name=timeEnd]').first().val(); |
| | | if (timeBegin != '') { |
| | | timeBegin += ':00'; |
| | | } else { |
| | | timeBegin = '1900/01/01 00:00:00'; |
| | | } |
| | | if (timeEnd != '') { |
| | | timeEnd += ':00'; |
| | | } else { |
| | | timeEnd = '1900/01/01 00:00:00'; |
| | | } |
| | | var status = -1; |
| | | $div.find('input[name=StatuSubmit]').each(function (index, element) { |
| | | if ($(element).is(':checked')) { |
| | | status = $(element).val(); |
| | | } |
| | | }); |
| | | var param = { InspectObjectCode: code, TimeBegin: timeBegin, TimeEnd: timeEnd, Status: status, filterType: 'quality' } |
| | | return param; |
| | | } |
| | | |
| | | //初始化提示框 |
| | | function initStartDIXQualityDialog() { |
| | | $('#StartDIXQualityDialog').dialog({ |
| | | closed: true,//默认关闭状态 |
| | | closable: false,//不提供关闭页面 |
| | | top: 10, |
| | | //left: 10, |
| | | resizable: false,//是否可改变窗口大小 |
| | | modal: true,//模式化窗口,打开其他地方不可点击 |
| | | buttons: [{ |
| | | text: '关闭', |
| | | iconCls: 'icon-cancel', |
| | | handler: function () { |
| | | $('#StartDIXQualityDialog').empty(); |
| | | $('#StartDIXQualityDialog').dialog({ closed: true, }); |
| | | } |
| | | }], |
| | | }); |
| | | } |
| | | |
| | | |
| | | function initTimeControl() { |
| | | $.datetimepicker.setLocale('zh'); |
| | | $('.some_class').datetimepicker(); |
| | | } |
| | | |
| | | |
| | | function reloadHomeIndexAttention() { |
| | | //return; |
| | | $.ajax({ |
| | | url: '../../GlobalM/Bill/GetNeedDealtNum', |
| | | data: null, |
| | | type: 'POST', |
| | | dataType: 'json', |
| | | async: true, |
| | | success: function (data) { |
| | | var $span = $('#HomeIndexAttention', window.parent.document); |
| | | $span.empty(); |
| | | console.info(data); |
| | | if (data.Code == 200) { |
| | | var arr = data.Message.split(','); |
| | | var needDealt = parseInt(arr[0]); |
| | | var isRepair = parseInt(arr[1]); |
| | | var $temp = $(''); |
| | | if (needDealt > 0) { |
| | | $temp = $('<span> 需待办:<span style="color:red;font-weight:bold;">' + needDealt + '<span><span>'); |
| | | } else { |
| | | $temp = $('<span> 需待办:<span>' + needDealt + '<span><span>'); |
| | | } |
| | | $span.append($temp); |
| | | if (isRepair > 0) { |
| | | $temp = $('<span> 需维修:<span style="color:red;font-weight:bold;">' + isRepair + '<span><span>'); |
| | | } else { |
| | | $temp = $('<span> 需维修:<span>' + isRepair + '<span><span>'); |
| | | } |
| | | $span.append($temp); |
| | | } else { |
| | | |
| | | } |
| | | }, |
| | | error: function (data) { |
| | | result = data; |
| | | }, |
| | | }); |
| | | } |
| | |
| | | pagination: true, |
| | | rownumbers: true, |
| | | pagePosition: 'bottom', |
| | | pageSize: 10000, |
| | | pageSize: 1000, |
| | | pageNumber: 1, |
| | | fitColumns: true, |
| | | pageList: [2, 10, 15, 20, 30, 50,100,1000,10000], |
| | |
| | | }, |
| | | ]], |
| | | loadFilter: function (data) { |
| | | debugger; |
| | | if (data.Code == 200) { |
| | | return data; |
| | | } else { |
| | |
| | | pagePosition: 'bottom', |
| | | pageSize: 10, |
| | | pageNumber: 1, |
| | | pageList: [2, 10, 15, 20, 30, 50], |
| | | pageList: [2, 10, 15, 20, 30, 50,100,200,500,1000], |
| | | toolbar: '#searchUserToolBar', |
| | | columns: [[ |
| | | { title: '序号', width: 100, field: 'Id', hidden: true }, |
| | | { title: '编号', width: 80, field: 'UserNo', }, |
| | | { title: '名称', width: 80, field: 'UserName', }, |
| | | { title: '组织', width: 80, field: 'OrgName', }, |
| | | { title: '角色', width: 80, field: 'RoleName', }, |
| | | { title: '组织', width: 120, field: 'OrgName', }, |
| | | { title: '角色', width: 120, field: 'RoleName', }, |
| | | { title: '电话', width: 100, field: 'MobilePhone', }, |
| | | { title: '座机', width: 100, field: 'Tel', }, |
| | | { title: '邮件', width: 100, field: 'Email', }, |
| | | { title: '地址', width: 100, field: 'Address', }, |
| | | /* |
| | | { |
| | | title: '生日', width: 100, field: 'BirthDay', |
| | | formatter: function (value, row, index) { |
| | |
| | | return time.getFullYear() + '-' + (time.getMonth()+1) + '-' + time.getDate(); |
| | | } |
| | | }, |
| | | { title: '身份证', width: 100, field: 'IdCard', }, |
| | | */ |
| | | //{ title: '身份证', width: 100, field: 'IdCard', }, |
| | | { |
| | | title: '状态', width: 100, field: 'UserStatu', formatter: function (value, row, index) { |
| | | if (value == 1) { |
| | |
| | | |
| | | function initICSCombobox() { |
| | | var $option = $(''); |
| | | var $inspectOrgId = $('#searchICSInspectOrgId'); |
| | | var $inspectObjectType = $('#searchICSInspectObjectType'); |
| | | var $inspectType = $('#searchICSInspectType'); |
| | | $inspectOrgId.empty(); |
| | | $inspectObjectType.empty(); |
| | | $inspectType.empty(); |
| | | |
| | | var data = ajaxSame('../../GlobalM/Org/GetDropDownListOrg', null, 'post', 'json'); |
| | | if (typeof (data) == 'string') data = $.parseJSON(data); |
| | | for (var i in data) { |
| | | if (data[i].Id == -1) { |
| | | $option = $('<option value = "' + data[i].Id + '" selected = "selected">' + data[i].Text + '</option>'); |
| | | } else { |
| | | $option = $('<option value = "' + data[i].Id + '" >' + data[i].Text + '</option>'); |
| | | } |
| | | $inspectOrgId.append($option); |
| | | } |
| | | |
| | | var data = ajaxSame('../../GlobalM/Statement/GetInspectObjectType', null, 'post', 'json'); |
| | | for (var i in data) { |
| | |
| | | var timeEnd = $('#searchICStimeEnd').val(); |
| | | var inspectObjectType = $('#searchICSInspectObjectType').val(); |
| | | var inspectType = $('#searchICSInspectType').val(); |
| | | var param = { TimeBegin: timeBegin, TimeEnd: timeEnd, InspectObjectTypeId: inspectObjectType, InspectTypeId: inspectType } |
| | | var OrgId = $('#searchICSInspectOrgId').val(); |
| | | var param = { TimeBegin: timeBegin, TimeEnd: timeEnd, InspectObjectTypeId: inspectObjectType, InspectTypeId: inspectType, OrgId: OrgId } |
| | | return param; |
| | | } |
| | | |
| | |
| | | var dataOIDECharts = []; |
| | | |
| | | $(function () { |
| | | initOIDHeight() |
| | | //initOIDHeight() |
| | | initOIDTime(); |
| | | initOIDClick(); |
| | | }); |
| | |
| | | function initOIDHeight(){ |
| | | var pageHeight = $('#page', window.parent.document).height(); |
| | | var whereHeight = $('#tabOIDSearch').height(); |
| | | var showHeight = parseInt(pageHeight) - parseInt(whereHeight); |
| | | debugger; |
| | | $('#tabOIDTable').css({ "width": "100%", "height": showHeight + "px" }); |
| | | var showHeight = parseInt(pageHeight) - parseInt(whereHeight) - 50; |
| | | $('#tabOIDTable').datagrid({ |
| | | height: showHeight, |
| | | }); |
| | | } |
| | | |
| | | function initOIDTime() { |
| | |
| | | |
| | | |
| | | function initOIDTable() { |
| | | initOIDHeight(); |
| | | $('#tabOIDTable').empty(); |
| | | var param = getOIDSearchParam(); |
| | | console.info(param); |
| | |
| | | } |
| | | }, |
| | | }); |
| | | initOIDHeight(); |
| | | } |
| | | function getColumnsOID(colArr) { |
| | | var title = [ |
| | |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ApproveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ActiveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | //将tr添加到表格 |
| | | $table.append($tr); |
| | | } |
| | |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ApproveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ActiveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | //将tr添加到表格 |
| | | $table.append($tr); |
| | | } |
| | |
| | | pagination: true, |
| | | rownumbers: true, |
| | | pagePosition: 'bottom', |
| | | pageSize: 10000, |
| | | pageSize: 1000, |
| | | pageNumber: 1, |
| | | pageList: [2, 5,10, 20, 50, 100,1000,10000], |
| | | toolbar: '#searchMyNeedDealtToolBar', |
| | |
| | | { title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | ]], |
| | | loadFilter: function (data) { |
| | | debugger; |
| | | if (data.Code == 200) { |
| | | return data; |
| | | } else { |
| | |
| | | } |
| | | clearPageMyNeedDealt(); |
| | | |
| | | }); |
| | | //点击同意全部代办 |
| | | $('#btnMyNeedDealtAgreeAll').click(function () { |
| | | if (confirm('确认审批同意全部代办?(若数据量大请耐心等待)')) { |
| | | var remark = $('#MyNeedDealtRemark').val(); |
| | | var param = { Remark: remark }; |
| | | var data = ajaxSame('../../GlobalM/WorkList/ApproveAgreeAll', param, 'post', 'json'); |
| | | if (data.Code == 200) { |
| | | reloadMyNeedDealtTable(); |
| | | reloadHomeIndexAttention(); |
| | | alert(data.Message); |
| | | } else { |
| | | alert(data.Message); |
| | | } |
| | | } |
| | | clearPageMyNeedDealt(); |
| | | }); |
| | | //点击拒绝 |
| | | $('#btnMyNeedDealtRefuse,#btnMyNeedDealtRefuseControl').click(function () { |
| | |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ApproveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | $td = $('<td style="padding:6px;text-align:center;">' + data.rows[i].ActiveTimeStr + '</td>'); |
| | | $tr.append($td); |
| | | //将tr添加到表格 |
| | | $table.append($tr); |
| | | } |
| | |
| | | pagination: true, |
| | | rownumbers: true, |
| | | pagePosition: 'bottom', |
| | | pageSize: 10, |
| | | pageSize: 20, |
| | | pageNumber: 1, |
| | | pageList: [2, 10, 15, 20, 30, 50,100], |
| | | toolbar: '#searchWorkflowToolBar', |
| | |
| | | columns: [[ |
| | | //{ checkbox: true, field: 'Id', fixed: true, }, |
| | | { title: '序号', width: 35, field: 'Id', hidden: true, }, |
| | | { title: '编号', width: 130, field: 'Code', }, |
| | | { title: '名称', width: 130, field: 'Name', }, |
| | | { title: '编号', width: 100, field: 'Code', }, |
| | | { title: '名称', width: 230, field: 'Name', }, |
| | | |
| | | { title: '审计地址', width: 200, field: 'AuditUrl', }, |
| | | { title: '浏览地址', width: 200, field: 'BrowseUrl', }, |
| | | { title: '开始地址', width: 200, field: 'StartUrl', }, |
| | | { title: '审计地址', width: 120, field: 'AuditUrl', }, |
| | | { title: '浏览地址', width: 120, field: 'BrowseUrl', }, |
| | | { title: '开始地址', width: 120, field: 'StartUrl', }, |
| | | { |
| | | title: '创建时间', width: 200, field: 'CreateTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | |
| | | pagePosition: 'bottom', |
| | | pageSize: 10, |
| | | pageNumber: 1, |
| | | pageList: [2, 10, 15, 20, 30, 50], |
| | | pageList: [2, 10, 15, 20, 30, 50,100], |
| | | toolbar: '#searchWorkflowNDetailToolBar', |
| | | //数据格式 |
| | | columns: [[ |
| | | { title: '序号', width: 35, field: 'Id', hidden: true, }, |
| | | { title: '节点序号', width: 35, field: 'NodeId', hidden: true, }, |
| | | { title: '节点名称', width: 180, field: 'NodeName', }, |
| | | { title: '节点名称', width: 230, field: 'NodeName', }, |
| | | { title: '组织类型序号', width: 35, field: 'OrgTypeId', hidden: true, }, |
| | | { title: '组织类型名称', width: 180, field: 'OrgTypeName', }, |
| | | //{ title: '组织类型名称', width: 180, field: 'OrgTypeName', }, |
| | | { title: '组织序号', width: 35, field: 'OrgId', hidden: true, }, |
| | | { title: '组织名称', width: 180, field: 'OrgName', }, |
| | | { title: '角色类型序号', width: 35, field: 'RoleTypeId', hidden: true, }, |
| | |
| | | { title: '角色序号', width: 35, field: 'RoleId', hidden: true, }, |
| | | { title: '角色名称', width: 180, field: 'RoleName', }, |
| | | { title: '执行顺序', width: 80, field: 'DetailLevel', }, |
| | | { title: '激活类型', width: 120, field: 'ActiveType', }, |
| | | { |
| | | title: '创建时间', width: 200, field: 'CreateTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | | } |
| | | }, |
| | | { title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | { title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | { |
| | | title: '变更时间', width: 200, field: 'ChangeTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | |
| | | $('#dgWorkflowNDetailRoleId').val(''); |
| | | $('#dgWorkflowNDetailRoleName').text(''); |
| | | $('#dgWorkflowNDetailLevel').textbox('setValue', ''); |
| | | $('#dgWorkflowNDetailActiveType').textbox('setValue', ''); |
| | | $('.errorMsg').text(''); |
| | | } |
| | | //获取dialog中的值 |
| | |
| | | var roleTypeId = $('#dgWorkflowNDetailRoleType').combobox('getValue'); |
| | | var roleId = $('#dgWorkflowNDetailRoleId').val(); |
| | | var level = $('#dgWorkflowNDetailLevel').textbox('getValue'); |
| | | var param = { Id: id, OrgTypeId: orgTypeId, OrgId: orgId, RoleTypeId: roleTypeId, RoleId: roleId, DetailLevel: level, NodeId: nodeId }; |
| | | var activeType = $('#dgWorkflowNDetailActiveType').textbox('getValue'); |
| | | var param = { Id: id, OrgTypeId: orgTypeId, OrgId: orgId, RoleTypeId: roleTypeId, RoleId: roleId, DetailLevel: level, NodeId: nodeId, ActiveType: activeType }; |
| | | console.info(param); |
| | | return param; |
| | | } |
| | |
| | | $('#dgWorkflowNDetailRoleId').val(data.rows.RoleId); |
| | | $('#dgWorkflowNDetailRoleName').text(data.rows.RoleName); |
| | | $('#dgWorkflowNDetailLevel').textbox('setValue', data.rows.DetailLevel); |
| | | $('#dgWorkflowNDetailActiveType').textbox('setValue', data.rows.ActiveType); |
| | | } else { |
| | | alert(data.rows); |
| | | } |
| | |
| | | var name = n.Name; |
| | | if (name == '本部门上级') { |
| | | $('#WorkflowNodeDialog td[title=WorkflowNodeRole]').removeClass('tdHidden'); |
| | | } else if (name == '分组流向') { |
| | | $('#WorkflowNodeDialog td[title=WorkflowNodeRole]').addClass('tdHidden'); |
| | | $('#WorkflowNodeDialog td[title=WorkflowNodeRole]:first').removeClass('tdHidden'); |
| | | } else { |
| | | $('#WorkflowNodeDialog td[title=WorkflowNodeRole]').addClass('tdHidden'); |
| | | } |
| | |
| | | pagination: true, |
| | | rownumbers: true, |
| | | pagePosition: 'bottom', |
| | | pageSize: 10, |
| | | pageSize: 30, |
| | | pageNumber: 1, |
| | | pageList: [2, 10, 15, 20, 30, 50], |
| | | toolbar: '#searchWorkflowNodeToolBar', |
| | |
| | | columns: [[ |
| | | //{ checkbox: true, field: 'Id', fixed: true, }, |
| | | { title: '序号', width: 35, field: 'Id', hidden: true, }, |
| | | { title: '编号', width: 150, field: 'Code', }, |
| | | { title: '名称', width: 150, field: 'Name', }, |
| | | { title: '编号', width: 120, field: 'Code', }, |
| | | { title: '名称', width: 230, field: 'Name', }, |
| | | { title: '类型序号', width: 35, field: 'NodeTypeId', hidden: true, }, |
| | | { title: '类型', width: 180, field: 'NodeTypeName', }, |
| | | { title: '最小角色序号', width: 35, field: 'MinRoleId', hidden: true, }, |
| | |
| | | return toDateStr(value); |
| | | } |
| | | }, |
| | | { title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | { title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | { |
| | | title: '变更时间', width: 200, field: 'ChangeTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | |
| | | //数据格式 |
| | | columns: [[ |
| | | { title: '序号', width: 35, field: 'Id', hidden: true, }, |
| | | { title: '编号', width: 150, field: 'Code', }, |
| | | { title: '名称', width: 150, field: 'Name', }, |
| | | { title: '编号', width: 100, field: 'Code', }, |
| | | { title: '名称', width: 230, field: 'Name', }, |
| | | { title: '类型序号', width: 35, field: 'NodeTypeId', hidden: true, }, |
| | | { title: '类型', width: 180, field: 'NodeTypeName', }, |
| | | { title: '最小角色序号', width: 35, field: 'MinRoleId', hidden: true, }, |
| | |
| | | { title: '最大角色名称', width: 150, field: 'MaxRoleName', }, |
| | | { title: '执行顺序', width: 80, field: 'OrderNo', }, |
| | | { |
| | | title: '创建时间', width: 200, field: 'CreateTime', formatter: function (value, row, index) { |
| | | title: '创建时间', width: 120, field: 'CreateTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | | } |
| | | }, |
| | | { title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | { title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | { |
| | | title: '变更时间', width: 200, field: 'ChangeTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | |
| | | columns: [[ |
| | | { title: '序号', width: 35, field: 'Id', hidden: true, }, |
| | | { title: '流程序号', width: 35, field: 'WorkflowId', hidden: true, }, |
| | | { title: '流程名称', width: 180, field: 'WorkflowName', }, |
| | | { title: '流程名称', width: 230, field: 'WorkflowName', }, |
| | | { title: '原指向节点序号', width: 35, field: 'FromNodeId', hidden: true, }, |
| | | { title: '原指向节点名称', width: 180, field: 'FromNodeName', }, |
| | | { title: '原指向节点名称', width: 230, field: 'FromNodeName', }, |
| | | { title: '被指向节点序号', width: 35, field: 'ToNodeId', hidden: true, }, |
| | | { title: '被指向节点名称', width: 180, field: 'ToNodeName', }, |
| | | { title: '被指向节点名称', width: 230, field: 'ToNodeName', }, |
| | | { |
| | | title: '指向类型', width: 180, field: 'ActionType', formatter: function (value, row, index) { |
| | | if (value == '-1') { |
| | |
| | | return toDateStr(value); |
| | | } |
| | | }, |
| | | { title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | { title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | { |
| | | title: '变更时间', width: 200, field: 'ChangeTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | |
| | | //{ checkbox: true, field: 'Id', fixed: true, }, |
| | | { title: '序号', width: 35, field: 'Id', hidden: true, }, |
| | | { title: '编号', width: 130, field: 'Code', }, |
| | | { title: '名称', width: 130, field: 'Name', }, |
| | | { title: '名称', width: 230, field: 'Name', }, |
| | | |
| | | { title: '审计地址', width: 200, field: 'AuditUrl', }, |
| | | { title: '浏览地址', width: 200, field: 'BrowseUrl', }, |
| | | { title: '开始地址', width: 200, field: 'StartUrl', }, |
| | | { title: '审计地址', width: 120, field: 'AuditUrl', }, |
| | | { title: '浏览地址', width: 120, field: 'BrowseUrl', }, |
| | | { title: '开始地址', width: 120, field: 'StartUrl', }, |
| | | { |
| | | title: '创建时间', width: 200, field: 'CreateTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |
| | | } |
| | | }, |
| | | { title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | { title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserId', hidden: true, }, |
| | | //{ title: '创建人', width: 100, field: 'CreateUserName', }, |
| | | { |
| | | title: '变更时间', width: 200, field: 'ChangeTime', formatter: function (value, row, index) { |
| | | return toDateStr(value); |