Jelajahi Sumber

标段概况修改

MaiXinRong 5 tahun lalu
induk
melakukan
cb3c0bd074
4 mengubah file dengan 21 tambahan dan 10 penghapusan
  1. 4 1
      app/const/tender_info.js
  2. 10 7
      app/public/js/tender.js
  3. 5 0
      app/service/tender_info.js
  4. 2 2
      app/view/tender/detail.ejs

+ 4 - 1
app/const/tender_info.js

@@ -8,7 +8,8 @@
  * @version
  * @version
  */
  */
 
 
-const parseInfo = ['deal_info', 'construction_unit', 'tech_param', 'decimal', 'precision', 'deal_param', 'display', 'chapter'];
+const parseInfo = ['deal_info', 'construction_unit', 'tech_param', 'decimal', 'precision', 'deal_param', 'display'];
+const arrayInfo = ['chapter'];
 const defaultInfo = {
 const defaultInfo = {
     // 合同信息
     // 合同信息
     deal_info: {
     deal_info: {
@@ -76,6 +77,7 @@ const defaultInfo = {
         ke: { unit: '棵', value: 0 },
         ke: { unit: '棵', value: 0 },
         zu: { unit: '组', value: 0 },
         zu: { unit: '组', value: 0 },
         xitong: { unit: '系统', value: 0 },
         xitong: { unit: '系统', value: 0 },
+        zonge: { unit: '总额', value: 0 },
         other: { value: 3 },
         other: { value: 3 },
     },
     },
     // 合同参数
     // 合同参数
@@ -111,5 +113,6 @@ const defaultInfo = {
 
 
 module.exports = {
 module.exports = {
     parseInfo,
     parseInfo,
+    arrayInfo,
     defaultInfo,
     defaultInfo,
 };
 };

+ 10 - 7
app/public/js/tender.js

@@ -138,7 +138,7 @@ $(document).ready(function() {
         SpreadJsObj.massOperationSheet(sheet, function () {
         SpreadJsObj.massOperationSheet(sheet, function () {
             sheet.defaults.rowHeight = 25;
             sheet.defaults.rowHeight = 25;
             sheet.setColumnCount(3);
             sheet.setColumnCount(3);
-            sheet.setRowCount(14);
+            sheet.setRowCount(15);
             sheet.setColumnWidth(0, 1);
             sheet.setColumnWidth(0, 1);
             sheet.setColumnWidth(1, 100);
             sheet.setColumnWidth(1, 100);
             sheet.setColumnWidth(2, 60);
             sheet.setColumnWidth(2, 60);
@@ -157,10 +157,11 @@ $(document).ready(function() {
             sheet.setText(10, 1, '棵');
             sheet.setText(10, 1, '棵');
             sheet.setText(11, 1, '组');
             sheet.setText(11, 1, '组');
             sheet.setText(12, 1, '系统');
             sheet.setText(12, 1, '系统');
-            sheet.setText(13, 1, '其他未列单位');
+            sheet.setText(13, 1, '总额');
+            sheet.setText(14, 1, '其他未列单位');
             const lineBorder = new spreadNS.LineBorder('#6a696e', spreadNS.LineStyle.thin);
             const lineBorder = new spreadNS.LineBorder('#6a696e', spreadNS.LineStyle.thin);
-            sheet.getRange(0, 0, 14, 3).setBorder(lineBorder, {all: true});
-            sheet.getRange(0, 0, 14, 3).formatter('@');
+            sheet.getRange(0, 0, 15, 3).setBorder(lineBorder, {all: true});
+            sheet.getRange(0, 0, 15, 3).formatter('@');
             sheet.setSelection(1, 2, 1, 1);
             sheet.setSelection(1, 2, 1, 1);
         });
         });
 
 
@@ -231,10 +232,11 @@ $(document).ready(function() {
             sheet.setValue(10, 2, property.precision.ke.value);
             sheet.setValue(10, 2, property.precision.ke.value);
             sheet.setValue(11, 2, property.precision.zu.value);
             sheet.setValue(11, 2, property.precision.zu.value);
             sheet.setValue(12, 2, property.precision.xitong.value);
             sheet.setValue(12, 2, property.precision.xitong.value);
-            sheet.setValue(13, 2, property.precision.other.value);
+            sheet.setValue(13, 2, property.precision.zonge.value);
+            sheet.setValue(14, 2, property.precision.other.value);
         }
         }
         function setReadOnly(readOnly) {
         function setReadOnly(readOnly) {
-            sheet.getRange(1, 2, 14, 1).locked(readOnly);
+            sheet.getRange(1, 2, 15, 1).locked(readOnly);
         }
         }
         function getNewPrecisionData() {
         function getNewPrecisionData() {
             const precision = JSON.parse(JSON.stringify(property.precision));
             const precision = JSON.parse(JSON.stringify(property.precision));
@@ -250,7 +252,8 @@ $(document).ready(function() {
             precision.ke.value = _.toNumber(sheet.getText(10, 2));
             precision.ke.value = _.toNumber(sheet.getText(10, 2));
             precision.zu.value = _.toNumber(sheet.getText(11, 2));
             precision.zu.value = _.toNumber(sheet.getText(11, 2));
             precision.xitong.value = _.toNumber(sheet.getText(12, 2));
             precision.xitong.value = _.toNumber(sheet.getText(12, 2));
-            precision.other.value = _.toNumber(sheet.getText(13, 2));
+            precision.zonge.value = _.toNumber(sheet.getText(13, 2));
+            precision.other.value = _.toNumber(sheet.getText(14, 2));
             return precision;
             return precision;
         }
         }
         function checkPrecisionMinLimit(precision, limit) {
         function checkPrecisionMinLimit(precision, limit) {

+ 5 - 0
app/service/tender_info.js

@@ -10,6 +10,7 @@
 
 
 const infoConst = require('../const/tender_info');
 const infoConst = require('../const/tender_info');
 const parseInfo = infoConst.parseInfo;
 const parseInfo = infoConst.parseInfo;
+const arrayInfo = infoConst.arrayInfo;
 const defaultInfo = infoConst.defaultInfo;
 const defaultInfo = infoConst.defaultInfo;
 
 
 module.exports = app => {
 module.exports = app => {
@@ -64,6 +65,10 @@ module.exports = app => {
             }
             }
             for (const pi of parseInfo) {
             for (const pi of parseInfo) {
                 info[pi] = !info[pi] || info[pi] === '' ? defaultInfo[pi] : JSON.parse(info[pi]);
                 info[pi] = !info[pi] || info[pi] === '' ? defaultInfo[pi] : JSON.parse(info[pi]);
+                this.ctx.helper._.defaults(info[pi], defaultInfo[pi]);
+            }
+            for (const ai of arrayInfo) {
+                info[ai] = !info[ai] || info[ai] === '' ? defaultInfo[ai] : JSON.parse(info[ai]);
             }
             }
             return info;
             return info;
         }
         }

+ 2 - 2
app/view/tender/detail.ejs

@@ -112,7 +112,7 @@
                                 <div class="nav flex-column nav-pills" >
                                 <div class="nav flex-column nav-pills" >
                                     <a class="nav-link active" data-toggle="pill" href="#v-pills-1" role="tab">标段属性</a>
                                     <a class="nav-link active" data-toggle="pill" href="#v-pills-1" role="tab">标段属性</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-2" role="tab">小数位数</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-2" role="tab">小数位数</a>
-                                    <a class="nav-link"  data-toggle="pill" href="#v-pills-3" role="tab">清单精度</a>
+                                    <a class="nav-link"  data-toggle="pill" href="#v-pills-3" role="tab">数量精度</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-4" role="tab">合同参数</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-4" role="tab">合同参数</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-5" role="tab">显示设置</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-5" role="tab">显示设置</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-6" role="tab">章节设置</a>
                                     <a class="nav-link"  data-toggle="pill" href="#v-pills-6" role="tab">章节设置</a>
@@ -465,7 +465,7 @@
                                             </div>
                                             </div>
                                         </div>
                                         </div>
                                         <% } %>
                                         <% } %>
-                                        <legend class="mt-3">清单精度</legend>
+                                        <legend class="mt-3">数量精度</legend>
                                         <!--默认显示-->
                                         <!--默认显示-->
                                         <div class="form-group" id="precision-spread" style="height: 365px; width: 600px;">
                                         <div class="form-group" id="precision-spread" style="height: 365px; width: 600px;">
                                         </div>
                                         </div>