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/RptCwGLDetailColumnChart/RptCwGLDetailColumnChartInd...

1347 lines
62 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.

var hitColumn;
var gloabAccType = 0;
var objName = "";
Ext.namespace('Shipping');
Shipping.RptCwGLDetailColumnChartIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.RptCwGLDetailColumnChartIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.RptCwGLDetailColumnChartIndex, Ext.Panel, {
PageSize: 1000,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1<0',
acctype: 1,
isInitData: 0,
strCwSTARTGID: '',
initUIComponents: function () {
this.formname = 'RptCwGLDetailColumnChartIndex'; //图表分析
//#region 列表数据
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'OBJNAME', type: 'string' },
{ name: 'OBJNUM', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/RptCwGLDetailColumnChart/GetDataList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.initgirdcolums = [{
sortable: true,
dataIndex: 'OBJNAME',
header: '分析对象',
width: 120
}, {
sortable: true,
dataIndex: 'OBJNUM',
header: '数据',
align: 'right',
width: 120,
summaryType: 'sum',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
if (parseFloat(value) < 0) {
return '<SPAN style="COLOR: red">' + value + '</SPAN>';
}
return value;
},
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
}
}];
this.girdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'bs', this.initgirdcolums, 1);
this.gridList = new Ext.grid.GridPanel({
store: this.storeList,
enableHdMenu: false,
region: 'center',
loadMask: { msg: "数据加载中,请稍等..." },
trackMouseOver: true,
disableSelection: false,
columns: this.girdcolums,
features: [{
ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
}],
viewConfig: {
enableTextSelection: true, //允许复制数据
autoFill: true
}
});
//#endregion
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
/*this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
====this.SelectedRecord = record;
====var month = record.data.MONTHNAME;
====alert(hitColumn + " " + month);
====//if (hitColumn == undefined) { hitColumn = ""; }
====//openNewDiv("layer", "图表分析", 1083, 630, escape(month.substring(0, 4)), escape(month.substring(5)), hitColumn);
====hitColumn = "";
}, this);*/
this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
objName = record.data.OBJNAME; // OBJNAME;
//alert(month);
openNewDiv("layer", "图表分析", 1083, 630);
}, this);
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
//#region 图表数据
_this = this;
this.piechart = Ext.create('Ext.chart.Chart', {
xtype: 'chart',
region: 'center',
animate: true,
store: this.storeList,
shadow: true,
legend: {
position: 'right'
},
insetPadding: 60,
theme: 'Base:gradients',
series: [{
type: 'pie',
field: 'OBJNUM',
showInLegend: true,
donut: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function (storeItem, item) {
//calculate percentage.
var total = 0;
_this.storeList.each(function (rec) {
total += rec.get('OBJNUM');
});
this.setTitle(storeItem.get('OBJNAME') + ': ' + Math.round(storeItem.get('OBJNUM') / total * 100) + '%');
}
},
highlight: {
segment: {
margin: 20
}
},
label: {
field: 'OBJNAME',
display: 'rotate',
contrast: true,
font: '18px Arial'
}
}]
});
this.columnchart = Ext.create('Ext.chart.Chart', {
id: 'chartCmp',
xtype: 'chart',
style: 'background:#fff',
animate: true,
shadow: true,
store: this.storeList,
axes: [{
type: 'Numeric',
position: 'left',
fields: ['OBJNUM'],
label: {
//renderer: Ext.util.Format.numberRenderer('0,0')
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
if (parseFloat(value) < 0) {
return '<SPAN style="COLOR: red">' + value + '</SPAN>';
}
return value;
}
},
title: '数据',
grid: true,
minimum: 0
}, {
type: 'Category',
position: 'bottom',
fields: ['OBJNAME'],
title: '分析对象'
}],
series: [{
type: 'column',
axis: 'left',
highlight: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function (storeItem, item) {
this.setTitle(storeItem.get('OBJNAME') + ': ' + storeItem.get('OBJNUM'));
}
},
label: {
display: 'insideEnd',
'text-anchor': 'middle',
field: 'OBJNUM',
orientation: 'vertical',
color: '#333',
//renderer: Ext.util.Format.numberRenderer('0.00'),
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
if (parseFloat(value) < 0) {
return '<SPAN style="COLOR: red">' + value + '</SPAN>';
}
return value;
}
},
xField: 'OBJNAME',
yField: 'OBJNUM',
//color renderer
renderer: function (sprite, record, attr, index, store) {
var fieldValue = Math.random() * 20 + 10;
var color = ['rgb(213, 70, 121)',
'rgb(44, 153, 201)',
'rgb(146, 6, 157)',
'rgb(49, 149, 0)',
'rgb(249, 153, 0)',
'rgb(180, 50, 201)',
'rgb(150, 10, 10)',
'rgb(130, 10, 201)',
'rgb(120, 10, 10)'][index];
return Ext.apply(attr, {
fill: color
});
}
}]
});
//#endregion
//#region formSearch 下拉框信息加载
//科目加载
this.storeCwAccitems = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CwAccitemsGlModel',
proxy: { url: '/CommMng/BasicDataRef/GetCwAccitemsGl' }
});
this.storeCwAccitems.load({ params: { condition: "ISENABLE=1"} });
this.comboxACCNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '科目名称',
store: this.storeCwAccitems,
forceSelection: true, //输入值是否严格为待选列表中存在的值
allowBlank: false,
id: 'ACCID',
name: 'ACCID',
valueField: 'ACCID',
displayField: 'ACCIDNAME',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
//this.onRefreshClick();
if (_field.rawValue.toString() != "") {
var fValue = _field.rawValue.toString();
//alert(fValue);
if (fValue.indexOf("-") > -1) {
fValue = fValue.substr(0, fValue.indexOf("-"));
}
var ACCDATEbgn = Ext.getCmp('ACCDATE').getRawValue();
Ext.Ajax.request({
waitMsg: '正在查询汇率值...',
url: '/MvcShipping/RptCwGLDetailColumn/GetIsSubject',
params: {
condition: "ACCID='" + fValue + "'",
ACCDATEbgn: ACCDATEbgn
},
callback: function (options, success, response) {
var result = Ext.JSON.decode(response.responseText);
if (success) {
if (!result.Success) {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
_field.setValue("");
return;
}
//
Ext.getCmp('CustNAME').setValue("");
Ext.getCmp('DeptName').setValue("");
Ext.getCmp('SALE').setValue("");
Ext.getCmp('ITEMNAME').setValue("");
var strItem = result.Message.toString();
if (strItem == "") {
Ext.getCmp('SubjectAccount').hide();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
this.acctype = 1;
gloabAccType = 1;
}
else {
this.acctype = 2;
gloabAccType = 2;
Ext.getCmp('SubjectAccount').show();
this.storeSubjectAccount.load({ params: { condition: "ACCID='" + fValue + "'", ACCDATEbgn: ACCDATEbgn} });
argItems = result.Message.toString().split(",");
strItem = argItems[0].toString();
Ext.getCmp('SubjectAccount').setValue(strItem);
//
if (strItem == "客户") {
Ext.getCmp('CustNAME').show();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "部门") {
Ext.getCmp('DeptName').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "人员") {
Ext.getCmp('SALE').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "项目") {
Ext.getCmp('ITEMNAME').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
}
}
this.onRefreshClick();
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
_field.setValue("");
return;
//Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
var ACCDATEbgn = Ext.getCmp('ACCDATE').getRawValue();
Ext.Ajax.request({
waitMsg: '正在查询汇率值...',
url: '/MvcShipping/RptCwGLDetailColumn/GetIsSubject',
params: {
condition: "ACCID='" + _Field.value.toString() + "'",
ACCDATEbgn: ACCDATEbgn
},
callback: function (options, success, response) {
var result = Ext.JSON.decode(response.responseText);
if (success) {
if (!result.Success) {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
_Field.setValue("");
return;
}
//
Ext.getCmp('CustNAME').setValue("");
Ext.getCmp('DeptName').setValue("");
Ext.getCmp('SALE').setValue("");
Ext.getCmp('ITEMNAME').setValue("");
var strItem = result.Message.toString();
if (strItem == "") {
Ext.getCmp('SubjectAccount').hide();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
this.acctype = 1;
gloabAccType = 1;
}
else {
this.acctype = 2;
gloabAccType = 2;
Ext.getCmp('SubjectAccount').show();
this.storeSubjectAccount.load({ params: { condition: "ACCID='" + _Field.value.toString() + "'", ACCDATEbgn: ACCDATEbgn} });
argItems = result.Message.toString().split(",");
strItem = argItems[0].toString();
Ext.getCmp('SubjectAccount').setValue(strItem);
//
if (strItem == "客户") {
Ext.getCmp('CustNAME').show();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "部门") {
Ext.getCmp('DeptName').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "人员") {
Ext.getCmp('SALE').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "项目") {
Ext.getCmp('ITEMNAME').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
}
}
this.onRefreshClick();
} else {
Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
_Field.setValue("");
return;
//Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
}
}
}
});
//币别
this.storeCodeCurrency = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeCurrencyModel',
proxy: { url: '/MvcShipping/RptCwGLDetailColumn/GetCodeCurrencyList' }
});
this.storeCodeCurrency.load();
this.comboxCodeCurrency = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '币别',
store: this.storeCodeCurrency,
forceSelection: true,
id: 'cmbCURRENCY',
name: 'CURRENCY',
valueField: 'CODENAME',
displayField: 'CODENAME',
value: '综合本位币',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
this.onRefreshClick();
}
}
}
});
//客户加载
this.storeCustCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
});
this.storeCustCode.load({ params: { condition: ""} });
//this.storeCustCode.insert(0, { "GId": "", "CustCode": "", "CustName": "", "CodeAndName": "", "SALE": "" });
this.comboxCust = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '客户',
store: this.storeCustCode,
forceSelection: true,
id: 'CustNAME',
name: 'CustNAME',
valueField: 'CustName',
displayField: 'CodeAndName',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
this.onRefreshClick();
}
}
}
});
//部门加载
this.storeDept = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.DeptModel',
proxy: { url: '/CommMng/BasicDataRef/GetDeptList' }
});
this.storeDept.load({ params: { condition: ""} });
//this.storeDept.insert(0, { "Deptno": "", "DeptName": "", "Manage1": "" });
this.comboxDept = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '部门',
store: this.storeDept,
forceSelection: true,
id: 'DeptName',
name: 'DeptName',
valueField: 'DeptName',
displayField: 'DeptName',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
this.onRefreshClick();
}
}
}
});
//人员信息加载
this.storeOpCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserRefList' }
});
this.storeOpCode.load();
this.comboxSALE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '人员',
store: this.storeOpCode,
forceSelection: true,
id: 'SALE',
name: 'SALE',
valueField: 'UserName',
displayField: 'CodeAndName',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
this.onRefreshClick();
}
}
}
});
//项目加载
this.storeCwItem = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CwItemModel',
proxy: { url: '/CommMng/BasicDataRef/GetCwItemList' }
});
this.storeCwItem.load();
this.comboxCwItem = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '项目',
store: this.storeCwItem,
forceSelection: true,
id: 'ITEMNAME',
name: 'ITEMNAME',
valueField: 'ITEMNAME',
displayField: 'CodeAndName',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
this.onRefreshClick();
}
}
}
});
//核算项目
Ext.define('SubjectAccountModel', { extend: 'Ext.data.Model', fields: [{ name: 'DC', type: 'string' }, { name: 'NAME', type: 'string'}] });
this.storeSubjectAccount = Ext.create('DsExt.ux.RefTableStore', {
model: 'SubjectAccountModel',
proxy: { url: '/MvcShipping/RptCwGLDetailColumn/GetSubjectAccount' }
});
//this.storeSubjectAccount.load({ params: { condition: ""} });
this.comboxSubjectAccount = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '核算项目',
store: this.storeSubjectAccount,
forceSelection: true,
id: 'SubjectAccount',
name: 'SubjectAccount',
valueField: 'NAME',
displayField: 'NAME',
//value: '客户',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
Ext.getCmp('SubjectAccount').show();
Ext.getCmp('CustNAME').setValue("");
Ext.getCmp('DeptName').setValue("");
Ext.getCmp('SALE').setValue("");
Ext.getCmp('ITEMNAME').setValue("");
if (_Field.value.toString() == "客户") {
Ext.getCmp('CustNAME').show();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (_Field.value.toString() == "部门") {
Ext.getCmp('DeptName').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (_Field.value.toString() == "人员") {
Ext.getCmp('SALE').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (_Field.value.toString() == "项目") {
Ext.getCmp('ITEMNAME').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
}
this.onRefreshClick();
}
}
}
});
//#endregion
//#region formSearch 查询面板
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 60,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
id: 'rdOBJCHART',
//fieldLabel: '图形类别',
//flex: 2,
//columns: 2,
vertical: true,
listeners: {
change: function (the, newValue, oldValue, eOpts) {
if (newValue.OBJCHART == '柱状图') {
_this.panelchart.setVisible(false);
_this.panelcolumnchart.setVisible(true);
} else {
_this.panelchart.setVisible(true);
_this.panelcolumnchart.setVisible(false);
}
}
},
items: [{ boxLabel: '饼形图', name: 'OBJCHART', inputValue: '饼形图', checked: true },
{ boxLabel: '柱状图', name: 'OBJCHART', inputValue: '柱状图'}]
}, {
xtype: 'radiogroup',
id: 'rdOBJNUM',
//fieldLabel: '分析内容',
//flex: 2,
//columns: 2,
vertical: true,
items: [
{ id: 'rdoGain', boxLabel: '本期合计', name: 'OBJNUM', inputValue: '本期合计', checked: true },
{ id: 'rdoArrearage', boxLabel: '本年累计', name: 'OBJNUM', inputValue: '本年累计' }
],
listeners: {
change: function (rd, newValue, oldValue, eOpts) {
_this.onRefreshClick();
}
}
}, this.comboxCodeCurrency, this.comboxACCNAME, {
fieldLabel: '会计期间',
xtype: 'monthfield',
editable: false,
allowBlank: false, //是否允许为空
id: 'ACCDATE',
name: 'ACCDATE',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
}
}
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxSubjectAccount, this.comboxCust, this.comboxDept, this.comboxSALE, this.comboxCwItem]
}]//end items(fieldset 1)
}]//end root items
});
//#endregion formSearch
//#region 按钮工具条
this.CheckSaveQuery = new Ext.form.Checkbox({
fieldLabel: '记忆查询条件',
checked: true,
width: 120
});
_this = this;
this.SearchBtn = new Ext.Button({
text: '隐藏查询',
handler: function () {
if (_this.SearchBtn.text == '隐藏查询') {
_this.panelSearch.hide();
_this.SearchBtn.setText("显示查询");
} else {
_this.panelSearch.show();
_this.SearchBtn.setText("隐藏查询");
}
}
});
this.panelBtn = new Ext.Panel({
region: "center",
border: false,
tbar: [{
text: "执行查询",
iconCls: "btnrefresh",
handler: function (button, event) {
this.onRefreshClick(button, event);
var isvisible = true;
var issavevalue = false;
if (_this.SearchBtn.text == '隐藏查询') {
isvisible = true
}
else {
isvisible = false;
}
if (this.CheckSaveQuery.checked) {
issavevalue = true
}
saveQuerySetting(this.formname, this.formSearch, isvisible, issavevalue);
},
scope: this
}, '-', this.SearchBtn, {
xtype: 'button',
width: 90,
text: "清空条件",
iconCls: "btnreset",
handler: function (button, event) {
this.onClearSql(button, event);
},
scope: this
}, this.CheckSaveQuery]
});
//#endregion
//#region 页面布局
this.panelZQ = new Ext.Panel({
layout: "border",
region: "east",
width: 500,
style: 'text-align:right;',
border: false,
items: [{
xtype: 'displayfield',
id: 'lbTitle2',
name: 'lbTitle2',
value: "&nbsp;&nbsp;"
}]
});
this.panelTopF = new Ext.Panel({
layout: "border",
region: "north",
height: 28,
//border: false,
items: [this.panelBtn, this.panelZQ]
});
this.panelTop = new Ext.Panel({
layout: "border",
region: "north",
height: 28,
border: false,
items: [this.panelTopF]
});
this.panelSearch = new Ext.Panel({
layout: "border",
region: "north",
height: 75,
border: false,
items: [this.formSearch]
});
this.panelBodyChFee = new Ext.Panel({
title: '明细数据',
layout: "border",
region: 'east',
width: 260,
margin: '0 0',
frame: true,
border: false,
items: [this.gridList]
});
this.panelchart = new Ext.Panel({
title: '图表',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
border: false,
items: [this.piechart]
});
this.panelcolumnchart = new Ext.Panel({
title: '图表',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
border: false,
items: [this.columnchart]
});
this.panelcolumnchart.setVisible(false);
this.panelBody = new Ext.Panel({
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
border: false,
items: [this.panelchart, this.panelcolumnchart,
this.panelBodyChFee]
});
Ext.apply(this, {
border: false,
items: [this.panelTop, this.panelSearch, this.panelBody]
});
//#endregion
//#region 页面加载
this.InitData();
LoadQueryData(this.formname, this.formSearch, this.CheckSaveQuery);
//#endregion
}, //end initUIComponents
//#region 加载事件
InitData: function () {
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/RptCwGenlegAccitems/GetData',
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
return;
}
data = result.data;
var arrtmp = data.toString().split("&");
this.strCwSTARTGID = arrtmp[0].toString();
var strCwSTARTNAME = arrtmp[1].toString();
var strCwACCDATE = arrtmp[2].toString();
var sYear = arrtmp[3].toString();
var sMonth = arrtmp[4].toString();
//
var sZQ = "&nbsp;&nbsp;当前登录账套:“" + strCwSTARTNAME + "”&nbsp;&nbsp;当前财务账期:“" + sYear + "年第" + sMonth + "期”&nbsp;&nbsp;";
Ext.getCmp("lbTitle2").setValue(sZQ);
Ext.getCmp("ACCDATE").setValue(strCwACCDATE);
//
//Ext.getCmp("ACCID").setValue(combo.store.data.items[0].data.ACCID); //选中
//
Ext.getCmp('SubjectAccount').hide();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
} else {
//Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
async: false,
scope: this
});
}, //end InitData
//#endregion
//#region 查询
onRefreshClick: function (button, event) {
if (!this.checkSearchCondition()) {
return;
}
else {
if (this.isInitData == 0) {
this.isInitData = 1;
var sACCID = Ext.getCmp('ACCID').getValue();
var ACCDATEbgn = Ext.getCmp('ACCDATE').getRawValue();
Ext.Ajax.request({
waitMsg: '正在查询汇率值...',
url: '/MvcShipping/RptCwGLDetailColumn/GetIsSubject',
params: {
condition: "ACCID='" + sACCID + "'",
ACCDATEbgn: ACCDATEbgn
},
callback: function (options, success, response) {
var result = Ext.JSON.decode(response.responseText);
if (success) {
if (!result.Success) {
//Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
//_Field.setValue("");
return;
}
//
//Ext.getCmp('CustNAME').setValue("");
//Ext.getCmp('DeptName').setValue("");
//Ext.getCmp('SALE').setValue("");
//Ext.getCmp('ITEMNAME').setValue("");
var strItem = result.Message.toString();
if (strItem == "") {
Ext.getCmp('SubjectAccount').hide();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
this.acctype = 1;
gloabAccType = 1;
}
else {
this.acctype = 2;
gloabAccType = 2;
Ext.getCmp('SubjectAccount').show();
this.storeSubjectAccount.load({ params: { condition: "ACCID='" + sACCID + "'", ACCDATEbgn: ACCDATEbgn} });
argItems = result.Message.toString().split(",");
strItem = argItems[0].toString();
Ext.getCmp('SubjectAccount').setValue(strItem);
//
if (strItem == "客户") {
Ext.getCmp('CustNAME').show();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "部门") {
Ext.getCmp('DeptName').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('SALE').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "人员") {
Ext.getCmp('SALE').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('ITEMNAME').hide();
}
else if (strItem == "项目") {
Ext.getCmp('ITEMNAME').show();
Ext.getCmp('CustNAME').hide();
Ext.getCmp('DeptName').hide();
Ext.getCmp('SALE').hide();
}
}
//this.onRefreshClick();
}
},
async: false,
scope: this
});
}
}
//
var form = this.formSearch.getForm();
var rdOBJNUM = Ext.getCmp('rdOBJNUM');
var OBJNUM = rdOBJNUM.getValue();
//
this.sqlcontext = "";
var strACCDATE = form.findField('ACCDATE').getRawValue();
var strCURRENCY = form.findField('CURRENCY').getValue();
var strACCID = form.findField('ACCID').getValue();
var isDETAILED = "";
var AccitemsList = DsStoreQueryBy(this.storeCwAccitems, 'ACCID', strACCID.toString());
if (AccitemsList.length > 0) {
var AccitemsRaw = AccitemsList.getAt(0).raw;
isDETAILED = AccitemsRaw.DETAILED.toString();
}
var strCustNAME = form.findField('CustNAME').getValue();
var strDeptName = form.findField('DeptName').getValue();
var strSALE = form.findField('SALE').getValue();
var strITEMNAME = form.findField('ITEMNAME').getValue();
var strSubjectAccount = form.findField('SubjectAccount').getValue();
//
this.storeList.removeAll();
this.storeList.load({
params: { start: 0, limit: this.PageSize, strACCDATE: strACCDATE, strCURRENCY: strCURRENCY, strACCID: strACCID, strCustNAME: strCustNAME, strDeptName: strDeptName, strSALE: strSALE, strITEMNAME: strITEMNAME, strSubjectAccount: strSubjectAccount, acctype: this.acctype, sumfieldtype: OBJNUM, isDETAILED: isDETAILED },
waitMsg: "正在查询数据...",
scope: this
});
},
//#endregion
//#region 其他
checkSearchCondition: function () {
var form = this.formSearch.getForm();
if (!form.isValid()) {
//Ext.Msg.alert('提示', '查询条件赋值错误,请检查。');
return false;
}
return true;
},
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.SelectedRecord.data.BSNO;
ret[4] = "RptCwGLDetailColumnChartIndex";
return ret;
}
//#endregion
});
function $() {
return document.getElementById(arguments[0]) || false;
}
function openNewDiv(_id, DivHtml, newDivWidth, newDivHeight, strYear, strMonth) {
var accdate = Ext.getCmp('ACCDATE').getRawValue();
var condition = Ext.getCmp('ACCID').getValue();
var currency = Ext.getCmp('cmbCURRENCY').getValue()
//alert(accdate+" "+condition);
var m = "mask";
var _leftDatumPoint = document.body.scrollLeft + document.body.clientWidth / 2 - newDivWidth / 2;
var _topDatumPoint = document.body.scrollTop + document.body.clientHeight / 2 - newDivHeight / 2;
var _innerHTML = "<div style='padding-top:130px;width:1083px;text-align:center;'><img src='../../../images/wait.gif' width='80' height='80' bordr='0' /></div>"; // "<div style='padding-left:60px;padding-top:0px;padding-bottom:30px;width:500px;height:262px;line-height:22px;font-size:12px;color:#000;font-family:\"微软雅黑\";overflow-x:hidden;overflow-y:auto;'>韩国航线<br />日本九州<br />日本关东<br />日本关西<br />日本航线<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br />日本关西<br /><br /></div>"; //
var _storeDictionary = new Array();
var _storeDictionaryClass = new Array();
var _storeDictionaryValue = 0;
var outputStr = "";
var outputStrTitle = "";
var outputStrAmount = "";
var datetimeStr = "";
var recordCount = 0;
var dispClass = 0;
var strSumfieldType = "";
if ($(_id)) document.body.removeChild($(_id));
if ($(m)) document.body.removeChild($(m));
//mask遮罩层
var newMask = document.createElement("div");
newMask.id = m;
newMask.style.position = "absolute";
newMask.style.zIndex = "1";
_scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
_scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
newMask.style.width = _scrollWidth + "px";
newMask.style.height = _scrollHeight + "px";
newMask.style.top = "0px";
newMask.style.left = "0px";
newMask.style.background = "#33393C";
newMask.style.filter = "alpha(opacity=1)";
newMask.style.opacity = "0.01";
document.body.appendChild(newMask);
//消息层框架
var newDiv = document.createElement("div");
newDiv.id = _id;
newDiv.style.position = "absolute";
newDiv.style.zIndex = "9999";
newDivWidth = newDivWidth || 1004;
if (document.body.clientHeight > 768) {
newDivHeight = newDivHeight || 630;
}
else {
newDivHeight = 500;
}
_topDatumPoint = document.body.scrollTop + document.body.clientHeight / 2 - newDivHeight / 2;
newDiv.style.width = newDivWidth + "px";
newDiv.style.height = newDivHeight + "px";
newDiv.style.top = _topDatumPoint + "px";
newDiv.style.left = _leftDatumPoint + "px";
newDiv.style.background = "#dfe9f6";
newDiv.style.border = "1px solid #99bce8";
newDiv.style.padding = "5px";
//newDiv.innerHTML = DivHtml;
document.body.appendChild(newDiv);
//消息层标题
var newDivTitle = document.createElement("div");
newDivTitle.id = "_title" + _id;
newDivTitle.style.position = "absolute";
newDivTitle.style.zIndex = "10002";
newDivWidth = newDivWidth || 1083;
newDivHeight = newDivHeight || 630;
newDivTitle.style.width = 1083 + "px";
newDivTitle.style.height = 16 + "px";
newDivTitle.style.top = _topDatumPoint + "px";
newDivTitle.style.left = _leftDatumPoint + "px";
newDivTitle.style.border = "0px solid #99bce8";
newDivTitle.style.padding = "5px";
newDivTitle.style.fontWeight = "bold";
newDivTitle.style.color = "#15498b";
newDivTitle.style.fontSize = "14px";
newDivTitle.style.fontFamily = "微软雅黑";
document.body.appendChild(newDivTitle);
//消息层按钮
var newDivTitleBtn = document.createElement("div");
newDivTitleBtn.id = "_titleBtn" + _id;
newDivTitleBtn.style.position = "absolute";
newDivTitleBtn.style.zIndex = "10005";
newDivWidth = newDivWidth || 1083;
newDivHeight = newDivHeight || 630;
newDivTitleBtn.style.width = 14 + "px";
newDivTitleBtn.style.height = 14 + "px";
newDivTitleBtn.style.top = _topDatumPoint + 2 + "px";
newDivTitleBtn.style.left = _leftDatumPoint + 1064 + "px";
newDivTitleBtn.style.border = "0px solid #99bce8";
newDivTitleBtn.style.padding = "0px";
document.body.appendChild(newDivTitleBtn);
//消息层内容
var newDivContent = document.createElement("div");
newDivContent.id = "_contentFrame" + _id;
newDivContent.style.position = "absolute";
newDivContent.style.zIndex = "10000";
newDivContent.style.width = 1083 + "px";
if (document.body.clientHeight > 768) {
newDivContent.style.height = 593 + "px";
}
else {
newDivContent.style.height = 464 + "px";
}
newDivContent.style.top = _topDatumPoint + 35 + "px";
newDivContent.style.left = _leftDatumPoint + "px";
newDivContent.innerHTML = _innerHTML;
document.body.appendChild(newDivContent);
//查询消息
//消息层滚动居中
function newDivCenter() {
newDiv.style.top = _topDatumPoint + "px";
newDiv.style.left = _leftDatumPoint + "px";
}
if (document.all) {
window.attachEvent("onscroll", newDivCenter);
}
else {
window.addEventListener('scroll', newDivCenter, false);
}
//关闭新图层和mask遮罩层
var newA = document.createElement("a");
newA.style.color = "#15498b";
newA.style.fontSize = "14px";
newA.style.fontFamily = "微软雅黑";
newA.style.cssText = "font-size:14px;text-decoration:none;"
newA.href = "#";
newA.innerHTML = "×";
newA.onclick = function () {
if (document.all) {
window.detachEvent("onscroll", newDivCenter);
}
else {
window.removeEventListener('scroll', newDivCenter, false);
}
document.body.removeChild($(_id));
document.body.removeChild($("_title" + _id));
document.body.removeChild($("_titleBtn" + _id));
document.body.removeChild($("_contentFrame" + _id));
document.body.removeChild($(m));
return false;
}
newDivTitleBtn.appendChild(newA);
if (Ext.getCmp('rdoGain').getValue()) { strSumfieldType = "本期合计"; }
else if (Ext.getCmp('rdoArrearage').getValue()) { strSumfieldType = "本年累计"; }
Ext.onReady(function () {
_store = Ext.create('DsExt.ux.RefTableStore', { //OBJNAME, OBJNUM, ACCATTRIBUTE, ACCNAME, DC, ACCDATE, ACCTYPE
fields: [
{ name: 'VOUDATE', type: 'string' },
{ name: 'VKNO', type: 'string' },
{ name: 'VOUNO', type: 'string' },
{ name: 'EXPLAN', type: 'string' },
{ name: 'DR', type: 'string' },
{ name: 'CR', type: 'string' },
{ name: 'DC', type: 'string' }
],
proxy: { url: '/MvcShipping/RptCwGLDetailColumnChart/GetDataListDetail' },
scope: this
});
_store.load({ params: { strACCDATE: accdate, strCURRENCY: currency, strACCID: condition, strInquireField: objName, acctype: gloabAccType, sumfieldtype: strSumfieldType} });
_store.on("load", function (_store) {
newDivTitle.innerHTML = "&nbsp;&nbsp;" + DivHtml + "&nbsp;-&nbsp;" + objName;
outputStrTitle = "<table id=\"ResultTitle\" align=\"left\" class=\"tab\" width=\"840\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">";
outputStrTitle += "<tr>";
outputStrTitle += "<td width=\"100\" height=\"40\" align=\"center\" valign=\"middle\" class=\"tabTitle tabTopBorder\">日期</td>";
outputStrTitle += "<td width=\"60\" height=\"40\" align=\"center\" valign=\"middle\" class=\"tabTitle tabTopBorder\">凭证字</td>";
outputStrTitle += "<td width=\"60\" height=\"40\" align=\"center\" valign=\"middle\" class=\"tabTitle tabTopBorder\">凭证号</td>";
outputStrTitle += "<td width=\"220\" height=\"40\" align=\"center\" valign=\"middle\" class=\"tabTitle tabTopBorder\">摘要</td>";
outputStrTitle += "<td width=\"40\" height=\"40\" align=\"center\" valign=\"middle\" class=\"tabTitle tabTopBorder\">方向</td>";
outputStrTitle += "<td width=\"180\" height=\"40\" align=\"center\" valign=\"middle\" class=\"tabTitle tabTopBorder\">借方金额</td>";
outputStrTitle += "<td width=\"180\" height=\"40\" align=\"center\" valign=\"middle\" class=\"tabTitle tabTopBorder\">贷方金额</td>";
outputStrTitle += "</tr>";
outputStrTitle += "</table>";
outputStr = "<table id=\"Result\" width=\"840\" align=\"left\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" class=\"tab\" style=\"border-top:0px #fff solid;border-bottom:0px #fff solid;\">";
for (var i = 0; i < _store.getCount(); i++) {
outputStr += "<tr>";
if (i % 2 == 0) {
outputStr += "<td width=\"100\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabLeftCollumn tabLeftTopBorder\" style=\"width:100px;max-width:100px;min-width:100px;\">" + _store.getAt(i).get("VOUDATE") + "</td>";
outputStr += "<td width=\"60\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabLightCollumnNormal tabTopBorder\" style=\"width:60px;max-width:60px;min-width:60px;\">" + _store.getAt(i).get("VKNO") + "</td>";
outputStr += "<td width=\"60\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabLightCollumnNormal tabTopBorder\" style=\"width:60px;max-width:60px;min-width:60px;\">" + _store.getAt(i).get("VOUNO") + "</td>";
outputStr += "<td width=\"220\" height=\"20\" align=\"center\" valign=\"left\" class=\"tabLightCollumnNormal tabTopBorder\" style=\"width:220px;max-width:220px;min-width:220px;text-align:left;\"><span style=\"padding-left:5px;display:block;\">" + _store.getAt(i).get("EXPLAN") + "</span></td>";
outputStr += "<td width=\"40\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabLightCollumnNormal tabTopBorder\" style=\"width:40px;max-width:40px;min-width:40px;\">" + _store.getAt(i).get("DC") + "</td>";
outputStr += "<td width=\"180\" height=\"20\" align=\"center\" valign=\"right\" class=\"tabLightCollumnNormal tabTopBorder\" style=\"width:180px;max-width:180px;min-width:180px;text-align:right;\"><span style=\"padding-right:20px;display:block;\">" + _store.getAt(i).get("DR") + "</span></td>";
outputStr += "<td width=\"180\" height=\"20\" align=\"center\" valign=\"right\" class=\"tabLightCollumnNormal tabTopBorder\" style=\"width:180px;max-width:180px;min-width:180px;text-align:right;\"><span style=\"padding-right:20px;display:block;\">" + _store.getAt(i).get("CR") + "</span></td>";
}
else {
outputStr += "<td width=\"100\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabLeftCollumn tabLeftTopBorder\" style=\"width:100px;max-width:100px;min-width:100px;\">" + _store.getAt(i).get("VOUDATE") + "</td>";
outputStr += "<td width=\"60\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabDarkCollumnNormal tabTopBorder\" style=\"width:60px;max-width:60px;min-width:60px;\">" + _store.getAt(i).get("VKNO") + "</td>";
outputStr += "<td width=\"60\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabDarkCollumnNormal tabTopBorder\" style=\"width:60px;max-width:60px;min-width:60px;\">" + _store.getAt(i).get("VOUNO") + "</td>";
outputStr += "<td width=\"220\" height=\"20\" align=\"center\" valign=\"left\" class=\"tabDarkCollumnNormal tabTopBorder\" style=\"width:220px;max-width:220px;min-width:220px;text-align:left;\"><span style=\"padding-left:5px;display:block;\">" + _store.getAt(i).get("EXPLAN") + "</span></td>";
outputStr += "<td width=\"40\" height=\"20\" align=\"center\" valign=\"middle\" class=\"tabDarkCollumnNormal tabTopBorder\" style=\"width:40px;max-width:40px;min-width:40px;\">" + _store.getAt(i).get("DC") + "</td>";
outputStr += "<td width=\"180\" height=\"20\" align=\"center\" valign=\"right\" class=\"tabDarkCollumnNormal tabTopBorder\" style=\"width:180px;max-width:180px;min-width:180px;text-align:right;\"><span style=\"padding-right:20px;display:block;\">" + _store.getAt(i).get("DR") + "</span></td>";
outputStr += "<td width=\"180\" height=\"20\" align=\"center\" valign=\"right\" class=\"tabDarkCollumnNormal tabTopBorder\" style=\"width:180px;max-width:180px;min-width:180px;text-align:right;\"><span style=\"padding-right:20px;display:block;\">" + _store.getAt(i).get("CR") + "</span></td>";
}
outputStr += "</tr>";
recordCount++;
}
outputStr += "</table>";
if (document.body.clientHeight > 768) {
_innerHTML = "<div id='ResultFrame' style='padding-left:24px;padding-right:24px;padding-top:0px;width:840px;height:593px;line-height:22px;font-size:12px;color:#000;font-family:\"微软雅黑\";'>";
_innerHTML += "<div style='margin:0px;padding:0px;width:840px;height:46px;font-size:12px;color:#fff;font-family:\"微软雅黑\";text-align:center;'>" + outputStrTitle + "</div>";
_innerHTML += "<div style='margin:0px;padding:0px;width:840px;height:502px;font-size:12px;color:#fff;font-family:\"微软雅黑\";text-align:center;overflow-x:hidden;overflow-y:auto;'>" + outputStr + "</div>"; /*height:502px;*/
_innerHTML += "</div>";
}
else {
_innerHTML = "<div id='ResultFrame' style='padding-left:24px;padding-right:24px;padding-top:0px;width:840px;line-height:22px;font-size:12px;color:#000;font-family:\"微软雅黑\";'>"; /*height:593px;*/
_innerHTML += "<div style='margin:0px;padding:0px;width:840px;height:41px;font-size:12px;color:#fff;font-family:\"微软雅黑\";text-align:left;'>" + outputStrTitle + "</div>";
_innerHTML += "<div id='Result' style='margin:0px;padding:0px;width:840px;font-size:12px;color:#fff;font-family:\"微软雅黑\";text-align:left;overflow-x:hidden;overflow-y:auto;'>" + outputStr + "</div>"; /*height:373px;*/
_innerHTML += "</div>";
}
newDivContent.innerHTML = _innerHTML;
if (parseInt(newDivContent.style.height.substring(0, 3)) > parseInt(document.getElementById("ResultFrame").offsetHeight)) {
newDivContent.style.height = document.getElementById("ResultFrame").offsetHeight + "px";
newDiv.style.width = 890 + "px";
newDivTitleBtn.style.left = _leftDatumPoint + 872 + "px";
newDiv.style.height = parseInt(newDivTitle.style.height.substring(0, 2)) + parseInt(newDivContent.style.height.substring(0, 3)) + 40 + "px"; //40
_topDatumPoint = document.body.scrollTop + document.body.clientHeight / 2 - parseInt(newDiv.style.height.substring(0, 3)) / 2
newDiv.style.top = _topDatumPoint + "px";
newDivTitle.style.top = _topDatumPoint + "px";
newDivContent.style.top = _topDatumPoint + 35 + "px";
newDivTitleBtn.style.top = _topDatumPoint + 2 + "px";
}
else {
document.getElementById("Result").style.height = parseInt(newDivContent.style.height.substring(0, 3)) - 20 - 46 + "px"; //470
newDivContent.style.height = parseInt(newDivContent.style.height.substring(0, 3)) - 20 + "px"; //561
newDiv.style.width = 890 + "px";
newDivTitleBtn.style.left = _leftDatumPoint + 872 + "px";
newDiv.style.height = parseInt(newDivTitle.style.height.substring(0, 2)) + parseInt(newDivContent.style.height.substring(0, 3)) + 40 + "px";
_topDatumPoint = document.body.scrollTop + document.body.clientHeight / 2 - parseInt(newDiv.style.height.substring(0, 3)) / 2
newDiv.style.top = _topDatumPoint + "px";
newDivTitle.style.top = _topDatumPoint + "px";
newDivContent.style.top = _topDatumPoint + 35 + "px";
newDivTitleBtn.style.top = _topDatumPoint + 2 + "px";
}
});
});
}