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/BookingConfirm/Booking_SIIndex.js

1339 lines
42 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.Booking_SIIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.Booking_SIIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.Booking_SIIndex, Ext.Panel, {
PageSize: 50,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1=2',
initUIComponents: function () {
this.formname = "Booking_SIIndex";
this.sqlcontext = '1=2';
/////////////////////////////////////////
//#region 主列表
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'Booking_SImb',
remoteSort: false,
//groupField: 'GroupDate',
proxy: {
type: 'ajax',
//url: '/TruckMng/MsRptPcHeadOperate/QryData_ADL',
url: '/MvcShipping/BookingConfirm/GetBooking_SIList',
//this.storeList.proxy.url = '/TruckMng/MsRptPcHeadOperate/QryData_ADL';
reader: {
id: 'SINO',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.column = [
{
sortable: true,hidden:true,
dataIndex: 'SINO',
header: '提单确认编号',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'ORDNO',
header: '订舱编号',
width: 80
},
{
sortable: true,
dataIndex: 'ORDERNO',
header: '订舱业务编号',
width: 80
},
{
sortable: true,hidden:true,
dataIndex: 'BSNO',
header: '业务编号',
width: 80
},
{
sortable: true,
dataIndex: 'BSSTATUS',
header: '业务状态',
width: 80,
renderer: function (value, meta, record) {
return record.get("BSSTATUSREF");
}
},
{
sortable: true,
dataIndex: 'SUBMITDATE',
header: '截单提交时间',
width: 140
},
{
sortable: true,
dataIndex: 'BSDATE',
header: '订舱日期',
width: 140
},
{
sortable: true,
dataIndex: 'MBLNO',
header: '主提单号',
width: 80
},
{
sortable: true,
dataIndex: 'HBLNO',
header: '分提单号',
width: 80
},
{
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合约号',
width: 80
},
{
sortable: true,
dataIndex: 'SERVICECONTRACTNO',
header: '客户合同号',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERID',
header: '发货人代码',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEEID',
header: '收货人代码',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYID',
header: '通知人代码',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPER',
header: '发货人',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEE',
header: '收货人',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTY',
header: '通知人',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTY2',
header: '第二通知人',
width: 80
},
{
sortable: true,
dataIndex: 'YARD',
header: '场站',
width: 80
},
{
sortable: true,
dataIndex: 'VESSELID',
header: '船舶呼号',
width: 80
},
{
sortable: true,
dataIndex: 'VESSEL',
header: '船名',
width: 80
},
{
sortable: true,
dataIndex: 'VOYNO',
header: '航次',
width: 80
},
{
sortable: true,
dataIndex: 'ETD',
header: '开船日期',
width: 80
},
{
sortable: true,
dataIndex: 'CLOSINGDATE',
header: '截港日期',
width: 80
},
{
sortable: true,
dataIndex: 'CLOSEDOCDATE',
header: '截单日期',
width: 80
},
{
sortable: true,
dataIndex: 'ETA',
header: '预计到港日期',
width: 80
},
{
sortable: true,
dataIndex: 'PLACERECEIPTID',
header: '收货地代码',
width: 80
},
{
sortable: true,
dataIndex: 'PLACERECEIPT',
header: '收货地',
width: 80
},
{
sortable: true,
dataIndex: 'PORTLOADID',
header: '起运港代码',
width: 80
},
{
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运港',
width: 80
},
{
sortable: true,
dataIndex: 'PORTDISCHARGEID',
header: '卸货港代码',
width: 80
},
{
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '卸货港',
width: 80
},
{
sortable: true,
dataIndex: 'PLACEDELIVERYID',
header: '交货地代码',
width: 80
},
{
sortable: true,
dataIndex: 'PLACEDELIVERY',
header: '交货地',
width: 80
},
{
sortable: true,
dataIndex: 'DESTINATIONID',
header: '目的地代码',
width: 80
},
{
sortable: true,
dataIndex: 'DESTINATION',
header: '目的地',
width: 80
},
{
sortable: true,
dataIndex: 'NOBILL',
header: '提单份数',
width: 80
},
{
sortable: true,
dataIndex: 'COPYNOBILL',
header: '副本提单份数',
width: 80
},
{
sortable: true,
dataIndex: 'ISSUETYPE',
header: '签单方式',
width: 80
},
{
sortable: true,
dataIndex: 'ISSUEDATE',
header: '签单日期',
width: 80
},
{
sortable: true,
dataIndex: 'ISSUEPLACEID',
header: '签单地点代码',
width: 80
},
{
sortable: true,
dataIndex: 'ISSUEPLACE',
header: '签单地点',
width: 80
},
{
sortable: true,
dataIndex: 'BLFRT',
header: '付费方式',
width: 80
},
{
sortable: true,
dataIndex: 'PREPARDAT',
header: '预付地点',
width: 80
},
{
sortable: true,
dataIndex: 'PAYABLEAT',
header: '到付地点',
width: 80
},
{
sortable: true,
dataIndex: 'SERVICE',
header: '运输条款',
width: 80
},
{
sortable: true,
dataIndex: 'MARKS',
header: '唛头',
width: 80
},
{
sortable: true,
dataIndex: 'HSCODE',
header: 'HS代码',
width: 80
},
{
sortable: true,
dataIndex: 'DESCRIPTION',
header: '货描',
width: 80
},
{
sortable: true,
dataIndex: 'PKGS',
header: '件数',
width: 80
},
{
sortable: true,
dataIndex: 'KINDPKGS',
header: '包装',
width: 80
},
{
sortable: true,
dataIndex: 'KGS',
header: '毛重',
width: 80
},
{
sortable: true,
dataIndex: 'CBM',
header: '尺码',
width: 80
},
{
sortable: true,
dataIndex: 'CNTRTOTAL',
header: '集装箱',
width: 80
},
{
sortable: true,
dataIndex: 'INPUTBY',
header: '录入人',
width: 80
},
{
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 80
},
{
sortable: true,
dataIndex: 'CARGOID',
header: '货物标识',
width: 80
},
{
sortable: true,
dataIndex: 'DCLASS',
header: '危险品类别',
width: 80
},
{
sortable: true,
dataIndex: 'DUNNO',
header: '危险品编号',
width: 80
},
{
sortable: true,
dataIndex: 'DPAGE',
header: '危险品页号',
width: 80
},
{
sortable: true,
dataIndex: 'DLABEL',
header: '危险品标签',
width: 80
},
{
sortable: true,
dataIndex: 'LINKMAN',
header: '危险品联系人',
width: 80
},
{
sortable: true,
dataIndex: 'TEMPID',
header: '温度单位',
width: 80
},
{
sortable: true,
dataIndex: 'TEMPSET',
header: '设置温度',
width: 80
},
{
sortable: true,
dataIndex: 'REEFERF',
header: '通风度',
width: 80
},
{
sortable: true,
dataIndex: 'HUMIDITY',
header: '湿度',
width: 80
},
{
sortable: true,
dataIndex: 'ISCONTAINERSOC',
header: '是否SOC箱',
width: 80
},
{
sortable: true,
dataIndex: 'REMARK',
header: '备注',
width: 80
},
{
sortable: true,
dataIndex: 'SIREMARK',
header: 'SI备注',
width: 80
},
{
sortable: true,
dataIndex: 'CREATETIME',
header: '创建时间',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFYTIME',
header: '修改时间',
width: 80
},
{
sortable: true,
dataIndex: 'MODIFYUSER',
header: '修改人',
width: 80
},
{
sortable: true,hidden:true,
dataIndex: 'USERID',
header: '用户代码',
width: 80
},
{
sortable: true, hidden: true,
dataIndex: 'CORPID',
header: '公司代码',
width: 80
},
{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '委托单位',
width: 80
},
{
sortable: true,
dataIndex: 'OPERATOR',
header: '截单发起人',
width: 80
},
{
sortable: true,
dataIndex: 'OPERATORTEL',
header: '截单发起人电话',
width: 80
},
{
sortable: true,
dataIndex: 'OPERATORMAIL',
header: '截单发起人邮箱',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERNAME',
header: '发货人名称',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERADDR1',
header: '发货人地址1',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERADDR2',
header: '发货人地址2',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERADDR3',
header: '发货人地址3',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERCITY',
header: '发货人城市',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERPROVINCE',
header: '发货人省份代码',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERPOSTCODE',
header: '发货人邮编',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERCOUNTRY',
header: '发货人国家代码',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERATTN',
header: '发货人联系人',
width: 80
},
{
sortable: true,
dataIndex: 'SHIPPERTEL',
header: '发货人电话',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEENAME',
header: '发货人名称',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEEADDR1',
header: '发货人地址1',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEEADDR2',
header: '发货人地址2',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEEADDR3',
header: '发货人地址3',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEECITY',
header: '发货人城市',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEEPROVINCE',
header: '发货人省份代码',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEEPOSTCODE',
header: '发货人邮编',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEERCOUNTRY',
header: '发货人国家代码',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEEATTN',
header: '发货人联系人',
width: 80
},
{
sortable: true,
dataIndex: 'CONSIGNEETEL',
header: '发货人电话',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYNAME',
header: '通知人名称',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYADDR1',
header: '通知人地址1',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYADDR2',
header: '通知人地址2',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYADDR3',
header: '通知人地址3',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYCITY',
header: '通知人城市',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYPROVINCE',
header: '通知人省份代码',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYPOSTCODE',
header: '通知人邮编',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYCOUNTRY',
header: '通知人国家代码',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYATTN',
header: '通知人联系人',
width: 80
},
{
sortable: true,
dataIndex: 'NOTIFYPARTYTEL',
header: '通知人电话',
width: 80
},
{
sortable: true,
dataIndex: 'ISMULTI',
header: '是否多提单业务',
width: 120
},
{
sortable: true,hidden:true,
dataIndex: 'ORDER_BSNO',
header: '父业务编号',
width: 80
}
];
this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 40
});
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
//selModel: this.MainCB,
columns: this.column,
plugins: [
//this.cellEditing
],
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
/*features: [{
id: 'group',
ftype: 'grouping',
groupHeaderTpl: '{name}',
hideGroupedHeader: true,
enableGroupingMenu: true
}],*/
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true,
getRowClass: function (record, rowIndex, rowParams, store) {
//var YXSTATE = record.get('YXSTATE');
//return Shipping.GetAuditClass(BLSTATUS);
}
},
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
/////////////以下部分为获取存储的gridpanel显示样式
this.column = DsTruck.GetGridPanel(USERID, this.formname, this.column);
//使用者id表名 中间column数组
this.column.unshift(new Ext.grid.RowNumberer());
this.gridList.reconfigure(this.storeList, this.column);
////////////////////////////
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
// alert('0....' + dataview.toString() + ',' + record.toString() + ',' + item.toString() + ',' + index.toString() + ',' + e.toString() + ',' + b.toString());
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin('/MvcShipping/BookingConfirm/Edit_SI', "提单确认");
}, this);
//#endregion
//////////////////////////////////////////////////////////////
//#region formSearch
//#region formSearch枚举参照相关
//客户
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListController' }
});
this.storeCustCode.load({ params: { condition: "" } });
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '委托单位',
store: this.storeCustCode,
//queryMode: 'remote',
minChars: 1,
//queryParam: 'CODENAME',
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName'
//,allowBlank: false
});
this.comboxBSSTATUS = getEnumcombox({
LABEL: '截单状态',
NAME: 'BSSTATUS',
FLEX: 1,
value: "Submit",
enumTypeId: 82002
});
//#endregion
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 85,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxCustCode,
{
fieldLabel: '提单号',
//labelWidth: 110,
name: 'MBLNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},
{
fieldLabel: '订舱编号',
//labelWidth: 110,
name: 'ORDERNO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxBSSTATUS,
{
fieldLabel: '从..订舱日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'BSDATE_BGN',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到..订舱日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'BSDATE_END',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},
{
fieldLabel: '从..ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETD_BGN',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到..ETD',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETD_END',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
saveQuerySetting(this.formname, this.formSearch, true, true);
},
scope: this
}, '-', {
text: "导出Excel",
id: "btnExportExcel",
iconCls: 'btnexportexcel',
handler: function (button, event) {
this.onExportClick(button, event);
},
scope: this
}, {
text: "打印", id: "print",
tooltip: 'print',
handler: function (button, event) {
//this.PushState("30011");
this.Print();
},
scope: this
}, /*{
id: "btnFeeAuditReject",
text: '驳回提交费用业务',
tooltip: '驳回提交费用业务',
iconCls: "btnrefuse",
handler: function (button, event) {
this.onAuditRefuseClick(button, event);
},
scope: this
},*/
{
text: "保存列表样式",
id: "btntest",
handler: function (button, event) {
var formname = this.formname;
var tempcolumns = this.gridList.columns;
DsTruck.SaveGridPanel(USERID, formname, tempcolumns, this.column, 0, false);
},
scope: this
}
//,this.CB_EditMode
]
});
//#region 布局
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
items: [this.formSearch, this.panelBtn]
});
this.panelMain = new Ext.Panel({
//title: '',
layout: "border",
region: 'center',
height: 600,
margin: '1 2',
split: true,
items: [this.gridList]
});
Ext.apply(this, {
items: [this.panelTop, this.panelMain]
});
//#endregion
//#region 以下集中绑定事件
this.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
//Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
//#endregion
this.LoadInitData();
}, //end initUIComponents
LoadInitData: function () {
//this.storeTruckNo.load({ params: { condition: " A.truckno not in (select DISTINCT truckno from tMsWlPcHead where isnull(isend,0)=0 ) "} });
sql = " BSSTATUS = 'Submit' ";
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onAuditRefuseClick: function (button, event) {
var sql = " A.GID in (select bsno from ch_fee where FEESTATUS=6)";
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onRefreshClick: function (button, event) {
//if (!this.checkSearchCondition())
// return;
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//}
},
onDsQuery: function (button, event) {
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//}
},
onRefreshClick_Add: function (button, event) {
if (!this.checkSearchCondition())
return;
var sql = this.getCondition_Add();
this.storeList.load({
params: { start: 0, limit: this.PageSize, 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: '/MvcShipping/MsOp_YAXIANG/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
getCondition: function () {
var form = this.formSearch.getForm();
var sql = '';
//20170309 增加逻辑
//
//只能看到“”
var MBLNO = form.findField('MBLNO').getValue();
sql = sql + getAndConSql(sql, MBLNO, " mblno like '%" + MBLNO + "%' ");
var ORDERNO = form.findField('ORDERNO').getValue();
sql = sql + getAndConSql(sql, ORDERNO, " ORDERNO like '%" + ORDERNO + "%' ");
var BSSTATUS = form.findField('BSSTATUS').getValue();
sql = sql + getAndConSql(sql, BSSTATUS, " BSSTATUS = '" + BSSTATUS + "' ");
var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
sql = sql + getAndConSql(sql, CUSTOMERNAME, " OP_SEAE_SI.USERID in(select GID from sys_user where INFO_CLIENT like '%" + CUSTOMERNAME + "%') ");
var BSDATE_BGN = form.findField('BSDATE_BGN').getRawValue();
sql = sql + getAndConSql(sql, BSDATE_BGN, " (select max(optime) from OP_LOG where billno=ORDNO and JsonValue like '%\"BSSTATUS\":\"Submit\"%')>='" + BSDATE_BGN + "'");
var BSDATE_END = form.findField('BSDATE_END').getRawValue();
sql = sql + getAndConSql(sql, BSDATE_END, " (select max(optime) from OP_LOG where billno=ORDNO and JsonValue like '%\"BSSTATUS\":\"Submit\"%')<='" + BSDATE_END + " 23:59:59'");
var ETD_BGN = form.findField('ETD_BGN').getRawValue();
sql = sql + getAndConSql(sql, ETD_BGN, " ETD>='" + ETD_BGN + "'");
var ETD_END = form.findField('ETD_END').getRawValue();
sql = sql + getAndConSql(sql, ETD_END, " ETD<='" + ETD_END + " 23:59:59'");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
if (this.OprationStatus == "add") {
ret[3] = "";
} else {
ret[3] = this.SelectedRecord.data.YXNO;
}
//将押箱单位列表带过
ret[4] = this.storeCustCode;
return ret;
},
onAddClick: function (button, event) {
this.OprationStatus = 'add';
DsOpenEditWin("/MvcShipping/MsOp_YAXIANG/Edit", "新建押箱单", "700", "1100");
} //onDeleteClick
, PushState: function (execution) {
var selectedRecords = this.gridList.selModel.getSelection();
Ext.MessageBox.confirm('提示', '确定吗?', function (btn) {
if (btn == 'yes') {
var Bodydatas = [];
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
Bodydatas.push(rec);
}
var jsonBody = ConvertRecordsToJsonAll(Bodydatas);
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOp_YAXIANG/PushState_List',
scope: this,
params: {
dataList: jsonBody,
Execution: execution
},
callback: function (options, success, response) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onRefreshClick();
} else {
Ext.Msg.show({
title: '请重试',
msg: jsonresult.Message,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
}, this);
}
, Submit: function () {
this.Audit('SubmitAudit');
}
, SubmitBack: function () {
this.Audit('SubmitAuditBack');
}
, Audit: function (AuditType) {
var selectedRecords = this.gridList.selModel.getSelection();
Ext.MessageBox.confirm('提示', '确定吗?', function (btn) {
if (btn == 'yes') {
var Bodydatas = [];
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
Bodydatas.push(rec);
}
var jsonBody = ConvertRecordsToJsonAll(Bodydatas);
//var Head = "[" + Ext.JSON.encode(this.Editdata) + "]";
Ext.Msg.wait('正在保存数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在保存数据...',
url: '/MvcShipping/MsOp_YAXIANG/' + AuditType,
scope: this,
params: {
dataList: jsonBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
condition = "YXNO='" + this.editRecord.get('YXNO') + "'";
this.LoadData(this.opStatus, condition);
} else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: '请重试',
msg: '服务器响应出错',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
});
}
,
//#region 打印
Print: function () {
var selectedRecords = this.gridList.selModel.getSelection();
var YXNOList = "";
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (!isNullorEmpty(YXNOList)) YXNOList += "','";
YXNOList += rec.get("YXNO");
}
var printType = 'MSOP_YAXIANG';
var sql1 = "";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsOp_YAXIANG/GetPrintSql',
params: {
printname: "Print1",
YXNOList: "'" + YXNOList + "'"
},
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;
}
//this.Editdata = result.data;
//this.LoadInit(data);
sql1 = result.Data.sql1;
sql2 = result.Data.sql2;
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
//#endregion
});