var hitColumn;
var gloabAccType;
var adjest = 0;
var itemNull = false; //判断strItem是否为空
Ext.namespace('Shipping');
Shipping.RptCwGLDetailColumnCompareIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.RptCwGLDetailColumnCompareIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.RptCwGLDetailColumnCompareIndex, Ext.Panel, {
PageSize: 2000,
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '1<0',
acctype: 1,
isInitData: 0,
isWuZiKeMu: false,
strCwSTARTGID: '',
initUIComponents: function () {
this.formname = 'RptCwGLDetailColumnCompareIndex'; //趋势分析
//#region 列表数据
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'MONTHNAME', type: 'string' },
{ name: 'ZL1', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/RptCwGLDetailColumnCompare/GetDataList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
Ext.define('Ext.grid.column.Actiontextcolumn', {
extend: 'Ext.grid.column.Column',
alias: ['widget.actiontextcolumn'],
defaultRenderer: function (value) {
var me = this;
prefix = Ext.baseCSSPrefix;
scope = me.origScope || me;
value = value + '';
return value;
},
processEvent: function (type, view, cell, recordIndex, cellIndex, e, record, row) {
var me = this;
if (type == 'click') {
me.handler.call(me.scope || me.origScope || me, view, recordIndex, cellIndex, e, record, row);
}
}
});
//定义Grid
this.initgirdcolums = [{
sortable: true,
dataIndex: 'MONTHNAME',
header: '月份',
width: 110
}, {
sortable: true,
dataIndex: 'MONTHNUM',
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 '' + value + '';
}
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
}
});
/////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////
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), hitColumn);
hitColumn = "";
}, this);
/////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////
/*this.gridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
var month = record.data.MONTHNAME;
openNewDiv("layer", "走势对比图表分析", 1083, 630, escape(month.substring(0, 4)), escape(month.substring(5)), hitColumn);
hitColumn = "";
}, this);*/
_this = this;
this.piechart = 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: ['ZL1'],
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 '' + value + '';
}
return value;
}
},
title: '数据',
grid: true
//,minimum: 0
}, {
type: 'Category',
position: 'bottom',
fields: ['MONTHNAME'],
title: '年度月份'
}],
series: [{
type: 'column',
axis: 'left',
highlight: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function (storeItem, item) {
this.setTitle(storeItem.get('MONTHNAME') + ': ' + storeItem.get('ZL1'));
}
},
label: {
display: 'insideEnd',
'text-anchor': 'middle',
field: 'ZL1',
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 '' + value + '';
}
return value;
}
},
xField: 'MONTHNAME',
yField: 'ZL1'
}]
});
//#endregion
//#region formSearch 下拉框信息加载
_this = this;
//科目加载
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();
if (fValue.indexOf("-") > -1) {
fValue = fValue.substr(0, fValue.indexOf("-"));
}
var ACCDATEbgn = Ext.getCmp('ACCDATEbgn').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("");
this.isWuZiKeMu = true;
return;
}
//
Ext.getCmp('SubjectAccount').setValue("");
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();
//itemNull = false;
adjest = 1;
this.acctype = 1;
gloabAccType = 1;
}
else {
this.acctype = 1;
var rdOBJNAME = Ext.getCmp('rdOBJNAME').getValue();
var sOBJNAME = rdOBJNAME.OBJNAME;
if (sOBJNAME.toString() == "对比") {
adjest = 2;
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();
if (strItem.indexOf("您所选的科目无法生成多栏账,请选择非明细科目或挂核算项目的科目!") > -1) {
Ext.getCmp('SubjectAccount').setValue("");
this.isWuZiKeMu = true;
}
else {
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();
}
}
}
} else {
//Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
//_field.setValue("");
//return;
//Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
async: false,
scope: this
});
//
this.onRefreshClick();
}
}
},
scope: this
},
'select': function (_Field, itemArray, Object) {
if (_Field.value.toString() != "") {
var ACCDATEbgn = Ext.getCmp('ACCDATEbgn').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("");
this.isWuZiKeMu = true;
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();
adjest = 1;
this.acctype = 1;
gloabAccType = 1;
}
else {
this.acctype = 1;
var rdOBJNAME = Ext.getCmp('rdOBJNAME').getValue();
var sOBJNAME = rdOBJNAME.OBJNAME;
if (sOBJNAME.toString() == "对比") {
adjest = 2;
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();
if (strItem.indexOf("您所选的科目无法生成多栏账,请选择非明细科目或挂核算项目的科目!") > -1) {
Ext.getCmp('SubjectAccount').setValue("");
this.isWuZiKeMu = true;
}
else {
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();
}
}
}
} else {
//Ext.Msg.show({ title: '提示', msg: result.Message, icon: Ext.MessageBox.INFO, buttons: Ext.Msg.OK });
//_Field.setValue("");
//return;
//Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
async: false,
scope: this
});
//
this.onRefreshClick();
}
}
}
});
//币别
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',
flex: 1,
defaultType: 'textfield',
items: [{
xtype: 'radiogroup',
id: 'rdOBJNAME',
//fieldLabel: '分析对象',
//columns: 6,
//flex: 3,
vertical: true,
items: [
{ id: 'rdoCompare', boxLabel: '对比', name: 'OBJNAME', inputValue: '对比' },
{ id: 'rdoAnalyze', boxLabel: '汇总', name: 'OBJNAME', inputValue: '分析', checked: true }
],
listeners: {
change: function (rd, newValue, oldValue, eOpts) {
_this.onRefreshClick();
}
}
}, {
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();
}
}
}, {
fieldLabel: '会计期间',
xtype: 'monthfield',
editable: false,
allowBlank: false, //是否允许为空
id: 'ACCDATEbgn',
name: 'ACCDATEbgn',
enableKeyEvents: true, //激活键盘事件
listeners: {
scope: this,
'keyup': {
fn: function (_field, e) {
if (e.getKey() == 13) {
this.onRefreshClick();
}
},
scope: this
}
}
}, {
fieldLabel: '至',
xtype: 'monthfield',
editable: false,
allowBlank: false, //是否允许为空
id: 'ACCDATEend',
name: 'ACCDATEend',
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.comboxCodeCurrency, this.comboxACCNAME, this.comboxSubjectAccount, this.comboxCust, this.comboxDept, this.comboxSALE, this.comboxCwItem]
}]//end items(fieldset 1)
}]//end root items
});
//#endregion
//#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: " "
}]
});
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: 'south',
height: 238,
margin: '0 0',
frame: true,
split: true,
collapsible: 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.panelBody = new Ext.Panel({
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
border: false,
items: [this.panelchart, 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 = " 当前登录账套:“" + strCwSTARTNAME + "” 当前财务账期:“" + sYear + "年第" + sMonth + "期” ";
Ext.getCmp("lbTitle2").setValue(sZQ);
Ext.getCmp("ACCDATEbgn").setValue(strCwACCDATE);
Ext.getCmp("ACCDATEend").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('ACCDATEbgn').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) {
this.isWuZiKeMu = true;
return;
}
//
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 = 1;
var rdOBJNAME = Ext.getCmp('rdOBJNAME').getValue();
var sOBJNAME = rdOBJNAME.OBJNAME;
if (sOBJNAME.toString() == "对比") {
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();
if (strItem.indexOf("您所选的科目无法生成多栏账,请选择非明细科目或挂核算项目的科目!") > -1) {
Ext.getCmp('SubjectAccount').setValue("");
this.isWuZiKeMu = true;
}
else {
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 rdOBJNAME = Ext.getCmp('rdOBJNAME');
var OBJNAME = rdOBJNAME.getValue();
var rdOBJNUM = Ext.getCmp('rdOBJNUM');
var OBJNUM = rdOBJNUM.getValue();
//
this.sqlcontext = "";
var strACCDATEbgn = form.findField('ACCDATEbgn').getRawValue();
var strACCDATEend = form.findField('ACCDATEend').getRawValue();
var strCURRENCY = form.findField('CURRENCY').getValue();
var strACCID = form.findField('ACCID').getValue();
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 = Ext.getCmp('SubjectAccount').getValue(); //form.findField('SubjectAccount').getValue();
if(this.isWuZiKeMu) {
strSubjectAccount = "-1";
}
//
this.sqlcontext = "";
this.InitGrid(OBJNAME, OBJNUM, strACCDATEbgn, strACCDATEend, strCURRENCY, strACCID, strCustNAME, strDeptName, strSALE, strITEMNAME, strSubjectAccount);
},
InitGrid: function (OBJNAME, sumfieldtype, strACCDATEbgn, strACCDATEend, strCURRENCY, strACCID, strCustNAME, strDeptName, strSALE, strITEMNAME, strSubjectAccount) {
_this = this;
var zlcolumn = [{ sortable: true, dataIndex: 'MONTHNAME', header: '月份', width: 110}];
var myfield = [{ name: 'MONTHNAME', type: 'string'}];
var charfield = [];
var aseries = [];
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
fields: [
{ name: 'MONTHNAME', type: 'string' },
{ name: 'MONTHNUM', type: 'number' }
],
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/RptCwGLDetailColumnCompare/GetDataList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
var storeMonthData = Ext.create('DsExt.ux.RefTableStore', {
fields: [
{ name: 'MONTHNAME', type: 'string' },
{ name: 'MONTHNO', type: 'number' },
{ name: 'MONTHFIELDNAME', type: 'string' }
],
proxy: { url: '/MvcShipping/RptCwGLDetailColumnCompare/GetObjListData' }
});
_this = this;
storeMonthData.load({ params: { OBJNAME: OBJNAME, sumfieldtype: sumfieldtype, strACCDATEbgn: strACCDATEbgn, strACCDATEend: strACCDATEend, strCURRENCY: strCURRENCY, strACCID: strACCID, strCustNAME: strCustNAME, strDeptName: strDeptName, strSALE: strSALE, strITEMNAME: strITEMNAME, strSubjectAccount: strSubjectAccount, acctype: this.acctype },
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: 'Z' + memberyf.data.MONTHNAME, type: 'number' });
zlcolumn.push({
dataIndex: 'Z' + memberyf.data.MONTHNAME,
header: memberyf.data.MONTHNAME,
align: 'right',
xtype: 'actiontextcolumn',
width: 100,
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
var memberyf = storeMonthData.getAt(colIndex - 1);
hitColumn = memberyf.data.MONTHNAME;
},
summaryType: 'sum',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
if (parseFloat(value) < 0) {
return '' + value + '';
}
return value;
},
summaryRenderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
value = usMoney(value, 2, '', true);
return value;
}
});
var cfield = 'Z' + memberyf.data.MONTHNAME;
charfield.push(cfield);
aseries.push({
type: 'line',
highlight: {
size: 7,
radius: 7
},
axis: 'left',
smooth: true,
fill: true,
xField: 'MONTHNAME',
yField: 'Z' + memberyf.data.MONTHNAME,
tips: {
trackMouse: true,
width: 80,
height: 40,
renderer: function (storeItem, item) {
this.setTitle(item.value[1]);
}
},
markerConfig: {
type: 'circle',
size: 4,
radius: 4,
'stroke-width': 0
}
});
};
}
Ext.define('summodel', { extend: 'Ext.data.Model', fields: myfield });
this.storeList = Ext.create('Ext.data.Store', {
pageSize: this.PageSize,
model: 'summodel',
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/RptCwGLDetailColumnCompare/SumListData',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridList.reconfigure(this.storeList, zlcolumn);
this.storeList.removeAll();
this.storeList.load({
params: { start: 0, limit: this.PageSize, OBJNAME: OBJNAME, sumfieldtype: sumfieldtype, strACCDATEbgn: strACCDATEbgn, strACCDATEend: strACCDATEend, strCURRENCY: strCURRENCY, strACCID: strACCID, strCustNAME: strCustNAME, strDeptName: strDeptName, strSALE: strSALE, strITEMNAME: strITEMNAME, strSubjectAccount: strSubjectAccount, acctype: this.acctype },
waitMsg: "正在查询数据...",
scope: this
});
var chart = Ext.create('Ext.chart.Chart', {
id: 'chartControl',
xtype: 'chart',
style: 'background:#fff',
animate: true,
store: this.storeList,
shadow: true,
theme: 'Category1',
legend: {
position: 'right'
},
axes: [{
type: 'Numeric',
//minimum: 0,
position: 'left',
fields: charfield,
title: '数据',
minorTickSteps: 1,
grid: {
odd: {
opacity: 1,
fill: '#ddd',
stroke: '#bbb',
'stroke-width': 0.5
}
}
}, {
type: 'Category',
position: 'bottom',
fields: ['MONTHNAME'],
title: '月份'
}],
series: aseries
});
this.panelchart.removeAll();
this.panelchart.add(chart);
this.panelchart.doLayout();
}
},
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] = "MsRptOpProfitPerCentIndex";
return ret;
}
//#endregion
});
//#region 弹出的html页面
function $() {
return document.getElementById(arguments[0]) || false;
}
function openNewDiv(_id, DivHtml, newDivWidth, newDivHeight, strDate, column) {
var accdate = strDate; //Ext.getCmp('ACCDATE').getRawValue();
var condition = Ext.getCmp('ACCID').getValue();
var currency = Ext.getCmp('cmbCURRENCY').getValue();
var strClass = Ext.getCmp('SubjectAccount').getValue();
var analyze = Ext.getCmp('rdoAnalyze').getRawValue();
//alert(analyze);
//alert(adjest);
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 = "
"; // "韩国航线
日本九州
日本关东
日本关西
日本航线
日本关西
日本关西
日本关西
日本关西
日本关西
日本关西
日本关西
日本关西
日本关西
日本关西
日本关西
日本关西
"; //
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";
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 = "本年累计"; }
if (strSumfieldType == "本年累计") {
newDivContent.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";
}
}
else {
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/RptCwGLDetailColumnCompare/GetDataListDetail' },
scope: this
});
_store.load({ params: { adjest: adjest, isAnalyze: analyze, strACCDATE: accdate, strCURRENCY: currency, strACCID: condition, strInquireClass: strClass, strInquireField: column, acctype: gloabAccType, sumfieldtype: strSumfieldType} });
//_store.load({ params: { rdoAnalyze: analyze, isAdjest: isAdjest, strACCDATE: accdate, strCURRENCY: currency, strACCID: condition, strInquireClass: strClass, strInquireField: column, acctype: gloabAccType, sumfieldtype: strSumfieldType} });
_store.on("load", function (_store) {
newDivTitle.innerHTML = " " + DivHtml + " - " + column;
outputStrTitle = "";
outputStrTitle += "";
outputStrTitle += "日期 | ";
outputStrTitle += "凭证字 | ";
outputStrTitle += "凭证号 | ";
outputStrTitle += "摘要 | ";
outputStrTitle += "方向 | ";
outputStrTitle += "借方金额 | ";
outputStrTitle += "贷方金额 | ";
outputStrTitle += "
";
outputStrTitle += "
";
outputStr = "";
for (var i = 0; i < _store.getCount(); i++) {
outputStr += "";
if (i % 2 == 0) {
outputStr += "" + _store.getAt(i).get("VOUDATE") + " | ";
outputStr += "" + _store.getAt(i).get("VKNO") + " | ";
outputStr += "" + _store.getAt(i).get("VOUNO") + " | ";
outputStr += "" + _store.getAt(i).get("EXPLAN") + " | ";
outputStr += "" + _store.getAt(i).get("DC") + " | ";
outputStr += "" + _store.getAt(i).get("DR") + " | ";
outputStr += "" + _store.getAt(i).get("CR") + " | ";
}
else {
outputStr += "" + _store.getAt(i).get("VOUDATE") + " | ";
outputStr += "" + _store.getAt(i).get("VKNO") + " | ";
outputStr += "" + _store.getAt(i).get("VOUNO") + " | ";
outputStr += "" + _store.getAt(i).get("EXPLAN") + " | ";
outputStr += "" + _store.getAt(i).get("DC") + " | ";
outputStr += "" + _store.getAt(i).get("DR") + " | ";
outputStr += "" + _store.getAt(i).get("CR") + " | ";
}
outputStr += "
";
recordCount++;
}
outputStr += "
";
if (document.body.clientHeight > 768) {
_innerHTML = "";
_innerHTML += "
" + outputStrTitle + "
";
_innerHTML += "
" + outputStr + "
"; /*height:502px;*/
_innerHTML += "
";
}
else {
_innerHTML = ""; /*height:593px;*/
_innerHTML += "
" + outputStrTitle + "
";
_innerHTML += "
" + outputStr + "
"; /*height:373px;*/
_innerHTML += "
";
}
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";
}
});
});
}
}
//#endregion