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/Import/Viewsjs/CWLock/_XXHIndex.js

1091 lines
36 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');
var C_contractno = ""; //用于存储当前选定的合同号/ch_fee.id
DsTruck.XXHIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.DsTruck.XXHIndex.superclass.constructor.call(this);
};
Ext.extend(DsTruck.XXHIndex, Ext.Panel, {
PageSize: 500,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
remind: null,
initUIComponents: function () {
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'XXHmb',
remoteSort: false,
pageSize: this.PageSize,
proxy: {
type: 'ajax',
url: '/Import/XXH/GetDataList',
reader: {
idProperty: 'id' + 'cgid',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.formname = "CWLock";
//枚举参照
var Locked = [
{ "id": '0', "name": "未锁" },
{ "id": '1', "name": "已锁定"}];
this.StoreLocked = Ext.create('Ext.data.Store', {
model: 'CMBmb',
data: Locked
});
this.comboxLocked = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '是否财务锁定',
store: this.StoreLocked,
name: 'ContractStatus',
valueField: 'id',
displayField: 'name'
//ciq代码
});
this.storeMainstate = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeMainstate.load({ params: { enumTypeId: 3} });
this.comboxMainstate = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '合同状态',
autosize: true,
bodyPadding: 5,
flex: 4,
width: 500,
labelWidth: 90,
store: this.storeMainstate,
queryMode: 'local',
triggerOnClick: false,
valueField: 'EnumValueId',
displayField: 'EnumValueName'
});
this.storeport = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeport.load({ params: { enumTypeId: 10} });
this.comboxPort = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '目的港',
//renderTo: 'basicBoxselect',
//autoHeight:true,
autosize: true,
bodyPadding: 1,
flex: 2,
//height:60,
width: 80,
labelWidth: 90,
store: this.storeport,
queryMode: 'local',
//stacked: true,
//pinList: false,
triggerOnClick: false,
valueField: 'EnumValueId',
displayField: 'EnumValueName'
//,value: ['TX', 'CA']
});
this.storeBuyer = Ext.create('DsExt.ux.RefTableStore', {
model: 'Tradermb',
proxy: { url: '/CommMng/BasicDataRef/GetTrader' }
});
this.storeBuyer.load({ params: { condition: " isagentcn=1 "} });
this.comboxBuyer = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '客户',
autosize: true,
bodyPadding: 7,
flex: 1,
labelWidth: 90,
store: this.storeBuyer,
queryMode: 'local',
triggerOnClick: false,
valueField: 'name',
displayField: 'codename'
});
//表参照
this.storeCountry = Ext.create('DsExt.ux.RefTableStore', {
model: 'ConutryRef',
proxy: { url: '/CommMng/BasicDataRef/GetCountryRefList' }
});
this.storeCountry.load({ params: { condition: ""} });
this.comboxCountry = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '进口国',
store: this.storeCountry,
name: 'countryid',
valueField: 'countryid',
displayField: 'country_idandname'
});
this.storeCargoinfo = Ext.create('DsExt.ux.RefTableStore', {
model: 'CargoRef',
proxy: { url: '/CommMng/BasicDataRef/GetCargoRefList' }
});
this.storeCargoinfo.load({ params: { condition: ""} });
this.comboxCargoinfo = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'HS代码',
store: this.storeCargoinfo,
name: 'Cargoinfo_id',
valueField: 'id',
displayField: 'codeandname'
//HS代码
});
this.storeCargociq = Ext.create('DsExt.ux.RefTableStore', {
model: 'CargociqRef',
proxy: { url: '/CommMng/BasicDataRef/GetCargociqRefList' }
});
this.storeCargociq.load({ params: { condition: ""} });
this.comboxCargociq = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: 'ciq代码',
store: this.storeCargociq,
name: 'Cargociq_id',
valueField: 'id',
displayField: 'codeandname'
//ciq代码
});
this.storeCompany = Ext.create('DsExt.ux.RefTableStore', {
model: 'companymb',
proxy: { url: '/CommMng/BasicDataRef/GetcompanyList' }
});
this.storeCompany.load({ params: { condition: ""} });
this.comboxCompany = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '用证公司',
store: this.storeCompany,
name: 'company',
valueField: 'gid',
displayField: 'name'
});
this.storeRemind = Ext.create('DsExt.ux.RefTableStore', {
model: 'remind',
proxy: { url: '/CommMng/BasicDataRef/Getimportremind' }
});
this.storeRemind.load({ params: { condition: ""} });
this.comboxRemind = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '业务提醒',
store: this.storeRemind,
name: 'Remind',
valueField: 'RemindSql',
displayField: 'RemindName',
triggerAction: 'all',flex:2,
selectOnFocus: true,
listeners: {
change: function (field, newValue, oldValue) {
this.onGetremind(field, newValue, oldValue);
},
scope: this
}
});
this.MainCB = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.column = [{
id: '',
sortable: true,
dataIndex: '',
header: '',
width: 30
}, {
sortable: true, id: '',
dataIndex: 'seller',
header: '贸易商',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'buyer',
header: '购货方',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'HTH',
header: '合同号',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'country',
header: '进口国',
width: 80
}, {
sortable: true, id: '', //5
dataIndex: 'countryid',
header: 'countryid',
hidden: true,
width: 80
}, {
sortable: true, id: '',
dataIndex: 'portRef',
header: '目的港',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'companyname',
header: '用证公司',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'creattime',
header: '接单日期',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'name',
header: '货物名称',
width: 80
}, {
sortable: true, id: '', //10
dataIndex: 'weight',
header: '净重(吨)',
width: 80
}, /*{
sortable: true,
dataIndex: 'cicode',
header: '商品手册编号',
width: 80
},*/{
sortable: true, id: '',
dataIndex: 'ciname',
header: '商品手册名称',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'AppNo',
header: '许可证号',
width: 80
}, {
sortable: true,
dataIndex: 'ValidDate',
header: '许可证有效期',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'STT',
header: '双抬头',
width: 80
}, {
sortable: true, id: '', //15
dataIndex: 'printedRef',
header: '是否打印',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'AutoAPPRef',
header: '自动证',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'WriteoffsRef',
header: '核销完成',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'MainstateRef',
header: '合同状态',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'Ex_sailingdate',
header: '预计开船日',
width: 80
}, {
sortable: true, id: '', //20
dataIndex: 'Sailingdate',
header: '开船日',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'ArrivalDate',
header: '到港日',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'ReceiptStatusRef',
header: '单据是否完备',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'Receiptremark',
header: '寄单情况',
width: 280
}, {
sortable: true, id: '',
dataIndex: 'tax_date',
header: '出税日期',
width: 80
}, {
sortable: true, id: '', //25
dataIndex: 'tax_paydate',
header: '付税日期',
width: 80
}, {
sortable: true, id: '', dataIndex: 'id', header: 'id', hidden: true
},
{
dataIndex: 'TimeMark', id: '', header: 'TimeMark', hidden: true
},
{
sortable: true, id: '',
dataIndex: 'cgid',
header: 'cgid',
hidden: true,
width: 80
}, {
sortable: true, id: '',
dataIndex: 'BillNo',
header: '提单号',
width: 80
}, {
sortable: true, id: '', //30
dataIndex: 'E_Billtime',
header: '电放时间',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'BillTime',
header: '正本时间',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'HDtime',
header: '换单时间',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'ContainerNo',
header: '箱号',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'SealNo',
header: '铅封号',
width: 80
}, {
sortable: true, id: '', //35
dataIndex: 'ShipCompanyRef',
header: '船公司',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'Vessel',
header: '船名',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'Voyage',
header: '航次',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'CIQ_licence',
header: '卫生证号',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'CIQ_canbesearchRef',
header: '卫生证是否可查',
width: 80
}, {
sortable: true, id: '', //40
dataIndex: 'inspection_Signup_date',
header: '报检日期',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'inspection_no',
header: '报检号',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'SamplingDate_Plan',
header: '海关确定抽检',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'SamplingDate_Act',
header: '海关实际验货',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'CustomsReleaseDate',
header: '海关放行日期',
width: 80
}, {
sortable: true, id: '', //45
dataIndex: 'DeclareNumber',
header: '报关单号',
width: 80
}, {
id: ' ', sortable: true,
dataIndex: 'ContractNo',
header: '合同序列号',
width: 120
}, {
sortable: true, id: '',
dataIndex: 'Paydate',
header: '付货款时间(尾款)',
width: 80
}, {
sortable: true, id: '',
dataIndex: 'Prepaydate',
header: '付货款时间(预付)',
width: 80
}, {
sortable: true,
dataIndex: 'TRADINGAGENCY',
header: '订货方(中间商)',
width: 80
}, {
sortable: true,
dataIndex: 'FactoryNo',
header: '厂号',
width: 80
}];
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
stripeRows: true,
viewConfig: {
enableTextSelection: true
},
stateful: true,
selModel: this.MainCB,
stateId: 'PortOperateGrid',
columns: [new Ext.grid.RowNumberer()],
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
/////////////以下部分为获取存储的gridpanel显示样式
this.column = DsTruck.GetGridPanel(GID, this.formname, this.column, 1);
//使用者id表名 中间column数组跳过一开始的几列
this.gridList.reconfigure(this.storeList, this.column);
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('/Import/CWLock/Edit', "", "650", "1000");
}, this);
//#region formSearch
//#region formSearch枚举参照相关
///////////////////////////////////////////////////
this.storeport = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeport.load({ params: { enumTypeId: 10} });
/*
this.comboxport = Ext.create('DsExt.ux.RefEnumCombox', {
id:"S_port",
fieldLabel: '目的港',
store: this.storeport,
width: 180,
labelWidth:45,
name: 'port'
});*/
this.basicBoxselect = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '目的港',
//renderTo: 'basicBoxselect',
//autoHeight:true,
autosize: true,
bodyPadding: 3,
flex: 2,
//height:60,
width: 500,
labelWidth: 130,
store: this.storeport,
queryMode: 'local',
//stacked: true,
//pinList: false,
triggerOnClick: false,
valueField: 'EnumValueId',
displayField: 'EnumValueName'
//,value: ['TX', 'CA']
});
this.storeCname = Ext.create('DsExt.ux.RefTableStore', {
model: 'Fieldmb',
proxy: { url: '/Import/XXH/GetField' }
});
this.storeCname.load({ params: { tablename: 'import_cargo', fieldid: 'name', fieldvalue: 'name'} });
this.Cname = Ext.create('Ext.ux.form.field.BoxSelect', {
fieldLabel: '货物名称',
autosize: true,
bodyPadding: 5,
flex: 3,
width: 500,
labelWidth: 130,
store: this.storeCname,
queryMode: 'local',
triggerOnClick: false,
valueField: 'FieldId',
displayField: 'FieldValue'
});
////////////////////
//#endregion
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: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [//this.comboxport,
/*{
fieldLabel: '合同号',
name: 'HTH'
},*/
this.comboxCompany,
this.comboxCountry, {
fieldLabel: '合同序列号',
name: 'ContractNo'
}, {
fieldLabel: '从..开船日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'SailingDate_min'
}, {
fieldLabel: '到..开船日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'SailingDate_max'
}]
}]
}, //end items(fieldset 1)
{//fieldset 2
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '业务单据不完整',
xtype: 'checkbox',
name: 'ReceiptStatus',
flex: 1
}, this.comboxRemind, {
fieldLabel: '包含双抬头',
xtype: 'checkbox',
name: 'STT'
},
{ fieldLabel: '双抬头内容',
name: 'STT_word'
}
]
}]
}, //end fieldset 2
{//fieldset 4
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '提单号',
name: 'BillNo'
}, {
fieldLabel: '箱号',
name: 'ContainerNo'
}, {
fieldLabel: '铅封号',
name: 'SealNo'
}, {
fieldLabel: '从..到港日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ArrivalDate_min'
}, {
fieldLabel: '到..到港日',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ArrivalDate_max'
}]
}]
}, //end items(fieldset 4)
{//fieldset 5
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '库存清空',
xtype: 'checkbox',
name: 'KCClear', flex: 1
}, { fieldLabel: '贸易商',
name: 'seller'
}, {
fieldLabel: '备注中包含',
name: 'remark', flex: 1
}, {
fieldLabel: '从..审单时间',
format: 'Y-m-d',
xtype: 'datefield',
name: 'Audittime_min'
}, {
fieldLabel: '到..审单时间',
format: 'Y-m-d',
xtype: 'datefield',
name: 'Audittime_max'
}]
}]
} //end items(fieldset 5)
, {//fieldset 6
xtype: 'container',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxMainstate, this.comboxLocked]
}]
} //end items(fieldset 6)
, {//fieldset 6
xtype: 'container',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxPort]
}]
} //end items(fieldset 6)
, {//fieldset 6
xtype: 'container',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: []
}]
} //end items(fieldset 6)
, {//fieldset 6
xtype: 'container',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxBuyer]
}]
} //end items(fieldset 6)
]//end root items
});
//#endregion formSearch
var menu1 = new Ext.menu.Menu({
id: 'basicMenu',
items: [{
text: '船期表',
handler: clickHandler
}, {
text: '费用通知单_预付款',
handler: clickHandler_4
}, {
text: '费用通知单_尾款(无过程)',
handler: clickHandler_2
}, {
text: '费用通知单_尾款(有过程)',
handler: clickHandler_3
}
]
});
function clickHandler() {
panelTest.Print();
};
function clickHandler_2() {
panelTest.Print_FYTZ();
};
function clickHandler_3() {
panelTest.Print_FYTZ_3();
};
function clickHandler_4() {
panelTest.Print_FYTZ_4();
};
_this = this;
this.CBMSearch = new Ext.form.Checkbox({
fieldLabel: '高级查询',
listeners: {
change: function (newValue, oldValue, eOpts)//change事件
{
//alert(newValue.checked);
if (newValue.checked) {
_this.panelSearch.show();
} else {
_this.panelSearch.hide();
}
}
}
});
//查询工具条
this.panelBtn = new Ext.Panel({
region: "center",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
},
{
text: "重置条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onResetClick(button, event);
},
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, {
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
this.column = DsTruck.SaveGridPanel(GID, this.formname, this.gridList.columns, this.column, 1, true);
//alert(this.column[0].id);
},
scope: this
}, '-',
{ id: "S_HTH",
fieldLabel: "合同号",
labelWidth: 55,
xtype: 'textfield',
name: 'HTH'
}, { xtype: 'label', id: 'label1', text: "" },
//this.comboxport
this.CBMSearch
//this.basicBoxselect
]
});
//选择时保存选中的合同号
this.gridList.getSelectionModel().on('select',
function (model, record, index) {
this.C_contractno = record.data.ContractNo;
//alert(this.C_contractno);
},
this);
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 30,
items: [this.panelBtn]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 260,
autoSize: true,
hidden: true,
items: [this.formSearch]
});
Ext.apply(this, {
items: [this.panelTop, this.panelSearch, this.gridList]
});
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
}, //end initUIComponents
onRefreshClick: function (button, event) {
var sql = this.getCondition();
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];
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/Import/XXH/Delete',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(record);
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}, //onDeleteClick
getStrValue: function (list) {
var _list = [];
for (var _i = 0; _i < list.length; _i++) {
_list.push("'" + list[_i] + "'");
}
return _list;
},
getCondition: function () {
var sql = ' M.ISDELETE=0 ';
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var ContractNo = form.findField('ContractNo').getValue();
sql = sql + getAndConSql(sql, ContractNo, "M.ContractNo like '%" + ContractNo + "%'");
/*
var HTH = form.findField('HTH').getValue();
sql = sql + getAndConSql(sql, HTH, "M.HTH like '%" + HTH + "%'");
var port = form.findField('port').getValue();
sql = sql + getAndConSql(sql, port, "m.port = " + port + "");*/
var HTH = Ext.getCmp('S_HTH').getValue();
sql = sql + getAndConSql(sql, HTH, "M.HTH like '%" + HTH + "%'");
/*
var port = Ext.getCmp('S_port').getValue();
sql = sql + getAndConSql(sql, port, "m.port = " + port + "");*/
var port = this.comboxPort.getValue();
if (port != "") {
sql = sql + getAndConSql(sql, port, "m.port in (" + port + ")");
}
/*
var CnameList = this.Cname.getValue();
var CnameString = "";
for (var i in CnameList) {
if (CnameString == "") { CnameString = "'" + CnameList[i] + "'"; }
else { CnameString = CnameString + ",'" + CnameList[i] + "'"; }
}
if (CnameString != "") {
sql = sql + getAndConSql(sql, CnameString, "cg.name in (" + CnameString + ")");
}*/
var company = form.findField('company').getValue();
sql = sql + getAndConSql(sql, company, "M.company = '" + company + "'");
var countryid = form.findField('countryid').getValue();
sql = sql + getAndConSql(sql, countryid, "m.countryid like '%" + countryid + "%'");
var SailingDate_min = form.findField('SailingDate_min').getRawValue();
sql = sql + getAndConSql(sql, SailingDate_min, "m.SailingDate >= '" + SailingDate_min + "'");
var SailingDate_max = form.findField('SailingDate_max').getRawValue();
sql = sql + getAndConSql(sql, SailingDate_max, "m.SailingDate <= '" + SailingDate_max + " 23:59:59'");
//var Mainstate = form.findField('Mainstate').getValue();
//sql = sql + getAndConSql(sql, Mainstate, "m.Mainstate = " + Mainstate + "");
var Mainstate = this.comboxMainstate.getValue();
if (Mainstate != "") {
sql = sql + getAndConSql(sql, Mainstate, "m.Mainstate in (" + Mainstate + ")");
}
var seller = form.findField('seller').getRawValue();
sql = sql + getAndConSql(sql, seller, "M.seller like '%" + seller + "%'");
//var buyer = form.findField('buyer').getRawValue();
//sql = sql + getAndConSql(sql, buyer, "M.buyer like '%" + buyer + "%'");
var buyer = this.getStrValue(this.comboxBuyer.getValue());
sql = sql + getAndConSql(sql, buyer, "M.buyer in (" + buyer + ")");
/*
var ShipCompany_id = this.comboxCGS.getValue();
if (ShipCompany_id != "") {
sql = sql + getAndConSql(sql, ShipCompany_id, "m.ShipCompany_id in (" + ShipCompany_id + ")");
}*/
var BillNo = form.findField('BillNo').getRawValue();
sql = sql + getAndConSql(sql, BillNo, "m.BillNo like '%" + BillNo + "%'");
var ContainerNo = form.findField('ContainerNo').getRawValue();
sql = sql + getAndConSql(sql, ContainerNo, "m.ContainerNo like '%" + ContainerNo + "%'");
var SealNo = form.findField('SealNo').getValue();
sql = sql + getAndConSql(sql, SealNo, "m.SealNo like '%" + SealNo + "%'");
// alert(sql);
var STT = form.findField("STT").getValue();
if (STT)
{ sql = sql + getAndConSql(sql, STT, " m.STT is not null and m.STT<>'' "); }
var STT_word = form.findField('STT_word').getRawValue();
sql = sql + getAndConSql(sql, STT_word, "m.STT like '%" + STT_word + "%'");
var KCClear = form.findField("KCClear").getValue();
if (KCClear)
{ sql = sql + getAndConSql(sql, KCClear, " m.KCClear = 1 "); }
else { sql = sql + getAndConSql(sql, "True", " m.KCClear = 0 "); }
var ReceiptStatus = form.findField("ReceiptStatus").getValue();
if (ReceiptStatus)
{ sql = sql + getAndConSql(sql, ReceiptStatus, " (m.ReceiptStatus is null or m.ReceiptStatus=0 )"); }
var ArrivalDate_min = form.findField('ArrivalDate_min').getRawValue();
sql = sql + getAndConSql(sql, ArrivalDate_min, "m.ArrivalDate >= '" + ArrivalDate_min + "'");
var ArrivalDate_max = form.findField('ArrivalDate_max').getRawValue();
sql = sql + getAndConSql(sql, ArrivalDate_max, "m.ArrivalDate <= '" + ArrivalDate_max + " 23:59:59'");
var Audittime_min = form.findField('Audittime_min').getRawValue();
sql = sql + getAndConSql(sql, Audittime_min, "m.Audittime >= '" + Audittime_min + "'");
var Audittime_max = form.findField('Audittime_max').getRawValue();
sql = sql + getAndConSql(sql, Audittime_max, "m.Audittime <= '" + Audittime_max + " 23:59:59'");
var remark = form.findField('remark').getValue();
sql = sql + getAndConSql(sql, remark, "(m.remark like '%" + remark + "%' or m.remark_2 like '%"
+ remark + "%' or m.remark_3 like '%" + remark + "%' or m.remark_4 like '%" + remark + "%' or m.Receiptremark like '%" + remark + "%' )");
var _CS = form.findField('ContractStatus').getValue();
if (_CS == '0') { sql = sql + getAndConSql(sql, _CS, " (M.Contractstatus = 0 or M.Contractstatus is null) "); } else
if (_CS == '1') { sql = sql + getAndConSql(sql, _CS, " (M.Contractstatus = 1) "); }
if (this.remind != "") {
sql = sql + getAndConSql(sql, this.remind, this.remind);
}
return sql;
},
onGetremind: function (field, newValue, oldValue) {
if (newValue != null) {/*
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: newValue },
waitMsg: "正在查询数据...",
scope: this
});*/
this.remind = newValue;
}
},
onResetClick: function (button, event) {
this.formSearch.getForm().reset();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
return ret;
},
// alert(this.OprationStatus.ToString());
// alert(this.storeList.toString());
// alert(this.SelectedRecord.toString());
onExportClick: function (button, event) {
GridExportExcelPage(this.gridList);
},
});