?? erp2successbid.js
字號:
dataStore.remove(selections[i]);//從表格中刪除
} catch (e) {
}
}
Ext.Ajax.request({
url : 'remove.htm?ids=' + ids,
success : function() {
Ext.MessageBox.alert('提示', '刪除成功!');
//dataStore.reload();
},
failure : function(){Ext.MessageBox.alert('提示', '刪除失??!');}
});
}
});
} else {
Ext.MessageBox.alert('警告', '至少要選擇一條記錄');
}
}
});
dataStore.on('beforeload', function() {
dataStore.baseParams = {
bidCode : bidCode.getValue(),
bidContent : bidContent.getValue(),
publishDate : publishDate.getValue()
};
});
dataStore.load({
params:{start:0, limit:paging.pageSize}
});
});
EditForm = {
getInsertForm : function(closeTagHandler) {
this.createForm('./insert.htm', 'insert-box');
var form = this.form;
form.addButton({
text:'提交',
handler:function(){
if (form.isValid()) {
form.submit({
success:function(form, action){
Ext.MessageBox.confirm('提示', '添加成功,是否繼續填寫其他投標單' , function(btn){
if (btn == 'yes') {
form.reset();
} else {
closeTagHandler();
}
});
}
,failure:function(form, action){
Ext.suggest.msg('錯誤', action.result.response);
}
,waitMsg:'提交中...'
});
}
}
});
form.addButton({
text:'重置',
handler:function(){
EditForm.form.reset();
}
});
form.addButton({
text:'取消',
handler:closeTagHandler
});
form.render("insert-form");
return form;
},
getUpdateForm : function(closeTagHandler, id) {
this.createForm('./insert.htm', 'update-box');
var form = this.form;
this.id = id;
form.addButton({
text:'提交',
handler:function(){
if (form.isValid()) {
form.submit({
params:{id:EditForm.id},
success:function(form, action){
Ext.MessageBox.confirm('提示', '修改成功,是否返回' , function(btn){
if (btn == 'yes') {
closeTagHandler();
} else {
form.reset();
}
});
}
,failure:function(form, action){
Ext.suggest.msg('錯誤', action.result.response);
}
,waitMsg:'提交中...'
});
}
}
});
form.addButton({
text:'重置',
handler:function(){
EditForm.form.reset();
}
});
form.addButton({
text:'取消',
handler:closeTagHandler
});
form.render("update-form");
form.load({url:'./loadData.htm?id=' + id});
// 初始化級聯的信息
Ext.lib.Ajax.request(
'GET',
'./loadData.htm?id=' + this.id,
{success:function(response){
var entity = Ext.decode(response.responseText);
var inviteBid = entity[0].erp2InviteBid;
var bidId = inviteBid.erp2Bid.id;
var bidCode = inviteBid.erp2Bid.code;
var inviteBidId = inviteBid.id;
var supplierName = inviteBid.erp2Supplier.name;
form.findField('bidCode').setValue(bidId);
form.findField('bidCodeId2').setRawValue(bidCode);
form.findField('supplierName').setValue(inviteBidId);
form.findField('supplierNameId2').setRawValue(supplierName);
},failure:function(){}}
);
return form;
},
createForm : function(url, waitMsgTarget) {
var form = new Ext.form.Form({
labelAlign:'right',
labelWidth:150,
url:url,
method: 'POST',
waitMsgTarget:waitMsgTarget,
reader : new Ext.data.JsonReader({}, [
{name:'publishDate'},
{name:'bidContent'},
{name:'price'},
{name:'descn'}
])
});
var publishDate = new Ext.form.DateField({
id:'publishDate',
name:'publishDate',
readOnly:true,
fieldLabel:'公示結果日期',
format:'Y-m-d',
width:400
});
var bidCode = new Ext.form.ComboBox({
id:'bidCodeId2',
name:'bidCode',
readOnly:true,
fieldLabel:'所投標書編號',
hiddenName:'bidCode',
store: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'../erp2bid/pagedQueryForCombo.htm'}),
reader: new Ext.data.JsonReader({
root : "result",
totalProperty : "totalCount",
id : "id"
},['id','code'])
}),
valueField:'id',
displayField:'code',
typeAhead:true,
mode:'remote',
triggerAction:'all',
emptyText:'請選擇',
selectOnFocus:true,
width:400,
allowBlank:false,
pageSize:10
});
var supplierDataStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'../erp2invitebid/pagedQueryByBidId.htm'}),
reader: new Ext.data.JsonReader({
root : "result",
totalProperty : "totalCount",
id : "id"
},['id',{name:'name',mapping:'erp2Supplier.name'}])
});
var supplierName = new Ext.form.ComboBox({
id:'supplierNameId2',
name:'supplierName',
readOnly:true,
fieldLabel:'中標單位名稱',
hiddenName:'supplierName',
store: supplierDataStore,
valueField:'id',
displayField:'name',
typeAhead:true,
mode:'local',
triggerAction:'all',
emptyText:'請選擇',
selectOnFocus:true,
width:400,
allowBlank:false,
pageSize:10
});
bidCode.on('select', function() {
bidId = bidCode.getValue();
supplierName.clearValue();
supplierDataStore.load({
params:{bidCode:bidId}
});
});
var bidContent = new Ext.form.TextField({
fieldLabel:'招標內容',
name:'bidContent',
width:400,
allowBlank:false
});
var price = new Ext.form.NumberField({
fieldLabel:'中標成交金額(元)',
name:'price',
width:400
});
var descn = new Ext.form.TextArea({
fieldLabel:'中標、成交項目主要內容',
name:'descn',
width:400,
height:100
});
form.fieldset(
{legend:'中標結果', hideLabels:false},
publishDate,
bidCode,
supplierName,
bidContent,
price,
descn
);
//
this.form = form;
}
};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -