|
@@ -6,10 +6,10 @@ const moduleName = 'stdRation';
|
|
|
//上下拖动div节点的高度
|
|
|
const verticalResize = 10;
|
|
|
let pageOprObj = {
|
|
|
- rationLibName : null,
|
|
|
- rationLibId : null,
|
|
|
+ rationLibName: null,
|
|
|
+ rationLibId: null,
|
|
|
gljLibId: null,
|
|
|
- initPage : function(libInfo) {
|
|
|
+ initPage: function (libInfo) {
|
|
|
this.rationLibId = libInfo.ID;
|
|
|
this.gljLibId = libInfo.gljLib;
|
|
|
this.rationLibName = libInfo.dispName;
|
|
@@ -37,7 +37,7 @@ let sectionTreeObj = {
|
|
|
controller: null,
|
|
|
workBook: null,
|
|
|
sheet: null,
|
|
|
- updateType: {new: 'new', update: 'update'},
|
|
|
+ updateType: { new: 'new', update: 'update' },
|
|
|
insertBtn: $('#tree_Insert'),
|
|
|
removeBtn: $('#tree_remove'),
|
|
|
upLevelBtn: $('#tree_upLevel'),
|
|
@@ -46,7 +46,7 @@ let sectionTreeObj = {
|
|
|
upMoveBtn: $('#tree_upMove'),
|
|
|
setting: {
|
|
|
sheet: {
|
|
|
- cols:[
|
|
|
+ cols: [
|
|
|
{
|
|
|
head: {
|
|
|
titleNames: ['ID'],
|
|
@@ -94,13 +94,13 @@ let sectionTreeObj = {
|
|
|
rootId: -1
|
|
|
},
|
|
|
options: {
|
|
|
- tabStripVisible: false,
|
|
|
+ tabStripVisible: false,
|
|
|
allowContextMenu: false,
|
|
|
- allowCopyPasteExcelStyle : false,
|
|
|
+ allowCopyPasteExcelStyle: false,
|
|
|
allowExtendPasteRange: false,
|
|
|
- allowUserDragDrop : false,
|
|
|
+ allowUserDragDrop: false,
|
|
|
allowUserDragFill: false,
|
|
|
- scrollbarMaxAlign : true
|
|
|
+ scrollbarMaxAlign: true
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -112,7 +112,7 @@ let sectionTreeObj = {
|
|
|
},
|
|
|
//sheet things
|
|
|
setOptions: function (workbook, opts) {
|
|
|
- for(let opt in opts){
|
|
|
+ for (let opt in opts) {
|
|
|
workbook.options[opt] = opts[opt];
|
|
|
}
|
|
|
},
|
|
@@ -120,7 +120,7 @@ let sectionTreeObj = {
|
|
|
renderFunc: function (sheet, func) {
|
|
|
sheet.suspendPaint();
|
|
|
sheet.suspendEvent();
|
|
|
- if(this.isFunc(func)){
|
|
|
+ if (this.isFunc(func)) {
|
|
|
func();
|
|
|
}
|
|
|
sheet.resumePaint();
|
|
@@ -128,9 +128,9 @@ let sectionTreeObj = {
|
|
|
},
|
|
|
|
|
|
buildSheet: function () {
|
|
|
- if(!this.isDef(this.workBook)){
|
|
|
- this.workBook = new GC.Spread.Sheets.Workbook($('#sectionSpread')[0], {sheetCount: 1});
|
|
|
- sheetCommonObj.bindEscKey(this.workBook, [{sheet: this.workBook.getSheet(0), editStarting: this.onEditStarting, editEnded: this.onEditEnded}]);
|
|
|
+ if (!this.isDef(this.workBook)) {
|
|
|
+ this.workBook = new GC.Spread.Sheets.Workbook($('#sectionSpread')[0], { sheetCount: 1 });
|
|
|
+ sheetCommonObj.bindEscKey(this.workBook, [{ sheet: this.workBook.getSheet(0), editStarting: this.onEditStarting, editEnded: this.onEditEnded }]);
|
|
|
this.sheet = this.workBook.getActiveSheet();
|
|
|
this.setOptions(this.workBook, this.setting.options);
|
|
|
this.sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
|
|
@@ -158,7 +158,7 @@ let sectionTreeObj = {
|
|
|
onEditStarting: function (sender, args) {
|
|
|
let me = sectionTreeObj;
|
|
|
let dataCode = me.setting.sheet.cols[args.col]['data']['field'];
|
|
|
- if(dataCode === 'ID'){
|
|
|
+ if (dataCode === 'ID') {
|
|
|
args.cancel = true;
|
|
|
}
|
|
|
},
|
|
@@ -168,7 +168,7 @@ let sectionTreeObj = {
|
|
|
let postData = [];
|
|
|
let v = me.isDef(args.editingText) ? args.editingText.toString().trim() : '';
|
|
|
let node = me.cache[args.row];
|
|
|
- if(me.isDef(node) && node.data.name !== v){
|
|
|
+ if (me.isDef(node) && node.data.name !== v) {
|
|
|
let updateObj = me.getUpdateObj(me.updateType.update, node.getID(), null, null, v, null);
|
|
|
postData.push(updateObj);
|
|
|
//ajax
|
|
@@ -183,37 +183,37 @@ let sectionTreeObj = {
|
|
|
|
|
|
onClipboardPasting: function (sender, info) {
|
|
|
let me = sectionTreeObj;
|
|
|
- if(info.cellRange.col === 0){
|
|
|
+ if (info.cellRange.col === 0) {
|
|
|
info.cancel = true;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
onClipboardPasted: function (sender, info) {
|
|
|
let me = sectionTreeObj;
|
|
|
- let items = sheetCommonObj.analyzePasteData({header: [{dataCode: 'ID'}, {dataCode: 'name'}]}, info);
|
|
|
+ let items = sheetCommonObj.analyzePasteData({ header: [{ dataCode: 'ID' }, { dataCode: 'name' }] }, info);
|
|
|
let postData = [];
|
|
|
let frontData = [];
|
|
|
- for(let i = 0, len = items.length; i < len; i++){
|
|
|
+ for (let i = 0, len = items.length; i < len; i++) {
|
|
|
let row = info.cellRange.row + i;
|
|
|
let node = me.cache[row];
|
|
|
- if(me.isDef(node) && me.isDef(items[i].name) && node.data.name !== items[i].name){
|
|
|
+ if (me.isDef(node) && me.isDef(items[i].name) && node.data.name !== items[i].name) {
|
|
|
let updateObj = me.getUpdateObj(me.updateType.update, node.getID(), null, null, items[i].name, null);
|
|
|
postData.push(updateObj);
|
|
|
- frontData.push({row: row, name: items[i].name});
|
|
|
+ frontData.push({ row: row, name: items[i].name });
|
|
|
node.data.name = items[i].name;
|
|
|
}
|
|
|
}
|
|
|
- if(postData.length > 0){
|
|
|
+ if (postData.length > 0) {
|
|
|
//ajax
|
|
|
me.sectionTreeAjax(postData, function (rstData) {
|
|
|
- for(let i = 0, len = frontData.length; i < len; i++){
|
|
|
+ for (let i = 0, len = frontData.length; i < len; i++) {
|
|
|
let node = me.cache[frontData[i]['row']];
|
|
|
- if(me.isDef(node)){
|
|
|
+ if (me.isDef(node)) {
|
|
|
node.data.name = frontData[i]['name'];
|
|
|
}
|
|
|
}
|
|
|
}, function () {
|
|
|
- for(let i = 0, len = frontData.length; i < len; i++){
|
|
|
+ for (let i = 0, len = frontData.length; i < len; i++) {
|
|
|
let node = me.cache[frontData[i]['row']];
|
|
|
me.sheet.setValue(frontData[i]['row'], 1, me.isDef(node) ? node.data.name : '');
|
|
|
}
|
|
@@ -226,7 +226,7 @@ let sectionTreeObj = {
|
|
|
let spreadWidth = $('#sectionSpread').width() - 65; //65: 列头宽度和垂直滚动条宽度和
|
|
|
let IDRate = 40 / spreadWidth,
|
|
|
nameRate = 1 - IDRate;
|
|
|
- sheetCommonObj.setColumnWidthByRate($('#sectionSpread').width() - 65, this.workBook, [{rateWidth: IDRate}, {rateWidth: nameRate}]);
|
|
|
+ sheetCommonObj.setColumnWidthByRate($('#sectionSpread').width() - 65, this.workBook, [{ rateWidth: IDRate }, { rateWidth: nameRate }]);
|
|
|
}
|
|
|
},
|
|
|
initSectionTree: function (sectionTree) {
|
|
@@ -239,7 +239,7 @@ let sectionTreeObj = {
|
|
|
this.controller.showTreeData();
|
|
|
this.sheet.setFormatter(-1, 0, '@');
|
|
|
this.initSelection(this.tree.selected);
|
|
|
- explanatoryOprObj.bindEvents(explanatoryOprObj.exEditor, explanatoryOprObj.calcEditor);
|
|
|
+ explanatoryOprObj.bindEvents(explanatoryOprObj.exEditor, explanatoryOprObj.erratumEditor, explanatoryOprObj.calcEditor);
|
|
|
this.loadRateWidth();
|
|
|
this.autoLocate();
|
|
|
},
|
|
@@ -260,7 +260,7 @@ let sectionTreeObj = {
|
|
|
initController: function (tree, sheet, setting) {
|
|
|
this.controller = TREE_SHEET_CONTROLLER.createNew(tree, sheet, setting);
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
refreshBtn: function (selected) {
|
|
|
if (locked) {
|
|
|
return;
|
|
@@ -272,7 +272,7 @@ let sectionTreeObj = {
|
|
|
me.downLevelBtn.removeClass('disabled');
|
|
|
me.downMoveBtn.removeClass('disabled');
|
|
|
me.upMoveBtn.removeClass('disabled');
|
|
|
- if(!me.isDef(selected)){
|
|
|
+ if (!me.isDef(selected)) {
|
|
|
me.removeBtn.addClass('disabled');
|
|
|
me.upLevelBtn.addClass('disabled');
|
|
|
me.downLevelBtn.addClass('disabled');
|
|
@@ -280,26 +280,26 @@ let sectionTreeObj = {
|
|
|
me.upMoveBtn.addClass('disabled');
|
|
|
}
|
|
|
else {
|
|
|
- if(!me.isDef(selected.preSibling)){
|
|
|
+ if (!me.isDef(selected.preSibling)) {
|
|
|
me.downLevelBtn.addClass('disabled');
|
|
|
me.upMoveBtn.addClass('disabled');
|
|
|
}
|
|
|
- if(!me.isDef(selected.nextSibling)){
|
|
|
+ if (!me.isDef(selected.nextSibling)) {
|
|
|
me.downMoveBtn.addClass('disabled');
|
|
|
}
|
|
|
- if(!me.isDef(selected.parent)){
|
|
|
+ if (!me.isDef(selected.parent)) {
|
|
|
me.upLevelBtn.addClass('disabled');
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
bindBtn: function () {
|
|
|
let me = this;
|
|
|
me.insertBtn.click(function () {
|
|
|
me.insert();
|
|
|
});
|
|
|
$('#delConfirm').click(function () {
|
|
|
- if(me.canRemoveSection){
|
|
|
+ if (me.canRemoveSection) {
|
|
|
me.remove(me.tree.selected);
|
|
|
}
|
|
|
else {
|
|
@@ -309,12 +309,12 @@ let sectionTreeObj = {
|
|
|
me.removeBtn.click(function () {
|
|
|
//不可删除有子节点或有定额数据的节点
|
|
|
let section = me.cache[me.workBook.getActiveSheet().getActiveRowIndex()];
|
|
|
- if(!section){
|
|
|
+ if (!section) {
|
|
|
return;
|
|
|
}
|
|
|
let sectionName = me.isDef(section.data.name) ? section.data.name : '';
|
|
|
let sectionRations = rationOprObj.currentRations[`_SEC_ID_${section.data.ID}`];
|
|
|
- if(section.children.length > 0 || (sectionRations && sectionRations.length > 0)){
|
|
|
+ if (section.children.length > 0 || (sectionRations && sectionRations.length > 0)) {
|
|
|
me.canRemoveSection = false;
|
|
|
$('#delAlert').find('.modal-body h5').text('当前节点下有数据,不可删除。');
|
|
|
}
|
|
@@ -343,22 +343,22 @@ let sectionTreeObj = {
|
|
|
me.insertBtn.addClass('disabled');
|
|
|
let postData = [];
|
|
|
CommonAjax.post('api/getNewRationTreeID', {}, function (newID) {
|
|
|
- if(!me.isDef(newID)){
|
|
|
+ if (!me.isDef(newID)) {
|
|
|
return;
|
|
|
}
|
|
|
me.tree.maxNodeID(newID - 1);
|
|
|
let selected = me.tree.selected;
|
|
|
let insertObj = me.getUpdateObj(me.updateType.new, newID, -1, -1, '', null);
|
|
|
- if(me.isDef(selected)) {
|
|
|
+ if (me.isDef(selected)) {
|
|
|
let updateObj = me.getUpdateObj(me.updateType.update, selected.getID(), newID, null, null, null);
|
|
|
postData.push(updateObj);
|
|
|
insertObj.updateData.ParentID = selected.getParentID();
|
|
|
- if(me.isDef(selected.nextSibling)){
|
|
|
+ if (me.isDef(selected.nextSibling)) {
|
|
|
insertObj.updateData.NextSiblingID = selected.getNextSiblingID();
|
|
|
}
|
|
|
}
|
|
|
postData.push(insertObj);
|
|
|
- if(postData.length > 0){
|
|
|
+ if (postData.length > 0) {
|
|
|
//ajax
|
|
|
me.sectionTreeAjax(postData, function (rstData) {
|
|
|
me.controller.insert();
|
|
@@ -375,31 +375,31 @@ let sectionTreeObj = {
|
|
|
let me = this;
|
|
|
me.removeBtn.addClass('disabled');
|
|
|
let postData = [], IDs = [];
|
|
|
- if(!selected){
|
|
|
+ if (!selected) {
|
|
|
return;
|
|
|
}
|
|
|
getDelIds(selected);
|
|
|
- function getDelIds(node){
|
|
|
- if(me.isDef(node)){
|
|
|
+ function getDelIds(node) {
|
|
|
+ if (me.isDef(node)) {
|
|
|
IDs.push(node.getID());
|
|
|
- if(node.children.length > 0){
|
|
|
- for(let i = 0, len = node.children.length; i < len; i++){
|
|
|
+ if (node.children.length > 0) {
|
|
|
+ for (let i = 0, len = node.children.length; i < len; i++) {
|
|
|
getDelIds(node.children[i]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(me.isDef(selected.preSibling)){
|
|
|
+ if (me.isDef(selected.preSibling)) {
|
|
|
let updateObj = me.getUpdateObj(me.updateType.update, selected.preSibling.getID(), selected.getNextSiblingID(), null, null, null);
|
|
|
postData.push(updateObj);
|
|
|
}
|
|
|
- if(IDs.length > 0){
|
|
|
- for(let i = 0, len = IDs.length; i < len; i++){
|
|
|
+ if (IDs.length > 0) {
|
|
|
+ for (let i = 0, len = IDs.length; i < len; i++) {
|
|
|
let delObj = me.getUpdateObj(me.updateType.update, IDs[i], null, null, null, true);
|
|
|
postData.push(delObj);
|
|
|
}
|
|
|
}
|
|
|
- if(postData.length > 0){
|
|
|
+ if (postData.length > 0) {
|
|
|
//ajax
|
|
|
me.sectionTreeAjax(postData, function (rstData) {
|
|
|
$('#delAlert').modal('hide');
|
|
@@ -413,17 +413,17 @@ let sectionTreeObj = {
|
|
|
}
|
|
|
},
|
|
|
removeRationsCodes: function (rations) {
|
|
|
- for(let ration of rations){
|
|
|
+ for (let ration of rations) {
|
|
|
rationOprObj.rationsCodes.splice(rationOprObj.rationsCodes.indexOf(ration.code), 1);
|
|
|
}
|
|
|
},
|
|
|
- getSameDepthNodes: function(){
|
|
|
+ getSameDepthNodes: function () {
|
|
|
let rst = [];
|
|
|
let sel = this.sheet.getSelections()[0];
|
|
|
let selectedDepth = this.tree.selected.depth();
|
|
|
- for(let i = 0; i < sel.rowCount; i++){
|
|
|
+ for (let i = 0; i < sel.rowCount; i++) {
|
|
|
let row = sel.row + i;
|
|
|
- if(this.cache[row].depth() === selectedDepth){
|
|
|
+ if (this.cache[row].depth() === selectedDepth) {
|
|
|
rst.push(this.cache[row]);
|
|
|
}
|
|
|
}
|
|
@@ -434,42 +434,42 @@ let sectionTreeObj = {
|
|
|
me.upLevelBtn.addClass('disabled');
|
|
|
let postData = [];
|
|
|
let selNodes = me.getSameDepthNodes();
|
|
|
- if(selNodes.length <= 0){
|
|
|
- return ;
|
|
|
+ if (selNodes.length <= 0) {
|
|
|
+ return;
|
|
|
}
|
|
|
let firstParent = selNodes[0].parent;
|
|
|
- if(!me.isDef(firstParent)){
|
|
|
+ if (!me.isDef(firstParent)) {
|
|
|
return;
|
|
|
}
|
|
|
//更新父节点
|
|
|
postData.push(me.getUpdateObj(me.updateType.update, firstParent.getID(), selNodes[0].getID(), null, null, null));
|
|
|
//更新前节点
|
|
|
- if(me.isDef(selNodes[0].preSibling)){
|
|
|
+ if (me.isDef(selNodes[0].preSibling)) {
|
|
|
postData.push(me.getUpdateObj(me.updateType.update, selNodes[0].preSibling.getID(), -1, null, null, null));
|
|
|
}
|
|
|
//更新选中节点的后兄弟节点
|
|
|
let lastSelNode = selNodes[selNodes.length - 1];
|
|
|
let nextIDs = [];
|
|
|
getNext(lastSelNode);
|
|
|
- function getNext(node){
|
|
|
- if(me.isDef(node.nextSibling)){
|
|
|
+ function getNext(node) {
|
|
|
+ if (me.isDef(node.nextSibling)) {
|
|
|
nextIDs.push(node.getNextSiblingID());
|
|
|
getNext(node.nextSibling);
|
|
|
}
|
|
|
}
|
|
|
- for(let nextID of nextIDs){
|
|
|
+ for (let nextID of nextIDs) {
|
|
|
postData.push(me.getUpdateObj(me.updateType.update, nextID, null, lastSelNode.getID(), null, null));
|
|
|
}
|
|
|
//更新选中节点
|
|
|
- for(let i = 0; i < selNodes.length; i++){
|
|
|
+ for (let i = 0; i < selNodes.length; i++) {
|
|
|
let selNode = selNodes[i];
|
|
|
let nid = i === selNodes.length - 1 ? firstParent.getNextSiblingID() : selNode.getNextSiblingID();
|
|
|
postData.push(me.getUpdateObj(me.updateType.update, selNode.getID(), nid, firstParent.getParentID(), null, null));
|
|
|
}
|
|
|
- if(postData.length > 0){
|
|
|
+ if (postData.length > 0) {
|
|
|
//ajax
|
|
|
me.sectionTreeAjax(postData, function (rstData) {
|
|
|
- for(let selNode of selNodes){
|
|
|
+ for (let selNode of selNodes) {
|
|
|
me.controller.setTreeSelected(selNode);
|
|
|
me.controller.upLevel();
|
|
|
}
|
|
@@ -483,28 +483,28 @@ let sectionTreeObj = {
|
|
|
me.downLevelBtn.addClass('disabled');
|
|
|
let postData = [];
|
|
|
let selNodes = me.getSameDepthNodes();
|
|
|
- if(selNodes.length <= 0 ){
|
|
|
+ if (selNodes.length <= 0) {
|
|
|
return;
|
|
|
}
|
|
|
let firstPreSibling = selNodes[0].preSibling;
|
|
|
- if(!me.isDef(firstPreSibling)){
|
|
|
+ if (!me.isDef(firstPreSibling)) {
|
|
|
return;
|
|
|
}
|
|
|
//更新前节点
|
|
|
postData.push(me.getUpdateObj(me.updateType.update, firstPreSibling.getID(), selNodes[selNodes.length - 1].getNextSiblingID(), null, null, null));
|
|
|
//更新前节点最末子节点
|
|
|
- if(firstPreSibling.children.length > 0){
|
|
|
+ if (firstPreSibling.children.length > 0) {
|
|
|
postData.push(me.getUpdateObj(me.updateType.update, firstPreSibling.children[firstPreSibling.children.length - 1].getID(), selNodes[0].getID(), null, null, null));
|
|
|
}
|
|
|
//更新选中节点
|
|
|
- for(let i = 0; i < selNodes.length; i++){
|
|
|
+ for (let i = 0; i < selNodes.length; i++) {
|
|
|
let selNode = selNodes[i];
|
|
|
postData.push(me.getUpdateObj(me.updateType.update, selNode.getID(), i === selNodes.length - 1 ? -1 : selNode.getNextSiblingID(), firstPreSibling.getID(), null, null));
|
|
|
}
|
|
|
- if(postData.length > 0){
|
|
|
+ if (postData.length > 0) {
|
|
|
//ajax
|
|
|
me.sectionTreeAjax(postData, function (rstData) {
|
|
|
- for(let selNode of selNodes){
|
|
|
+ for (let selNode of selNodes) {
|
|
|
me.controller.setTreeSelected(selNode);
|
|
|
me.controller.downLevel();
|
|
|
}
|
|
@@ -517,21 +517,21 @@ let sectionTreeObj = {
|
|
|
let me = this;
|
|
|
me.upMoveBtn.addClass('disabled');
|
|
|
let postData = [];
|
|
|
- if(!me.isDef(selected)){
|
|
|
+ if (!me.isDef(selected)) {
|
|
|
return;
|
|
|
}
|
|
|
- if(!me.isDef(selected.preSibling)){
|
|
|
+ if (!me.isDef(selected.preSibling)) {
|
|
|
return;
|
|
|
}
|
|
|
let updateObj = me.getUpdateObj(me.updateType.update, selected.getID(), selected.preSibling.getID(), null, null, null);
|
|
|
postData.push(updateObj);
|
|
|
let updatePre = me.getUpdateObj(me.updateType.update, selected.preSibling.getID(), selected.getNextSiblingID(), null, null, null);
|
|
|
postData.push(updatePre);
|
|
|
- if(me.isDef(selected.preSibling.preSibling)){
|
|
|
+ if (me.isDef(selected.preSibling.preSibling)) {
|
|
|
let updatePrepre = me.getUpdateObj(me.updateType.update, selected.preSibling.preSibling.getID(), selected.getID(), null, null, null);
|
|
|
postData.push(updatePrepre);
|
|
|
}
|
|
|
- if(postData.length > 0){
|
|
|
+ if (postData.length > 0) {
|
|
|
//ajax
|
|
|
me.sectionTreeAjax(postData, function (rstData) {
|
|
|
me.controller.upMove();
|
|
@@ -544,13 +544,13 @@ let sectionTreeObj = {
|
|
|
let me = this;
|
|
|
me.downMoveBtn.addClass('disabled');
|
|
|
let postData = [];
|
|
|
- if(!me.isDef(selected)){
|
|
|
+ if (!me.isDef(selected)) {
|
|
|
return;
|
|
|
}
|
|
|
- if(!me.isDef(selected.nextSibling)){
|
|
|
+ if (!me.isDef(selected.nextSibling)) {
|
|
|
return;
|
|
|
}
|
|
|
- if(me.isDef(selected.preSibling)){
|
|
|
+ if (me.isDef(selected.preSibling)) {
|
|
|
let updatePre = me.getUpdateObj(me.updateType.update, selected.preSibling.getID(), selected.getNextSiblingID(), null, null, null);
|
|
|
postData.push(updatePre);
|
|
|
}
|
|
@@ -558,7 +558,7 @@ let sectionTreeObj = {
|
|
|
postData.push(updateObj);
|
|
|
let updateNext = me.getUpdateObj(me.updateType.update, selected.getNextSiblingID(), selected.getID(), null, null, null);
|
|
|
postData.push(updateNext);
|
|
|
- if(postData.length > 0){
|
|
|
+ if (postData.length > 0) {
|
|
|
//ajax
|
|
|
me.sectionTreeAjax(postData, function (rstData) {
|
|
|
me.controller.downMove();
|
|
@@ -572,49 +572,49 @@ let sectionTreeObj = {
|
|
|
updateObj.updateType = '';
|
|
|
updateObj.updateData = Object.create(null);
|
|
|
updateObj.updateData.rationRepId = pageOprObj.rationLibId;
|
|
|
- if(this.isDef(updateType)){
|
|
|
+ if (this.isDef(updateType)) {
|
|
|
updateObj.updateType = updateType;
|
|
|
}
|
|
|
- if(this.isDef(id)){
|
|
|
+ if (this.isDef(id)) {
|
|
|
updateObj.updateData.ID = id;
|
|
|
}
|
|
|
- if(this.isDef(nid)){
|
|
|
+ if (this.isDef(nid)) {
|
|
|
updateObj.updateData.NextSiblingID = nid;
|
|
|
}
|
|
|
- if(this.isDef(pid)){
|
|
|
+ if (this.isDef(pid)) {
|
|
|
updateObj.updateData.ParentID = pid;
|
|
|
}
|
|
|
- if(this.isDef(name)){
|
|
|
+ if (this.isDef(name)) {
|
|
|
updateObj.updateData.name = name;
|
|
|
}
|
|
|
- if(this.isDef(deleted)){
|
|
|
+ if (this.isDef(deleted)) {
|
|
|
updateObj.updateData.isDeleted = true;
|
|
|
}
|
|
|
return updateObj;
|
|
|
},
|
|
|
sectionTreeAjax: function (postData, scFunc, errFunc) {
|
|
|
- CommonAjax.post('api/updateNodes', {updateData: postData, lastOpr: userAccount}, scFunc, errFunc);
|
|
|
+ CommonAjax.post('api/updateNodes', { updateData: postData, lastOpr: userAccount }, scFunc, errFunc);
|
|
|
},
|
|
|
initTools: function (node) {
|
|
|
- if(this.isDef(node)){
|
|
|
- explanatoryOprObj.setAttribute(explanatoryOprObj.currentTreeNode ? explanatoryOprObj.currentTreeNode : node, node, node.data.explanation, node.data.ruleText);
|
|
|
- explanatoryOprObj.showText(explanatoryOprObj.exEditor, explanatoryOprObj.calcEditor, node.data.explanation, node.data.ruleText);
|
|
|
+ if (this.isDef(node)) {
|
|
|
+ explanatoryOprObj.setAttribute(explanatoryOprObj.currentTreeNode ? explanatoryOprObj.currentTreeNode : node, node, node.data.explanation, node.data.erratumRecord, node.data.ruleText);
|
|
|
+ explanatoryOprObj.showText(node.data.explanation, node.data.erratumRecord, node.data.ruleText);
|
|
|
//job
|
|
|
- jobContentOprObj.currentSituation = typeof node.data.jobContentSituation !== 'undefined'? node.data.jobContentSituation : jobContentOprObj.situations.ALL;
|
|
|
+ jobContentOprObj.currentSituation = typeof node.data.jobContentSituation !== 'undefined' ? node.data.jobContentSituation : jobContentOprObj.situations.ALL;
|
|
|
jobContentOprObj.setAttribute(jobContentOprObj.currentTreeNode ? jobContentOprObj.currentTreeNode : node, node);
|
|
|
jobContentOprObj.clickUpdate($('#txtareaAll'));
|
|
|
//fz
|
|
|
- annotationOprObj.currentSituation = typeof node.data.annotationSituation !== 'undefined'? node.data.annotationSituation : annotationOprObj.situations.ALL;
|
|
|
+ annotationOprObj.currentSituation = typeof node.data.annotationSituation !== 'undefined' ? node.data.annotationSituation : annotationOprObj.situations.ALL;
|
|
|
annotationOprObj.clickUpdate($('#fzTxtareaAll'));
|
|
|
}
|
|
|
},
|
|
|
//模仿默认点击
|
|
|
initSelection: function (node, doAfterGetRation = null) {
|
|
|
- if (node && node.tree){
|
|
|
+ if (node && node.tree) {
|
|
|
node.tree.selected = node ? node : null;
|
|
|
}
|
|
|
let me = this;
|
|
|
- if(!me.isDef(node)){
|
|
|
+ if (!me.isDef(node)) {
|
|
|
sheetCommonObj.cleanSheet(rationOprObj.workBook.getActiveSheet(), rationOprObj.setting, -1);
|
|
|
sheetCommonObj.cleanSheet(rationGLJOprObj.sheet, rationGLJOprObj.setting, -1);
|
|
|
sheetCommonObj.cleanSheet(rationAssistOprObj.sheet, rationAssistOprObj.setting, -1);
|
|
@@ -625,7 +625,7 @@ let sectionTreeObj = {
|
|
|
//me.workBook.getActiveSheet().setActiveCell(node.serialNo(), me.workBook.getActiveSheet().getActiveColumnIndex());
|
|
|
me.initTools(node);
|
|
|
me.refreshBtn(node);
|
|
|
- if(!me.isDef(node.children) || node.children.length === 0){
|
|
|
+ if (!me.isDef(node.children) || node.children.length === 0) {
|
|
|
//需要根据章节树下是否含有定额数据判断是否可以删除,在异步获取定额数据前将删除按钮无效化
|
|
|
me.removeBtn.addClass('disabled');
|
|
|
rationOprObj.canRations = true;
|
|
@@ -668,7 +668,7 @@ let sectionTreeObj = {
|
|
|
$seach.val(rationCode);
|
|
|
//去后台搜索该定额
|
|
|
$.bootstrapLoading.start();
|
|
|
- CommonAjax.post('/rationRepository/api/getRationItem', {rationLibId: pageOprObj.rationLibId, code: rationCode}, function (rstData) {
|
|
|
+ CommonAjax.post('/rationRepository/api/getRationItem', { rationLibId: pageOprObj.rationLibId, code: rationCode }, function (rstData) {
|
|
|
if (!rstData) {
|
|
|
alert(`不存在定额${rationCode}`);
|
|
|
$.bootstrapLoading.end();
|
|
@@ -690,7 +690,7 @@ let sectionTreeObj = {
|
|
|
me.sheet.showRow(sectionRow, GC.Spread.Sheets.VerticalPosition.top);
|
|
|
$.bootstrapLoading.end();
|
|
|
const doAfterGetRation = function (rations) {
|
|
|
- const findRation = _.find(rations, {code: rationCode});
|
|
|
+ const findRation = _.find(rations, { code: rationCode });
|
|
|
const rIdx = rations.indexOf(findRation);
|
|
|
const rationSheet = rationOprObj.workBook.getActiveSheet();
|
|
|
rationSheet.setActiveCell(rIdx, 0);
|
|
@@ -705,7 +705,7 @@ let sectionTreeObj = {
|
|
|
};
|
|
|
$(document).ready(function () {
|
|
|
$('#rationSearch').keydown(function (event) {
|
|
|
- if(event.keyCode === 13){
|
|
|
+ if (event.keyCode === 13) {
|
|
|
$(this).blur();
|
|
|
let rationCode = $(this).val().toUpperCase();
|
|
|
if (rationCode) {
|