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/TruckMng/Viewsjs/MsWlBs/MsPcEdit_HYRDIndex.js

4236 lines
155 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.MsPcEditIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.MsPcEditIndex.superclass.constructor.call(this);
};
Ext.extend(DsTruck.MsPcEditIndex, Ext.Panel, {
PageSize: 30,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
SelectedstoreList: null,
SelectPGID: '',
fensql: '',
sqlcontext: '',
selections:null,
initUIComponents: function () {
this.formname = "PcHeadEdit_HYRD";
this.fensql = ' 1=2 ';
this.selectstorelist = null;
this.sqlcontext = '';
this.selectbsno = '';
this.notedit = 0;
this.storePLList = Ext.create('Ext.data.Store', {
model: 'MsOpBill'
});
this.selectGid = '';
_thisPcIndex = this;
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: 'ACCDATE', type: 'string' },
{ name: 'RowNumber', type: 'string' },
{ name: 'BillNo', type: 'string' },
{ name: 'ExpDate', type: 'string',},
{ name: 'GroupDate', type: 'string' },
{ name: 'EndPortDate', type: 'string'},
{ name: 'EtDate', type: 'string' },
{ name: 'VoyVeg', type: 'string' },
{ name: 'VoyVegSe', type: 'string' },
{ name: 'ArriveDate', type: 'string' },
{ name: 'ReturnDate', type: 'string'},
{ name: 'CustomerName', type: 'string' },
{ name: 'F_CustomerName', type: 'string' },
{ name: 'DdName', 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: 'OverLoadMil', type: 'string' },
{ name: 'AroundTon', 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: 'RoadFee', type: 'number' },
{ name: 'GoodsName', type: 'string' },
{ name: 'RtnDocStatus', type: 'string' },
{ name: 'RtnDocTime', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'DESTINATION', type: 'string' },
{ name: 'SALECORPID', type: 'string' },
{ name: 'SALECORP', type: 'string' },
{ name: 'DCLASS', type: 'string' },
{ name: 'DUNNO', type: 'string' },
{ name: 'OPSTATUS', type: 'string' },
{ name: 'FEESTATUSREF', type: 'string' },
{ name: 'BSSTATUSREF', type: 'string' },
{ name: 'COLOR', type: 'string' },
{ name: 'FuelPrice', type: 'number' },
{ name: 'FuelQty', type: 'number' },
{ name: 'RealMil', type: 'number' },
{ name: 'RatedMil', type: 'number' },
{ name: 'RatedFuel', type: 'number' },
{ name: 'RealFuel', type: 'number' },
{ name: 'DetiNationSe', type: 'string' },
{ name: 'FactoryAddrSe', type: 'string' },
{ name: 'ContainerNoSe', type: 'string' },
{ name: 'DRFEESTATUS', type: 'string' },
{ name: 'CRFEESTATUS', type: 'string' },
{ name: 'DRDUISTATUS', type: 'string' },
{ name: 'DRINVSTATUS', type: 'string' },
{ name: 'CRDUISTATUS', type: 'string' },
{ name: 'CRINVSTATUS', type: 'string' },
{ name: 'ISSHUISHI', type: 'boolean' },
{ name: 'ISGAOWEN', type: 'boolean' },
{ name: 'ISXIANLIANG', type: 'boolean' },
{ name: 'ISCHECHUAN', type: 'boolean' },
{ name: 'ISHAIWU', type: 'boolean' },
{ name: 'ISFENGXIANG', type: 'boolean' },
{ name: 'ISWEISHENBAO', type: 'boolean' },
{ name: 'ISBAOGUAN', type: 'boolean' },
{ name: 'ISRIZHAO', type: 'boolean' },
{ name: 'ISBOCHUAN', type: 'boolean' },
{ name: 'ISPINGTAI', type: 'boolean' },
{ name: 'FrTruckNo', type: 'string' },
{ name: 'FrDrvName', type: 'string' },
{ name: 'WmsTruckNo', type: 'string' },
{ name: 'WmsDrvName', type: 'string' },
{ name: 'ChangedReson', type: 'string' },
{ name: 'LoadFactory', type: 'string' },
{ name: 'DrvCode', type: 'string' },
{ name: 'EtDateSe', type: 'string' },
{ name: 'ContainerNo', type: 'string' },
{ name: 'SealNo', type: 'string' },
{ name: 'YardCodeSe', type: 'string' },
{ name: 'YardNameSe', type: 'string' },
{ name: 'DstAreaSe', type: 'string' },
{ name: 'SealNoSe', type: 'string' },
{ name: 'ContainerTypeSe', type: 'string' },
{ name: 'ISCANCEL', type: 'string' },
{ name: 'CargoID', 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/GetTruckNoListRm' },
//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 )"} });
this.comboxTruckNo = Ext.create('DsExt.ux.RefTableCombox', {
//fieldLabel: '车牌号',
//multiSelect:true,
queryMode: 'remote',
minChars: 1,
queryParam: 'TruckNo',
store: this.storeTruckNo, //readOnly:true,
queryMode: 'remote',
name: 'TruckNo', id: "TruckNo",
valueField: 'TruckNo',
displayField: 'TruckNo'
});
//客户加载_车队
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.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: 'PS_DRVNAME',
valueField: 'DrvName',
displayField: 'CodeAndName'
,
listeners: {
beforequery: function (e) {
return FilterCombox(e,1); //在beforequery使用此方法
},
scope: this
}
});
this.storeWmsTruckNo = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlTruck',
proxy: { url: '/TruckMng/MsWlPc/GetTruckNoListRm' }
});
this.storeWmsTruckNo.load({ params: { condition: "" } });
this.comboxWmsTruckNo = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeWmsTruckNo,
name: 'WmsTruckNo',
queryMode: 'remote',
minChars: 1,
queryParam: 'TruckNo',
valueField: 'TruckNo',
displayField: 'TruckNo',
matchFieldWidth: true
});
this.storeWmsDrvName = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlDriver',
proxy: { url: '/TruckMng/MsWlPc/GetDrvNameList' }
});
this.storeWmsDrvName.load({ params: { condition: "" } });
this.comboxWmsDrvName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeWmsDrvName,
name: 'WmsDrvName',
valueField: 'DrvName',
displayField: 'DrvName'
,
listeners: {
beforequery: function (e) {
return FilterCombox(e, 1); //在beforequery使用此方法
},
scope: this
}
});
this.storeTruckNo = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlTruck',
proxy: { url: '/TruckMng/MsWlPc/GetTruckNoListRm' }
});
this.storeTruckNo.load({ params: { condition: "" } });
this.comboxTruckNo = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeTruckNo,
name: 'TruckNo',
queryMode: 'remote',
minChars: 1,
queryParam: 'TruckNo',
valueField: 'TruckNo',
displayField: 'TruckNo',
matchFieldWidth: true,
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
// this.formEdit.getForm().findField('F_CustomerName').setValue(records[0].data.OWNER);
}
}
}
});
this.storeFrTruckNo = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlTruck',
proxy: { url: '/TruckMng/MsWlPc/GetTruckNoListRm' }
});
this.storeFrTruckNo.load({ params: { condition: "" } });
this.comboxFrTruckNo = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFrTruckNo,
name: 'FrTruckNo',
queryMode: 'remote',
minChars: 1,
queryParam: 'TruckNo',
valueField: 'TruckNo',
displayField: 'TruckNo',
matchFieldWidth: true,
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
// this.formEdit.getForm().findField('F_CustomerName').setValue(records[0].data.OWNER);
}
}
}
});
this.storeRtnDocStatus2 = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeRtnDocStatus2.add({ "FSTATUS": "无装箱证明", "NAME": "无装箱证明" });
this.storeRtnDocStatus2.add({ "FSTATUS": "无转港", "NAME": "无转港" });
this.storeRtnDocStatus2.add({ "FSTATUS": "已办", "NAME": "已办" });
this.storeRtnDocStatus2.add({ "FSTATUS": "1", "NAME": "1" });
this.storeRtnDocStatus2.add({ "FSTATUS": "缺附件", "NAME": "缺附件" });
this.storeRtnDocStatus2.add({ "FSTATUS": "完结", "NAME": "完结" });
this.comboxRtnDocStatus2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeRtnDocStatus2,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'RtnDocStatus',
enableKeyEvents: true
});
this.storeFrDrvName = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsWlBsHeadRefMsWlDriver',
proxy: { url: '/TruckMng/MsWlPc/GetDrvNameListRm' }
});
this.storeFrDrvName.load({ params: { condition: "" } });
this.comboxFrDrvName = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFrDrvName,
queryMode: 'remote',
minChars: 1,
queryParam: 'DrvName',
name: 'FrDrvName',
valueField: 'DrvName',
displayField: 'DrvName'
,
listeners: {
beforequery: function (e) {
return FilterCombox(e, 1); //在beforequery使用此方法
},
scope: this
}
});
_thisPcIndex = 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/GetHYRDDataList',
//this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL';
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
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) {
_thisPcIndex.onRefreshClick();
}
}
}
});
this.ACCDATEEDIT = Ext.create('Ext.ux.form.MonthField', {
format: 'Y-m',
selectOnFocus: true
});
this.column = [
{
sortable: true, hidden: true,
dataIndex: 'PcBillType',
header: 'PcBillType',
width: 80
},
{
sortable: true,
dataIndex: 'ExpDate',
header: '业务时间',
width: 160,
editor: {
xtype: 'datefield',
format: 'Y-m-d',
selectOnFocus: true
},
renderer: Ext.util.Format.dateRenderer('Y-m-d')
},
{
sortable: true,
dataIndex: 'PcBillTypeREF',
header: '派车类型',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'UserCode',
header: 'UserCode',
width: 80
},
{
sortable: true,
dataIndex: 'BSSTATUSREF',
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,
renderer: function (value) {
if (value == "") {
value="派车单票";
};
if (value == "派车单票" || value == "派车主票") {
return " <a><font> <B>" + value + "</B></font></a>";
} 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,
dataIndex: 'FEESTATUSREF',
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,
id: '',
dataIndex: 'DRDUISTATUS',
header: '应收对账', //'应收对账',
align: 'center',
width: 60,
renderer: function (value, meta, record) {
if (value == '已对账') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分对账') {
meta.tdCls = 'feestatus_refer';
} else if (value == '未对账') {
}
return value;
}
},
{
sortable: true,
id: '',
dataIndex: 'CRDUISTATUS',
header: '应付对账', //'应收对账',
align: 'center',
width: 60,
renderer: function (value, meta, record) {
if (value == '已对账') {
meta.tdCls = 'feestatus_pass';
} else if (value == '部分对账') {
meta.tdCls = 'feestatus_refer';
} else if (value == '未对账') {
}
return value;
}
},
{
sortable: true,
id: '',
dataIndex: 'DRINVSTATUS',
header: '应收开票', //'应收对账',
align: 'center',
width: 60,
renderer: function (value, meta, record) {
//if (value == '已对账') {
// meta.tdCls = 'feestatus_pass';
//} else if (value == '部分对账') {
// meta.tdCls = 'feestatus_refer';
//} else if (value == '未对账') {
//}
return value;
}
},
{
sortable: true,
id: '',
dataIndex: 'CRINVSTATUS',
header: '应付开票', //'应收对账',
align: 'center',
width: 60,
renderer: function (value, meta, record) {
//if (value == '已对账') {
// meta.tdCls = 'feestatus_pass';
//} else if (value == '部分对账') {
// meta.tdCls = 'feestatus_refer';
//} else if (value == '未对账') {
//}
return value;
}
},
{
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,
// dataIndex: 'RowNumber',
// header: '日序号',
// width: 60,
// align: 'center'
//},
{
sortable: true,
dataIndex: 'CUSTNO',
header: '工作号',
width: 160
},
{
sortable: true,
dataIndex: 'MblNoSe',
header: '主提单号',
width: 160,
renderer: function (value, meta) {
meta.tdCls = 'mblno';
btnurl = getGridCopyButton(value);
return btnurl + value;
}
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'CustomerName',
header: '委托单位',
width: 80
// ,
// editor: this.comboxCustomerName
},
{
sortable: true,
dataIndex: 'ACCDATE',
header: '会计期间',
width: 160, //'会计期间',
editor: this.ACCDATEEDIT,
renderer: Ext.util.Format.dateRenderer('Y-m')
},
{
sortable: true,
dataIndex: 'SalesName',
header: '揽货人',
width: 160
},
{
sortable: true,
dataIndex: 'DdName',
header: '客服',
width: 160
},
{
sortable: true,
dataIndex: 'LinkManSe',
header: '单证',
width: 160
},
{
sortable: true,
dataIndex: 'YardName',
header: '场站',
width: 160
},
{
sortable: true,
dataIndex: 'CargoID',
header: '货物标识',
width: 160
},
{
sortable: true,
dataIndex: 'DUNNO',
header: 'UN',
width: 160
},
{
sortable: true,
dataIndex: 'DCLASS',
header: '主危',
width: 160
},
{
sortable: true,
dataIndex: 'YardCodeSe',
header: '副危',
width: 160
},
{
sortable: true,
dataIndex: 'YardNameSe',
header: '闪点',
width: 160
},
{
sortable: true,
dataIndex: 'ISSHUISHI',
header: '怕水湿',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISGAOWEN',
header: '怕高温',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISXIANLIANG',
header: '只限量',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISCHECHUAN',
header: '车船',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISHAIWU',
header: '海污',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISFENGXIANG',
header: '封箱',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISWEISHENBAO',
header: '危申报',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISBAOGUAN',
header: '报关',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISRIZHAO',
header: '日照',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'ISBOCHUAN',
header: '驳船',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'DispatchName',
header: '绑定',
width: 160,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'ISPINGTAI',
header: '平台空箱',
width: 160,
renderer: function (value, meta, record) {
if (value == true || value == '1')
return '√';
else
return '';
}
},
{
sortable: true,
dataIndex: 'BsType',
header: '业务类型',
width: 110
},
{
sortable: true,
dataIndex: 'TruckNo',
header: '空箱车号',
width: 80,
editor: this.comboxTruckNo
},
{
sortable: true,
dataIndex: 'LoadFactory',
header: '工厂名称',
width: 80
},
{
sortable: true,
dataIndex: 'FactoryAddrSe',
header: '工厂地址',
width: 80
},
{
sortable: true,
dataIndex: 'ArriveDate',
header: '到厂日期',
width: 80,
editor: {
xtype: 'datefield',
format: 'Y-m-d',
selectOnFocus: true
},
renderer: Ext.util.Format.dateRenderer('Y-m-d')
},
{
sortable: true,
dataIndex: 'EndPortDate',
header: '预计到港日期',
width: 80,
editor: {
xtype: 'datetimefield',
format: 'Y-m-d H:i:s',
selectOnFocus: true
},
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s')
},
{
sortable: true,
dataIndex: 'EtDate',
header: '预计离港日期',
width: 80,
// ,
// editor: {
// xtype: 'datefield'
// }
},
{
sortable: true,
dataIndex: 'RtnDocStatus',
header: '集港单',
width: 120,
editor: this.comboxRtnDocStatus2
},
{
sortable: true,
dataIndex: 'FrTruckNo',
header: '外点车号',
width: 120,
editor: this.comboxFrTruckNo
},
{
sortable: true,
dataIndex: 'FrDrvName',
header: '外点司机',
width: 120,
editor: this.comboxFrDrvName
},
{
sortable: true,
dataIndex: 'WmsTruckNo',
header: '入库车号',
width: 120,
editor:this.comboxWmsTruckNo
},
{
sortable: true,
dataIndex: 'WmsDrvName',
header: '入库司机',
width: 120,
editor: this.comboxWmsDrvName
},
{
sortable: true,
dataIndex: 'DstAreaSe',
header: '空箱要求',
width: 120,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'DetiNationSe',
header: '派车要求',
width: 120
},
{
sortable: true,
dataIndex: 'ContainerTypeSe',
header: '入库要求',
width: 120,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'ContainerQty',
header: '箱量',
width: 80
},
{
sortable: true,
dataIndex: 'ContainerNo',
header: '箱号',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'SealNo',
header: '封号',
width: 80
},
{
sortable: true,
dataIndex: 'ContainerNoSe',
header: '件重尺',
width: 80
// ,
// editor: {
// xtype: 'numberfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'LoadPlace',
header: '装货地址',
width: 80
},
{
sortable: true,
dataIndex: 'VoyVegSe',
header: '中文船名',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'EtDateSe',
header: '航次',
width: 80,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'VoyVeg',
header: '英文船名',
width: 110,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'ContainerType',
header: '箱型',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'GoodsName',
header: '品名',
width: 80
// ,
// editor: {
// xtype: 'textfield',
// selectOnFocus: true
// }
},
{
sortable: true,
dataIndex: 'ChangedReson',
header: '外点落箱',
width: 80
,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'Remark',
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,
dataIndex: 'UserName',
header: '录入人',
width: 110
},
{
sortable: true,
dataIndex: 'LinkTelSe',
header: '调度备注',
width: 110,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'LoadCount',
header: '入库趟数',
width: 110,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'RtnDocTime',
header: '入库时间',
width: 120,
editor: {
xtype: 'datefield',
format: 'Y-m-d',
selectOnFocus: true
},
renderer: Ext.util.Format.dateRenderer('Y-m-d')
},
{
sortable: true,
dataIndex: 'OverLoadMil',
header: '入库分成',
width: 110,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'Ton',
header: '外点分成',
width: 110,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
},
{
sortable: true,
dataIndex: 'AroundTon',
header: '空箱分成',
width: 110,
editor: {
xtype: 'textfield',
selectOnFocus: true
}
}, {
header: '押运员',
sortable: true,
dataIndex: 'LinkMan',
width: 80
}, {
header: '司机公里',
sortable: true,
dataIndex: 'RatedMil',
width: 80
}, {
header: '规定公里',
sortable: true,
dataIndex: 'RealMil',
width: 80
}, {
header: '标准油耗',
sortable: true,
dataIndex: 'RatedFuel',
width: 80
}, {
header: '实际油耗',
sortable: true,
dataIndex: 'RealFuel',
width: 80
}, {
header: '油价',
sortable: true,
dataIndex: 'FuelPrice',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'RefBillNo',
header: 'RefBillNo',
width: 110
},
{
sortable: true, hidden: true,
dataIndex: 'RefBillNose',
header: 'RefBillNose',
width: 110
},
{
sortable: true,
dataIndex: 'ReturnDate',
header: '空箱时间',
width: 80,
editor: {
xtype: 'datefield',
format: 'Y-m-d',
selectOnFocus: true
},
renderer: Ext.util.Format.dateRenderer('Y-m-d')
}
];
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],
viewConfig: {
enableTextSelection: true,
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var ISCANCEL = record.get('ISCANCEL');
if (ISCANCEL == '1')
return 'feestatus_Del';
var DRDUISTATUS = record.get('DRDUISTATUS');
if (DRDUISTATUS == '已对账')
return 'feestatus_pass';
var OPSTATUS = record.get('OPSTATUS');
if (OPSTATUS == '完结')
return 'feestatus_settle';
}
},
// 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.Pagenum]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
if (this.notedit == 1) return;
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.SelectedstoreList = this.storeList;
this.SelectPGID = '';
DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/HYRDEdit');
}, this);
this.gridList.addListener('itemclick', function (dataview, record, item, index, e, b) {
this.SelectedstoreList = this.storeList;
var ISMASTER = this.formSearch.getForm().findField('ONLYMASTER').getValue();
if (ISMASTER != '1') {
if (record.data.BLTYPE == '派车主票' && this.CheckSaveQuery.checked) {
this.SelectedRecord = record;
var SelectGridtext = Ext.getCmp('SelectCustNo');
SelectGridtext.setText('所选主票:' + record.data.CUSTNO);
this.selectGid = record.data.gId;
this.fensql = " t.PGID='" + record.data.gId + "' AND t.GID<>'" + record.data.gId + "' ";
this.storeListfen.load({
params: { start: 0, limit: this.PageSize, condition: this.fensql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListNofen.load({
params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " },
waitMsg: "正在查询数据...",
scope: this
});
this.paneldetail.setVisible(true);
} else {
this.paneldetail.setVisible(false);
}
}
}, this);
this.cellEditing.on('beforeedit', function (editor, e) {
return this.cellEditingBeforeEdit(editor, e);
}, 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) {
_thisPcIndex.onRefreshClick();
}
}
}
});
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsTruckMng.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' }
});
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户',
typeAhead: true,
store: this.storeCustCode,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'CustName',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.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) {
_thisPcIndex.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) {
_thisPcIndex.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) {
_thisPcIndex.onRefreshClick();
}
}
}
});
this.storeWmsStatus = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeWmsStatus.add({ "FSTATUS": "", "NAME": '全部' });
this.storeWmsStatus.add({ "FSTATUS": "0", "NAME": '否'});
this.storeWmsStatus.add({ "FSTATUS": "1", "NAME": '是'});
this.comboxWmsStatus = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '是否入库',
store: this.storeWmsStatus,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'ISWMS',
flex: 0.5,
labelWidth: 65,
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
});
this.storeCtnStatus = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeCtnStatus.add({ "FSTATUS": "", "NAME": '全部' });
this.storeCtnStatus.add({ "FSTATUS": "0", "NAME": '否' });
this.storeCtnStatus.add({ "FSTATUS": "1", "NAME": '是' });
this.comboxCtnStatus = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '是否空箱',
store: this.storeCtnStatus,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'ISCTN',
flex: 0.5,
labelWidth: 65,
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
});
//人员信息加载
this.storeDdCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.storeDdCode.load();
//客服
this.comboxDdName = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服',
store: this.storeDdCode,
queryMode: 'remote',
//flex: 0.5,
minChars: 0,
queryParam: 'CODENAME',
// flex: 0.5,
forceSelection: true,
name: 'DdName',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
});
//人员信息加载
this.storeDOCCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
});
this.storeDOCCode.load();
//客服
this.comboxDOCName = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '单证',
store: this.storeDOCCode,
queryMode: 'remote',
//flex: 0.5,
minChars: 0,
queryParam: 'CODENAME',
// flex: 0.5,
forceSelection: true,
name: 'LinkManSe',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
});
this.storeOnlyMaster = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeOnlyMaster.add({ "FSTATUS": "", "NAME": "仅显示主单" });
this.storeOnlyMaster.add({ "FSTATUS": "1", "NAME": "全部显示" });
this.storeOnlyMaster.add({ "FSTATUS": "2", "NAME": "仅显示分单" });
this.comboxOnlyMaster = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '主分单显示',
store: this.storeOnlyMaster,
valueField: 'FSTATUS',
displayField: 'NAME',
value: '1',
forceSelection: true,
name: 'ONLYMASTER',
value: '',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.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: '主提单号',
name: 'PS_MBLNO',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
}, {
fieldLabel: '工作号',
name: 'BillNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
}
, this.comboxDrvName
, {
fieldLabel: '车号',
name: 'TruckNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
}, {
fieldLabel: '从到厂日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'Fr_ArriveDate',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
}, {
fieldLabel: '到到厂日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'To_ArriveDate',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
},
{
text: "执行查询",
iconCls: "btnrefresh",
xtype: 'button',
width: 90,
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCustCode, this.comboxDdName
, this.comboxPCSTATUS, {
fieldLabel: '工厂地点',
name: 'FactoryAddrSe',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
}, this.comboxWmsStatus, this.comboxCtnStatus, {
fieldLabel: '箱号',
name: 'CntrNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
},{
//xtype: 'button',
width: 90,
text: "高级查询",
xtype: 'button',
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxDOCName,{
fieldLabel: '从到港日期',
format: 'Y-m-d',
xtype: 'datetimefield',
name: 'PS_EXPDATEBGN',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
}, {
fieldLabel: '到到港日期',
format: 'Y-m-d',
xtype: 'datetimefield',
name: 'PS_EXPDATEEND',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.onRefreshClick();
}
}
}
}, this.comboxTRUCKERQ
//, this.comboxFeeNameRef
, this.comboxPcBillType, this.comboxOnlyMaster,
{
text: "重置条件",
iconCls: "btnreset",
xtype: 'button',
width: 90,
handler: function (button, event) {
var form = this.formSearch.getForm();
form.reset();
},
scope: this
}
]
}
]//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.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: '显示分票', //记忆查询条件
checked: false,
labelWidth: 55,
width: 80
});
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/PcHeadEdit_WFSD/HYRDEdit');
// this.onAddPCClick();
},
scope: this
}, {
text: "复制新建", id: "btnaddcopy", //hidden: true,
iconCls: "btnadd",
handler: 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];
this.SelectedRecord = record;
this.SelectedstoreList = this.storeList;
this.OprationStatus = 'copy';
this.SelectPGID = '';
DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/HYRDEdit');
// this.onAddPCClick();
},
scope: this
}, {
text: "复制新建(含费用)", id: "btnaddcopyfee", //hidden: true,
iconCls: "btnadd",
handler: 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];
this.SelectedRecord = record;
this.SelectedstoreList = this.storeList;
this.OprationStatus = 'copyfee';
this.SelectPGID = '';
DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/HYRDEdit');
// this.onAddPCClick();
},
scope: this
}, {
text: "保存修改", id: "SaveBtn",
iconCls: "btnsave",
handler: function (button, event) {
this.onSaveClick(button, event,0);
},
scope: this
}, {
text: "删除", id: "btndelete", //hidden: true,
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteListClick(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: "批量设置完成", menu: menu1, 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: '复制数据',
tooltip: '复制',
iconCls: "btnadd",
handler: function (button, event) {
this.onCopyClipClick();
},
scope: this
},
// {
// text: "保存修改", id: "SaveBtn",
// iconCls: "btnsave",
// handler: function (button, event) {
// this.onSaveClick(button, event);
// },
// scope: this
// },
'-',
{
text: "业务信息",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onBsViewClick(button, event);
},
scope: this
}, '-', {
text: "打印派车单",
iconCls: "btnprint",
handler: function (button, event) {
this.Print();
},
scope: this
}, '-', {
text: '其他操作', //"拼箱操作",
menu: [
{
text: "批量费用提交", //"批量费用提交",
handler: function (menu, event) {
_thisPcIndex.onPiLiangSubmitClick(menu, event, 1);
}
}, {
text: "业务批量修改", //"业务批量修改",
handler: function (menu, event) {
_thisPcIndex.winModifyShow.show();
}
}, {
text: "费用编辑", //"费用编辑",
handler: function (menu, event) {
_thisPcIndex.onFeeEditClick(menu, event);
}
}, {
text: '完结', //"退舱",
id: "btnOpOver",
menu: [
{
text: '确认完结', //"确认退舱",
handler: function (menu, event) {
_thisPcIndex.UpdateStatus('完结');
}
}, {
text: '取消完结', //"取消退舱",
handler: function (menu, event) {
_thisPcIndex.DeleteStatus('完结');
}
}]
}, {
text: '退单', //"退舱",
id: "btnOpTui",
menu: [
{
text:'确认退单', //"确认退舱",
handler: function (menu, event) {
_thisPcIndex.onCancelShippingOrderClick('1');
}
}, {
text: '取消退单', //"取消退舱",
handler: function (menu, event) {
_thisPcIndex.onCancelShippingOrderClick('0');
}
}]
}],
scope: this
}, this.CheckSaveQuery
// , '-',
// {
// text: "派车通知",
// iconCls: "btnrefresh",
// handler: function (button, event) {
// this.onBsTruckViewClick(button, event);
// },
// scope: this
// }
//,this.CB_EditMode
]
});
//#region 分票列表
this.storeListfen = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'PCmb',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/PcHeadEdit_WFSD/GetDataFenList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.MainCBFen = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
this.cellEditingfen = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.gridListFen = new Ext.grid.GridPanel({
store: this.storeListfen,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.MainCBFen,
viewConfig: {
enableTextSelection: true,
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var ISCANCEL = record.get('ISCANCEL');
if (ISCANCEL == '1')
return 'feestatus_Del';
var DRDUISTATUS = record.get('DRDUISTATUS');
if (DRDUISTATUS == '已对账')
return 'feestatus_pass';
var OPSTATUS = record.get('OPSTATUS');
if (OPSTATUS == '完结')
return 'feestatus_settle';
}
},
// plugins: [this.cellEditingfen],
columns: this.column,
tbar: [{
text: '添加分票',
tooltip: '添加分票',
iconCls: "btnadd",
handler: function (button, event) {
this.SelectedstoreList = this.storeListfen;
this.OprationStatus = 'add';
this.SelectPGID = this.selectGid;
DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/HYRDEdit');
// this.onAddPCClick(button, event, 1);
},
scope: this
},
'-', {
text: '保存分票',
tooltip: '保存分票',
iconCls: "btnsave",
handler: function (button, event) {
this.onSaveClick(button, event, 1);
},
scope: this
}, {
text: "批量复制", //"复制新建",
iconCls: "btnadd",
handler: function (button, event) {
this.PLCopyAdd();
},
scope: this
},
'-', {
text: '删除分票',
tooltip: '删除分票',
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteListClick(button, event, 1);
},
scope: this
}, {
text: '取消分配',
tooltip: '取消分配',
iconCls: "btncancel",
handler: function (button, event) {
this.SetPGID(button, event, 1);
},
scope: this
}, '-', {
text: "打印派车单",
iconCls: "btnprint",
handler: function (button, event) {
this.PrintFen();
},
scope: this
}, '-', {
xtype: 'label',
id: 'SelectCustNo',
text: '所选主票'
}, {
xtype: 'label',
width: 220,
id: 'Selectid',
hidden: true,
text: ''
}],
plugins: [this.cellEditingfen],
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeListfen,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.gridListFen.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.SelectedstoreList = this.storeListfen;
var Selectid = Ext.getCmp('Selectid');
this.SelectPGID =this.selectGid;
DsOpenEditWinAll('/TruckMng/PcHeadEdit_WFSD/HYRDEdit');
// DsOpenEditWin('/TruckMng/PcHeadEdit_WFSD/FeeEdit');
}, this);
this.storeListNofen = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'PCmb',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/TruckMng/PcHeadEdit_WFSD/GetDataList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.MainCBNoFen = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
this.cellEditingnofen = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.gridListNoFen = new Ext.grid.GridPanel({
store: this.storeListNofen,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.MainCBNoFen,
columns: this.column,
tbar: [
{
xtype: 'textfield',
fieldLabel: '工作号',
name: 'BillNo',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_thisPcIndex.storeListNofen.load({
params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) and t.BillNo like '%" + field.value+ "%'" },
waitMsg: "正在查询数据...",
scope: this
});
}
}
}
}
,
{
text: '添加至主票',
tooltip: '添加至主票',
iconCls: "btnadd",
handler: function (button, event) {
this.SetPGID(button, event, 2);
},
scope: this
}],
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeListNofen,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.panelfen = new Ext.Panel({
title: '派车分票',
layout: "border",
region: 'north',
height: 280,
items: [
this.gridListFen
]
});
// this.formSearchnofen = Ext.widget('form', {
// region: 'north',
// bodyPadding: 5,
// height:20,
// 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: [ {xtype: 'textfield',
// fieldLabel: '委托编号',
// name: 'PS_CUSTNO',
// enableKeyEvents: true,
// listeners: {
// specialkey: function (field, e) {
// if (e.getKey() == e.ENTER) {
// _this.storeListNofen.load({
// params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) and t.BillNo like '%"++"%'" },
// waitMsg: "正在查询数据...",
// scope: this
// });
// }
// }
// }
//]
// }
// ]//end items(fieldset 1)
// }//end fieldset 1
// ]//end root items
// });
this.panelnofen = new Ext.Panel({
title: '未分配派车分票',
layout: "border",
region: "center",
items: [
this.gridListNoFen
]
});
this.paneldetail = new Ext.Panel({
layout: "border",
region: 'east',
hidden: true,
split: true, width: 600,
items: [this.panelfen, this.panelnofen]
});
this.panelgrid = new Ext.Panel({
layout: "border",
region: "center",
items: [
this.gridList
]
});
// 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]
});
Ext.apply(this, {
items: [this.panelTop, this.panelgrid, this.paneldetail]
});
///以下集中绑定事件
this.storeList.on('beforeload', function (store) {
var sql = this.sqlcontext;
var ISMASTER = this.formSearch.getForm().findField('ONLYMASTER').getValue();
Ext.apply(store.proxy.extraParams, { condition: sql, ismaster: ISMASTER });
}, this);
this.storeListfen.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: this.fensql });
}, this);
this.storeListNofen.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: " BsType<>'装箱' and t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " });
}, this);
this.gridList.on('edit', function (editor, e, eOpts) {
this.PCAfterEdit(editor, e, eOpts);
}, this);
this.gridListFen.on('edit', function (editor, e, eOpts) {
this.PCAfterEdit(editor, e, eOpts);
}, this);
this.gridListNoFen.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);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: 'modPcHeadEdit_NotEdit'
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success) {
this.notedit = 1;
} else {
}
}
},
scope: this
});
this.LoadInitData();
this.formCopyStrShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 80,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
height: 180,
id: 'COPYSTR',
name: 'COPYSTR',
anchor: '100%'
}
]//end items(fieldset 1)
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.winCopyStrShow = Ext.create('Ext.window.Window', {
title: "复制", //"发送预配舱单",
width: 450,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formCopyStrShow],
buttons: [{
text: "关闭", //"关闭",
minWidth: 70,
handler: function () {
_thisPcIndex.winCopyStrShow.close();
}
}]
});
this.storeRtnDocStatus = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeRtnDocStatus.add({ "FSTATUS": "无装箱证明", "NAME": "无装箱证明" });
this.storeRtnDocStatus.add({ "FSTATUS": "无转港", "NAME": "无转港" });
this.storeRtnDocStatus.add({ "FSTATUS": "已办", "NAME": "已办" });
this.comboxRtnDocStatus = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '集港单', //是否开垫付
store: this.storeRtnDocStatus,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'RtnDocStatus',
enableKeyEvents: true
});
this.storeISCANCEL = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeISCANCEL.add({ "FSTATUS": "", "NAME": '' });
this.storeISCANCEL.add({ "FSTATUS": "0", "NAME": '否' });
this.storeISCANCEL.add({ "FSTATUS": "1", "NAME": '是' });
this.comboxISCANCEL = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '是否封箱',
store: this.storeISCANCEL,
valueField: 'FSTATUS',
displayField: 'NAME',
forceSelection: true,
name: 'ISCANCEL',
value: '',
enableKeyEvents: true
});
this.formModify = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxRtnDocStatus, this.comboxISCANCEL,{
fieldLabel: '英文船名',
name: 'VoyVeg'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '中文船名',
name: 'VoyVegSe'
}, {
fieldLabel: '航次',
name: 'EtDateSe'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '调度备注',
height: 80,
flex: 3,
name: 'LinkTelSe'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
}); //end this.formEdit
me = this;
this.winModifyShow = Ext.create('Ext.window.Window', {
title: "批量修改", //"批量修改",
width: 820,
//height : 120,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formModify],
buttons: [{
text: "确认修改", //"确认修改",
minWidth: 70,
handler: function () {
me.onModifyClick()
}
}, {
text: "关闭", //"关闭",
minWidth: 70,
handler: function () {
me.winModifyShow.close();
}
}]
});
}, //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 = " t.BsType<>'装箱' and (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) AND ISNULL(ISCANCEL,'0')<>'1' and (datediff(month,ExpDate,getdate())=0 or ExpDate is null or ExpDate='1900-01-01 00:00:00.000' ) ";
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onAuditRefuseClick: function (button, event) {
var sql = " BsType<>'装箱' and 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.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListNofen.pageSize = this.PageSize;
this.storeListNofen.load({
params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " },
waitMsg: "正在查询数据...",
scope: this
});
//}
},
onDsQuery: function (button, event) {
var sql = this.sqlcontext;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
this.storeListNofen.pageSize = this.PageSize;
this.storeListNofen.load({
params: { start: 0, limit: this.PageSize, condition: " t.BLTYPE='派车分票' AND (t.GID=t.PGID OR t.PGID='' OR t.PGID IS NULL) and (isend=0 or isend is null) " },
waitMsg: "正在查询数据...",
scope: this
});
//}
},
cellEditingBeforeEdit: function (editor, e) {
var canedit = true;
var BSSTATUSREF = e.record.get('BSSTATUSREF');
if (BSSTATUSREF == '锁定') {
// Ext.Msg.show({ title: '提示', msg: '当前状态不允许修改!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法修改!
canedit = false;
}
return canedit;
},
onModifyClick: function (menu, event) {
var GidStr = '';
var records = this.MainCB.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要修改的业务!
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
if (rec.data.BSSTATUSREF == '锁定') {
Ext.Msg.show({ title: '警告', msg: '已业务锁定不能修改业务', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
} else {
bodyAddDatas.push(rec);
}
}
var data = this.formModify.getForm().getValues();
_thisPcIndex = this;
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有要修改的业务', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在修改业务...',
url: '/TruckMng/PcHeadEdit_WFSD/modify',
params: {
data: jsonbodyAddDatas,
modifydata: Ext.JSON.encode(data)
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_thisPcIndex.onDsQuery();
_thisPcIndex.winModifyShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
onCancelShippingOrderClick: function (type) {
var records = this.MainCB.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要修改的业务!
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
if (rec.data.BSSTATUSREF == '锁定') {
Ext.Msg.show({ title: '警告', msg: '已业务锁定不能修改业务', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
} else {
}
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
}
var cancelstr = "";
if (type == '0') cancelstr = "取消";
Ext.MessageBox.confirm('提示', '确定要' + cancelstr + '退舱吗?', function (btn) {
if (btn == 'yes') {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
//Ext.Msg.wait('正在' + cancelstr + '退舱...');
Ext.Msg.wait('正在操作数据....');
Ext.Ajax.request({
waitMsg: '正在操作数据....',
url: '/TruckMng/PcHeadEdit_WFSD/CancelShippingOrderList',
params: {
data: jsonbodyAddDatas,
type: type
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onDsQuery();
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);
},
UpdateStatus: function (status) {
var records = this.MainCB.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要修改的业务!
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
if (rec.data.BSSTATUSREF == '锁定') {
Ext.Msg.show({ title: '警告', msg: '已业务锁定不能更新业务', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
} else {
}
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
}
Ext.MessageBox.confirm('提示', '确定更新完结吗?', function (btn) {
if (btn == 'yes') {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
//Ext.Msg.wait('正在' + cancelstr + '退舱...');
Ext.Msg.wait('正在操作数据....');
Ext.Ajax.request({
waitMsg: '正在操作数据....',
url: '/TruckMng/PcHeadEdit_WFSD/UpdateStatus',
params: {
data: jsonbodyAddDatas,
status: status
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.reload();
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);
},
DeleteStatus: function (status) {
var records = this.MainCB.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK }); //请先选择要修改的业务!
return;
}
var bodyAddDatas = [];
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
}
Ext.MessageBox.confirm('提示', '确定取消完结吗?', function (btn) {
if (btn == 'yes') {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
//Ext.Msg.wait('正在' + cancelstr + '退舱...');
Ext.Msg.wait('正在操作数据....');
Ext.Ajax.request({
waitMsg: '正在操作数据....',
url: '/TruckMng/PcHeadEdit_WFSD/DeleteStatus',
params: {
data: jsonbodyAddDatas,
status: status
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onDsQuery();
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: function (button, event, type) {
if (type == 1) {
var selections = this.gridListFen.getSelectionModel().getSelection();
} 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];
if (record.data.FEESTATUS == true) {
Ext.Msg.show({ title:'警告', msg:'已费用锁定不允许删除业务!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/TruckMng/PcHeadEdit_WFSD/DeleteHYRD',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (type == 1)
this.storeListfen.remove(record);
else
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
onDeleteListClick: function (button, event, type) {
if (type == 1) {
var selections = this.gridListFen.getSelectionModel().getSelection();
} else
var selections = this.gridList.getSelectionModel().getSelection();
var bodyAddDatas = [];
var icount = 0;
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
var isdelete = true;
if (rec.data.FEESTATUS == true) {
Ext.Msg.show({ title: '警告', msg: '已费用锁定不允许删除业务!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
if (isdelete) {
bodyAddDatas.push(rec);
icount = icount + 1;
}
}
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/TruckMng/PcHeadEdit_WFSD/DeleteListHYRD',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (type == 1)
this.storeListfen.reload();
else
this.storeList.reload();
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);
},
onHuiDanClick: function (button, event, type) {
if (type == 1) {
var selections = this.gridListFen.getSelectionModel().getSelection();
this.selectstorelist = this.storeListfen;
} else {
var selections = this.gridList.getSelectionModel().getSelection();
this.selectstorelist = this.storeList;
}
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.selections = selections;
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m-d H:i:s');
this.formCreateRtnDocStatusShow.getForm().findField('RtnDocTime').setRawValue();
this.winRtnDocStatusShow.show();
}, //onDeleteClick
onHuiDanfn: function (data) {
var bodyAddDatas = [];
var selections =this.selections;
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
bodyAddDatas.push(rec);
}
var jsonBody = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait('正在更新数据...');
Ext.Ajax.request({
waitMsg: '正在更新数据...',
url: '/TruckMng/PcHeadEdit_WFSD/HuiDan',
params: {
data: Ext.JSON.encode(data),
jsonBody: jsonBody
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.selectstorelist.reload();
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
this.winRtnDocStatusShow.close();
}
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
});
},
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 = " BsType<>'装箱' ";
/*
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 TruckNo = form.findField('TruckNo').getValue();
sql = sql + getAndConSql(sql, TruckNo, " (TruckNo like '%" + TruckNo + "%' or WmsTruckNo like '%" + TruckNo + "%' or FrTruckNo like '%" + TruckNo + "%') ");
var drvName = form.findField('PS_DRVNAME').getValue();
sql = sql + getAndConSql(sql, drvName, " (DrvName like '%" + drvName + "%' or DrvCode ='" + drvName + "' or WmsDrvName ='" + drvName + "' or FrDrvName ='" + drvName + "') ");
var DstArea = form.findField('FactoryAddrSe').getValue();
sql = sql + getAndConSql(sql, DstArea, " (FactoryAddrSe like '%" + DstArea + "%' ) ");
var CntrNo = form.findField('CntrNo').getValue();
sql = sql + getAndConSql(sql, CntrNo, " (ContainerNo like '%" + CntrNo + "%' ) ");
// 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 CUSTNO = form.findField('BillNo').getValue();
sql = sql + getAndConSql(sql, CUSTNO, " CUSTNO like '%" + CUSTNO + "%'");
// 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, " EndPortDate>='" + expDate_Min + "'");
var expDate_Max = form.findField('PS_EXPDATEEND').getRawValue();
sql = sql + getAndConSql(sql, expDate_Max, " EndPortDate<='" + expDate_Max + "'");
var Fr_ArriveDate = form.findField('Fr_ArriveDate').getRawValue();
sql = sql + getAndConSql(sql, Fr_ArriveDate, " ArriveDate>='" + Fr_ArriveDate + "'");
var To_ArriveDate = form.findField('To_ArriveDate').getRawValue();
sql = sql + getAndConSql(sql, To_ArriveDate, " ArriveDate<='" + To_ArriveDate + " 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 LinkManSe = form.findField('LinkManSe').getValue();
sql = sql + getAndConSql(sql, LinkManSe, " LinkManSe='" + LinkManSe + "' ");
var DdName = form.findField('DdName').getValue();
sql = sql + getAndConSql(sql, DdName, " DdName='" + DdName + "' ");
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 ONLYMASTER = form.findField('ONLYMASTER').getValue();
if (ONLYMASTER== "") {
var fensql = "";
var ISWMS = form.findField('ISWMS').getValue();
if (ISWMS == '1') {
fensql = " ISNULL(WmsTruckNo,'')<>'' ";
}
if (ISWMS == '0') {
fensql = " ISNULL(WmsTruckNo,'')='' "
}
if (fensql != '') {
sql = sql + getAndConSql(sql, '111', " EXISTS (select 1 from tMsWlPcHead WHERE (t.GID=tMsWlPcHead.GID OR t.PGID=tMsWlPcHead.GID) AND " + fensql + ") ");
}
var ISCTN = form.findField('ISCTN').getValue();
fensql = "";
if (ISCTN == '1') {
fensql = " ISNULL(TruckNo,'')='' ";
}
if (ISCTN == '0') {
fensql = " ISNULL(TruckNo,'')<>'' "
}
if (fensql != '') {
sql = sql + getAndConSql(sql, '111', " EXISTS (select 1 from tMsWlPcHead WHERE (t.GID=tMsWlPcHead.GID OR t.PGID=tMsWlPcHead.GID) AND " + fensql + ") ");
}
} else {
var ISWMS = form.findField('ISWMS').getValue();
if (ISWMS == '1') {
sql = sql + getAndConSql(sql, '111', " ISNULL(WmsTruckNo,'')<>'' ");
}
if (ISWMS == '0') {
sql = sql + getAndConSql(sql, '111', " ISNULL(WmsTruckNo,'')='' ");
}
var ISCTN = form.findField('ISCTN').getValue();
if (ISCTN == '1') {
sql = sql + getAndConSql(sql, '111', " ISNULL(TruckNo,'')='' ");
}
if (ISCTN == '0') {
sql = sql + getAndConSql(sql, '111', " ISNULL(TruckNo,'')<>'' ");
}
}
//if (ISCTN == '0') {
// fensql = fensql + getAndConSql(sql, ISCTN, " ISNULL(TruckNo,'')<>'' ");
//}
//if (ISCTN == '1') {
// fensql = fensql + getAndConSql(sql, ISCTN, " ISNULL(TruckNo,'')='' ");
//}
/*
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;
},
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';
ret[5] = this.storePLList;
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) {
var selectedRecords = this.gridListFen.selModel.getSelection();
var pgid = '';
} else {
var selectedRecords = this.gridListNoFen.selModel.getSelection();
var Selectid = Ext.getCmp('Selectid');
var pgid = Selectid.text;
}
var pgid = this.selectGid;
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.storeListfen.load({
params: { start: 0, limit: this.PageSize, condition: this.fensql },
waitMsg: "正在查询数据...",
scope: this
});
this.onRefreshClick();
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
}); //request over
},
PLCopyAdd: function () {
var selections = this.gridListFen.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请选择要复制的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
this.selectbsno = record.data.gId;
if (this.winPLCopyShow == undefined || this.winPLCopyShow == NaN) {
this.formPLCopyShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 80,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [{
fieldLabel: '复制数量', //'发票号',
//labelWidth: 50,
id: 'COPYNUM',
value: '1',
//flex: 0.5,
name: 'COPYNUM'
}]
}]
});
this.winPLCopyShow = Ext.create('Ext.window.Window', {
width: 420,
height: 160,
//plain : true,
iconCls: "addicon",
resizable: false,
title: '批量复制业务',
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formPLCopyShow],
buttons: [{
text: '确认复制', //"确认生成",
minWidth: 70,
handler: function () {
var COPYNUM = Ext.getCmp('COPYNUM');
var COPYNUM = COPYNUM.getValue();
_thisPcIndex.FnPLCopy(_thisPcIndex.selectbsno, COPYNUM);
_thisPcIndex.winPLCopyShow.close();
}
}, {
text: "关闭", //"关闭",
minWidth: 70,
handler: function () {
_thisPcIndex.winPLCopyShow.close();
}
}]
});
} else {
}
this.winPLCopyShow.show();
},
FnPLCopy: function (BSNO, COPYNUM) {
Ext.Msg.wait('正在处理数据....');
Ext.Ajax.request({
waitMsg: '正在处理数据....',
url: '/TruckMng/PcHeadEdit_WFSD/PLCopy',
params: {
bsno: BSNO,
copynum: COPYNUM
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeListfen.reload();
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
},
onSaveClick: function (button, event, type) {
var bodyList = [];
if (type == 1) {
for (i = 0; i < this.storeListfen.getCount(); i += 1) {
var member = this.storeListfen.getAt(i);
var RtnDocTime = member.data.RtnDocTime;
if (RtnDocTime != '')
RtnDocTime = Ext.util.Format.date(RtnDocTime, 'Y-m-d');
member.data.RtnDocTime = RtnDocTime;
var ArriveDate = member.data.ArriveDate;
if (ArriveDate != '')
ArriveDate = Ext.util.Format.date(ArriveDate, 'Y-m-d');
member.data.ArriveDate = ArriveDate;
var EndPortDate = member.data.EndPortDate;
if (EndPortDate != '')
EndPortDate = Ext.util.Format.date(EndPortDate, 'Y-m-d H:i:s');
member.data.EndPortDate = EndPortDate;
var ReturnDate = member.data.ReturnDate;
if (ReturnDate != '')
ReturnDate = Ext.util.Format.date(ReturnDate, 'Y-m-d');
member.data.ReturnDate = ReturnDate;
var ExpDate = member.data.ExpDate;
if (ExpDate != '')
ExpDate = Ext.util.Format.date(ExpDate, 'Y-m-d');
member.data.ExpDate = ExpDate;
bodyList.push(member);
};
} else {
for (i = 0; i < this.storeList.getCount(); i += 1) {
var member = this.storeList.getAt(i);
var RtnDocTime = member.data.RtnDocTime;
if (RtnDocTime != '')
RtnDocTime = Ext.util.Format.date(RtnDocTime, 'Y-m-d');
member.data.RtnDocTime = RtnDocTime;
var ArriveDate = member.data.ArriveDate;
if (ArriveDate != '')
ArriveDate = Ext.util.Format.date(ArriveDate, 'Y-m-d');
member.data.ArriveDate = ArriveDate;
var EndPortDate = member.data.EndPortDate;
if (EndPortDate != '')
EndPortDate = Ext.util.Format.date(EndPortDate, 'Y-m-d H:i:s');
member.data.EndPortDate = EndPortDate;
var ReturnDate = member.data.ReturnDate;
if (ReturnDate != '')
ReturnDate = Ext.util.Format.date(ReturnDate, 'Y-m-d');
member.data.ReturnDate = ReturnDate;
var ExpDate = member.data.ExpDate;
if (ExpDate != '')
ExpDate = Ext.util.Format.date(ExpDate, 'Y-m-d');
member.data.ExpDate = ExpDate;
bodyList.push(member);
};
}
var jsonBody = ConvertRecordsToJson(bodyList);
if (jsonBody == '') {
return;
}
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/TruckMng/PcHeadEdit_WFSD/SaveHYRDList',
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.storeListfen.load({
params: { start: 0, limit: this.PageSize, condition: this.fensql },
waitMsg: "正在查询数据...",
scope: this
});
} else {
this.storeList.reload();
}
} 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) {
var Selectid = Ext.getCmp('Selectid');
var pgid = Selectid.text;
var record = Ext.create('PCmb', {
'PcBillType': '1',
'PcBillTypeREF': '散货派车单',
'gId': '',
'PGid': pgid,
'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.storeListfen.add(record);
var n = this.storeListfen.getCount();
this.cellEditingfen.startEditByPosition({ row: n - 1, column: 2 });
} 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();
}
}
,
//#region 复制
onCopyClipClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var clipstr = "";
var sError = "";
for (var i = 0; i < selections.length; i++) {
var record = selections[i];
clipstr = clipstr + '\r\n' + " 流水号:" + record.data.BillNo;
clipstr = clipstr + '\r\n' + " 提单号:" + record.data.MblNoSe;
clipstr = clipstr + '\r\n' + " 装货时间:" + record.data.ArriveDate;
clipstr = clipstr + '\r\n' + " 装货地址:" + record.data.LoadPlace;
clipstr = clipstr + '\r\n' + " 箱型箱量:" + record.data.ContainerType;
clipstr = clipstr + '\r\n' + " 货重:" + record.data.Ton;
}
Ext.getCmp('COPYSTR').setValue(clipstr);
this.winCopyStrShow.show();
},
//#endregion
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 ) "} });
}
},
onPiLiangSubmitClick: function (menu, event, type) {
var selectedRecords = this.gridList.selModel.getSelection();
this.storePLList.removeAll();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
var record = Ext.create('MsOpBill', {
'BSNO': rec.data.gId,
'PARENTID': rec.data.gId,
'BSSTATUS': rec.data.BillStatus,
'FEESTATUS': rec.data.FEESTATUS,
'BSSTATUSREF': '未锁定',
'FEESTATUSREF': rec.data.FEESTATUS,
'BSSOURCE': '',
'BSSOURCEDETAIL': '',
'ACCDATE': rec.data.ACCDATE,
'OPLB': 'tMsWlPcHead',
'OPTYPE': '普通货',
'OPLBNAME': '陆运派车单',
'MBLNO': rec.data.MblNo,
'HBLNO': '',
'CUSTNO': rec.data.BillNo,
'CUSTOMERNAME': rec.data.CustomerName,
'ETD': rec.data.ExpDate,
'PORTLOAD': rec.data.LoadPlace,
'PORTDISCHARGE': rec.data.DetiNation
});
this.storePLList.add(record);
}
if (this.storePLList.getCount()==0) {
Ext.Msg.show({ title:'提示', msg:'没有要提交的业务', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
window.open('/Account/Chfee_Audit/PiLiangSubmit', "PILIANGSUBMIT", 'width=1200,height=600,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
}
},
onFeeEditClick: function (menu, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg:'请选择业务', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.SelectedstoreList = this.storeList;
var record = selections[0];
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/TruckMng/PcHeadEdit_WFSD/PiLiangFeeEdit');
},
onExportClick: function (button, event) {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/TruckMng/PcHeadEdit_WFSD/GetHYRDDataListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var sql1 = returnstr;
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
});
}
}
});
},
//#region 打印
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var bsno = "111";
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
bsno = record.data.gId;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/TruckMng/PcHeadEdit_WFSD/GetHYRDDataListStr',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true'
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'tMsWlPcHead';
var sql1 = returnstr;
var sql2 = "SELECT * FROM tMsWlPcHead 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
});
}
}
});
},
//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];
// var bsNo = record.data.RefBillNo;
// if (record.data.RefBillNo == '') {
// //Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
// //return;
// bsNo='111'
// }
// var oplb = record.data.MblNoSe;
// 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);
//},
PrintFen: function () {
var selections = this.gridListFen.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var bsNo = record.data.RefBillNo;
if (record.data.RefBillNo == '') {
//Ext.Msg.show({ title: '警告', msg: '此票无法查看业务信息!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
//return;
bsNo = '111'
}
var oplb = record.data.MblNoSe;
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
});