Bläddra i källkod

support xsaz fy

Xiaopeng Zhang 4 månader sedan
förälder
incheckning
f59ed4d309
3 ändrade filer med 62 tillägg och 12 borttagningar
  1. 25 11
      src/Service.js
  2. 1 1
      src/SimpleQingdan.js
  3. 36 0
      src/utils.js

+ 25 - 11
src/Service.js

@@ -1,4 +1,4 @@
-import {copy, danxiangdinge_index, danxiangdinge_index_djcs, renameDingE, extractFuzhu, match_target, azfy, addChildren} from './utils';
+import {copy, danxiangdinge_index, danxiangdinge_index_djcs, renameDingE, extractFuzhu, match_target, azfy, xsazfy, addChildren} from './utils';
 import { v4 as uuidv4 } from 'uuid';
 class Service{
     
@@ -2341,7 +2341,14 @@ async generateQingdanTuijian(name, bh, bt, bm) {
         let res = JSON.parse(dinge);
         let keys = Object.keys(res['DEBH']);
         let key = keys[0];
-        let tips = azfy(res['DEBH'][key], res['GCLMC'][key]);
+        let tips = null;
+        if (res['actual_zhuanye'] == 30) {
+            tips = azfy(res['DEBH'][key], res['GCLMC'][key]);
+        }
+        if (res['actual_zhuanye'] == 60) {
+            tips = xsazfy(res['DEBH'][key], res['GCLMC'][key]);
+        }
+
 
         if (tips != null) {
             res['rgde'] = tips['rgde'];
@@ -2361,24 +2368,24 @@ async generateQingdanTuijian(name, bh, bt, bm) {
                 let sum = Number(sl) * Number(rgf) * Number(res['azfytag'][1]) / Number(100);
                 dercj.push(['', res['rgde'][0]['CLBH'], res['rgde'][0]['CLMC'], '', '元', 
                     '1', '', '', '1', '', Number(sum) * Number(res['azfytag'][2]) / Number(100), Number(sum) * Number(res['azfytag'][2]) / Number(100),
-                    '', '', '', '', '', '' ]);
+                    '', '', '', '', uuidv4(), '' ]);
                 dercj.push(['', res['clde'][0]['CLBH'], res['clde'][0]['CLMC'], '', '元', 
                     '1', '', '', '2', '', Number(sum) * Number(res['azfytag'][3]) / Number(100), Number(sum) * Number(res['azfytag'][3]) / Number(100),
-                    '', '', '', '', '', '' ]);
+                    '', '', '', '', uuidv4(), '' ]);
                 dercj.push(['', res['jxde'][0]['jxbh'], res['jxde'][0]['jxmc'], '', '元', 
                     '1', '', '', '3', '', Number(sum) * Number(res['azfytag'][4]) / Number(100), Number(sum) * Number(res['azfytag'][4]) / Number(100),
-                    '', '', '', '', '', '' ]);
+                    '', '', '', '', uuidv4(), '' ]);
             } else if (res['azfytag'][0] == '人工费+机械费') {
                 let sum = Number(sl) * (Number(jxf) + Number(rgf)) * Number(res['azfytag'][1]) / Number(100);
                 dercj.push(['', res['rgde'][0]['CLBH'], res['rgde'][0]['CLMC'], '', '元', 
                     '1', '', '', '1', '', Number(sum) * Number(res['azfytag'][2]) / Number(100), Number(sum) * Number(res['azfytag'][2]) / Number(100),
-                    '', '', '', '', '', '' ]);
+                    '', '', '', '', uuidv4(), '' ]);
                 dercj.push(['', res['clde'][0]['CLBH'], res['clde'][0]['CLMC'], '', '元', 
                     '1', '', '', '2', '', Number(sum) * Number(res['azfytag'][3]) / Number(100), Number(sum) * Number(res['azfytag'][3]) / Number(100),
-                    '', '', '', '', '', '' ]);
+                    '', '', '', '', uuidv4(), '' ]);
                 dercj.push(['', res['jxde'][0]['jxbh'], res['jxde'][0]['jxmc'], '', '元', 
                     '1', '', '', '3', '', Number(sum) * Number(res['azfytag'][4]) / Number(100), Number(sum) * Number(res['azfytag'][4]) / Number(100),
-                    '', '', '', '', '', '' ]);
+                    '', '', '', '', uuidv4(), '' ]);
 
             }
         }
