You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/MvcShipping/Viewsjs/MsOp_InternalTrade/MsOp_InternalTradeIndex.js

1648 lines
56 KiB
JavaScript

3 years ago
//押箱管理
Ext.namespace('Shipping');
Shipping.MsOp_InternalTradeIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOp_InternalTradeIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOp_InternalTradeIndex, Ext.Panel, {
PageSize: 50,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
pageSize: 50,
ChangeListData:null,
initUIComponents: function () {
this.formname = "MsOp_InternalTradeIndex";
this.sqlcontext = '';
/////////////////////////////////////////
//#region 主列表
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOp_InternalTrademb',
remoteSort: false,
proxy: {
type: 'ajax',
//url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL',
url: '/MvcShipping/MsOp_InternalTrade/GetDataList',
//this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL';
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.column = [
{
sortable: true, hidden: true,
dataIndex: 'BSNO',
header: 'BSNO',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'MASTERNO',
header: 'MASTERNO',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'num',
header: '',
width: 30
},
{
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 80
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 80
},
{
sortable: true,
dataIndex: 'BSSTATUS',
header: '业务状态',
width: 80,
renderer: function (value, cellmeta) {
if (isTrue(value)) {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
} else return ""
}
},
{
sortable: true,
dataIndex: 'FEESTATUS',
header: '费用状态',
width: 80,
renderer: function (value, cellmeta) {
if (isTrue(value)) {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
} else return ""
}
},
{
sortable: true,
dataIndex: 'CONTAINERDAYS',
header: '用箱天数',
width: 80
},
{
sortable: true,
dataIndex: 'BSDATE',
header: '录入时间',
width: 80
},
{
sortable: true,
dataIndex: 'CREATOR',
header: '录入人',
width: 80
},
{
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'HBLNO',
header: 'HBLNO',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'STLCODE',
header: 'STLCODE',
width: 80
},
{
sortable: true,
dataIndex: 'STLNAME',
header: '结算方式',
width: 80
},
{
sortable: true,
dataIndex: 'STLDATE',
header: '结算日期',
width: 80
},
{
sortable: true,
dataIndex: 'BSSOURCE',
header: '业务来源',
width: 80
},
{
sortable: true,
dataIndex: 'BSSOURCEDETAIL',
header: '贸易条款',
3 years ago
width: 80
},
{
sortable: true,
dataIndex: 'TRANSNO',
header: '发货编号',
width: 80
},
{
sortable: true,
dataIndex: 'OPREF',
header: '操作',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTSERVICEREF',
header: '客服',
width: 80
},
{
sortable: true,
dataIndex: 'SALEREF',
header: '销售',
width: 80
},
{
sortable: true,hidden:true,
dataIndex: 'OP',
header: 'OP',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CUSTSERVICE',
header: 'CUSTSERVICE',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'SALE',
header: 'SALE',
width: 80
},
{
sortable: true,
dataIndex: 'OPERATOR',
header: '客户联系人',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CORPID',
header: 'CORPID',
width: 80
},
{
sortable: true,
dataIndex: 'SALEDEPT',
header: '所属部门',
width: 80
},
{
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 80
},
{
sortable: true,
dataIndex: 'VESSEL',
header: '船名',
width: 80
},
{
sortable: true,
dataIndex: 'VOYNO',
header: '航次',
width: 80
},
{
sortable: true,
dataIndex: 'PORTLOADID',
header: '起运港',
width: 80
},
{
sortable: true,hidden:true,
dataIndex: 'PORTLOAD',
header: '起运港名称',
width: 80
},
{
sortable: true,
dataIndex: 'ETD',
header: '开船日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'YARD',
header: '场站',
width: 80
},
{
sortable: true,
dataIndex: 'LOADEDCTNRETURNDATE',
header: '重箱回场时间',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'EMPTYCTNTOSHIPPERDATE',
header: '提箱日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKER',
header: '车队名称',
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKNO',
header: '车牌号',
width: 80
},
{
sortable: true,
dataIndex: 'CNTRNO',
header: '箱号',
width: 80
},
{
sortable: true,
dataIndex: 'SEALNO',
header: '封号',
width: 80
},
{
sortable: true,
dataIndex: 'CTNALL',
header: '箱型',
width: 80
},
{
sortable: true,
dataIndex: 'PORTLOADSTORAGEPERIOD',
header: '起运港堆存天数',
width: 80
},
{
sortable: true,
dataIndex: 'FBPPORTLOAD',
header: '起运港免箱期',
width: 80
},
{
sortable: true,
dataIndex: 'PORTLOADREMARK',
header: '起运备注',
width: 80
},
{
sortable: true, //hidden: true,
dataIndex: 'VIAID',
header: '中转港',
width: 80
},
{
sortable: true,
dataIndex: 'VIA',
header: '中转港名称',
width: 80
},
{
sortable: true,
dataIndex: 'VIA_ETA',
header: '中转港到港日',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'VIA_VESSEL',
header: '中转港船名',
width: 80
},
{
sortable: true,
dataIndex: 'VIA_VOYNO',
header: '中转港航次',
width: 80
},
{
sortable: true,
dataIndex: 'VIA_ETD',
header: '中转港开船日',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'VIA_STORAGEPERIOD',
header: '中转港堆存天数',
width: 80
},
{
sortable: true,
dataIndex: 'VIA2ID',
header: '中转港2',
width: 80
},
{
sortable: true,hidden:true,
dataIndex: 'VIA2',
header: '中转港2名称',
width: 80
},
{
sortable: true,
dataIndex: 'VIA2_ETA',
header: '中转港2到港日',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'VIA2_VESSEL',
header: '中转港2船名',
width: 80
},
{
sortable: true,
dataIndex: 'VIA2_VOYNO',
header: '中转港2航次',
width: 80
},
{
sortable: true,
dataIndex: 'VIA2_ETD',
header: '中转港2开船日',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'VIA2_STORAGEPERIOD',
header: '中转港2堆存天数',
width: 80
},
{
sortable: true, //hidden: true,
dataIndex: 'VIA3ID',
header: '中转港3',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'VIA3',
header: '中转港3名称',
width: 80
},
{
sortable: true,
dataIndex: 'VIA3_ETA',
header: '中转港3到港日',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'VIA3_VESSEL',
header: '中转港3船名',
width: 80
},
{
sortable: true,
dataIndex: 'VIA3_VOYNO',
header: '中转港3航次',
width: 80
},
{
sortable: true,
dataIndex: 'VIA3_ETD',
header: '中转港3开船日',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'VIA3_STORAGEPERIOD',
header: '中转港3堆存天数',
width: 80
},
{
sortable: true,
dataIndex: 'VIA_MARK',
header: '中转备注',
width: 80
},
{
sortable: true,
dataIndex: 'PORTDISCHARGEID',
header: '目的港',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'PORTDISCHARGE',
header: '目的港名称',
width: 80
},
{
sortable: true,
dataIndex: 'PlACERECEIPT',
header: '收货地址',
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKER2',
header: '目的地车队',
width: 80
},
{
sortable: true,
dataIndex: 'TRUCKNO2',
header: '目的地车牌号',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEE',
header: '收货人',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEECONTACT',
header: '收货联系人',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEETEL',
header: '收货联系电话',
width: 80
},
{
sortable: true,
dataIndex: 'DISPATCHDATE',
header: '派单日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'DELIVERYDATE',
header: '提货日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'RECEIVEDATE',
header: '送货到厂时间',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'CORPREF',
header: '所属分部',
width: 80
},
{
sortable: true,
id: '',
dataIndex: 'OPSTATUS',
header: '自定义业务状态',
width: 60,
renderer: function (value, metadata, record, rowIndex) {
metadata.style = "background-color:" + record.data.COLOR;
return value;
},
filter: true
},
{
sortable: true,
id: '',
dataIndex: 'DRFEESTATUS',
header: '应收费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
return Shipping.SetFeeGrid(meta, value);
}
},
{
sortable: true,
id: '',
dataIndex: 'CRFEESTATUS',
header: '应付费用',
align: 'center',
width: 60,
renderer: function (value, meta) {
return Shipping.SetFeeGrid(meta, value);
}
},
{
sortable: true,
id: '',
dataIndex: 'DRINVSTATUS',
header: '应收开票', //'应收开票',
align: 'center',
// xtype: 'actioncolumn',
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;
},
// getClass: function(v, meta, rec) { // Or return a class from a function
// if (rec.get('DRINVSTATUS')=='已开票'||rec.get('DRINVSTATUS')=='部分开票') {
// return 'btnedit';
// } else {
// return '';
// }
// },
// handler: function(grid, rowIndex, colIndex) {
// var rec = grid.getStore().getAt(rowIndex);
// var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
// var openType = "_blank";
// var openUrl = "";
// openUrl = "../../MvcShipping/MsRptChInvTotal/BsView?handle=check&bsnosql=BSNO='" + rec.data.BSNO+"'";
// window.open(openUrl, openType, openSet);
// },
filter: {
type: 'list',
options: ['已开票', '部分开票', '未开票']
}
},
{
sortable: true,hidden:true,
dataIndex: 'TIMEMARK',
header: 'TIMEMARK',
width: 80
}
];
this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 40
});
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
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.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
//selModel: this.MainCB,
columns: this.column,
plugins: [
//this.cellEditing
],
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
/*features: [{
id: 'group',
ftype: 'grouping',
groupHeaderTpl: '{name}',
hideGroupedHeader: true,
enableGroupingMenu: true
}],*/
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
//var YXSTATE = record.get('YXSTATE');
//return Shipping.GetAuditClass(BLSTATUS);
}
},
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
/////////////以下部分为获取存储的gridpanel显示样式
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column);
//使用者id表名 中间column数组
this.column.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.column);
////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
// alert('0....' + dataview.toString() + ',' + record.toString() + ',' + item.toString() + ',' + index.toString() + ',' + e.toString() + ',' + b.toString());
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/MvcShipping/MsOp_InternalTrade/Edit', record.data.CUSTNO);
}, this);
//#endregion
//////////////////////////////////////////////////////////////
//#region formSearch
//#region formSearch枚举参照相关
parentWin = window.parent.opener;
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load();
//this.storeCustCode.loadData(window.parent.GetPubStore("INFOCLIENT_ISCONTROLLER").data.items);
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
//queryMode: 'remote',
minChars: 1,
//queryParam: 'CODENAME',
matchFieldWidth: false,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司',
store: this.storeCARRIER,
//queryMode: 'remote',
//minChars: 1,
//queryParam: 'CODENAME',
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
this.storeTRUCK = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
this.storeTRUCK.load({ params: { condition: "ISTRUCK ='1'" } });
this.comboxTRUCK = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '车队',
store: this.storeTRUCK,
//queryMode: 'remote',
//minChars: 1,
//queryParam: 'CODENAME',
name: 'TRUCKER',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
this.storeYARD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
this.storeYARD.load({ params: { condition: "ISYARD ='1'" } });
this.comboxYARD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '场站',
store: this.storeYARD,
//queryMode: 'remote',
//minChars: 1,
//queryParam: 'CODENAME',
name: 'YARD',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
this.storeCONSIGNEE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
this.storeCONSIGNEE.load({ params: { condition: "ISCONSIGNEE ='1'" } });
this.comboxCONSIGNEE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '收货人',
store: this.storeCONSIGNEE,
//queryMode: 'remote',
//minChars: 1,
//queryParam: 'CODENAME',
name: 'CONSIGNEE',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
this.storeCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'companymb',
proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' }
});
this.storeCompany.load({ params: { condition: " ISDISABLE=0 " } });
this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '所属分部',
store: this.storeCompany,
//width: 80,
name: 'CORPID',
valueField: 'gid',
displayField: 'name',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
this.storeUser.load({
params: { condition: "CORPID='" + combo.value + "'", dbname: records[0].data.DBNAME }
,
callback: function (options, success, response) {
if (success) {
//....
}
}
});
}
}
}
});
this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeUser.load({ params: { condition: "" } });
//所属部门
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: Zi.LAN.SALEDEPT2, //'所属部门',
store: this.storeDept,
flex: 1,
labelWidth: 55,
forceSelection: true,
name: 'SALEDEPT',
valueField: 'DeptName',
displayField: 'DeptName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
//起运港
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList' }
});
this.storeCodeLoadport.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '起运港',
store: this.storeCodeLoadport,
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
this.comboxVIA = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '中转港',
store: this.storeCodeLoadport,
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
this.comboxPORTDISCHARGEID = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '目的港',
store: this.storeCodeLoadport,
name: 'PORTLOAD',
valueField: 'PORT',
displayField: 'CodeAndName',
listeners: {
scope: this,
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
}
}
});
//船名
this.storeVESSEL = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DICModel',
proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' }
});
this.storeVESSEL.load({ params: { tablename: "Op_InternalTrade", columnname: "VESSEL", condition: " BSDATE>DATEADD(day,-15, getdate()) " } });
this.comboxVESSEL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船名',
store: this.storeVESSEL,
forceSelection: false,
name: 'VESSEL',
valueField: 'KEYFIELD',
displayField: 'KEYFIELD',
listeners: {
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
},
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//航次
this.storeVOYNO = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DICModel',
proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' }
});
this.storeVOYNO.load({ params: { tablename: "Op_InternalTrade", columnname: "VOYNO", condition: " BSDATE>DATEADD(day,-15, getdate()) " } });
this.comboxVOYNO = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '航次',
store: this.storeVOYNO,
forceSelection: false,
name: 'VOYNO',
valueField: 'KEYFIELD',
displayField: 'KEYFIELD',
listeners: {
'beforequery': function (e) {
return FilterCombox(e);//在beforequery使用此方法
},
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCtn = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCtnModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeCtnList' }
});
this.storeCtn.load();
//箱型
this.comboxCTN = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCtn,
forceSelection: true,
fieldLabel: '箱型',
allowBlank: true,
name: 'CTNALL',
valueField: 'CTN',
displayField: 'CTN'
});
//#endregion
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '1 1 1 1',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxCustCode,
{
fieldLabel: '会计期间',
format: 'Y-m',
xtype: 'datefield',
name: 'ACCDATE',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},
{
fieldLabel: '提单号',
//labelWidth: 110,
name: 'MBLNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},
{
fieldLabel: '委托编号/箱号',
//labelWidth: 110,
name: 'CUSTNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},
{
fieldLabel: '从..ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETD_BGN',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到..ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETD_END',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},this.comboxCompany]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
]
}
]//end items(fieldset 1)
}//end 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);
saveQuerySetting(this.formname, this.formSearch, true, true);
},
scope: this
}, '-', {
text: "新建", id: "btnadd",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
DsOpenEditWin('/MvcShipping/MsOp_InternalTrade/Edit', "新建内贸海运业务");
},
scope: this
}, {
text: "删除", id: "btndelete",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-', {
text: "批量修改信息", id: "Btnchangelist",
handler: function (button, event) {
//this.PushState("3000");
this.onSaveList();
},
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, {
text: "打印", id: "print",
tooltip: 'print',
handler: function (button, event) {
//this.PushState("30011");
this.Print();
},
scope: this
}, /*{
id: "btnFeeAuditReject",
text: '驳回提交费用业务',
tooltip: '驳回提交费用业务',
iconCls: "btnrefuse",
handler: function (button, event) {
this.onAuditRefuseClick(button, event);
},
scope: this
},*/
{
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
var formname = this.formname;
var tempcolumns = this.gridList.columns;
DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false);
},
scope: this
}
//,this.CB_EditMode
]
});
//#region 布局
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
items: [this.formSearch, this.panelBtn]
});
this.panelMain = new Ext.Panel({
//title: '',
layout: "border",
region: 'center',
height: 600,
margin: '1 2',
split: true,
items: [this.gridList]
});
Ext.apply(this, {
items: [this.panelTop, this.panelMain]
});
//#endregion
//#region 弹出窗口 批量修改信息
this.formChange = 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: '会计期间',
xtype: 'monthfield',
format: 'Y-m',
name: 'ACCDATE'
}, {
fieldLabel: '开船日期',
name: 'ETD',
format: 'Y-m-d',
xtype: 'datefield'
}, {
fieldLabel: '到港日期',
name: 'ETA',
format: 'Y-m-d',
xtype: 'datefield'
}
]
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxVESSEL
, this.comboxVOYNO
, { xtype: 'hiddenfield' }
] //,this.comboxDataInputType
},
{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
{
fieldLabel: '装箱地点',
name: 'LOADADDR'
}, {
fieldLabel: '装箱时间',
name: 'LOADDATE',
format: 'Y-m-d',
xtype: 'datefield'
}
, this.comboxCTN
] //,this.comboxDataInputType
}
] //end items(fieldset 1)
},
this.comboxDataInputType //end fieldset 1
] //end root items
});
me = this;
this.winChangeShow = Ext.create('Ext.window.Window', {
title: "批量修改数据",
width: 600,
//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.formChange],
buttons: [{
text: "确认接受",
minWidth: 70,
handler: function () {
var form = me.formChange.getForm();
me.ChangeListData =
{
"ACCDATE": form.findField("ACCDATE").getRawValue(),
"ETD": form.findField("ETD").getRawValue(),
"ETA": form.findField("ETA").getRawValue(),
"VESSEL": form.findField("VESSEL").getValue(),
"VOYNO": form.findField("VOYNO").getValue(),
"LOADADDR": form.findField("LOADADDR").getValue(),
"LOADDATE": form.findField("LOADDATE").getRawValue(),
"CTNALL": form.findField("CTNALL").getRawValue()
};
me.doSavelist(me.ChangeListData);
}
},
{
text: "关闭",
minWidth: 70,
handler: function () {
me.winChangeShow.close();
}
}]
});
//#endregion
//#region 以下集中绑定事件
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: this.sqlcontext });
}, this);
//#endregion
this.LoadInitData();
}, //end initUIComponents
LoadInitData: function () {
if (this.sqlcontext == '') {
this.sqlcontext = "ACCDATE='" + currdate.format('yyyy-MM') + "'";
}
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: this.sqlcontext },
waitMsg: "正在查询数据...",
scope: this
});
},
onRefreshClick: function (button, event) {
this.PageSize = this.Pagenum.getValue();
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//}
},
onDsQuery: function (button, event) {
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//}
},
onRefreshClick_Add: function (button, event) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition_Add();
this.storeList.load({
params: { start: 0, limit: this.PageSize, 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];
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/MsOp_InternalTrade/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);
}, //onDeleteClickwinChangeShow
onSaveList: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.winChangeShow.show();
},
doSavelist: function(data) {
var selections = this.gridList.getSelectionModel().getSelection();
var BSNOList = "";
for (var i = 0; i < selections.length; i++) {
//_data = selections[i].data;
if (!BSNOList == "") { BSNOList += ","; }
BSNOList += "'" + selections[i].get('BSNO') + "'";
}
_this = this;
Ext.MessageBox.confirm('提示', '确定修改选中的业务这些数据吗?',
function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在保存数据...');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOp_InternalTrade/SaveList',
params: {
BSNOList: BSNOList,
headdata: Ext.JSON.encode(data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.onRefreshClick();
} else {
Ext.Msg.show({
title: '错误',
msg: jsonresult.Message,
icon: Ext.Msg.ERROR,
buttons: Ext.Msg.OK
});
_this.onRefreshClick();
}
Ext.Msg.hide();
_this.winChangeShow.close();
}
},
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);
},
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
//20170309 增加逻辑
//
//只能看到“”
var MBLNO = form.findField('MBLNO').getValue();
sql = sql + getAndConSql(sql, MBLNO, " ( mblno like '%" + MBLNO + "%' or hblno like '%" + MBLNO + "%') ");
var ACCDATE = form.findField('ACCDATE').getRawValue();
sql = sql + getAndConSql(sql, ACCDATE, " ACCDATE = '" + ACCDATE + "' ");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, " CUSTOMERNAME like '%" + CUSTOMERNAME + "%' ");
var CUSTNO = form.findField('CUSTNO').getValue();
sql = sql + getAndConSql(sql, CUSTNO, " (CUSTNO like '%" + CUSTNO + "%' or CNTRNO like '%" + CUSTNO + "%') ");
var ETD_BGN = form.findField('ETD_BGN').getRawValue();
sql = sql + getAndConSql(sql, ETD_BGN, " ETD>='" + ETD_BGN + "'");
var ETD_END = form.findField('ETD_END').getRawValue();
sql = sql + getAndConSql(sql, ETD_END, " ETD<='" + ETD_END + " 23:59:59'");
var CORPID = form.findField('CORPID').getRawValue();
sql = sql + getAndConSql(sql, CORPID, " CORPID='" + CORPID + "'");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.storeCustCode;
ret[4] = this.storeCompany;
ret[5] = this.storeUser;
ret[6] = this.storeDept;
ret[7] = this.storeCARRIER;
ret[8] = this.storeCodeLoadport;
ret[9] = this.storeVESSEL;
ret[10] = this.storeVOYNO;
ret[11] = this.storeTRUCK;
ret[12] = this.storeYARD;
ret[13] = this.storeCONSIGNEE;
ret[14] = this.storeCtn;
return ret;
},
onAddClick: function (button, event) {
this.OprationStatus = 'add';
DsOpenEditWin("/MvcShipping/MsOp_YAXIANG/Edit", "新建内贸海运");
}, //onDeleteClick
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
},
//#region 打印
Print: function () {
var selectedRecords = this.gridList.selModel.getSelection();
var YXNOList = "";
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (!isNullorEmpty(YXNOList)) YXNOList += "','";
YXNOList += rec.get("YXNO");
}
var printType = 'MSOP_YAXIANG';
var sql1 = "";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOp_YAXIANG/GetPrintSql',
params: {
printname: "Print1",
YXNOList: "'" + YXNOList + "'"
},
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;
}
//this.Editdata = result.data;
//this.LoadInit(data);
sql1 = result.Data.sql1;
sql2 = result.Data.sql2;
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
//#endregion
});