Browse Source

定额库编辑器debug

zhongzewei 6 years ago
parent
commit
cd59597443

+ 3 - 0
modules/all_models/stdRation_ration.js

@@ -34,6 +34,9 @@ const rationItemSchema = new Schema({
     name: String,
     unit: String,
     basePrice: Number,
+    labourPrice: Number,
+    materialPrice: Number,
+    machinePrice: Number,
     sectionId: Number,
     rationRepId: Number,
     caption: String,

+ 3 - 3
web/maintain/ration_repository/js/ration.js

@@ -140,7 +140,7 @@ let rationOprObj = {
                 if (updateArr[i]["ID"] && cacheSection[j]["ID"]) {
                     if (cacheSection[j]["ID"] == updateArr[i]["ID"]) {
                         updateArr[i]['rationGljList'] = rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] ? rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] : [];
-                        updateArr[i]['rationCoeList'] = rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] ? rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] : [];
+                        updateArr[i]['rationCoeList'] = cacheSection[j]['rationCoeList'] ? cacheSection[j]['rationCoeList'] : [];
                         updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
                         updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
                         cacheSection[j] = updateArr[i];
@@ -148,7 +148,7 @@ let rationOprObj = {
                 } else {
                     if (cacheSection[j][me.setting.header[0].dataCode] == updateArr[i][me.setting.header[0].dataCode]) {
                         updateArr[i]['rationGljList'] = rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] ? rationGLJOprObj.cache['_GLJ_' + cacheSection[j]['ID']] : [];
-                        updateArr[i]['rationCoeList'] = rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] ? rationCoeOprObj.cache['_Coe_' + cacheSection[j]['ID']] : [];
+                        updateArr[i]['rationCoeList'] = cacheSection[j]['rationCoeList'] ? cacheSection[j]['rationCoeList'] : [];
                         updateArr[i]['rationAssList'] = cacheSection[j]['rationAssList'];
                         updateArr[i]['rationInstList'] = cacheSection[j]['rationInstList'];
                         cacheSection[j] = updateArr[i];
@@ -567,8 +567,8 @@ let rationOprObj = {
                     me.mixUpdate = 0;
                     me.mixDel = 0;
                 }
-                if(callback) callback();
                 me.workBook.focus(true);
+                if(callback) callback();
             },
             error:function(){
             }

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

@@ -111,7 +111,7 @@ var rationAssistOprObj = {
         // 新增
         if (args.row >= assList.length) {
             if (assObj.decimal == undefined || assObj.decimal == null){assObj.decimal = '0';};
-            if (assObj.carryBit == undefined || assObj.carryBit == null){assObj.carryBit = '四舍五入';};
+            if (assObj.carryBit == undefined || assObj.carryBit == null){assObj.carryBit = '进一';};
             assList.push(assObj);
         }
         // 修改

+ 2 - 2
web/maintain/ration_repository/js/ration_coe.js

@@ -156,7 +156,7 @@ var rationCoeOprObj = {
     onClipboardPasting: function(sender, args) {
         var me = rationCoeOprObj;
         let rationSection = rationOprObj.getCache();
-        let rationRow = rationOprObj.workBook.getSheet(0).getSelections()[0].row;
+        let rationRow = rationOprObj.workBook.getActiveSheet().getSelections()[0].row;
         me.curRation = rationRow < rationSection.length ? rationSection[rationRow] : null;
         if (args.cellRange.colCount != 1 || args.cellRange.col != 0 || !(me.curRation)) {
             args.cancel = true;
@@ -221,7 +221,7 @@ var rationCoeOprObj = {
     onEditStarting: function (sender, args) {
         let me = rationCoeOprObj;
         let rationSection = rationOprObj.getCache();
-        let rationRow = rationOprObj.workBook.getSheet(0).getSelections()[0].row;
+        let rationRow = rationOprObj.workBook.getActiveSheet().getSelections()[0].row;
         me.curRation = rationRow < rationSection.length ? rationSection[rationRow] : null;
         if(!me.curRation || args.col !== 0){
             args.cancel = true;