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/MsOpSeai/OPWMSCHANGEIndex.js

369 lines
12 KiB
JavaScript

Ext.namespace('Shipping');
Shipping.OPWMSCHANGEIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.OPWMSCHANGEIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.OPWMSCHANGEIndex, Ext.Panel, {
PageSize: 20,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
EditRecord: null,
BsNo: '',
mainWin: null,
initUIComponents: function () {
var mainform = window.panelEdit;
this.EditRecord = mainform.editRecord;
this.BsNo = this.EditRecord.get('CUSTOMNO');
this.mainWin = getMainForm(window.parent.opener);
this.formname = "OPWMSCHANGEIndex"; //页面名称
//定义数据集
Ext.define('OP_WMS_CHANGE_BILLModel', {
extend: 'Ext.data.Model',
idProperty: 'init',
fields: [
{ name: 'init', type: 'string' },
{ name: 'mblno', type: 'string' },
{ name: 'CUSTOMNO', type: 'string' },
{ name: 'CHANGETYPE', type: 'string' },
{ name: 'DODATE', type: 'string' },
{ name: 'PKGS', type: 'string' },
{ name: 'KGS', type: 'string' },
{ name: 'NETWEIGHT', type: 'string' },
{ name: 'STORAGEUNITCOUNT', type: 'string' },
{ name: 'PKGS2', type: 'string' },
{ name: 'KGS2', type: 'string' },
{ name: 'NETWEIGHT2', type: 'string' },
{ name: 'STORAGEUNITCOUNT2', type: 'string' },
{ name: 'PKGS3', type: 'string' },
{ name: 'KGS3', type: 'string' },
{ name: 'NETWEIGHT3', type: 'string' },
{ name: 'STORAGEUNITCOUNT3', type: 'string' },
]
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'OP_WMS_CHANGE_BILLModel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsOpSeai/GetOP_WMS_CHANGE_BILL',
reader: {
id: 'init',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//#region List列表显示信息
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.girdcolums = [{
sortable: true,
hidden: true,
dataIndex: 'init',
header: '', //'业务编号',
width: 0
},
{
sortable: true,
dataIndex: 'mblno',
header: Zi.LAN.MBLNO, //'仓储类型',
width: 140
},
{
sortable: true,
dataIndex: 'CUSTOMNO',
header: Zi.LAN.CUSTOMNO, //'仓储类型',
width: 160
},
{
sortable: true,
dataIndex: 'CHANGETYPE',
header: '库存变动',
width: 60
},
{
sortable: true,
dataIndex: 'DODATE',
header: '执行日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
},
{
sortable: true,
dataIndex: 'PKGS',
header: '变动件数',
width: 80
},
{
sortable: true,
dataIndex: 'KGS',
header: '变动毛重(kg)',
width: 80
},
{
sortable: true,
dataIndex: 'NETWEIGHT',
header: '变动净重(kg)',
width: 80
},
{
sortable: true,
dataIndex: 'STORAGEUNITCOUNT',
header: '变动计费数量',
width: 80
}
//,
//{
// sortable: true,
// dataIndex: 'PKGS2',
// header: '变动前件数',
// width: 80
//},
//{
// sortable: true,
// dataIndex: 'KGS2',
// header: '变动前毛重(kg)',
// width: 80
//},
//{
// sortable: true,
// dataIndex: 'NETWEIGHT2',
// header: '变动前净重(kg)',
// width: 80
//},
//{
// sortable: true,
// dataIndex: 'STORAGEUNITCOUNT2',
// header: '变动前计费数量',
// width: 80
//},
//{
// sortable: true,
// dataIndex: 'PKGS3',
// header: '变动后件数',
// width: 80
//},
//{
// sortable: true,
// dataIndex: 'KGS3',
// header: '变动后毛重(kg)',
// width: 80
//},
//{
// sortable: true,
// dataIndex: 'NETWEIGHT3',
// header: '变动后净重(kg)',
// width: 80
//},
//{
// sortable: true,
// dataIndex: 'STORAGEUNITCOUNT3',
// header: '变动后计费数量',
// width: 80
//}
];
this.GridCheckBoxFenModel = Ext.create('Ext.selection.CheckboxModel');
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.ShuJuJiaZaiZhongQingShaoDeng},
trackMouseOver: true,
selModel: this.GridCheckBoxFenModel,
disableSelection: false,
columns: this.girdcolums,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: Zi.LAN.displayMsg,
emptyMsg: Zi.LAN.emptyMsg
})
});
/////////////以下部分为获取存储的gridpanel显示样式
// this.column = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.gridList.columns[0] = new Ext.grid.RowNumberer();
////////////////////////////////////////////////
//this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
// this.SelectedRecord = record;
// this.OprationStatus = 'edit';
// DsOpenEditWin('/MvcShipping/MsOpSeai/Edit', "分票信息");
//}, this);
_thisfenlist = this;
//按钮工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: Zi.LAN.btnrefresh,
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 30,
items: [this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
this.onRefreshClick();
1 year ago
//this.storeList.on('beforeload', function (store) {
// var CUSTOMNO = this.BsNo;
// Ext.apply(store.proxy.extraParams, { CUSTOMNO: CUSTOMNO });
//}, this);
}, //end initUIComponents
onRefreshClick: function (button, event) {
//var girdcolums = this.gridList.getColumnMode();
var CUSTOMNO = this.BsNo;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', CUSTOMNO: CUSTOMNO },
waitMsg: "正在查询数据...",
scope: this
});
},
onDeleteClick: function (button, event) {
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: Zi.LAN.TiShi, msg: Zi.LAN.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
if (record.data.BSSTATUS == 'true') {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.YeWuYiSuoDingBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //'警告', '业务已锁定,不允许删除!'
return;
}
if (record.data.FEESTATUS == 'true') {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.FeiYongYiSuoDingBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK }); //'警告', 费用已锁定,不允许删除!'
return;
}
if (this.StoreOpRange.getCount() == 0) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
} else {
var op = record.data.OP;
var inputby = record.data.INPUTBY;
var records = DsStoreQueryBy(this.StoreOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
var recordins = DsStoreQueryBy(this.StoreOpRange, 'OPID', inputby);
if (recordins.getCount() > 0) {
} else {
canedit = false;
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: Zi.LAN.QuanXianBuZuBuYunXuShanChu, icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
}
}
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
if (btn == 'yes') {
Ext.Msg.wait(Zi.LAN.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu,
url: '/MvcShipping/MsOpSeai/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: Zi.LAN.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.JingGao, msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) { },
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
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.mainWin;
return ret;
},
//#region 打印
Print: function () {
var basicForm = this.formHead.getForm();
var MASTERNO = this.BsNo;
var printType = 'MSOPSEAIFENLIST';
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_seai WHERE BSNO = '" + MASTERNO + "'";
var sql1 = "SET LANGUAGE 'us_english' SELECT * FROM op_seai WHERE MASTERNO = '" + MASTERNO + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
//#endregion
});