You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.0 KiB
JavaScript

Ext.namespace('Shipping');
var BSNO = '';
var CID = '';
var Title = '';
var Context = '';
var ISSYS = '';
Shipping.OpSeaCoverEdit = function (config, bsno, cid, title, context,issys) {
Ext.applyIf(this, config);
BSNO = bsno;
CID = cid;
Title = title;
Context = context;
ISSYS = issys;
this.initUIComponents();
Shipping.OpSeaCoverEdit.superclass.constructor.call(this);
};
Ext.extend(Shipping.OpSeaCoverEdit, Ext.Window, {
initUIComponents: function () {
this.formEdit = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
width:390,
msgTarget: 'qtip'
},
items: [{
xtype: 'textfield',
name: 'COVERTITLE',
fieldLabel: '类型',
labelWidth: 40,
labelStyle: 'text-align:center;'
}, {
xtype: 'textarea',
rows: 10,
name: 'COVERCONTEXT',
fieldLabel: '内容',
labelWidth: 40,
labelStyle: 'text-align:center;'
}, {
xtype: 'hiddenfield',
name: 'ISSYS',
fieldLabel: 'ISSYS',
labelWidth: 40,
labelStyle: 'text-align:center;'
}, {
xtype: 'hiddenfield',
name: 'CID',
fieldLabel: '主键',
labelWidth: 40,
labelStyle: 'text-align:center;'
}, {
xtype: 'hiddenfield',
name: 'BSNO',
fieldLabel: '业务编号',
labelWidth: 40,
labelStyle: 'text-align:center;'
}],
buttons: [{
text: "保存",
handler: function (button, event) {
var form = this.formEdit.getForm();
form.findField('BSNO').setValue(BSNO);
if (form.isValid()) {
form.submit({
url: '/MvcShipping/MsOpSeaPlugin/SaveCover',
waitMsg: '正在保存数据...',
success: function (f, a) {
var win = Ext.getCmp("editCover");
// Ext.Msg.alert('提示', a.result.Message);
PluginCoverOBJ.onRefreshClick();
win.close();
}
});
}
},
scope: this
}, {
text: "取消",
handler: function (button, event) {
var win = Ext.getCmp("editCover");
win.close();
}
}]
});
Ext.apply(this, {
height: 280,
width: 460,
closeable: true,
draggable: true,
closeAction: 'destroy',
resizable: true,
modal: true,
defaultButton: 'btnImport',
layout: "border",
xtype: "window",
id: 'editCover',
header: {
html: '添加备注'
},
items: [this.formEdit]
});
if (CID != '') {
var form = this.formEdit.getForm();
form.findField('COVERTITLE').setValue(Title);
form.findField('COVERCONTEXT').setValue(Context);
form.findField('CID').setValue(CID);
form.findField('BSNO').setValue(BSNO);
form.findField('ISSYS').setValue(ISSYS);
if (ISSYS=='1'){
form.findField('COVERTITLE').setReadOnly(true);
form.findField('COVERCONTEXT').setReadOnly(true);
form.findField('CID').setReadOnly(true);
}
}
}
});