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.

2005 lines
75 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.MsOpCtnBsCardCqRptIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpCtnBsCardCqRptIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpCtnBsCardCqRptIndex, Ext.Panel, {
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
PageSize: 50,
sortfield: '',
sortdire: '',
AccDate: null,
initUIComponents: function () {
this.formname = "formMsOpCtnBsCardCqRptIndex"; //页面名称
this.openertype = getUrlParam("opener");
this.CTNBSCARDUNLOCK = false;
this.MsOpCtnCQTXIsOnly = 0;
this.storeListLock = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'GID', type: 'string' },
{ name: 'FIELDNAME', type: 'string' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpCtnBsCard/GetLockField',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.worksql = getUrlParam('worksql');
this.storePLList = Ext.create('Ext.data.Store', {
model: 'MsOpCtnBsCard'
});
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'MsOpCtnBsCard',
pageSize: this.PageSize,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpCtnBsCard/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 170,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
})
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.initgirdcolums = [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
id: '',
dataIndex: '',
header: '',
width: 0
}, {
sortable: true,
dataIndex: 'COMPANYID',
header: 'COMPANYID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'CTNNO',
header: '箱号',
width: 200
}, {
sortable: true,
dataIndex: 'APPLYNO',
header: '放箱申请编号',
width: 120
}, {
sortable: true,
dataIndex: 'CTNPROP',
header: '箱属',
width: 200
}, {
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
width: 200
}, {
sortable: true,
dataIndex: 'MODIFYTIME',
header: '更新时间',
width: 200
}, {
sortable: true,
dataIndex: 'ISCLOSE',
header: '锁定',
width: 100,
renderer: function (value, cellmeta) {
if (value == 'true') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
}, {
sortable: true,
dataIndex: 'IS_PUTCTN',
header: '放箱通知发送',
width: 100,
renderer: function (value, cellmeta) {
if (value == 'true') {
return "是";
}
}
}, {
sortable: true,
dataIndex: 'PUTCTNDATE',
header: '放箱通知发送时间',
width: 100
}, {
sortable: true,
dataIndex: 'PUTCTNAUDITSTATUS',
header: '放箱通知状态',
width: 100
}, {
sortable: true,
dataIndex: 'PUTCTNAUDITBYREF',
header: '放箱通知审核人',
width: 100
}, {
xtype: 'actioncolumn',
width: 50,
text: '预览放箱单', //操作
items: [{
icon: '/images/icons/btnSearch.gif', // Use a URL in the icon config
tooltip: '预览',
getClass: function (v, meta, rec) {
var filePath = rec.get('ATTACHMENTFXD');
if (filePath == '' || filePath == null) {
return '';
} else {
return 'button_view';
}
},
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var filePath = rec.get('ATTACHMENTFXD');
if (filePath == '') {
Ext.Msg.show({ title: '提示', msg: '没有文件无法预览!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var imgView = new Shipping.FileView({ filePath: filePath + '?a=' + Math.random() });
imgView.show();
}
}]
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 200
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: '货物名称',
width: 100
}, {
sortable: true,
dataIndex: 'GOODSNAMEREF',
header: '货物名称(含英文简称)',
width: 100
}, {
sortable: true,
dataIndex: 'PREGOODSNAME',
header: '前装货品名',
width: 100
}, {
sortable: true,
dataIndex: 'ETD',
header: '开船日期',
width: 100
}, {
sortable: true,
dataIndex: 'PREETA',
header: '预抵日期',
width: 100
}, {
sortable: true,
dataIndex: 'PREETD',
header: '预计开船日期',
width: 100
}, {
sortable: true,
dataIndex: 'ETA',
header: '到港日期',
width: 100
}, {
sortable: true,
dataIndex: 'AGENTNAME',
header: '目的港代理',
width: 100
}, {
sortable: true,
dataIndex: 'CUR_PORT',
header: '当前位置',
width: 100
}, {
sortable: true,
dataIndex: 'CUR_DATE',
header: '当前时间',
width: 100
}, {
sortable: true,
dataIndex: 'CYCLE_DAY',
header: '周期',
width: 100
}, {
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 200
}, {
sortable: true,
dataIndex: 'OP',
header: '操作',
width: 200
}, {
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 200
}, {
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 200
}, {
sortable: true,
dataIndex: 'PORTLOAD_STATOIN',
header: '起运港场站',
width: 200
}, {
sortable: true,
dataIndex: 'PORTLOAD_CNT_TIME',
header: '起运港提箱日期',
width: 200
}, {
sortable: true,
dataIndex: 'LOADFACTORY',
header: '装货工厂',
width: 200
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运港',
width: 200
}, {
sortable: true,
dataIndex: 'DESTPORT',
header: '目的港',
width: 100
}, {
sortable: true,
dataIndex: 'DEST_CNT_TIME',
header: '目的港提箱日期',
width: 200
}, {
sortable: true,
dataIndex: 'DEST_RTCNT_TIME',
header: '目的港还箱日期',
width: 200
}, {
sortable: true,
dataIndex: 'DESTPORT_STATOIN',
header: '目的港场站',
width: 200
}, {
sortable: true,
dataIndex: 'DETAIN_CTN_DAYS',
header: '滞箱天数',
width: 200
}, {
sortable: true,
dataIndex: 'PRE_CNT_TIME',
header: '预计提箱日期',
width: 200,
renderer: function (value, meta, record) {
if (record.data.DEST_CNT_TIME==''&&value != '') {
var ENDATE = new Date(value);
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d');
mydatestr = getNewDay(mydatestr, 1);
mydatestr = new Date(mydatestr);
if (mydatestr.getTime() > ENDATE.getTime()) {
meta.tdCls = 'feestatus_nopass';
}
}
return value;
}
}, {
sortable: true,
dataIndex: 'CLEARNTIME',
header: '清洗日期',
width: 100
}, {
sortable: true,
dataIndex: 'IS_RETURE_EMPTY',
header: '是否返空',
width: 100
}, {
sortable: true,
dataIndex: 'ISRETURNDOMESTIC',
header: '空返国内',
width: 100
}, {
sortable: true,
dataIndex: 'ISSHORTRENTCTN',
header: '短租箱',
width: 100
}, {
sortable: true,
dataIndex: 'TRANSTYPE',
header: '运输类型',
width: 100
}, {
sortable: true,
dataIndex: 'IS_POD_CLEAN',
header: '否目的港清洗',
width: 100
}, {
sortable: true,
dataIndex: 'IS_BOOKING',
header: '是否订舱',
width: 200
}, {
sortable: true,
dataIndex: 'I_CUSTNO',
header: '空返委托编号',
width: 100
}, {
sortable: true,
dataIndex: 'I_MBLNO',
header: '空返提单号',
width: 120
}, {
sortable: true,
dataIndex: 'I_CARRIER',
header: '空返船公司',
width: 100
}, {
sortable: true,
dataIndex: 'I_CONTRACT',
header: '运费约价',
width: 100
}, {
sortable: true,
dataIndex: 'I_PORTLOAD_CNT_TIME',
header: '空返起运港提箱日期',
width: 100
}, {
sortable: true,
dataIndex: 'I_PORTLOAD',
header: '空返起运港',
width: 100
}, {
sortable: true,
dataIndex: 'I_ETD',
header: '空返开船日期',
width: 100
}, {
sortable: true,
dataIndex: 'I_DESTPORT',
header: '空返目的港',
width: 100
}, {
sortable: true,
dataIndex: 'I_ETA',
header: '空返到港日期',
width: 100
}, {
sortable: true,
dataIndex: 'I_DESTPORT_STATOIN',
header: '空返目的港场站',
width: 100
}, {
sortable: true,
dataIndex: 'I_DEST_CNT_TIME',
header: '空返目的港提箱日期',
width: 100
}, {
sortable: true,
dataIndex: 'I_DEST_RTCNT_TIME',
header: '空返目的港还箱日期',
width: 100
}, {
sortable: true,
dataIndex: 'I_CLEARNTIME',
header: '空返清洗日期',
width: 100
}, {
sortable: true,
dataIndex: 'I_PREETD',
header: '空返预计开船日期',
width: 100
}, {
sortable: true,
dataIndex: 'PREI_ETA',
header: '空返预抵日期',
width: 100
}, {
sortable: true,
dataIndex: 'PORTLOAD_FREE_DAYS',
header: '起运港免箱使天数',
width: 100
}, {
sortable: true,
dataIndex: 'PORTLOAD_OVER_DAYS',
header: '起运港超期天数',
width: 100
}, {
sortable: true,
dataIndex: 'PORTLOAD_OVER_DAYS_FEE',
header: '起运港箱使费/天',
width: 100
}, {
sortable: true,
dataIndex: 'PORTLOAD_OVER_DAYS_AMT',
header: '起运港箱使费',
width: 100
}, {
sortable: true,
dataIndex: 'DESTPORT_FREE_DAYS',
header: '目的港免箱使天数',
width: 100
}, {
sortable: true,
dataIndex: 'DESTPORT_OVER_DAYS',
header: '目的港超期天数',
width: 100
}, {
sortable: true,
dataIndex: 'DESTPORT_OVER_DAYS_FEE',
header: '目的港箱使费/天',
width: 100
}, {
sortable: true,
dataIndex: 'DESTPORT_OVER_DAYS_AMT',
header: '目的港箱使费',
width: 100
}, {
sortable: true,
dataIndex: 'MDGXSFSTATUS',
header: '目的港箱使费生成状态',
width: 140,
renderer: function (value, meta, record) {
var acolor = '#000000';
if (record.data.MDGXSFSTATUS === '') {
acolor = '#000000';
} else if (value === '已生成,已引入') {
acolor = '#00bc12';
} else if (value === '已生成,未引入') {
acolor = '#B87070';
} else if (value === '已还箱,未生成') {
acolor = '#B87070';
} else if (value === '未还箱,未生成') {
acolor = '#B87070';
}else {
acolor = ' #000000';
}
returnValue = '<b style=' + '"color:' + acolor + '"' + '">' + value + '</b>';
return returnValue;
}
}, {
sortable: true,
dataIndex: 'QYGXSFSTATUS',
header: '起运港箱使费生成状态',
width: 140,
renderer: function (value, meta, record) {
var acolor = '#000000';
if (record.data.MDGXSFSTATUS === '') {
acolor = '#000000';
} else if (value === '已生成,已引入') {
acolor = '#00bc12';
} else if (value === '已生成,未引入') {
acolor = '#B87070';
} else if (value === '已开船,未生成') {
acolor = '#B87070';
} else if (value === '未开船,未生成') {
acolor = '#B87070';
} else {
acolor = ' #000000';
}
returnValue = '<b style=' + '"color:' + acolor + '"' + '">' + value + '</b>';
return returnValue;
}
}, {
sortable: true,
dataIndex: 'MDGXSFSTATUS2',
header: '目的港箱使费一致',
width: 140
}, {
sortable: true,
dataIndex: 'QYGXSFSTATUS2',
header: '起运港箱使费一致',
width: 140
}, {
sortable: true,
dataIndex: 'IMPFEESTATUS',
header: '有未引入费用',
width: 140
}, {
sortable: true,
dataIndex: 'BOOKGOODNAME',
header: '订舱品名',
width: 100
}, {
sortable: true,
dataIndex: 'CUSTOMGOODNAME',
header: '报关品名',
width: 100
}, {
sortable: true,
dataIndex: 'TRUCKNAME',
header: '车队',
width: 100
}, {
sortable: true,
dataIndex: 'INPUTBYREF',
header: '录入人',
width: 100
}, {
sortable: true,
dataIndex: 'INPUTTIME',
header: '录入时间',
width: 100
}, {
sortable: true,
dataIndex: 'SERVICE',
header: '运输条款',
width: 100
}, {
sortable: true,
dataIndex: 'NEEDBEHEATED',
header: '是否加热',
width: 80,
renderer: function (value, cellmeta) {
if (value == 'true') {
return "是";
}
}
}, {
sortable: true,
dataIndex: 'AGENTINPUTBY',
header: '代理维护人',
width: 100
}, {
sortable: true,
dataIndex: 'IS_DB',
header: '是否调拨',
width: 100
}, {
sortable: true,
dataIndex: 'D_CUSTNO',
header: '调拨委托编号',
width: 100
}, {
sortable: true,
dataIndex: 'D_MBLNO',
header: '调拨提单号',
width: 120
}, {
sortable: true,
dataIndex: 'D_CARRIER',
header: '调拨船公司',
width: 100
}, {
sortable: true,
dataIndex: 'D_PORTLOAD_CNT_TIME',
header: '调拨起运港提箱日期',
width: 100
}, {
sortable: true,
dataIndex: 'D_PORTLOAD',
header: '调拨起运港',
width: 100
}, {
sortable: true,
dataIndex: 'D_ETD',
header: '调拨开船日期',
width: 100
}, {
sortable: true,
dataIndex: 'D_DESTPORT',
header: '调拨目的港',
width: 100
}, {
sortable: true,
dataIndex: 'D_ETA',
header: '调拨到港日期',
width: 100
}, {
sortable: true,
dataIndex: 'D_DESTPORT_STATOIN',
header: '调拨目的港场站',
width: 100
}, {
sortable: true,
dataIndex: 'D_DEST_CNT_TIME',
header: '调拨目的港提箱日期',
width: 100
}, {
sortable: true,
dataIndex: 'D_DEST_RTCNT_TIME',
header: '调拨目的港还箱日期',
width: 100
}, {
sortable: true,
dataIndex: 'D_CLEARNTIME',
header: '调拨清洗日期',
width: 100
}, {
sortable: true,
dataIndex: 'TOPVALVE',
header: '顶阀',
width: 100
}, {
sortable: true,
dataIndex: 'EXSITSIPHONPIPE',
header: '虹吸管',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'EXSITPRESSUREGAUGE',
header: '压力表',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'EXSITTOPOVERFLOWBOX',
header: '顶部溢流盒盖',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'EXSITINTOOVERFLOWBOX',
header: '人孔溢流盒盖',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'EXSITBOTTONVALVEDUSTCOVER',
header: '底部阀门防尘罩',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISBSLOCK',
header: '出口信息锁定',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISSEAILOCK',
header: '进口信息锁定',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISRELOCK',
header: '返空信息锁定',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'ISDBLOCK',
header: '调拨信息锁定',
width: 100,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
}, {
sortable: true,
dataIndex: 'N_FACTRY',
header: '送货工厂',
width: 100
}, {
sortable: true,
dataIndex: 'N_FACTRYADDR',
header: '送货地址',
width: 100
}, {
sortable: true,
dataIndex: 'OILXS',
header: '燃油系数',
width: 100
}, {
sortable: true,
dataIndex: 'N_BKNO',
header: '交货单号',
width: 100
}, {
sortable: true,
dataIndex: 'N_CARRIER_TASKNO',
header: '船运-运输任务单号',
width: 100
}, {
sortable: true,
dataIndex: 'N_TRUCK_TASKNO',
header: '汽运-运输任务单号',
width: 100
}, {
sortable: true,
dataIndex: 'N_DELIVERYDATE',
header: '送货时间',
width: 100
}, {
sortable: true,
dataIndex: 'CTN_HANDINGOP',
header: '箱使费负责人',
width: 100
}, {
sortable: true,
dataIndex: 'RTOP',
header: '空返负责人',
width: 100
}
];
this.girdcolums = this.initgirdcolums;
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
viewConfig: {
enableTextSelection: true
},
selModel: this.GridCheckBoxModel,
columns: this.girdcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
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.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
if (BSCARDTYPE == '1')
DsOpenEditWin('/MvcContainer/MsOpCtnBsCard/Edit', record.data.GID);
else
DsOpenEditWin('/MvcContainer/MsOpCtnBsCard/CtnStatusEdit', record.data.GID);
}, this);
var isloadfee = true;
this.gridList.getSelectionModel().on('select', function (model, record, index) {
}, this);
// this.gridList.on({
// selectionchange: function (sm, selections) {
// if (selections.length == 0) {
// _this.formMDEdit.setVisible(false);
// }
// }
// });
//#region formSearch 查询面板
_this = this;
//客户加载_委托单位
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' }
});
//this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
//委托单位
_this = this;
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
labelwidth = 60;
this.CheckPORTLOAD_CNT_TIME = new Ext.form.Checkbox({
fieldLabel: '起运港提箱超期', //仅需审核业务
labelAlign:'right',
checked: false,
labelWidth: 130,
enableKeyEvents: true
});
this.CheckETD = new Ext.form.Checkbox({
fieldLabel: '开船日期超期', //仅需审核业务
labelAlign: 'right',
checked: false,
labelWidth: 130,
enableKeyEvents: true
});
this.CheckETA= new Ext.form.Checkbox({
fieldLabel: '到港日期超期', //仅需审核业务
labelAlign: 'right',
checked: false,
labelWidth: 130,
enableKeyEvents: true
});
this.CheckDEST_RTCNT_TIME = new Ext.form.Checkbox({
fieldLabel: '目的港还箱日期超期', //仅需审核业务
labelAlign: 'right',
checked: false,
labelWidth: 150,
enableKeyEvents: true
});
this.CheckInsurance = new Ext.form.Checkbox({
fieldLabel: '有保险费未生成保险信息', //仅需审核业务
labelAlign: 'right',
checked: false,
labelWidth: 150,
enableKeyEvents: true
});
this.CheckPORTLOAD_CNT_TIME.addListener('change', function (field, newValue, oldValue, eOpts) {
_this.onRefreshClick();
}, this);
this.CheckETD.addListener('change', function (field, newValue, oldValue, eOpts) {
_this.onRefreshClick();
}, this);
this.CheckETA.addListener('change', function (field, newValue, oldValue, eOpts) {
_this.onRefreshClick();
}, this);
this.CheckDEST_RTCNT_TIME.addListener('change', function (field, newValue, oldValue, eOpts) {
_this.onRefreshClick();
}, this);
this.CheckInsurance.addListener('change', function (field, newValue, oldValue, eOpts) {
_this.onRefreshClick();
}, this);
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
autoLoad: true,
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.storeCodeDisport3 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
autoLoad: true,
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportListRm' }
});
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '目的港',
store: this.storeCodeDisport,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'DESTPORT',
valueField: 'PORT',
displayField: 'PORT',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '起运港',
store: this.storeCodeDisport3,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'PORT',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeAGENT = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListAgent' }
});
//this.storeAGENT.load({ params: { condition: "ISAGENT='1'"} });
this.comboxAgent = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '目的港代理',
labelWidth: 90,
store: this.storeAGENT,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'AGENTNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeListGood = Ext.create('Ext.data.Store', {
model: 'MsCodeMSDS',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsCodeMSDS/GetDataListRm',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//this.storeListGood.load({ params: { start: 0, limit: 20000, condition: ""} });
this.comboxGoods = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeListGood,
fieldLabel: '品名',
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
// forceSelection: true,
name: 'GOODSNAME',
valueField: 'CHEMICALCGOODSNAME',
displayField: 'GOODNAMEANDCNAME',
enableKeyEvents: true,
listeners: {
specialkey: 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: 60,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '箱号',
labelWidth: labelwidth,
name: 'CTNNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '编号',
labelWidth: labelwidth,
name: 'BSNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCustCode, {
fieldLabel: '开船日期',
labelWidth: labelwidth,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDbgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
labelWidth: labelwidth,
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDend',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '目的港超期天数',
labelWidth: 120,
name: 'DESTPORT_OVER_DAYS',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},this.comboxPORTLOAD, this.comboxPORTDISCHARGE, this.comboxAgent, this.comboxGoods , {
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
}]
}
]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}, {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
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
}
]
});
this.storeSumList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsCqData',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpCtnBsCard/GetCqDataList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.girdcolumsSum = [{
sortable: true,
dataIndex: 'BLCOUNT',
header:'票数', //'TEU',
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLDESTPORT_OVER_DAYS',
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: 160
}, {
sortable: true,
dataIndex: 'DESTPORT_OVER_DAYS',
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: 160
}, {
sortable: true,
dataIndex: 'TTLDESTPORT_OVER_DAYS_AMT',
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: 160
}, {
sortable: true,
dataIndex: 'DESTPORT_OVER_DAYS_AMT',
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: 160
}
];
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: 120,
region: 'south',
margin: '0 0',
frame: true,
items: [this.gridListSum]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 105,
items: [this.formSearch, this.panelBtn]
});
this.panelCenter = new Ext.Panel({
layout: "border",
region: "center",
items: [this.gridList, this.panelSum]
});
Ext.apply(this, {
items: [this.panelTop, this.panelCenter]
});
this.sqlcontext = '';
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
}, this);
//if (!isNullorEmpty(this.worksql)) {
// this.worksql = this.worksql.replace(/@@/g, '=')
// this.sqlcontext = this.worksql;
// this.onDsQuery();
//} else {
// if (!this.isotheropen())
// this.onRefreshClick();
//}
me = this;
}, //end initUIComponents
InitGrid: function (grid) {
var agirdcolums = grid;
this.gridList.reconfigure(this.storeList, agirdcolums);
},
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.dosearch(sql);
},
dosearch: function (sql) {
this.PageSize = this.Pagenum.getValue();
this.sqlcontext = sql;
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
callback: function (r, options, success) {
if (success) {
}
},
scope: this
});
this.storeSumList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
callback: function (r, options, success) {
if (success) {
}
},
scope: this
});
},
onDsQuery: function () {
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: "正在查询数据...",
callback: function (r, options, success) {
if (success) {
}
},
scope: this
});
this.storeSumList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
callback: function (r, options, success) {
if (success) {
}
},
scope: this
});
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
var BSNO = form.findField('BSNO').getValue();
sql = sql + getAndConSql(sql, BSNO, " ((ISNULL(BSNO,'')+' '+ISNULL(CUSTNO,'')+' '+ISNULL(I_CUSTNO,'')+' '+ISNULL(MBLNO,'')+' '+ISNULL(I_MBLNO,'') like '%" + BSNO + "%')) ");
// sql = sql + getAndConSql(sql, BSNO, " (BSNO like '%" + BSNO + "%' ) ");
var CTNNO = form.findField('CTNNO').getValue();
var i = CTNNO.indexOf(",");
if (i > 0) {
var slist = CTNNO.split(",");
var feeGidSql = '';
for (var i = 0; i < slist.length; i += 1) {
var feeGId = "'" + slist[i] + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
}
// sql = " B.CTNNO in (" + feeGidSql + ") ";
sql = sql + " ( B.CTNGID IN (select GID from code_ctntk where CTNNO IN (" + feeGidSql + ") OR PCTNNO IN (" + feeGidSql + ") OR (GID IN (SELECT LINKGID FROM Code_CtnTkBefore WHERE CTNNO IN (" + feeGidSql + ")))) ) ";
} else
sql = sql + getAndConSql(sql, CTNNO, " (B.CTNNO like '%" + CTNNO + "%' or B.CTNGID IN (select PCTNNO from code_ctntk where CTNNO like '%" + CTNNO + "%' or PCTNNO like '%" + CTNNO + "%' OR GID IN (SELECT LINKGID FROM Code_CtnTkBefore WHERE CTNNO LIKE '%" + CTNNO + "%')) ) ");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
var expDateBgn = form.findField('ETDbgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "ETD>='" + expDateBgn + "'");
var expDateEnd = form.findField('ETDend').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "ETD<='" + expDateEnd + " 23:59:59'");
var GOODSNAME = form.findField('GOODSNAME').getValue();
sql = sql + getAndConSql(sql, GOODSNAME, "GOODSNAME='" + GOODSNAME + "'");
var PORTLOAD = form.findField('PORTLOAD').getValue();
sql = sql + getAndConSql(sql, PORTLOAD, "PORTLOAD='" + PORTLOAD + "'");
var DESTPORT = form.findField('DESTPORT').getValue();
sql = sql + getAndConSql(sql, DESTPORT, "DESTPORT='" + DESTPORT + "'");
var AGENTNAME = form.findField('AGENTNAME').getValue();
sql = sql + getAndConSql(sql, AGENTNAME, "AGENTNAME='" + AGENTNAME + "'");
var DESTPORT_OVER_DAYS = form.findField('DESTPORT_OVER_DAYS').getValue();
sql = sql + getAndConSql(sql, DESTPORT_OVER_DAYS, "DESTPORT_OVER_DAYS>=" + DESTPORT_OVER_DAYS + "");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.storePLList;
return ret;
},
Print: 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/MsOpCtnBsCard/GetDataListStr',
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 = 'MSOPCTNBSCARD';
var sql1 = returnstr;
var sql2 = "Select GID 编号";
sql2 = sql2 + ",BSNO 业务编号 , CTNNO 箱号, CUR_PORT 当期位置, GOODSNAME 货物名称 ";
sql2 = sql2 + " , MBLNO 主提单号, CUSTNO 委托编号, CUSTOMERNAME 委托单位, PORTLOAD_STATOIN 起运港场站, GOODSNAME 货物名称";
sql2 = sql2 + " ,PORTLOAD_CNT_TIME 提箱日期 ,PRE_CNT_TIME 预计提箱日期, LOADFACTORY 装货工厂";
sql2 = sql2 + ", PORTLOAD 起运港, ETD 开船日期 ,DESTPORT 目的港 , ETA 到港日期 ,PREETA 预抵日期, AGENTNAME 目的港代理";
sql2 = sql2 + " , DEST_CNT_TIME 目的港提箱日期 ,DEST_RTCNT_TIME 目的港还箱日期 ,DESTPORT_STATOIN 目的港堆存场站 ";
sql2 = sql2 + " , DESTPORT_FREE_DAYS 免费箱使天数, DESTPORT_OVER_DAYS 超期天数,DESTPORT_OVER_DAYS_FEE 箱使费天, DESTPORT_OVER_DAYS_AMT 超期箱使费 ,DETAIN_CTN_DAYS 滞箱天数 ";
sql2 = sql2 + " ,I_MBLNO 进口主提单号, I_CUSTNO 进口委托编号,I_PORTLOAD 进口堆存场站 ";
sql2 = sql2 + " ,I_PORTLOAD_CNT_TIME 进口提箱日期 ";
sql2 = sql2 + " ,I_PORTLOAD 进口起运港 ,I_ETD 进口开船日期 ,i_DESTPORT 进口目的港, I_ETA 进口到港日期 ";
sql2 = sql2 + " , I_DEST_CNT_TIME 进口目的港提箱日期 ,I_DEST_RTCNT_TIME 进口目的港还箱日期 ,I_DESTPORT_STATOIN 进口目的港堆存场站 ";
sql2 = sql2 + " from op_ctnbscard where GID='" + bsno + "'";
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 = 'CTNNO';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GID') + "'";
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.GID;
}
var printType = 'MSOPCTNBSCARDSELECT';
var sql1 = "Select op_ctnbscard.GID 编号";
sql1 = sql1 + ",BSNO 业务编号 , CTNNO 箱号, CUR_PORT 当期位置, GOODSNAME 货物名称 ";
sql1 = sql1 + " , MBLNO 主提单号, CUSTNO 委托编号, CUSTOMERNAME 委托单位, PORTLOAD_STATOIN 起运港场站, GOODSNAME 货物名称";
sql1 = sql1 + " ,PORTLOAD_CNT_TIME 提箱日期,PRE_CNT_TIME 预计提箱日期 , LOADFACTORY 装货工厂";
sql1 = sql1 + ", PORTLOAD 起运港, ETD 开船日期 ,DESTPORT 目的港 , ETA 到港日期 ,PREETA 预抵日期, AGENTNAME 目的港代理";
sql1 = sql1 + " , DEST_CNT_TIME 目的港提箱日期 ,DEST_RTCNT_TIME 目的港还箱日期 ,DESTPORT_STATOIN 目的港堆存场站 ";
sql1 = sql1 + " , DESTPORT_FREE_DAYS 免费箱使天数, DESTPORT_OVER_DAYS 超期天数,DESTPORT_OVER_DAYS_FEE 箱使费天, DESTPORT_OVER_DAYS_AMT 超期箱使费 ,DETAIN_CTN_DAYS 滞箱天数,TRUCKNAME 车队,TRUCKLINKNAME 车队联系人 ";
sql1 = sql1 + " ,I_MBLNO 进口主提单号, I_CUSTNO 进口委托编号,I_PORTLOAD 进口堆存场站 ";
sql1 = sql1 + " ,I_PORTLOAD_CNT_TIME 进口提箱日期 ";
sql1 = sql1 + " ,I_PORTLOAD 进口起运港 ,I_ETD 进口开船日期,i_DESTPORT 进口目的港,I_ETA 进口到港日期 ";
sql1 = sql1 + " , I_DEST_CNT_TIME 进口目的港提箱日期 ,I_DEST_RTCNT_TIME 进口目的港还箱日期 ,I_DESTPORT_STATOIN 进口目的港堆存场站 ";
sql1 = sql1 + " , ClientSTATOIN.Tel 场站电话 ,ClientSTATOIN.CHIEF 场站联系人,ClientSTATOIN.ADDR 场站地址 ";
sql1 = sql1 + " from op_ctnbscard "
sql1 = sql1 + " Left join info_client ClientSTATOIN on ClientSTATOIN.SHORTNAME=op_ctnbscard.PORTLOAD_STATOIN ";
sql1 = sql1 + "WHERE op_ctnbscard.GID IN (" + feeGidSql + ") order by CTNNO ";
var sql2 = "select * from op_ctnbscard where GID='" + bsno + "'";
var sql3 = "SELECT [CTNNO] 罐号,[CTNPROP] 箱属,[NAMEPLATE] 铭牌信息 ,[OWNERCTN] 罐东 ,[MADEDATE] 制造年限";
sql3 = sql3 + ",(select ShowName from [user] where GID=code_ctntk.INPUTBY) as 录入人";
sql3 = sql3 + ",(select TOP 1 GOODSNAME FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO";
sql3 = sql3 + " ORDER BY PORTLOAD_CNT_TIME DESC) as 所装货";
// sql3 = sql3 + ",(select TOP 1 CUR_PORT FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO ";
// sql3 = sql3 + " ORDER BY PORTLOAD_CNT_TIME DESC) as 当前位置";
sql3 = sql3 + ",(select TOP 1 当前位置 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 当前日期 DESC) as 当前位置 ";
sql3 = sql3 + ",(select TOP 1 当前日期 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 当前日期 DESC) as 当前日期 ";
sql3 = sql3 + ",(select TOP 1 下一日期 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 下一日期 DESC) as 下一日期 ";
sql3 = sql3 + ",(select TOP 1 前装货 FROM v_tk_preGoodsName WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " order by PORTLOAD_CNT_TIME desc ) as 前装货 ";
sql3 = sql3 + ",(select TOP 1 DEST_RTCNT_TIME FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " order by DEST_RTCNT_TIME desc ) as 最后还箱日期 ";
sql3 = sql3 + " from code_ctntk";
sql3 = sql3 + " where (ISSTOPUSE=0 OR ISSTOPUSE IS NULL) AND CTNPROP in ('租赁箱','自有箱')";
sql3 = sql3 + " ORDER BY CTNNO ";
var sql4 = "Select op_ctnbscard.GID 编号";
sql4 = sql4 + ", op_ctnbscard.CTNNO 箱号,[dbo].F_GetRepairItems(op_ctnbscard.GID) 改装列表";
sql4 = sql4 + " from op_ctnbscard ";
sql4 = sql4 + "WHERE op_ctnbscard.GID IN (" + feeGidSql + ") order by op_ctnbscard.CTNNO ";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
},
PrintSelectPutCtn: 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 = 'CTNNO';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
if (record.get('PUTCTNAUDITSTATUS') == '审核通过' || record.get('PUTCTNAUDITSTATUS') == '已发送' || record.get('PUTCTNAUDITSTATUS') == '已发送邮件') {
var feeGId = "'" + record.get('GID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
}
};
if (feeGidSql == '') {
Ext.Msg.show({ title: '提示', msg: '必须审核后才可以打印,没有要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var printType = 'MSOPCTNBSCARDSELECTPUTCTN';
var sql1 = "Select op_ctnbscard.GID 编号";
sql1 = sql1 + ",BSNO 业务编号 , CTNNO 箱号, CUR_PORT 当期位置, GOODSNAME 货物名称 ";
sql1 = sql1 + " , MBLNO 主提单号, CUSTNO 委托编号, CUSTOMERNAME 委托单位, PORTLOAD_STATOIN 起运港场站, GOODSNAME 货物名称";
sql1 = sql1 + " ,PORTLOAD_CNT_TIME 提箱日期,PRE_CNT_TIME 预计提箱日期 , LOADFACTORY 装货工厂";
sql1 = sql1 + ", PORTLOAD 起运港, ETD 开船日期 ,DESTPORT 目的港 , ETA 到港日期 , AGENTNAME 目的港代理";
sql1 = sql1 + " , DEST_CNT_TIME 目的港提箱日期 ,DEST_RTCNT_TIME 目的港还箱日期 ,DESTPORT_STATOIN 目的港堆存场站 ";
sql1 = sql1 + " , DESTPORT_FREE_DAYS 免费箱使天数, DESTPORT_OVER_DAYS 超期天数,DESTPORT_OVER_DAYS_FEE 箱使费天, DESTPORT_OVER_DAYS_AMT 超期箱使费 ,DETAIN_CTN_DAYS 滞箱天数,TRUCKNAME 车队,TRUCKLINKNAME 车队联系人 ";
sql1 = sql1 + " ,I_MBLNO 进口主提单号, I_CUSTNO 进口委托编号,I_PORTLOAD 进口堆存场站 ";
sql1 = sql1 + " ,I_PORTLOAD_CNT_TIME 进口提箱日期 ";
sql1 = sql1 + " ,I_PORTLOAD 进口起运港 ,I_ETD 进口开船日期,i_DESTPORT 进口目的港,I_ETA 进口到港日期 ";
sql1 = sql1 + " , I_DEST_CNT_TIME 进口目的港提箱日期 ,I_DEST_RTCNT_TIME 进口目的港还箱日期 ,I_DESTPORT_STATOIN 进口目的港堆存场站 ";
sql1 = sql1 + " , ClientSTATOIN.Tel 场站电话 ,ClientSTATOIN.CHIEF 场站联系人,ClientSTATOIN.ADDR 场站地址 ";
sql1 = sql1 + " from op_ctnbscard "
sql1 = sql1 + " Left join info_client ClientSTATOIN on ClientSTATOIN.SHORTNAME=op_ctnbscard.PORTLOAD_STATOIN ";
sql1 = sql1 + " Left join op_ctnrepair on op_ctnrepair.LINKGID=op_ctnbscard.GID ";
sql1 = sql1 + "WHERE op_ctnbscard.GID IN (" + feeGidSql + ") order by CTNNO ";
var sql2 = "select * from op_ctnbscard where GID='" + bsno + "'";
var sql3 = "SELECT [CTNNO] 罐号,[CTNPROP] 箱属,[NAMEPLATE] 铭牌信息 ,[OWNERCTN] 罐东 ,[MADEDATE] 制造年限";
sql3 = sql3 + ",(select ShowName from [user] where GID=code_ctntk.INPUTBY) as 录入人";
sql3 = sql3 + ",(select TOP 1 GOODSNAME FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO";
sql3 = sql3 + " ORDER BY PORTLOAD_CNT_TIME DESC) as 所装货";
// sql3 = sql3 + ",(select TOP 1 CUR_PORT FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO ";
// sql3 = sql3 + " ORDER BY PORTLOAD_CNT_TIME DESC) as 当前位置";
sql3 = sql3 + ",(select TOP 1 当前位置 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 当前日期 DESC) as 当前位置 ";
sql3 = sql3 + ",(select TOP 1 当前日期 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 当前日期 DESC) as 当前日期 ";
sql3 = sql3 + ",(select TOP 1 下一日期 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 下一日期 DESC) as 下一日期 ";
sql3 = sql3 + ",(select TOP 1 前装货 FROM v_tk_preGoodsName WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " order by PORTLOAD_CNT_TIME desc ) as 前装货 ";
sql3 = sql3 + ",(select TOP 1 DEST_RTCNT_TIME FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " order by DEST_RTCNT_TIME desc ) as 最后还箱日期 ";
sql3 = sql3 + " from code_ctntk";
sql3 = sql3 + " where (ISSTOPUSE=0 OR ISSTOPUSE IS NULL) AND CTNPROP in ('租赁箱','自有箱')";
sql3 = sql3 + " ORDER BY CTNNO ";
var sql4 = "Select op_ctnbscard.GID 编号";
sql4 = sql4 + ", op_ctnbscard.CTNNO 箱号,[dbo].F_GetRepairItems(op_ctnbscard.GID) 改装列表";
sql4 = sql4 + " from op_ctnbscard ";
sql4 = sql4 + "WHERE op_ctnbscard.GID IN (" + feeGidSql + ") order by op_ctnbscard.CTNNO ";
var sql5 = "";
var sql6 = "";
Ext.Msg.wait('正在整理数据...');
Ext.Ajax.request({
waitMsg: '正在生成...', //'正在生成...',
url: '/MvcContainer/MsOpCtnBsCard/CreateSendMail',
params: {
bsno: feeGidSql,
bltype: '提箱单'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6,'', '', '', result.Data,'');
} else {
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
PrintViewSelectPutCtn: function (BSNO) {
_this = this;
var printType = 'MSOPCTNBSCARDSELECTPUTCTN';
var sql1 = "Select op_ctnbscard.GID 编号";
sql1 = sql1 + ",BSNO 业务编号 , CTNNO 箱号, CUR_PORT 当期位置, GOODSNAME 货物名称 ";
sql1 = sql1 + " , MBLNO 主提单号, CUSTNO 委托编号, CUSTOMERNAME 委托单位, PORTLOAD_STATOIN 起运港场站, GOODSNAME 货物名称";
sql1 = sql1 + " ,PORTLOAD_CNT_TIME 提箱日期,PRE_CNT_TIME 预计提箱日期 , LOADFACTORY 装货工厂";
sql1 = sql1 + ", PORTLOAD 起运港, ETD 开船日期 ,DESTPORT 目的港 , ETA 到港日期 , AGENTNAME 目的港代理";
sql1 = sql1 + " , DEST_CNT_TIME 目的港提箱日期 ,DEST_RTCNT_TIME 目的港还箱日期 ,DESTPORT_STATOIN 目的港堆存场站 ";
sql1 = sql1 + " , DESTPORT_FREE_DAYS 免费箱使天数, DESTPORT_OVER_DAYS 超期天数,DESTPORT_OVER_DAYS_FEE 箱使费天, DESTPORT_OVER_DAYS_AMT 超期箱使费 ,DETAIN_CTN_DAYS 滞箱天数,TRUCKNAME 车队,TRUCKLINKNAME 车队联系人 ";
sql1 = sql1 + " ,I_MBLNO 进口主提单号, I_CUSTNO 进口委托编号,I_PORTLOAD 进口堆存场站 ";
sql1 = sql1 + " ,I_PORTLOAD_CNT_TIME 进口提箱日期 ";
sql1 = sql1 + " ,I_PORTLOAD 进口起运港 ,I_ETD 进口开船日期,i_DESTPORT 进口目的港,I_ETA 进口到港日期 ";
sql1 = sql1 + " , I_DEST_CNT_TIME 进口目的港提箱日期 ,I_DEST_RTCNT_TIME 进口目的港还箱日期 ,I_DESTPORT_STATOIN 进口目的港堆存场站 ";
sql1 = sql1 + " , ClientSTATOIN.Tel 场站电话 ,ClientSTATOIN.CHIEF 场站联系人,ClientSTATOIN.ADDR 场站地址 ";
sql1 = sql1 + " from op_ctnbscard "
sql1 = sql1 + " Left join info_client ClientSTATOIN on ClientSTATOIN.SHORTNAME=op_ctnbscard.PORTLOAD_STATOIN ";
sql1 = sql1 + " Left join op_ctnrepair on op_ctnrepair.LINKGID=op_ctnbscard.GID ";
sql1 = sql1 + "WHERE op_ctnbscard.GID='" + BSNO + "' order by CTNNO ";
var sql2 = "select * from op_ctnbscard where GID='" + BSNO + "'";
var sql3 = "SELECT [CTNNO] 罐号,[CTNPROP] 箱属,[NAMEPLATE] 铭牌信息 ,[OWNERCTN] 罐东 ,[MADEDATE] 制造年限";
sql3 = sql3 + ",(select ShowName from [user] where GID=code_ctntk.INPUTBY) as 录入人";
sql3 = sql3 + ",(select TOP 1 GOODSNAME FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO";
sql3 = sql3 + " ORDER BY PORTLOAD_CNT_TIME DESC) as 所装货";
// sql3 = sql3 + ",(select TOP 1 CUR_PORT FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO ";
// sql3 = sql3 + " ORDER BY PORTLOAD_CNT_TIME DESC) as 当前位置";
sql3 = sql3 + ",(select TOP 1 当前位置 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 当前日期 DESC) as 当前位置 ";
sql3 = sql3 + ",(select TOP 1 当前日期 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 当前日期 DESC) as 当前日期 ";
sql3 = sql3 + ",(select TOP 1 下一日期 FROM v_tk_cutdate WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " ORDER BY 下一日期 DESC) as 下一日期 ";
sql3 = sql3 + ",(select TOP 1 前装货 FROM v_tk_preGoodsName WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " order by PORTLOAD_CNT_TIME desc ) as 前装货 ";
sql3 = sql3 + ",(select TOP 1 DEST_RTCNT_TIME FROM op_ctnbscard WHERE CTNNO=code_ctntk.CTNNO ";
sql3 = sql3 + " order by DEST_RTCNT_TIME desc ) as 最后还箱日期 ";
sql3 = sql3 + " from code_ctntk";
sql3 = sql3 + " where (ISSTOPUSE=0 OR ISSTOPUSE IS NULL) AND CTNPROP in ('租赁箱','自有箱')";
sql3 = sql3 + " ORDER BY CTNNO ";
var sql4 = "Select op_ctnbscard.GID 编号";
sql4 = sql4 + ", op_ctnbscard.CTNNO 箱号,[dbo].F_GetRepairItems(op_ctnbscard.GID) 改装列表";
sql4 = sql4 + " from op_ctnbscard ";
sql4 = sql4 + "WHERE op_ctnbscard.GID='" + BSNO + "' order by op_ctnbscard.CTNNO ";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, '', 'MSCHFEAUDITSEL', 1);
},
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/MsOpCtnBsCard/GetDataListStr',
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 = 'MSOPCTNBSCARD';
var sql1 = returnstr;
sql1 = sql1.replace(/\+/g, "@@@")
sql1 = sql1.replace(/\>/g, "&&&")
sql1 = sql1.replace(/\</g, "%%%")
if (sql1 != '') {
GridExportBySql(sql1, this.formname, '业务卡列表.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
});
}
}
});
},
UploadFile: function (uploadFileType, title) {
if (this.storeList.getCount() == 0) {
return;
}
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 = 'CTNNO';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
var record = selectedRecords[0];
var feeGId = record.get('GID');
//var feeGidSql = '';
//for (var i = 0; i < selectedRecords.length; i++) {
// var record = selectedRecords[i];
// var feeGId = "'" + record.get('GID') + "'";
// if (feeGidSql == '') {
// feeGidSql = feeGId;
// } else {
// feeGidSql = feeGidSql + "," + feeGId;
// }
//};
//if (feeGidSql == '') {
// Ext.Msg.show({ title: '提示', msg: '没有选择要上传文件的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
var winUpload = Ext.create('Ext.window.Window', {
layout: 'fit',
title: '上传' + title,
width: 600,
height: 500,
modal: true,
plain: true,
autoScroll: true,
bodyStyle: "padding:5px 0 0 5px",
items: {
xtype: "panel",
layout: 'fit',
border: false,
frame: false,
autoScroll: true,
html: "<iframe scrolling='yes'width='100%' height='100%' frameborder='0' src='../../MvcContainer/MsOpCtnBsCard/UploadFile'></iframe>"
},
buttonAlign: "center",
buttons: [{
text: "关 闭",
handler: function () {
winUpload.close();
}
}]
});
PuploadFileType = uploadFileType;
SelectBsSql = feeGId;
winFXTZModifyShow = _this.winFXTZModifyShow;
extParentWinFrame = winUpload;
winUpload.show();
},
isotheropen: function () {
if (isNullorEmpty(this.opener())) return false;
return true;
}
, opener: function () {
return this.openertype;
}
});