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.

2600 lines
93 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('DsTruck');
DsTruck.MsWlBsCtnPcIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.MsWlBsCtnPcIndex.superclass.constructor.call(this);
};
Ext.extend(DsTruck.MsWlBsCtnPcIndex, Ext.Panel, {
PageSize: 30,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
SelectedstoreList: null,
SelectPGID: '',
fensql: '',
initUIComponents: function () {
this.formname = "MsWlBsCtnPcIndex";
this.fensql = ' 1=2 ';
Ext.define('PCmb', {
extend: 'Ext.data.Model',
idProperty: '',
fields: [
{ name: 'ywType', type: 'string' },
{ name: 'PcBillType', type: 'string' },
{ name: 'PcBillTypeREF', type: 'string' },
{ name: 'timeMark', type: 'number' },
{ name: 'gId', type: 'string' },
{ name: 'PGid', type: 'string' },
{ name: 'BLTYPE', type: 'string' },
{ name: 'TRANSSTATUS', type: 'string' },
{ name: 'RowNumber', type: 'string' },
{ name: 'BillNo', type: 'string' },
{ name: 'ExpDate', type: 'date', dateFormat: 'Y-m-d H:i:s' },
{ name: 'GroupDate', type: 'string' },
{ name: 'EndPortDate', type: 'date', dateFormat: 'Y-m-d H:i:s' },
{ name: 'EtDate', type: 'date' },
{ name: 'VoyVeg', type: 'string' },
{ name: 'ArriveDate', type: 'date', dateFormat: 'Y-m-d H:i:s' },
{ name: 'ReturnDate', type: 'date', dateFormat: 'Y-m-d H:i:s' },
{ name: 'CustomerName', type: 'string' },
{ name: 'F_CustomerName', type: 'string' },
{ name: 'DrvName', type: 'string' },
{ name: 'TruckNo', type: 'string' },
{ name: 'MblNo', type: 'string' },
{ name: 'LinkMan', type: 'string' },
{ name: 'DstArea', type: 'string' },
{ name: 'DetiNation', type: 'string' },
{ name: 'ContainerQty', type: 'string' },
{ name: 'Ton', type: 'string' },
{ name: 'LoadCount', type: 'string' },
{ name: 'LoadPlace', type: 'string' },
{ name: 'TruckSpec', type: 'string' },
{ name: 'IsDouble', type: 'string' },
{ name: 'Property', type: 'string' },
{ name: 'YUNFEI', type: 'string' },
{ name: 'HCHJ', type: 'string' },
{ name: 'ZXF', type: 'string' },
{ name: 'DDF', type: 'string' },
{ name: 'QTFee', type: 'string' },
{ name: 'TotalFee', type: 'string' },
{ name: 'Remark', type: 'string' },
{ name: 'FEESTATUS', type: 'string' },
{ name: 'UserCode', type: 'string' },
{ name: 'UserName', type: 'string' },
{ name: 'OrgName', type: 'string' },
{ name: 'LrDate', type: 'string' },
{ name: 'PCSTATUSREF', type: 'string' },
{ name: 'RefBillNo', type: 'string' },
{ name: 'RefBillNose', type: 'string' },
{ name: 'MblNoSe', type: 'string' },
{ name: 'ContainerType', type: 'string' },
{ name: 'LinkTel', type: 'string' },
{ name: 'YardName', type: 'string' },
{ name: 'LinkManSe', type: 'string' },
{ name: 'LinkTelSe', type: 'string' },
{ name: 'RtnYardName', type: 'string' },
{ name: 'BsType', type: 'string' },
{ name: 'CustName', type: 'string' },
{ name: 'CustLikeManName', type: 'string' },
{ name: 'DispatchName', type: 'string' },
{ name: 'INVOICENO', type: 'string' },
{ name: 'KINDPKGS', type: 'string' },
{ name: 'CUSTNO', type: 'string' },
{ name: 'SalesName', type: 'string' },
{ name: 'DRFEESTATUS', type: 'string' },
{ name: 'CRFEESTATUS', type: 'string' },
{ name: 'ChangedReson', type: 'string' }
]
});
Ext.define('Tradermb', {
extend: 'Ext.data.Model',
idProperty: 'gid',
fields: [
{ name: 'gid', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'codename', type: 'string' }
]
});
Ext.define('DsShipping.ux.CustomRefModel', {
extend: 'Ext.data.Model',
fields: [
{ name: 'GId', type: 'string' },
{ name: 'CustCode', type: 'string' },
{ name: 'CustName', type: 'string' },
{ name: 'CodeAndName', type: 'string' },
{ name: 'SALE', type: 'string' }
]
});
//定义数据集
this.storeCustomerName = Ext.create('DsExt.ux.RefTableStore', {
model: 'Tradermb',
proxy: { url: '/CommMng/BasicDataRef/GetTrader' }
});
this.storeCustomerName.load({ params: { condition: ""} });
this.comboxCustomerName = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '客户',
id: "CustomerName", //hidden: true,
forceSelection: true,
store: this.storeCustomerName,
name: 'CustomerName',
valueField: 'name',
displayField: 'codename'
});
this.storeTruckNo = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlTruck',
proxy: { url: '/TruckMng/MsWlPc/GetTruckNoCanUse' },
//params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 )"},
autoLoad: false
});
//this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 )"} });
var _this = this;
this.comboxTruckNo = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '车牌号',
//multiSelect:true,
store: this.storeTruckNo, //readOnly:true,
queryMode: 'remote',
name: 'TruckNo', id: "TruckNo",
valueField: 'TruckNo',
displayField: 'TruckNo'
});
// this.storeDrvName = Ext.create('DsExt.ux.RefTableStore', {
// model: 'MsWlBsHeadRefMsWlDriver',
// proxy: { url: '/TruckMng/MsWlPc/GetDrvNameList' }
// });
// this.storeDrvName.load({ params: { condition: ""} });
// this.comboxDrvName = Ext.create('DsExt.ux.RefTableCombox', {
// //fieldLabel: '司机',
// store: this.storeDrvName,
// name: 'DrvName',
// valueField: 'DrvName',
// displayField: 'CodeAndName',
// listeners: {
// scope: this,
// 'select': function (combo, records, eOpts) {
// if (records.length > 0) {
// this.setDrvName(records[0].data.DrvCode);
// }
// }
// }
// });
//客户加载_车队
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', {
store: this.storeTRUCKER,
name: 'F_CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.StoreBLTYPE = Ext.create('Ext.data.Store', {
fields: ['BLTYPE']
});
this.StoreBLTYPE.add({ "BLTYPE": "派车主票" });
this.StoreBLTYPE.add({ "BLTYPE": "派车分票" });
this.StoreBLTYPE.add({ "BLTYPE": "派车单票" });
this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreBLTYPE,
forceSelection: true,
name: 'BLTYPE',
valueField: 'BLTYPE',
displayField: 'BLTYPE',
value: '派车单票'
});
_this = this;
/////////////////////////////////////////
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'PCmb',
remoteSort: true,
groupField: 'GroupDate',
proxy: {
type: 'ajax',
//url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL',
url: '/TruckMng/PcHeadEdit_WFSD/GetDataList',
//this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL';
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.column = [
{
sortable: true, hidden: true,
dataIndex: 'PcBillType',
header: 'PcBillType',
width: 80
},
{
sortable: true,
dataIndex: 'ExpDate',
header: '派车时间',
width: 160,
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
// ,
// editor: {
// //format: 'Y-m-d H:i:s',
// xtype: 'datetimefield'
// /*,
// labelWidth: 60,
// width: 220,
// name: 'STARTDATETIME'*/
// }
},
{
sortable: true, hidden: true,
dataIndex: 'UserCode',
header: 'UserCode',
width: 80
},
{
sortable: true,
dataIndex: 'UserName',
header: '派车申请人',
width: 80
}, {
sortable: true,
dataIndex: 'PCSTATUSREF',
header: '状态',
width: 50,
renderer: function (value) {
if (value == "接单") {
return "<a><font color='#333333'>" + value + "</font></a>";
} else if (value == "派车") {
return "<a><font color='#0000FF'>" + value + "</font></a>";
} else if (value == "完成") {
return "<a><font color='#00FF00'>" + value + "</font></a>";
}
}
},
{
sortable: true,
dataIndex: 'BLTYPE',
header: '派车单类型',
width: 80,
// editor: this.comboxBLTYPE,
renderer: function (value) {
if (value == "") {
return "派车单票";
} else return value;
}
},
{
sortable: true, hidden: true,
dataIndex: 'timeMark',
header: 'timeMark',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'gId',
header: 'gId',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'PGid',
header: 'PGid',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'FEESTATUS',
header: '费用锁定',
width: 80
},
{
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';
}
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';
}
return value;
}
},
{
sortable: true,
dataIndex: 'RowNumber',
header: '日序号',
width: 60,
align: 'center'
},
{
sortable: true,
dataIndex: 'BillNo',
header: '委托编号',
width: 160
},
{
sortable: true,
dataIndex: 'MblNoSe',
header: '提单号',
width: 160
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'GroupDate',
header: '派车日期',
width: 80
},
{
sortable: true,
dataIndex: 'ArriveDate',
header: '装货日期',
width: 80,
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
// ,
// editor: {
// xtype: 'datefield'
// }
},
{
sortable: true,
dataIndex: 'ReturnDate',
header: '卸货日期',
width: 80,
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
// ,
// editor: {
// xtype: 'datefield'
// }
},
{
sortable: true,
dataIndex: 'CustomerName',
header: '客户名称(公司)',
width: 80
// ,
// editor: this.comboxCustomerName
},
{
sortable: true,
dataIndex: 'LinkMan',
header: '客户联系人',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'CustName',
header: '发货人',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'DispatchName',
header: '收货人',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'F_CustomerName',
header: '车队',
width: 80
// ,
// editor: this.comboxTRUCKER
},
{
sortable: true,
dataIndex: 'TruckNo',
header: '车牌号',
width: 80
// ,
// editor: this.comboxTruckNo
},
{
sortable: true,
dataIndex: 'MblNo',
header: 'Marstar业务号',
width: 120
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'BsType',
header: '业务类型',
width: 110
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'DstArea',
header: '到达地',
width: 120
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'DetiNation',
header: '目的地址',
width: 120
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'ContainerQty',
header: '件数',
width: 80
// ,
// editor: {
// xtype: 'numberfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'Ton',
header: '重量',
width: 80
// ,
// editor: {
// xtype: 'numberfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'LoadCount',
header: '体积',
width: 80
// ,
// editor: {
// xtype: 'numberfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'LoadPlace',
header: '装货地址',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'TruckSpec',
header: '车型',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'ContainerType',
header: '箱型箱量',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'YardName',
header: '提箱场站',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'CustLikeManName',
header: '工厂联系人',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'INVOICENO',
header: '发票号',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'KINDPKGS',
header: '包装',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'CUSTNO',
header: '运单号',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'IsDouble',
header: '是否包车',
width: 60,
renderer: function (value) {
if (value == "0") {
return "<a><font color='#333333'>否</font></a>";
} else if (value == "1") {
return "<a><font color='#FF0000'>是</font></a>";
}
}
},
{
sortable: true,
dataIndex: 'Property',
header: '车辆类别',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'YUNFEI',
header: '运费',
width: 80
},
{
sortable: true,
dataIndex: 'HCHJ',
header: '回程合计',
width: 80
},
{
sortable: true,
dataIndex: 'ZXF',
header: '装卸费',
width: 80
},
{
sortable: true,
dataIndex: 'DDF',
header: '代垫费',
width: 80
},
{
sortable: true,
dataIndex: 'QTFee',
header: '其他',
width: 80
},
{
sortable: true,
dataIndex: 'TotalFee',
header: '合计运费',
width: 80
},
{
sortable: true,
dataIndex: 'Remark',
header: '备注',
width: 160
,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'ChangedReson',
header: '注意事项',
width: 160
,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true, hidden: true,
dataIndex: 'OrgName',
header: '分公司',
width: 80
},
{
sortable: true,
dataIndex: 'LrDate',
header: '录入日期',
width: 110
},
{
sortable: true, hidden: true,
dataIndex: 'RefBillNo',
header: 'RefBillNo',
width: 110
},
{
sortable: true, hidden: true,
dataIndex: 'RefBillNose',
header: 'RefBillNose',
width: 110
}
];
this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.MainCB = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 40
});
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.MainCB,
columns: this.column,
// plugins: [this.cellEditing],
features: [{
id: 'group',
ftype: 'grouping',
groupHeaderTpl: '{name}',
hideGroupedHeader: true,
enableGroupingMenu: true
}],
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.SelectedstoreList = this.storeList;
this.SelectPGID = '';
DsOpenEditWinAll('/TruckMng/MsWlBsCtn/PcEdit');
}, this);
this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) {
}, this);
/////////////以下部分为获取存储的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);
////////////////////////////
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
//#region formSearch
//#region formSearch枚举参照相关
this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.FeeTypeRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetFeeTypeRefList' }
});
this.storeFeeNameRef.load({ params: { condition: " ISTRUCKING='1' "} });
this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '不含此费用',
store: this.storeFeeNameRef,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户',
typeAhead: true,
store: this.storeCustCode,
name: 'CustName',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
// this.storeF_CustCode = Ext.create('DsExt.ux.RefTableStore', {
// model: 'DsTruckMng.ux.CustomRefModel',
// proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
// });
// this.storeF_CustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
// this.comboxF_CustCode = Ext.create('DsExt.ux.RefTableCombox', {
// fieldLabel: '最终客户',
// typeAhead: true,
// store: this.storeF_CustCode,
// name: 'F_CustName',
// valueField: 'CustName',
// displayField: 'CodeAndName'
// });
Ext.define('PCSTATUSmd', {
extend: 'Ext.data.Model',
fields: [
{ name: 'ID', type: 'string' },
{ name: 'STATUSNAME', type: 'string' }
]
});
var PCSTATUSData = [{ "ID": "0", "STATUSNAME": "接单" },
{ "ID": "1", "STATUSNAME": "派车" },
{ "ID": "2", "STATUSNAME": "完成"}];
this.storePCSTATUS = Ext.create('Ext.data.Store', {
model: 'PCSTATUSmd',
data: PCSTATUSData
});
this.comboxPCSTATUS = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '状态',
autosize: true,
bodyPadding: 5,
// flex: 2,
//width: 500,
labelWidth: 85,
store: this.storePCSTATUS,
queryMode: 'local',
triggerOnClick: false,
valueField: 'ID',
displayField: 'STATUSNAME',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.comboxTRUCKERQ = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeTRUCKER,
fieldLabel: '车队',
name: 'F_CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.StorePcBillType = Ext.create('DsExt.ux.RefEnumStore', {});
this.StorePcBillType.load({ params: { enumTypeId: 99046} });
this.comboxPcBillType = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '派车类型',
store: this.StorePcBillType,
name: 'PcBillType',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#endregion
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
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: [{
fieldLabel: 'Marstar业务号',
name: 'PS_MBLNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '司机姓名',
name: 'PS_DRVNAME',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '车牌',
name: 'TruckNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '目的地/工厂',
name: 'DstArea',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
fieldLabel: '单据(路单)号',
name: 'PS_BILLNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
, this.comboxCustCode, {
fieldLabel: '发/收货人',
name: 'F_CustName',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
, this.comboxPCSTATUS
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '从派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到派车日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'PS_EXPDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxTRUCKERQ
//, this.comboxFeeNameRef
, this.comboxPcBillType
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
var menu1 = new Ext.menu.Menu({
id: 'basicMenu',
items: [{
text: '批量设为完成',
handler: clickEnd
}, {
text: '批量设为未完成',
handler: clickNotEnd
}]
});
function clickEnd() {
panelTest.SetEnd("1");
};
function clickNotEnd() {
panelTest.SetEnd("0");
};
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "新建", id: "btnadd", //hidden: true,
iconCls: "btnadd",
handler: function (button, event) {
this.SelectedstoreList = this.storeList;
this.OprationStatus = 'add';
this.SelectPGID = '';
DsOpenEditWinAll('/TruckMng/MsWlBsCtn/PcEdit');
// this.onAddPCClick();
},
scope: this
}, {
text: "删除", id: "btndelete", //hidden: true,
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, '-',
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
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
},
// {
// text: "保存修改", id: "SaveBtn",
// iconCls: "btnsave",
// handler: function (button, event) {
// this.onSaveClick(button, event);
// },
// scope: this
// },
'-',
{
text: "打印派车单",
iconCls: "btnprint",
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', {
text: "状态更新",
menu: [
{
text: "配载完成",
handler: function (menu, event) {
_this.onUpTransStatusClick('在途');
}
}, {
text: "已到货",
handler: function (menu, event) {
_this.onUpTransStatusClick('已到货');
}
}, {
text: "已回单",
handler: function (menu, event) {
_this.onUpTransStatusClick('已回单');
}
}],
scope: this
}
// , '-',
// {
// text: "派车通知",
// iconCls: "btnrefresh",
// handler: function (button, event) {
// this.onBsTruckViewClick(button, event);
// },
// scope: this
// }
//,this.CB_EditMode
]
});
// this.panelcenter = new Ext.Panel({
// layout: "border",
// region: 'center',
// items: [this.gridList, this.paneldetail]
// });
// //#endregion
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 125,
items: [this.formSearch, this.panelBtn]
});
this.panelWlBsCtnPc = new Ext.Panel({
title: '派车单列表',
id: 'pnlmodWlBsCtnPcList', //pnlmodOpOtherOpwt
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
frame: false,
items: [this.panelTop, this.gridList]
});
//#region 待派车列表
this.storeList2 = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsWlBsHead',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/MsWlBs/GetDataList',
reader: {
id: 'BillNo',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.Pagenum2 = 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.onRefreshClick2();
}
}
}
});
this.gridList2 = new Ext.grid.GridPanel({
store: this.storeList2,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
viewConfig: {
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('PcType');
return DsTruck.MsChFeeGetRowClass(feeStatus);
}
},
columns: [{
sortable: true,
dataIndex: 'BillNo',
header: '物流号',
width: 150
}, {
sortable: true,
dataIndex: 'TRANSSTATUS',
header: '订单状态',
width: 80
}, {
sortable: true,
dataIndex: 'LrDate',
header: '录入日期',
width: 80
}, {
sortable: true,
dataIndex: 'JzDate',
header: '记账日期',
width: 80
}, {
sortable: true,
dataIndex: 'UserCode',
header: '用户编码',
width: 60
}, {
sortable: true,
dataIndex: 'UserName',
header: '用户姓名',
width: 80
}, {
sortable: true,
dataIndex: 'OrgCode',
header: '组织编码',
width: 80
}, {
sortable: true,
dataIndex: 'OrgName',
header: '组织名称',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'BsType',
header: '托单类型',
renderer: function (value, p, record) { return value + '-' + record.data.BsType_Ref; },
width: 60
}, {
sortable: true,
dataIndex: 'CustCode',
header: '委托单位代码',
width: 80
}, {
sortable: true,
dataIndex: 'CustName',
header: '委托单位',
//renderer: function (value, p, record) { return value + '-' + record.data.CustName_Ref; },
width: 80
}, {
sortable: true,
dataIndex: 'CustDate',
header: '委托日期',
width: 80
},
/* {
sortable: true,
dataIndex: 'FeeOpStatus',
header: '费用操作状态',
renderer: function (value, p, record) { return value + '-' + record.data.FeeOpStatus_Ref; },
width: 85
},
*/
{
sortable: true,
dataIndex: 'VoyVeg',
header: '船名航次',
renderer: function (value, p, record) { return value + '-' + record.data.VoyVeg_Ref; },
width: 80
}, {
sortable: true,
dataIndex: 'EtDate',
header: '开船(到港)日期',
width: 80
}, {
sortable: true,
dataIndex: 'EndPortDate',
header: '截港日期',
width: 80
}, {
sortable: true,
dataIndex: 'MblNo',
header: '提单号',
width: 120
}, {
sortable: true,
dataIndex: 'SalesCode',
header: '揽货人',
renderer: function (value, p, record) { return value + '-' + record.data.SalesCode_Ref; },
width: 80
}, {
sortable: true,
dataIndex: 'SalesName',
header: '揽货人姓名',
width: 80
}, {
sortable: true,
dataIndex: 'DispatchCode',
header: '调度员编码',
renderer: function (value, p, record) { return value + '-' + record.data.DispatchCode_Ref; },
width: 60
}, {
sortable: true,
dataIndex: 'DispatchName',
header: '调度员姓名',
width: 80
}, {
sortable: true,
dataIndex: 'SendYardCode',
header: '拖箱场站编码',
renderer: function (value, p, record) { return value + '-' + record.data.SendYardCode_Ref; },
width: 80
}, {
sortable: true,
dataIndex: 'SendYardName',
header: '拖箱场站',
width: 80
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运地',
width: 80
}, {
sortable: true,
dataIndex: 'DstArea',
header: '目的地',
width: 80
}, {
sortable: true,
dataIndex: 'DetiNation',
header: '工厂地址',
width: 200
}, {
sortable: true,
dataIndex: 'DetiLinkTel',
header: '工厂联系电话',
width: 200
}, {
sortable: true,
dataIndex: 'DetiLinkMan',
header: '工厂联系人',
width: 200
}, {
sortable: true,
dataIndex: 'Remark',
header: '备注',
width: 200
}, {
sortable: true,
hidden: true,
dataIndex: 'PcType',
header: 'PcType',
width: 20
}, {
sortable: true,
dataIndex: 'TruckNo',
header: '车牌号(派车单内)',
width: 180
}, {
sortable: true,
dataIndex: 'CtnInfo',
header: '集装箱信息',
width: 180
}
],
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {
id: "bbar1",
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum2]
});
this.gridList2.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin("/TruckMng/MsWlBsCtn/Edit");
}, this);
//#region formSearch
//#region formSearch枚举参照相关
this.storeBillStatus = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBillStatus.load({ params: { enumTypeId: 99026 } });
this.comboxBillStatus = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '业务锁定状态',
store: this.storeBillStatus,
name: 'BillStatus'
});
this.storeFeeStatus = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeFeeStatus.load({ params: { enumTypeId: 99027 } });
this.comboxFeeStatus = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '费用锁定状态',
store: this.storeFeeStatus,
name: 'FeeStatus'
});
this.storeBsType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeBsType.load({ params: { enumTypeId: 99025 } });
this.comboxBsType = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '托单类型',
store: this.storeBsType,
name: 'BsType'
});
this.storeFeeOpStatus = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeFeeOpStatus.load({ params: { enumTypeId: 99035 } });
this.comboxFeeOpStatus = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '费用操作状态',
store: this.storeFeeOpStatus,
name: 'FeeOpStatus'
});
this.storePcType = Ext.create('DsExt.ux.RefEnumStore', {});
this.storePcType.load({ params: { enumTypeId: 99041 } });
this.comboxPcType = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '已派车/未派车',
store: this.storePcType,
name: 'PcType'
});
this.storeVessel2 = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeVessel2.load({ params: { enumTypeId: 99042 } });
this.comboxVessel2 = Ext.create('DsExt.ux.RefEnumCombox', {
fieldLabel: '二程船名航次',
store: this.storeVessel2,
name: 'Vessel2Type'
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'" } });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
typeAhead: true,
store: this.storeCustCode,
name: 'CustCode',
valueField: 'CustCode',
displayField: 'CodeAndName'
});
this.storeContainerType = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CtnRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnRefList' }
});
this.storeContainerType.load({ params: { condition: "" } });
this.comboxContainerType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '箱型',
store: this.storeContainerType,
name: 'ContainerType',
valueField: 'CtnCode',
displayField: 'CodeAndName'
});
//#endregion
this.storeTransStatus2 = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeTransStatus2.add({ "DC": "接单", "NAME": "接单" });
this.storeTransStatus2.add({ "DC": "提交审核", "NAME": "提交审核" });
this.storeTransStatus2.add({ "DC": "审核通过", "NAME": "审核通过" });
this.storeTransStatus2.add({ "DC": "已派车", "NAME": "已派车" });
this.storeTransStatus2.add({ "DC": "未派车", "NAME": "未派车" });
this.comboxTransStatus2 = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '订单状态', //'费用类型',
store: this.storeTransStatus2,
valueField: 'DC',
value: '审核通过',
readOnly: true,
displayField: 'NAME',
forceSelection: true,
name: 'TRANSSTATUS'
});
this.formSearch2 = Ext.widget('form', {
frame: true,
region: 'center',
// height: 70,
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: [this.comboxTransStatus2, {
fieldLabel: '物流号',
name: 'BillNo'
}, {
fieldLabel: '船名航次',
name: 'VoyVeg'
}, {
fieldLabel: '提单号',
name: 'MblNo'
}, this.comboxCustCode, {
fieldLabel: '目的地',
name: 'DstArea'
}, {
xtype: 'button',
width: 100,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick2(button, event);
},
scope: this
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '从委托日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'CustDate_Min'
}, {
fieldLabel: '至委托日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'CustDate_Max'
}, {
fieldLabel: '从起运日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDate_Min'
}, {
fieldLabel: '到起运日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ExpDate_Max'
}, {
fieldLabel: '从到达日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'NeedArriveDate_Min'
}, {
fieldLabel: '到到达日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'NeedArriveDate_Max'
}, {
text: "重置",
width: 100,
xtype: 'button',
iconCls: "btnreset",
handler: function (button, event) {
this.onResetClick2(button, event);
},
scope: this
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
this.panelBtn2 = new Ext.Panel({
region: "north",
tbar: [{
text: '直接派车',
tooltip: '直接派车',
handler: function (button, event) {
this.onCreatePcAutoClick();
},
scope: this
}]
});
this.panelTop2 = new Ext.Panel({
layout: "border",
region: "north",
height: 95,
items: [this.panelBtn2,this.formSearch2]
});
this.panelWlBsCtn = new Ext.Panel({
title: '待派车单托单',
id: 'pnlmodWlBsCtnList', //pnlmodOpOtherOpwt
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
frame: false,
items: [this.panelTop2, this.gridList2]
});
//#endregion
this.tabWlBsCtnPc = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'center',
id: "tabWlBsCtnPcPanel",
enableTabScroll: true,
items:
[
this.panelWlBsCtnPc,
this.panelWlBsCtn
]
});
Ext.apply(this, {
items: [this.tabWlBsCtnPc]
});
///以下集中绑定事件
this.storeList.on('beforeload', function (store) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridList.on('edit', function (editor, e, eOpts) {
this.PCAfterEdit(editor, e, eOpts);
}, this);
this.cellEditing.on('beforeedit', function (editor, e) {
return this.PCBeforeEdit(editor, e);
}, this);
this.LoadInitData();
}, //end initUIComponents
LoadInitData: function () {
//this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} });
var sql = " (isend=0 or isend is null) and (datediff(month,ExpDate,getdate())=0 or ExpDate is null or ExpDate='1900-01-01 00:00:00.000' ) ";
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onAuditRefuseClick: function (button, event) {
var sql = " A.GID in (select bsno from ch_fee where FEESTATUS=6)";
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//}
},
onRefreshClick2: function (button, event) {
var sql = this.getCondition2();
var PageSize = this.Pagenum2.getValue();
this.storeList2.load({
params: { start: 0, limit: PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onCreatePcAutoClick: function () {
var selections = this.gridList2.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
_this = this;
var record = selections[0];
Ext.MessageBox.confirm('提示', '确定要生成派车单吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在生成数据...');
Ext.Ajax.request({
waitMsg: '正在生成数据...',
url: '/TruckMng/MsWlBsCtn/AddBillAuto',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnData = jsonresult.Data;
var arrNewRecords = _this.storeList.add(returnData);
_this.SelectedRecord = arrNewRecords[0];
_this.OprationStatus = 'edit';
DsOpenEditWinAll('/TruckMng/MsWlBsCtn/PcEdit');
_this.storeList2.reload();
Ext.Msg.hide();
}
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);
},
onUpTransStatusClick: function (transstatus) {
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 bodydatas = [];
for (var i = 0; i < selections.length ; i += 1) {
var member = selections[i];
//if (member.data.BSSTATUSREF != '锁定')
bodydatas.push(member);
}
if (bodydatas.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有需要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
Ext.MessageBox.confirm('提示', '确实要更新派车的状态为<' + transstatus + '>吗?', function (btn) {
if (btn == 'yes') {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodydatas);
Ext.Msg.wait('正在操作数据...');
Ext.Ajax.request({
waitMsg: '正在操作数据...',
url: '/TruckMng/MsWlBsCtn/UpTransStatusList',
params: {
data: jsonbodyAddDatas,
transstatus: transstatus
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.reload();
Ext.Msg.hide();
}
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);
},
onDeleteClick: function (button, event, type) {
if (type == 1) {
} else
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: '/TruckMng/MsWlBsCtn/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);
}, //onDeleteClick
onBsViewClick: 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.RefBillNo == '') {
Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var oplb = record.data.MblNoSe;
var bsno = record.data.RefBillNo;
var openSet = "height=1000, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
if (oplb == '海运出口') {
openUrl = "../MvcShipping/MsOpSeae/EditView?handle=check&bsno=" + bsno;
window.open(openUrl, openType, openSet);
} else if (oplb == '海运进口') {
openUrl = "../MvcShipping/MsOpSeai/EditView?handle=check&bsno=" + bsno;
window.open(openUrl, openType, openSet);
} else if (oplb == '空运出口') {
openUrl = "../MvcShipping/MsOpAire/EditView?handle=check&bsno=" + bsno;
window.open(openUrl, openType, openSet);
} else if (oplb == '空运进口') {
openUrl = "../MvcShipping/MsOpAiri/EditView?handle=check&bsno=" + bsno;
window.open(openUrl, openType, openSet);
}
},
onBsTruckViewClick: 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.RefBillNo == '') {
Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var oplb = record.data.MblNoSe;
var bsno = record.data.RefBillNo;
var le_id = record.data.RefBillNose;
var openSet = "height=600, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
openUrl = "../MvcShipping/MsOpLetter/TruckView?handle=check&bsno=" + bsno + "&oplb=" + oplb + "&le_id=" + le_id;
window.open(openUrl, openType, openSet);
},
getCondition: function () {
var form = this.formSearch.getForm();
// var sql = " t.PcBillType=1 ";
// var sql = " (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) ";
// var sql = " (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) ";
var sql = "";
/*
var sqldata = form.getValues();
sql = Ext.JSON.encode(sqldata);
*/
var mblNo = form.findField('PS_MBLNO').getValue();
sql = sql + getAndConSql(sql, mblNo, " (MblNo like '%" + mblNo + "%' or MBLNOse like '%" + mblNo + "%') ");
var drvName = form.findField('PS_DRVNAME').getValue();
sql = sql + getAndConSql(sql, drvName, " (DrvName like '%" + drvName + "%' or TruckNo='" + drvName + "') ");
var DstArea = form.findField('DstArea').getValue();
sql = sql + getAndConSql(sql, DstArea, " (DstArea like '%" + DstArea + "%' or DetiNation like '%" + DstArea + "%') ");
// var VoyVeg = form.findField('VoyVeg').getValue();
// sql = sql + getAndConSql(sql, VoyVeg, " (VoyVeg like '%" + VoyVeg + "%' ) ");
var pcBillNo = form.findField('PS_BILLNO').getValue();
sql = sql + getAndConSql(sql, pcBillNo, " BillNo like '%" + pcBillNo + "%'");
// var billNo = form.findField('PS_REFBILLNO').getValue();
// sql = sql + getAndConSql(sql, billNo, " (RefBillNo like '%" + billNo + "%' or RefBillNose like '%" + billNo + "%')");
var expDate_Min = form.findField('PS_EXPDATEBGN').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " ExpDate>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " ExpDate<='" + expDate_Max + " 23:59:59'");
// var orgCode = form.findField('OrgCode').getValue();
// sql = sql + getAndConSql(sql, orgCode, "OrgCode like '%" + orgCode + "%'");
var CustName = form.findField('CustName').getValue();
sql = sql + getAndConSql(sql, CustName, " customername like '%" + CustName + "%' ");
var F_CustName = form.findField('F_CustName').getValue();
sql = sql + getAndConSql(sql, F_CustName, " (CustName like '%" + F_CustName + "%' or DispatchName like '%" + F_CustName + "%')");
var F_CustomerName = form.findField('F_CustomerName').getValue();
sql = sql + getAndConSql(sql, F_CustomerName, " F_CustomerName like '%" + F_CustomerName + "%' ");
var PcBillType = form.findField('PcBillType').getValue();
sql = sql + getAndConSql(sql, PcBillType, " PcBillType='" + PcBillType + "' ");
/*
var FEENAME = form.findField('FeeName').getValue();
sql = sql + getAndConSql(sql, FEENAME, " GID not in( select distinct BSNO from ch_fee where feename='" + FEENAME + "')");
*/
var PCSTATUS = this.comboxPCSTATUS.getValue();
if (PCSTATUS != "") {
//sql = sql + getAndConSql(sql, Mainstate, "m.Mainstate in (" + Mainstate + ")");
//alert(PCSTATUS);
if (PCSTATUS == "0") {
sql = sql + getAndConSql(sql, PCSTATUS, "TruckNo=''");
}
if (PCSTATUS == "1") {
sql = sql + getAndConSql(sql, PCSTATUS, "(TruckNo<>'' and isend=0)");
}
if (PCSTATUS == "2") {
sql = sql + getAndConSql(sql, PCSTATUS, "isend=1");
}
if (PCSTATUS == "0,1") {
sql = sql + getAndConSql(sql, PCSTATUS, "isend=0");
}
if (PCSTATUS == "1,2") {
sql = sql + getAndConSql(sql, PCSTATUS, "TruckNo<>''");
}
if (PCSTATUS == "0,2") {
sql = sql + getAndConSql(sql, PCSTATUS, "(TruckNo='' or isend=1)");
}
}
return sql;
},
getCondition2: function () {
var form = this.formSearch2.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = "";
var TRANSSTATUS = form.findField('TRANSSTATUS').getValue();
sql = sql + getAndConSql(sql, TRANSSTATUS, "TRANSSTATUS='" + TRANSSTATUS + "'");
var billNo = form.findField('BillNo').getValue();
sql = sql + getAndConSql(sql, billNo, "BillNo like '%" + billNo + "%'");
var custDate_Min = form.findField('CustDate_Min').getRawValue();
sql = sql + getAndConSql(sql, custDate_Min, "CustDate >= '" + custDate_Min + "'");
var custDate_Max = form.findField('CustDate_Max').getRawValue();
sql = sql + getAndConSql(sql, custDate_Max, "CustDate <= '" + custDate_Max + " 23:59:59'");
var CustCode = form.findField('CustCode').getValue();
sql = sql + getAndConSql(sql, CustCode, "CustCode like '%" + CustCode + "%'");
var mblNo = form.findField('MblNo').getValue();
sql = sql + getAndConSql(sql, mblNo, "MblNo like '%" + mblNo + "%'");
var expDate_Min = form.findField('ExpDate_Min').getRawValue();
sql = sql + getAndConSql(sql, expDate_Min, " BillNo in (select BS_BILLNO from v_BSPCList where PC_BILLNO in (select BILLNO from tMsWlPcHead where ExpDate>='" + expDate_Min + "'))");
var expDate_Max = form.findField('ExpDate_Max').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " BillNo in (select BS_BILLNO from v_BSPCList where PC_BILLNO in (select BILLNO from tMsWlPcHead where ExpDate<='" + expDate_Min + " 23:59:59'))");
var voyVeg = form.findField('VoyVeg').getValue();
sql = sql + getAndConSql(sql, voyVeg, "VoyVeg like '%" + voyVeg + "%'");
sql = sql + getAndConSql(sql, voyVeg, "VoyVegSe like '%" + voyVeg + "%'");
var NeedArriveDate_Min = form.findField('NeedArriveDate_Min').getRawValue();
sql = sql + getAndConSql(sql, NeedArriveDate_Min, " NeedArriveDate>='" + NeedArriveDate_Min + "'");
var NeedArriveDate_Max = form.findField('NeedArriveDate_Max').getRawValue();
sql = sql + getAndConSql(sql, NeedArriveDate_Max, " NeedArriveDate<='" + NeedArriveDate_Max + " 23:59:59'");
var ExpDate_Min = form.findField('ExpDate_Min').getRawValue();
sql = sql + getAndConSql(sql, ExpDate_Min, " NeadLoadDate>='" + ExpDate_Min + "'");
var ExpDate_Max = form.findField('ExpDate_Max').getRawValue();
sql = sql + getAndConSql(sql, ExpDate_Max, " NeadLoadDate<='" + ExpDate_Max + " 23:59:59'");
var DstArea = form.findField('DstArea').getValue();
sql = sql + getAndConSql(sql, DstArea, " DstArea like '%" + DstArea + "%' ");
return sql;
},
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return false;
}
return true;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.SelectedstoreList;
ret[2] = this.SelectedRecord;
ret[3] = this.SelectPGID;
ret[4] = 'tMsWlPcHead';
return ret;
},
SetEnd: function (isEnd) {
selectedRecords = this.gridList.selModel.getSelection();
var GIDList = "";
var needalert = false;
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.get('TruckNo') != "") {
if (GIDList == "") { GIDList = "'" + rec.get('gId') + "'"; }
else {
GIDList = GIDList + ",'" + rec.get('gId') + "'";
}
}
else { needalert = true; }
}
if (needalert == true) {
alert("不能将接单状态的业务设置为完成");
}
if (GIDList == "") {
return;
}
Ext.Ajax.request({
waitMsg: '正在查询数据...',
url: '/TruckMng/MsWlPc/SetEnd',
async: false,
params: {
GIDList: GIDList,
isEnd: isEnd
},
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;
}
var _count = result.data;
this.onRefreshClick();
if (needalert == true) {
alert("注意,未派车(未选择车号)的业务不能设置为完成。");
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
}); //request over
},
SetPGID: function (button, event, type) {
if (type == 1) {
} else {
var selectedRecords = this.gridListNoFen.selModel.getSelection();
var Selectid = Ext.getCmp('Selectid');
var pgid = Selectid.text;
}
var GIDList = "";
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (GIDList == "") { GIDList = "'" + rec.get('gId') + "'"; }
else {
GIDList = GIDList + ",'" + rec.get('gId') + "'";
}
}
if (GIDList == "") {
return;
}
Ext.Ajax.request({
waitMsg: '正在查询数据...',
url: '/TruckMng/MsWlPc/SetPGID',
async: false,
params: {
GIDList: GIDList,
PGID: pgid
},
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;
}
var _count = result.data;
this.onRefreshClick();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
}); //request over
},
onSaveClick: function (button, event, type) {
var bodyList = [];
if (type == 1) {
} else {
for (i = 0; i < this.storeList.getCount(); i += 1) {
var member = this.storeList.getAt(i);
bodyList.push(member);
};
}
var jsonBody = ConvertRecordsToJson(bodyList);
if (jsonBody == '') {
return;
}
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/TruckMng/PcHeadEdit_WFSD/SaveWFSDList',
scope: this,
params: {
data: jsonBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
//this.storeEditList.commitChanges();
if (type == 1) {
this.onRefreshClick();
} else {
this.onRefreshClick();
}
} 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
});
}
//alert('03');
}
});
}
,
onAddPCClick: function (button, event, type) {
if (type == 1) {
} else {
var record = Ext.create('PCmb', {
'PcBillType': '1',
'PcBillTypeREF': '散货派车单',
'gId': '',
'RowNumber': '',
'BillNo': '',
'ExpDate': '',
'GroupDate': '',
'ArriveDate': '',
'ReturnDate': '',
'CustomerNam': '',
'F_CustomerName': '',
'LinkMan': '',
'DrvName': '',
'TruckNo': '',
'MblNo': '',
'DstArea': '',
'DetiNation': '',
'ContainerQty': '0',
'Ton': '0',
'LoadCount': '0',
'LoadPlace': '',
'TruckSpec': '',
'IsDouble': '',
'Property': '',
'BsType': '海运出口',
'BLTYPE': '派车单票',
'YUNFEI': '',
'HCHJ': '',
'ZXF': '',
'DDF': '',
'QTFee': '',
'TotalFee': '',
'Remark': '',
'timeMark': '0',
'RoadFee': '0',
'UserCode': usercode,
'UserName': SHOWNAME,
'OrgName': '',
'LrDate': ''
});
this.storeList.add(record);
var n = this.storeList.getCount();
this.cellEditing.startEditByPosition({ row: n - 1, column: 2 });
}
}
,
PCAfterEdit: function (editor, e, eOpts) {
//if (e.value == e.originalValue) { return; }
if (e.field == 'ContainerType') {//箱号
var CTNrecords = DsStoreQueryBy(this.storeContainerType, 'CtnCode', e.value);
if (CTNrecords.getCount() > 0) {
var CTNdata = CTNrecords.getAt(0).data;
e.record.set('ContainerType_Ref', CTNdata.CtnName);
} else {
e.record.set('ContainerType_Ref', '');
}
}
if (e.field == 'YardCode') {
var Yardrecords = DsStoreQueryBy(this.storeYardCode, 'CustCode', e.value);
if (Yardrecords.getCount() > 0) {
var Yarddata = Yardrecords.getAt(0).data;
e.record.set('YardCode_Ref', Yarddata.CodeAndName);
} else {
e.record.set('YardCode_Ref', '');
}
}
if (e.field == 'RtnYardCode') {
var Yardrecords = DsStoreQueryBy(this.storeRtnYardCode, 'CustCode', e.value);
if (Yardrecords.getCount() > 0) {
var Yarddata = Yardrecords.getAt(0).data;
e.record.set('RtnYardCode_Ref', Yarddata.CodeAndName);
} else {
e.record.set('RtnYardCode_Ref', '');
}
}
if (e.field == 'DrvName') {
/*
var Yardrecords = DsStoreQueryBy(this.storeRtnYardCode, 'CustCode', e.value);
if (Yardrecords.getCount() > 0) {
var Yarddata = Yardrecords.getAt(0).data;
e.record.set('RtnYardCode_Ref', Yarddata.CodeAndName);
} else {
e.record.set('RtnYardCode_Ref', '');
}*/
}
if (e.field == 'TruckNo') {
var _datas = DsStoreQueryBy(this.storeTruckNo, 'TruckNo', e.value);
if (_datas.getCount() > 0) {
var _t = _datas.getAt(0).data;
e.record.set('DrvName', _t.DrvName);
e.record.set('Mobile', _t.Mobile);
} else {
e.record.set('DrvName', "");
e.record.set('Mobile', "");
}
}
if (e.field == 'F_CustomerName') {
var _datas = DsStoreQueryBy(this.storeF_CustomerName, 'name', e.value);
if (_datas.getCount() > 0) {
var _t = _datas.getAt(0).data;
e.record.set('DetiNation', _t.ADDR);
} else {
e.record.set('DrvName', "");
}
}
}
,
PCBeforeEdit: function (editor, e, eOpts) {
if (e.field == 'TruckNo') {//箱号
this.SetTruckNo();
}
}
,
SetTruckNo: function () {
var TruckNoList = "";
for (i = 0; i < this.storeList.getCount(); i += 1) {
var member = this.storeList.getAt(i);
if (member.data.PCSTATUSREF != "完成" && member.data.TruckNo != "") {
if (TruckNoList == "") {
TruckNoList = "('" + member.data.TruckNo + "'";
} else {
TruckNoList = TruckNoList + ",'" + member.data.TruckNo + "'";
}
}
};
if (TruckNoList != "") {
TruckNoList = TruckNoList + ")";
this.storeTruckNo.load({ params: { condition: " and A.truckno not in " + TruckNoList} });
} else {
//this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} });
}
},
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
},
//#region 打印
Print: 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;
}
var record = selections[0];
if (record.data.RefBillNo == '') {
Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var oplb = record.data.MblNoSe;
var bsNo = record.data.RefBillNo;
var le_id = record.data.RefBillNose;
var billNo = record.data.BillNo;
var printType = 'MSOPLETTERTRUCKLS';
if (oplb == "海运进口") {
printType = 'MSOPLETTERTRUCKSEAILS'
} else if (oplb == "空运进口") {
printType = 'MSOPLETTERTRUCKAIRILS'
} else if (oplb == "空运出口") {
printType = 'MSOPLETTERTRUCKAIRELS'
}
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_letter WHERE LE_ID = '" + le_id + "'";
var sql2 = "SET LANGUAGE 'us_english' SELECT * FROM tMsWlPcHead WHERE billNo = '" + billNo + "'";
var sql3 = "";
if (this.oplb == "海运进口")
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_seai WHERE BSNO = '" + bsNo + "'";
else if (this.oplb == "空运进口")
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_airi WHERE BSNO = '" + bsNo + "'";
else if (this.oplb == "空运出口")
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_aire WHERE BSNO = '" + bsNo + "'";
else
sql3 = "SET LANGUAGE 'us_english' SELECT * FROM op_seae WHERE BSNO = '" + bsNo + "'";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
// #endregion
});