zhangweicheng 7 vuotta sitten
vanhempi
commit
dd8feee20a

+ 1 - 1
modules/all_models/project_glj.js

@@ -14,7 +14,7 @@ let Schema = mongoose.Schema;
 let collectionName = 'glj_list';
 let modelSchema = {
     // 自增id
-    id: Number,
+    id: {type:Number,unique: true},
     // 工料机总库ID
     glj_id: Number,
     // 标段ID

+ 2 - 2
modules/glj/models/unit_price_model.js

@@ -253,7 +253,7 @@ class UnitPriceModel extends BaseModel {
         let doc={},newValueMap={};
         doc[data.field]=data.newval;
         newValueMap[data.id]=doc;
-        let unitPrice = await this.db.findAndModify({id:data.id},doc);
+        let unitPrice = await this.db.findAndModify({id:data.id,unit_price_file_id:data.unit_price_file_id},doc);
         if(!unitPrice){
             throw "没有找到对应的单价";
         }
@@ -284,7 +284,7 @@ class UnitPriceModel extends BaseModel {
         let parentTask = [];
         let newValueMap = {};
         for(let d of data){//第一次循环生成更新提交的记录,并生成一个新值的映射表,为更新父节点使用
-            let condition = {id:d.unit_price.id};
+            let condition = {id:d.unit_price.id,unit_price_file_id:d.unit_price.unit_price_file_id};
             let doc = {};
             doc[d.field]=d.newval;
             newValueMap[d.unit_price.id] = doc;

+ 1 - 1
web/building_saas/main/js/models/project_glj.js

@@ -266,7 +266,7 @@ ProjectGLJ.prototype.updatePrice = function (recode, updateField, newval,from,cb
         if(glj.unit_price[updateField] == newval){
             return;
         }
-        let data = {id: glj.unit_price.id, field: updateField, newval: newval,project_id:glj.project_id};
+        let data = {id: glj.unit_price.id, field: updateField, newval: newval,project_id:glj.project_id,unit_price_file_id:glj.unit_price.unit_price_file_id};
         let callback = function (data) {
             if (updateField == 'base_price') {
                 glj.unit_price.base_price = newval;

+ 4 - 6
web/building_saas/main/js/views/project_glj_view.js

@@ -358,9 +358,9 @@ projectGljObject={
             projectGljSheetData.push(this.getSheetDataByGLJ(glj));
         }
         this.projectGljSheetData = projectGljSheetData;
-        this.projectGljSheet.setRowCount(0);
-        sheetCommonObj.showData(this.projectGljSheet, this.projectGljSetting,this.projectGljSheetData);
         this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
+        sheetCommonObj.showData(this.projectGljSheet, this.projectGljSetting,this.projectGljSheetData);
+        //this.projectGljSheet.setRowCount(this.projectGljSheetData.length);
         sel.row = oldData?_.findIndex(this.projectGljSheetData,{'id':oldData.id}):'';
         this.projectGljSheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
     },
@@ -700,7 +700,7 @@ projectGljObject={
         let parentBasePrice = 0;
         for(let i = 0;i < me.mixRatioData.length;i++){
             let ratio = me.mixRatioData[i];
-            let marketPrice = ratio.unit_price.marketPrice;
+            let marketPrice = ratio.unit_price.market_price;
             let basePrice = ratio.unit_price.base_price;
             // 如果是删除则忽略即将被删除的行数据
             if (scene === 'delete' && affectRow === i) {
@@ -725,9 +725,7 @@ projectGljObject={
             return;
         }
         if (value&&!me.checkData(col,setting,value)) {
-            setTimeout(function () {//为了不与click事件冲突
-                alert('输入的数据类型不对,请重新输入!');
-            },200);
+            alert('输入的数据类型不对,请重新输入!');
             info.sheetName =="materialTreeSheet"?me.materialTreeController.refreshTreeNode([me.materialTree.selected]):me.refreshProjectGljRow(row);
             return ;
         }

+ 4 - 0
web/building_saas/main/js/views/sub_view.js

@@ -11,6 +11,8 @@ characterOprObj.buildSheet($("#itemSpread")[0]);
 $("#tzjnrCon").hide();
 $("#subSpread").show();
 var subSpread = sheetCommonObj.createSpread($("#subSpread")[0], 4);
+subSpread.options.allowUserDragDrop = false;
+subSpread.options.allowUserDragFill = false;
 subSpread.getSheet(2).name('JSCX');
 
 pageCCOprObj.active = false;
@@ -36,6 +38,7 @@ $("#linkGLJ").click(function(){
     $("#subItems").children().hide();//控制显示subSpread,隐藏特征及内容spread
     $("#subSpread").show();
     pageCCOprObj.active = false;
+    subSpread.options.allowUserDragFill = false;
     refreshSubSpread();
     subSpread.setActiveSheetIndex(0);
     gljOprObj.activeTab='#linkGLJ';
@@ -57,6 +60,7 @@ $("#linkAZZJF").click(function(){
 $("#linkGCLMX").click(function(){
     $("#subItems").children().hide();
     $("#subSpread").show();
+    subSpread.options.allowUserDragFill = true;
     pageCCOprObj.active = false;
     refreshSubSpread();
     subSpread.setActiveSheetIndex(1);