|
|
@@ -63,21 +63,21 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
|
|
|
}, {
|
|
|
xtype: 'combobox',
|
|
|
fieldLabel: '通知对象',
|
|
|
- name: 'notify_class',
|
|
|
+ name: 'notify_target',
|
|
|
displayField: 'name',
|
|
|
valueField: 'value',
|
|
|
editable: false,
|
|
|
clearable: false,
|
|
|
store: Ext.create('Ext.data.Store', {
|
|
|
fields: ['name', 'value'],
|
|
|
- data: [{ name: '全体教师', value: -1 }, { name: '全体家长', value: -2 }, { name: '指定班级', value: -3 }]
|
|
|
+ data: [{ name: '全体教师', value: 'teacher' }, { name: '全体家长', value: 'parent' }, { name: '指定年级', value: 'grade'}, { name: '指定班级', value: 'class' }]
|
|
|
}),
|
|
|
- defaultValue: -2,
|
|
|
+ defaultValue: 'parent',
|
|
|
minChars: 0,
|
|
|
queryMode: 'local',
|
|
|
allowBlank: false,
|
|
|
listeners: {
|
|
|
- change: 'onNotifyClassComboChange'
|
|
|
+ change: 'onNotifyTargetComboChange'
|
|
|
}
|
|
|
}, {
|
|
|
xtype: 'hidden',
|
|
|
@@ -178,9 +178,10 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
|
|
|
},
|
|
|
initFormData: function(data) {
|
|
|
let me = this;
|
|
|
- if(data.main.notify_class > 0) {
|
|
|
- data.main.classId = data.main.notify_class;
|
|
|
- data.main.notify_class = -3;
|
|
|
+ if(data.main.notify_target == 'grade') {
|
|
|
+ data.main.gradeId = data.main.notify_targetId;
|
|
|
+ }else if(data.main.notify_target == 'class') {
|
|
|
+ data.main.classId = data.main.notify_targetId;
|
|
|
}
|
|
|
me.setFormData(data);
|
|
|
me.clearDirty();
|
|
|
@@ -189,11 +190,18 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
|
|
|
let me = this;
|
|
|
let viewModel = me.getViewModel();
|
|
|
let formItems = me.formItems || [];
|
|
|
- let notifyClassValue = me.getForm().findField('notify_class').value;
|
|
|
+ let notifyTargetValue = me.getForm().findField('notify_target').value;
|
|
|
let valid = !Ext.Array.findBy(formItems, function(f) {
|
|
|
- if(notifyClassValue != -3 && (f.name == 'gradeName' || f.name == 'classzName')) {
|
|
|
- return false;
|
|
|
+ if(notifyTargetValue == 'teacher' || notifyTargetValue == 'parent') {
|
|
|
+ if(f.name == 'gradeName' || f.name == 'classzName') {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else if(notifyTargetValue == 'grade') {
|
|
|
+ if(f.name == 'classzName') {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
return !f.isValid();
|
|
|
});
|
|
|
let detailGrids = me.query('detailGridField');
|