EvaluationForm.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. 
  2. function loadSuccessEvaluationTable(data) {
  3. if (data.length == 0) {
  4. return;
  5. }
  6. var evaluationTableID = $("#EvaluationTableID").combogridX("getValue");
  7. if (evaluationTableID != "" && evaluationTableID != "-1" && evaluationTableID != null) {
  8. loadColumsRank(evaluationTableID);
  9. }
  10. }
  11. function queryEvaluationTable() {
  12. var evaluationTableID = $("#EvaluationTableID").combogridX("getValue");
  13. if (evaluationTableID != "" && evaluationTableID != "-1" && evaluationTableID != null) {
  14. loadColumsRank(evaluationTableID);
  15. } else {
  16. loadColumsRank("");
  17. }
  18. }
  19. function loadColumsRank(evaluationTableID) {
  20. var dataColums = Invoke("/EvaluationForm/FormTitle", null, "jsonp", function (re) { });
  21. var dataList = Invoke("/EvaluationForm/Content?evaluationTableID=" + evaluationTableID, null, "jsonp", function (re) { });
  22. if (dataColums != undefined && dataColums != null) {
  23. if (dataList !== undefined && dataList != null) {
  24. var jsonData = { rows: eval("[" + dataList.rows + "]"), total: dataList.total };
  25. $("#dgEvaluationFormList").datagrid({
  26. columns: [[
  27. { field: 'OrderNo', title: '次序', width: 150, align: 'center' },
  28. { field: 'EvaluationProjectName', title: '评价项目', width: 350, align: 'center', formatter: formatCellTooltip },
  29. { field: 'Weight', title: '权重', width: 100, align: 'center' },
  30. { field: 'EvaluationNormName', title: '评分标准', width: 250, align: 'center' }]],
  31. data: jsonData,
  32. singleSelect: true,
  33. rownumbers: false,
  34. showFooter: true,
  35. striped: 'True',
  36. nowrap: true,
  37. fitColumns: false,
  38. rowStyler: function (index, row) {
  39. if (isNaN(row.OrderNo)) {
  40. return 'color:blue;';
  41. }
  42. }
  43. });
  44. }
  45. }
  46. }
  47. //格式化单元格提示信息
  48. function formatCellTooltip(val, rec) {
  49. return "<span title='" + val + "'>" + val + "</span>";
  50. }
  51. //设置列颜色为红色
  52. function SetRedColumn(index, row, value) {
  53. return " <span style=\"color: red;\">" + value + "</span>";
  54. }