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.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/MsOpLetter/MsOpLetterIndex.js

320 lines
12 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.MsOpLetterIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpLetterIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpLetterIndex, Ext.Panel, {
PageSize: 30,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
EditRecord: null,
BsNo: "",
oplb: '',
initUIComponents: function () {
//定义数据集
var mainform = window.parent.panelEdit;
if (mainform == undefined) {
parentWin = window.parent.opener;
if (parentWin) {
var ret = parentWin.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.EditRecord = ret[2];
this.oplb = ret[4];
}
this.BsNo = this.EditRecord.get('BSNO');
} else {
this.EditRecord = mainform.editRecord;
this.BsNo = this.EditRecord.get('BSNO');
this.oplb = mainform.stroplb;
}
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpLetter',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpLetter/GetListData',
reader: {
id: 'BsNo',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.girdcolums = [{
sortable: true,
dataIndex: 'LE_ID',
header: 'LE_ID',
hidden: true,
width: 150
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
hidden: true,
width: 150
}, {
sortable: true,
dataIndex: 'LETTERNAME',
2 years ago
header: Zi.LAN.LETTERNAME,
width: 120,
renderer: function (value, meta) {
if (value == '入货通知') {
return Zi.LAN.RuHuoTongZhi;
} else if (value == '派车通知') {
return Zi.LAN.TRUCKLETTER;
} else if (value == '电放保函') {
return Zi.LAN.DIANFANGBAOHAN;
} else if (value == '更改通知') {
return Zi.LAN.GENGGAITONGZHI;
} else {
return "";
}
}
3 years ago
}, {
sortable: true,
dataIndex: 'INPUTBY',
2 years ago
header: Zi.LAN.INPUTBY,
3 years ago
width: 80
}, {
sortable: true,
dataIndex: 'INPUTTIME',
2 years ago
header: Zi.LAN.INPUTTIME,
3 years ago
width: 80
}
];
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
2 years ago
loadMask: { msg: Zi.LAN.ZhengZaiChaXunShuJu },
3 years ago
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolums,
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
2 years ago
displayMsg: Zi.LAN.displayMsg,
emptyMsg: Zi.LAN.emptyMsg
3 years ago
})
});
_this = this;
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
_this.SelectedRecord = record;
_this.OprationStatus = 'edit';
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
if (record.data.LETTERNAME == '入货通知')
openUrl = "../../MvcShipping/MsOpLetter/YardEdit";
//window.open('/MvcShipping/MsOpLetter/YardEdit', "函电", "height=" + (window.screen.availHeight - 155) + ", width=900px,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no");
else if (record.data.LETTERNAME == '派车通知')
openUrl = "../../MvcShipping/MsOpLetter/TruckEdit";
//window.open('/MvcShipping/MsOpLetter/TruckEdit', "函电", "height=" + (window.screen.availHeight - 155) + ", width=900px,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no");
else if (record.data.LETTERNAME == '电放保函')
openUrl = "../../MvcShipping/MsOpLetter/SurEdit";
//window.open('/MvcShipping/MsOpLetter/SurEdit', "函电", "height=" + (window.screen.availHeight - 155) + ", width=900px,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no");
else if (record.data.LETTERNAME == '更改通知')
openUrl = "../../MvcShipping/MsOpLetter/ChangeEdit";
//window.open('/MvcShipping/MsOpLetter/ChangeEdit', "函电", "height=" + (window.screen.availHeight - 155) + ", width=900px,center:yes,help:no,toolbar=no,menubar=no,scrollbars=no,resizable=0,location=no,status=no");
window.open(openUrl, openType, openSet);
}, this);
//查询工具条
_this;
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
2 years ago
text: Zi.LAN.btnNew,
3 years ago
iconCls: "btnadd",
menu:
[
2 years ago
{
text: Zi.LAN.RuHuoTongZhi,
3 years ago
handler: function (menu, event) {
_this.OprationStatus = 'add';
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsOpLetter/YardEdit";
window.open(openUrl, openType, openSet);
}
},
2 years ago
{
text: Zi.LAN.TRUCKLETTER,
3 years ago
handler: function (menu, event) {
_this.OprationStatus = 'add';
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsOpLetter/TruckEdit";
window.open(openUrl, openType, openSet);
}
},
2 years ago
{
text: Zi.LAN.DIANFANGBAOHAN,
3 years ago
handler: function (menu, event) {
_this.OprationStatus = 'add';
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsOpLetter/SurEdit";
window.open(openUrl, openType, openSet);
}
},
2 years ago
{
text: Zi.LAN.GENGGAITONGZHI,
3 years ago
handler: function (menu, event) {
_this.OprationStatus = 'add';
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsOpLetter/ChangeEdit";
window.open(openUrl, openType, openSet);
}
}],
scope: this
},
{
2 years ago
text: Zi.LAN.btnDelete,
3 years ago
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
},
'-',
{
2 years ago
text: Zi.LAN.refresh,
3 years ago
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 30,
items: [this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
this.onRefreshClick();
this.storeList.on('beforeload', function (store) {
var sql = "BSNO='" + this.BsNo + "'";
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
}, //end initUIComponents
onRefreshClick: function (button, event) {
var sql = "BSNO='" + this.BsNo + "'";
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
2 years ago
waitMsg: Zi.LAN.ZhengZaiChaXunShuJu,
3 years ago
scope: this
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
return;
}
var record = selections[0];
2 years ago
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
3 years ago
if (btn == 'yes') {
2 years ago
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
3 years ago
Ext.Ajax.request({
2 years ago
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
3 years ago
url: '/MvcShipping/MsOpLetter/Delete',
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);
2 years ago
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
}
else {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
3 years ago
}
}
},
failure: function (response, options) {
2 years ago
Ext.Msg.show({ title: Zi.LAN.ChuoWu, msg: Zi.LAN.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
3 years ago
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}, //onDeleteClick
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.EditRecord;
ret[4] = this.oplb;
return ret;
}
});