Browse Source

企业基础信息高新领域增加name字段

ljb 8 months ago
parent
commit
251dfe21af

+ 27 - 0
src/views/basic-resource/comp-basic-info/components/comp-info-table.vue

@@ -93,6 +93,30 @@ export default {
     this.getEnterpriseInfoFunc(this.yearAndMonth);
   },
   methods: {
+    // 转译高新领域
+    formatHighTechField(id) {
+      return this.findLabelById(HIGH_TECH_FIELDS, id);
+    },
+    findLabelById(tree, targetId) {
+      // 遍历当前层级的节点
+      for (const node of tree) {
+        // 如果找到目标ID,返回对应的label
+        if (node.value == targetId) {
+          return node.label;
+        }
+        
+        // 如果有子节点,递归查找
+        if (node.children && node.children.length > 0) {
+          const result = this.findLabelById(node.children, targetId);
+          if (result) {
+            return result;
+          }
+        }
+      }
+      
+      // 如果没有找到,返回null或undefined
+      return null;
+    },
     initFormData(data) {
       this.form = { ...data };
       let highTechFields = [];
@@ -122,8 +146,11 @@ export default {
       const params = { ...this.form, yearAndMonth: this.yearAndMonth };
       if (params.highTechFields && params.highTechFields.length) {
         params.highTechDomainL1 = params.highTechFields[0];
+        params.highTechDomainL1Name = this.formatHighTechField(params.highTechFields[0]);
         params.highTechDomainL2 = params.highTechFields[1];
+        params.highTechDomainL2Name = this.formatHighTechField(params.highTechFields[1]);
         params.highTechDomainL3 = params.highTechFields[2];
+        params.highTechDomainL3Name = this.formatHighTechField(params.highTechFields[2]);
       }
       saveOrUpdateEnterInfo(params).then(({ data }) => {
         if (data.code == 200) {

+ 3 - 3
src/views/external-reports/external-manage/high-comp-discount-details.vue

@@ -36,19 +36,19 @@
             <td width="23%" align="center" rowspan="3">企业主要产品(服务)及特殊收入支持作用的技术所属范围</td>
             <td rowspan="3" width="30%" align="center">国家重点支持的高新技术领域</td>
             <td colspan="3">一级领域</td>
-            <td width="12%" align="center">{{ formatHighTechField(formData.d1) }}</td>
+            <td width="12%" align="center">{{ formData.d1 }}</td>
           </tr>
 
           <tr>
             <td width="30px" align="center">2</td>
             <td colspan="3">二级领域</td>
-            <td align="center">{{ formatHighTechField(formData.d2) }}</td>
+            <td align="center">{{ formData.d2 }}</td>
           </tr>
 
           <tr>
             <td width="30px" align="center">3</td>
             <td colspan="3">三级领域</td>
-            <td align="center">{{ formatHighTechField(formData.d3) }}</td>
+            <td align="center">{{ formData.d3 }}</td>
           </tr>
 
           <tr>

+ 11 - 4
src/views/wel/index.vue

@@ -315,6 +315,8 @@ export default {
     // 获取费用统计数据
     getCostSummaryListFunc() {
       getCostSummaryList({ yearAndMonth: `${this.currYear}12` }).then(({ data }) => {
+        let costList = data.data;
+
         let ryrgfyTotal = new Decimal(0); // 人员人工费用
         let zjtrfyTotal = new Decimal(0); // 直接投入费用
         let zjfyycqdtfyTotal = new Decimal(0); // 折旧费用和长期待摊费用
@@ -323,7 +325,11 @@ export default {
         let zbtsfyysyfyTotal = new Decimal(0); // 装备调试费用与试验费用
         let qtfyTotal = new Decimal(0); // 其他费用
         let wwfyTotal = new Decimal(0); // 委外费用
-        data.data.forEach(item => {
+
+        let monthArr = [];
+        let monthSalesArr = [];
+
+        costList.forEach(item => {
           ryrgfyTotal = ryrgfyTotal.add(new Decimal(item.ryrgfy));
           zjtrfyTotal = zjtrfyTotal.add(new Decimal(item.zjtrfy));
           zjfyycqdtfyTotal = zjfyycqdtfyTotal.add(new Decimal(item.zjfyycqdtfy));
@@ -332,6 +338,9 @@ export default {
           zbtsfyysyfyTotal = zbtsfyysyfyTotal.add(new Decimal(item.zbtsfyysyfy));
           qtfyTotal = qtfyTotal.add(new Decimal(item.qtfy));
           wwfyTotal = wwfyTotal.add(new Decimal(item.wwfy));
+
+          monthArr.push(item.yearAndMonth);
+          monthSalesArr.push(Number(new Decimal(item.total).div(new Decimal(0.8))));
         });
         // 研发费用总额
         let costAmount = ryrgfyTotal
@@ -357,8 +366,6 @@ export default {
 
 
         // 本年度月研发归集趋势图
-        let monthArr = data.data.map(item => item.yearAndMonth);
-        let salesArr = data.data.map(item => item.total);
         this.monthAggregationBarOpt = {
           grid: {
             top: "3%",
@@ -386,7 +393,7 @@ export default {
           },
           series: [
             {
-              data: salesArr,
+              data: monthSalesArr,
               type: 'bar',
               barWidth: "25%",
               label: {