SODDetailForm.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. Ext.define('erp.view.oa.officialDocument.sendODManagement.SODDetailForm',{
  2. extend: 'Ext.form.Panel',
  3. alias: 'widget.erpSODDetailFormPanel',
  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: 'column'
  14. },
  15. fieldDefaults: {
  16. columnWidth: .5
  17. },
  18. deleteUrl: 'oa/officialDocument/sendODManagement/deleteDraft.action',
  19. updateUrl: 'oa/officialDocument/sendODManagement/updateDraft.action',
  20. submitUrl: 'oa/officialDocument/sendODManagement/submitDraft.action',
  21. auditUrl: 'oa/officialDocument/sendODManagement/auditDraft.action',
  22. resSubmitUrl: 'oa/officialDocument/sendODManagement/resSubmitDraft.action',
  23. resAuditUrl: 'oa/officialDocument/sendODManagement/resAuditDraft.action',
  24. items: [{
  25. xtype: 'textfield',
  26. fieldLabel: '发文类型',
  27. readOnly: true,
  28. fieldStyle: 'background:#f1f1f1;border:none;',
  29. id:'sod_type',
  30. name: 'sod_type'
  31. }, {
  32. xtype: 'textfield',
  33. fieldLabel: '发文日期',
  34. readOnly: true,
  35. fieldStyle: 'background:#f1f1f1;border:none;',
  36. id:'sod_date',
  37. name: 'sod_date'
  38. }, {
  39. xtype: 'textfield',
  40. fieldLabel: '发文标题',
  41. readOnly: true,
  42. fieldStyle: 'background:#f1f1f1;border:none;',
  43. id:'sod_title',
  44. name: 'sod_title'
  45. }, {
  46. xtype: 'textfield',
  47. fieldLabel: '发文机关',
  48. readOnly: true,
  49. fieldStyle: 'background:#f1f1f1;border:none;',
  50. name: 'sod_fw_organ',
  51. id: 'sod_fw_organ'
  52. }, {
  53. xtype: 'textfield',
  54. fieldLabel: '拟稿人',
  55. readOnly: true,
  56. fieldStyle: 'background:#f1f1f1;border:none;',
  57. name: 'sod_drafter',
  58. id: 'sod_drafter'
  59. }, {
  60. xtype: 'textfield',
  61. fieldLabel: '主题词',
  62. readOnly: true,
  63. fieldStyle: 'background:#f1f1f1;border:none;',
  64. name: 'sod_subject',
  65. id: 'sod_subject'
  66. }, {
  67. xtype: 'textfield',
  68. fieldLabel: '主送机关',
  69. readOnly: true,
  70. fieldStyle: 'background:#f1f1f1;border:none;',
  71. name: 'sod_zs_organ',
  72. id: 'sod_zs_organ'
  73. }, {
  74. xtype: 'textfield',
  75. fieldLabel: '秘密等级',
  76. readOnly: true,
  77. fieldStyle: 'background:#f1f1f1;border:none;',
  78. name: 'sod_secretlevel',
  79. id: 'sod_secretlevel'
  80. }, {
  81. xtype: 'textfield',
  82. fieldLabel: '紧急程度',
  83. readOnly: true,
  84. fieldStyle: 'background:#f1f1f1;border:none;',
  85. name: 'sod_emergencydegree',
  86. id: 'sod_emergencydegree'
  87. }, {
  88. xtype: 'displayfield',
  89. fieldLabel: '附件',
  90. name: 'sod_attach',
  91. id: 'sod_attach'
  92. },{
  93. xtype: 'htmleditor',
  94. columnWidth: 1,
  95. hideLabel: true,
  96. autoScroll: true,
  97. height: height*0.8,
  98. name: 'sod_context',
  99. id: 'sod_context',
  100. anchor: '100%'//编辑框******
  101. },{
  102. xtype: 'textfield',
  103. hidden: true,
  104. id:'sod_id',
  105. name: 'sod_id'
  106. },{
  107. xtype: 'textfield',
  108. hidden: true,
  109. id:'sod_statuscode',
  110. name: 'sod_statuscode'
  111. }],
  112. tbar:[{
  113. id: 'distribute',
  114. text: '转收文',
  115. iconCls: 'group-read',
  116. cls: 'x-btn-gray'
  117. }],
  118. buttonAlign: 'center',
  119. statuscodeField: 'sod_statuscode',
  120. initComponent : function(){
  121. this.callParent(arguments);
  122. this.getSODDetail(getUrlParam('id'));
  123. },
  124. getSODDetail: function(id){
  125. var me = this;
  126. Ext.Ajax.request({//拿到grid的columns
  127. url : basePath + "oa/officialDocument/getSODDetail.action",
  128. params: {
  129. id: id
  130. },
  131. method : 'post',
  132. callback : function(options, success, response){
  133. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  134. var res = new Ext.decode(response.responseText);
  135. if(res.exceptionInfo){
  136. showError(res.exceptionInfo);return;
  137. }
  138. if(!res.sod){
  139. return;
  140. } else {
  141. Ext.getCmp('sod_date').setValue(Ext.util.Format.date(new Date(res.sod.sod_date)));
  142. Ext.getCmp('sod_type').setValue(res.sod.sod_type);
  143. Ext.getCmp('sod_title').setValue(res.sod.sod_title);
  144. Ext.getCmp('sod_id').setValue(res.sod.sod_id);
  145. Ext.getCmp('sod_subject').setValue(res.sod.sod_subject);
  146. Ext.getCmp('sod_zs_organ').setValue(res.sod.sod_zs_organ);
  147. Ext.getCmp('sod_fw_organ').setValue(res.sod.sod_fw_organ);
  148. Ext.getCmp('sod_secretlevel').setValue(res.sod.sod_secretlevel);
  149. Ext.getCmp('sod_emergencydegree').setValue(res.sod.sod_emergencydegree);
  150. Ext.getCmp('sod_context').setValue(res.sod.sod_context);
  151. Ext.getCmp('sod_drafter').setValue(res.sod.sod_drafter);
  152. Ext.getCmp('sod_statuscode').setValue(res.sod.sod_statuscode);
  153. if(res.sod_attach != ""){
  154. var attach = res.sod_attach.split(';');
  155. var text = "";
  156. Ext.each(attach, function(a, index){
  157. var path = a.toString();
  158. if(me.BaseUtil.contains(a, '\\', true)){
  159. text += "&nbsp;&nbsp;<a class='mail-attach' href='" + basePath + "common/download.action?path=" + path + "'>" + a.substring(a.lastIndexOf('\\') + 1) + "</a>";
  160. } else {
  161. text += "&nbsp;&nbsp;<a class='mail-attach' href='" + basePath + "common/download.action?path=" + path + "'>" + a.substring(a.lastIndexOf('/') + 1) + "</a>";
  162. }
  163. });
  164. Ext.getCmp('sod_attach').setValue(text);
  165. } else {
  166. Ext.getCmp('sod_attach').hide();
  167. }
  168. }
  169. me.getForm().getFields().each(function (item,index,length){
  170. item.originalValue = item.value;
  171. });
  172. me.addDocked({
  173. xtype: 'toolbar',
  174. dock: 'bottom',
  175. defaults: {
  176. style: {
  177. marginLeft: '14px'
  178. }
  179. },
  180. items: ['->',{
  181. xtype: 'erpUpdateButton'
  182. },{
  183. xtype: 'erpSubmitButton'
  184. },{
  185. xtype: 'erpResSubmitButton'
  186. },{
  187. xtype: 'erpAuditButton'
  188. },{
  189. xtype: 'erpResAuditButton'
  190. },{
  191. xtype: 'erpDeleteButton'
  192. },{
  193. id: 'close',
  194. text: '关闭',
  195. iconCls: 'group-close',
  196. cls: 'x-btn-gray'
  197. },'->']
  198. });
  199. }
  200. });
  201. }
  202. });