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

1506 lines
50 KiB
JavaScript

2 years ago
Ext.namespace('Shipping');
Shipping.MsSeaeOrderAudit = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsSeaeOrderAudit.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsSeaeOrderAudit, Ext.Panel, {
PageSize: 20,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isShowAdvancedQuery: 0, //是否显示高级查询面板
IsAudit: true,
accdate: null,
seaeop: "",
seaecustservice: "",
FORWARDER: "",
reason: "",
sqlcontext:"",
initUIComponents: function () {
this.formname = "formMsSeaeOrderAudit"; //页面名称
this.ORREMARK = '';
this.SaleOrderAuditSelf = 0;
_this = this;
//定义数据集
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnDispModel',
proxy: { url: '/CommMng/BasicDataRef/GetCtnDisp' }
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsSeaeOrderModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsSeaeOrder/GetAuditDataList',
reader: {
id: 'BSNO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#region List列表显示信息
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.initgirdcolums = [{
sortable: true,
dataIndex: 'BSNO',
header: '业务编号',
width: 0
}, {
sortable: true,
dataIndex: 'ORDNO',
header: '订舱编号',
width: 120
},
{
sortable: true,
dataIndex: 'ORSTATUSREF',
header: '状态',
width: 60,
renderer: function (value, meta) {
if (value == '审核通过') {
meta.tdCls = 'feestatus_pass';
} else if (value == '提交审核') {
meta.tdCls = 'feestatus_refer';
} else if (value == '确认订舱') {
meta.tdCls = 'feestatus_settle';
} else if (value == '驳回') {
meta.tdCls = 'feestatus_nopass';
} else if (value == '退舱') {
meta.tdCls = 'feestatus_Del';
}
return value;
}
},
{
sortable: true,
dataIndex: 'SALE',
header: '揽货人',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTSERVICE',
header: '客服员',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 120
},
{
sortable: true,
dataIndex: 'BSDATE',
header: '接单日期',
width: 80
},
{
sortable: true,
dataIndex: 'ETD',
header: '开船日期',
width: 80
},
{
sortable: true,
dataIndex: 'BLTYPE',
header: '装运方式',
width: 60
},
{
sortable: true,
dataIndex: 'STLNAME',
header: '结算方式',
width: 60
},
{
sortable: true,
dataIndex: 'STLDATE',
header: '结算日期',
width: 60
},
{
sortable: true,
dataIndex: 'BLFRT',
header: '付费方式',
width: 60
},
{
sortable: true,
dataIndex: 'CARGOID',
header: '货物标识',
width: 60
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 120
},
{
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 120
},
{
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 80
},
{
sortable: true,
dataIndex: 'KGS',
header: '毛重',
width: 80
},
{
sortable: true,
dataIndex: 'CNTRTOTAL',
header: '集装箱',
width: 80
},
{
sortable: true,
dataIndex: 'INPUTBY',
header: '录入人',
width: 80
},
{
sortable: true,
dataIndex: 'OP',
header: '操作员',
width: 80
},
{
sortable: true,
dataIndex: 'VESSEL',
header: '船名',
width: 100
},
{
sortable: true,
dataIndex: 'VOYNO',
header: '航次',
width: 60
},
{
sortable: true,
dataIndex: 'PORTLOAD',
header: '装货港',
width: 100
},
{
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '卸货港',
width: 100
},
{
sortable: true,
dataIndex: 'CUSTOMSER',
header: '报关行',
width: 80
},
{
sortable: true,
dataIndex: 'KINDPKGS',
header: '件数包装',
width: 60
},
{
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 100
},
{
sortable: true,
dataIndex: 'AGENTID',
header: '国外代理',
width: 100
},
{
sortable: true,
dataIndex: 'AUDITOPERATOR',
header: '审核人',
width: 100
},
{
sortable: true,
dataIndex: 'AUDITDATE',
header: '审核日期',
width: 100
},
{
sortable: true,
dataIndex: 'CONFIRMOP',
header: '确认人',
width: 100
},
{
sortable: true,
dataIndex: 'CONFIRMDATE',
header: '确认日期',
width: 100
},
{
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 100
1 year ago
},
{
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;
}
}];
2 years ago
this.girdcolums = this.initgirdcolums;
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.initgirdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
selModel: this.GridCheckBoxModel,
disableSelection: false,
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var ORSTATUS = record.get('ORSTATUS');
if (ORSTATUS == '4')
return 'feestatus_Del';
}
},
listeners: {
cellclick: function (thisTab, record, item, index, e, eOpts) {
if (index == 10) {//设置按钮列
// alert('用户编号=' + this.getStore().getAt(rowIndex).data.usercode);
}
}
},
columns: this.girdcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
2 years ago
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='SALEORDERAUDITHIDECUST'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
var columnindex = 0;
for (var j = 0; j < this.girdcolums.length; j++) {
if (this.girdcolums[j].dataIndex == 'CUSTOMERNAME') {
columnindex = j;
}
}
this.girdcolums.splice(columnindex, 1);
this.gridList.reconfigure(this.storeList, this.girdcolums);
} else {
}
}
} else {
}
},
scope: this
});
2 years ago
/////////////以下部分为获取存储的gridpanel显示样式
// 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';
DsOpenEditWin('/MvcShipping/MsSeaeOrder/Edit');
}, this);
//#region formSearch 下拉框信息加载
//权限范围
this.StoreOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsOP',
proxy: { url: '/MvcShipping/MsBaseInfo/GetOpRang' }
});
this.StoreOpRange.load({ params: { optype: "modSeaeOrderList"} });
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
//客服
this.comboxCUSTSERVICE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服',
store: this.storeOpCode,
forceSelection: true,
name: 'CUSTSERVICE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//揽货人
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '揽货人',
store: this.storeOpCode,
forceSelection: true,
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//操 作
this.comboxOP = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操 作',
store: this.storeOpCode,
forceSelection: true,
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//录入人
this.comboxINPUTBY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '录入人',
store: this.storeOpCode,
forceSelection: true,
name: 'INPUTBY',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//客户加载_委托单位
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,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//客户加载_船公司
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
// this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
//船公司
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司',
store: this.storeCARRIER,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
//键值维护表_委托单类型
this.StoreBLTYPE = Ext.create('Ext.data.Store', {
fields: ['BLTYPE']
});
this.StoreBLTYPE.add({ "BLTYPE": "整箱" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱主票" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱分票" });
this.StoreBLTYPE.add({ "BLTYPE": "拼箱单票" });
this.comboxBLTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装运方式',
store: this.StoreBLTYPE,
forceSelection: true,
name: 'BLTYPE',
valueField: 'BLTYPE',
displayField: 'BLTYPE'
});
//品名
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '品名',
store: this.storeCodeGoodsList,
forceSelection: true,
name: 'GOODSNAME',
valueField: 'GOODNAME',
displayField: 'CodeAndName'
});
//国际港口(进口装货港、出口卸货港)
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
this.storeCodeDisport.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '装货港',
store: this.storeCodeDisport,
forceSelection: true,
name: 'PORTLOAD',
valueField: 'CNAME',
displayField: 'CodeAndName'
});
//国内港口(出口装货港、进口卸货港)
this.storeCodeLoadport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeLoadportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLoadportList' }
});
this.storeCodeLoadport.load();
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '卸货港',
store: this.storeCodeLoadport,
forceSelection: true,
name: 'PORTDISCHARGE',
valueField: 'CNAME',
displayField: 'CodeAndName'
});
this.StoreStatus = Ext.create('Ext.data.Store', {
fields: ['ID', 'STATUS']
});
this.StoreStatus.add({ "ID": "9", "STATUS": "录入状态" });
this.StoreStatus.add({ "ID": "1", "STATUS": "提交审核" });
this.StoreStatus.add({ "ID": "2", "STATUS": "驳回提交" });
this.StoreStatus.add({ "ID": "8", "STATUS": "确认订舱" });
this.StoreStatus.add({ "ID": "0", "STATUS": "审核通过" });
this.StoreStatus.add({ "ID": "", "STATUS": "全部" });
this.comboxStatus = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreStatus,
fieldLabel: '订舱状态',
forceSelection: true,
name: 'ORSTATUS',
valueField: 'ID',
displayField: 'STATUS'
});
//#endregion
//#region formSearch 查询面板
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxStatus, {
fieldLabel: '订舱编号',
name: 'MblNo'
}, {
fieldLabel: '开船日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDbgn'
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDend'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCustCode, this.comboxOP, this.comboxSALE, this.comboxGOODSNAME]
}]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
//#region formSearch2 隐藏查询面板
this.formSearch2 = Ext.widget('form', {
frame: true,
region: 'north',
bodyPadding: 0,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1, //所占列
labelWidth: 70, //值 能够使 text框也是对齐状态
msgTarget: 'qtip'//文本框显示的必填样式修改这里的值msgTarget:"title" msgTarget:"under" msgTarget:"side"
},
items: [{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCARRIER, {
fieldLabel: '集装箱',
name: 'CNTRTOTAL'
}, this.comboxBLTYPE, {
fieldLabel: '备注',
name: 'REMARK'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxPORTLOAD, this.comboxPORTDISCHARGE, {
fieldLabel: '船名',
name: 'VESSEL'
}, {
fieldLabel: '航次',
name: 'VOYNO'
}]
}]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch2
this.storeUser = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeUser.load({ params: { condition: ""} });
this.comboxSeaeOp = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '操作',
11 months ago
forceSelection: true,
2 years ago
store: this.storeUser,
name: 'OP',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.storeCustService = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeCustService.load({ params: { condition: ""} });
this.comboxSeaeCustService = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客服',
11 months ago
forceSelection: true,
2 years ago
store: this.storeCustService,
name: 'CUSTSERVICE',
valueField: 'UserName',
displayField: 'CodeAndName'
});
//客户加载_订舱代理
this.storeFORWARDER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListFORWARDER' }
});
// this.storeFORWARDER.load({ params: { condition: "ISBOOKING='1'"} });
//船公司
this.comboxFORWARDER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '订舱代理',
store: this.storeFORWARDER,
11 months ago
forceSelection: true,
2 years ago
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'FORWARDER',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.formAudit = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '会计期间',
xtype: 'monthfield',
name: 'ACCDATE'
}, this.comboxSeaeOp
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxSeaeCustService
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxFORWARDER
]
}, {
xtype: 'textareafield',
grow: true,
fieldLabel: '备注',
labelWidth: 0,
height: 90,
name: 'REMARK',
anchor: '100%'
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winAuditShow = 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.formAudit],
buttons: [{
text: "确认接受",
minWidth: 70,
handler: function () {
var form = me.formAudit.getForm();
var ACCDATE = form.findField('ACCDATE').getRawValue();
if (ACCDATE == '' || ACCDATE == null || ACCDATE == undefined) {
Ext.Msg.show({ title: '提示', msg: '会计期间为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
me.accdate = ACCDATE;
var User = me.comboxSeaeOp.getValue();
if (User == '' || User == null || User == undefined) {
Ext.Msg.show({ title: '提示', msg: '操作员为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
me.seaeop = User;
me.seaecustservice = me.comboxSeaeCustService.getValue();
me.FORWARDER = me.comboxFORWARDER.getValue();
me.ORREMARK = form.findField('REMARK').getValue();
me.onAuditPassClick();
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winAuditShow.close();
}
}]
});
this.formAuditBack = Ext.widget('form', {
frame: true,
region: 'center',
title: "<a href='#'><font color='#FF0000'>驳回原因</font></a>",
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: '',
labelSeparator: '',
labelWidth: 0,
height: 100,
name: 'ORREASON',
anchor: '100%'
}
]//end root items
});
me = this;
this.winAuditBackShow = 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.formAuditBack],
buttons: [{
text: "确认驳回",
minWidth: 70,
handler: function () {
var form = me.formAuditBack.getForm();
var ORREASON = form.findField('ORREASON').getRawValue();
if (ORREASON == '' || ORREASON == null || ORREASON == undefined) {
Ext.Msg.show({ title: '提示', msg: '驳回原因为必填!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
me.reason = ORREASON;
me.onAuditBack();
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winAuditBackShow.close();
}
}]
});
//按钮工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}, {
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
},
'-', {
text: "审核通过",
id: 'btnAudit',
iconCls: "btnadd",
handler: function (button, event) {
this.onAccPassClick();
},
scope: this
},
'-',
{
text: "驳回提交",
id: 'btnAuditBack',
iconCls: "btndelete",
handler: function (button, event) {
this.onAuditBackClick();
},
scope: this
}, '-', {
text: "确认订舱",
iconCls: "btnadd",
id: 'btnAuditConfirm',
handler: function (button, event) {
this.onAuditClick();
},
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);
},
scope: this
}, { text: "初始化", //"初始化",
handler: function (menu, event) {
// _this.InitGrid(_this.initgirdcolums);
_this.gridList.reconfigure(_this.storeList, _this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}]
}, '-', {
text: "高级查询面板",
id: "btIsShowAdvancedQuery",
handler: function (button, event) {
this.setIsShowAdvancedQuery(button, event);
},
scope: this
}]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 80,
autoSize: true,
hidden: true,
items: [this.formSearch2]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 100,
items: [this.panelBtn, this.formSearch]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.gridList]
});
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsBaseInfo/GetUserQuerySetting',
params: {
formname: _this.formname
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.success) {
return false;
}
data = result.data;
if (data.ISSAVEVALUE == true) {
_this.formSearch.getForm().reset();
if (data.FIELDVALUES !== "") {
_this.formSearch.getForm().setValues(Ext.JSON.decode(data.FIELDVALUES));
}
}
_this.onRefreshClick();
return true;
} else {
//Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
return false;
}
},
scope: this
});
//this.formSearch.getForm().findField('ORSTATUS').setValue('0');
//this.onRefreshClick();
this.storeList.on('beforeload', function (store) {
var sql = this.sqlcontext;
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
var btnAudit = Ext.getCmp('btnAudit');
var btnAuditBack = Ext.getCmp('btnAuditBack');
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modSaleOrderAudit"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
btnAudit.disable();
} else {
btnAudit.enable();
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modSaleOrderAuditBack"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
btnAuditBack.disable();
} else {
btnAuditBack.enable();
}
} else {
}
},
scope: this
});
var btnAuditConfirm = Ext.getCmp('btnAuditConfirm');
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modSaleOrderConfirm"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
btnAuditConfirm.disable();
} else {
btnAuditConfirm.enable();
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modSaleOrderAuditSelf"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
this.SaleOrderAuditSelf = 0;
} else {
this.SaleOrderAuditSelf = 1;
}
} else {
}
},
scope: this
});
}, //end initUIComponents
onAuditClick: function () {
var form = this.formAudit.getForm();
var VoucherDate = form.findField('ACCDATE');
var thisday = this.getToMonth();
VoucherDate.setRawValue(thisday)
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
return;
}
var record = selections[0];
this.comboxSeaeOp.setValue(record.data.OP);
this.comboxSeaeCustService.setValue(record.data.CUSTSERVICE);
this.comboxFORWARDER.setValue(record.data.FORWARDER);
this.winAuditShow.show();
},
onAuditPassClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择需确认订舱的单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
if (record.data.ORSTATUS != '0') {
Ext.Msg.show({ title: '警告', msg: '当前状态,无法确认订舱,审核通过后才能确认订舱!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
if (this.SaleOrderAuditSelf == 1) {
if (record.data.DEFSALE == '' || record.data.DEFSALE == record.data.SALE || record.data.SALE == SHOWNAME) {
} else {
Ext.Msg.show({ title: '警告', msg: '你仅能接受揽货人和默认揽货人是自己的业务!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
}
_this = this;
Ext.MessageBox.confirm('提示', '确认订舱选中的业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在数据...');
Ext.Ajax.request({
waitMsg: '正在数据...',
url: '/MvcShipping/MsSeaeOrder/AuditOrder',
params: {
data: Ext.JSON.encode(record.data),
accdate: _this.accdate,
op: _this.seaeop,
custservice: _this.seaecustservice,
FORWARDER: _this.FORWARDER,
ORREMARK: _this.ORREMARK
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_this.onRefreshClick();
Ext.Msg.show({ title: '提示', msg: '确认订舱成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
_this.winAuditShow.close()
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
onAuditBackClick: function () {
this.winAuditBackShow.show();
},
onAuditBack: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择需驳回的单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
if (record.data.ORSTATUS != '1' && record.data.ORSTATUS != '0') {
Ext.Msg.show({ title: '警告', msg: '当前状态,不无法驳回!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
_this = this;
Ext.MessageBox.confirm('提示', '确定驳回选中的业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在驳回数据...');
Ext.Ajax.request({
waitMsg: '正在驳回数据...',
url: '/MvcShipping/MsSeaeOrder/AuditBackOrder',
params: {
data: Ext.JSON.encode(record.data),
orreason: _this.reason
},
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: '驳回成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
_this.winAuditBackShow.close();
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
onAccPassClick: function () {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择需审核的单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
if (record.data.ORSTATUS != '1') {
Ext.Msg.show({ title: '警告', msg: '当前状态,不无法审核!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
if (this.SaleOrderAuditSelf == 1) {
if (record.data.DEFSALE == '' || record.data.DEFSALE == record.data.SALE || record.data.SALE == SHOWNAME) {
} else {
Ext.Msg.show({ title: '警告', msg: '你仅能接受揽货人和默认揽货人是自己的业务!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
}
_this = this;
Ext.MessageBox.confirm('提示', '确定审核选中的业务吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在审核数据...');
Ext.Ajax.request({
waitMsg: '正在审核数据...',
url: '/MvcShipping/MsSeaeOrder/AccAudit',
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.reload();
Ext.Msg.show({ title: '提示', msg: '审核成功!', 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);
},
onRefreshClick: function (button, event) {
saveQuerySetting(this.formname, this.formSearch, true, true);
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
getToMonth: function () {
var now = new Date();
var year = now.getFullYear(); //年
var month = now.getMonth() + 1; //月
var clock = year + "-";
if (month < 10)
clock = clock + "0" + month;
else
clock = clock + month;
return (clock);
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
var form2 = this.formSearch2.getForm();
if (!form.isValid() || !form2.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
//隐藏查询面板
this.panelSearch.hide();
this.isShowAdvancedQuery = 0;
//
var sql = '';
//#region formSearch 查询面板
//编号包括(主提单号)
var MblNo = form.findField('MblNo').getValue();
sql = sql + getAndConSql(sql, MblNo, "(ORDNO like '%" + MblNo + "%' )");
//状态
var ORSTATUS = form.findField('ORSTATUS').getValue();
sql = sql + getAndConSql(sql, ORSTATUS, "ORSTATUS='" + ORSTATUS + "'");
//客户名称
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, "CUSTOMERNAME='" + CUSTOMERNAME + "'");
//到港日期
var ETDbgn = form.findField('ETDbgn').getRawValue();
sql = sql + getAndConSql(sql, ETDbgn, "ETD >='" + ETDbgn + "'");
var ETDend = form.findField('ETDend').getRawValue();
sql = sql + getAndConSql(sql, ETDend, "ETD <='" + ETDend + "'");
//操作人
var OP = form.findField('OP').getValue();
sql = sql + getAndConSql(sql, OP, "OP='" + OP + "'");
//揽货人
var SALE = form.findField('SALE').getValue();
sql = sql + getAndConSql(sql, SALE, "SALE='" + SALE + "'");
//牌号
var CNTRTOTAL = form2.findField('CNTRTOTAL').getValue();
sql = sql + getAndConSql(sql, CNTRTOTAL, "CNTRTOTAL like '%" + CNTRTOTAL + "%'");
//装货港
var PORTLOAD = form2.findField('PORTLOAD').getValue();
sql = sql + getAndConSql(sql, PORTLOAD, "PORTLOAD like '%" + PORTLOAD + "%'");
//卸货港
var PORTDISCHARGE = form2.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, "PORTDISCHARGE like '%" + PORTDISCHARGE + "%'");
//船名
var VESSEL = form2.findField('VESSEL').getValue();
sql = sql + getAndConSql(sql, VESSEL, "VESSEL like '%" + VESSEL + "%'");
//航次
var VOYNO = form2.findField('VOYNO').getValue();
sql = sql + getAndConSql(sql, VOYNO, "VOYNO like '%" + VOYNO + "%'");
//船公司
var CARRIER = form2.findField('CARRIER').getValue();
sql = sql + getAndConSql(sql, CARRIER, "CARRIER='" + CARRIER + "'");
//装运方式
var BLTYPE = form2.findField('BLTYPE').getValue();
sql = sql + getAndConSql(sql, BLTYPE, "BLTYPE='" + BLTYPE + "'");
//备注
var REMARK = form2.findField('REMARK').getValue();
sql = sql + getAndConSql(sql, REMARK, "REMARK like '%" + REMARK + "%'");
//#endregion formSearch2
return sql;
},
setIsShowAdvancedQuery: function () {
if (this.isShowAdvancedQuery == 0) {
this.panelSearch.show();
this.isShowAdvancedQuery = 1;
} else {
this.panelSearch.hide();
this.isShowAdvancedQuery = 0;
}
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.IsAudit;
return ret;
}
});