mailbox.js 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /**
  2. * 校长信箱
  3. */
  4. Ext.define('school.view.interaction.mailbox.mailbox', {
  5. // extend: 'school.view.core.base.BasePanel',
  6. extend: 'Ext.grid.Panel',
  7. xtype: 'interaction-mailbox-mailbox',
  8. // dataUrl: '/api/interact/timetable/list',
  9. //字段属性
  10. _title: '校长信箱',
  11. _idField: 'id',
  12. _codeField: 'pu_code',
  13. _statusField: 'pu_status',
  14. _statusCodeField: 'pu_statuscode',
  15. _auditmanField: 'pu_auditman',
  16. _auditdateField: 'pu_auditdate',
  17. _relationColumn: 'pd_puid',
  18. _readUrl: '/api/purchase/purchase/read',
  19. _saveUrl: '/api/purchase/purchase/save',
  20. _auditUrl: '/api/purchase/purchase/audit',
  21. _unAuditUrl: '/api/purchase/purchase/unAudit',
  22. _deleteUrl: '/api/purchase/purchase/delete',
  23. _turnInUrl: '/api/purchase/purchase/turnProdin',
  24. initId: 0,
  25. initComponent: function() {
  26. Ext.apply(this, {
  27. // title: '校长信箱',
  28. store: Ext.create('Ext.data.Store', {
  29. fields:['code', 'content', 'Enclosure', 'time', 'name', 'Handle'],
  30. data:[
  31. {code:"U001", content:"孩子作业太少了,回家每天玩王者荣耀,希望学校老师布置作业多一点,让我孩子忙起来", Enclosure:'无', time:"01/10/2004 16:00", name:'张三', Handle:'true'},
  32. {code:"U001", content:"学校课本费收入明细未公开,希望课本费明细能够向我们家长公开", Enclosure:'有', time:"01/10/2004 16:00", name:'张三', Handle:'false'},
  33. {code:"U001", content:"觉得十分激烈的交锋了", Enclosure:'无', time:"01/10/2004 16:00", name:'张三', Handle:'true'},
  34. ]
  35. }),
  36. columns : [
  37. {text: '编号',dataIndex: 'code', flex: 0.1},
  38. {text: '内容',dataIndex: 'content', flex: 0.3},
  39. {text: '附件',dataIndex: 'Enclosure', flex: 0.1},
  40. {text: '日期',dataIndex: 'time',xtype: 'datecolumn',format:'Y-m-d H:i', flex: 0.2},
  41. {text: '提出人',dataIndex: 'name', flex: 0.1},
  42. {text: '处理', flex: 0.2, align:'center', dataIndex: 'Handle',
  43. renderer: function(val,meta,rec) {
  44. // 为元素生成唯一id
  45. var id = Ext.id();
  46. if (rec.data.Handle == 'false') {
  47. return Ext.String.format('<div>已回复</div>');
  48. } else if(rec.data.Handle == 'true'){
  49. Ext.defer(function() {
  50. Ext.widget('button', {
  51. renderTo: id,
  52. text: '回复',
  53. handler: function() {//点击回复事件
  54. Ext.MessageBox.show({
  55. title: '回复处理',
  56. msg: '回复对象:'+rec.data.code,
  57. width:500,
  58. height:600,
  59. bbar: Ext.MessageBox.OKCANCEL,
  60. multiline: true,
  61. scope: this,
  62. fn: this.showResultText,
  63. });
  64. }
  65. });
  66. }, 50);
  67. return Ext.String.format('<div id="{0}"></div>', id);
  68. }
  69. }
  70. }
  71. ],
  72. tbar: ['->',{
  73. xtype: 'button',
  74. text: '导出'
  75. }, {
  76. xtype: 'button',
  77. text: '删除'
  78. }, {
  79. xtype: 'button',
  80. text: '批量回复'
  81. }],
  82. });
  83. this.callParent();
  84. },
  85. })