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

976 lines
35 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, {
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
initUIComponents: function () {
this.formname = 'WMSNewList';
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
model: 'WMSNewListModel',
pageSize: 30,
// autoLoad: { start: 0, limit: 30 },
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/WMSNew/GetDataList_LTJY',
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: 120
}, {
sortable: true,
dataIndex: 'ISLOCK',
header: '是否入账',
width: 80,
renderer: function (value, cellmeta) {
if (value == '1' || value == true || value == 'true') {
return "是";
} else {
return "否";
}
}
}, {
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: 120
}, {
sortable: true,
dataIndex: 'STORAGENAME',
header: '仓库名称',
width: 120
}, {
sortable: true,
dataIndex: 'ARCLIENT',
header: '应收客户',
width: 120
}, {
sortable: true,
dataIndex: 'TRUCKNAME',
header: '应付客户',
width: 120
}, {
sortable: true,
dataIndex: 'GOODSNAME',
header: '品名',
width: 120
}, {
sortable: true,
dataIndex: 'GOODSMODEL',
header: '牌号',
width: 120
}, {
sortable: true,
dataIndex: 'GOODSPACK',
header: '入库件数',
width: 60
}, {
sortable: true,
dataIndex: 'GOODSPACKSTOCK',
header: '剩余件数',
width: 80
}, {
sortable: true,
dataIndex: 'GOODSRKSL',
header: '入库量',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value) {
return Ext.util.Format.number(value, '0.00');
}
}, {
sortable: true,
dataIndex: 'GOODSSTOCK',
header: '库存量',
width: 80,
summaryType: 'sum',
summaryRenderer: function (value) {
return Ext.util.Format.number(value, '0.00');
}
}, {
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: 100
}, {
sortable: true,
dataIndex: 'STARTBILLINGDATE',
header: '开始计费日期',
width: 100
}, {
sortable: true,
dataIndex: 'MARKETVALUE',
header: '市场货值',
width: 80
}, {
sortable: true,
dataIndex: 'BANKVALUE',
header: '银行货值',
width: 80
}, {
sortable: true,
dataIndex: 'PICIHAO',
header: '批次号',
width: 80
}, {
sortable: true,
dataIndex: 'AREACODE',
header: '库位编码',
width: 80
},
{
sortable: true,
dataIndex: 'FilePath',
header: '附件文件名',
width: 200,
//return '<a href="' + record.data.Driect_URL + '" style=' + '"text-decoration:none"' + ' >' + value + '</a>';
renderer: function (value, p, record) {
if (value == '') {
//return '<input type="button" value="上传" onClick="javascript:this.UpLoadFile('+record.data.BillNo+')"';
return '右键上传附件'
} else
return '<a href="' + value + '" style=' + '"text-decoration:none" target="_blank"' + ' > 已有附件 </a>';
}
}
];
this.girdcolums = this.columns;
this.girdcolums = DsTruck.GetGridPanel(GID, this.formname, this.girdcolums, 0); //使用者id表名中间column数组跳过一开始的几列
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
selModel: this.WMSCB,
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
columns: this.girdcolums,
bbar: [{
xtype: 'pagingtoolbar',
store: this.storeList,
displayInfo: true
}]
});
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
DsOpenEditWin("/MvcShipping/WMSNew_LTJY/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',
valueField: 'value',
displayField: 'text',
store: cbStore1,
fieldLabel: '是否保税业务'
});
//所属仓库
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.storeGoodsname = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DICModel',
proxy: { url: '/CommMng/TruckBasicDataRef/GetCommaWord' }
});
this.storeGoodsname.load({ params: { tablename: "WMS_IN", columnname: "GoodsName", condition: ""} });
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '品名',
store: this.storeGoodsname,
forceSelection: false,
name: 'GOODSNAME',
valueField: 'KEYFIELD',
displayField: 'KEYFIELD',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//委托单位
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'
});
//#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',
flex: 1,
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: '编号/箱号',
name: 'NO',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '入库时间(从)',
name: 'WMSDATE',
format: 'Y-m-d',
xtype: 'datefield',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '入库时间(到)',
name: 'WMSDATETO',
format: 'Y-m-d',
xtype: 'datefield',
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, this.comboxCustCode
//,this.comboxCountry
]
}, { xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [
this.comboxSTORAGENAME,
this.comboxGOODSNAME,
//cbType,
{
fieldLabel: '牌号',
name: 'GOODSMODEL'
}, { xtype: 'hiddenfield'
}
]
}
]//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_LTJY/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: "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
}
]
});
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.storeList.on('beforeload', function (store) {
var sql = this.getCondition();
Ext.apply(store.proxy.extraParams, { condition: sql });
}, this);
this.gridList.addListener('itemcontextmenu', this.itemcontextmenu);
this.onRefreshClick();
}, //end initUIComponents
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.storeList.load({
params: { start: 0, limit: 30, 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
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = '';
/*
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 NO = form.findField('NO').getValue();
sql = sql + getAndConSql(sql, NO, " ( BLNO like '%" + NO + "%' OR WMSNO like '%" + NO + "%' OR CUSTNO like '%" + NO + "%' OR (SELECT 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, WMSDATE, " 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.BSNO=wms.GID and wms_in.countryid='" + COUNTRYID + "') ");
}*/
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
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;
}
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
}
,
// gridList_Edit的右键菜单
itemcontextmenu: function (his, record, item, index, e) {
// itemcontextmenu( Ext.view.View this, Ext.data.Model record,
// HTMLElement item, Number index, Ext.EventObject e, Object eOpts )
// 分类代码表的右键菜单
e.preventDefault();
e.stopEvent(); // 取消浏览器默认事件
_this = this;
var array = [
{
text: '上传附件',
handler: function () {
this.SelectedRecord = record;
//BillNo ShipCompanyRef
var BillNo = record.data.WMSNO;
me = this;
var imgform = new Ext.FormPanel({
region: 'center',
labelWidth: 40,
frame: true,
bodyStyle: 'padding:5px 5px 0',
autoScroll: true,
border: false,
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'LoadFile',
name: 'LoadFile',
emptyText: '请选择文件',
fieldLabel: '文件',
buttonText: '选择文件',
allowBlank: false,
buttonCfg: { iconCls: 'uploaddialog' },
anchor: '98%'
}],
buttons: [{
text: '上传',
type: 'submit',
handler: function () {
var UserFilePath = Ext.getCmp('LoadFile').getValue();
if (!imgform.form.isValid()) { return; }
imgform.form.submit({
url: '/TruckMng/PcHeadEdit_LTJY/UploadFile_WMS',
waitMsg: '正在上传',
method: 'POST',
submitEmptyText: false,
async: false,
params: {
BillNo: BillNo,
TABLENAME:"WMS"
},
success: function (form, action) {
win.close(this);
Ext.Msg.show({ title: '提示', msg: '上传成功!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
failure: function (form, action) {
form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
Ext.MessageBox.alert('警告', action.result.Message);
}
});
}
}, {
text: '关闭',
type: 'submit',
handler: function () {
win.close(this);
}
}]
});
var win = new Ext.Window({
title: "上传文件",
width: 360,
height: 120,
modal: true,
resizable: false,
border: false,
items: imgform
});
win.show();
}
}
];
var nodemenu = new Ext.menu.Menu({
items: array
});
nodemenu.showAt(e.getXY()); // 菜单打开的位置
}
});