|
|
Ext.namespace('Shipping');
|
|
|
|
|
|
Shipping.MsOpPriceIndex = function (config) {
|
|
|
Ext.applyIf(this, config);
|
|
|
this.initUIComponents();
|
|
|
window.Shipping.MsOpPriceIndex.superclass.constructor.call(this);
|
|
|
};
|
|
|
|
|
|
Ext.extend(Shipping.MsOpPriceIndex, Ext.Panel, {
|
|
|
PageSize: 30,
|
|
|
OprationStatus: null, //仅当弹出界面时使用
|
|
|
SelectedRecord: null,
|
|
|
sqlcontext: '',
|
|
|
selectbsno: '',
|
|
|
sortfield: '',
|
|
|
sortdire: '',
|
|
|
|
|
|
|
|
|
initUIComponents: function () {
|
|
|
this.formname = "MsOpPriceIndex"; //页面名称
|
|
|
//定义数据集
|
|
|
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'MsOP',
|
|
|
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
|
|
|
});
|
|
|
this.StoreOpRange.load({ params: { optype: "modOpPriceList" } });
|
|
|
|
|
|
this.storeList = Ext.create('Ext.data.Store', {
|
|
|
pageSize: this.PageSize,
|
|
|
model: 'MsOpPrice',
|
|
|
remoteSort: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
url: '/MvcShipping/MsOpPrice/GetDataList',
|
|
|
reader: {
|
|
|
id: 'GID',
|
|
|
root: 'data',
|
|
|
totalProperty: 'totalCount'
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
|
|
|
width: 50
|
|
|
});
|
|
|
|
|
|
_this = this;
|
|
|
|
|
|
this.Pagenum = Ext.create('Ext.form.field.Number', {
|
|
|
name: 'bottles',
|
|
|
fieldLabel: '每页记录数',
|
|
|
labelAlign: 'right',
|
|
|
value: this.PageSize,
|
|
|
maxValue: 100000,
|
|
|
width: 180,
|
|
|
minValue: 0,
|
|
|
listeners: {
|
|
|
specialkey: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.initgirdcolums = [{
|
|
|
sortable: true,
|
|
|
dataIndex: 'GID',
|
|
|
header: '业务编号',
|
|
|
hidden: true,
|
|
|
width: 80
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'BILLSTATUSREF',
|
|
|
header: '报价单状态',
|
|
|
align: 'center',
|
|
|
width: 60
|
|
|
},
|
|
|
{
|
|
|
sortable: true,
|
|
|
dataIndex: 'PRICETYPE',
|
|
|
header: '报价单类型',
|
|
|
align: 'center',
|
|
|
width: 60
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'BILLNO',
|
|
|
header: '报价单号',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CUSTOMERNAME',
|
|
|
header: '委托单位',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SALE',
|
|
|
header: '揽货人',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'ORDNO',
|
|
|
header: '订舱编号',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'PORTLOAD',
|
|
|
header: '装货港',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'PORTDISCHARGE',
|
|
|
header: '卸货港',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CARRIER',
|
|
|
header: '船公司',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'FORWARDER',
|
|
|
header: '供应商',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'VIA',
|
|
|
header: '中转港',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'ETD',
|
|
|
header: '开船日期',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'TT',
|
|
|
header: '航程',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'TTLFREIGHT',
|
|
|
header: '运费总价',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'RMBOT',
|
|
|
header: '国内杂费',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'USDOT',
|
|
|
header: '国外杂费美金',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'OTHEROT',
|
|
|
header: '其他币别杂费',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SELLTTLFREIGHT',
|
|
|
header: '卖价运费总价',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SELLRMBOT',
|
|
|
header: '卖价国内杂费',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SELLUSDOT',
|
|
|
header: '卖价国外杂费美金',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'SELLOTHEROT',
|
|
|
header: '卖价其他币别杂费',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CREATEUSER',
|
|
|
header: '录入人',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'CREATETIME',
|
|
|
header: '录入日期',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'MODIFIEDUSER',
|
|
|
header: '修改人',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'MODIFIEDTIME',
|
|
|
header: '修改日期',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'PQENDDATE',
|
|
|
header: '询价截止时间',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'EFFECTIVEDATE',
|
|
|
header: '生效日期',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'VALIDDATE',
|
|
|
header: '失效日期',
|
|
|
width: 80
|
|
|
}, {
|
|
|
sortable: true,
|
|
|
dataIndex: 'REMARK',
|
|
|
header: '备注',
|
|
|
width: 80
|
|
|
}];
|
|
|
|
|
|
this.girdcolums = this.initgirdcolums;
|
|
|
|
|
|
//定义Grid
|
|
|
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
|
|
|
|
|
|
_this = this;
|
|
|
this.gridList = new Ext.grid.GridPanel({
|
|
|
store: this.storeList,
|
|
|
enableHdMenu: false,
|
|
|
region: 'center',
|
|
|
loadMask: { msg: "数据加载中,请稍等..." },
|
|
|
trackMouseOver: true,
|
|
|
disableSelection: false,
|
|
|
selModel: this.GridCheckBoxModel,
|
|
|
columns: this.girdcolums,
|
|
|
viewConfig: {
|
|
|
enableTextSelection: true, //允许复制数据
|
|
|
autoFill: true,
|
|
|
getRowClass: function (record, rowIndex, rowParams, store) {
|
|
|
var PRICETYPE = record.get('PRICETYPE');
|
|
|
if (PRICETYPE == '报价')
|
|
|
return 'feestatus_pass';
|
|
|
|
|
|
}
|
|
|
},
|
|
|
// paging bar on the bottom
|
|
|
bbar: [Ext.create('Ext.PagingToolbar', {
|
|
|
store: this.storeList,
|
|
|
displayInfo: true,
|
|
|
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
|
|
|
emptyMsg: "没有数据"
|
|
|
}), this.Pagenum]
|
|
|
});
|
|
|
|
|
|
/////////////以下部分为获取存储的gridpanel显示样式
|
|
|
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id,表名,中间column数组,跳过一开始的几列
|
|
|
this.gridList.reconfigure(this.storeList, this.girdcolums);
|
|
|
this.gridList.columns[0] = new Ext.grid.RowNumberer();
|
|
|
////////////////////////////
|
|
|
|
|
|
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
|
|
|
this.SelectedRecord = record;
|
|
|
this.OprationStatus = 'edit';
|
|
|
if (record.data.PRICETYPE =='报价')
|
|
|
DsOpenEditWin('/MvcShipping/MsOpPrice/SellEdit', record.data.BILLNO);
|
|
|
else
|
|
|
DsOpenEditWin('/MvcShipping/MsOpPrice/Edit', record.data.BILLNO);
|
|
|
}, this);
|
|
|
|
|
|
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
|
|
|
this.sortfield = column.dataIndex;
|
|
|
this.sortdire = direction;
|
|
|
}, this);
|
|
|
|
|
|
//#region formSearch 查询条件
|
|
|
|
|
|
_this = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//人员信息加载
|
|
|
this.storeSaleCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
|
|
|
});
|
|
|
this.storeSaleCode.load();
|
|
|
//操 作
|
|
|
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '揽货人',
|
|
|
store: this.storeSaleCode,
|
|
|
forceSelection: true,
|
|
|
name: 'SALE',
|
|
|
queryMode: 'remote',
|
|
|
//flex: 0.5,
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
valueField: 'UserName',
|
|
|
displayField: 'CodeAndName',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//客户加载_委托单位
|
|
|
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' }
|
|
|
});
|
|
|
// this.storeCustCode.load({ params: { condition: "ISCONTROLLER='1'"} });
|
|
|
//委托单位
|
|
|
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '委托单位',
|
|
|
store: this.storeCustCode,
|
|
|
forceSelection: true,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 1,
|
|
|
queryParam: 'CODENAME',
|
|
|
name: 'CUSTOMERNAME',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
//specialkey: function (field, e) {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//客户加载_船公司
|
|
|
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
|
|
|
});
|
|
|
|
|
|
//船公司
|
|
|
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '船公司', //'船公司',
|
|
|
store: this.storeCARRIER,
|
|
|
//forceSelection: true,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
name: 'CARRIER',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
//specialkey: function (field, e) {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//客户加载_订舱代理
|
|
|
this.storeFORWARDER = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CustomRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListFORWARDER' }
|
|
|
});
|
|
|
//船公司
|
|
|
this.comboxFORWARDER = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '供应商', //'订舱代理',
|
|
|
store: this.storeFORWARDER,
|
|
|
forceSelection: true,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 0,
|
|
|
queryParam: 'CODENAME',
|
|
|
name: 'FORWARDER',
|
|
|
valueField: 'CustName',
|
|
|
displayField: 'CodeAndName',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
//specialkey: function (field, e) {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.CodeLoadportModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportListRm' }
|
|
|
});
|
|
|
this.storeCodeLoadport.load();
|
|
|
|
|
|
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '装货港',
|
|
|
store: this.storeCodeLoadport,
|
|
|
queryMode: 'remote',
|
|
|
minChars: 2,
|
|
|
queryParam: 'PORT',
|
|
|
name: 'PORTLOAD',
|
|
|
valueField: 'PORT',
|
|
|
displayField: 'CodeAndName',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
//specialkey: function (field, e) {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '卸货港',
|
|
|
store: this.storeCodeDisport,
|
|
|
name: 'PORTDISCHARGE',
|
|
|
valueField: 'PORT',
|
|
|
queryMode: 'remote',
|
|
|
matchFieldWidth: false,
|
|
|
minChars: 1,
|
|
|
queryParam: 'PORT',
|
|
|
displayField: 'CodeAndName',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
//specialkey: function (field, e) {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//人员信息加载
|
|
|
this.storeINPUTBYCode = Ext.create('DsExt.ux.RefTableStore', {
|
|
|
model: 'DsShipping.ux.UserRefModel',
|
|
|
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefListRm' }
|
|
|
});
|
|
|
this.storeINPUTBYCode.load();
|
|
|
|
|
|
this.comboxINPUTBY = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel:'录入人', //'录入人',
|
|
|
store: this.storeINPUTBYCode,
|
|
|
forceSelection: true,
|
|
|
name: 'CREATEUSER',
|
|
|
valueField: 'GID',
|
|
|
displayField: 'CodeAndName',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
this.storeAddDCType = Ext.create('Ext.data.Store', {
|
|
|
fields: ['DC', 'NAME']
|
|
|
});
|
|
|
this.storeAddDCType.add({ "DC": "0", "NAME":'审核通过'});
|
|
|
this.storeAddDCType.add({ "DC": "1", "NAME": '未提交'});
|
|
|
this.storeAddDCType.add({ "DC": "2", "NAME": '已提交' });
|
|
|
this.storeAddDCType.add({ "DC": "", "NAME": '全部' });
|
|
|
|
|
|
this.comboxaddDCType = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
fieldLabel: '报价单状态',
|
|
|
store: this.storeAddDCType,
|
|
|
valueField: 'DC',
|
|
|
displayField: 'NAME',
|
|
|
forceSelection: true,
|
|
|
name: 'BILLSTATUS',
|
|
|
value: '1',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
this.formSearch = Ext.widget('form', {
|
|
|
frame: true,
|
|
|
region: 'center',
|
|
|
bodyPadding: 5,
|
|
|
fieldDefaults: {
|
|
|
margins: '2 2 2 2',
|
|
|
labelAlign: 'right',
|
|
|
flex: 1,
|
|
|
labelWidth: 90,
|
|
|
msgTarget: 'qtip'
|
|
|
},
|
|
|
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
defaultType: 'textfield',
|
|
|
layout: 'anchor',
|
|
|
defaults: {
|
|
|
anchor: '100%'
|
|
|
},
|
|
|
items: [{
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [{
|
|
|
fieldLabel: '报价单号',
|
|
|
name: 'BILLNO',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, this.comboxFORWARDER, this.comboxCustCode, {
|
|
|
fieldLabel: '订舱编号',
|
|
|
name: 'ORDNO',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, this.comboxSALE, this.comboxCARRIER, {
|
|
|
xtype: 'button',
|
|
|
width: 90,
|
|
|
text: "查询",
|
|
|
iconCls: "btnrefresh",
|
|
|
handler: function (button, event) {
|
|
|
this.onRefreshClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}]
|
|
|
}, {
|
|
|
xtype: 'container',
|
|
|
layout: 'hbox',
|
|
|
defaultType: 'textfield',
|
|
|
items: [this.comboxaddDCType,this.comboxPORTLOAD, this.comboxPORTDISCHARGE,{
|
|
|
fieldLabel: '从录入日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETDBgn',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
fieldLabel: '到录入日期',
|
|
|
format: 'Y-m-d',
|
|
|
xtype: 'datefield',
|
|
|
name: 'ETDEnd',
|
|
|
enableKeyEvents: true,
|
|
|
listeners: {
|
|
|
keyup: function (field, e) {
|
|
|
if (e.getKey() == e.ENTER) {
|
|
|
_this.onRefreshClick();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}, this.comboxINPUTBY, {
|
|
|
xtype: 'button',
|
|
|
width: 90,
|
|
|
text: "更多",
|
|
|
iconCls: "btnmore",
|
|
|
handler: function (button, event) {
|
|
|
var sql = this.getCondition();
|
|
|
var winAccess = new Shipping.DsQuery({
|
|
|
|
|
|
});
|
|
|
winAccess.StoreList = this.storeList;
|
|
|
winAccess.formname = this.formname;
|
|
|
winAccess.condition = sql;
|
|
|
winAccess.show();
|
|
|
return;
|
|
|
|
|
|
|
|
|
},
|
|
|
scope: this
|
|
|
}]
|
|
|
}]
|
|
|
}]
|
|
|
});
|
|
|
//#endregion formSearch
|
|
|
|
|
|
//查询工具条
|
|
|
this.panelBtn = new Ext.Panel({
|
|
|
region: "north",
|
|
|
tbar: [{
|
|
|
text: "新建",
|
|
|
iconCls: "btnadd",
|
|
|
handler: function (button, event) {
|
|
|
this.OprationStatus = 'add';
|
|
|
DsOpenEditWin('/MvcShipping/MsOpPrice/Edit');
|
|
|
},
|
|
|
scope: this
|
|
|
}, {
|
|
|
text: "删除",
|
|
|
iconCls: "btndelete",
|
|
|
handler: function (button, event) {
|
|
|
this.onDeleteClick(button, event);
|
|
|
},
|
|
|
scope: this
|
|
|
}, '-', {
|
|
|
text: "保存列表样式",
|
|
|
id: "btntest",
|
|
|
menu: [
|
|
|
{ text: "保存",
|
|
|
handler: function (button, event) {
|
|
|
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
|
|
|
}
|
|
|
}, { text: "初始化",
|
|
|
handler: function (menu, event) {
|
|
|
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
|
|
|
}
|
|
|
}],
|
|
|
scope: this
|
|
|
}, '-',
|
|
|
{
|
|
|
text: "打印",
|
|
|
iconCls: 'btnprint',
|
|
|
menu: [
|
|
|
{ text: "全部",
|
|
|
handler: function (menu, event) {
|
|
|
_this.Print();
|
|
|
}
|
|
|
}, { text: "选择打印",
|
|
|
handler: function (menu, event) {
|
|
|
_this.PrintSelect();
|
|
|
}
|
|
|
}],
|
|
|
|
|
|
scope: this
|
|
|
}, '-' ,{
|
|
|
text:'导出EXCEL', //"EXCEL模板导出",
|
|
|
iconCls: "btnexportexcel",
|
|
|
handler: function (button, event) {
|
|
|
this.onExportClick(button, event);
|
|
|
|
|
|
},
|
|
|
scope: this
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.panelTop = new Ext.Panel({
|
|
|
layout: "border",
|
|
|
region: "north",
|
|
|
height: 95,
|
|
|
items: [this.formSearch, this.panelBtn]
|
|
|
});
|
|
|
|
|
|
Ext.apply(this, {
|
|
|
items: [this.panelTop, this.gridList]
|
|
|
});
|
|
|
var myDate = new Date();
|
|
|
var mydatestr = Ext.util.Format.date(myDate, 'Y-m');
|
|
|
this.sqlcontext = " b.BILLSTATUS<>0";
|
|
|
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
this.storeList.on('beforeload', function (store) {
|
|
|
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
|
|
|
}, this);
|
|
|
|
|
|
|
|
|
//#region 批量修改窗体
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
}, //end initUIComponents
|
|
|
|
|
|
InitGrid: function (grid) {
|
|
|
//var agirdcolums = Ext.clone(this.gridList.columns);
|
|
|
var agirdcolums = grid;
|
|
|
|
|
|
this.storecodeservice.load({ params: { condition: "OPTYPE='7'" },
|
|
|
callback: function (r, options, success) {
|
|
|
if (success) {
|
|
|
if (r.length != 0) {
|
|
|
for (i = 0; i < this.storecodeservice.getCount(); i += 1) {
|
|
|
var itemindex = i + 1;
|
|
|
var memberyf = this.storecodeservice.getAt(i);
|
|
|
for (var j = 0; j < agirdcolums.length; j++) {
|
|
|
if ((agirdcolums[j].dataIndex == 'Is' + memberyf.data.OPField) || (agirdcolums[j].dataIndex ==memberyf.data.OPField)) {
|
|
|
agirdcolums[j].header = memberyf.data.SERVICENAME;
|
|
|
// agirdcolums[j].hidden = false;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
}
|
|
|
this.gridList.reconfigure(this.storeList, agirdcolums);
|
|
|
}
|
|
|
},
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
// this.gridList.reconfigure(this.storeList, agirdcolums);
|
|
|
},
|
|
|
|
|
|
|
|
|
onRefreshClick: function (button, event) {
|
|
|
var sql = this.getCondition();
|
|
|
this.sqlcontext = sql;
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
|
|
|
this.storeList.pageSize = this.PageSize;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
onDsQuery: function () {
|
|
|
//var girdcolums = this.gridList.getColumnMode();
|
|
|
var sql = this.sqlcontext;
|
|
|
this.PageSize = this.Pagenum.getValue();
|
|
|
|
|
|
this.storeList.pageSize = this.PageSize;
|
|
|
this.storeList.load({
|
|
|
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
|
|
|
waitMsg: "正在查询数据...",
|
|
|
scope: this
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
onDeleteClick: function (button, event) {
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
var record = selections[0];
|
|
|
if (record.data.BILLSTATUS == '0') {
|
|
|
Ext.Msg.show({ title: '警告', msg: '业务已审核通过,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (this.StoreOpRange.getCount() == 0) {
|
|
|
Ext.Msg.show({ title: '警告', msg: '权限不足,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
} else {
|
|
|
var op = record.data.CREATEUSER;
|
|
|
|
|
|
var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', op);
|
|
|
if (records.getCount() > 0) {
|
|
|
} else {
|
|
|
canedit = false;
|
|
|
Ext.Msg.show({ title: '警告', msg: '权限不足,不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
//
|
|
|
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
|
|
|
if (btn == 'yes') {
|
|
|
Ext.Msg.wait('正在删除数据...');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在删除数据...',
|
|
|
url: '/MvcShipping/MsOpPrice/Delete',
|
|
|
params: {
|
|
|
data: Ext.JSON.encode(record.data)
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
this.storeList.remove(record);
|
|
|
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
else {
|
|
|
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
failure: function (response, options) {
|
|
|
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
},
|
|
|
success: function (response, options) {
|
|
|
},
|
|
|
scope: this
|
|
|
}); //end Ext.Ajax.request
|
|
|
}
|
|
|
}, this);
|
|
|
},
|
|
|
|
|
|
onClearSql: function () {
|
|
|
var form = this.formSearch.getForm();
|
|
|
form.reset();
|
|
|
}, //onDeleteClick
|
|
|
|
|
|
onUpOpStatusClick: function (menu, event, type) {
|
|
|
|
|
|
var selections = this.GridCheckBoxModel.selected.items;
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
var BSNOStr = '';
|
|
|
for (var i = 0; i < selections.length; i++) {
|
|
|
var rec = selections[i];
|
|
|
var BSNO = "'" + rec.data.BSNO + "'";
|
|
|
if (BSNOStr == '')
|
|
|
BSNOStr = BSNO;
|
|
|
else {
|
|
|
|
|
|
BSNOStr = BSNOStr + ',' + BSNO;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (BSNOStr == '') {
|
|
|
Ext.Msg.show({ title: '提示', msg: '没有要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.selectbsno = " BSNO IN (" + BSNOStr + ")";
|
|
|
|
|
|
window.open('/MvcShipping/MsOpStatus/PiLiang', "PILIANGOPSTATUS", 'width=1200,height=600,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
onPiLiangSubmitClick: function (menu, event, type) {
|
|
|
|
|
|
var selections = this.GridCheckBoxModel.selected.items;
|
|
|
if (selections.length == 0) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
var BSNOStr = '';
|
|
|
for (var i = 0; i < selections.length; i++) {
|
|
|
var rec = selections[i];
|
|
|
var BSNO = "'" + rec.data.BSNO + "'";
|
|
|
if (BSNOStr == '')
|
|
|
BSNOStr = BSNO;
|
|
|
else {
|
|
|
|
|
|
BSNOStr = BSNOStr + ',' + BSNO;
|
|
|
}
|
|
|
}
|
|
|
this.storePLList.removeAll();
|
|
|
for (var i = 0; i < selections.length; i++) {
|
|
|
var rec = selections[i];
|
|
|
this.storePLList.add(rec.data);
|
|
|
}
|
|
|
|
|
|
|
|
|
if (BSNOStr == '') {
|
|
|
Ext.Msg.show({ title: '提示', msg: '没有要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.selectbsno = " BSNO IN (" + BSNOStr + ")";
|
|
|
|
|
|
window.open('/Account/Chfee_Audit/PiLiangSubmit', "PILIANGSUBMIT", 'width=1200,height=600,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
getCondition: function () {
|
|
|
var form = this.formSearch.getForm();
|
|
|
if (!form.isValid()) {
|
|
|
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
var sql = '';
|
|
|
|
|
|
var BILLNO = form.findField('BILLNO').getValue();
|
|
|
BILLNO = BILLNO.trim();
|
|
|
|
|
|
sql = sql + getAndConSql(sql, BILLNO, "BILLNO like '%" + BILLNO + "%'");
|
|
|
|
|
|
|
|
|
|
|
|
var BILLSTATUS = form.findField('BILLSTATUS').getValue();
|
|
|
sql = sql + getAndConSql(sql, BILLSTATUS, "BILLSTATUS= " + BILLSTATUS);
|
|
|
|
|
|
|
|
|
var ORDNO = form.findField('ORDNO').getValue();
|
|
|
sql = sql + getAndConSql(sql, ORDNO, "ORDNO like '%" + ORDNO + "%'");
|
|
|
|
|
|
|
|
|
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
|
|
|
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
|
|
|
|
|
|
var FORWARDER = form.findField('FORWARDER').getValue();
|
|
|
sql = sql + getAndConSql(sql, FORWARDER, "FORWARDER= '" + FORWARDER + "'");
|
|
|
|
|
|
|
|
|
var SALE = form.findField('SALE').getValue();
|
|
|
sql = sql + getAndConSql(sql, SALE, "SALE= '" + SALE + "'");
|
|
|
|
|
|
var CREATEUSER = form.findField('CREATEUSER').getValue();
|
|
|
sql = sql + getAndConSql(sql, CREATEUSER, "CREATEUSER= '" + CREATEUSER + "'");
|
|
|
|
|
|
var CARRIER = form.findField('CARRIER').getValue();
|
|
|
sql = sql + getAndConSql(sql, CARRIER, "CARRIER= '" + CARRIER + "'");
|
|
|
|
|
|
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
|
|
|
sql = sql + getAndConSql(sql, PORTDISCHARGE, "PORTDISCHARGE= '" + PORTDISCHARGE + "'");
|
|
|
|
|
|
var ETDBgn = form.findField('ETDBgn').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, ETDBgn, "CONVERT(char(10), CREATETIME, 20) >='" + ETDBgn + "'");
|
|
|
var ETDEnd = form.findField('ETDEnd').getRawValue();
|
|
|
sql = sql + getAndConSql(sql, ETDEnd, "CONVERT(char(10), CREATETIME, 20) <='" + ETDEnd + "'");
|
|
|
|
|
|
|
|
|
|
|
|
return sql;
|
|
|
},
|
|
|
OprationSwap: function () {
|
|
|
var ret = new Array();
|
|
|
ret[0] = this.OprationStatus;
|
|
|
ret[1] = this.storeList;
|
|
|
ret[2] = this.SelectedRecord;
|
|
|
ret[3] = this.selectbsno;
|
|
|
ret[4] = 'op_other';
|
|
|
ret[5] = this.storePLList;
|
|
|
return ret;
|
|
|
},
|
|
|
|
|
|
onExportClick: function () {
|
|
|
|
|
|
_this = this;
|
|
|
if (this.storeList.getCount() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Ext.Msg.wait('正在组织数据, 请稍侯..');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在组织数据...',
|
|
|
url: '/MvcShipping/MsOpPrice/GetDataListStr',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
condition: _this.sqlcontext,
|
|
|
printstr: 'true'
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
Ext.MessageBox.hide();
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
var returnstr = jsonresult.data;
|
|
|
var printType = 'MSOPPRICELIST';
|
|
|
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
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
Print: function () {
|
|
|
|
|
|
_this = this;
|
|
|
if (this.storeList.getCount() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Ext.Msg.wait('正在组织数据, 请稍侯..');
|
|
|
Ext.Ajax.request({
|
|
|
waitMsg: '正在组织数据...',
|
|
|
url: '/MvcShipping/MsOpPrice/GetDataListStr',
|
|
|
scope: this,
|
|
|
params: {
|
|
|
condition: _this.sqlcontext,
|
|
|
printstr: 'true'
|
|
|
},
|
|
|
callback: function (options, success, response) {
|
|
|
if (success) {
|
|
|
Ext.MessageBox.hide();
|
|
|
var jsonresult = Ext.JSON.decode(response.responseText);
|
|
|
if (jsonresult.Success) {
|
|
|
var returnstr = jsonresult.data;
|
|
|
var printType = 'MSOPPRICELIST';
|
|
|
var sql1 = returnstr;
|
|
|
var sql2 = "";
|
|
|
var sql3 = "";
|
|
|
var sql4 = "";
|
|
|
var sql5 = "";
|
|
|
var sql6 = "";
|
|
|
|
|
|
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
|
|
|
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
|
|
|
}
|
|
|
} else {
|
|
|
Ext.Msg.show({ title: '请重试',
|
|
|
msg: '服务器响应出错',
|
|
|
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
|
|
|
PrintSelect: function () {
|
|
|
|
|
|
_this = this;
|
|
|
if (this.storeList.getCount() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
var selectedRecords = [];
|
|
|
var storeadd = null;
|
|
|
selectedRecords = this.GridCheckBoxModel.selected.items;
|
|
|
|
|
|
|
|
|
if (selectedRecords.length == 0) {
|
|
|
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var sortstr = '';
|
|
|
|
|
|
if (this.sortfield != '' && this.sortdire != '') {
|
|
|
|
|
|
sortstr = this.sortfield + ' ' + this.sortdire;
|
|
|
}
|
|
|
|
|
|
if (sortstr == "") sortstr = "CREATETIME desc"
|
|
|
|
|
|
var feeGidSql = '';
|
|
|
for (var i = 0; i < selectedRecords.length; i++) {
|
|
|
var record = selectedRecords[i];
|
|
|
var feeGId = "'" + record.get('GID') + "'";
|
|
|
if (feeGidSql == '') {
|
|
|
feeGidSql = feeGId;
|
|
|
} else {
|
|
|
feeGidSql = feeGidSql + "," + feeGId;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
var bsno = '11111';
|
|
|
var selections = this.gridList.getSelectionModel().getSelection();
|
|
|
if (selections.length != 0) {
|
|
|
var record = selections[0];
|
|
|
bsno = record.data.GID;
|
|
|
}
|
|
|
|
|
|
var printType = 'MSOPPRICELISTSELECT';
|
|
|
var sql1 = "select * from op_price WHERE GID IN (" + feeGidSql + ") order by " + sortstr;
|
|
|
var sql2 = "";
|
|
|
var sql3 = "";
|
|
|
var sql4 = "";
|
|
|
var sql5 = "";
|
|
|
var sql6 = "";
|
|
|
|
|
|
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|