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.

1048 lines
43 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Ext.namespace('Shipping');
String.prototype.trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ""); }
Shipping.MsCwAccitemsGlIndex = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.MsCwAccitemsGlIndex.superclass.constructor.call(this);
};
Ext.extend(Shipping.MsCwAccitemsGlIndex, Ext.Panel, {
ParentWin: null,
OprationType: null, //
OprationStatus: null, //仅当弹出界面时使用
SelectedRecord: null,
sqlcontext: '',
initUIComponents: function () {
this.formname = "formMsCwAccitemsGlIndex"; //科目信息
//#region 定义数据集
this.storeTreeListZC = Ext.create('Ext.data.TreeStore', {
model: 'MsCwAccitemsGlModel',
nodeParam: 'PACCGID',
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCwAccitemsGl/GetDataListZC',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
},
autoLoad: false, //是否允许自动加载数据
folderSort: false, //将叶子节点排列到非叶子节点后面 默认为false
root: {
name: '根节点',
expanded: true,
id: 'ZC'
}
});
this.storeTreeListFZ = Ext.create('Ext.data.TreeStore', {
model: 'MsCwAccitemsGlModel',
nodeParam: 'PACCGID',
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCwAccitemsGl/GetDataListFZ',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
},
autoLoad: false, //是否允许自动加载数据
folderSort: false, //将叶子节点排列到非叶子节点后面 默认为false
root: {
name: '根节点',
expanded: true,
id: 'FZ'
}
});
this.storeTreeListGT = Ext.create('Ext.data.TreeStore', {
model: 'MsCwAccitemsGlModel',
nodeParam: 'PACCGID',
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCwAccitemsGl/GetDataListGT',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
},
autoLoad: false, //是否允许自动加载数据
folderSort: false, //将叶子节点排列到非叶子节点后面 默认为false
root: {
name: '根节点',
expanded: true,
id: 'GT'
}
});
this.storeTreeListQY = Ext.create('Ext.data.TreeStore', {
model: 'MsCwAccitemsGlModel',
nodeParam: 'PACCGID',
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCwAccitemsGl/GetDataListQY',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
},
autoLoad: false, //是否允许自动加载数据
folderSort: false, //将叶子节点排列到非叶子节点后面 默认为false
root: {
name: '根节点',
expanded: true,
id: 'QY'
}
});
this.storeTreeListCB = Ext.create('Ext.data.TreeStore', {
model: 'MsCwAccitemsGlModel',
nodeParam: 'PACCGID',
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCwAccitemsGl/GetDataListCB',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
},
autoLoad: false, //是否允许自动加载数据
folderSort: false, //将叶子节点排列到非叶子节点后面 默认为false
root: {
name: '根节点',
expanded: true,
id: 'CB'
}
});
this.storeTreeListSY = Ext.create('Ext.data.TreeStore', {
model: 'MsCwAccitemsGlModel',
nodeParam: 'PACCGID',
proxy: {
type: 'ajax',
url: '/MvcShipping/MsCwAccitemsGl/GetDataListSY',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
},
autoLoad: false, //是否允许自动加载数据
folderSort: false, //将叶子节点排列到非叶子节点后面 默认为false
root: {
name: '根节点',
expanded: true,
id: 'SY'
}
});
//#endregion
//#region 列定义
this.girdcolums = [{
sortable: true,
dataIndex: 'GID',
text: '唯一编码',
width: 0
}, {
xtype: 'treecolumn', //这是我们知道列将显示树
text: '科目',
//sortable: true,
dataIndex: 'NAME',
width: 300
}, {
text: '方向',
//sortable: true,
dataIndex: 'DC',
width: 40,
align: 'center'
}, {
text: '科目类别',
dataIndex: 'ACCTYPE',
//sortable: true,
width: 100,
align: 'center'
}, {
text: '核算外币',
dataIndex: 'ISFCY',
//xtype: 'checkcolumn',
xtype: "booleancolumn",
trueText: "是",
falseText: " ",
//sortable: true,
width: 60,
align: 'center'
}, {
text: '核算部门',
dataIndex: 'ISDEPTACC',
//xtype: 'checkcolumn',
xtype: "booleancolumn",
trueText: "是",
falseText: " ",
//sortable: true,
width: 60,
align: 'center'
}, {
text: '核算人员',
dataIndex: 'ISEMPLACC',
//xtype: 'checkcolumn',
xtype: "booleancolumn",
trueText: "是",
falseText: " ",
//sortable: true,
width: 60,
align: 'center'
}, {
text: '核算客户',
dataIndex: 'ISCORPACC',
//xtype: 'checkcolumn',
xtype: "booleancolumn",
trueText: "是",
falseText: " ",
//sortable: true,
width: 60,
align: 'center'
}, {
text: '核算项目',
dataIndex: 'ISITEMACC',
//xtype: 'checkcolumn',
xtype: "booleancolumn",
trueText: "是",
falseText: " ",
//sortable: true,
width: 60,
align: 'center'
}, {
text: '是否末级科目',
dataIndex: 'DETAILED',
width: 0
}, {
text: '科目属性',
dataIndex: 'ACCATTRIBUTE',
width: 0
}];
//#endregion
//#region 列表显示信息
//#region treeListZC列表显示信息
this.treeListZC = new Ext.tree.Panel({
region: 'center',
split: true,
store: this.storeTreeListZC,
hideHeaders: false,
animate: false,
lines: true,
collapsible: true, //允许展开和收缩
rootVisible: false, //false不显示根节点,默认为true
useArrows: true, //是否使用箭头样式
//multiSelect: true, //动态增加列表项
//singleExpand: true, //若已展开一个结点A此时去点击另一个同级或更高等级的结点B会将A结点收起并展开B结点若B结点有子结点
trackMouseOver: true, //是否高亮显示鼠标所在的行默认为true
enableHdMenu: false,//是否显示表格列的菜单
//disableSelection: false,//是否禁止行选择默认为false
loadMask: { msg: "数据加载中,请稍等..." },
columns: this.girdcolums
});
//#endregion
//#region treeListFZ列表显示信息
this.treeListFZ = new Ext.tree.Panel({
region: 'center',
split: true,
store: this.storeTreeListFZ,
hideHeaders: false,
animate: false,
lines: true,
collapsible: true, //允许展开和收缩
rootVisible: false, //false不显示根节点,默认为true
useArrows: true, //是否使用箭头样式
//multiSelect: true, //动态增加列表项
//singleExpand: true, //若已展开一个结点A此时去点击另一个同级或更高等级的结点B会将A结点收起并展开B结点若B结点有子结点
trackMouseOver: true, //是否高亮显示鼠标所在的行默认为true
enableHdMenu: false, //是否显示表格列的菜单
//disableSelection: false,//是否禁止行选择默认为false
loadMask: { msg: "数据加载中,请稍等..." },
columns: this.girdcolums
});
//#endregion
//#region treeListGT列表显示信息
this.treeListGT = new Ext.tree.Panel({
region: 'center',
split: true,
store: this.storeTreeListGT,
hideHeaders: false,
animate: false,
lines: true,
collapsible: true, //允许展开和收缩
rootVisible: false, //false不显示根节点,默认为true
useArrows: true, //是否使用箭头样式
//multiSelect: true, //动态增加列表项
//singleExpand: true, //若已展开一个结点A此时去点击另一个同级或更高等级的结点B会将A结点收起并展开B结点若B结点有子结点
trackMouseOver: true, //是否高亮显示鼠标所在的行默认为true
enableHdMenu: false, //是否显示表格列的菜单
//disableSelection: false,//是否禁止行选择默认为false
loadMask: { msg: "数据加载中,请稍等..." },
columns: this.girdcolums
});
//#endregion
//#region treeListQY列表显示信息
this.treeListQY = new Ext.tree.Panel({
region: 'center',
split: true,
store: this.storeTreeListQY,
hideHeaders: false,
animate: false,
lines: true,
collapsible: true, //允许展开和收缩
rootVisible: false, //false不显示根节点,默认为true
useArrows: true, //是否使用箭头样式
//multiSelect: true, //动态增加列表项
//singleExpand: true, //若已展开一个结点A此时去点击另一个同级或更高等级的结点B会将A结点收起并展开B结点若B结点有子结点
trackMouseOver: true, //是否高亮显示鼠标所在的行默认为true
enableHdMenu: false, //是否显示表格列的菜单
//disableSelection: false,//是否禁止行选择默认为false
loadMask: { msg: "数据加载中,请稍等..." },
columns: this.girdcolums
});
//#endregion
//#region treeListCB列表显示信息
this.treeListCB = new Ext.tree.Panel({
region: 'center',
split: true,
store: this.storeTreeListCB,
hideHeaders: false,
animate: false,
lines: true,
collapsible: true, //允许展开和收缩
rootVisible: false, //false不显示根节点,默认为true
useArrows: true, //是否使用箭头样式
//multiSelect: true, //动态增加列表项
//singleExpand: true, //若已展开一个结点A此时去点击另一个同级或更高等级的结点B会将A结点收起并展开B结点若B结点有子结点
trackMouseOver: true, //是否高亮显示鼠标所在的行默认为true
enableHdMenu: false, //是否显示表格列的菜单
//disableSelection: false,//是否禁止行选择默认为false
loadMask: { msg: "数据加载中,请稍等..." },
columns: this.girdcolums
});
//#endregion
//#region treeListSY列表显示信息
this.treeListSY = new Ext.tree.Panel({
region: 'center',
split: true,
store: this.storeTreeListSY,
hideHeaders: false,
animate: false,
lines: true,
collapsible: true, //允许展开和收缩
rootVisible: false, //false不显示根节点,默认为true
useArrows: true, //是否使用箭头样式
//multiSelect: true, //动态增加列表项
//singleExpand: true, //若已展开一个结点A此时去点击另一个同级或更高等级的结点B会将A结点收起并展开B结点若B结点有子结点
trackMouseOver: true, //是否高亮显示鼠标所在的行默认为true
enableHdMenu: false, //是否显示表格列的菜单
//disableSelection: false,//是否禁止行选择默认为false
loadMask: { msg: "数据加载中,请稍等..." },
columns: this.girdcolums
});
//#endregion
//#endregion
//#region 双击打开信息
this.treeListZC.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
_this = this;
parentWin = window.parent.opener;
if (parentWin) {
this.onF7DbClick(parentWin, record);
}
else {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.OprationType = 'ZC';
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
}
}, this);
this.treeListFZ.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
_this = this;
parentWin = window.parent.opener;
if (parentWin) {
this.onF7DbClick(parentWin, record);
}
else {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.OprationType = 'FZ';
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
}
}, this);
this.treeListGT.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
_this = this;
parentWin = window.parent.opener;
if (parentWin) {
this.onF7DbClick(parentWin, record);
}
else {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.OprationType = 'GT';
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
}
}, this);
this.treeListQY.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
_this = this;
parentWin = window.parent.opener;
if (parentWin) {
this.onF7DbClick(parentWin, record);
}
else {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.OprationType = 'QY';
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
}
}, this);
this.treeListCB.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
_this = this;
parentWin = window.parent.opener;
if (parentWin) {
this.onF7DbClick(parentWin, record);
}
else {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.OprationType = 'CB';
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
}
}, this);
this.treeListSY.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
_this = this;
parentWin = window.parent.opener;
if (parentWin) {
this.onF7DbClick(parentWin, record);
}
else {
this.SelectedRecord = record;
this.OprationStatus = 'edit';
this.OprationType = 'SY';
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
}
}, this);
//#endregion
//#region 按钮工具条
this.panelBtn = new Ext.Panel({
region: "north",
tbar: [{
id: 'btnCopy',
text: "复制上一年科目",
iconCls: "btnadd",
handler: function (button, event) {
//this.onCopyClick(button, event);(暂时废弃,迁移到账套启用模块的“启用”功能中)
},
scope: this
}]
});
this.panelBtnZC = new Ext.Panel({
region: "north",
tbar: [{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationType = 'ZC';
this.OprationStatus = 'add';
this.SelectedRecord = this.treeListZC.getSelectionModel().getLastSelected();
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event, 'ZC');
},
scope: this
}, {
text: '刷新',
tooltip: '刷新',
iconCls: "btnrefresh",
handler: function (button, event) {
this.storeTreeListZC.load({
params: { condition: " and ACCATTRIBUTE = '资产'" },
waitMsg: "正在刷新数据...",
scope: this
});
},
scope: this
}]
});
this.panelBtnFZ = new Ext.Panel({
region: "north",
tbar: [{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationType = 'FZ';
this.OprationStatus = 'add';
this.SelectedRecord = this.treeListFZ.getSelectionModel().getLastSelected();
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event, 'FZ');
},
scope: this
}, {
text: '刷新',
tooltip: '刷新',
iconCls: "btnrefresh",
handler: function (button, event) {
this.storeTreeListFZ.load({
params: { condition: " and ACCATTRIBUTE = '负债'" },
waitMsg: "正在刷新数据...",
scope: this
});
},
scope: this
}]
});
this.panelBtnGT = new Ext.Panel({
region: "north",
tbar: [{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationType = 'GT';
this.OprationStatus = 'add';
this.SelectedRecord = this.treeListGT.getSelectionModel().getLastSelected();
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event, 'GT');
},
scope: this
}, {
text: '刷新',
tooltip: '刷新',
iconCls: "btnrefresh",
handler: function (button, event) {
this.storeTreeListGT.load({
params: { condition: " and ACCATTRIBUTE = '共同'" },
waitMsg: "正在刷新数据...",
scope: this
});
},
scope: this
}]
});
this.panelBtnQY = new Ext.Panel({
region: "north",
tbar: [{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationType = 'QY';
this.OprationStatus = 'add';
this.SelectedRecord = this.treeListQY.getSelectionModel().getLastSelected();
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event, 'QY');
},
scope: this
}, {
text: '刷新',
tooltip: '刷新',
iconCls: "btnrefresh",
handler: function (button, event) {
this.storeTreeListQY.load({
params: { condition: " and ACCATTRIBUTE = '权益'" },
waitMsg: "正在刷新数据...",
scope: this
});
},
scope: this
}]
});
this.panelBtnCB = new Ext.Panel({
region: "north",
tbar: [{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationType = 'CB';
this.OprationStatus = 'add';
this.SelectedRecord = this.treeListCB.getSelectionModel().getLastSelected();
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event, 'CB');
},
scope: this
}, {
text: '刷新',
tooltip: '刷新',
iconCls: "btnrefresh",
handler: function (button, event) {
this.storeTreeListCB.load({
params: { condition: " and ACCATTRIBUTE = '成本'" },
waitMsg: "正在刷新数据...",
scope: this
});
},
scope: this
}]
});
this.panelBtnSY = new Ext.Panel({
region: "north",
tbar: [{
text: "新建",
iconCls: "btnadd",
handler: function (button, event) {
this.OprationType = 'SY';
this.OprationStatus = 'add';
this.SelectedRecord = this.treeListSY.getSelectionModel().getLastSelected();
DsOpenEditWin('/MvcShipping/MsCwAccitemsGl/Edit', "科目信息录入", "500", "450", (window.screen.availHeight / 2 - 200), (window.screen.availWidth / 2 - 200));
},
scope: this
}, {
text: "删除",
iconCls: "btndelete",
handler: function (button, event) {
this.onDeleteClick(button, event, 'SY');
},
scope: this
}, {
text: '刷新',
tooltip: '刷新',
iconCls: "btnrefresh",
handler: function (button, event) {
this.storeTreeListSY.load({
params: { condition: " and ACCATTRIBUTE = '损益'" },
waitMsg: "正在刷新数据...",
scope: this
});
},
scope: this
}]
});
//#endregion
//#region 页面布局
this.panelZC = new Ext.Panel({
title: '资产',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.panelBtnZC, this.treeListZC]
});
this.panelFZ = new Ext.Panel({
title: '负债',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.panelBtnFZ, this.treeListFZ]
});
this.panelGT = new Ext.Panel({
title: '共同',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.panelBtnGT, this.treeListGT]
});
this.panelQY = new Ext.Panel({
title: '权益',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.panelBtnQY, this.treeListQY]
});
this.panelCB = new Ext.Panel({
title: '成本',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.panelBtnCB, this.treeListCB]
});
this.panelSY = new Ext.Panel({
title: '损益',
layout: "border",
region: 'center',
margin: '0 0',
frame: true,
items: [this.panelBtnSY, this.treeListSY]
});
this.tabpanel = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: false,
frame: false,
region: 'center',
id: "TabPanelID",
enableTabScroll: true,
items:
[
this.panelZC,
this.panelFZ,
this.panelGT,
this.panelQY,
this.panelCB,
this.panelSY
]
});
Ext.apply(this, {
items: [this.tabpanel]//this.panelBtn,(暂时废弃,迁移到账套启用模块的“启用”功能中)
});
//#endregion
//#region 页面加载
this.treeListZC.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: " and ACCATTRIBUTE = '资产'" });
}, this);
this.treeListFZ.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: " and ACCATTRIBUTE = '负债'" });
}, this);
this.treeListGT.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: " and ACCATTRIBUTE = '共同'" });
}, this);
this.treeListQY.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: " and ACCATTRIBUTE = '权益'" });
}, this);
this.treeListCB.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: " and ACCATTRIBUTE = '成本'" });
}, this);
this.treeListSY.on('beforeload', function (store) {
Ext.apply(store.proxy.extraParams, { condition: " and ACCATTRIBUTE = '损益'" });
}, this);
this.InitData();
//#endregion
}, //end initUIComponents
//#region 加载事件
InitData: function () {
//#region 复制上年科目(暂时废弃,迁移到账套启用模块的“启用”功能中)
/* //复制上年科目(暂时废弃,迁移到账套启用模块的“启用”功能中)
Ext.Ajax.request({
waitMsg: '正在查询主表数据...',
url: '/MvcShipping/MsCwAccitemsGl/isShowCopy',
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
data = result.Data.toString();
if (data == "0") {
this.panelBtn.show();
} else {
this.panelBtn.hide();
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
*/
//#endregion
},
//#endregion
//#region 复制上一年科目(暂时废弃,迁移到账套启用模块的“启用”功能中)
onCopyClick: function (button, event) {
Ext.MessageBox.confirm('提示', '确定复制记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在复制数据...');
Ext.Ajax.request({
waitMsg: '正在复制数据...',
url: '/MvcShipping/MsCwAccitemsGl/onCopy',
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeTreeListZC.load({
params: { condition: " and ACCATTRIBUTE = '资产'" },
waitMsg: "正在刷新数据...",
scope: this
});
this.storeTreeListFZ.load({
params: { condition: " and ACCATTRIBUTE = '负债'" },
waitMsg: "正在刷新数据...",
scope: this
});
this.storeTreeListGT.load({
params: { condition: " and ACCATTRIBUTE = '共同'" },
waitMsg: "正在刷新数据...",
scope: this
});
this.storeTreeListQY.load({
params: { condition: " and ACCATTRIBUTE = '权益'" },
waitMsg: "正在刷新数据...",
scope: this
});
this.storeTreeListCB.load({
params: { condition: " and ACCATTRIBUTE = '成本'" },
waitMsg: "正在刷新数据...",
scope: this
});
this.storeTreeListSY.load({
params: { condition: " and ACCATTRIBUTE = '损益'" },
waitMsg: "正在刷新数据...",
scope: this
});
//
this.panelBtn.hide();
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 });
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
},
//#endregion
//#region 删除
onDeleteClick: function (button, event, type) {
var selections = this.treeListZC.getSelectionModel().getSelection();
if (type == 'ZC') {
selections = this.treeListZC.getSelectionModel().getSelection();
}
else if (type == 'FZ') {
selections = this.treeListFZ.getSelectionModel().getSelection();
}
else if (type == 'GT') {
selections = this.treeListGT.getSelectionModel().getSelection();
}
else if (type == 'QY') {
selections = this.treeListQY.getSelectionModel().getSelection();
}
else if (type == 'CB') {
selections = this.treeListCB.getSelectionModel().getSelection();
}
else if (type == 'SY') {
selections = this.treeListSY.getSelectionModel().getSelection();
}
//
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择业务!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = selections[0];
var skdfj = record.data.DETAILED.toString();
if (record.data.DETAILED.toString() == 'false') {
Ext.Msg.show({ title: '警告', msg: '不是末级科目,不允许删除,请先删除其子科目!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
//
var sACCID = record.data.ACCID.toString();
Ext.Ajax.request({
waitMsg: '正在查询...',
url: '/MvcShipping/MsCwAccitemsGl/GetIsDisable',
params: {
sACCID: sACCID
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: '提示',
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
}
//
data = result.data;
if (data == "true") {
Ext.MessageBox.alert('提示', '已经使用的科目不允许删除!');
}
else {
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/MsCwAccitemsGl/Delete',
params: {
data: Ext.JSON.encode(record.data)
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
//this.storeTreeListZC.remove(record);
if (type == 'ZC') {
//this.storeTreeListZC.remove(record);
this.storeTreeListZC.load({
params: { condition: " and ACCATTRIBUTE = '资产'" },
waitMsg: "正在刷新数据...",
scope: this
});
}
else if (type == 'FZ') {
//this.storeTreeListFZ.remove(record);
this.storeTreeListFZ.load({
params: { condition: " and ACCATTRIBUTE = '负债'" },
waitMsg: "正在刷新数据...",
scope: this
});
}
else if (type == 'GT') {
//this.storeTreeListGT.remove(record);
this.storeTreeListGT.load({
params: { condition: " and ACCATTRIBUTE = '共同'" },
waitMsg: "正在刷新数据...",
scope: this
});
}
else if (type == 'QY') {
//this.storeTreeListQY.remove(record);
this.storeTreeListQY.load({
params: { condition: " and ACCATTRIBUTE = '权益'" },
waitMsg: "正在刷新数据...",
scope: this
});
}
else if (type == 'CB') {
//this.storeTreeListCB.remove(record);
this.storeTreeListCB.load({
params: { condition: " and ACCATTRIBUTE = '成本'" },
waitMsg: "正在刷新数据...",
scope: this
});
}
else if (type == 'SY') {
//this.storeTreeListSY.remove(record);
this.storeTreeListSY.load({
params: { condition: " and ACCATTRIBUTE = '损益'" },
waitMsg: "正在刷新数据...",
scope: this
});
}
//
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);
}
} else {
Ext.MessageBox.alert('请求出现错误,请重试', response.responseText);
}
},
scope: this
});
},
//#endregion
//#region F7返回双击事件
onF7DbClick: function (parentWin, record) {
if (record.data.DETAILED.toString() == 'false' && parentWin.name == "凭证录入") {
Ext.Msg.show({ title: '警告', msg: '不是末级科目,不允许选择!', icon: Ext.Msg.WARNING, buttons: Ext.Msg.OK });
return;
}
var ret = parentWin.OprationSwap2();
var selections = ret[0];
selections[0].set('ACCID', record.data.ACCID.toString());
var selections1 = ret[1];
//selections1.setValue(record.data.ACCNAME);
selections1.setValue((record.data.ACCID.toString() + "-" + record.data.ACCNAME.toString()), record.data.ACCNAME.toString());
window.close();
},
//#endregion
OprationSwap: function () {
var ret = new Array();
ret[0] = this.OprationStatus;
if (this.OprationType == 'ZC') {
ret[1] = this.storeTreeListZC;
}
else if (this.OprationType == 'FZ') {
ret[1] = this.storeTreeListFZ;
}
else if (this.OprationType == 'GT') {
ret[1] = this.storeTreeListGT;
}
else if (this.OprationType == 'QY') {
ret[1] = this.storeTreeListQY;
}
else if (this.OprationType == 'CB') {
ret[1] = this.storeTreeListCB;
}
else if (this.OprationType == 'SY') {
ret[1] = this.storeTreeListSY;
}
ret[2] = this.SelectedRecord;
ret[3] = this.OprationType;
return ret;
}
});