Преглед изворни кода

feat: 重庆接口导入,导出项目特征以工作内容调整

zhangweicheng пре 3 година
родитељ
комит
6acd9addc7

+ 33 - 2
web/over_write/js/chongqing_2018_export.js

@@ -1317,8 +1317,8 @@ const XMLStandard = (function () {
             let bills = new FXbills(source);
             //清单项目项目编码要在建设项目中唯一
             _util.checkUnique(curProjectEle.constraints.billsCode, source.code, `第${source.row}行`,`清单项目编码${source.code}`);
-            //加载特征及内容
-            function loadFeatureContent() {
+            //加载特征及内容 --- 进接用项目特征及内容可编辑的字符串拆分版本, 导出后格式检查不通过
+            function loadFeatureContentV1() {
                 let job = [],
                     feature = [];
                 let jobText = node.data.jobContentText || '';
@@ -1384,6 +1384,37 @@ const XMLStandard = (function () {
                     bills.children.push(jobContent);
                 }
             }
+
+            function loadFeatureContent(){
+                let itemCharacter =  node.data.itemCharacter || [];
+                let jobContentArr = node.data.jobContent || [];
+                let itemChac = new ItemCharacter();
+                for (let f of itemCharacter) {
+                    if(f.isChecked === true){
+                        let cValue = '';
+                        for(let ei of f.eigenvalue){
+                            if(ei.isSelected === true) {
+                                cValue += ei.value ;
+                                break
+                            }
+                        }
+                        let source = {name: f.character, value: cValue};
+                        let featureEle = new Feature(source);
+                        itemChac.children.push(featureEle);
+                    }           
+                }
+                if(itemChac.children.length > 0) bills.children.push(itemChac);
+                
+                let jobContent = new JobContent();
+                for (let job of jobContentArr) {
+                    if(job.isChecked === true){
+                        let content = new Content(job.content);
+                        jobContent.children.push(content);
+                    }
+                }
+               if(jobContent.children.length > 0) bills.children.push(jobContent);
+
+            }
             loadFeatureContent();
             //解析工程量计算式
             function parseQuantityExp(rationData) {

+ 3 - 3
web/over_write/js/chongqing_2018_import.js

@@ -275,7 +275,7 @@ const importXML = (() => {
     function extractBills(billsSrc, type) {
         let { features, contents } = getFeaturesAndContents(billsSrc);
         // 特征及内容窗口
-        //let { itemCharacter, jobContent } = featureAndContent(features, contents);
+        let { itemCharacter, jobContent } = featureAndContent(features, contents);
         let obj = {
             type: type, //清单类型
             code: getValue(billsSrc, ['_项目编码']),
@@ -286,8 +286,8 @@ const importXML = (() => {
             quantity: getValue(billsSrc, ['_工程量']) || '0',
             remark: getValue(billsSrc, ['_备注']),
             itemCharacterText: featureAndContentText(features, contents),
-            /* itemCharacter: itemCharacter, // 不导入到清单下方的特征及内容窗口
-            jobContent: jobContent */
+            itemCharacter: itemCharacter, // 不导入到清单下方的特征及内容窗口
+            jobContent: jobContent
         };
         //投标和控制价,需要导入最高限价
         if ([FileKind.tender, FileKind.control].includes(importFileKind)) {