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.

3723 lines
132 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Ext.namespace('Shipping');
Shipping.MsOpSeaiSaleIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpSeaiSaleIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpSeaiSaleIndex, Ext.Panel, {
PageSize: 100,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isShowAdvancedQuery: 0, //是否显示高级查询面板
sqlcontext: '',
selectbsno: '',
initUIComponents: function () {
this.formname = "formMsOpSeaiSaleIndex"; //页面名称
//#region 定义数据集
this.storePLList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaiModel'
});
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnDispModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
});
this.storecodeservice = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsCodeOpService',
proxy: { url: '/MvcShipping/MsCodeOpService/GetDataCtnList' }
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpSeaiModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeai/GetSaleDataList',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#endregion
//#region List列表显示信息
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.girdcolums = [{
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
width: 0
},
{
sortable: true,
dataIndex: 'BSSTATUSREF',
align: 'center',
header: '业务锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
dataIndex: 'FEESTATUSREF',
align: 'center',
header: '费用锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
id: '',
dataIndex: 'DRFEESTATUS',
header: '应收费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
} else if (value == '录入状态') {
} else if (value == '提交审核') {
meta.tdCls = 'feestatus_refer';
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_refer';
} else if (value == '结算完毕') {
meta.tdCls = 'feestatus_settle';
} else if (value == '未录入') {
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_settle';
} else if (value == '部分审核') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分提交') {
meta.tdCls = 'feestatus_refer';
} else if (value == '驳回提交') {
meta.tdCls = 'feestatus_nopass';
}
return value;
}
},
{
sortable: true,
id: '',
dataIndex: 'CRFEESTATUS',
header: '应付费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
} else if (value == '录入状态') {
} else if (value == '提交审核') {
meta.tdCls = 'feestatus_refer';
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_refer';
} else if (value == '结算完毕') {
meta.tdCls = 'feestatus_settle';
} else if (value == '未录入') {
} else if (value == '部分结算') {
meta.tdCls = 'feestatus_settle';
} else if (value == '部分审核') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分提交') {
meta.tdCls = 'feestatus_refer';
} else if (value == '驳回提交') {
meta.tdCls = 'feestatus_nopass';
}
return value;
}
},
{
sortable: true,
id: '',
dataIndex: 'DRINVSTATUS',
header: '应收开票', //'应收开票',
align: 'center',
width: 60,
renderer: function (value, meta, record) {
var openSet = "height=200, width=650, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 250) / 2 + ",Left= " + (screen.width - 600) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../../MvcShipping/MsRptChInvTotal/BsView?handle=check&bsno=" + record.data.BSNO;
var winstr = "window.open(this.href,'" + openType + "','" + openSet + "')";
if (value == '已开票') {
value = '<a href="' + openUrl + '" onclick="' + winstr + ';return false">已开票</a>'
meta.tdCls = 'feestatus_pass';
} else if (value == '部分开票') {
meta.tdCls = 'feestatus_refer';
value = '<a href="' + openUrl + '" onclick="' + winstr + ';return false">部分开票</a>'
}
return value;
}
},
{
sortable: true,
dataIndex: 'BSTYPE',
header: '委托单类型',
width: 70
},
{
sortable: true,
dataIndex: 'WMSTYPE',
header: '仓储类型',
width: 60
},
{
sortable: true,
dataIndex: 'OPSTATUS',
header: '状态管理',
width: 80,
renderer: function (value, metadata, record, rowIndex) {
metadata.style = "background-color:" + record.data.OPSTATUSCOLOR;
return value;
}
},
{
sortable: true,
dataIndex: 'ETD',
header: '到港日期',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 120,
renderer: function (value, meta) {
meta.tdCls = 'mblno';
return value;
}
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 120
},
{
sortable: true,
dataIndex: 'TRADETYPE',
header: '贸易方式',
width: 60
},
{
sortable: true,
dataIndex: 'BSDATE',
header: '接单日期',
width: 80
},
{
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合同号',
width: 120
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 120
},
{
sortable: true,
dataIndex: 'NUMBERPLATE',
header: '牌号',
width: 120
},
{
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 80
},
{
sortable: true,
dataIndex: 'KGS',
header: '毛重',
width: 80
},
{
sortable: true,
dataIndex: 'NETWEIGHT',
header: '净重',
width: 80
},
{
sortable: true,
dataIndex: 'CNTRTOTAL',
header: '集装箱',
width: 80
},
{
sortable: true,
dataIndex: 'ORDERTYPE',
header: '委托方式',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'ORDERNO',
header: '业务编号',
width: 120
},
{
sortable: true,
dataIndex: 'HBLNO',
header: '分提单号',
width: 120
},
{
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
width: 60
},
{
sortable: true,
dataIndex: 'BSSOURCE',
header: '业务来源',
width: 80
},
{
sortable: true,
dataIndex: 'BSSOURCEDETAIL',
header: '来源明细',
width: 80
},
{
sortable: true,
dataIndex: 'INPUTBY',
header: '录入人',
width: 80
},
{
sortable: true,
dataIndex: 'CREATETIME',
header: '创建时间',
width: 120
},
{
sortable: true,
dataIndex: 'OP',
header: '操作员',
width: 80
},
{
sortable: true,
dataIndex: 'SALE',
header: '揽货人',
width: 80
},
{
sortable: true,
dataIndex: 'VESSEL',
header: '船名',
width: 100
},
{
sortable: true,
dataIndex: 'VOYNO',
header: '航次',
width: 60
},
{
sortable: true,
dataIndex: 'PORTLOAD',
header: '装货港',
width: 100
},
{
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '卸货港',
width: 100
},
{
sortable: true,
dataIndex: 'OTCNTR',
header: '其他箱型',
width: 60
},
{
sortable: true,
dataIndex: 'TEU',
header: '箱TEU',
width: 40
},
{
sortable: true,
dataIndex: 'COUNTRYOFORIGIN',
header: '原产地',
width: 80
},
{
sortable: true,
dataIndex: 'UNITS',
header: '单位',
width: 40
},
{
sortable: true,
dataIndex: 'BALES',
header: '包装(散货/托盘)数',
width: 60
},
{
sortable: true,
dataIndex: 'CUSTOMSER',
header: '报关行',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMNO',
header: '报关单号',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMDATE',
header: '通关日期',
width: 80
},
{
sortable: true,
dataIndex: 'INSPECTION',
header: '报检',
width: 80
},
{
sortable: true,
dataIndex: 'INSPECTIONNO',
header: '报检单号',
width: 80
},
{
sortable: true,
dataIndex: 'INSPECTIONDATE',
header: '报检日期',
width: 80
},
{
sortable: true,
dataIndex: 'KINDPKGS',
header: '件数包装',
width: 60
},
{
sortable: true,
dataIndex: 'CBM',
header: '立方/尺码',
width: 60
},
{
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 100
},
{
sortable: true,
dataIndex: 'ENTERP',
header: '经营单位',
width: 100
},
{
sortable: true,
dataIndex: 'TRUCKER',
header: '承运车队',
width: 100
},
{
sortable: true,
dataIndex: 'VOUNO',
header: '凭证号',
width: 60
},
{
sortable: true,
dataIndex: 'FBP',
header: '免箱期',
width: 60
},
{
sortable: true,
dataIndex: 'BMDDATE',
header: '箱使到期日',
width: 70
},
{
sortable: true,
dataIndex: 'MDTDATE',
header: '搬倒日期',
width: 80
},
{
sortable: true,
dataIndex: 'TRADINGAGENCY',
header: '贸易代理',
width: 80
},
{
sortable: true,
dataIndex: 'FORWARDER',
header:'货代', //'委托方式',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSTYPENAME',
header: '品名类型',
width: 60
},
{
sortable: true,
dataIndex: 'SHOWNAME',
header: '委托单位联系人',
width: 100
},
{
sortable: true,
dataIndex: 'EMAIL',
header: '委托单位EMAIL',
width: 90
},
{
sortable: true,
dataIndex: 'TEL',
header: '委托单位TEL',
width: 80
},
{
sortable: true,
dataIndex: 'FAX',
header: '委托单位FAX',
width: 80
},
{
sortable: true,
dataIndex: 'TARRIFSPAIEDTIEM',
header: '交关税时间',
width: 70
},
{
sortable: true,
dataIndex: 'APPROVENO',
header: '审批单号',
width: 100
},
{
sortable: true,
dataIndex: 'UPDATETIME',
header: '申报日期',
width: 80
}, {
dataIndex: 'SALEDEPT',
header: Zi.LAN.SALEDEPT2, //'货物标识',
width: 70
},
{
sortable: true,
dataIndex: 'IMPORTVALUE',
header: '货值',
width: 50,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
},
{
sortable: true,
dataIndex: 'UNITPRICE',
header: '单价',
width: 50,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
},
{
sortable: true,
dataIndex: 'BLTYPE',
header: '装运方式',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR1',
header: '箱型1',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR2',
header: '箱型2',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR3',
header: '箱型3',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR4',
header: '箱型4',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR5',
header: '箱型5',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR6',
header: '箱型6',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR7',
header: '箱型7',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR8',
header: '箱型8',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR9',
header: '箱型9',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'CNTR10',
header: '箱型10',
width: 60
},
{
sortable: true,
id: '',
dataIndex: 'OTCNTR',
header: '其他箱型',
width: 60
}, {
sortable: true,
dataIndex: 'ISPRINTPR',
header: '打印核算单',
width: 100,
renderer: function (value, meta, record) {
if (value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'DOC',
header: '单证', //'揽货人',
width: 80
}, {
sortable: true,
dataIndex: 'ISFUMIGATION',
header: '服务项目1',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISSTORAGE',
header: '服务项目2',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISLAND',
header: '服务项目3',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISCUSTOMS',
header: '服务项目4',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISINSPECTION',
header: '服务项目5',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISBOOKING',
header: '服务项目6',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISAGENT',
header: '服务项目7',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISHBLNO',
header: '服务项目8',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'SERVICE9',
header: '服务项目9',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'SERVICE10',
header: '服务项目10',
hidden: true,
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}];
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.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolums,
selModel: this.GridCheckBoxModel,
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
},
plugins: [{
ptype: 'rowexpander',
rowBodyTpl: [
'<div id="{BSNO}">',
'</div>'
]
}],
// 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.girdcolums.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.columns[1] = new Ext.grid.RowNumberer();
////////////////////////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenMultiEditWin('/MvcShipping/MsOpSeai/SaleEdit', record.data.BSNO);
}, this);
this.gridList.view.on('expandBody', function (rowNode, record, expandRow, eOpts) {
_this.displayInnerGrid(record.get('BSNO'), record.get('FENPIAO'));
});
this.gridList.view.on('collapsebody', function (rowNode, record, expandRow, eOpts) {
_this.destroyInnerGrid(record);
});
//#endregion
_this = this;
//#region formSearch 下拉框信息加载
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modSeaImportList"} });
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
//客服
this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服',
store: this.storeOpCode,
forceSelection: true,
name: 'CUSTSERVICE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//揽货人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeOpCode,
forceSelection: true,
flex: 0.8,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作',
store: this.storeOpCode,
forceSelection: true,
flex: 0.8, name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//录入人
this.comboxINPUTBY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '录入人',
store: this.storeOpCode,
forceSelection: true,
flex: 0.8, name: 'INPUTBY',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//客户加载_委托单位
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
//委托单位
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxCustENTERP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '经营单位',
store: this.storeCustCode,
forceSelection: true,
name: 'ENTERP',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//仓储出库货主
this.comboxCustWmsCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '仓储货主',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME_WMS',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//仓储出库货转对象
this.comboxCustWmsOutCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '货转对象',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME_WMS_OUT',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_贸易代理
this.storeTRADINGAGENCY = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeTRADINGAGENCY.load({ params: { condition: "ISTRADINGAGENCY='1'"} });
//贸易代理
this.comboxTRADINGAGENCY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '贸易代理',
store: this.storeTRADINGAGENCY,
forceSelection: true,
name: 'TRADINGAGENCY',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_船公司
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
//船公司
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司',
store: this.storeCARRIER,
forceSelection: true,
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_车队
this.storeTRUCKER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeTRUCKER.load({ params: { condition: "ISTRUCK='1'"} });
//车队
this.comboxTRUCKER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '车队',
store: this.storeTRUCKER,
forceSelection: true,
name: 'TRUCKER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_报关报检
this.storeCUSTOMSER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCUSTOMSER.load({ params: { condition: "ISCUSTOM='1'"} });
//报关行
this.comboxCUSTOMSER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '报关行',
store: this.storeCUSTOMSER,
forceSelection: true,
name: 'CUSTOMSER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//报检
this.comboxINSPECTION = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '报检',
store: this.storeCUSTOMSER,
forceSelection: true,
name: 'INSPECTION',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//键值维护表_贸易方式
this.storeCrmKeyCodeCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CrmKeyCodeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
});
this.storeCrmKeyCodeCode.load({ params: { condition: " and KEYTYPE='贸易方式'"} });
this.comboxTRADETYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '贸易方式',
store: this.storeCrmKeyCodeCode,
forceSelection: true,
name: 'TRADETYPE',
valueField: 'KEYVALUE',
displayField: 'KEYVALUE'
});
//键值维护表_仓储类型
this.storeCrmKeyCodeCode2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CrmKeyCodeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
});
this.storeCrmKeyCodeCode2.load({ params: { condition: " and KEYTYPE='仓储类型'"} });
this.comboxWMSTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '仓储类型',
store: this.storeCrmKeyCodeCode2,
forceSelection: true,
name: 'WMSTYPE',
valueField: 'KEYVALUE',
displayField: 'KEYVALUE'
});
//键值维护表_装运方式
this.storeCrmKeyCodeCode3 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CrmKeyCodeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
});
this.storeCrmKeyCodeCode3.load({ params: { condition: " and KEYTYPE='装运方式'"} });
this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装运方式',
store: this.storeCrmKeyCodeCode3,
forceSelection: true,
name: 'BLTYPE',
valueField: 'KEYVALUE',
displayField: 'KEYVALUE'
});
//键值维护表_委托单类型
this.storeCrmKeyCodeCode4 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CrmKeyCodeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCrmKeyCodeList' }
});
this.storeCrmKeyCodeCode4.load({ params: { condition: " and KEYTYPE='委托单类型'"} });
this.comboxBSTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单类型',
store: this.storeCrmKeyCodeCode4,
forceSelection: true,
name: 'BSTYPE',
valueField: 'KEYVALUE',
displayField: 'KEYVALUE'
});
//品名
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '品名',
store: this.storeCodeGoodsList,
forceSelection: true,
name: 'GOODSNAME',
valueField: 'GOODNAME',
displayField: 'CodeAndName'
});
//业务来源
this.storeSource = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceModel',
proxy: { url: '/CommMng/BasicDataRef/GetSource' }
});
this.storeSource.load();
this.storeSourceDetail = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.SourceDetailModel',
proxy: { url: '/CommMng/BasicDataRef/GetSourceDetail2' }
});
this.comboxBSSOURCE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务来源',
store: this.storeSource,
forceSelection: true,
name: 'BSSOURCE',
valueField: 'SourceName',
displayField: 'SourceName',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
var recs = DsStoreQueryBy(this.storeSource, 'SourceID', records[0].data.SourceID);
if (recs.getCount() > 0) {
var data = recs.getAt(0).data;
var s = "SOURCEID='" + data.SourceID + "'";
this.storeSourceDetail.load({ params: { condition: s} });
} else {
var BSSOURCEDETAIL = this.formHead.getForm().findField('BSSOURCEDETAIL');
BSSOURCEDETAIL.setValue('');
}
}
}
}
});
this.comboxBSSOURCEDETAIL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '来源明细',
store: this.storeSourceDetail,
forceSelection: true,
name: 'BSSOURCEDETAIL',
valueField: 'SourceDetail',
displayField: 'SourceDetail'
});
//状态_业务状态
Ext.define('BSSTATUSModel', {
extend: 'Ext.data.Model',
fields: [
{ name: 'Name', type: 'string' }
]
});
var dataBSSTATUS = [{ "Name": "未锁定" }, { "Name": "锁定" }, { "Name": ""}];
var storeBSSTATUS = Ext.create('Ext.data.Store', {
model: 'BSSTATUSModel',
data: dataBSSTATUS
});
//业务状态
this.comboxBSSTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务锁定',
forceSelection: true,
store: storeBSSTATUS,
name: 'BSSTATUS',
valueField: 'Name',
displayField: 'Name'
});
//费用状态
this.comboxFEESTATUS = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '费用锁定',
forceSelection: true,
store: storeBSSTATUS,
name: 'FEESTATUS',
valueField: 'Name',
displayField: 'Name'
});
//所属部门
this.storeDept = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DeptModel',
proxy: { url: '/CommMng/BasicDataRef/GetDeptList' }
});
this.storeDept.load();
this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属部门',
store: this.storeDept,
forceSelection: true,
name: 'SALEDEPT',
valueField: 'DeptName',
displayField: 'DeptName'
//,hidden: true
});
//国际港口(进口装货港、出口卸货港)
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
this.storeCodeDisport.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装货港',
store: this.storeCodeDisport,
forceSelection: true,
name: 'PORTLOAD',
valueField: 'CNAME',
displayField: 'CodeAndName'
});
//国内港口(出口装货港、进口卸货港)
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList' }
});
this.storeCodeLoadport.load();
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港',
store: this.storeCodeLoadport,
forceSelection: true,
name: 'PORTDISCHARGE',
valueField: 'CNAME',
displayField: 'CodeAndName'
});
//品名类型
this.storeCodeGoodsType = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsTypeModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsTypeList' }
});
this.storeCodeGoodsType.load();
this.comboxGOODSTYPENAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '品名类型',
store: this.storeCodeGoodsType,
forceSelection: true,
name: 'GOODSTYPENAME',
valueField: 'GoodsTypeName',
displayField: 'CodeAndName'
});
//#endregion
//#region formSearch 查询面板
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '编号',
name: 'MblNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCustCode
// , {
// fieldLabel: '会计期间',
// format: 'Y-m',
// xtype: 'datefield',
// name: 'ACCDATE'
// }
, {
fieldLabel: '到港日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDbgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDend',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxOP, this.comboxSALE, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(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
}]
}
// , {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxOP, this.comboxSALE, this.comboxTRADETYPE, this.comboxGOODSNAME, {
// fieldLabel: '牌号',
// name: 'NUMBERPLATE'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [{
// fieldLabel: '接单日期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'BSDATEbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'BSDATEend'
// }, this.comboxBSSTATUS, this.comboxFEESTATUS, this.comboxWMSTYPE]
// }
]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
//#region formSearch2 隐藏查询面板
// this.formSearch2 = Ext.widget('form', {
// frame: true,
// region: 'north',
// bodyPadding: 0,
// fieldDefaults: {
// margins: '2 2 2 2',
// labelAlign: 'right',
// flex: 1, //所占列
// labelWidth: 70, //值 能够使 text框也是对齐状态
// msgTarget: 'qtip'//文本框显示的必填样式修改这里的值msgTarget:"title" msgTarget:"under" msgTarget:"side"
// },
// items: [{//fieldset 1
// xtype: 'container',
// defaultType: 'textfield',
// layout: 'anchor',
// defaults: {
// anchor: '100%'
// },
// items: [{
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxCustWmsCode, {
// fieldLabel: '建单日期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'CREATETIMEbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'CREATETIMEend'
// }, this.comboxINPUTBY, this.comboxBSTYPE, {
// fieldLabel: '集装箱',
// name: 'CNTRTOTAL'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxCustWmsOutCode, this.comboxPORTLOAD, this.comboxPORTDISCHARGE, {
// fieldLabel: '船名',
// name: 'VESSEL'
// }, {
// fieldLabel: '航次',
// name: 'VOYNO'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxCARRIER, {
// fieldLabel: '箱使到期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'BMDDATEbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'BMDDATEend'
// }, {
// fieldLabel: '搬倒日期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'MDTDATEbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'MDTDATEend'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxGOODSTYPENAME, this.comboxTRADINGAGENCY, {
// fieldLabel: '原产地',
// name: 'COUNTRYOFORIGIN'
// }, {
// fieldLabel: 'BALES',
// name: 'BALES'
// }, this.comboxTRUCKER]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxCUSTOMSER, {
// fieldLabel: '通关日期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'CUSTOMDATEbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'CUSTOMDATEend'
// }, {
// fieldLabel: '申报日期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'UPDATETIMEbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'UPDATETIMEend'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxINSPECTION, {
// fieldLabel: '报检日期',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'INSPECTIONDATEbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'INSPECTIONDATEend'
// }, {
// fieldLabel: '交关税时间',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'TARRIFSPAIEDTIEMbgn'
// }, {
// fieldLabel: '到',
// format: 'Y-m-d',
// xtype: 'datefield',
// name: 'TARRIFSPAIEDTIEMend'
// }]
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [this.comboxBSSOURCE, this.comboxBSSOURCEDETAIL, this.comboxBSTYPE, this.comboxBLTYPE, {
// fieldLabel: '备注',
// name: 'REMARK'
// }]//, { xtype: 'hiddenfield'}
// }, {
// xtype: 'container',
// layout: 'hbox',
// defaultType: 'textfield',
// items: [{
// fieldLabel: '发货人内容',
// name: 'SHIPPER'
// }, {
// fieldLabel: '收货人内容',
// name: 'CONSIGNEE'
// }, {
// fieldLabel: '通知人内容',
// name: 'NOTIFYPARTY'
// }, this.comboxCustENTERP, { xtype: 'hiddenfield'}]//, { xtype: 'hiddenfield'}
// }]//end items(fieldset 1)
// }]//end root items
// });
//#endregion formSearch2
//#region 按钮工具条
_this = this;
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, '-', {
text: "EDI报文导出",
menu: [{ text: "外代EDI",
handler: function (menu, event) {
_this.onCreateEDIClick(menu, event, 'WDSEAIEDI');
}
}, {
text: "交通部EDI",
handler: function (menu, event) {
_this.onCreateIFTMBFClick(menu, event);
}
}],
scope: this
},
'-',
{
text: "EDI导入",
iconCls: "btnexportexcel",
handler: function (button, event) {
this.onImportEdiClick(button, event);
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
DsTruck.SaveGridPanel(USERID, this.formname, this.gridList.columns, this.column, 1, true);
},
scope: this
}, '-', {
text: "高级查询面板",
id: "btIsShowAdvancedQuery",
handler: function (button, event) {
this.setIsShowAdvancedQuery(button, event);
},
scope: this
}, '-',
{ text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}]
});
//#endregion
//#region 合计列表
this.SumField = [
{ name: 'NOBILL', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'PKGS', type: 'number' },
{ name: 'CBM', type: 'number' }
];
this.storeSumList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: this.SumField,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeai/GetSaleCtnSum',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.girdcolumsSum = [{
sortable: true,
dataIndex: 'NOBILL',
header: '票数',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TEU',
header: 'TEU',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
header: '毛重',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'CBM',
header: '尺码',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}
];
this.gridListSum = new Ext.grid.GridPanel({
store: this.storeSumList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolumsSum
});
this.panelSum = new Ext.Panel({
// title: '合 计',
layout: "border",
height: 70,
region: 'south',
margin: '0 0',
frame: true,
items: [this.gridListSum]
});
//#endregion
//#region 页面框架
// this.panelSearch = new Ext.Panel({
// layout: "border",
// region: "north",
// height: 215,
// autoSize: true,
// hidden: true,
// items: [this.formSearch2]
// });
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
items: [this.panelBtn, this.formSearch]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.gridList, this.panelSum]
});
//#endregion
//#region 其他
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
this.sqlcontext = " ACCDATE='" + mydatestr + "'";
this.storeCtnList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'CTNALL', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeai/GetCtnList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.InitGrid(this.girdcolums);
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext },
waitMsg: "正在查询数据...",
scope: this
});
this.onRefreshSumClick(_this.sqlcontext);
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
//#endregion
//#region 外代 EDI
this.CheckNoCtn = new Ext.form.Checkbox({
fieldLabel: '不输出箱号封号',
checked: true
});
this.CheckBill = new Ext.form.Checkbox({
fieldLabel: '货代提单',
checked: false
});
this.formEdiShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
fieldLabel: '报文类型',
id: 'rFILETYPE',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel: '订舱',
name: 'FILETYPE',
checked: true,
inputValue: 'B',
id: 'radio1'
}, {
boxLabel: '确认',
name: 'FILETYPE',
inputValue: 'E',
id: 'radio2'
}
]
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
fieldLabel: '文件功能',
id: 'rFILEROLE',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel: '原始',
name: 'FILEROLE',
inputValue: '9',
checked: true,
id: 'radio3'
}, {
boxLabel: '增加',
name: 'FILEROLE',
inputValue: '2',
id: 'radio4'
}, {
boxLabel: '删除',
name: 'FILEROLE',
inputValue: '3',
id: 'radio5'
}, {
boxLabel: '更新',
name: 'FILEROLE',
inputValue: '4',
id: 'radio6'
}
]
}
]
}, , {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.CheckNoCtn, this.CheckBill
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winEDIShow = Ext.create('Ext.window.Window', {
title: "生成EDI",
width: 450,
//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.formEdiShow],
buttons: [{
text: "上传EDI",
minWidth: 70,
handler: function () {
var cgFILETYPE = Ext.getCmp('rFILETYPE');
var FILETYPE = cgFILETYPE.getValue();
var cgFILEROLE = Ext.getCmp('rFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
var IsNoCtn = 0;
if (me.CheckNoCtn.checked)
IsNoCtn = 1;
var IsBill = 0;
if (me.CheckBill.checked)
IsBill = 1;
me.onSendEDI(me.editype, FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, IsNoCtn);
}
}, {
text: "保存EDI文件",
minWidth: 70,
handler: function () {
var cgFILETYPE = Ext.getCmp('rFILETYPE');
var FILETYPE = cgFILETYPE.getValue();
var cgFILEROLE = Ext.getCmp('rFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
var IsNoCtn = 0;
if (me.CheckNoCtn.checked)
IsNoCtn = 1;
var IsBill = 0;
if (me.CheckBill.checked)
IsBill = 1;
me.onSaveEDI(me.editype, FILETYPE.FILETYPE, FILEROLE.FILEROLE, IsBill, IsNoCtn);
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winEDIShow.close();
}
}]
});
//#endregion
//#region 交通部EDI窗体
this.formIFTMBFShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
fieldLabel: '文件功能',
id: 'jtbFILEROLE',
defaults: { flex: 1 },
layout: 'hbox',
items: [{
boxLabel: '原始',
name: 'FILEROLE',
inputValue: '9',
checked: true
}, {
boxLabel: '更新',
name: 'FILEROLE',
inputValue: '5'
}, {
boxLabel: '删除',
name: 'FILEROLE',
inputValue: '4'
}]
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
fieldLabel: '船公司',
columns: 2,
vertical: true,
id: 'jtbCARRIER',
items: [{
boxLabel: '宁波船代(NBCDI)',
name: 'CARRIER',
inputValue: 'NBCDI',
checked: true
}, {
boxLabel: '上海船代(SHCDI)',
name: 'CARRIER',
inputValue: 'SHCDI'
}]
}
]
}]//end items(fieldset 1)
}]//end root items
});
me = this;
this.winIFTMBFShow = Ext.create('Ext.window.Window', {
title: "生成交通部报文",
width: 450,
//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.formIFTMBFShow],
buttons: [{
text: "上传EDI",
minWidth: 70,
handler: function () {
var cgFILEROLE = Ext.getCmp('jtbFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
var cgCARRIER = Ext.getCmp('jtbCARRIER');
var CARRIER = cgCARRIER.getValue();
me.onSendIFTMBF(FILEROLE.FILEROLE, CARRIER.CARRIER);
}
}, {
text: "保存EDI文件",
minWidth: 70,
handler: function () {
var cgFILEROLE = Ext.getCmp('jtbFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
var cgCARRIER = Ext.getCmp('jtbCARRIER');
var CARRIER = cgCARRIER.getValue();
me.onSaveIFTMBF(FILEROLE.FILEROLE, CARRIER.CARRIER);
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winIFTMBFShow.close();
}
}]
});
//#endregion
//#region 下载窗体
this.formDownloadShow = Ext.widget('form', {
frame: true,
region: 'center',
height: 100,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
id: 'downloadfile',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'label',
html: '',
width: 120,
text: ''
}]//end items(fieldset 1)
}]//end root items
});
me = this;
this.winDownloadShow = Ext.create('Ext.window.Window', {
title: "下载文件",
width: 450,
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.formDownloadShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
me.winDownloadShow.close();
}
}]
});
//#endregion
}, //end initUIComponents
//#region 基本调用函数
InitGrid: function (grid) {
//var agirdcolums = Ext.clone(this.gridList.columns);
var agirdcolums = grid;
// var agirdcolumsSum = this.girdcolumsSum;
this.storectndisp.load({ params: { condition: "" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
for (i = 0; i < this.storectndisp.getCount(); i += 1) {
var itemindex = i + 1;
var memberyf = this.storectndisp.getAt(i);
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'CNTR1') {
if (memberyf.data.CNT1 != '' && memberyf.data.CNT1 != null) {
agirdcolums[j].header = memberyf.data.CNT1;
//agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR2') {
if (memberyf.data.CNT2 != '' && memberyf.data.CNT2 != null) {
agirdcolums[j].header = memberyf.data.CNT2;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR3') {
if (memberyf.data.CNT3 != '' && memberyf.data.CNT3 != null) {
agirdcolums[j].header = memberyf.data.CNT3;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR4') {
if (memberyf.data.CNT4 != '' && memberyf.data.CNT4 != null) {
agirdcolums[j].header = memberyf.data.CNT4;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR5') {
if (memberyf.data.CNT5 != '' && memberyf.data.CNT5 != null) {
agirdcolums[j].header = memberyf.data.CNT5;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR6') {
if (memberyf.data.CNT6 != '' && memberyf.data.CNT6 != null) {
agirdcolums[j].header = memberyf.data.CNT6;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR7') {
if (memberyf.data.CNT7 != '' && memberyf.data.CNT7 != null) {
agirdcolums[j].header = memberyf.data.CNT7;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR8') {
if (memberyf.data.CNT8 != '' && memberyf.data.CNT8 != null) {
agirdcolums[j].header = memberyf.data.CNT8;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR9') {
if (memberyf.data.CNT9 != '' && memberyf.data.CNT9 != null) {
agirdcolums[j].header = memberyf.data.CNT9;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
if (agirdcolums[j].dataIndex == 'CNTR10') {
if (memberyf.data.CNT10 != '' && memberyf.data.CNT10 != null) {
agirdcolums[j].header = memberyf.data.CNT10;
agirdcolums[j].hidden = false;
} else {
agirdcolums[j].hidden = true;
}
}
}
};
}
this.storecodeservice.load({ params: { condition: "OPTYPE='2'" },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
for (i = 0; i < this.storecodeservice.getCount(); i += 1) {
var itemindex = i + 1;
var memberyf = this.storecodeservice.getAt(i);
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == memberyf.data.OPField) {
agirdcolums[j].header = memberyf.data.SERVICENAME;
agirdcolums[j].hidden = false;
}
}
};
}
this.gridList.reconfigure(this.storeList, agirdcolums);
}
},
scope: this
});
// this.gridList.reconfigure(this.storeList, agirdcolums);
// this.gridListSum.reconfigure(this.storeSumList, agirdcolumsSum);
}
},
scope: this
});
},
onRefreshClick: function (button, event) {
//var girdcolums = this.gridList.getColumnMode();
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
});
this.onRefreshSumClick(sql);
},
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
});
this.onRefreshSumClick(sql);
},
onRefreshSumClick: function (sql) {
this.SumField = [
{ name: 'NOBILL', type: 'number' },
{ name: 'TEU', type: 'number' },
{ name: 'KGS', type: 'number' },
{ name: 'PKGS', type: 'number' },
{ name: 'CBM', type: 'number' }
];
this.girdcolumsSum = [{
sortable: true,
dataIndex: 'NOBILL',
header: '票数',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TEU',
header: 'TEU',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'PKGS',
header: '件数',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'KGS',
header: '毛重',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'CBM',
header: '尺码',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}
];
_this = this;
this.storeCtnList.load({ params: { condition: sql },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
for (i = 0; i < _this.storeCtnList.getCount(); i += 1) {
var itemindex = i + 1;
var memberyf = _this.storeCtnList.getAt(i);
_this.SumField.push({ name: 'C' + memberyf.data.CTNALL, type: 'number' });
_this.girdcolumsSum.push({
sortable: true,
dataIndex: 'C' + memberyf.data.CTNALL,
header: memberyf.data.CTNALL,
width: 80
});
};
}
_this.storeSumList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: _this.SumField,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeai/GetCtnSum',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
_this.gridListSum.reconfigure(_this.storeSumList, _this.girdcolumsSum);
_this.storeSumList.load({
params: { condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
}
}
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
if (record.data.BSSTATUS == 'true') {
Ext.Msg.show({ title: '警告', msg: '业务已锁定,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
if (record.data.FEESTATUS == 'true') {
Ext.Msg.show({ title: '警告', msg: '费用已锁定,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
if (this.StoreOpRange.getCount() == 0) {
Ext.Msg.show({ title: '警告', msg: '权限不足,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
} else {
var op = record.data.OP;
var inputby = record.data.INPUTBY;
var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
var recordins = DsStoreQueryBy(this.StoreOpRange, 'OPID', inputby);
if (recordins.getCount() > 0) {
} else {
canedit = false;
Ext.Msg.show({ title: '警告', msg: '权限不足,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
}
}
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/MsOpSeai/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);
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
//#endregion
//#region 拼箱分票Grid
displayInnerGrid: function (renderId, fenpiao) {
if (fenpiao == '0')
return;
var storeBodyList = Ext.create('Ext.data.Store', {
model: 'MsOpSeaiModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeai/GetFenList',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
innerGrid = Ext.create('Ext.grid.Panel', {
store: storeBodyList,
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
},
columns: [{
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
width: 0
},
{
sortable: true,
dataIndex: 'BSSTATUSREF',
align: 'center',
header: '业务锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
dataIndex: 'FEESTATUSREF',
align: 'center',
header: '费用锁定',
width: 60,
renderer: function (value, cellmeta) {
if (value == '锁定') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
},
{
sortable: true,
dataIndex: 'BSTYPE',
header: '委托单类型',
width: 70
},
{
sortable: true,
dataIndex: 'WMSTYPE',
header: '仓储类型',
width: 60
},
{
sortable: true,
dataIndex: 'OPSTATUS',
header: '状态管理',
width: 80,
renderer: function (value, metadata, record, rowIndex) {
metadata.style = "background-color:" + record.data.OPSTATUSCOLOR;
return value;
}
},
{
sortable: true,
dataIndex: 'ETD',
header: '到港日期',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 120
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 120
},
{
sortable: true,
dataIndex: 'TRADETYPE',
header: '贸易方式',
width: 60
},
{
sortable: true,
dataIndex: 'BSDATE',
header: '接单日期',
width: 80
},
{
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合同号',
width: 120
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 120
},
{
sortable: true,
dataIndex: 'NUMBERPLATE',
header: '牌号',
width: 120
},
{
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 80
},
{
sortable: true,
dataIndex: 'KGS',
header: '毛重',
width: 80
},
{
sortable: true,
dataIndex: 'NETWEIGHT',
header: '净重',
width: 80
},
{
sortable: true,
dataIndex: 'CNTRTOTAL',
header: '集装箱',
width: 80
},
{
sortable: true,
dataIndex: 'ORDERTYPE',
header: '委托方式',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 120
}, {
sortable: true,
id: '',
dataIndex: 'ORDERNO',
header: '业务编号',
width: 120
},
{
sortable: true,
dataIndex: 'HBLNO',
header: '分提单号',
width: 120
},
{
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
width: 60
},
{
sortable: true,
dataIndex: 'BSSOURCE',
header: '业务来源',
width: 80
},
{
sortable: true,
dataIndex: 'BSSOURCEDETAIL',
header: '来源明细',
width: 80
},
{
sortable: true,
dataIndex: 'INPUTBY',
header: '录入人',
width: 80
},
{
sortable: true,
dataIndex: 'CREATETIME',
header: '创建时间',
width: 120
},
{
sortable: true,
dataIndex: 'OP',
header: '操作员',
width: 80
},
{
sortable: true,
dataIndex: 'SALE',
header: '揽货人',
width: 80
},
{
sortable: true,
dataIndex: 'VESSEL',
header: '船名',
width: 100
},
{
sortable: true,
dataIndex: 'VOYNO',
header: '航次',
width: 60
},
{
sortable: true,
dataIndex: 'PORTLOAD',
header: '装货港',
width: 100
},
{
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '卸货港',
width: 100
},
{
sortable: true,
dataIndex: 'OTCNTR',
header: '其他箱型',
width: 60
},
{
sortable: true,
dataIndex: 'TEU',
header: '箱TEU',
width: 40
},
{
sortable: true,
dataIndex: 'COUNTRYOFORIGIN',
header: '原产地',
width: 80
},
{
sortable: true,
dataIndex: 'UNITS',
header: '单位',
width: 40
},
{
sortable: true,
dataIndex: 'BALES',
header: '包装(散货/托盘)数',
width: 60
},
{
sortable: true,
dataIndex: 'CUSTOMSER',
header: '报关行',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMNO',
header: '报关单号',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMDATE',
header: '通关日期',
width: 80
},
{
sortable: true,
dataIndex: 'INSPECTION',
header: '报检',
width: 80
},
{
sortable: true,
dataIndex: 'INSPECTIONNO',
header: '报检单号',
width: 80
},
{
sortable: true,
dataIndex: 'INSPECTIONDATE',
header: '报检日期',
width: 80
},
{
sortable: true,
dataIndex: 'KINDPKGS',
header: '件数包装',
width: 60
},
{
sortable: true,
dataIndex: 'CBM',
header: '立方/尺码',
width: 60
},
{
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 100
},
{
sortable: true,
dataIndex: 'ENTERP',
header: '经营单位',
width: 100
},
{
sortable: true,
dataIndex: 'TRUCKER',
header: '承运车队',
width: 100
},
{
sortable: true,
dataIndex: 'VOUNO',
header: '凭证号',
width: 60
},
{
sortable: true,
dataIndex: 'FBP',
header: '免箱期',
width: 60
},
{
sortable: true,
dataIndex: 'BMDDATE',
header: '箱使到期日',
width: 70
},
{
sortable: true,
dataIndex: 'MDTDATE',
header: '搬倒日期',
width: 80
},
{
sortable: true,
dataIndex: 'TRADINGAGENCY',
header: '贸易代理',
width: 80
},
{
sortable: true,
dataIndex: 'GOODSTYPENAME',
header: '品名类型',
width: 60
},
{
sortable: true,
dataIndex: 'SHOWNAME',
header: '委托单位联系人',
width: 100
},
{
sortable: true,
dataIndex: 'EMAIL',
header: '委托单位EMAIL',
width: 90
},
{
sortable: true,
dataIndex: 'TEL',
header: '委托单位TEL',
width: 80
},
{
sortable: true,
dataIndex: 'FAX',
header: '委托单位FAX',
width: 80
},
{
sortable: true,
dataIndex: 'TARRIFSPAIEDTIEM',
header: '交关税时间',
width: 70
},
{
sortable: true,
dataIndex: 'APPROVENO',
header: '审批单号',
width: 100
},
{
sortable: true,
dataIndex: 'UPDATETIME',
header: '申报日期',
width: 80
},
{
sortable: true,
dataIndex: 'IMPORTVALUE',
header: '货值',
width: 50,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
},
{
sortable: true,
dataIndex: 'UNITPRICE',
header: '单价',
width: 50,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
],
// columnLines: true,
// autoWidth: true,
// autoHeight: true,
frame: false,
renderTo: renderId
});
innerGrid.columns[0] = new Ext.grid.RowNumberer();
innerGrid.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/MvcShipping/MsOpSeai/Edit');
}, this);
storeBodyList.on('beforeload', function (store) {
var sql = " MASTERNO='" + renderId + "' AND BSNO<>'" + renderId + "'"
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
storeBodyList.load({ params: { start: 0, limit: this.PageSize, sort: '', condition: " MASTERNO='" + renderId + "' AND BSNO<>'" + renderId + "'"} });
// innerGrid.getEl().swallowEvent([
// 'mousedown', 'mouseup', 'click',
// 'contextmenu', 'mouseover', 'mouseout',
// 'dblclick', 'mousemove'
// ]);
},
destroyInnerGrid: function (record) {
var parent = document.getElementById(record.get('BSNO'));
var child = parent.firstChild;
while (child) {
child.parentNode.removeChild(child);
child = child.nextSibling;
}
},
//#endregion
//#region 其他调用函数
onImportEdiClick: function (button, event) {
var winAccess = new Shipping.EDIImport({
});
winAccess.StoreList = this.storeList;
winAccess.show();
return;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
// var form2 = this.formSearch2.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
//隐藏查询面板
// this.panelSearch.hide();
this.isShowAdvancedQuery = 0;
//
var sql = "";
//#region formSearch 查询面板
//编号包括(主提单号)
var MblNo = form.findField('MblNo').getValue();
sql = sql + getAndConSql(sql, MblNo, "(MblNo like '%" + MblNo + "%' or CONTRACTNO like '%" + MblNo + "%' or CUSTNO like '%" + MblNo + "%' or HBLNO like '%" + MblNo + "%' or CUSTOMNO like '%" + MblNo + "%' or INSPECTIONNO like '%" + MblNo + "%' or VOUNO like '%" + MblNo + "%' or APPROVENO like '%" + MblNo + "%' or ORDERNO like '%" + MblNo + "%')");
//客户名称
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
// //会计期间
// var ACCDATE = form.findField('ACCDATE').getRawValue();
// sql = sql + getAndConSql(sql, ACCDATE, "ACCDATE='" + ACCDATE + "'");
//到港日期
var ETDbgn = form.findField('ETDbgn').getRawValue();
sql = sql + getAndConSql(sql, ETDbgn, "ETD >='" + ETDbgn + "'");
var ETDend = form.findField('ETDend').getRawValue();
sql = sql + getAndConSql(sql, ETDend, "ETD <='" + ETDend + "'");
//操作人
var OP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, OP, "OP='" + OP + "'");
//揽货人
var SALE = form.findField('SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "SALE='" + SALE + "'");
// //贸易方式
// var TRADETYPE = form.findField('TRADETYPE').getValue();
// sql = sql + getAndConSql(sql, TRADETYPE, "TRADETYPE='" + TRADETYPE + "'");
// //品名
// var GOODSNAME = form.findField('GOODSNAME').getValue();
// sql = sql + getAndConSql(sql, GOODSNAME, "GOODSNAME='" + GOODSNAME + "'");
// //牌号
// var NUMBERPLATE = form.findField('NUMBERPLATE').getValue();
// sql = sql + getAndConSql(sql, NUMBERPLATE, "NUMBERPLATE like '%" + NUMBERPLATE + "%'");
// //接单日期
// var BSDATEbgn = form.findField('BSDATEbgn').getRawValue();
// sql = sql + getAndConSql(sql, BSDATEbgn, "BSDATE >='" + BSDATEbgn + "'");
// var BSDATEend = form.findField('BSDATEend').getRawValue();
// sql = sql + getAndConSql(sql, BSDATEend, "BSDATE <='" + BSDATEend + "'");
// //业务状态
// var BSSTATUS = form.findField('BSSTATUS').getValue();
// if (BSSTATUS != null) {
// if (BSSTATUS.toString().trim() == "锁定") {
// sql = sql + getAndConSql(sql, BSSTATUS, "BSSTATUS=1");
// }
// else if (BSSTATUS.toString().trim() == "未锁定") {
// sql = sql + getAndConSql(sql, BSSTATUS, "BSSTATUS=0");
// }
// }
// //费用状态
// var FEESTATUS = form.findField('FEESTATUS').getValue();
// if (FEESTATUS != null) {
// if (FEESTATUS.toString().trim() == "锁定") {
// sql = sql + getAndConSql(sql, FEESTATUS, "FEESTATUS=1");
// }
// else if (FEESTATUS.toString().trim() == "未锁定") {
// sql = sql + getAndConSql(sql, FEESTATUS, "FEESTATUS=0");
// }
// }
// //仓储状态
// var WMSTYPE = form.findField('WMSTYPE').getValue();
// sql = sql + getAndConSql(sql, WMSTYPE, "WMSTYPE='" + WMSTYPE + "'");
//#endregion formSearch
//#region formSearch2 隐藏查询面板
// //建单日期
// var CREATETIMEbgn = form2.findField('CREATETIMEbgn').getRawValue();
// sql = sql + getAndConSql(sql, CREATETIMEbgn, "CREATETIME >='" + CREATETIMEbgn + "'");
// var CREATETIMEend = form2.findField('CREATETIMEend').getRawValue();
// sql = sql + getAndConSql(sql, CREATETIMEend, "CREATETIME <='" + CREATETIMEend + "'");
// //录入人
// var INPUTBY = form2.findField('INPUTBY').getValue();
// sql = sql + getAndConSql(sql, INPUTBY, "INPUTBY='" + INPUTBY + "'");
// //
// var BSTYPE = form2.findField('BSTYPE').getValue();
// sql = sql + getAndConSql(sql, BSTYPE, "BSTYPE='" + BSTYPE + "'");
// //牌号
// var CNTRTOTAL = form2.findField('CNTRTOTAL').getValue();
// sql = sql + getAndConSql(sql, CNTRTOTAL, "CNTRTOTAL like '%" + CNTRTOTAL + "%'");
// //仓储入库货主
// var CUSTOMERNAME_WMS = form2.findField('CUSTOMERNAME_WMS').getValue();
// sql = sql + getAndConSql(sql, CUSTOMERNAME_WMS, "bsno in (select ASSOCIATEDNO from wms where CUSTOMERNAME='" + CUSTOMERNAME_WMS + "' and CORPID='" + COMPANYID + "')");
// //仓储出库货转对象
// var CUSTOMERNAME_WMS_OUT = form2.findField('CUSTOMERNAME_WMS_OUT').getValue();
// sql = sql + getAndConSql(sql, CUSTOMERNAME_WMS_OUT, "bsno in (select ASSOCIATEDNO from wms_out where CLIENTNAMEOLD='" + CUSTOMERNAME_WMS_OUT + "' and CORPID='" + COMPANYID + "')");
// //装货港
// var PORTLOAD = form2.findField('PORTLOAD').getValue();
// sql = sql + getAndConSql(sql, PORTLOAD, "PORTLOAD like '%" + PORTLOAD + "%'");
// //卸货港
// var PORTDISCHARGE = form2.findField('PORTDISCHARGE').getValue();
// sql = sql + getAndConSql(sql, PORTDISCHARGE, "PORTDISCHARGE like '%" + PORTDISCHARGE + "%'");
// //船名
// var VESSEL = form2.findField('VESSEL').getValue();
// sql = sql + getAndConSql(sql, VESSEL, "VESSEL like '%" + VESSEL + "%'");
// //航次
// var VOYNO = form2.findField('VOYNO').getValue();
// sql = sql + getAndConSql(sql, VOYNO, "VOYNO like '%" + VOYNO + "%'");
// //船公司
// var CARRIER = form2.findField('CARRIER').getValue();
// sql = sql + getAndConSql(sql, CARRIER, "CARRIER='" + CARRIER + "'");
// //箱使到期
// var BMDDATEbgn = form2.findField('BMDDATEbgn').getRawValue();
// sql = sql + getAndConSql(sql, BMDDATEbgn, "BMDDATE >='" + BMDDATEbgn + "'");
// var BMDDATEend = form2.findField('BMDDATEend').getRawValue();
// sql = sql + getAndConSql(sql, BMDDATEend, "BMDDATE <='" + BMDDATEend + "'");
// //搬倒日期
// var MDTDATEbgn = form2.findField('MDTDATEbgn').getRawValue();
// sql = sql + getAndConSql(sql, MDTDATEbgn, "MDTDATE >='" + MDTDATEbgn + "'");
// var MDTDATEend = form2.findField('MDTDATEend').getRawValue();
// sql = sql + getAndConSql(sql, MDTDATEend, "MDTDATE <='" + MDTDATEend + "'");
// //品名类型
// var GOODSTYPENAME = form2.findField('GOODSTYPENAME').getValue();
// sql = sql + getAndConSql(sql, GOODSTYPENAME, "GOODSTYPENAME like '%" + GOODSTYPENAME + "%'");
// //贸易代理
// var TRADINGAGENCY = form2.findField('TRADINGAGENCY').getValue();
// sql = sql + getAndConSql(sql, TRADINGAGENCY, "TRADINGAGENCY='" + TRADINGAGENCY + "'");
// //原产地
// var COUNTRYOFORIGIN = form2.findField('COUNTRYOFORIGIN').getValue();
// sql = sql + getAndConSql(sql, COUNTRYOFORIGIN, "COUNTRYOFORIGIN like '%" + COUNTRYOFORIGIN + "%'");
// //BALES
// var BALES = form2.findField('BALES').getValue();
// sql = sql + getAndConSql(sql, BALES, "BALES like '%" + BALES + "%'");
// //车队
// var TRUCKER = form2.findField('TRUCKER').getValue();
// sql = sql + getAndConSql(sql, TRUCKER, "TRUCKER='" + TRUCKER + "'");
// //报关行
// var CUSTOMSER = form2.findField('CUSTOMSER').getValue();
// sql = sql + getAndConSql(sql, CUSTOMSER, "CUSTOMSER='" + CUSTOMSER + "'");
// //发货人
// var SHIPPER = form2.findField('SHIPPER').getValue();
// sql = sql + getAndConSql(sql, SHIPPER, "SHIPPER like '%" + SHIPPER + "%'");
// //收货人
// var CONSIGNEE = form2.findField('CONSIGNEE').getValue();
// sql = sql + getAndConSql(sql, CONSIGNEE, "CONSIGNEE like '%" + CONSIGNEE + "%'");
// //通知人
// var NOTIFYPARTY = form2.findField('NOTIFYPARTY').getValue();
// sql = sql + getAndConSql(sql, NOTIFYPARTY, "NOTIFYPARTY like '%" + NOTIFYPARTY + "%'");
// var ENTERP = form2.findField('ENTERP').getValue();
// sql = sql + getAndConSql(sql, ENTERP, "ENTERP ='" + ENTERP + "'");
// //通关日期
// var CUSTOMDATEbgn = form2.findField('CUSTOMDATEbgn').getRawValue();
// sql = sql + getAndConSql(sql, CUSTOMDATEbgn, "CUSTOMDATE >='" + CUSTOMDATEbgn + "'");
// var CUSTOMDATEend = form2.findField('CUSTOMDATEend').getRawValue();
// sql = sql + getAndConSql(sql, CUSTOMDATEend, "CUSTOMDATE <='" + CUSTOMDATEend + "'");
// //申报日期
// var UPDATETIMEbgn = form2.findField('UPDATETIMEbgn').getRawValue();
// sql = sql + getAndConSql(sql, UPDATETIMEbgn, "UPDATETIME >='" + UPDATETIMEbgn + "'");
// var UPDATETIMEend = form2.findField('UPDATETIMEend').getRawValue();
// sql = sql + getAndConSql(sql, UPDATETIMEend, "UPDATETIME <='" + UPDATETIMEend + "'");
// //报检
// var INSPECTION = form2.findField('INSPECTION').getValue();
// sql = sql + getAndConSql(sql, INSPECTION, "INSPECTION='" + INSPECTION + "'");
// //报检日期
// var INSPECTIONDATEbgn = form2.findField('INSPECTIONDATEbgn').getRawValue();
// sql = sql + getAndConSql(sql, INSPECTIONDATEbgn, "INSPECTIONDATE >='" + INSPECTIONDATEbgn + "'");
// var INSPECTIONDATEend = form2.findField('INSPECTIONDATEend').getRawValue();
// sql = sql + getAndConSql(sql, INSPECTIONDATEend, "INSPECTIONDATE <='" + INSPECTIONDATEend + "'");
// //交关税时间
// var TARRIFSPAIEDTIEMbgn = form2.findField('TARRIFSPAIEDTIEMbgn').getRawValue();
// sql = sql + getAndConSql(sql, TARRIFSPAIEDTIEMbgn, "TARRIFSPAIEDTIEM >='" + TARRIFSPAIEDTIEMbgn + "'");
// var TARRIFSPAIEDTIEMend = form2.findField('TARRIFSPAIEDTIEMend').getRawValue();
// sql = sql + getAndConSql(sql, TARRIFSPAIEDTIEMend, "TARRIFSPAIEDTIEM <='" + TARRIFSPAIEDTIEMend + "'");
// //业务来源
// var BSSOURCE = form2.findField('BSSOURCE').getValue();
// sql = sql + getAndConSql(sql, BSSOURCE, "BSSOURCE='" + BSSOURCE + "'");
// //来源明细
// var BSSOURCEDETAIL = form2.findField('BSSOURCEDETAIL').getValue();
// sql = sql + getAndConSql(sql, BSSOURCEDETAIL, "BSSOURCEDETAIL='" + BSSOURCEDETAIL + "'");
// //装运方式
// var BLTYPE = form2.findField('BLTYPE').getValue();
// sql = sql + getAndConSql(sql, BLTYPE, "BLTYPE='" + BLTYPE + "'");
// //备注
// var REMARK = form2.findField('REMARK').getValue();
// sql = sql + getAndConSql(sql, REMARK, "REMARK like '%" + REMARK + "%'");
//#endregion formSearch2
return sql;
},
setIsShowAdvancedQuery: function () {
if (this.isShowAdvancedQuery == 0) {
this.panelSearch.show();
this.isShowAdvancedQuery = 1;
} else {
this.panelSearch.hide();
this.isShowAdvancedQuery = 0;
}
},
onUpOpStatusClick: function (menu, event, type) {
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BSNOStr = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BSNO = "'" + rec.data.BSNO + "'";
if (BSNOStr == '')
BSNOStr = BSNO;
else {
BSNOStr = BSNOStr + ',' + BSNO;
}
}
if (BSNOStr == '') {
Ext.Msg.show({ title: '提示', msg: '没有要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
this.selectbsno = " BSNO IN (" + BSNOStr + ")";
window.open('/MvcShipping/MsOpStatus/PiLiang', "PILIANGOPSTATUS", 'width=1200,height=600,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
}
},
onPiLiangSubmitClick: function (menu, event, type) {
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BSNOStr = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var BSNO = "'" + rec.data.BSNO + "'";
if (BSNOStr == '')
BSNOStr = BSNO;
else {
BSNOStr = BSNOStr + ',' + BSNO;
}
}
this.storePLList.removeAll();
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
this.storePLList.add(rec.data);
}
if (BSNOStr == '') {
Ext.Msg.show({ title: '提示', msg: '没有要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
this.selectbsno = " BSNO IN (" + BSNOStr + ")";
window.open('/Account/Chfee_Audit/PiLiangSubmit', "PILIANGSUBMIT", 'width=1200,height=600,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
}
},
onFeeEditClick: function (menu, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/MvcShipping/MsOpSeai/PiLiangFeeEdit');
},
//#endregion
//#region 导出EDI
onCreateEDIClick: function (menu, event, type) {
this.editype = type;
this.winEDIShow.show();
},
onSendEDI: function (type, filetype, filerole, isbill, isnoctn) {
var GidStr = '';
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
var j = 0;
var Mblno = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
Mblno = rec.data.MBLNO;
bodyAddDatas.push(rec);
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在生成...',
url: '/MvcShipping/MsOpSeai/CreateEDIList',
params: {
headData: jsonbodyAddDatas,
mblno: Mblno,
type: type,
filetype: filetype,
filerole: filerole,
isbill: isbill,
isnoctn: isnoctn
},
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.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onSaveEDI: function (type, filetype, filerole, isbill, isnoctn) {
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;
}
var insert;
var bodyAddDatas = [];
var j = 0;
var Mblno = '';
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var EDISTATUS = rec.data.EDISTATUS;
if (EDISTATUS == "已发送") {
j = j + 1;
}
Mblno = rec.data.MBLNO;
bodyAddDatas.push(rec);
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
var msg = '';
msg = '确定要保存EDI文件吗';
var strlo = window.location.host;
_this = this;
Ext.MessageBox.confirm('提示', msg, function (btn) {
if (btn == 'yes') {
Ext.Ajax.request({
waitMsg: 'Changing...',
url: '/MvcShipping/MsOpSeai/SaveEDIList',
params: {
headData: jsonbodyAddDatas,
mblno: Mblno,
type: type,
filetype: filetype,
filerole: filerole,
isbill: isbill,
isnoctn: isnoctn
},
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.MessageBox.ERROR, buttons: Ext.Msg.OK });
return;
} else {
var downloadfile = Ext.getCmp('downloadfile');
var filehtml = '<a href="' + result.Data + '" style=' + '"text-decoration:none"' + '>' + result.Message + '</a>'
downloadfile.html = filehtml;
this.winDownloadShow.show();
}
} else {
Ext.MessageBox.alert('The Server Response Error, Please Try Again', response.responseText);
}
},
scope: this
});
}
}, this);
},
//#endregion
//#region 交通部EDI
onCreateIFTMBFClick: function (menu, event) {
this.winIFTMBFShow.show();
},
onSendIFTMBF: function (filerole, carrier) {
var GidStr = '';
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BSNOStr = '';
var j = 0;
var Mblno = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
Mblno = rec.data.MBLNO;
var BSNO = rec.data.BSNO;
if (BSNOStr == '')
BSNOStr = BSNO;
else {
BSNOStr = BSNOStr + ',' + BSNO;
}
}
if (BSNOStr == '') {
Ext.Msg.show({ title: '提示', msg: '没有要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Ajax.request({
waitMsg: '正在生成...',
url: '/MvcShipping/MsOpSeai/CreateIFTMBFList',
params: {
bsnos: BSNOStr,
mblno: Mblno,
filerole: filerole,
carrier: carrier
},
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.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
onSaveIFTMBF: function (filerole, carrier) {
var GidStr = '';
var selections = this.GridCheckBoxModel.selected.items;
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var BSNOStr = '';
var j = 0;
var Mblno = '';
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
Mblno = rec.data.MBLNO;
var BSNO = rec.data.BSNO;
if (BSNOStr == '')
BSNOStr = BSNO;
else {
BSNOStr = BSNOStr + ',' + BSNO;
}
}
if (BSNOStr == '') {
Ext.Msg.show({ title: '提示', msg: '没有要生成的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
Ext.Ajax.request({
waitMsg: 'Changing...',
url: '/MvcShipping/MsOpSeai/SaveIFTMBFList',
params: {
bsnos: BSNOStr,
mblno: Mblno,
filerole: filerole,
carrier: carrier
},
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.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
var downloadfile = Ext.getCmp('downloadfile');
var children = downloadfile.items;
if (children) {
for (var i = 0, len = children.length; i < len; i++) {
downloadfile.remove(children.items[i], true);
}
}
var downloadfiles = '<a href="' + result.Data + '" style=' + '"text-decoration:none"' + '>' + result.Message + '</a>';
var htmla = Ext.widget('label', {
html: downloadfiles,
width: 120,
text: ''
});
downloadfile.items.add(htmla);
this.winDownloadShow.show();
}
} else {
Ext.MessageBox.alert('The Server Response Error, Please Try Again', response.responseText);
}
},
scope: this
});
}
},
//#endregion
//#region 导出Excel
onExportClick: function (button, event) {
var strGIDs = "";
var sql = escape(this.sqlcontext);
var openSet = "height=1, width=400, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top=" + (screen.height - 200) / 2 + ",Left=" + (screen.width - 400) / 2;
var openType = "_blank";
var openUrl = "../../Reports/RptExport.aspx?handle=MsOpSeaiIndex&formname=" + this.formname + "&condition1=" + sql + "&gids=" + strGIDs;
window.open(openUrl, openType, openSet);
},
//#endregion
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_seai';
ret[5] = this.storePLList;
return ret;
},
//#region 打印
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcShipping/MsOpSeai/GetDataListStr',
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 = 'MSOPSEAILIST';
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 feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('BSNO') + "'";
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 = 'MSOPSEAILISTSELECT';
var sql1 = "select * from op_seai WHERE BSNO IN (" + feeGidSql + ") order by BSDATE desc";
var sql2 = "select * from op_seai where BSNO='" + bsno + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
//#endregion
});