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/MvcContainer/Viewsjs/MsOpPrice/MsOpPriceSeaeIndex.js

979 lines
35 KiB
JavaScript

3 years ago
Ext.namespace('Shipping');
Shipping.MsOpPriceSeaeIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsOpPriceSeaeIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsOpPriceSeaeIndex, Ext.Panel, {
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
PageSize: 100,
sortfield: '',
sortdire: '',
initUIComponents: function () {
this.formname = "formOpPriceSeaeIndex" + PRICETYPE; //页面名称
var salefield = [
{ name: 'GID', type: 'string' },
{ name: 'PRICETYPE', type: 'string' },
{ name: 'LINE', type: 'string' },
{ name: 'COUNTRY', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'TRANSPORT', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'WEEKETD', type: 'string' },
{ name: 'VOYAGE', type: 'string' },
{ name: 'VALIDETD', type: 'string' },
{ name: 'SERVICE', type: 'string' },
{ name: 'GOODTYPE', type: 'string' },
{ name: 'CTNSTATUS', type: 'string' },
{ name: 'AGENTNAME', type: 'string' },
{ name: 'AGENTATTN', type: 'string' },
{ name: 'AGENTADDR', type: 'string' },
{ name: 'DEBITCORPNAME', type: 'string' },
{ name: 'PRICEDATE', type: 'string' },
{ name: 'TOTALRMB', type: 'string' },
{ name: 'TOTALUSD', type: 'string' },
{ name: 'TOTALJPY', type: 'string' },
{ name: 'TOTALEUR', type: 'string' },
{ name: 'OTRMB', type: 'string' },
{ name: 'OTUSD', type: 'string' },
{ name: 'OTJPY', type: 'string' },
{ name: 'OTEUR', type: 'string' },
{ name: 'REMARKS', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'INPUTBYREF', type: 'string' },
{ name: 'OP', type: 'string' },
{ name: 'OPREF', type: 'string' },
{ name: 'INPUTTIME', type: 'string' },
{ name: 'COMPANYID', type: 'string' }
];
this.initgirdcolums = [{
sortable: true,
dataIndex: 'GID',
header: 'GID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'COMPANYID',
header: 'COMPANYID',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'PRICETYPE',
header: 'PRICETYPE',
hidden: true,
width: 120
}, {
sortable: true,
dataIndex: 'LINE',
header: '航线',
width: 100
}, {
sortable: true,
dataIndex: 'COUNTRY',
header: '国家',
width: 100
}, {
sortable: true,
dataIndex: 'PORTLOAD',
header: '起运港',
width: 100
}, {
sortable: true,
dataIndex: 'PORTDISCHARGE',
header: '目的港',
width: 100
}, {
sortable: true,
dataIndex: 'TRANSPORT',
header: '中转港',
width: 100
}, {
sortable: true,
dataIndex: 'CARRIER',
header: '船公司',
width: 100
}, {
sortable: true,
dataIndex: 'WEEKETD',
header: '船期',
width: 100
}, {
sortable: true,
dataIndex: 'VOYAGE',
header: '航程',
width: 100
}, {
sortable: true,
dataIndex: 'VALIDETD',
header: '有效期',
width: 100
}, {
sortable: true,
dataIndex: 'SERVICE',
header: '运输条款',
width: 100
}, {
sortable: true,
dataIndex: 'CTNSTATUS',
header: '箱状态',
width: 100
}, {
sortable: true,
dataIndex: 'OTRMB',
header: 'RMB其他',
width: 100
}, {
sortable: true,
dataIndex: 'OTUSD',
header: 'USD其他',
width: 100
}, {
sortable: true,
dataIndex: 'OTJPY',
header: 'JPY其他',
width: 100
}, {
sortable: true,
dataIndex: 'OTEUR',
header: 'EUR其他',
width: 100
}, {
sortable: true,
dataIndex: 'TOTALRMB',
header: '合计RMB',
width: 100
}, {
sortable: true,
dataIndex: 'TOTALUSD',
header: '合计USD',
width: 100
}, {
sortable: true,
dataIndex: 'TOTALJPY',
header: '合计JPY',
width: 100
}, {
sortable: true,
dataIndex: 'TOTALEUR',
header: '合计EUR',
width: 100
}, {
sortable: true,
dataIndex: 'REMARKS',
header: '备注',
width: 200
}, {
sortable: true,
dataIndex: 'INPUTBYREF',
header: '录入人',
width: 100
}, {
sortable: true,
dataIndex: 'INPUTTIME',
header: '录入时间',
width: 100
}
];
this.girdcolums = this.initgirdcolums;
_this = this;
Ext.Ajax.request({
url: '/MvcContainer/MsOpPrice/GetUNITLIST',
async: false,
params: {
condition: " b.PRICETYPE='" + PRICETYPE + "'"
},
success: function (response) {
var json = Ext.JSON.decode(response.responseText);
var aaa = json.data;
for (i = 0; i < aaa.length; i += 1) {
var itemindex = i + 1;
var memberyf = aaa[i];
salefield.push({ name: 'HYF' + memberyf.UNIT+memberyf.CURRENCY, type: 'number' });
var isfind = false;
for (var j = 0; j < _this.girdcolums.length; j++) {
if (_this.girdcolums[j].dataIndex == 'HYF' + memberyf.UNIT)
isfind = true;
};
if (!isfind)
_this.girdcolums.push({
dataIndex: 'HYF' + memberyf.UNIT + memberyf.CURRENCY,
text: memberyf.UNIT + '(' + memberyf.CURRENCY + ')',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
});
};
},
failure: function (request) {
Ext.MessageBox.show({
title: '操作提示',
msg: "连接服务器失败",
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
},
method: 'get'
});
Ext.define('MsOpPrice', {
extend: 'Ext.data.Model',
fields: salefield
});
//定义数据集
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpPrice',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpPrice/GetListData',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storePLList = Ext.create('Ext.data.Store', {
model: 'MsOpPrice'
});
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 30
});
this.GridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_this = this;
//定义Grid
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
selModel: this.GridCheckBoxModel,
columns: this.girdcolums
,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeList,
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
})
});
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname, this.girdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
// this.InitGrid(this.girdcolums, '');
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
// DsOpenEditWin('/MvcContainer/MsOpPrice/SeaeEdit', record.data.GID);
var openSet = "height=500, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 500) / 2 + ",Left= " + (screen.width - 600) / 2
var openType = record.data.GID;
var openUrl = "/MvcContainer/MsOpPrice/SeaeEdit";
if (PRICETYPE == "2")
openUrl = "/MvcContainer/MsOpPrice/SeaiEdit";
window.open(openUrl, openType, openSet);
}, this);
this.gridList.addListener('sortchange', function (ct, column, direction, eOpts) {
this.sortfield = column.dataIndex;
this.sortdire = direction;
}, this);
this.gridList.columns[1] = new Ext.grid.RowNumberer();
//#region formSearch 查询面板
this.storeLANE = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.Lane',
proxy: { url: '/CommMng/BasicDataRef/GetCodeLaneList' }
});
this.storeLANE.load();
this.comboxLANE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '航线',
store: this.storeLANE,
name: 'LANE',
valueField: 'LANE',
displayField: 'LANE',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storeCodeDisport = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
this.storeCodeDisport.load();
this.comboxPORTDISCHARGE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '目的港',
store: this.storeCodeDisport,
name: 'PORTDISCHARGE',
valueField: 'PORT',
queryMode: 'local',
displayField: 'PORT',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
this.storePORTLOAD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeDisportModel',
autoLoad: true,
proxy: { url: '/CommMng/BasicDataRef/GetCodeDisportList' }
});
this.storePORTLOAD.load();
this.comboxPORTLOAD = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '起运港',
store: this.storePORTLOAD,
name: 'PORTLOAD',
valueField: 'PORT',
queryMode: 'local',
displayField: 'PORT',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
//客户加载_船公司
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
//船公司
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '船公司',
store: this.storeCARRIER,
forceSelection: true,
name: 'CARRIER',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
_this = this;
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.comboxPORTLOAD, this.comboxPORTDISCHARGE, this.comboxLANE, this.comboxCARRIER, {
fieldLabel: '录入日期',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDbgn',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
fieldLabel: '到',
format: 'Y-m-d',
xtype: 'datefield',
name: 'ETDend',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}, {
xtype: 'button',
width: 90,
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
},
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
}]
}
]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
//查询工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [
{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationStatus = 'add';
var openSet = "height=500, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 500) / 2 + ",Left= " + (screen.width - 600) / 2
var openType = "";
var openUrl = "/MvcContainer/MsOpPrice/SeaeEdit";
if (PRICETYPE == "2")
openUrl = "/MvcContainer/MsOpPrice/SeaiEdit";
window.open(openUrl, openType, openSet);
// DsOpenEditWin('/MvcContainer/MsOpPrice/SeaeEdit');
},
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) {
},
scope: this
}, '-',
{
text: "打印",
iconCls: 'btnprint',
menu: [
{ text: "全部",
handler: function (menu, event) {
_this.Print();
}
}, { text: "选择打印",
handler: function (menu, event) {
_this.PrintSelect();
}
}],
scope: this
}, '-', {
text: "保存列表样式",
menu: [
{ text: "保存",
handler: function (button, event) {
this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.girdcolums, 1, true);
}
}, { text: "初始化",
handler: function (menu, event) {
_this.InitGrid(_this.initgirdcolums);
_this.girdcolums = DsTruck.SaveGridPanel(USERID, _this.formname, _this.gridList.columns, _this.initgirdcolums, 1, true);
}
}],
scope: this
},
'-',
{
text: "批量费用修改",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onPiLiangFeeClick(button, event);
},
scope: this
}
]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
items: [this.formSearch, this.panelBtn]
});
Ext.apply(this, {
items: [this.panelTop, this.gridList]
});
this.storeList.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext, pricetype: PRICETYPE });
}, this);
this.sqlcontext = '';
this.gridList.reconfigure(this.storeList, this.girdcolums);
this.onRefreshClick();
// this.InitGrid(this.girdcolums,this.sqlcontext);
}, //end initUIComponents
InitGrid: function (grid, condition) {
var zlcolumn = [];
var hyfcolumn = [];
var myfield = [];
var salefield = [
{ name: 'GID', type: 'string' },
{ name: 'PRICETYPE', type: 'string' },
{ name: 'LINE', type: 'string' },
{ name: 'COUNTRY', type: 'string' },
{ name: 'PORTLOAD', type: 'string' },
{ name: 'PORTDISCHARGE', type: 'string' },
{ name: 'TRANSPORT', type: 'string' },
{ name: 'CARRIER', type: 'string' },
{ name: 'WEEKETD', type: 'string' },
{ name: 'VOYAGE', type: 'string' },
{ name: 'VALIDETD', type: 'string' },
{ name: 'SERVICE', type: 'string' },
{ name: 'GOODTYPE', type: 'string' },
{ name: 'CTNSTATUS', type: 'string' },
{ name: 'AGENTNAME', type: 'string' },
{ name: 'AGENTATTN', type: 'string' },
{ name: 'AGENTADDR', type: 'string' },
{ name: 'DEBITCORPNAME', type: 'string' },
{ name: 'PRICEDATE', type: 'string' },
{ name: 'TOTALRMB', type: 'string' },
{ name: 'TOTALUSD', type: 'string' },
{ name: 'OTRMB', type: 'string' },
{ name: 'OTUSD', type: 'string' },
{ name: 'REMARKS', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'INPUTBYREF', type: 'string' },
{ name: 'INPUTTIME', type: 'string' },
{ name: 'COMPANYID', type: 'string' }
];
var storeMonthData = Ext.create('DsExt.ux.RefTableStore', {
fields: [
{ name: 'UNIT', type: 'string' }
],
proxy: { url: '/MvcContainer/MsOpPrice/GetUNITLIST' }
});
_this = this;
storeMonthData.load({ params: { condition: condition },
callback: function (r, options, success) {
if (success) {
if (r.length != 0) {
for (i = 0; i < storeMonthData.getCount(); i += 1) {
var itemindex = i + 1;
var memberyf = storeMonthData.getAt(i);
myfield.push({ name: 'HYF' + memberyf.data.UNIT, type: 'number' });
var isfind = false;
for (var j = 0; j < grid.length; j++) {
if (grid[j].dataIndex == 'HYF' + memberyf.data.UNIT)
isfind = true;
};
if (!isfind)
grid.push({
dataIndex: 'HYF' + memberyf.data.UNIT,
text: memberyf.data.UNIT,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>'; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
});
};
}
for (var k in myfield) {
salefield.push(myfield[k]);
}
Ext.define('MsOpPrice', {
extend: 'Ext.data.Model',
fields: salefield
});
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'MsOpPrice',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcContainer/MsOpPrice/GetListData',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
var agirdcolums = grid;
// this.storeList.on('beforeload', function (store) {
// Ext.apply(store.proxy.extraParams, { condition: _this.sqlcontext });
// }, this);
// this.girdcolums = agirdcolums;
// this.gridList.reconfigure(this.storeList, grid);
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext, pricetype: PRICETYPE },
waitMsg: "正在查询数据...",
scope: this
});
this.gridList.reconfigure(this.storeList, this.girdcolums);
}
},
scope: this
});
},
onRefreshClick: function (button, event) {
var sql = this.getCondition();
this.sqlcontext = sql;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: _this.sqlcontext, pricetype: PRICETYPE },
waitMsg: "正在查询数据...",
scope: this
});
},
onDsQuery: function () {
var sql = this.sqlcontext;
this.storeList.load({
params: { start: 0, limit: this.PageSize, sort: '', condition: sql, pricetype: PRICETYPE },
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') {
var bodyAddDatas = [];
for (var i = 0; i < selections.length; i++) {
var rec = selections[i];
bodyAddDatas.push(rec);
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcContainer/MsOpPrice/Delete',
params: {
data: jsonbodyAddDatas
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.onRefreshClick();
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
onPiLiangFeeClick: function (button, event) {
var GidStr = '';
var records = this.GridCheckBoxModel.selected.items;
if (records.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.storePLList.removeAll();
for (var i = 0; i < records.length; i++) {
var rec = records[i];
this.storePLList.add(rec.data);
}
_this = this;
if (this.storePLList.length == 0) {
Ext.Msg.show({ title: '提示', msg: '没有要更新的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
DsOpenEditWin('/MvcContainer/MsOpPrice/PiLiangFeeEdit');
}
},
getCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return '';
}
var sql = " b.PRICETYPE='" + PRICETYPE + "'";
var PORTLOAD = form.findField('PORTLOAD').getValue();
sql = sql + getAndConSql(sql, PORTLOAD, " b.PORTLOAD like '%" + PORTLOAD + "%' ");
var PORTDISCHARGE = form.findField('PORTDISCHARGE').getValue();
sql = sql + getAndConSql(sql, PORTDISCHARGE, " b.PORTDISCHARGE like '%" + PORTDISCHARGE + "%' ");
var LANE = form.findField('LANE').getValue();
sql = sql + getAndConSql(sql, LANE, " b.LINE='" + LANE + "'");
var CARRIER = form.findField('CARRIER').getValue();
sql = sql + getAndConSql(sql, CARRIER, " b.CARRIER='" + CARRIER + "'");
var expDateBgn = form.findField('ETDbgn').getRawValue();
sql = sql + getAndConSql(sql, expDateBgn, "b.INPUTTIME >='" + expDateBgn + "'");
var expDateEnd = form.findField('ETDend').getRawValue();
sql = sql + getAndConSql(sql, expDateEnd, "b.INPUTTIME <='" + expDateEnd + " 23:59:59'");
return sql;
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
ret[1] = this.storeList;
ret[2] = this.SelectedRecord;
ret[3] = this.storePLList;
return ret;
},
Print: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var bsno = '11111';
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var sortstr = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
Ext.Msg.wait('正在组织数据, 请稍侯..');
Ext.Ajax.request({
waitMsg: '正在组织数据...',
url: '/MvcContainer/MsOpPrice/GetListData',
scope: this,
params: {
condition: _this.sqlcontext,
printstr: 'true',
pricetype: PRICETYPE,
sort: sortstr
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var returnstr = jsonresult.data;
var printType = 'MSOPPRICE';
var sql1 = returnstr;
var sql2 = "select * from op_price where GID='" + bsno + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
} 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
});
}
}
});
},
PrintSelect: function () {
_this = this;
if (this.storeList.getCount() == 0) {
return;
}
var selectedRecords = [];
var storeadd = null;
selectedRecords = this.GridCheckBoxModel.selected.items;
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择要打印的业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var sortstr = '';
if (this.sortfield != '' && this.sortdire != '') {
sortstr = this.sortfield + ' ' + this.sortdire;
}
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 selections = this.gridList.getSelectionModel().getSelection();
if (selections.length != 0) {
var record = selections[0];
bsno = record.data.GID;
}
var printType = 'MSOPPRICESELECT';
var sql1 = "select * from op_price WHERE GID IN (" + feeGidSql + ") order by " + sortstr;
var sql2 = "select * from op_price where GID='" + bsno + "'";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6);
}
});