Procházet zdrojové kódy

feat: 人材机库编辑器,新增“搜索人材机”

vian před 1 rokem
rodič
revize
0f7e30b8e1

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 117 - 84
config/config.js


+ 9 - 8
modules/all_models/stdRation_coe.js

@@ -6,14 +6,14 @@ const mongoose = require('mongoose');
 const Schema = mongoose.Schema;
 const coeSchema = new Schema({
     coeType: String,                // 系数类型,指作用范围:
-                                    // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
+    // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
     gljID: Number,                  // 要调整的工料机ID(当coeType=0时有效)
     operator: String,               // 运算符(*、+、-、=)
     amount: String,                 // 调整的量
     gljCode: String,
     gljName: String,
-    replaceCode:String,
-    replaceName:String,
+    replaceCode: String,
+    replaceName: String,
     _id: false
 });
 
@@ -23,10 +23,11 @@ const coeListSchema = new Schema({
     serialNo: Number,                  //编号
     name: String,                       // 名称
     content: String,                    // 说明
-    original_code:String,               //原人材机编码
-    option_codes:String,                //可选人材机编码
-    option_list:[Schema.Types.Mixed],//下拉列表选项
+    original_code: String,               //原人材机编码
+    option_codes: String,                //可选人材机编码
+    option_list: [Schema.Types.Mixed],//下拉列表选项
     coes: [coeSchema]
-}, {versionKey: false});
+}, { versionKey: false });
 
-mongoose.model('std_ration_lib_coe_list', coeListSchema, 'std_ration_lib_coe_list');
+mongoose.model('std_ration_lib_coe_list', coeListSchema, 'std_ration_lib_coe_list');
+mongoose.model('std_ration_lib_coe_list_backup', coeListSchema, 'std_ration_lib_coe_list_backup');

+ 10 - 9
modules/all_models/stdRation_ration.js

@@ -7,7 +7,7 @@ const Schema = mongoose.Schema;
 const rationGljItemSchema = new Schema({
     gljId: Number,
     consumeAmt: Number,
-    proportion: {type: Number, default: 0} //配合比,暂时无需使用,默认0
+    proportion: { type: Number, default: 0 } //配合比,暂时无需使用,默认0
 }, { _id: false });
 
 const rationAssItemSchema = new Schema({
@@ -20,25 +20,25 @@ const rationAssItemSchema = new Schema({
     carryBit: String,
     minValue: String,
     maxValue: String,
-    paramName:String,//参数名称
-    param:String,//参数
-    thirdRationCode:String//第三定额
+    paramName: String,//参数名称
+    param: String,//参数
+    thirdRationCode: String//第三定额
 }, { _id: false });
 
 //定额安装增加费用
 const rationInstSchema = new Schema({
     feeItemId: String,
     sectionId: String
-},{_id: false});
+}, { _id: false });
 
 const rationItemSchema = new Schema({
-    ID:Number,
+    ID: Number,
     code: String,
     name: String,
     unit: String,
     basePrice: Number,
     sectionId: Number,
-    rationRepId: {type: Number, index: true},
+    rationRepId: { type: Number, index: true },
     caption: String,
     feeType: String,
     jobContent: String,
@@ -51,7 +51,8 @@ const rationItemSchema = new Schema({
         type: Array,
         default: []
     },
-    isDeleted: {type: Boolean, default: false}
+    isDeleted: { type: Boolean, default: false }
 });
 
-mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');
+mongoose.model('std_ration_lib_ration_items', rationItemSchema, 'std_ration_lib_ration_items');
+mongoose.model('std_ration_lib_ration_items_backup', rationItemSchema, 'std_ration_lib_ration_items_backup');

+ 2 - 1
modules/all_models/stdRation_section.js

@@ -18,4 +18,5 @@ const rationChapterTreeSchema = new Schema({//章节树  //生成唯一id改为s
     isDeleted: Boolean
 });
 
-mongoose.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema, 'std_ration_lib_ration_chapter_trees');
+mongoose.model("std_ration_lib_ration_chapter_trees", rationChapterTreeSchema, 'std_ration_lib_ration_chapter_trees');
+mongoose.model("std_ration_lib_ration_chapter_trees_backup", rationChapterTreeSchema, 'std_ration_lib_ration_chapter_trees_backup');

+ 26 - 24
modules/ration_repository/controllers/repository_views_controller.js

@@ -8,21 +8,23 @@ import mongoose from 'mongoose';
 const compilationModel = mongoose.model('compilation');
 const rationLibModel = mongoose.model('std_ration_lib_map');
 const fs = require('fs');
