RODDetailForm.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. Ext.define('erp.view.oa.officialDocument.receiveODManagement.RODDetailForm',{
  2. extend: 'Ext.form.Panel',
  3. alias: 'widget.erpRODDetailFormPanel',
  4. id: 'form',
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. region: 'center',
  7. frame : true,
  8. fieldDefaults: {
  9. labelWidth: 80,
  10. cls: 'form-field-allowBlank'
  11. },
  12. layout: {
  13. type: 'vbox',//hbox水平盒布局
  14. align: 'stretch' // Child items are stretched to full width子面板高度充满父容器
  15. },
  16. items: [{
  17. xtype: 'displayfield',
  18. fieldLabel: 'ID',
  19. id:'rod_id',
  20. name: 'rod_id'
  21. // },{
  22. // xtype: 'displayfield',
  23. // fieldLabel: '审批状态',
  24. // id:'rod_status',
  25. // name: 'rod_status'
  26. },{
  27. xtype: 'displayfield',
  28. fieldLabel: '收文类型',
  29. id:'rod_type',
  30. name: 'rod_type'
  31. }, {
  32. xtype: 'displayfield',
  33. fieldLabel: '收文日期',
  34. id:'rod_date',
  35. name: 'rod_date'
  36. }, {
  37. xtype: 'displayfield',
  38. fieldLabel: '来文标题',
  39. id:'rod_title',
  40. name: 'rod_title'
  41. }, {
  42. xtype: 'displayfield',
  43. fieldLabel: '来文单位',
  44. name: 'rod_unit',
  45. id: 'rod_unit'
  46. // }, {
  47. // xtype: 'displayfield',
  48. // fieldLabel: '登记人',
  49. // name: 'rod_registrant',
  50. // id: 'rod_registrant'
  51. }, {
  52. xtype: 'displayfield',
  53. fieldLabel: '秘密等级',
  54. name: 'rod_secretlevel',
  55. id: 'rod_secretlevel'
  56. }, {
  57. xtype: 'displayfield',
  58. fieldLabel: '紧急程度',
  59. name: 'rod_emergencydegree',
  60. id: 'rod_emergencydegree'
  61. },{
  62. xtype: 'displayfield',
  63. fieldLabel: '主题词',
  64. name: 'rod_subject',
  65. id: 'rod_subject'
  66. }, {
  67. xtype: 'displayfield',
  68. fieldLabel: '附件',
  69. name: 'rod_attach',
  70. id: 'rod_attach'
  71. },{
  72. xtype: 'htmleditor',
  73. hideLabel: true,
  74. autoScroll: true,
  75. readOnly: true,
  76. height: height*0.8,
  77. name: 'rod_context',
  78. id: 'rod_context',
  79. anchor: '100%'//编辑框******
  80. }],
  81. tbar: [{
  82. id: 'distribute',
  83. text: '转发文',
  84. iconCls: 'group-read',
  85. cls: 'x-btn-gray'
  86. }],
  87. buttonAlign: 'center',
  88. buttons: [{
  89. // id: 'file',
  90. // text: '归档',
  91. // iconCls: 'group-read',
  92. // cls: 'x-btn-gray'
  93. // }, {
  94. id: 'close',
  95. text: '关闭',
  96. iconCls: 'group-close',
  97. cls: 'x-btn-gray'
  98. }],
  99. initComponent : function(){
  100. this.callParent(arguments);
  101. this.getRODDetail(getUrlParam('id'));
  102. },
  103. getRODDetail: function(id){
  104. // if (id != null) {
  105. // id = id.substring(id.lastIndexOf("IS")+2);
  106. // }
  107. // alert(id);
  108. var me = this;
  109. // parent.Ext.getCmp("content-panel").getActiveTab().setLoading(true);//loading...
  110. Ext.Ajax.request({//拿到grid的columns
  111. url : basePath + "oa/officialDocument/getRODDetail.action",
  112. params: {
  113. id: id
  114. },
  115. method : 'post',
  116. callback : function(options, success, response){
  117. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  118. console.log(response);
  119. var res = new Ext.decode(response.responseText);
  120. if(res.exceptionInfo){
  121. showError(res.exceptionInfo);return;
  122. }
  123. if(!res.rod){
  124. return;
  125. } else {
  126. // var day = new Date(Ext.util.Format.date(new Date(res.rod.rod_date))); //将日期值格式化
  127. // var today = new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");
  128. Ext.getCmp('rod_date').setValue(Ext.util.Format.date(new Date(res.rod.rod_date)));// + "(" + today[day.getDay()] + ")");
  129. Ext.getCmp('rod_type').setValue(res.rod.rod_type);
  130. // Ext.getCmp('rod_status').hide().setValue(res.rod.rod_status);
  131. Ext.getCmp('rod_id').hide().setValue(res.rod.rod_id);
  132. Ext.getCmp('rod_title').setValue(res.rod.rod_title);
  133. Ext.getCmp('rod_subject').setValue(res.rod.rod_subject);
  134. Ext.getCmp('rod_unit').setValue(res.rod.rod_unit);
  135. Ext.getCmp('rod_secretlevel').setValue(res.rod.rod_secretLevel);
  136. Ext.getCmp('rod_emergencydegree').setValue(res.rod.rod_emergencyDegree);
  137. Ext.getCmp('rod_context').setValue(res.rod.rod_context);
  138. // Ext.getCmp('rod_registrant').setValue(res.rod_registrant);
  139. if(res.rod_attach != ""){
  140. var attach = res.rod_attach.split(';');
  141. var text = "";
  142. Ext.each(attach, function(a, index){
  143. var path = a.toString();
  144. if(me.BaseUtil.contains(a, '\\', true)){
  145. text += "&nbsp;&nbsp;<a class='mail-attach' href='" + basePath + "common/download.action?path=" + path + "'>" + a.substring(a.lastIndexOf('\\') + 1) + "</a>";
  146. } else {
  147. text += "&nbsp;&nbsp;<a class='mail-attach' href='" + basePath + "common/download.action?path=" + path + "'>" + a.substring(a.lastIndexOf('/') + 1) + "</a>";
  148. }
  149. });
  150. Ext.getCmp('rod_attach').setValue(text);
  151. } else {
  152. Ext.getCmp('rod_attach').hide();
  153. }
  154. }
  155. }
  156. });
  157. }
  158. });