瀏覽代碼

feat: 工料机编辑器增加排序号

zhangweicheng 3 月之前
父節點
當前提交
f266aca87b

+ 22 - 19
modules/all_models/stdGlj_glj.js

@@ -2,23 +2,24 @@
  * Created by Zhong on 2018/3/22.
  */
 /*标准工料机*/
-const mongoose = require('mongoose');
+const mongoose = require("mongoose");
 const Schema = mongoose.Schema;
 //标准工料机的组成物只来自标准工料机
 const std_gljComponent = new Schema(
-    {
-        ID: Number,
-        consumeAmt: Number,
-        consumeAmtProperty: {
-            type: Schema.Types.Mixed,
-            default: {}
-        }
+  {
+    ID: Number,
+    consumeAmt: Number,
+    consumeAmtProperty: {
+      type: Schema.Types.Mixed,
+      default: {},
     },
-    { _id: false },
-    { versionKey: false }
+  },
+  { _id: false },
+  { versionKey: false }
 );
 
-const std_glj = new Schema({
+const std_glj = new Schema(
+  {
     deleted: Boolean,
     repositoryId: Number,
     ID: Number,
@@ -27,10 +28,11 @@ const std_glj = new Schema({
     specs: String,
     basePrice: Number,
     priceProperty: {
-        type: Schema.Types.Mixed,
-        default: {}
+      type: Schema.Types.Mixed,
+      default: {},
     },
     gljClass: Number,
+    classSeq: Number,
     gljType: Number,
     shortName: String,
     unit: String,
@@ -41,11 +43,12 @@ const std_glj = new Schema({
     materialCoe: Number, //三材系数
     model: Number, //机型
     //经济指标数据
-    materialIndexType: String,//工料指标类别
-    materialIndexUnit: String,//工料指标单位
-    materialIndexCoe: Number,//单位转换系数
+    materialIndexType: String, //工料指标类别
+    materialIndexUnit: String, //工料指标单位
+    materialIndexCoe: Number, //单位转换系数
     lossRate: Number, // 损耗率
+  },
+  { versionKey: false }
+);
 
-}, { versionKey: false });
-
-mongoose.model('std_glj_lib_gljList', std_glj, 'std_glj_lib_gljList');
+mongoose.model("std_glj_lib_gljList", std_glj, "std_glj_lib_gljList");

+ 9 - 5
modules/all_models/stdGlj_gljClass.js

@@ -2,15 +2,19 @@
  * Created by Zhong on 2018/3/22.
  */
 /*标准工料机分类树*/
-const mongoose = require('mongoose');
+const mongoose = require("mongoose");
 const Schema = mongoose.Schema;
-const std_gljClass = new Schema({
+const std_gljClass = new Schema(
+  {
     repositoryId: Number,
     ID: Number,
     ParentID: Number,
     NextSiblingID: Number,
     Name: String,
-    deleted: Boolean
-}, {versionKey: false});
+    deleted: Boolean,
+    classSeq: Number,
+  },
+  { versionKey: false }
+);
 
-mongoose.model('std_glj_lib_gljClass', std_gljClass, 'std_glj_lib_gljClass');
+mongoose.model("std_glj_lib_gljClass", std_gljClass, "std_glj_lib_gljClass");

+ 4 - 0
web/maintain/std_glj_lib/js/glj.js

@@ -56,6 +56,7 @@ let repositoryGljObj = {
   treeObj: null,
   workBook: null,
   gljCurTypeId: -1,
+  gljCurClassSeq: 0,
   currentRepositoryId: -1,
   currentCache: null,
   parentNodeIds: {},
@@ -468,6 +469,7 @@ let repositoryGljObj = {
           );
           if (result.data && result.data.length > 0) {
             me.gljCurTypeId = result.data[0].ID;
+            me.gljCurClassSeq = result.data[0].classSeq;
           } else {
             //重新创建库?
             gljTypeTreeOprObj.addRootNode();
@@ -1286,6 +1288,7 @@ let repositoryGljObj = {
     }
     if (!me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]) {
       rObj.gljClass = me.gljCurTypeId;
+      rObj.classSeq = me.gljCurClassSeq;
     }
     if (updateArr.length > 0 || addArr.length > 0) {
       me.currentEditingGlj = null;
@@ -1967,6 +1970,7 @@ let repositoryGljObj = {
     //pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
     if (!me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]) {
       pasteObj.gljClass = me.gljCurTypeId;
+      pasteObj.classSeq = me.gljCurClassSeq;
     }
     return true;
   },

+ 1 - 0
web/maintain/std_glj_lib/js/gljClassTree.js

@@ -730,6 +730,7 @@ let gljClassTreeObj = {
     }
     let gljTypeId = node.data.ID;
     re.gljCurTypeId = node.data.ID;
+    re.gljCurClassSeq = node.data.classSeq;
     re.addGljObj = null;
     sheetCommonObj.cleanSheet(that.workBook.getSheet(0), that.setting, 10);
     if (re.parentNodeIds["_pNodeId_" + gljTypeId]) {