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.

1085 lines
38 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('Shipping');
Shipping.MsOpSeaePXIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpSeaePXIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpSeaePXIndex, Ext.Panel, {
PageSize: 50,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
isShowAdvancedQuery: 0, //是否显示高级查询面板
IsAudit: false,
BillType: 1,
OrType: 2,
editype: '',
initUIComponents: function () {
this.formname = "formMsOpSeaePXIndex"; //页面名称
//#region 发送拼箱申请单窗口
this.formVGMShow = 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: 'radiogroup',
fieldLabel: '操作类型',
columns: 3,
vertical: true,
id: 'doptype',
items: [
{
boxLabel: '新增',
name: 'optype',
inputValue: '0',
checked: true
}, {
boxLabel: '修改',
name: 'optype',
inputValue: '1',
checked: false
}, {
boxLabel: '删除',
name: 'optype',
inputValue: '2',
checked: false
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winVGMShow = 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.formVGMShow],
buttons: [{
text: "发送",
minWidth: 70,
handler: function () {
var optype = Ext.getCmp('doptype');
var type = optype.getValue();
me.onExportManifest('1', type);
}
}, {
text: "导出",
minWidth: 70,
handler: function () {
var optype = Ext.getCmp('doptype');
var type = optype.getValue();
me.onExportManifest('0', type);
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winVGMShow.close();
}
}]
});
//#endregion
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsSeaePXModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeaePX/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#region List列表显示信息
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 2000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.girdcolums = [{
sortable: true,
id: '',
dataIndex: '',
header: '',
width: 0
}, {
sortable: false,
dataIndex: 'GID',
header: 'GID',
width: 0
}, {
dataIndex: 'MBLNO',
header: '提单号',
width: 120
}, {
sortable: false,
dataIndex: 'GuanQuDaiMa',
header: '关区代码',
width: 60
}, {
sortable: false,
dataIndex: 'CangKuMingCheng',
header: '仓库名称',
width: 120
},
{
sortable: false,
dataIndex: 'ChuanMing',
header: '船名',
width: 100
},
{
sortable: false,
dataIndex: 'HangCi',
header: '航次',
width: 100
}, {
sortable: false,
dataIndex: 'LuRuRiQi',
header: '录入日期',
width: 100
},
{
sortable: false,
dataIndex: 'YeWuLeiXing',
header: '业务类型',
width: 100
},
{
sortable: false,
dataIndex: 'ShenBaoZhuangTai',
header: '申报状态',
width: 100,
renderer: function (value, meta, record) {
var acolor = '#000000';
if (record.data.ShenBaoZhuangTai === '已录入') {
acolor = '#000000';
} else if (record.data.ShenBaoZhuangTai === '已发送') {
acolor = '#00bc12';
} else {
acolor = ' #000000';
}
returnValue = '<b style=' + '"color:' + acolor + '"' + '">' + record.data.ShenBaoZhuangTai + '</b>';
return returnValue;
}
}, {
sortable: false,
dataIndex: 'JianShu',
header: '件数',
width: 100
}, {
sortable: false,
dataIndex: 'MaoZhong',
header: '毛重',
width: 100
}, {
sortable: false,
dataIndex: 'TiJi',
header: '体积',
width: 100
}, {
sortable: false,
dataIndex: 'LuRuRen',
header: '录入人',
width: 100
}, {
sortable: false,
dataIndex: 'SuoShuGongSi',
header: '所属公司',
width: 100
}, {
sortable: false,
dataIndex: 'BeiZhu',
header: '备注',
width: 100
}];
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,
disableSelection: false,
selModel: this.GridCheckBoxModel,
viewConfig: {
enableTextSelection: true
},
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: "没有数据"
}), 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';
var mfno = record.get('GID');
var lno = record.get('MBLNO');
var queryString = "?gid=" + mfno + "&opstatus=edit";
var exTabArr = this.mainTab.items.items;
for (var i = 0; i < exTabArr.length; i++) {
if (exTabArr[i].id == mfno) {
this.mainTab.setActiveTab(mfno);
return;
}
}
this.mainTab.insert(this.mainTab.items.length, {
//title: '新Tab ' + (++index),
title: lno,
id: mfno,
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="/MvcShipping/MsOpSeaePX/Edit' + queryString + '"></iframe>',
// loader: { url:'/MvcShipping/MsOpSeaeEdi/CustomEdit', loadMask: 'loading...', autoLoad: true, scripts: true },
closable: true
});
this.mainTab.setActiveTab(mfno);
//DsOpenEditWin('/MvcShipping/MsOpSeaeEdi/CustomEdit');
//window.open('/MvcShipping/MsOpSubSeaOrder/Edit', "ORDER EDIT", 'width=1200,height=' + (window.screen.availHeight - 55) + ',top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
}, this);
//#endregion
//录入人
this.comboxINPUTBY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '录入人',
store: this.storeOpCode,
forceSelection: true,
name: 'LuRuRen',
valueField: 'UserName',
displayField: 'CodeAndName'
});
this.StoreStatus = Ext.create('Ext.data.Store', {
fields: ['STATUS']
});
this.StoreStatus.add({ "STATUS": "已录入" });
this.StoreStatus.add({ "STATUS": "已发送" });
this.comboxStatus = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreStatus,
fieldLabel: '发送状态',
forceSelection: true,
name: 'FaSongZhuangTai',
valueField: 'STATUS',
displayField: 'STATUS'
});
this.StoreHuiZhiStatus = Ext.create('Ext.data.Store', {
fields: ['STATUS']
});
this.StoreHuiZhiStatus.add({ "STATUS": "全部" });
this.StoreHuiZhiStatus.add({ "STATUS": "船公司已接收" });
this.StoreHuiZhiStatus.add({ "STATUS": "部分接收" });
this.StoreHuiZhiStatus.add({ "STATUS": "暂无状态" });
this.comboxHuiZhiStatus = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreHuiZhiStatus,
fieldLabel: '回执状态',
forceSelection: true,
name: 'HuiZhiZhuangTai',
valueField: 'STATUS',
displayField: 'STATUS'
});
this.StoreSBZT = Ext.create('Ext.data.Store', {
fields: ['STATUS']
});
this.StoreSBZT.add({ "STATUS": "已录入" });
this.StoreSBZT.add({ "STATUS": "已发送" });
this.comboxSBZT = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreSBZT,
fieldLabel: '申报状态',
forceSelection: true,
name: 'ShenBaoZhuangTai',
valueField: 'STATUS',
displayField: 'STATUS'
});
this.StoreChengZhongFangShi = Ext.create('Ext.data.Store', {
fields: ['STATUS']
});
this.StoreChengZhongFangShi.add({ "STATUS": "全部" });
this.StoreChengZhongFangShi.add({ "STATUS": "累加" });
this.StoreChengZhongFangShi.add({ "STATUS": "总重" });
this.comboxChengZhongFangShi = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreChengZhongFangShi,
fieldLabel: '称重方式',
forceSelection: true,
name: 'ChengZhongFangShi',
valueField: 'STATUS',
displayField: 'STATUS'
});
//#region 关区代码
//关区代码
this.StoreGQDM = Ext.create('Ext.data.Store', {
fields: ['value']
});
this.StoreGQDM.add({ "value": "黄岛关区" });
this.comboxGQDM = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '关区代码',
store: this.StoreGQDM,
name: 'GuanQuDaiMa',
valueField: 'value',
displayField: 'value'
});
//#endregion
//#region 仓库名称
this.StoreCKMC = Ext.create('Ext.data.Store', {
fields: ['VALUE']
});
this.StoreCKMC.add({ "VALUE": "中创" });
this.StoreCKMC.add({ "VALUE": "万嘉" });
this.StoreCKMC.add({ "VALUE": "捷运" });
this.StoreCKMC.add({ "VALUE": "邦达" });
this.StoreCKMC.add({ "VALUE": "大亚" });
this.StoreCKMC.add({ "VALUE": "外运" });
this.comboxCKMC = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '仓库名称',
store: this.StoreCKMC,
forceSelection: true,
name: 'CangKuMingCheng',
valueField: 'VALUE',
displayField: 'VALUE'
});
//#endregion
//#region formSearch 查询面板
//船名
this.storeVoyVeg = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.VesselModel',
proxy: { url: '/CommMng/BasicDataRef/GetVesselList' }
});
this.storeVoyVeg.load({ params: { condition: "" } });
this.comboxVoyVeg = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船 名',
store: this.storeVoyVeg,
name: 'ChuanMing',
valueField: 'VESSEL',
flex: 1,
displayField: 'VESSEL'
});
_this = this;
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: [{
fieldLabel: '提单号',
name: 'MBLNO',
listeners: {
change: function (field, newValue, oldValue) {
var str = newValue.replace(/(^\s*)|(\s*$)/g, "");
_this.formSearch.getForm().findField('MblNo').setValue(str);
}
}
}, this.comboxSBZT, this.comboxCKMC, this.comboxVoyVeg, {
fieldLabel: '航次',
name: 'HangCi'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '录入日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'lururiqistart'
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'lururiqiend'
}, {
fieldLabel: '商品名称',
name: 'ShangPinMingCheng'
}, {
fieldLabel: '商品编码',
name: 'ShangPinBianMa'
}, {
fieldLabel: '录入人',
name:'LuRuRen'
}]
}]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
_this = this;
//按钮工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: "新增",
iconCls: "btnadd",
handler: function (button, event) {
this.SelectedRecord = '';
this.OprationStatus = 'add';
var mfno = "*";
var queryString = "?mfno=" + mfno + "&opstatus=add";
this.mainTab.insert(1, {
//title: '新Tab ' + (++index),
title: '新建拼箱',
id: mfno,
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="/MvcShipping/MsOpSeaePX/Edit' + queryString + '"></iframe>',
// loader: { url:'/MvcShipping/MsOpSeaeEdi/CustomEdit', loadMask: 'loading...', autoLoad: true, scripts: true },
closable: true
});
this.mainTab.setActiveTab(mfno);
//DsOpenEditWin('/MvcShipping/MsOpSeaeEdi/CustomEdit');
},
scope: this
}, {
text: "复制新建",
hidden:true,
iconCls: "btnadd",
handler: function (button, event) {
var selectedRecords = this.gridList.getSelectionModel().getSelection();
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.SelectedRecord = selectedRecords[0];
this.OprationStatus = 'copy';
var mfno = this.SelectedRecord.get('MFNO');
var queryString = "?mfno=" + mfno + "&opstatus=copy";
this.mainTab.insert(1, {
title: '新建',
id: mfno,
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="/MvcShipping/MsOpSeaePX/Edit' + queryString + '"></iframe>',
closable: true
});
this.mainTab.setActiveTab(mfno);
//DsOpenEditWin('/MvcShipping/MsOpSeaeEdi/CustomEdit');
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
}, {
text: "发送",
id: "btnZhiFa",
handler: function () {
_this.winVGMShow.show();
}
}, {
text: "导出",
id: "btnDaoChu",
handler: function () {
me.onExportManifest('0');
}
}, '-', {
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, '-', {
text: "保存列表样式",
id: "btntest",
hidden:true,
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.gridList.reconfigure(_this.storeList, _this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
}, '-', {
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}]
});
//#region 生成EDI
this.formEdiShow = 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: [{
xtype: 'radiogroup',
fieldLabel: '文件功能',
id: 'rFILEROLE',
defaults: {
flex: 1
},
layout: 'hbox',
items: [
{
boxLabel: '原始',
name: 'FILEROLE',
inputValue: '9',
checked: true,
id: 'radio3'
}, {
boxLabel: '增加',
name: 'FILEROLE',
inputValue: '2',
id: 'radio4'
}, {
boxLabel: '删除',
name: 'FILEROLE',
inputValue: '3',
id: 'radio5'
}, {
boxLabel: '更新',
name: 'FILEROLE',
inputValue: '4',
id: 'radio6'
}
]
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winEDIShow = Ext.create('Ext.window.Window', {
title: "生成EDI",
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.formEdiShow],
buttons: [{
text: "上传EDI",
minWidth: 70,
handler: function () {
var cgFILEROLE = Ext.getCmp('rFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
me.onSendEDI(me.editype, FILEROLE.FILEROLE);
}
}, {
text: "保存EDI文件",
minWidth: 70,
handler: function () {
var cgFILEROLE = Ext.getCmp('rFILEROLE');
var FILEROLE = cgFILEROLE.getValue();
me.onSaveEDI(me.editype, FILEROLE.FILEROLE);
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winEDIShow.close();
}
}]
});
//#endregion
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 100,
items: [this.panelBtn, this.formSearch]
});
this.panelMainList = new Ext.Panel({
layout: "border",
region: "north",
title: "我的拼箱",
items: [this.panelTop, this.gridList],
listeners: {
'show': function (t, eOpts) {
me.onRefreshClick(null, null);
}
}
});
this.mainTab = new Ext.TabPanel({
id: 'mainTabPanel',
enableTabScroll: true,
closeAll: true,
activeTab: 0,
region: 'center',
resizeTabs: true,
items: [this.panelMainList]
});
Ext.apply(this, {
items: [this.mainTab]
});
this.onRefreshClick();
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql, billtype: this.BillType, ortype: this.OrType });
}, this);
this.formDownloadShow = 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',
id: 'downloadfile',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'label',
html: '',
width: 120,
text: ''
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winDownloadShow = 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.formDownloadShow],
buttons: [{
text: "关闭",
minWidth: 70,
handler: function () {
me.winDownloadShow.close();
}
}]
});
}, //end initUIComponents
onRefreshClick: function (button, event) {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.getCondition();
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.currentPage = 1;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, billtype: this.BillType, ortype: this.OrType },
waitMsg: "正在查询数据...",
scope: this
});
//权限
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOpSeaePX/GetPower',
params: {
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.getCmp('btnZhiFa').disable();
Ext.getCmp('btnDaoChu').disable();
return;
}
data = result.Data;
if (data.split(',')[0] == '1') {
Ext.getCmp('btnZhiFa').show();
} else {
Ext.getCmp('btnZhiFa').hide();
}
if (data.split(',')[1] == '1') {
Ext.getCmp('btnDaoChu').show();
} else {
Ext.getCmp('btnDaoChu').hide();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
onDeleteClick: function (button, event) {
var selectedRecords = this.gridList.getSelectionModel().getSelection();
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bsnos = '';
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.ShenBaoZhuangTai == '已发送' || rec.data.ShenBaoZhuangTai == '已导出') {
Ext.Msg.show({ title: '警告', msg: rec.data.MBLNO + ',此业务' + rec.data.ShenBaoZhuangTai + ',不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
} else {
var bsno = rec.data.GID;
bsnos += "'" + bsno+"',";
}
}
bsnos = bsnos.substring(0, bsnos.length-1);
Ext.MessageBox.confirm('提示', '确定删除选中记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/MsOpSeaePX/DeletePiLiang',
params: {
bsnos: bsnos
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onRefreshClick();
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);
},
onCreateEDIClick: function (type) {
this.editype = type;
this.winEDIShow.show();
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
}, //onDeleteClick
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = "1=1 ";
//#region formSearch 查询面板
//申报状态
var ShenBaoZhuangTai = form.findField('ShenBaoZhuangTai').getRawValue();
sql = sql + getAndConSql(sql, ShenBaoZhuangTai, "p.ShenBaoZhuangTai = '" + ShenBaoZhuangTai + "'");
var INPUTbgn = form.findField('lururiqistart').getRawValue();
sql = sql + getAndConSql(sql, INPUTbgn, "p.LURURIQI>='" + INPUTbgn + " 00:00:00'");
var INPUTend = form.findField('lururiqiend').getRawValue();
sql = sql + getAndConSql(sql, INPUTend, "p.LURURIQI<='" + INPUTend + " 23:59:59'");
//仓库
var CangKuMingCheng = form.findField('CangKuMingCheng').getValue();
sql = sql + getAndConSql(sql, CangKuMingCheng, "p.CangKuMingCheng = '" + CangKuMingCheng + "'");
//船名
var ChuanMing = form.findField('ChuanMing').getValue();
sql = sql + getAndConSql(sql, ChuanMing, "p.ChuanMing = '" + ChuanMing + "'");
//录入人
var LuRuRen = form.findField('LuRuRen').getValue();
sql = sql + getAndConSql(sql, LuRuRen, "p.LuRuRen = '" + LuRuRen + "'");
//提单号
var MblNo = form.findField('MBLNO').getValue();
sql = sql + getAndConSql(sql, MblNo, "p.MBLNO like '%" + MblNo + "%' ");
//航次
var HangCi = form.findField('HangCi').getValue();
sql = sql + getAndConSql(sql, HangCi, "p.HangCi = '" + HangCi + "'");
//商品编码
var ShangPinBianMa = form.findField('ShangPinBianMa').getValue();
sql = sql + getAndConSql(sql, ShangPinBianMa, " p.gid in (select pxid from op_seae_px_details where ShangPinBianMa like '%" + ShangPinBianMa + "%')");
//商品名称
var ShangPinMingCheng = form.findField('ShangPinMingCheng').getValue();
sql = sql + getAndConSql(sql, ShangPinMingCheng, " p.gid in (select pxid from op_seae_px_details where ShangPinMingCheng like '%" + ShangPinMingCheng + "%')");
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;
ret[4] = this.BillType;
ret[5] = this.OrType;
return ret;
},
//#region 导出/直发报文
onExportManifest: function (send,optype) {
var _this = this;
var GIDs = "";
var selectedRecords = this.gridList.getSelectionModel().getSelection();
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.SENDSTATUS == '已发送') {
Ext.Msg.show({ title: '警告', msg: rec.data.MBLNO + ',此业务' + rec.data.EDISTATUS + ',不允许删除!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
} else {
var gid = rec.data.GID;
GIDs += "'" + gid + "',";
}
}
if (GIDs === '') {
Ext.Msg.show({ title: '提示', msg: '没有要操作的业务', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
GIDs = GIDs.substring(0, GIDs.length-1);
Ext.Ajax.request({
waitMsg: '正在操作数据...',
url: '/MvcShipping/MsOpSeaePX/onExportManifest',
params: {
gid: GIDs,
send: send,
optype: optype
},
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 {
if (send=='0') {
this.opStatus == 'edit'
_this.onRefreshClick(null,null);
window.open(result.Data);
return;
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.OK, buttons: Ext.Msg.OK });
return;
}
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
}
//#endregion
});