瀏覽代碼

1. add bills from standard bills, load ruleText & comments;
2. bills & ration, merge comments view.

MaiXinRong 7 年之前
父節點
當前提交
93a8740f26

+ 3 - 0
modules/main/models/bills.js

@@ -28,6 +28,9 @@ let billsSchema = new Schema({
     quantity: String, // Decimal
     isFromDetail:{type: Number,default:0},//1 true 0 false
     programID: Number,
+    // 工程量计算规则
+    ruleText: String,
+    // 说明
     comments: String,
     // 调价
     xs_Labour: String, // Decimal

+ 2 - 1
test/tmp_data/bills_grid_setting.js

@@ -262,6 +262,7 @@ var BillsGridSetting ={
         {
             "width":120,
             "readOnly": 'readOnly.volumePrice',
+            "showHint": true,
             "head":{
                 "titleNames":[
                     "工程量计算规则"
@@ -283,7 +284,7 @@ var BillsGridSetting ={
                 ]
             },
             "data":{
-                "field":"programID",
+                "field":"ruleText",
                 "vAlign":1,
                 "hAlign":0,
                 "font":"Arial"

+ 3 - 9
web/building_saas/main/html/main.html

@@ -147,10 +147,7 @@
                                       <a class="nav-link" id="linkJSCX" data-toggle="tab" href="#subSpread" role="tab">计算程序</a>
                                   </li>
                                   <li class="nav-item">
-                                      <a class="nav-link" id="linkFXSM" data-toggle="tab" href="#fxComments" role="tab">分项说明</a>
-                                  </li>
-                                  <li class="nav-item">
-                                      <a class="nav-link" id="linkDESM" data-toggle="tab" href="#rationComments" role="tab">定额说明</a>
+                                      <a class="nav-link" data-toggle="tab" href="#comments" role="tab" id="linkComments">说明信息</a>
                                   </li>
                                   <li class="nav-item">
                                       <a class="nav-link" id="linkTZJNR" data-toggle="tab" href="#subSpread" role="tab">特征及内容</a>
@@ -161,11 +158,8 @@
                                   <div class="tab-pane active" id="subItems" role="tabpanel">
                                       <div class="main-data-bottom ovf-hidden" id="subSpread" style="display: none">
                                       </div>
-                                      <div class="main-data-bottom ovf-hidden" style="display: none" id="fxComments">
-                                          <textarea class="form-control"  rows="8"></textarea>
-                                      </div>
-                                      <div class="main-data-bottom ovf-hidden" style="display: none" id="rationComments">
-                                          <textarea class="form-control"  rows="8"></textarea>
+                                      <div class="main-data-bottom ovf-hidden" style="display: none" id="comments">
+                                          <textarea class="form-control" rows="8"></textarea>
                                       </div>
                                       <div id="tzjnrCon" class="main-data-bottom">
                                           <div class="main-data-bottom ovf-hidden" style="width: 40%; float: left;" id="jobSpread">

+ 4 - 0
web/building_saas/main/js/models/bills.js

@@ -149,6 +149,10 @@ var Bills = {
                     data.data.code = stdBillsData.code;
                     data.data.name = stdBillsData.name;
                     data.data.unit = stdBillsData.unit;
+                    // 工程量计算规则
+                    data.data.ruleText = stdBillsData.ruleText;
+                    // 说明(补注)
+                    data.data.comments = stdBillsData.recharge;
                     //zhong 特征及内容
                     data.data.jobContent = stdBillsData.jobContent;
                     data.data.itemCharacter = stdBillsData.itemCharacter;

+ 10 - 18
web/building_saas/main/js/views/sub_view.js

@@ -130,32 +130,24 @@ let subViewObj = {
     },
     loadComments: function (node) {
         let select = node;
-        if (select && select.sourceType === projectObj.project.Bills.getSourceType()) {
-            $('#fxComments>textarea').val(select.data.comments).removeAttr('readOnly');
-        } else {
-            $('#fxComments>textarea').val('').attr('readOnly', true);
-        }
-        if (select && select.sourceType === projectObj.project.Ration.getSourceType()) {
-            $('#rationComments>textarea').val(select.data.comments).removeAttr('readOnly');
+        if (node && (node.sourceType === projectObj.project.Bills.getSourceType() || node.sourceType === projectObj.project.Ration.getSourceType())) {
+            $('#comments>textarea').val(node.data.comments).removeAttr('readOnly');
         } else {
             $('#rationComments>textarea').val('').attr('readOnly', true);
         }
     },
     saveComments: function (node) {
-        let select = node;
-        if (select.sourceType === projectObj.project.Bills.getSourceType()) {
-            let text = $('#fxComments>textarea').val();
-            if (select.data.comments !== text) {
-                projectObj.project.Bills.updateField(select.source, 'comments', text);
+        let text = $('#comments>textarea').val();
+        if (node && node.sourceType === projectObj.project.Bills.getSourceType()) {
+            if (node.data.comments !== text) {
+                projectObj.project.Bills.updateField(node.source, "comments", text);
             }
-        } else if (select.sourceType === projectObj.project.Ration.getSourceType()) {
-            let text = $('#rationComments>textarea').val();
-            if (select.data.comments !== text) {
-                projectObj.project.Ration.updateField(select.source, 'comments', text);
+        } else if (node && node.sourceType === projectObj.project.Ration.getSourceType()) {
+            if (node.data.comments !== text) {
+                projectObj.project.Ration.updateField(node.source, "comments", text);
             }
         }
     }
 }
 
-$("#linkFXSM").click(subViewObj.linkTabClick);
-$("#linkDESM").click(subViewObj.linkTabClick);
+$("#linkComments").click(subViewObj.linkTabClick);