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/MvcShipping/Viewsjs/WMSNew/WMSNewIndex.js

1326 lines
46 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.WMSNewIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.WMSNewIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.WMSNewIndex, Ext.Panel, {
PageSize: 50,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
EditRecord: null, //用于从主界面获取
BsNo: '',
OPLBNAME: "",
initUIComponents: function () {
var mainform = window.parent._this; // Ext.getCmp('OpSeaiEdit');
if (typeof (mainform.editRecord) == "undefined") {
this.OPLBNAME = "WMSIN";
}
else {
this.EditRecord = mainform.editRecord;
//this.BSNO = EditRecord.get('BSNO');
this.BsNo = this.EditRecord.data.BSNO;
this.OPLBNAME = this.EditRecord.data.OPLBNAME;
if (this.OPLBNAME == "" || this.OPLBNAME == undefined) {
this.OPLBNAME = "海运进口";
}
}
this.formname = 'WMSNewList';
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'WMSNewListModel',
pageSize: this.PageSize,
// autoLoad: { start: 0, limit: 30 },
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/WMSNew/GetDataList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//定义Grid
this.WMSCB = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true });
this.columns = [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 80
}, {
sortable: true,
dataIndex: 'ISLOCK',
header: '是否入账',
width: 80,
renderer: function (value, cellmeta) {
if (value == '1' || value == true || value == 'true') {
//return "是";
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
}, {
sortable: true,
dataIndex: 'ISLOCK2',
header: '是否锁定',
width: 80,
renderer: function (value, cellmeta) {
if (value == '1' || value == true || value == 'true') {
return "<img src='../../../../TruckMng/Content/Images/Lock.png' />";
}
}
}, {
sortable: true,
dataIndex: 'ISCHANGE',
header: '货权转移',
hidden: true,
width: 80
}, {
sortable: false,
dataIndex: 'ISBONDED',
header: '保税业务',
width: 80
}, {
sortable: true,
dataIndex: 'BLNO',
header: '提单号',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTOMNO',
header: '备案清单号',
width: 120,
renderer: function (value, cellmeta) {
// if (value == '1' || value == true || value == 'true') {
// return "是";
// } else {
// return "否";
// }
return value;
}
}, {
sortable: true,
dataIndex: 'WMSNO',
header: '入库单号',
width: 120
}, {
sortable: true,
dataIndex: 'CUSTNO',
header: '委托编号',
width: 80
}, {
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: '客户名称',
width: 150
},{
sortable: true,
dataIndex: 'COUNTRYOFORIGIN',
header: '原产国',
width: 120
},{
sortable: true,
dataIndex: 'STORAGENAME',
header: '仓库名称',
width: 150
}, {
sortable: true,
dataIndex: 'ARCLIENT',
header: '应收客户',
width: 150
}, {
sortable: true,
dataIndex: 'TRUCKNAME',
header: '应付客户',
width: 150
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 120
}, {
sortable: true,
dataIndex: 'GOODSMODEL',
header: '牌号',
width: 80
}, {
sortable: true,
dataIndex: 'GOODSPACK',
header: '入库件数',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value) {
return Ext.util.Format.number(value, '0.0');
}
}, {
sortable: true,
dataIndex: 'GOODSPACKSTOCK',
header: '剩余件数',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value) {
return Ext.util.Format.number(value, '0.0');
}
}, {
sortable: true,
dataIndex: 'GOODSRKSL',
header: '入库量',
width: 100,
summaryType: 'sum',
summaryRenderer: function (value) {
//return Ext.util.Format.number(value, '0.0000');
value = usMoney(value, 4, '', true);
return value;
}
}, {
sortable: true,
dataIndex: 'GOODSSTOCK',
header: '库存量',
width: 100,
summaryType: 'sum',
summaryRenderer: function (value) {
//return Ext.util.Format.number(value, '0.0000');
value = usMoney(value, 4, '', true);
return value;
}
}, {
sortable: true,
dataIndex: 'GOODSKGS',
header: '重量',
width: 100,
summaryType: 'sum',
summaryRenderer: function (value) {
return Ext.util.Format.number(value, '0.0000');
}
}, {
sortable: true,
dataIndex: 'CHARGEUNIT',
header: '计费单位',
width: 60
}, {
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;
}
}, {
sortable: true,
dataIndex: 'ARFEE',
header: '应收账款',
width: 80
}, {
sortable: true,
dataIndex: 'APFEE',
header: '应付账款',
width: 80
}, {
sortable: true,
dataIndex: 'WMSOP',
header: '操作人',
width: 80
}, {
sortable: true,
dataIndex: 'WMSDATE',
header: '入库时间',
width: 80
}, {
sortable: true,
dataIndex: 'STARTBILLINGDATE',
header: '开始计费日期',
width: 80
}, {
sortable: true,
dataIndex: 'MARKETVALUE',
header: '市场货值',
width: 80
}, {
sortable: true,
dataIndex: 'BANKVALUE',
header: '银行货值',
width: 80
}, {
sortable: true,
dataIndex: 'PICIHAO',
header: '批次号',
width: 80
}, {
sortable: true,
dataIndex: 'CONTRACTNO',
header: '合同号',
width: 120
}, {
sortable: true,
dataIndex: 'TiDanJianShu',
header: '提单件数',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value, summaryData, dataIndex) {
var dataArr = _this.storeList.data.items;
var temp = 0;
var existBlno = '';
for (var i = 0; i < dataArr.length; i++) {
if (existBlno.indexOf(dataArr[i].data.BLNO) >= 0 ) {
continue;
} else {
existBlno += dataArr[i].data.BLNO + ',';
temp += parseFloat(dataArr[i].data.TiDanJianShu);
}
}
return temp;
}
}, {
sortable: true,
dataIndex: 'TiDanZhongLiang',
header: '提单重量',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value, summaryData, dataIndex) {
var dataArr = _this.storeList.data.items;
var temp = 0.0000;
var existBlno = '';
for (var i = 0; i < dataArr.length; i++) {
if (existBlno.indexOf(dataArr[i].data.BLNO) >= 0) {
continue;
} else {
existBlno += dataArr[i].data.BLNO + ',';
temp += parseFloat(dataArr[i].data.TiDanZhongLiang);
}
}
return temp;
}
}
];
this.Pagenum = Ext.create('Ext.form.field.Number', {
name: 'bottles',
fieldLabel: '每页记录数',
labelAlign: 'right',
value: this.PageSize,
maxValue: 100000,
width: 180,
minValue: 0,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.girdcolums = this.columns;
//this.girdcolums = DsTruck.GetGridPanel(GID, this.formname, this.girdcolums, 0); //使用者id表名中间column数组跳过一开始的几列
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1, true);
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
columnLines: true,
selModel: this.WMSCB,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
columns: this.girdcolums,
bbar: [Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.Pagenum]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin("/MvcShipping/WMSNew/InEdit", "", "650", "1250");
}, this);
//#region formSearch
Ext.regModel('OutType',
{
fields: [{ name: 'value' }, { name: 'text' }]
});
var cbStore1 = new Ext.data.Store({
model: 'OutType',
data: [{ 'value': '0', 'text': '否' },
{ 'value': '1', 'text': '是'}]
});
var cbType = Ext.create('Ext.form.ComboBox', {
name: 'cbType',
queryMode: 'local',
id: 'cbType',
triggerAction: 'all',
labelWidth: 90,
valueField: 'value',
displayField: 'text',
store: cbStore1,
fieldLabel: '是否保税业务',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
}
}
});
//所属仓库
this.storeSTORAGENAME = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeSTORAGENAME.load({ params: { condition: " ISWAREHOUSE=1 "} });
this.comboxSTORAGENAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '仓库名称',
store: this.storeSTORAGENAME,
forceSelection: true,
name: 'STORAGENAME',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//品名
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',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
}
}
});
//委托单位
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load();
this.comboxCustCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '货主',
store: this.storeCustCode,
forceSelection: true,
name: 'CUSTOMERNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//#region 进口国
Ext.define('ConutryRef', {
extend: 'Ext.data.Model',
fields: [
{ name: 'countryid', type: 'string' },
{ name: 'country', type: 'string' },
{ name: 'country_idandname', type: 'string' }
]
});
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: '进口国',
forceSelection: true,
store: this.storeCountry,
name: 'COUNTRYID',
valueField: 'countryid',
displayField: 'country_idandname',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
}
}
});
Ext.regModel('IsChange',
{
fields: [{ name: 'value' }, { name: 'text' }]
});
var cbStoreChange = new Ext.data.Store({
model: 'IsChange',
data: [{ 'value': '0', 'text': '否' },
{ 'value': '1', 'text': '是' }]
});
var cbChange = Ext.create('Ext.form.ComboBox', {
name: 'cbChange',
queryMode: 'local',
id: 'cbChange',
triggerAction: 'all',
labelWidth: 90,
valueField: 'value',
displayField: 'text',
store: cbStoreChange,
fieldLabel: '是否货权转移',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
}
}
});
//#endregion
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
flex: 1,
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '编号',
name: 'NO',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '入库时间(从)',
name: 'WMSDATE',
format: 'Y-m-d',
labelWidth: 90,
xtype: 'datefield',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '入库时间(到)',
labelWidth: 90,
name: 'WMSDATETO',
format: 'Y-m-d',
xtype: 'datefield',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCustCode
, this.comboxCountry, {
fieldLabel: '合同号',
name: 'CONTRACTNO',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}
]
}, { xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxSTORAGENAME,
this.comboxGOODSNAME,
cbType,{
fieldLabel: '牌号',
name: 'GOODSMODEL',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '箱号',
name: 'CNTRNO',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, cbChange
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
//#endregion formSearch
//查询工具条
_this = this;
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
text: '新建',
iconCls: "btnadd",
handler: function (menu, event) {
_this.OprationStatus = 'add';
DsOpenEditWin("/MvcShipping/WMSNew/InEdit", "", "650", "1250");
},
scope: this
}, '-',
{
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event);
},
scope: this
},
'-',
{
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: '发送报文',
iconCls: "btnrefresh",
menu: [{
text: '期初库存报文',
handler: function (menu, event) {
_this.onSendXMLClick();
}
}, {
text: '出库入库报文',
handler: function (menu, event) {
_this.onSendXML2Click();
}
}],
scope: this
}, '-', {
text: "保存列表样式",
menu: [{ text: "保存",
handler: function (button, event) {
_this.girdcolums = DsTruck.SaveGridPanel(GID, _this.formname, _this.gridList.columns, _this.girdcolums, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
}, { text: "初始化",
handler: function (menu, event) {
_this.formWMSINBody.reconfigure(_this.storeList, _this.columns);
_this.girdcolums = DsTruck.SaveGridPanel(GID, _this.formname, _this.gridList.columns, _this.columns, 0, true); //使用者id表名中间column数组跳过一开始的几列
}
}],
scope: this
}, {
text: "打印", //"打印",
iconCls: 'btnprint',
menu: [
{ text: "全部", //"全部",
handler: function (menu, event) {
_this.onPrintClick();
}
}, { text: "选择打印", //"选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}, {
xtype: 'button',
width: 90,
text: "高级查询",
iconCls: "btnmore",
handler: function (button, event) {
var sql = this.getCondition();
var winAccess = new Shipping.DsQuery({
});
winAccess.StoreList = this.storeList;
winAccess.formname = this.formname;
winAccess.condition = sql;
winAccess.show();
return;
},
scope: this
}, {
text: "业务批量修改",
handler: function (menu, event) {
_this.winModifyShow.show();
}
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 100,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
this.InitData();
this.formModify = Ext.widget('form', {
region: 'north',
frame: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 70,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'fieldset',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '提单号',
name: 'BLNO'
}, { xtype: 'hiddenfield' }, { xtype: 'hiddenfield' }
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
}); //end this.formEdit
me = this;
this.winModifyShow = Ext.create('Ext.window.Window', {
title: "批量修改",
width: 820,
//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.formModify],
buttons: [{
text: "确认修改",
minWidth: 70,
handler: function () {
me.onModifyClick()
}
}, {
text: "关闭",
minWidth: 70,
handler: function () {
me.winModifyShow.close();
}
}]
});
}, //end initUIComponents
//#region 加载事件
InitData: function () {
if (this.BsNo != undefined && this.BsNo != "") {
this.sqlcontext = " ASSOCIATEDNO='" + this.BsNo + "' "; //只显示该业务下的
} else {
//#region 初始化只显示当前月
var myDate = new Date();
var mydatestr = Ext.util.Format.date(myDate, 'Y-m') + ('-01');
this.sqlcontext = " WMSDATE >='" + mydatestr + "'";
//endregion
}
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: this.sqlcontext },
waitMsg:"正在查询数据...",
scope: this
});
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: this.sqlcontext });
}, this);
//#endregion
//this.onRefreshClick();
if (this.BsNo != undefined && this.BsNo != "") {
//this.formSearch.hidden = true;
this.formSearch.hide();
this.panelTop.height = 30;
} else {
this.formSearch.show();
this.panelTop.height = 130;
}
}, //end InitData
//#endregion
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.sqlcontext = sql;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function () {
//var girdcolums = this.gridList.getColumnMode();
var sql = this.sqlcontext;
this.PageSize = this.Pagenum.getValue();
this.storeList.pageSize = this.PageSize;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择记录!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var selectedRecords = [];
selectedRecords = this.gridList.selModel.getSelection();
var selectStores = [];
for (var i = 0; i < selectedRecords.length; i++) {
selectStores.push(selectedRecords[i].data);
}
var record = selections[0];
if (record.data.ISLOCK == "True" || record.data.ISLOCK == "1") {
Ext.Msg.show({ title: '提示', msg: '有已入账的信息,不允许删除!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/WMSNew/Delete',
params: {
data: Ext.JSON.encode(selectStores),
USERID: USERID
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeList.remove(selections);
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
onModifyClick: function (menu, event) {
var GidStr = '';
var records = this.gridList.getSelectionModel().getSelection();
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
bodyAddDatas.push(rec);
}
var data = this.formModify.getForm().getValues();
_this = this;
if (bodyAddDatas.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有要修改的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: '正在修改...',
url: '/MvcShipping/WMSNew/modify',
params: {
data: jsonbodyAddDatas,
modifydata: Ext.JSON.encode(data)
},
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 {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
_this.storeList.reload();
_this.winModifyShow.close();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
if (this.BsNo != undefined && this.BsNo != "") {
sql = " ASSOCIATEDNO='" + this.BsNo + "' "; //只显示该业务下的
}
var cbType = form.findField('cbType').getValue();
var temp = '';
if (cbType == '0' || cbType == '1') {
temp = "(select ISBONDED from op_seai where BSNO= wms.ASSOCIATEDNO)=" + cbType;
} else {
temp = ''
}
sql = sql + getAndConSql(sql, cbType, temp);
var cbChange = form.findField('cbChange').getValue();
if (cbChange != '' && cbChange != null) {
sql = sql + getAndConSql(sql, cbChange, " ISCHANGE = '" + cbChange + "'");
}
var NO = form.findField('NO').getValue();
sql = sql + getAndConSql(sql, NO, " ( BLNO like '%" + NO + "%' OR WMSNO like '%" + NO + "%' OR CUSTNO like '%" + NO + "%' OR (SELECT wi.PICIHAO+' '+wi.CNTRNO+' ' from wms_in wi where wi.ASSOCIATEDNO=wms.GID FOR XML PATH('')) like '%" + NO + "%')");
// var CUSTOMERNAME = form.findField('CUSTOMERNAME').getValue();
var CUSTOMERNAME = this.comboxCustCode.getValue();
if (CUSTOMERNAME != '' && CUSTOMERNAME != null) {
sql = sql + getAndConSql(sql, CUSTOMERNAME, " CUSTOMERNAME like '%" + CUSTOMERNAME + "%'");
}
var STORAGENAME = this.comboxSTORAGENAME.getValue();
if (STORAGENAME != '' && STORAGENAME != null) {
sql = sql + getAndConSql(sql, STORAGENAME, " STORAGENAME like '%" + STORAGENAME + "%'");
}
var WMSDATE = form.findField('WMSDATE').getRawValue();
sql = sql + getAndConSql(sql, WMSDATE, " WMSDATE >= '" + WMSDATE + "'");
var WMSDATETO = form.findField('WMSDATETO').getRawValue();
if (WMSDATETO != '' && WMSDATETO != null) {
sql = sql + getAndConSql(sql, WMSDATETO, " WMSDATE <= '" + WMSDATETO + "'");
}
var GOODSMODEL = form.findField('GOODSMODEL').getValue();
if (GOODSMODEL != '' && GOODSMODEL != null) {
sql = sql + getAndConSql(sql, GOODSMODEL, " GOODSMODEL like '%" + GOODSMODEL + "%'");
}
var GOODSNAME = this.comboxGOODSNAME.getValue();
if (GOODSNAME != '' && GOODSNAME != null) {
sql = sql + getAndConSql(sql, GOODSNAME, " EXISTS (select 1 from wms_in where wms_in.associatedno=wms.GID and wms_in.GOODSNAME like '%" + GOODSNAME + "%')");
}
var COUNTRYID = this.comboxCountry.getValue();
if (COUNTRYID != '' && COUNTRYID != null) {
sql = sql + getAndConSql(sql, COUNTRYID, " EXISTS (select 1 from wms_in where wms_in.ASSOCIATEDNO=wms.GID and wms_in.countryid='" + COUNTRYID + "') ");
}
var CONTRACTNO = form.findField('CONTRACTNO').getValue();
if (CONTRACTNO != '' && CONTRACTNO != null) {
sql = sql + getAndConSql(sql, CONTRACTNO, " CONTRACTNO like '%" + CONTRACTNO + "%'");
}
var CNTRNO = form.findField('CNTRNO').getValue();
if (CNTRNO != '' && CNTRNO != null) {
sql = sql + getAndConSql(sql, CNTRNO, " EXISTS (select 1 from wms_in where wms_in.ASSOCIATEDNO=wms.GID and wms_in.CNTRNO='" + CNTRNO + "') ");
}
return sql;
},
onClearSql: function () {
var form = this.formSearch.getForm();
form.reset();
//this.InitData();
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.EditRecord;
ret[4] = this.OPLBNAME;
return ret;
},
onSendXMLClick: function () {
var selectedRecords = [];
selectedRecords = this.gridList.selModel.getSelection();
var selectStores = [];
for (var i = 0; i < selectedRecords.length; i++) {
selectStores.push(selectedRecords[i].data);
}
var wmsnos = '';
for (var i = 0; i < selectedRecords.length; i++) {
wmsnos += "'" + selectedRecords[i].data.WMSNO + "',";
}
if (wmsnos.length <= 0) {
Ext.Msg.show({ title: '提示', msg: '请选择入库数据', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
wmsnos = wmsnos.substr(0, wmsnos.length - 1);
}
Ext.Msg.wait('正在查询数据...');
Ext.Ajax.request({
waitMsg: '正在查询数据...',
url: '/MvcShipping/WMSNew/GetXMLMessageWithWMSNO',
params: {
WMSNO: wmsnos
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
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
}, onPrintClick: function (button, event) {
// var printType = 'WmsInfoReport_opseai'; //海运进口 入库明细
var printType = 'WmsInfoReportNewList';
var uid = USERID;
var sql1 = "select * from wms ";
var wherestr = this.getCondition();
if (wherestr != '') {
sql1 += "where 1=1 and " + wherestr;
}
sql1 += " order by WMSDATE ";
PrintComm(printType, sql1);
},
PrintSelect: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var selectedRecords = [];
var storeadd = null;
selectedRecords = this.WMSCB.selected.items;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GID') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var bsno = '11111';
var mblno = '';
var printType = 'WmsInfoReportNewListSelect';
var sql1 = "select * from wms WHERE GID IN (" + feeGidSql + ") order by WMSDATE DESC";
var sql2 = "";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6,"");
},
onSendXML2Click: function () {
var selectedRecords = [];
selectedRecords = this.gridList.selModel.getSelection();
var selectStores = [];
for (var i = 0; i < selectedRecords.length; i++) {
selectStores.push(selectedRecords[i].data);
}
var wmsnos = '';
for (var i = 0; i < selectedRecords.length; i++) {
wmsnos += "'" + selectedRecords[i].data.WMSNO + "',";
}
if (wmsnos.length <= 0) {
Ext.Msg.show({ title: '提示', msg: '请选择入库数据', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
wmsnos = wmsnos.substr(0, wmsnos.length - 1);
}
Ext.Msg.wait('正在查询数据...');
Ext.Ajax.request({
waitMsg: '正在查询数据...',
url: '/MvcShipping/WMSNew/GetXMLMessage4001WithWMSBSNO',
params: {
WMSBSNO: wmsnos,
type: 0
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
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
}
});