|
|
Ext.namespace('Shipping');
|
|
|
|
|
|
Shipping.MsInfoClientShipperIndex = function (config) {
|
|
|
Ext.applyIf(this, config);
|
|
|
this.initUIComponents();
|
|
|
window.Shipping.MsInfoClientShipperIndex.superclass.constructor.call(this);
|
|
|
};
|
|
|
|
|
|
Ext.extend(Shipping.MsInfoClientShipperIndex, Ext.Panel, {
|
|
|
PageSize: 30,
|
|
|
OprationStatus: null, //仅当弹出界面时使用
|
|
|
SelectedRecord: null,
|
|
|
EditRecord: null,
|
|
|
CODENAME: '',
|
|
|
|
|
|
//需求编号:SR2017061200005-1
|
|
|
initUIComponents: function () {
|
|
|
|
|
|
|
|
|
|
|
|
var mainform = window.parent._this;
|
|
|
|
|
|
|
|
|
this.EditRecord = mainform.Editdata;
|
|
|
|
|
|
|
|
|
this.CODENAME = this.EditRecord.CODENAME;
|
|
|
|
|
|
this.formname = "formInfoClientShipperIndex"; //页面名称
|
|
|
//定义数据集
|
|
|
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CtnDispModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
|
|
|
});
|
|
|
|
|
|
|
|
|
this.storeList = Ext.create('Ext.data.Store', {
|
|
|
pageSize: this.PageSize,
|
|
|
model: 'MsInfoClientShipperModel',
|
|
|
remoteSort: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsInfoClient/GetShipperDataList',
|
|
|
reader: {
|
|
|
id: 'GID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//#region List列表显示信息
|
|
|
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
|
|
|
width: 30
|
|
|
});
|
|
|
|
|
|
this.girdcolums = [ {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CODENAME',
|
|
|
hidden: true,
|
|
|
header: Zi.LAN.CODENAME, //'CODENAME',
|
|
|
width: 0
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SHIPPERID',
|
|
|
header: Zi.LAN.SHIPPERID, //'代码',
|
|
|
width: 140
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SHORTNAME',
|
|
|
header: Zi.LAN.SHORTNAME, //'简称',
|
|
|
width: 140
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SERVICECONTRACTNO',
|
|
|
header: Zi.LAN.SERVICECONTRACTNO, //'内容',
|
|
|
width: 120
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SHIPPERDETAIL',
|
|
|
header: Zi.LAN.SHIPPERDETAIL, //'内容',
|
|
|
width: 220
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'SHIPPERTYPE',
|
|
|
header: Zi.LAN.SHIPPERTYPE, //'类型',
|
|
|
width: 120,
|
|
|
renderer: function (value, cellmeta) {
|
|
|
if (value == 1) {
|
|
|
return "收货人";
|
|
|
} else if (value == 2) {
|
|
|
return "发货人";
|
|
|
} else if (value == 3) {
|
|
|
return "通知人";
|
|
|
} else if (value == 4) {
|
|
|
return "代理";
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'ISPUBLIC',
|
|
|
header: Zi.LAN.ISPUBLIC, //'是否公共',
|
|
|
width: 120
|
|
|
}];
|
|
|
|
|
|
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
|
|
|
|
|
|
//定义Grid
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
|
store: this.storeList,
|
|
|
enableHdMenu: false,
|
|
|
region: 'center',
|
|
|
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhong }, //"数据加载中,请稍等..."
|
|
|
trackMouseOver: true,
|
|
|
disableSelection: false,
|
|
|
columns: this.girdcolums,
|
|
|
selModel: this.GridCheckBoxModel,
|
|
|
bbar: Ext.create('Ext.PagingToolbar', {
|
|
|
store: this.storeList,
|
|
|
displayMsg: Zi.LAN.displayMsg, //'当前显示 {0} - {1}条记录 /共 {2}条记录',
|
|
|
emptyMsg: Zi.LAN.emptyMsg, //"没有数据"
|
|
|
displayInfo: true
|
|
|
})
|
|
|
});
|
|
|
|
|
|
this.gridList.reconfigure(this.storeList, this.girdcolums);
|
|
|
this.gridList.columns[0] = new Ext.grid.RowNumberer();
|
|
|
////////////////////////////////////////////////
|
|
|
|
|
|
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
|
|
|
this.SelectedRecord = record;
|
|
|
this.OprationStatus = 'edit';
|
|
|
window.open('/MvcShipping/MsInfoClient/ShipperEdit', Zi.LAN.ShouFaTongXinXi, 'width=800,height=400,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
|
|
|
}, this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//按钮工具条
|
|
|
me = this;
|
|
|
this.panelBtn = new Ext.Panel({
|
|
|
region: "north",
|
|
|
tbar: [{
|
|
|
text: Zi.LAN.btnAdd, //"新建",
|
|
|
iconCls: "btnadd",
|
|
|
handler: function (button, event) {
|
|
|
this.OprationStatus = 'add';
|
|
|
window.open('/MvcShipping/MsInfoClient/ShipperEdit', Zi.LAN.ShouFaTongXinXi, "width=800,height=400,resizable=yes,status=yes,menubar=no,scrollbars=yes,Top= " + (screen.height - 650) / 2 + ",Left= " + (screen.width - 1000) / 2);
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: Zi.LAN.btnDelete, //"删除",
|
|
|
iconCls: "btndelete",
|
|
|
handler: function (button, event) {
|
|
|
this.onDeleteClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.panelTop = new Ext.Panel({
|
|
|
layout: "border",
|
|
|
region: "north",
|
|
|
height: 30,
|
|
|
items: [this.panelBtn, this.formSearch]
|
|
|
});
|
|
|
|
|
|
Ext.apply(this, {
|
|
|
items: [this.panelTop, this.gridList]
|
|
|
});
|
|
|
|
|
|
this.onRefreshClick();
|
|
|
|
|
|
this.storeList.on('beforeload', function (store) {
|
|
|
var sql = "CODENAME='" + this.CODENAME + "'";
|
|
|
Ext.apply(store.proxy.extraParams, { condition: sql });
|
|
|
}, this);
|
|
|
|
|
|
}, //end initUIComponents
|
|
|
|
|
|
|
|
|
onRefreshClick: function (button, event) {
|
|
|
//var girdcolums = this.gridList.getColumnMode();
|
|
|
var sql = "CODENAME='" + this.CODENAME+ "'";
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
|
|
|
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
|
|
|
scope: this
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onDeleteClick: function (button, event) {
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeXinXi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var record = selections[0];
|
|
|
|
|
|
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在删除数据...',
|
|
|
url: '/MvcShipping/MsInfoClient/DeleteShipper',
|
|
|
params: {
|
|
|
data: Ext.JSON.encode(record.data)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
this.storeList.remove(record);
|
|
|
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: Zi.LAN.CuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
failure: function (response, options) {
|
|
|
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
},
|
|
|
success: function (response, options) { },
|
|
|
scope: this
|
|
|
}); //end Ext.Ajax.request
|
|
|
}
|
|
|
}, this);
|
|
|
},
|
|
|
|
|
|
|
|
|
OprationSwap: function () {
|
|
|
var ret = new Array();
|
|
|
ret[0] = this.OprationStatus;
|
|
|
ret[1] = this.storeList;
|
|
|
ret[2] = this.SelectedRecord;
|
|
|
ret[3] = this.EditRecord;
|
|
|
return ret;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|