Browse Source

我的定额库

zhongzewei 6 years ago
parent
commit
d7d1952892

+ 37 - 0
modules/all_models/compleRation_coe.js

@@ -0,0 +1,37 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2018/10/23
+ * @version
+ */
+
+/*
+* 补充定额库用户新增子目换算
+* 用户ID与费用定额ID绑定子目换算
+* */
+
+import mongoose from 'mongoose';
+const Schema = mongoose.Schema;
+const coeSchema = new Schema({
+    coeType: String,                // 系数类型
+    gljCode: String,                //要调整的人材机编码
+    gljName: String,
+    operator: String,               // 运算符(*、+、-、=)
+    amount: String,                 // 调整的量
+    _id: false
+});
+
+const coeListSchema = new Schema({
+    userId: String,
+    compilationId: String,
+    ID: String,                         // uuid
+    serialNo: Number,                  //编号
+    name: String,                       // 名称
+    content: String,                    // 说明
+    coes: [coeSchema]
+}, {versionKey: false});
+
+mongoose.model('complementary_ration_coe_list', coeListSchema, 'complementary_ration_coe_list');

+ 29 - 0
modules/all_models/compleRation_installFeeItem.js

@@ -0,0 +1,29 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2018/10/23
+ * @version
+ */
+
+/*
+* 补充定额库用户新增安装增加费费用项
+*
+* */
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//补充安装增加费-费用项
+const installFeeItemSchema = new Schema({
+    userId: String,
+    compilationId: String,
+    ID: String,
+    feeItem: String, //费用项
+    feeType: String, //费用类型
+    position: String, //记取位置
+    section: [],
+    deleted: false
+}, {versionKey: false});
+
+mongoose.model('complementary_ration_installation', installFeeItemSchema, 'complementary_ration_installation');

+ 42 - 0
modules/all_models/compleRation_installSection.js

@@ -0,0 +1,42 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2018/10/23
+ * @version
+ */
+
+/*
+* 补充定额库用户新增安装增加费分册章节
+*
+*
+* */
+
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+//安装增加费-费用规则
+const feeRuleSchema = new Schema({
+    ID: String,
+    code: String,
+    rule: String,
+    base: String,
+    feeRate: Number,
+    labour: Number,
+    material: Number,
+    machine: Number
+});
+
+//补充安装增加费-分册章节
+const installSectionSchema = new Schema({
+    userId: String,
+    compilationId: String,
+    ID: String,
+    feeItemId: String,
+    name: String,
+    feeRule: [feeRuleSchema],
+    deleted: false
+}, {versionKey: false});
+
+mongoose.model('complementary_ration_installationSection', installSectionSchema, 'complementary_ration_installationSection');

+ 34 - 0
modules/all_models/comple_section_template.js

@@ -0,0 +1,34 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2018/10/23
+ * @version
+ */
+
+/*
+* 我的补充定额库章节树模板,一个费用定额有一个模板
+* 模板的生成目前由手工生成(借助定额库编辑器的章节树编辑)
+* 新用户第一次进入某费用定额的补充定额库时,拷贝模板给该用户
+*
+* */
+
+import mongoose from 'mongoose';
+
+const Schema = mongoose.Schema;
+const compleRationSectionTemp = new Schema({
+    compilationId: String,
+    name: String,
+    ID: Number,
+    ParentID: Number,
+    NextSiblingID: Number,
+    //以下预留结构,以防后续需要默认数据
+    explanation: String,//说明
+    ruleText: String,//计算规则,
+    jobContentSituation: String,//工作内容适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+    annotationSituation: String,//附注适用情况,ALL适用本项全部定额,PARTIAL适用本项部分定额
+});
+
+mongoose.model('complementary_ration_section_templates', compleRationSectionTemp, 'complementary_ration_section_templates');

+ 1 - 1
web/maintain/ration_repository/js/ration_glj.js

@@ -351,7 +351,7 @@ var rationGLJOprObj = {
                 }
                 //rationCoe表
                 else if(me.sheet.getParent().getActiveSheetIndex() === 2 && target.hitTestType === 3 && typeof target.row !== 'undefined' && typeof target.col !== 'undefined'){
-                    let currentCache = raCoe.isDef(raCoe.cache["_Coe_" + raCoe.curRation.ID])  ? raCoe.cache["_Coe_" + raCoe.curRation.ID] : [];
+                    let currentCache = raCoe.curRation && raCoe.isDef(raCoe.cache["_Coe_" + raCoe.curRation.ID])  ? raCoe.cache["_Coe_" + raCoe.curRation.ID] : [];
                     sheet.setActiveCell(target.row, target.col);
                     //控制按钮是否可用
                     let upDis = false,

+ 2 - 1
web/maintain/ration_repository/js/section_tree.js

@@ -340,7 +340,7 @@ let sectionTreeObj = {
             me.upMove(me.tree.selected);
         });
     },
-    
+
     insert: function () {
         let me = sectionTreeObj;
         me.insertBtn.addClass('disabled');
@@ -614,6 +614,7 @@ let sectionTreeObj = {
     },
     //模仿默认点击
     initSelection: function (node) {
+        node.tree.selected = node ? node : null;
         let me = this;
         if(!me.isDef(node)){
             sheetCommonObj.cleanSheet(rationOprObj.workBook.getActiveSheet(), rationOprObj.setting, -1);