|
|
@@ -5,92 +5,47 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
|
|
|
extend: 'school.view.core.form.FormPanel',
|
|
|
xtype: 'interaction-notice-schoolnotice',
|
|
|
|
|
|
- // controller: 'purchase-purchase-formpanel',
|
|
|
+ controller: 'interaction-notice-schoolnotice',
|
|
|
// viewModel: 'purchase-purchase-formpanel',
|
|
|
|
|
|
//字段属性
|
|
|
_title: '学校通知',
|
|
|
- _idField: 'id',
|
|
|
- _codeField: 'pu_code',
|
|
|
- _statusField: 'pu_status',
|
|
|
- _statusCodeField: 'pu_statuscode',
|
|
|
- _auditmanField: 'pu_auditman',
|
|
|
- _auditdateField: 'pu_auditdate',
|
|
|
- _relationColumn: 'pd_puid',
|
|
|
- _readUrl: '/api/purchase/purchase/read',
|
|
|
- _saveUrl: '/api/purchase/purchase/save',
|
|
|
- _auditUrl: '/api/purchase/purchase/audit',
|
|
|
- _unAuditUrl: '/api/purchase/purchase/unAudit',
|
|
|
- _deleteUrl: '/api/purchase/purchase/delete',
|
|
|
- _turnInUrl: '/api/purchase/purchase/turnProdin',
|
|
|
+ _idField: 'notify_id',
|
|
|
+ _codeField: null,
|
|
|
+ // _readUrl: 'http://10.1.80.47:9560/notice/read',
|
|
|
+ _readUrl: '/api/school/notice/read',
|
|
|
+ // _saveUrl: 'http://10.1.80.47:9560/notice/save',
|
|
|
+ _saveUrl: '/api/school/notice/save',
|
|
|
+ _deleteUrl: '/api/school/notice/delete',
|
|
|
initId: 0,
|
|
|
initComponent: function () {
|
|
|
Ext.apply(this, {
|
|
|
defaultItems: [{
|
|
|
xtype: 'hidden',
|
|
|
- name: 'id',
|
|
|
+ name: 'notify_id',
|
|
|
fieldLabel: 'id'
|
|
|
}, {
|
|
|
xtype: "textfield",
|
|
|
- name: "Publisher",
|
|
|
+ name: "notify_creator",
|
|
|
fieldLabel: "发布人",
|
|
|
columnWidth: 0.5
|
|
|
}, {
|
|
|
- xtype: 'textfield',
|
|
|
- name: 'time',
|
|
|
+ xtype: 'datefield',
|
|
|
+ name: 'create_date',
|
|
|
fieldLabel: '发布时间',
|
|
|
- columnWidth: 0.5
|
|
|
- }, {
|
|
|
- xtype: 'combobox',
|
|
|
- name: 'Notifications',
|
|
|
- fieldLabel: '通知人',
|
|
|
columnWidth: 0.5,
|
|
|
- queryMode: 'local',
|
|
|
- displayField: 'name',
|
|
|
- valueField: 'abbr',
|
|
|
- forceSelection: 'true',//阻止输入非列表内容
|
|
|
- store:Ext.create('Ext.data.Store', {
|
|
|
- fields: ['abbr', 'name'],
|
|
|
- data : [
|
|
|
- {"abbr":"AL", "name":"Alabama"},
|
|
|
- {"abbr":"AK", "name":"Alaska"},
|
|
|
- {"abbr":"AZ", "name":"Arizona"}
|
|
|
- ]
|
|
|
- })
|
|
|
+ formatter: 'Y-m-d H:i:s'
|
|
|
}, {
|
|
|
xtype: "textfield",
|
|
|
- name: "title",
|
|
|
+ name: "notify_title",
|
|
|
fieldLabel: "标题",
|
|
|
columnWidth: 1
|
|
|
}, {
|
|
|
xtype: "textareafield",//文本域
|
|
|
- name: 'content',
|
|
|
+ name: 'notify_details',
|
|
|
fieldLabel: "内容",
|
|
|
+ height: 300,
|
|
|
columnWidth: 1,
|
|
|
- }],
|
|
|
- toolBtns: [{
|
|
|
- xtype: 'button',
|
|
|
- text: '发布',
|
|
|
- handler: function() {
|
|
|
- let form = this.up('form');
|
|
|
- let values = form.getValues();
|
|
|
- form.setLoading(true);
|
|
|
- school.util.BaseUtil.request({
|
|
|
- // url: 'http://10.1.80.47:9560/notice/save',
|
|
|
- url: '/api/school/notice/save',
|
|
|
- method: 'POST',
|
|
|
- params: JSON.stringify({
|
|
|
- notify_title: values.title,
|
|
|
- notify_details: values.content
|
|
|
- })
|
|
|
- }).then(function(res) {
|
|
|
- form.setLoading(false);
|
|
|
- school.util.BaseUtil.showSuccessToast('发布成功');
|
|
|
- }).catch(function(e) {
|
|
|
- form.setLoading(false);
|
|
|
- school.util.BaseUtil.showErrorToast('发布失败: ' + e.message);
|
|
|
- });
|
|
|
- }
|
|
|
}]
|
|
|
});
|
|
|
this.callParent();
|