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.

1058 lines
35 KiB
JavaScript

10 months ago
Ext.namespace('Shipping');
Shipping.MsOpSocCtnDetailIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpSocCtnDetailIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpSocCtnDetailIndex, Ext.Panel, {
PageSize: 30,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
selectbsno: '',
sortfield: '',
sortdire: '',
initUIComponents: function () {
this.formname = "MsOpSocCtnDetailIndex"; //页面名称
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpSocCtnCtnDetail',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSocCtn/GetOpSocCtnCtnDetailList',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 50
});
_this = this;
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.initgirdcolums = [{
sortable: true,
dataIndex: 'CTNGID',
header: '业务编号',
hidden: true,
width: 80
}, {
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合同号',
width: 80
}, {
sortable: true,
dataIndex: 'CNTRNO',
header: '箱号',
width: 100
}, {
sortable: true,
dataIndex: 'CTNSTATUS',
header: '箱状态',
width: 80
}, {
sortable: true,
dataIndex: 'CTNALL',
header: '箱型',
width: 100
}, {
sortable: true,
dataIndex: 'YARD',
header: '场站',
width: 100
}, {
sortable: true,
dataIndex: 'INPUTYARDDATE',
header: '进场时间',
width: 100
}, {
sortable: true,
dataIndex: 'OUTYARDDATE',
header: '出场时间',
width: 100
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '目的港',
width: 100
}, {
sortable: true,
dataIndex: 'RTCTNDATE',
header: '还箱日期',
width: 100
}, {
sortable: true,
dataIndex: 'RTCTNYARD',
header: '还箱场站',
width: 100
}, {
sortable: true,
dataIndex: 'DEPOSITPRICE',
header: '租金',
width: 100
}, {
sortable: true,
dataIndex: 'CREATEUSERREF',
header: '创建人',
width: 80
}, {
sortable: true,
dataIndex: 'CREATETIME',
header: '创建时间',
width: 80
}, {
sortable: true,
dataIndex: 'MODIFIEDUSERREF',
header: '修改人',
width: 80
}, {
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: '修改日期',
width: 80
}];
this.girdcolums = this.initgirdcolums;
//定义Grid
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
columns: this.girdcolums,
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
},
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
/////////////以下部分为获取存储的gridpanel显示样式
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
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';
//DsOpenEditWin('/MvcShipping/MsOpSocCtn/BsEdit', record.data.BSNO);
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
//#region formSearch 查询条件
_this = this;
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港', //'卸货港',
store: this.storeCodeDisport,
name: 'PORTDISCHARGE',
valueField: 'PORT',
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCodeCtn = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCtnModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' }
});
this.storeCodeCtn.load();
this.comboxCTNALL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '箱型', //'箱型',
store: this.storeCodeCtn,
forceSelection: true,
name: 'CTNALL',
valueField: 'CTN',
displayField: 'CTN',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeBSSTATUS = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeBSSTATUS.add({ "FSTATUS": "未入场", "NAME": "未入场" });
this.storeBSSTATUS.add({ "FSTATUS": "待使用", "NAME": "待使用" });
this.storeBSSTATUS.add({ "FSTATUS": "使用中", "NAME": "使用中" });
this.storeBSSTATUS.add({ "FSTATUS": "已还箱", "NAME": "已还箱" });
this.comboxBSSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '状态',
store: this.storeBSSTATUS,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'CTNSTATUS',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeYARD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListYARD' }
});
this.storeYARD.load();
//
this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '场站', //'场站',
store: this.storeYARD,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'YARD',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 45,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: '箱号',
name: 'CNTRNO',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '合同号',
name: 'CONTRACTNO',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCTNALL, this.comboxYARD,this.comboxPORTDISCHARGE, this.comboxBSSTATUS,{
xtype: 'button',
width: 90,
text: "查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
text: "重置",
xtype: 'button',
width: 90,
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, {
xtype: 'button',
width: 90,
text: "更多",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}]
}]
}]
});
//#endregion formSearch
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "业务批量修改",
handler: function (button, event) {
_this.winModifyShow.show();
},
scope: this
},
{
text: "引入箱号信息",
iconCls: "btnupload",
handler: function (button, event) {
_this.onImportCtnList();
},
scope: this
},
{
text: "引入更新入场信息",
iconCls: "btnupload",
handler: function (button, event) {
_this.onImportCtnYardList();
},
scope: this
},'-', {
text: "保存列表样式",
id: "btntest",
menu: [
{ text: "保存",
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: "初始化",
handler: function (menu, event) {
_this.InitGrid(_this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}, '-' ,{
text:'导出EXCEL', //"EXCEL模板导出",
iconCls: "btnexportexcel",
handler: function (button, event) {
_this.onExportClick();
},
scope: this
}]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 70,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
this.sqlcontext = "";
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext },
waitMsg: "正在查询数据...",
scope: this
});
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
this.storeCodeDisportM = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.comboxPORTDISCHARGEM = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港', //'卸货港',
store: this.storeCodeDisportM,
name: 'PORTDISCHARGE',
valueField: 'PORT',
queryMode: 'remote',
minChars: 2,
queryParam: 'PORT',
displayField: 'CodeAndName',
enableKeyEvents: true
});
me = this;
this.formModify = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: '进场日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'INPUTYARDDATE'
}, {
fieldLabel: '出场日期',
format: 'Y-m-d',
flex: 1,
xtype: 'datefield',
name: 'OUTYARDDATE'
}, this.comboxPORTDISCHARGEM
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
}); //end this.formEdit
this.winModifyShow = Ext.create('Ext.window.Window', {
title: "业务批量修改", //"批量修改",
width: 900,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formModify],
buttons: [{
text: "确认修改", //"确认修改",
minWidth: 70,
handler: function () {
me.onModifyClick()
}
}, {
text: "清空", //"确认修改",
minWidth: 70,
iconCls: "btnreset",
handler: function () {
var form = me.formModify.getForm();
form.reset();
}
}, {
text: "关闭", //"关闭",
minWidth: 70,
handler: function () {
me.winModifyShow.close();
}
}]
});
}, //end initUIComponents
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.sqlcontext;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
onModifyClick: function (menu, event) {
var GidStr = '';
var records = this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的集装箱!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
icount = 0;
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
icount = icount + 1;
}
var data = this.formModify.getForm().getValues();
_this = this;
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有要修改的集装箱!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); return;
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在操作数据...',
url: '/MvcShipping/MsOpSocCtn/modifyCtnDetail',
params: {
data: jsonbodyAddDatas,
modifydata: Ext.JSON.encode(data)
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({ title: '错误', msg: result.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeList.reload();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
onImportCtnList: function () {
var GIDs = "";
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 20,
frame: true,
autoScroll: false,
border: false,
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'LoadExcel',
name: 'LoadExcel',
emptyText: '请选择EXCEL文件',
fieldLabel: 'EXCEL',
buttonText: '选择文件',
allowBlank: false,
width: 200,
buttonCfg:
{
iconCls: 'uploaddialog'
},
anchor: '98%'
}],
buttons: [{
text: '上传',
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('LoadExcel').getValue();
if (!CheckFileExt(UserFilePath, /.xls|.xlsx/i)) {
Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为EXCEL文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/MvcShipping/MsOpSocCtn/ImportCtnDetail',
waitMsg: '正在上传',
method: 'POST',
params: {
bsno: GIDs
},
success: function (form, action) {
win.close(this);
Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeList.reload();
},
failure: function (form, action) {
form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
Ext.MessageBox.alert('警告', action.result.Message);
}
});
}
}, {
text: '关闭',
type: 'submit',
handler: function () {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传EXCEL",
width: 380,
height: 120,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
return;
},
onImportCtnYardList: function () {
var GIDs = "";
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 20,
frame: true,
autoScroll: false,
border: false,
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'LoadExcel',
name: 'LoadExcel',
emptyText: '请选择EXCEL文件',
fieldLabel: 'EXCEL',
buttonText: '选择文件',
allowBlank: false,
width: 200,
buttonCfg:
{
iconCls: 'uploaddialog'
},
anchor: '98%'
}],
buttons: [{
text: '上传',
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('LoadExcel').getValue();
if (!CheckFileExt(UserFilePath, /.xls|.xlsx/i)) {
Ext.Msg.show({ title: '错误', msg: '请确认你上传的文件为EXCEL文件!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/MvcShipping/MsOpSocCtn/ImportCtnDetailYard',
waitMsg: '正在上传',
method: 'POST',
params: {
bsno: GIDs
},
success: function (form, action) {
win.close(this);
Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeList.reload();
},
failure: function (form, action) {
form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
Ext.MessageBox.alert('警告', action.result.Message);
}
});
}
}, {
text: '关闭',
type: 'submit',
handler: function () {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传EXCEL",
width: 380,
height: 120,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
return;
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var CNTRNO = form.findField('CNTRNO').getValue();
sql = sql + getAndConSql(sql, CNTRNO, "CNTRNO like '%" + CNTRNO + "%'");
var CONTRACTNO = form.findField('CONTRACTNO').getValue();
sql = sql + getAndConSql(sql, CONTRACTNO, "C.CONTRACTNO='" + CONTRACTNO + "'");
var CTNALL = form.findField('CTNALL').getValue();
sql = sql + getAndConSql(sql, CTNALL, "CTNALL='" + CTNALL + "'");
var YARD = form.findField('YARD').getValue();
sql = sql + getAndConSql(sql, YARD, "YARD='" + YARD + "'");
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, "B.PORTDISCHARGE= '" + PORTDISCHARGE + "'");
var CTNSTATUS = form.findField('CTNSTATUS').getValue();
sql = sql + getAndConSql(sql, CTNSTATUS, "CTNSTATUS= '" + CTNSTATUS + "'");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.selectbsno;
ret[4] = 'op_socctn';
ret[5] = this.storePLList;
return ret;
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsOpSocCtn/GetOpSocCtnCtnDetailListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSOPSOCCTNCTNLIST';
var sql1 = returnstr;
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
PrintSelect: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var selectedRecords = [];
var storeadd = null;
selectedRecords = this.GridCheckBoxModel.selected.items;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var sortstr = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
if (sortstr == "") sortstr = "CREATETIME "
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('CTNGID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.BSNO;
}
var printType = 'MSOPSOCCTNCTNLISTSELECT';
var sql1 = "select * from op_socctn_ctndetail WHERE CTNGID IN (" + feeGidSql + ") order by " + sortstr;
var sql2 = "select * from op_socctn_ctndetail where CTNGID='" + bsno + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
onExportClick: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var sortstr = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcContainer/MsOpSocCtn/GetOpSocCtnCtnDetailListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true',
sort: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSOPSOCCTN';
var sql1 = returnstr;
sql1 = sql1.replace(/\+/g, "@@@")
if (sql1 != '') {
GridExportBySql(sql1, this.formname, 'SOC箱集装箱信息.xls');
}
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
});