-class ViewsController extends BaseController{
-    async redirectMain(req, res){
-        let filter = req.query.filter ? {compilationId: req.query.filter} : null;
-        let allLibs = await rationLibModel.find({}, {_id: 0, recentOpr: 0}),
+const rationDao = require('../models/ration_item');
+class ViewsController extends BaseController {
+    async redirectMain(req, res) {
+        let filter = req.query.filter ? { compilationId: req.query.filter } : null;
+        let allLibs = await rationLibModel.find({}, { _id: 0, recentOpr: 0 }),
             rationLibs = allLibs.filter(lib => filter && lib.compilationId === filter.compilationId || !filter),
             allNames = allLibs.map(lib => lib.dispName);
         let compilationModel = new CompilationModel();
-        let compilationList = await compilationModel.getCompilationList({_id: 1, name: 1});
-        compilationList.unshift({_id: 'all', name: '所有'});
+        let compilationList = await compilationModel.getCompilationList({ _id: 1, name: 1 });
+        compilationList.unshift({ _id: 'all', name: '所有' });
         let activeCompilation = compilationList.find(compilation => compilation._id.toString() === req.query.filter);
         if (activeCompilation) {
             activeCompilation.active = 'active';
         } else {
             compilationList[0].active = 'active'
         }
+        // await rationDao.copyLib(173, 214, 7, 7)
         res.render('maintain/ration_repository/main.html',
             {
                 rationLibs: rationLibs,
@@ -30,10 +32,10 @@ class ViewsController extends BaseController{
                 compilationList: compilationList,
                 userAccount: req.session.managerData.username,
                 userID: req.session.managerData.userID,
-                LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
+                LicenseKey: config.getLicenseKey(process.env.NODE_ENV)
             });
     }
-    async redirectRation(req, res){
+    async redirectRation(req, res) {
         const repId = req.query.repository;
         const locked = req.query.locked || 'true';
         const redirectGlj = `/rationRepository/lmm?repository=${repId}&locked=${locked}`;
@@ -41,12 +43,12 @@ class ViewsController extends BaseController{
         const redirectInstallation = `/rationRepository/installation?repository=${repId}&locked=${locked}`;
         let overWriteUrl = null;
         let priceProperties = [];
-        let stdRationLib = await rationLibModel.findOne({ID: repId});
-        if(stdRationLib){
-            let compilation = await compilationModel.findOne({_id: mongoose.Types.ObjectId(stdRationLib.compilationId)});
+        let stdRationLib = await rationLibModel.findOne({ ID: repId });
+        if (stdRationLib) {
+            let compilation = await compilationModel.findOne({ _id: mongoose.Types.ObjectId(stdRationLib.compilationId) });
             priceProperties = compilation.priceProperties ? compilation.priceProperties : [];
             let absoluteUrl = compilation.overWriteUrl ? req.app.locals.rootDir + compilation.overWriteUrl : req.app.locals.rootDir;
-            overWriteUrl = fs.existsSync(absoluteUrl) && fs.statSync(absoluteUrl).isFile()? compilation.overWriteUrl : null;
+            overWriteUrl = fs.existsSync(absoluteUrl) && fs.statSync(absoluteUrl).isFile() ? compilation.overWriteUrl : null;
         }
         res.render('maintain/ration_repository/dinge.html',
             {
@@ -55,11 +57,11 @@ class ViewsController extends BaseController{
                 redirectGlj: redirectGlj,
                 redirectCoe: redirectCoe,
                 redirectInstallation: redirectInstallation,
-                LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
+                LicenseKey: config.getLicenseKey(process.env.NODE_ENV),
                 priceProperties: JSON.stringify(priceProperties)
             });
     }
-    async redirectGlj(req, res){
+    async redirectGlj(req, res) {
         const repId = req.query.repository;
         const locked = req.query.locked || 'true';
         const redirectRation = `/rationRepository/ration?repository=${repId}&locked=${locked}`;
@@ -67,12 +69,12 @@ class ViewsController extends BaseController{
         const redirectInstallation = `/rationRepository/installation?repository=${repId}&locked=${locked}`;
         let overWriteUrl = null;
         let priceProperties = [];
-        let stdRationLib = await rationLibModel.findOne({ID: repId});
-        if(stdRationLib){
-            let compilation = await compilationModel.findOne({_id: mongoose.Types.ObjectId(stdRationLib.compilationId)});
+        let stdRationLib = await rationLibModel.findOne({ ID: repId });
+        if (stdRationLib) {
+            let compilation = await compilationModel.findOne({ _id: mongoose.Types.ObjectId(stdRationLib.compilationId) });
             priceProperties = compilation.priceProperties ? compilation.priceProperties : [];
             let absoluteUrl = compilation.overWriteUrl ? req.app.locals.rootDir + compilation.overWriteUrl : req.app.locals.rootDir;
-            overWriteUrl = fs.existsSync(absoluteUrl) && fs.statSync(absoluteUrl).isFile()? compilation.overWriteUrl : null;
+            overWriteUrl = fs.existsSync(absoluteUrl) && fs.statSync(absoluteUrl).isFile() ? compilation.overWriteUrl : null;
         }
         res.render('maintain/ration_repository/gongliao.html',
             {
@@ -81,12 +83,12 @@ class ViewsController extends BaseController{
                 redirectRation: redirectRation,
                 redirectCoe: redirectCoe,
                 redirectInstallation: redirectInstallation,
-                LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
+                LicenseKey: config.getLicenseKey(process.env.NODE_ENV),
                 priceProperties: JSON.stringify(priceProperties),
                 rationLib: stdRationLib
             });
     }
-    redirectCoeList(req, res){
+    redirectCoeList(req, res) {
         const repId = req.query.repository;
         const locked = req.query.locked || 'true';
         const redirectGlj = `/rationRepository/lmm?repository=${repId}&locked=${locked}`;
@@ -99,16 +101,16 @@ class ViewsController extends BaseController{
                 redirectGlj: redirectGlj,
                 redirectRation: redirectRation,
                 redirectInstallation: redirectInstallation,
-                LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
+                LicenseKey: config.getLicenseKey(process.env.NODE_ENV)
             });
     }
-    async redirectInstallation(req, res){
+    async redirectInstallation(req, res) {
         const repId = req.query.repository;
         const locked = req.query.locked || 'true';
         const redirectGlj = `/rationRepository/lmm?repository=${repId}&locked=${locked}`;
         const redirectCoe = `/rationRepository/coeList?repository=${repId}&locked=${locked}`;
         const redirectRation = `/rationRepository/ration?repository=${repId}&locked=${locked}`;
-        let stdRationLib = await rationLibModel.findOne({ID: repId});
+        let stdRationLib = await rationLibModel.findOne({ ID: repId });
         res.render('maintain/ration_repository/anzhuang.html',
             {
                 userAccount: req.session.managerData.username,
@@ -116,7 +118,7 @@ class ViewsController extends BaseController{
                 redirectGlj: redirectGlj,
                 redirectCoe: redirectCoe,
                 redirectRation: redirectRation,
-                LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
+                LicenseKey: config.getLicenseKey(process.env.NODE_ENV),
                 rationLib: stdRationLib
             });
     }

+ 185 - 175
modules/ration_repository/models/ration_item.js

@@ -9,21 +9,24 @@ let gljDao = require('./glj_repository');
 let rationRepositoryDao = require('./repository_map');
 const scMathUtil = require('../../../public/scMathUtil').getUtil();
 const rationItemModel = mongoose.model('std_ration_lib_ration_items');
+const rationItemBackupModel = mongoose.model('std_ration_lib_ration_items_backup');
 const stdRationLibModel = mongoose.model('std_ration_lib_map');
 const stdRationSectionModel = mongoose.model('std_ration_lib_ration_chapter_trees');
+const stdRationSectionBackupModel = mongoose.model('std_ration_lib_ration_chapter_trees_backup');
 const stdCoeModel = mongoose.model('std_ration_lib_coe_list');
+const stdCoeBackupModel = mongoose.model('std_ration_lib_coe_list_backup');
 const compleRationModel = mongoose.model('complementary_ration_items');
 import STDGLJListModel from '../../std_glj_lib/models/gljModel';
 import InstallationDao from '../models/installation';
 const installationDao = new InstallationDao();
 import GljDao from "../../std_glj_lib/models/gljModel";
 const stdGljDao = new GljDao();
-import stdgljutil  from "../../../public/cache/std_glj_type_util";
+import stdgljutil from "../../../public/cache/std_glj_type_util";
 //add
 const stdGLJItemModel = mongoose.model('std_glj_lib_gljList');
 // const _rationItemModelBackup = mongoose.model('std_ration_lib_ration_items_backup');
 
-var rationItemDAO = function(){};
+var rationItemDAO = function () { };
 
 
 async function getIDMapping(counterName, data) {
@@ -38,7 +41,7 @@ async function getIDMapping(counterName, data) {
 
 // 拷贝分类树
 async function copyClassData(sourceLibID, targetLibID) {
-    const sourceClassData = await stdRationSectionModel.find({ rationRepId: sourceLibID }, '-_id').lean();
+    const sourceClassData = await stdRationSectionBackupModel.find({ rationRepId: sourceLibID }, '-_id').lean();
     const IDMapping = await getIDMapping(counter.moduleName.rationTree, sourceClassData);
     const insertData = sourceClassData.map(item => ({
         ...item,
@@ -55,7 +58,7 @@ async function copyClassData(sourceLibID, targetLibID) {
 
 // 拷贝子目换算
 async function copyCoeData(sourceLibID, targetLibID) {
-    const sourceCoeData = await stdCoeModel.find({ libID: sourceLibID }, '-_id').lean();
+    const sourceCoeData = await stdCoeBackupModel.find({ libID: sourceLibID }, '-_id').lean();
     const IDMapping = await getIDMapping(counter.moduleName.coeList, sourceCoeData);
     const insertData = sourceCoeData.map(item => ({
         ...item,
@@ -70,8 +73,8 @@ async function copyCoeData(sourceLibID, targetLibID) {
 
 
 // 拷贝定额库
-rationItemDAO.prototype.copyLib = async function(sourceLibID, targetLibID, sourceGLJLibID, targetGLJLibID) {
-    const sourceRationData = await rationItemModel.find({ rationRepId: sourceLibID }, '-_id').lean();
+rationItemDAO.prototype.copyLib = async function (sourceLibID, targetLibID, sourceGLJLibID, targetGLJLibID) {
+    const sourceRationData = await rationItemBackupModel.find({ rationRepId: sourceLibID }, '-_id').lean();
     const rationIDMapping = await getIDMapping(counter.moduleName.rations, sourceRationData);
     const classIDMapping = await copyClassData(sourceLibID, targetLibID);
     const coeIDMapping = await copyCoeData(sourceLibID, targetLibID);
@@ -168,7 +171,7 @@ rationItemDAO.prototype.updateRationGLJByOrgID = async function (rationLibID, gl
 // 处理部颁数据
 rationItemDAO.prototype.handleBBData = async function (rationLibID, gljLibID) {
     const rations = await rationItemModel.find({ rationRepId: rationLibID }, '-_id ID rationGljList').lean();
-    const gljs = await stdGLJItemModel.find({ repositoryId: gljLibID, 'component.0': {$exists: true} }, '-_id ID component').lean();
+    const gljs = await stdGLJItemModel.find({ repositoryId: gljLibID, 'component.0': { $exists: true } }, '-_id ID component').lean();
     const gljIDMap = {};
     gljs.forEach(glj => gljIDMap[glj.ID] = gljs);
     const updateData = [];
@@ -200,7 +203,7 @@ rationItemDAO.prototype.handleBBData = async function (rationLibID, gljLibID) {
                 if (diff <= errorRange) {
                     isChanged = true;
                 } else {
-                    newRationGljList.push(rGLJ);    
+                    newRationGljList.push(rGLJ);
                 }
             } else {
                 newRationGljList.push(rGLJ);
@@ -221,10 +224,10 @@ rationItemDAO.prototype.handleBBData = async function (rationLibID, gljLibID) {
 };
 
 // 由于导入excel时,excel数据存在负的工程量,所以导入后一些定额人材机的消耗量可能为负,需要处理
-rationItemDAO.prototype.handleMinusQuantity = async function() {
+rationItemDAO.prototype.handleMinusQuantity = async function () {
     const updateTask = [];
     const repIDs = new Set();
-    const rations = await rationItemModel.find({'rationGljList.consumeAmt': {$lt: 0}}).lean();
+    const rations = await rationItemModel.find({ 'rationGljList.consumeAmt': { $lt: 0 } }).lean();
     for (const ration of rations) {
         repIDs.add(ration.rationRepId);
         const rationGLJList = [];
@@ -251,11 +254,11 @@ rationItemDAO.prototype.handleMinusQuantity = async function() {
 
 rationItemDAO.prototype.prepareInitData = async function (rationRepId) {
     // 定额库
-    const libTask = stdRationLibModel.findOne({ID: rationRepId}, '-_id ID dispName gljLib');
+    const libTask = stdRationLibModel.findOne({ ID: rationRepId }, '-_id ID dispName gljLib');
     // 定额编码
-    const codesTask = rationItemModel.find({rationRepId}, '-_id code', {lean: true});
+    const codesTask = rationItemModel.find({ rationRepId }, '-_id code', { lean: true });
     // 定额章节树
-    const sectionTreeTask = stdRationSectionModel.find({rationRepId}, '-_id', {lean: true});
+    const sectionTreeTask = stdRationSectionModel.find({ rationRepId }, '-_id', { lean: true });
     // 安装增加费
     const installationTask = installationDao.getInstallation(rationRepId);
     const [libInfo, codesArr, sectionTree, installationList] = await Promise.all([libTask, codesTask, sectionTreeTask, installationTask]);
@@ -282,7 +285,7 @@ rationItemDAO.prototype.prepareInitData = async function (rationRepId) {
 
 //将消耗量为负的人材机改为正的
 rationItemDAO.prototype.toPositive = async function (rationRepId) {
-    let rations = await rationItemModel.find({rationRepId: rationRepId, 'rationGljList.consumeAmt': {$lt: 0}});
+    let rations = await rationItemModel.find({ rationRepId: rationRepId, 'rationGljList.consumeAmt': { $lt: 0 } });
     let task = [];
     for (let ration of rations) {
         let update = false;
@@ -293,7 +296,7 @@ rationItemDAO.prototype.toPositive = async function (rationRepId) {
             }
         }
         if (update) {
-            task.push({updateOne: {filter: {ID: ration.ID}, update: {rationGljList: ration.rationGljList}}});
+            task.push({ updateOne: { filter: { ID: ration.ID }, update: { rationGljList: ration.rationGljList } } });
         }
     }
     if (task.length > 0) {
@@ -302,53 +305,53 @@ rationItemDAO.prototype.toPositive = async function (rationRepId) {
 };
 
 rationItemDAO.prototype.getRationItemsByLib = async function (rationRepId, showHint = null, returnFields = '') {
-    let rationLib = await stdRationLibModel.findOne({ID: rationRepId, deleted: false});
-    if(!rationLib){
+    let rationLib = await stdRationLibModel.findOne({ ID: rationRepId, deleted: false });
+    if (!rationLib) {
         return [];
     }
     let startDate = new Date();
-    let rations = await rationItemModel.find({rationRepId: rationRepId}, returnFields);
+    let rations = await rationItemModel.find({ rationRepId: rationRepId }, returnFields);
     console.log(`Date: ${new Date() - startDate}====================================`);
-    if(!showHint){
+    if (!showHint) {
         return rations;
     }
     else {
         const stdBillsLibListsModel = new STDGLJListModel();
         const stdGLJData = await stdBillsLibListsModel.getGljItemsByRepId(rationLib.gljLib, '-_id ID code name unit gljType');
         let gljMapping = {};
-        for(let glj of stdGLJData){
+        for (let glj of stdGLJData) {
             gljMapping[glj.ID] = glj;
         }
         //设置悬浮
-        for(let ration of rations){
+        for (let ration of rations) {
             let hintsArr = [];
             //对人材机进行排序
             ration.rationGljList.sort(function (a, b) {
                 let gljA = gljMapping[a.gljId],
                     gljB = gljMapping[b.gljId];
-                if(gljA && gljB){
+                if (gljA && gljB) {
                     let aV = gljA.gljType + gljA.code,
                         bV = gljB.gljType + gljB.code;
-                    if(aV > bV) {
+                    if (aV > bV) {
                         return 1;
-                    } else if(aV < bV) {
+                    } else if (aV < bV) {
                         return -1;
                     }
                 }
                 return 0;
             });
-            for(let rationGlj of ration.rationGljList){
+            for (let rationGlj of ration.rationGljList) {
                 let subGlj = gljMapping[rationGlj.gljId];
-                if(subGlj){
+                if (subGlj) {
                     hintsArr.push(` ${subGlj.code} ${subGlj.name}${subGlj.specs ? '&nbsp;&nbsp;&nbsp;' + subGlj.specs : ''}&nbsp;&nbsp&nbsp;${subGlj.unit}&nbsp;&nbsp;&nbsp;${rationGlj.consumeAmt}`);
                 }
             }
             hintsArr.push(`基价 元 ${ration.basePrice}`);
-            if(ration.jobContent && ration.jobContent.toString().trim() !== ''){
+            if (ration.jobContent && ration.jobContent.toString().trim() !== '') {
                 hintsArr.push(`工作内容:`);
                 hintsArr = hintsArr.concat(ration.jobContent.split('\n'));
             }
-            if(ration.annotation && ration.annotation.toString().trim() !== ''){
+            if (ration.annotation && ration.annotation.toString().trim() !== '') {
                 hintsArr.push(`附注:`);
                 hintsArr = hintsArr.concat(ration.annotation.split('\n'));
             }
@@ -359,38 +362,38 @@ rationItemDAO.prototype.getRationItemsByLib = async function (rationRepId, showH
 };
 
 rationItemDAO.prototype.sortToNumber = function (datas) {
-    for(let i = 0, len = datas.length; i < len; i++){
+    for (let i = 0, len = datas.length; i < len; i++) {
         let data = datas[i]._doc;
-        if(_exist(data, 'labourPrice')){
+        if (_exist(data, 'labourPrice')) {
             data['labourPrice'] = parseFloat(data['labourPrice']);
         }
-        if(_exist(data, 'materialPrice')){
+        if (_exist(data, 'materialPrice')) {
             data['materialPrice'] = parseFloat(data['materialPrice']);
         }
-        if(_exist(data, 'machinePrice')){
+        if (_exist(data, 'machinePrice')) {
             data['machinePrice'] = parseFloat(data['machinePrice']);
         }
-        if(_exist(data, 'basePrice')){
+        if (_exist(data, 'basePrice')) {
             data['basePrice'] = parseFloat(data['basePrice']);
         }
-        if(_exist(data, 'rationGljList')){
-            for(let j = 0, jLen = data['rationGljList'].length; j < jLen; j++){
+        if (_exist(data, 'rationGljList')) {
+            for (let j = 0, jLen = data['rationGljList'].length; j < jLen; j++) {
                 let raGljObj = data['rationGljList'][j]._doc;
-                if(_exist(raGljObj, 'consumeAmt')){
+                if (_exist(raGljObj, 'consumeAmt')) {
                     raGljObj['consumeAmt'] = parseFloat(raGljObj['consumeAmt']);
                 }
             }
         }
     }
-    function _exist(data, attr){
+    function _exist(data, attr) {
         return data && data[attr] !== undefined && data[attr];
     }
 };
 
-rationItemDAO.prototype.getRationItemsBySection = async function(rationRepId, sectionId,callback){
+rationItemDAO.prototype.getRationItemsBySection = async function (rationRepId, sectionId, callback) {
     let me = this;
     try {
-        let rations = await rationItemModel.find({rationRepId: rationRepId, sectionId: sectionId});
+        let rations = await rationItemModel.find({ rationRepId: rationRepId, sectionId: sectionId });
         me.sortToNumber(rations);
         let matchRationIDs = [],
             matchRations = [];
@@ -404,7 +407,7 @@ rationItemDAO.prototype.getRationItemsBySection = async function(rationRepId, se
             }
         }
         if (matchRationIDs.length > 0) {
-            matchRations = await rationItemModel.find({ID: {$in: matchRationIDs}}, '-_id ID code name');
+            matchRations = await rationItemModel.find({ ID: { $in: matchRationIDs } }, '-_id ID code name');
         }
         for (let mr of matchRations) {
             for (let ration of rations) {
@@ -418,29 +421,29 @@ rationItemDAO.prototype.getRationItemsBySection = async function(rationRepId, se
                 }
             }
         }
-        callback(false,"Get items successfully", rations);
+        callback(false, "Get items successfully", rations);
     } catch (err) {
         console.log(err);
         callback(true, "Fail to get items", "");
     }
-  /*  rationItemModel.find({"rationRepId": rationRepId, "sectionId": sectionId, "$or": [{"isDeleted": null}, {"isDeleted": false} ]},function(err,data){
-        if(err) callback(true, "Fail to get items", "");
-        else {
-            me.sortToNumber(data);
-            callback(false,"Get items successfully", data);
-        }
-    })*/
+    /*  rationItemModel.find({"rationRepId": rationRepId, "sectionId": sectionId, "$or": [{"isDeleted": null}, {"isDeleted": false} ]},function(err,data){
+          if(err) callback(true, "Fail to get items", "");
+          else {
+              me.sortToNumber(data);
+              callback(false,"Get items successfully", data);
+          }
+      })*/
 };
-rationItemDAO.prototype.mixUpdateRationItems = function(rationLibId, lastOpr, sectionId, updateItems, addItems, rIds, callback){
+rationItemDAO.prototype.mixUpdateRationItems = function (rationLibId, lastOpr, sectionId, updateItems, addItems, rIds, callback) {
     var me = this;
     if (updateItems.length == 0 && rIds.length == 0) {
         me.addRationItems(rationLibId, lastOpr, sectionId, addItems, callback);
     } else {
-        me.removeRationItems(rationLibId, lastOpr, rIds, function(err, message, docs) {
+        me.removeRationItems(rationLibId, lastOpr, rIds, function (err, message, docs) {
             if (err) {
                 callback(true, "Fail to remove", false);
             } else {
-                me.updateRationItems(rationLibId, lastOpr, sectionId, updateItems, function(err, results){
+                me.updateRationItems(rationLibId, lastOpr, sectionId, updateItems, function (err, results) {
                     if (err) {
                         callback(true, "Fail to save", false);
                     } else {
@@ -456,15 +459,15 @@ rationItemDAO.prototype.mixUpdateRationItems = function(rationLibId, lastOpr, se
     }
 };
 
-rationItemDAO.prototype.removeRationItems = function(rationLibId, lastOpr, rIds,callback){
+rationItemDAO.prototype.removeRationItems = function (rationLibId, lastOpr, rIds, callback) {
     if (rIds.length > 0) {
-        rationItemModel.collection.remove({ID: {$in: rIds}}, null, function(err, docs){
+        rationItemModel.collection.remove({ ID: { $in: rIds } }, null, function (err, docs) {
             if (err) {
                 callback(true, "Fail to remove", false);
             } else {
-                rationRepositoryDao.updateOprArr({ID: rationLibId}, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
-                    if(!err){
-                        rationItemModel.update({rationRepId: rationLibId}, {$pull: {rationTemplateList: {rationID: {$in: rIds}}}}, function (theErr) {
+                rationRepositoryDao.updateOprArr({ ID: rationLibId }, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
+                    if (!err) {
+                        rationItemModel.update({ rationRepId: rationLibId }, { $pull: { rationTemplateList: { rationID: { $in: rIds } } } }, function (theErr) {
                             if (!theErr) {
                                 callback(false, "Remove successfully", docs);
                             } else {
@@ -483,10 +486,10 @@ rationItemDAO.prototype.removeRationItems = function(rationLibId, lastOpr, rIds,
     }
 };
 
-rationItemDAO.prototype.getRationItemsByCode = function(repId, code,callback){
-    rationItemModel.find({"rationRepId": repId, "code": {'$regex': code, $options: '$i'}, "$or": [{"isDeleted": null}, {"isDeleted": false}]},function(err,data){
-        if(err) callback(true, "Fail to get items", "")
-        else callback(false,"Get items successfully", data);
+rationItemDAO.prototype.getRationItemsByCode = function (repId, code, callback) {
+    rationItemModel.find({ "rationRepId": repId, "code": { '$regex': code, $options: '$i' }, "$or": [{ "isDeleted": null }, { "isDeleted": false }] }, function (err, data) {
+        if (err) callback(true, "Fail to get items", "")
+        else callback(false, "Get items successfully", data);
     })
 };
 
@@ -494,9 +497,9 @@ rationItemDAO.prototype.findRation = function (repId, keyword, callback) {
     var filter = {
         'rationRepId': repId,
         '$and': [{
-            '$or': [{'code': {'$regex': keyword, $options: '$i'}}, {'name': {'$regex': keyword, $options: '$i'}}]
+            '$or': [{ 'code': { '$regex': keyword, $options: '$i' } }, { 'name': { '$regex': keyword, $options: '$i' } }]
         }, {
-            '$or': [{'isDeleted': {"$exists":false}}, {'isDeleted': null}, {'isDeleted': false}]
+            '$or': [{ 'isDeleted': { "$exists": false } }, { 'isDeleted': null }, { 'isDeleted': false }]
         }]
     };
     rationItemModel.find(filter, function (err, data) {
@@ -509,13 +512,13 @@ rationItemDAO.prototype.findRation = function (repId, keyword, callback) {
 }
 
 rationItemDAO.prototype.getRationItem = async function (repId, code) {
-    let ration = await rationItemModel.findOne({rationRepId: repId, code: code});
+    let ration = await rationItemModel.findOne({ rationRepId: repId, code: code });
     return ration;
 };
 
-rationItemDAO.prototype.addRationItems = function(rationLibId, lastOpr, sectionId, items,callback){
+rationItemDAO.prototype.addRationItems = function (rationLibId, lastOpr, sectionId, items, callback) {
     if (items && items.length > 0) {
-        counter.counterDAO.getIDAfterCount(counter.moduleName.rations, items.length, function(err, result){
+        counter.counterDAO.getIDAfterCount(counter.moduleName.rations, items.length, function (err, result) {
             var maxId = result.sequence_value;
             var arr = [];
             for (var i = 0; i < items.length; i++) {
@@ -525,15 +528,15 @@ rationItemDAO.prototype.addRationItems = function(rationLibId, lastOpr, sectionI
                 obj.rationRepId = rationLibId;
                 arr.push(obj);
             }
-            rationItemModel.collection.insert(arr, null, function(err, docs){
+            rationItemModel.collection.insert(arr, null, function (err, docs) {
                 if (err) {
                     callback(true, "Fail to save", false);
                 } else {
-                    rationRepositoryDao.updateOprArr({ID: rationLibId}, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
-                        if(err){
+                    rationRepositoryDao.updateOprArr({ ID: rationLibId }, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
+                        if (err) {
                             callback(true, "Fail to sava operator", false);
                         }
-                        else{
+                        else {
                             callback(false, "Save successfully", docs);
                         }
                     })
@@ -545,12 +548,12 @@ rationItemDAO.prototype.addRationItems = function(rationLibId, lastOpr, sectionI
     }
 };
 
-rationItemDAO.prototype.updateRationItems = function(rationLibId, lastOpr, sectionId, items,callback){
+rationItemDAO.prototype.updateRationItems = function (rationLibId, lastOpr, sectionId, items, callback) {
     console.log('enter============');
     var functions = [];
-    for (var i=0; i < items.length; i++) {
-        functions.push((function(doc) {
-            return function(cb) {
+    for (var i = 0; i < items.length; i++) {
+        functions.push((function (doc) {
+            return function (cb) {
                 var filter = {};
                 if (doc.ID) {
                     filter.ID = doc.ID;
@@ -565,26 +568,26 @@ rationItemDAO.prototype.updateRationItems = function(rationLibId, lastOpr, secti
     }
     functions.push((function () {
         return function (cb) {
-            rationRepositoryDao.updateOprArr({ID: rationLibId}, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
-                if(err){
+            rationRepositoryDao.updateOprArr({ ID: rationLibId }, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
+                if (err) {
                     cb(err);
                 }
-                else{
+                else {
                     cb(null);
                 }
             });
         }
     })());
-    async.parallel(functions, function(err, results) {
+    async.parallel(functions, function (err, results) {
         callback(err, results);
     });
 };
 //ration round func
-function round(v,e){
-    var t=1;
-    for(;e>0;t*=10,e--);
-    for(;e<0;t/=10,e++);
-    return Math.round(v*t)/t;
+function round(v, e) {
+    var t = 1;
+    for (; e > 0; t *= 10, e--);
+    for (; e < 0; t /= 10, e++);
+    return Math.round(v * t) / t;
 }
 
 
@@ -593,30 +596,30 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
         let adjGljId = basePrcObj.gljId, adjBasePrice = basePrcObj.basePrice, adjGljType = basePrcObj.gljType;
         async.waterfall([
             function (cb) {
-                if(typeof basePrcObj.delete !== 'undefined' && basePrcObj.delete === 1){
-                    rationItemModel.find({'rationGljList.gljId': adjGljId},{ID: 1, rationGljList: 1}, function (err, result) {
-                        if(err){
+                if (typeof basePrcObj.delete !== 'undefined' && basePrcObj.delete === 1) {
+                    rationItemModel.find({ 'rationGljList.gljId': adjGljId }, { ID: 1, rationGljList: 1 }, function (err, result) {
+                        if (err) {
                             cb(err);
                         }
-                        else{
+                        else {
                             //删除
-                            rationItemModel.update({'rationGljList.gljId': adjGljId}, {$pull: {rationGljList: {gljId: adjGljId}}}, {multi: true}, function (err) {
-                                if(err){
+                            rationItemModel.update({ 'rationGljList.gljId': adjGljId }, { $pull: { rationGljList: { gljId: adjGljId } } }, { multi: true }, function (err) {
+                                if (err) {
                                     cb(err);
                                 }
-                                else{
+                                else {
                                     //补充定额
-                                    compleRationModel.find({'rationGljList.gljId': adjGljId},{ID: 1, rationGljList: 1}, function (err, compleRst) {
-                                        if(err){
+                                    compleRationModel.find({ 'rationGljList.gljId': adjGljId }, { ID: 1, rationGljList: 1 }, function (err, compleRst) {
+                                        if (err) {
                                             cb(err);
                                         }
                                         else {
-                                            compleRationModel.update({'rationGljList.gljId': adjGljId}, {$pull: {rationGljList: {gljId: adjGljId}}}, {multi: true}, function (err) {
-                                                if(err){
+                                            compleRationModel.update({ 'rationGljList.gljId': adjGljId }, { $pull: { rationGljList: { gljId: adjGljId } } }, { multi: true }, function (err) {
+                                                if (err) {
                                                     cb(err);
                                                 }
                                                 else {
-                                                    for(let i = 0, len = compleRst.length; i < len; i++){
+                                                    for (let i = 0, len = compleRst.length; i < len; i++) {
                                                         compleRst[i]._doc.type = 'complementary';
                                                     }
                                                     cb(null, result.concat(compleRst));
@@ -629,18 +632,18 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                         }
                     });
                 }
-                else{
-                    rationItemModel.find({'rationGljList.gljId': adjGljId}, {ID: 1, rationGljList: 1}, function (err, result) {
-                        if(err){
+                else {
+                    rationItemModel.find({ 'rationGljList.gljId': adjGljId }, { ID: 1, rationGljList: 1 }, function (err, result) {
+                        if (err) {
                             cb(err);
                         }
-                        else{
-                            compleRationModel.find({'rationGljList.gljId': adjGljId}, {ID: 1, rationGljList: 1}, function (err, compleRst) {
-                                if(err){
+                        else {
+                            compleRationModel.find({ 'rationGljList.gljId': adjGljId }, { ID: 1, rationGljList: 1 }, function (err, compleRst) {
+                                if (err) {
                                     cb(err);
                                 }
                                 else {
-                                    for(let i = 0, len = compleRst.length; i < len; i++){
+                                    for (let i = 0, len = compleRst.length; i < len; i++) {
                                         compleRst[i]._doc.type = 'complementary';
                                     }
                                     cb(null, result.concat(compleRst));
@@ -654,9 +657,9 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                 let compleRTasks = [], stdRTasks = [];
                 //重算时需要用到的所有工料机,一次性取
                 let compleGljIds = [], stdGljIds = [];
-                for(let ration of result){
-                    for(let glj of ration.rationGljList){
-                        if(glj.type !== undefined && glj.type === 'complementary'){
+                for (let ration of result) {
+                    for (let glj of ration.rationGljList) {
+                        if (glj.type !== undefined && glj.type === 'complementary') {
                             compleGljIds.push(glj.gljId);
                         }
                         else {
@@ -665,28 +668,28 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                     }
                 }
                 gljDao.getStdCompleGljItems(compleGljIds, stdGljIds, function (err, allGljs) {
-                    if(err){
+                    if (err) {
                         cb(err);
                     }
                     else {
                         let gljIndex = {};
-                        for(let glj of allGljs){
+                        for (let glj of allGljs) {
                             gljIndex[glj.ID] = glj;
                         }
                         async.each(result, function (rationItem, ecb) {
                             let rationGljList = rationItem.rationGljList;
                             let gljArr = [];
-                            for(let i=0; i<rationGljList.length; i++){
+                            for (let i = 0; i < rationGljList.length; i++) {
                                 let theGlj = gljIndex[rationGljList[i].gljId];
-                                if(theGlj !== undefined && theGlj){
-                                    if(theGlj.ID === adjGljId){
-                                        gljArr.push({gljId: theGlj.ID, basePrice: adjBasePrice, consumeAmt: rationGljList[i].consumeAmt});
+                                if (theGlj !== undefined && theGlj) {
+                                    if (theGlj.ID === adjGljId) {
+                                        gljArr.push({ gljId: theGlj.ID, basePrice: adjBasePrice, consumeAmt: rationGljList[i].consumeAmt });
                                     } else {
-                                        if(theGlj.priceProperty && Object.keys(theGlj.priceProperty).length > 0){
+                                        if (theGlj.priceProperty && Object.keys(theGlj.priceProperty).length > 0) {
                                             let priceKeys = Object.keys(theGlj.priceProperty);
-                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.priceProperty[priceKeys[0]]), consumeAmt: rationGljList[i].consumeAmt});
+                                            gljArr.push({ gljId: theGlj.ID, basePrice: parseFloat(theGlj.priceProperty[priceKeys[0]]), consumeAmt: rationGljList[i].consumeAmt });
                                         } else {
-                                            gljArr.push({gljId: theGlj.ID, basePrice: parseFloat(theGlj.basePrice), consumeAmt: rationGljList[i].consumeAmt});
+                                            gljArr.push({ gljId: theGlj.ID, basePrice: parseFloat(theGlj.basePrice), consumeAmt: rationGljList[i].consumeAmt });
                                         }
                                     }
                                 }
@@ -708,7 +711,7 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                                 }
                             };
                             //updateDataBase
-                            if(rationItem._doc.type !== undefined && rationItem._doc.type === 'complementary'){
+                            if (rationItem._doc.type !== undefined && rationItem._doc.type === 'complementary') {
                                 compleRTasks.push(task);
                                 ecb(null);
                             }
@@ -716,21 +719,21 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                                 stdRTasks.push(task);
                                 ecb(null);
                             }
-                        }, async function(err){
-                            if(err){
+                        }, async function (err) {
+                            if (err) {
                                 cb(err);
                             }
                             else {
                                 //do sth
-                                try{
-                                    if(compleRTasks.length > 0){
+                                try {
+                                    if (compleRTasks.length > 0) {
                                         await compleRationModel.bulkWrite(compleRTasks);
                                     }
-                                    if(stdRTasks.length > 0){
+                                    if (stdRTasks.length > 0) {
                                         await rationItemModel.bulkWrite(stdRTasks);
                                     }
                                 }
-                                catch(e){
+                                catch (e) {
                                     cb(err);
                                 }
                                 cb(null);
@@ -740,18 +743,18 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
                 });
             },
         ], function (err) {
-            if(err){
+            if (err) {
                 finalCb(err);
             }
-            else{
+            else {
                 finalCb(null);
             }
         });
     }, function (err) {
-        if(err){
+        if (err) {
             callback(err, 'Error');
         }
-        else{
+        else {
             callback(null, '');
         }
     });
@@ -759,21 +762,21 @@ rationItemDAO.prototype.updateRationBasePrc = function (basePrcArr, callback) {
 
 rationItemDAO.prototype.getRationGljIds = function (data, callback) {
     let repId = data.repId;
-    rationItemModel.find({rationRepId: repId}, function (err, result) {
-        if(err){
+    rationItemModel.find({ rationRepId: repId }, function (err, result) {
+        if (err) {
             callback(err, 'Error', null);
         }
-        else{
+        else {
             let rstIds = [], newRst = [];
             result.forEach(function (data) {
-                if(data.rationGljList.length >0){
+                if (data.rationGljList.length > 0) {
                     data.rationGljList.forEach(function (gljObj) {
                         rstIds.push(gljObj.gljId);
                     })
                 }
             });
-            for(let i= 0; i< rstIds.length; i++){
-                if(newRst.indexOf(rstIds[i]) === -1){
+            for (let i = 0; i < rstIds.length; i++) {
+                if (newRst.indexOf(rstIds[i]) === -1) {
                     newRst.push(rstIds[i]);
                 }
             }
@@ -784,11 +787,11 @@ rationItemDAO.prototype.getRationGljIds = function (data, callback) {
 
 rationItemDAO.prototype.getRationsCodes = function (data, callback) {
     let repId = data.repId;
-    rationItemModel.find({rationRepId: repId, isDeleted: false}, function (err, result) {
-        if(err){
+    rationItemModel.find({ rationRepId: repId, isDeleted: false }, function (err, result) {
+        if (err) {
             callback(err, 'Error', null);
         }
-        else{
+        else {
             let rstCodes = [];
             result.forEach(function (rationItem) {
                 rstCodes.push(rationItem.code);
@@ -799,21 +802,21 @@ rationItemDAO.prototype.getRationsCodes = function (data, callback) {
 };
 
 rationItemDAO.prototype.updateJobContent = function (lastOpr, repId, updateArr, callback) {
-    rationRepositoryDao.updateOprArr({ID: repId}, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
+    rationRepositoryDao.updateOprArr({ ID: repId }, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
         async.each(updateArr, function (obj, cb) {
-            rationItemModel.update({rationRepId: repId, code: obj.code}, {$set: {jobContent: obj.jobContent}}, function (err) {
-                if(err){
+            rationItemModel.update({ rationRepId: repId, code: obj.code }, { $set: { jobContent: obj.jobContent } }, function (err) {
+                if (err) {
                     cb(err);
                 }
-                else{
+                else {
                     cb(null);
                 }
             })
         }, function (err) {
-            if(err){
+            if (err) {
                 callback(err);
             }
-            else{
+            else {
                 callback(null);
             }
         });
@@ -821,21 +824,21 @@ rationItemDAO.prototype.updateJobContent = function (lastOpr, repId, updateArr,
 }
 
 rationItemDAO.prototype.updateAnnotation = function (lastOpr, repId, updateArr, callback) {
-    rationRepositoryDao.updateOprArr({ID: repId}, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
+    rationRepositoryDao.updateOprArr({ ID: repId }, lastOpr, moment(Date.now()).format('YYYY-MM-DD HH:mm:ss'), function (err) {
         async.each(updateArr, function (obj, cb) {
-            rationItemModel.update({rationRepId: repId, code: obj.code}, {$set: {annotation: obj.annotation}}, function (err) {
-                if(err){
+            rationItemModel.update({ rationRepId: repId, code: obj.code }, { $set: { annotation: obj.annotation } }, function (err) {
+                if (err) {
                     cb(err);
                 }
-                else{
+                else {
                     cb(null);
                 }
             })
         }, function (err) {
-            if(err){
+            if (err) {
                 callback(err);
             }
-            else{
+            else {
                 callback(null);
             }
         });
@@ -856,7 +859,7 @@ rationItemDAO.prototype.updateRationTemplate = async function (rationRepId, rati
     }
     matachCodes = Array.from(new Set(matachCodes));
     if (matachCodes.length > 0) {
-        matchRations = await rationItemModel.find({rationRepId: rationRepId, code: {$in: matachCodes}}, '-_id ID code name');
+        matchRations = await rationItemModel.find({ rationRepId: rationRepId, code: { $in: matachCodes } }, '-_id ID code name');
     }
     let validData = [];
     //设置展示数据
@@ -879,10 +882,10 @@ rationItemDAO.prototype.updateRationTemplate = async function (rationRepId, rati
         }
     }
     for (let data of validData) {
-        saveData.push({rationID: data.rationID ? data.rationID : null, type: data.type, billsLocation: data.billsLocation});
+        saveData.push({ rationID: data.rationID ? data.rationID : null, type: data.type, billsLocation: data.billsLocation });
     }
     //更新
-    await rationItemModel.update({ID: rationID}, {$set: {rationTemplateList: saveData}});
+    await rationItemModel.update({ ID: rationID }, { $set: { rationTemplateList: saveData } });
     return validData;
 };
 
@@ -890,7 +893,7 @@ rationItemDAO.prototype.updateRationTemplate = async function (rationRepId, rati
 rationItemDAO.prototype.calcForRation = function (stdGljList, ration) {
     let rationGljList = ration.rationGljList;
     let basePrice = 0;
-    for(let rationGlj of rationGljList) {
+    for (let rationGlj of rationGljList) {
         let glj = stdGljList[rationGlj.gljId];
         if (glj) {
             basePrice += glj.basePrice * rationGlj.consumeAmt;
@@ -912,10 +915,10 @@ rationItemDAO.prototype.getRationItemByCondition = async function (condition, fi
     if (Object.keys(condition).length <= 0) {
         return result;
     }
-    result = await rationItemModel.find(condition, fields).sort({code: 1});
+    result = await rationItemModel.find(condition, fields).sort({ code: 1 });
     if (indexBy !== null && result.length > 0) {
         let tmpResult = {};
-        for(let tmp of result) {
+        for (let tmp of result) {
             tmpResult[tmp[indexBy]] = tmp;
         }
         result = tmpResult;
@@ -930,7 +933,7 @@ rationItemDAO.prototype.getRationItemByCondition = async function (condition, fi
  * @param {Array} data
  * @return {bool}
  */
-rationItemDAO.prototype.batchAddFromExcel = async function(rationRepId, data) {
+rationItemDAO.prototype.batchAddFromExcel = async function (rationRepId, data) {
     if (data.length <= 0) {
         return false;
     }
@@ -1026,17 +1029,17 @@ rationItemDAO.prototype.batchAddFromExcel = async function(rationRepId, data) {
     }
     //更新定额
     let updateBulk = [];
-    for(let ration of updateData){
+    for (let ration of updateData) {
         this.calcForRation(stdGLJListByID, ration);
         updateBulk.push({
             updateOne: {
-                filter: {rationRepId: rationRepId, code: ration.code},
-                update: {$set: {rationGljList: ration.rationGljList, basePrice: ration.basePrice}}
+                filter: { rationRepId: rationRepId, code: ration.code },
+                update: { $set: { rationGljList: ration.rationGljList, basePrice: ration.basePrice } }
             }
         });
     }
     //更新数据库
-    if(updateBulk.length > 0){
+    if (updateBulk.length > 0) {
         await rationItemModel.bulkWrite(updateBulk);
     }
     // 如果都已经存在,直接返回
@@ -1044,7 +1047,7 @@ rationItemDAO.prototype.batchAddFromExcel = async function(rationRepId, data) {
         return true;
     }
     //计算价格
-    for(let ration of insertData){
+    for (let ration of insertData) {
         this.calcForRation(stdGLJListByID, ration);
     }
 
@@ -1069,7 +1072,7 @@ rationItemDAO.prototype.batchAddFromExcel = async function(rationRepId, data) {
  * @param {Number} rationRepId
  * @return {Array}
  */
-rationItemDAO.prototype.exportExcelData = async function(rationRepId) {
+rationItemDAO.prototype.exportExcelData = async function (rationRepId) {
     const condition = {
         rationRepId: rationRepId
     };
@@ -1159,7 +1162,7 @@ rationItemDAO.prototype.exportExcelData = async function(rationRepId) {
  * @param {Object} data
  * @return {bool}
  */
-rationItemDAO.prototype.batchUpdateSectionIdFromExcel = async function(data) {
+rationItemDAO.prototype.batchUpdateSectionIdFromExcel = async function (data) {
     if (data.length <= 0) {
         return false;
     }
@@ -1183,18 +1186,23 @@ rationItemDAO.prototype.batchUpdateSectionIdFromExcel = async function(data) {
         caption = caption ? caption : '';
         let jobContent = tmp[7] ? tmp[7] : '';
         let annotation = tmp[8] ? tmp[8] : '';
-        rationTasks.push({updateOne: {
-            filter: {ID: rationId},
-            update: {$set: {
-                sectionId,
-                feeType,
-                name,
-                caption,
-                jobContent,
-                annotation
-            }}}});
+        rationTasks.push({
+            updateOne: {
+                filter: { ID: rationId },
+                update: {
+                    $set: {
+                        sectionId,
+                        feeType,
+                        name,
+                        caption,
+                        jobContent,
+                        annotation
+                    }
+                }
+            }
+        });
     }
-    if(rationTasks.length <= 0){
+    if (rationTasks.length <= 0) {
         throw '无有效数据(树ID、定额ID不为空、且为数值)';
     }
     // 更新定额数据
@@ -1203,11 +1211,13 @@ rationItemDAO.prototype.batchUpdateSectionIdFromExcel = async function(data) {
     sectionIDs = Array.from(new Set(sectionIDs));
     if (sectionIDs.length) {
         await stdRationSectionModel.updateMany(
-            {ID: {$in: sectionIDs}},
-            {$set: {
-                jobContentSituation: 'ALL',
-                annotationSituation: 'ALL'
-            }}
+            { ID: { $in: sectionIDs } },
+            {
+                $set: {
+                    jobContentSituation: 'ALL',
+                    annotationSituation: 'ALL'
+                }
+            }
         )
     }
 };

+ 2 - 1
package.json

@@ -46,6 +46,7 @@
     "uat_server": "SET NODE_ENV=uat&& D:/GitHome/ConstructionOperation/node_modules/.bin/babel-node operation.js",
     "uat_sc_server": "SET NODE_ENV=pp_sc&& D:/GitHome/ConstructionOperation/node_modules/.bin/babel-node operation.js",
     "prod_server": "SET NODE_ENV=prod_s&& D:/GitHome/ConstructionOperation/node_modules/.bin/babel-node operation.js",
-    "prod_sc_server": "SET NODE_ENV=prod_sc&& D:/GitHome/ConstructionOperation/node_modules/.bin/babel-node operation.js"
+    "prod_sc_server": "SET NODE_ENV=prod_sc&& babel-node operation.js",
+    "local2prod_hw_server": "SET NODE_ENV=local2prod_hw&& babel-node operation.js"
   }
 }

+ 12 - 7
web/maintain/std_glj_lib/html/gongliao.html

@@ -44,13 +44,18 @@
                 <div class="row" id="dataRow">
                     <!--org 3:7:2-->
                   <div class="main-side p-0" id="leftContent" style="width: 25%; height: 100%; overflow: hidden">
-                      <div class="tab-bar">
-                          <a href="javascript:void(0);" id="tree_Insert" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-plus" aria-hidden="true"></i></a>
-                          <a href="javascript:void(0);" id="tree_remove" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
-                          <a href="javascript:void(0);" id="tree_upLevel" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
-                          <a href="javascript:void(0);" id="tree_downLevel" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
-                          <a href="javascript:void(0);" id="tree_downMove" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
-                          <a href="javascript:void(0);" id="tree_upMove" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                      <div class="tab-bar row">
+                         <div>
+                             <a href="javascript:void(0);" id="tree_Insert" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="插入"><i class="fa fa-plus" aria-hidden="true"></i></a>
+                             <a href="javascript:void(0);" id="tree_remove" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="删除"><i class="fa fa-remove" aria-hidden="true"></i></a>
+                             <a href="javascript:void(0);" id="tree_upLevel" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
+                             <a href="javascript:void(0);" id="tree_downLevel" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
+                             <a href="javascript:void(0);" id="tree_downMove" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
+                             <a href="javascript:void(0);" id="tree_upMove" class="btn btn-sm lock-btn-control" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                         </div>
+                         <div>
+                            <input type="text" class="form-control form-control-sm" placeholder="搜索人材机" value="" id="gljSearch">
+                         </div>
                       </div>
                       <div class="tab-content" id="gljClassSpread" style="overflow: hidden">
                       </div>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 417 - 383
web/maintain/std_glj_lib/js/glj.js


+ 70 - 70
web/maintain/std_glj_lib/js/gljClassTree.js

@@ -7,7 +7,7 @@ let gljClassTreeObj = {
     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'),
@@ -16,7 +16,7 @@ let gljClassTreeObj = {
     upMoveBtn: $('#tree_upMove'),
     setting: {
         sheet: {
-            cols:[
+            cols: [
                 {
                     head: {
                         titleNames: ['名称'],
@@ -47,13 +47,13 @@ let gljClassTreeObj = {
             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
         }
     },
 
@@ -65,7 +65,7 @@ let gljClassTreeObj = {
     },
     //sheet things
     setOptions: function (workbook, opts) {
-        for(let opt in opts){
+        for (let opt in opts) {
             workbook.options[opt] = opts[opt];
         }
     },
@@ -73,7 +73,7 @@ let gljClassTreeObj = {
     renderFunc: function (sheet, func) {
         sheet.suspendPaint();
         sheet.suspendEvent();
-        if(this.isFunc(func)){
+        if (this.isFunc(func)) {
             func();
         }
         sheet.resumePaint();
@@ -81,8 +81,8 @@ let gljClassTreeObj = {
     },
 
     buildSheet: function () {
-        if(!this.isDef(this.workBook)){
-            this.workBook = new GC.Spread.Sheets.Workbook($('#gljClassSpread')[0], {sheetCount: 1});
+        if (!this.isDef(this.workBook)) {
+            this.workBook = new GC.Spread.Sheets.Workbook($('#gljClassSpread')[0], { sheetCount: 1 });
             this.sheet = this.workBook.getActiveSheet();
             this.setOptions(this.workBook, this.setting.options);
             this.sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
@@ -100,7 +100,7 @@ let gljClassTreeObj = {
 
     onSelectionChanged: function (sender, info) {
         let me = gljClassTreeObj;
-        if(info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row){
+        if (info.oldSelections.length === 0 && info.newSelections.length > 0 || info.oldSelections[0].row !== info.newSelections[0].row) {
             let row = info.newSelections[0].row;
             let node = me.cache[row];
             me.initSelection(node);
@@ -115,7 +115,7 @@ let gljClassTreeObj = {
         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
@@ -130,30 +130,30 @@ let gljClassTreeObj = {
 
     onClipboardPasted: function (sender, info) {
         let me = gljClassTreeObj;
-        let items = sheetCommonObj.analyzePasteData({header: [{dataCode: 'Name'}]}, info);
+        let items = sheetCommonObj.analyzePasteData({ header: [{ 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.gljClassTreeAjax(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'], 0, me.isDef(node) ? node.data.Name : '');
                 }
@@ -165,11 +165,11 @@ let gljClassTreeObj = {
         let me = gljClassTreeObj;
         let re = repositoryGljObj;
         let url = 'api/getGljTree';
-        let postData = {gljLibId: gljLibId};
+        let postData = { gljLibId: gljLibId };
         let sucFunc = function (rstData) {
             zTreeHelper.createTree(rstData, componentSetting, "componentTree", componentOprObj);
             let rootNode = componentOprObj.treeObj.getNodes()[0];
-            if(rootNode && rootNode.isParent && rootNode.isFirstNode){
+            if (rootNode && rootNode.isParent && rootNode.isFirstNode) {
                 componentOprObj.rootNode = rootNode;
             }
             if (rstData && rstData.length > 0) {
@@ -185,7 +185,7 @@ let gljClassTreeObj = {
             me.controller.showTreeData();
             me.sheet.setFormatter(-1, 0, '@');
             me.initSelection(me.tree.selected);
-            if(callback){
+            if (callback) {
                 callback();
             }
         };
@@ -216,7 +216,7 @@ let gljClassTreeObj = {
         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');
@@ -224,14 +224,14 @@ let gljClassTreeObj = {
             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');
             }
         }
@@ -243,7 +243,7 @@ let gljClassTreeObj = {
             me.insert();
         });
         $('#delConfirm').click(function () {
-            if(me.canRemoveClass){
+            if (me.canRemoveClass) {
                 me.remove(me.tree.selected);
             }
             $('#delAlert').modal('hide');
@@ -251,12 +251,12 @@ let gljClassTreeObj = {
         me.removeBtn.click(function () {
             //当前分类下无子项且无工料机数据,才允许删除
             let classNode = me.cache[me.workBook.getActiveSheet().getActiveRowIndex()];
-            if(!classNode){
+            if (!classNode) {
                 return;
             }
             let className = me.isDef(classNode.data.Name) ? classNode.data.Name : '';
             let classGljs = repositoryGljObj.currentCache;
-            if(classNode.children.length > 0 || (classGljs && classGljs.length > 0)){
+            if (classNode.children.length > 0 || (classGljs && classGljs.length > 0)) {
                 me.canRemoveClass = false;
                 $('#delAlert').find('.modal-body h5').text('当前分类下有数据,不可删除。');
             }
@@ -286,21 +286,21 @@ let gljClassTreeObj = {
         me.insertBtn.addClass('disabled');
         let postData = [];
         let newID = me.tree.newNodeID();
-        if(!me.isDef(newID)){
+        if (!me.isDef(newID)) {
             return;
         }
         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.gljClassTreeAjax(postData, function (rstData) {
                 me.controller.insert();
@@ -316,31 +316,31 @@ let gljClassTreeObj = {
         let re = repositoryGljObj;
         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.gljClassTreeAjax(postData, function (rstData) {
                 me.controller.delete();
@@ -356,13 +356,13 @@ let gljClassTreeObj = {
         let re = repositoryGljObj;
         me.upLevelBtn.addClass('disabled');
         let postData = [];
-        if(!me.isDef(selected)){
+        if (!me.isDef(selected)) {
             return;
         }
-        if(!me.isDef(selected.parent)){
+        if (!me.isDef(selected.parent)) {
             return;
         }
-        if(me.isDef(selected.preSibling)){
+        if (me.isDef(selected.preSibling)) {
             let updateObj = me.getUpdateObj(me.updateType.update, selected.preSibling.getID(), -1, null, null, null);
             postData.push(updateObj);
         }
@@ -372,16 +372,16 @@ let gljClassTreeObj = {
         postData.push(updateParent);
         let nextIDs = [];
         getNext(selected);
-        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 i = 0, len = nextIDs.length; i < len; i++){
+        for (let i = 0, len = nextIDs.length; i < len; i++) {
             postData.push(me.getUpdateObj(me.updateType.update, nextIDs[i], null, selected.getID(), null, null));
         }
-        if(postData.length > 0){
+        if (postData.length > 0) {
             //ajax
             me.gljClassTreeAjax(postData, function (rstData) {
                 me.controller.upLevel();
@@ -396,21 +396,21 @@ let gljClassTreeObj = {
         let re = repositoryGljObj;
         me.downLevelBtn.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 updatePre = me.getUpdateObj(me.updateType.update, selected.preSibling.getID(), selected.getNextSiblingID(), null, null, null);
         postData.push(updatePre);
-        if(selected.preSibling.children.length > 0){
+        if (selected.preSibling.children.length > 0) {
             let updateObj = me.getUpdateObj(me.updateType.update, selected.preSibling.children[selected.preSibling.children.length - 1].getID(), selected.getID(), null, null, null);
             postData.push(updateObj);
         }
         let updateObj = me.getUpdateObj(me.updateType.update, selected.getID(), -1, selected.preSibling.getID(), null, null);
         postData.push(updateObj);
-        if(postData.length > 0){
+        if (postData.length > 0) {
             //ajax
             me.gljClassTreeAjax(postData, function (rstData) {
                 me.controller.downLevel();
@@ -423,21 +423,21 @@ let gljClassTreeObj = {
         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.gljClassTreeAjax(postData, function (rstData) {
                 me.controller.upMove();
@@ -449,13 +449,13 @@ let gljClassTreeObj = {
         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);
         }
@@ -463,7 +463,7 @@ let gljClassTreeObj = {
         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.gljClassTreeAjax(postData, function (rstData) {
                 me.controller.downMove();
@@ -476,28 +476,28 @@ let gljClassTreeObj = {
         updateObj.updateType = '';
         updateObj.updateData = Object.create(null);
         updateObj.updateData.repositoryId = pageOprObj.gljLibId;
-        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.deleted = true;
         }
         return updateObj;
     },
     gljClassTreeAjax: function (postData, scFunc, errFunc) {
-        CommonAjax.post('api/updateNodes', {updateData: postData, lastOpr: userAccount}, scFunc, errFunc);
+        CommonAjax.post('api/updateNodes', { updateData: postData, lastOpr: userAccount }, scFunc, errFunc);
     },
     //模仿默认点击
     initSelection: function (node) {
@@ -505,7 +505,7 @@ let gljClassTreeObj = {
             re = repositoryGljObj,
             that = gljComponentOprObj;
         me.refreshBtn(node);
-        if(!re.isDef(node)){
+        if (!re.isDef(node)) {
             return;
         }
         let gljTypeId = node.data.ID;