@@ -2545,7 +2552,14 @@ async generateQingdanTuijian(name, bh, bt, bm) {
                 let res = copy(dingeclick);
                 let keys = Object.keys(res['DEBH']);
                 let key = keys[0];
-                let tips = azfy(res['DEBH'][key], res['GCLMC'][key]);
+                let tips = null;
+                if (res['actual_zhuanye'] == 30) {
+                    tips = azfy(res['DEBH'][key], res['GCLMC'][key]);
+                }
+                
+                if (res['actual_zhuanye'] == 60) {
+                    tips = xsazfy(res['DEBH'][key], res['GCLMC'][key]);
+                }
                 if (tips != null) {
                       res['rgde'] = tips['rgde'];
                       res['clde'] = tips['clde'];
@@ -2687,7 +2701,7 @@ async generateQingdanTuijian(name, bh, bt, bm) {
                 '备注': null,
                 "dercj": [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
                 "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ],
-                   ['', bh, mingcheng, '', danwei, '', '', '', '2', '', '1', '', '',  '', '', '', '', '' ]
+                   ['', bh, mingcheng, '', danwei, '', '', '', '2', '', '1', '', '',  '', '', '', uuidv4(), '' ]
                       ],
                 'key' :   uuidv4(),
                 "fuzhuEnable": false,
@@ -2740,7 +2754,7 @@ async generateQingdanTuijian(name, bh, bt, bm) {
                 '备注': null,
                 "dercj": [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
                 "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", "key" , "bc" ],
-                   ['', bh, mingcheng, '', danwei, '', '', '', '2', '', '1', '', '',  '', '', '', "", "" ]
+                   ['', bh, mingcheng, '', danwei, '', '', '', '2', '', '1', '', '',  '', '', '', uuidv4(), "" ]
                       ],
                 'key' :   uuidv4(),
                 "fuzhuEnable": false

+ 1 - 1
src/SimpleQingdan.js

@@ -21,7 +21,7 @@ export default function SimpleQingdan({id, bh, azfycallback}) {
   React.useEffect(() => {
     myTable.current = new Tabulator(myRef.current, {
          index: "key",
-         height: 600,
+         height: 500,
        data: detail, //link data to table
        reactiveData: false, //enable data reactivity
        dataTreeStartExpanded:true,

+ 36 - 0
src/utils.js

@@ -574,6 +574,42 @@ const predef = {
     ["制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "取人工费*13%计算,其中人工工资占25%", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "取人工费*15%", "按人工费13%计取", "按人工费13%计取", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费)", ],
     ]
 };
+
+export const xsazfy = (debh, gclmc) => {
+    if (debh.includes("-F")) {
+        if (debh.includes("-F1")) {
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': 25,'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': 75,'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': 0, 'hj': '0' }];
+            result['sm'] = '取人工费*15%,其中工资占25%,材料占75%';
+            result['azfytag'] = ['人工费',15,25,75,0];
+            return result;
+        }
+        if (debh.includes("-F2")) {
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': 100,'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': 0,'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': 0, 'hj': '0' }];
+            result['sm'] = '离地5米以上的工程,按人工费的30%计取';
+            result['azfytag'] = ['人工费',30,100,0,0];
+            return result;
+            
+        }
+        if (debh.includes("-F3")) {
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': 20,'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': 0,'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': 80, 'hj': '0' }];
+            result['sm'] = '超过20m按人工费的20%计算';
+            result['azfytag'] = ['人工费',20,20,0,80];
+            return result;
+            
+        }
+    } else {
+        return null;
+    }
+};
 export const azfy = (debh, gclmc) => {
     if (debh.includes("-F")) {
        if (debh.includes("-F1")) {