Browse Source

first edition of AI

Gogs 3 months ago
parent
commit
7fb01e3d13
6 changed files with 5828 additions and 4 deletions
  1. 1580 0
      Qingdan3.js
  2. 2375 0
      Service.js
  3. 16 0
      package.json
  4. 59 0
      server.js
  5. 7 4
      tasks.py
  6. 1791 0
      utils.js

+ 1580 - 0
Qingdan3.js

@@ -0,0 +1,1580 @@
+import * as React from 'react';
+import Box from "@mui/material/Box";
+import Table from 'rsuite/Table';
+import 'rsuite/Table/styles/index.css';
+import Checkbox from 'rsuite/Checkbox';
+import 'rsuite/Checkbox/styles/index.css';
+import { CustomProvider, Input, InputNumber } from 'rsuite';
+import 'rsuite/InputNumber/styles/index.css';
+import zhCN from 'rsuite/locales/zh_CN';
+import { Grid } from '@mui/material';
+import Tooltip from '@mui/material/Tooltip';
+import AddIcon from '@mui/icons-material/Add';
+import Typography from '@mui/material/Typography';
+
+import DeleteIcon from '@mui/icons-material/DeleteOutlined';
+import Radio from '@mui/material/Radio';
+import RadioGroup from '@mui/material/RadioGroup';
+import FormControlLabel from '@mui/material/FormControlLabel';
+import FormControl from '@mui/material/FormControl';
+import FormLabel from '@mui/material/FormLabel';
+import Tab from "@mui/material/Tab";
+import TabContext from "@mui/lab/TabContext";
+import TabList from "@mui/lab/TabList";
+import TabPanel from "@mui/lab/TabPanel";
+import Stack from "@mui/material/Stack";
+import Service from './Service';
+import Button from '@mui/material/Button';
+import ButtonGroup from '@mui/material/ButtonGroup';
+import {extractFuzhu} from './utils';
+import {shanchu, undo, redo, danxiangdinge, updateDercj, changguidinge, handleBeizhu, huan, updateShuliang, handleYuban, updateDeMingcheng, handleRcjbc} from './editor';
+
+import { DataGrid, GridActionsCellItem, zhCN as zhCN_MUI, GridToolbarContainer } from '@mui/x-data-grid';
+
+
+import { v4 as uuidv4 } from 'uuid';
+
+import {copy} from './utils';
+
+
+import {TabulatorFull as Tabulator} from "tabulator-tables"; //import Tabulator library
+import './Tabulator.css';
+const {Column, HeaderCell, Cell} = Table;
+
+
+/**
+ * 
+本条规定了工程量清单编码的表示方式:十二位阿拉伯数字及其设置规定。
+各位数字的含义是:一、二位为专业工程代码(01—房屋建筑与装饰工程;02—仿古建筑工程;
+03—通用安装工程;04—市政工程;05—园林绿化工程;06—矿山工程;07—构筑物工程;08—城市
+轨道交通工程;09—爆破工程。以后进入国标的专业工程代码以此类推);三、四位为附录分类顺序码;
+五、六位为分部工程顺序码;七、八、九位为分项工程项目名称顺序码;十至十二位为清单项目名称
+顺序码。
+ */
+
+
+
+
+
+
+
+
+export default function Qingdan3({name, bh, bt,  beizhu/*后台传回来的附注信息,要整理后才能成为展示用的行*/ , beizhuFK, clickCallback, loadingCallback, dingeclick, tihuanCallback, tihuanClick, bctihuanClick, bctihuanCallback, suanshiCallback}) {
+    
+     const myTable = React.useRef(null);
+     const myRef = React.useRef(null);
+     const [valueTab, setValueTab] = React.useState("1");
+     const handleChange = (event, newValue) => {
+          setValueTab(newValue);
+        };
+     const onCellDoubleClick = (params, event, detail) => {
+         
+          if (params.field == '人材机编码') {
+               console.log(params);
+               bctihuanCallback(params.id);
+          }
+     };
+     const [rcjhl, setRcjhl] = React.useState([]);
+     const [rcjhl2, setRcjhl2] = React.useState([]);
+     const [fuzhu, setFuzhu] = React.useState([]);//展示用的附注行
+     const [tuijian, setTuijian] = React.useState([]);
+     const [fuzhuEnable, setFuzhuEnable] = React.useState(false);
+     const [yubanEnable, setYubanEnable] = React.useState(false);
+
+     const highlight = React.useRef([]);
+     const debmRef = React.useRef(null);
+
+     const tuijianRef = React.useRef(null);
+     const tuijianTable = React.useRef(null);
+     const rcj2Ref = React.useRef(null);
+     const rcj2Table = React.useRef(null);
+     const rcjRef = React.useRef(null);
+     const rcjTable = React.useRef(null);
+     const [detail, setDetail] = React.useState([
+                    
+     ]);
+
+     const selectedRowKeysTable = React.useRef([]);
+     const selectedRowKeysTableParent = React.useRef(null);
+     const beizhuFKRef = React.useRef(null);
+
+
+     const rgdeRef = React.useRef(null);
+     const jxdeRef = React.useRef(null);
+     const cldeRef = React.useRef(null);
+     const isQdrcj = React.useRef(false);
+     ///备注
+     const onSelectChange = (newSelectedRowKeys) => {
+          const [newData, newHl] = handleBeizhu(beizhuFKRef.current, selectedRowKeysTable.current[0], newSelectedRowKeys, fuzhu);
+                                       if (newData) {
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                                          myTable.current.deselectRow();
+                                          myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                                            myTable.current.element.children[1].scrollTop = former;
+                                            myTable.current.element.children[1].scrollLeft = former2;
+                                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                                              let component = null;
+                                              for(let i = 0; i < getRow.length; i++) {
+                                                   let entry = getRow[i]._row.modules.dataTree.children;
+                                                   for(let j = 0; j < entry.length; j++) {
+                                                        let child = entry[j];
+                                                        if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                                             component = child.component;
+                                                             break;
+                                                        }
+                                                        
+                                                   }
+
+                                              }
+                                              component.select();
+                                          
+                                          });
+                                          let y =[];
+                                          for (let i = 1; i < newHl.length; i++) {
+                                            y.push({
+                                          'ID' : newHl[i][0],
+                                          '人材机编码' : newHl[i][1],
+                                          '名称' : newHl[i][2],
+                                          '规格型号': newHl[i][3],
+                                          '单位' : newHl[i][4],
+                                          '单价' : newHl[i][5],
+                                          '产地' : newHl[i][6],
+                                          '供应厂商' : newHl[i][7],
+                                          '人材机类别' : newHl[i][8],
+                                          '甲供标志': newHl[i][9],
+                                          '含量' : newHl[i][10],
+                                          '合价' : newHl[i][11],
+                                          '暂估价标志' : newHl[i][12],
+                                          '主要材料标志' : newHl[i][13],
+                                          '主材标志' : newHl[i][14],
+                                          '设备标志' : newHl[i][15] ,
+                                          'key' : newHl[i][16],
+                                          'bc': newHl[i][17]
+
+                                          });
+                                        }
+                                         setRcjhl(y);
+                                         if (rcjTable.current) {
+                                            rcjTable.current.replaceData(y);
+                                         }
+     
+                                       }
+        };
+
+        //预拌砂浆
+        const onSelectChange2 = (event) => {
+          
+          setValueYuban(event.target.value);
+          const [newData, newHl]  = handleYuban(selectedRowKeysTable.current[0], [event.target.value]);
+          if (newData) {
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                                          myTable.current.deselectRow();
+               myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+               
+                                            myTable.current.element.children[1].scrollTop = former;
+                                            myTable.current.element.children[1].scrollLeft = former2;
+                                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                                              let component = null;
+                                              for(let i = 0; i < getRow.length; i++) {
+                                                   let entry = getRow[i]._row.modules.dataTree.children;
+                                                   for(let j = 0; j < entry.length; j++) {
+                                                        let child = entry[j];
+                                                        if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                                             component = child.component;
+                                                             break;
+                                                        }
+                                                        
+                                                   }
+
+                                              }
+                                              component.select();
+              
+               
+                });
+               let y =[];
+               for (let i = 1; i < newHl.length; i++) {
+                 y.push({
+               'ID' : newHl[i][0],
+               '人材机编码' : newHl[i][1],
+               '名称' : newHl[i][2],
+               '规格型号': newHl[i][3],
+               '单位' : newHl[i][4],
+               '单价' : newHl[i][5],
+               '产地' : newHl[i][6],
+               '供应厂商' : newHl[i][7],
+               '人材机类别' : newHl[i][8],
+               '甲供标志': newHl[i][9],
+               '含量' : newHl[i][10],
+               '合价' : newHl[i][11],
+               '暂估价标志' : newHl[i][12],
+               '主要材料标志' : newHl[i][13],
+               '主材标志' : newHl[i][14],
+               '设备标志' : newHl[i][15] ,
+               'key' : newHl[i][16],
+               'bc': newHl[i][17]
+
+               });
+             }
+              setRcjhl(y);
+              if (rcjTable.current) {
+                 rcjTable.current.replaceData(y);
+              }
+
+            }
+        
+        };
+
+
+     /**fuzhu select */
+    
+     const [checked, setChecked] = React.useState(false);
+     const [indeterminate, setIndeterminate] = React.useState(false);
+     const [checkedKeys, setCheckedKeys] = React.useState([]);
+     const setCheckedKeys_ = (keys) => {
+      setCheckedKeys(keys);
+      if (keys.length == fuzhu.length) {
+           setChecked(true);
+           setIndeterminate(false);
+      } else if (keys.length == 0) {
+           setChecked(false);
+           setIndeterminate(false);
+      } else {
+           setIndeterminate(true);
+           setChecked(false);
+      }
+      onSelectChange(keys);
+     };
+     const setCheckedKeys_2 = (keys) => {
+      setCheckedKeys(keys);
+      if (keys.length == fuzhu.length) {
+           setChecked(true);
+           setIndeterminate(false);
+      } else if (keys.length == 0) {
+           setChecked(false);
+           setIndeterminate(false);
+      } else {
+           setIndeterminate(true);
+           setChecked(false);
+      }
+      //onSelectChange(keys);
+     };
+     const handleCheckAll = (value, checked) => {
+      const keys = checked? fuzhu.map(item => item.id) : [];
+      setCheckedKeys_(keys);
+ 
+     }
+     const handleCheck = (value, checked) => {
+      const keys = checked? [...checkedKeys, value] : checkedKeys.filter(item => item != value);
+      setCheckedKeys_(keys);
+ 
+     }
+ 
+     const CheckCell = ({rowData, onChange, checkedKeys, dataKey, disabled, ...props}) => {
+       return <Cell {...props} style={{ padding: 0}}>
+           <div style={{lineHeight: '40px'}}>
+              <Checkbox value = {rowData[dataKey]}
+              inline
+              disabled={disabled}
+              onChange={onChange}
+              checked={checkedKeys.some(item => 
+               { 
+                    
+                    let hit = item === rowData[dataKey];
+                    
+                 return   hit;
+               })}
+              ></Checkbox>
+           </div>
+       </Cell>
+     };
+
+   
+
+     const [valueYuban, setValueYuban] = React.useState("");
+
+
+     var editCheck = function(cell){
+          //cell - the cell component for the editable cell
+      
+          //get row data
+          //console.log(cell);
+          if(cell._cell.row.data['序号']) return false;
+          return true;
+      }
+
+      var editCheckJg = function(cell){
+          //cell - the cell component for the editable cell
+      
+          //get row data
+          //console.log(cell);
+          if(isQdrcj.current) return false;
+          //if (cell._cell.row.getData()['人材机编码'].includes('10000F')) {
+          //     return false;
+          //}
+          if (cell._cell.row.getData()['人材机编码'].includes('000FE')) {////安装费用
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '00EXP001') {//回程费
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '99EXP007') {//
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '99EXP022') {//
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '31130104') {//
+               return false;
+          }
+          if (cell._cell.row.getData()['甲供标志'] == 'true') {
+               return false;
+          }
+
+          return true;
+      }
+      var editCheckRcj = function(cell){
+          //cell - the cell component for the editable cell
+      
+          //get row data
+          //console.log(cell);
+          if(isQdrcj.current) return false;
+          //if (cell._cell.row.getData()['人材机编码'].includes('10000F')) {
+          //     return false;
+          //}
+          if (cell._cell.row.getData()['人材机编码'].includes('000FE')) {//安装费用
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '00EXP001') {//回程费
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '99EXP007') {//
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '99EXP022') {//
+               return false;
+          }
+          if (cell._cell.row.getData()['人材机编码'] == '31130104') {//
+               return false;
+          }
+          
+
+          return true;
+      }
+
+
+     var sparklineFormatter = function(cell, formatterParams, onRendered){
+          for (let i = 0; i < highlight.current.length; i++) {
+               let entry = highlight.current[i];
+               if (entry.row + 1 == cell._cell.row.position && entry.col + 1 == cell._cell.column.getPosition()) {
+                    cell.getElement().style.fontWeight = 'bold';
+                    cell.getElement().style.color = 'green';
+                    cell.getElement().style.background = '#d7f1e1';
+               }
+              }
+              return Number(cell.getValue()).toFixed(2).toString(); 
+          };
+
+     var sparklineFormatter2 = function(cell, formatterParams, onRendered){
+               for (let i = 0; i < highlight.current.length; i++) {
+                    let entry = highlight.current[i];
+                    if (entry.row + 1 == cell._cell.row.position && entry.col + 1 == cell._cell.column.getPosition()) {
+                         cell.getElement().style.fontWeight = 'bold';
+                         cell.getElement().style.color = 'green';
+                         cell.getElement().style.background = '#d7f1e1';
+                    }
+                   }
+                   return cell.getValue(); 
+               };
+
+
+
+     const resetUI = () => {
+          selectedRowKeysTable.current = [];
+          selectedRowKeysTableParent.current = null;
+               setRcjhl([]);
+               if (rcjTable.current) {
+                    rcjTable.current.replaceData([]);
+               }
+               setFuzhu([]);
+               setRcjrows([]);
+               setShowToolbar(false);
+               setValueYuban("");
+               setYubanEnable(false);
+               isQdrcj.current = true;
+               highlight.current = [];
+               setTuijian([]);
+               if (tuijianTable.current) tuijianTable.current.replaceData([]);
+     };
+
+      function handleSelect(row){
+          selectedRowKeysTable.current = [row._row['data']['key']];
+          if (row._row.data['序号'] != null && row._row.data['序号'].length >0) {
+               selectedRowKeysTableParent.current = row._row['data']['key'];
+
+               setFuzhu([]);
+               setRcjrows([]);//补充人材机
+               setYubanEnable(false);
+               setValueYuban("");
+               setShowToolbar(false);
+               Service.generateQingdanrcj(name, bh,bt,row._row.data['清单编码']).then(x=>{
+                
+                
+                    let y =[];
+                    for (let i = 1; i < x.length; i++) {
+                         y.push({
+                              'ID' : x[i][0],
+                              '人材机编码' : x[i][1],
+                              '名称' : x[i][2],
+                              '规格型号': x[i][3],
+                              '单位' : x[i][4],
+                              '单价' : x[i][5],
+                              '产地' : x[i][6],
+                              '供应厂商' : x[i][7],
+                              '人材机类别' : x[i][8],
+                              '甲供标志': x[i][9],
+                              '含量' : x[i][10],
+                              '合价' : x[i][11],
+                              '暂估价标志' : x[i][12],
+                              '主要材料标志' : x[i][13],
+                              '主材标志' : x[i][14],
+                              '设备标志' : x[i][15] ,
+                              'key' : '',
+                              'bc': ''
+
+                         });
+                    }
+                    setRcjhl(y);
+                    if (rcjTable.current) {
+                         rcjTable.current.replaceData(y);
+                    }
+                
+                  isQdrcj.current = true;
+                  highlight.current = [];
+               });
+               Service.generateQingdanTuijian(name, bh,bt,row._row.data['清单编码']).then(x=>{
+                setTuijian(x);
+                if (tuijianTable.current) tuijianTable.current.replaceData(x);
+                
+             });
+          }else{
+               setTuijian([]);
+               if (tuijianTable.current) tuijianTable.current.replaceData([]);
+              let row_parent = row._row;
+              while(row_parent.modules.dataTree.parent) {
+                   row_parent = row_parent.modules.dataTree.parent;
+              }
+              
+
+               //console.log(name, bh,bt,qdbm, selected[1]);
+               debmRef.current = row._row['data']['清单编码'];
+               selectedRowKeysTableParent.current = row_parent['data']['key'];
+               let qdbm = row_parent['data']['清单编码'];
+               let debm = row._row['data']['清单编码'];
+               console.log('debm=');
+               console.log(debm);
+               let danwei = row._row['data']['单位'];
+
+               clickCallback(bt, qdbm, debm, row._row['data']['名称']);/**dingercj need row key */
+               Service.generateDingercj(name, bh,bt,qdbm, debm, danwei, row._row['data']['key']).then(x=>{
+                 console.log(x);
+                 let y =[];
+                              for (let i = 1; i < x[0].length; i++) {
+                                   y.push({
+                                        'ID' : x[0][i][0],
+                                        '人材机编码' : x[0][i][1],
+                                        '名称' : x[0][i][2],
+                                        '规格型号': x[0][i][3],
+                                        '单位' : x[0][i][4],
+                                        '单价' : x[0][i][5],
+                                        '产地' : x[0][i][6],
+                                        '供应厂商' : x[0][i][7],
+                                        '人材机类别' : x[0][i][8],
+                                        '甲供标志': x[0][i][9],
+                                        '含量' : x[0][i][10],
+                                        '合价' : x[0][i][11],
+                                        '暂估价标志' : x[0][i][12],
+                                        '主要材料标志' : x[0][i][13],
+                                        '主材标志' : x[0][i][14],
+                                        '设备标志' : x[0][i][15] ,
+                                        'key' : x[0][i][16],
+                                        'bc': x[0][i][17]
+          
+                                   });
+                              }
+                              setRcjhl(y);
+                              if (rcjTable.current) {
+                                   rcjTable.current.replaceData(y);
+                              }
+                 setShowToolbar(true);
+                 setFuzhuEnable(x[1]);
+                 setYubanEnable(x[1]);
+                 if (x[2]== null || x[2].length == 0) {
+                    setValueYuban("");
+                 } else {
+                    setValueYuban(x[2][0]);
+                 }
+                 setRcjrows(x[3]);//buchongrcj
+                 //hotRcjRef.current?.hotInstance?.loadData(x);
+                 isQdrcj.current = false;
+                 let toHighlight = [];
+                 highlight.current = toHighlight;
+               });
+
+          }
+
+      }
+
+     /**补充人材机 */
+     const [rcjrows, setRcjrows] = React.useState([]);
+     const [showToolbar, setShowToolbar] = React.useState(false);
+     const rcjcolumns = [
+          {
+               field: 'actions',
+               type: 'actions',
+               headerName: '操作',
+               width: 100,
+               cellClassName: 'actions',
+               getActions: ({ id }) => {
+                
+         
+                
+         
+                 return [
+               
+                   <GridActionsCellItem
+                     icon={<DeleteIcon />}
+                     label="Delete"
+                     onClick={handleDeleteClick(id)}
+                     color="inherit"
+                   />,
+                 ];
+               },
+             },
+          { field: '人材机编码', headerName: '人材机编码', width: 120, editable: false },
+          {
+            field: '名称',
+            headerName: '名称',
+            width: 120,
+            align: 'left',
+            headerAlign: 'left',
+            editable: true,
+          },
+          {
+            field: '规格型号',
+            headerName: '规格型号',
+            width: 100,
+            editable: true,
+          },
+          {
+            field: '单位',
+            headerName: '单位',
+            width: 80,
+            editable: true,
+          },
+          {
+               field: '单价',
+               headerName: '单价',
+               width: 80,
+               editable: true,
+             },
+             {
+               field: '产地',
+               headerName: '产地',
+               width: 80,
+               editable: true,
+             },
+             {
+               field: '供应厂商',
+               headerName: '供应厂商',
+               width: 80,
+               editable: true,
+             },
+          {
+               field: '人材机类别',
+               headerName: '人材机类别',
+               width: 120,
+               editable: false,
+             },
+             {
+               field: '甲供标志',
+               headerName: '甲供标志',
+               width: 80,
+               editable: true,
+               type: 'singleSelect',
+               valueOptions: ['true', 'false'] 
+             },
+             {
+               field: '含量',
+               headerName: '含量',
+               width: 80,
+               editable: true,
+             },
+            /* {
+               field: '合价',
+               headerName: '合价',
+               width: 80,
+               editable: true,
+             },*/
+             {
+               field: '暂估价标志',
+               headerName: '暂估价标志',
+               width: 100,
+               editable: true,
+               type: 'singleSelect',
+               valueOptions: ['true', 'false'] 
+             },
+             {
+               field: '主要材料标志',
+               headerName: '主要材料标志',
+               width: 120,
+               editable: true,
+               type: 'singleSelect',
+               valueOptions: ['true', 'false'] 
+             },
+             {
+               field: '主材标志',
+               headerName: '主材标志',
+               width: 80,
+               editable: true,
+               type: 'singleSelect',
+               valueOptions: ['true', 'false'] 
+             },
+             {
+               field: '设备标志',
+               headerName: '设备标志',
+               width: 80,
+               editable: true,
+               type: 'singleSelect',
+               valueOptions: ['true', 'false'] 
+             },
+       
+        ];
+
+    
+      
+        const handleDeleteClick = (id) => () => {
+          setRcjrows(rcjrows.filter((row) => row.id !== id));
+          const [newData, newHl] = handleRcjbc(selectedRowKeysTable.current[0], rcjrows.filter((row) => row.id !== id));
+          if (newData) {
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                                          myTable.current.deselectRow();
+               myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                                            myTable.current.element.children[1].scrollTop = former;
+                                            myTable.current.element.children[1].scrollLeft = former2;
+                                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                                              let component = null;
+                                              for(let i = 0; i < getRow.length; i++) {
+                                                   let entry = getRow[i]._row.modules.dataTree.children;
+                                                   for(let j = 0; j < entry.length; j++) {
+                                                        let child = entry[j];
+                                                        if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                                             component = child.component;
+                                                             break;
+                                                        }
+                                                        
+                                                   }
+
+                                              }
+                                              component.select();
+
+               });
+               let y =[];
+               for (let i = 1; i < newHl.length; i++) {
+                 y.push({
+               'ID' : newHl[i][0],
+               '人材机编码' : newHl[i][1],
+               '名称' : newHl[i][2],
+               '规格型号': newHl[i][3],
+               '单位' : newHl[i][4],
+               '单价' : newHl[i][5],
+               '产地' : newHl[i][6],
+               '供应厂商' : newHl[i][7],
+               '人材机类别' : newHl[i][8],
+               '甲供标志': newHl[i][9],
+               '含量' : newHl[i][10],
+               '合价' : newHl[i][11],
+               '暂估价标志' : newHl[i][12],
+               '主要材料标志' : newHl[i][13],
+               '主材标志' : newHl[i][14],
+               '设备标志' : newHl[i][15],
+               'key' : newHl[i][16],
+               'bc': newHl[i][17]
+
+               });
+             }
+              setRcjhl(y);
+              if (rcjTable.current) {
+                 rcjTable.current.replaceData(y);
+              }
+
+            }
+
+        };
+      
+      
+        const processRowUpdate = (newRow) => {
+          const updatedRow = { ...newRow, isNew: false };
+          setRcjrows(rcjrows.map((row) => (row.id === newRow.id ? updatedRow : row)));
+          const [newData, newHl] = handleRcjbc(selectedRowKeysTable.current[0], rcjrows.map((row) => (row.id === newRow.id ? updatedRow : row)));
+          if (newData) {
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                                          myTable.current.deselectRow();
+               myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                                            myTable.current.element.children[1].scrollTop = former;
+                                            myTable.current.element.children[1].scrollLeft = former2;
+                                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                                              let component = null;
+                                              for(let i = 0; i < getRow.length; i++) {
+                                                   let entry = getRow[i]._row.modules.dataTree.children;
+                                                   for(let j = 0; j < entry.length; j++) {
+                                                        let child = entry[j];
+                                                        if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                                             component = child.component;
+                                                             break;
+                                                        }
+                                                        
+                                                   }
+
+                                              }
+                                              component.select();
+
+               });
+               let y =[];
+               for (let i = 1; i < newHl.length; i++) {
+                 y.push({
+               'ID' : newHl[i][0],
+               '人材机编码' : newHl[i][1],
+               '名称' : newHl[i][2],
+               '规格型号': newHl[i][3],
+               '单位' : newHl[i][4],
+               '单价' : newHl[i][5],
+               '产地' : newHl[i][6],
+               '供应厂商' : newHl[i][7],
+               '人材机类别' : newHl[i][8],
+               '甲供标志': newHl[i][9],
+               '含量' : newHl[i][10],
+               '合价' : newHl[i][11],
+               '暂估价标志' : newHl[i][12],
+               '主要材料标志' : newHl[i][13],
+               '主材标志' : newHl[i][14],
+               '设备标志' : newHl[i][15] ,
+               'key' : newHl[i][16],
+               'bc': newHl[i][17]
+
+               });
+             }
+              setRcjhl(y);
+              if (rcjTable.current) {
+                 rcjTable.current.replaceData(y);
+              }
+
+            }
+          return updatedRow;
+        };
+
+        function EditToolbar(props) {
+          const { setRcjrows } = props;
+        
+          const handleClick = () => {
+            const id = uuidv4();
+            let a = [];
+            let temp = debmRef.current;
+            let temp2 = temp.split('-')[0];
+            setRcjrows((oldRows) => {
+               a = [
+                 ...oldRows,
+                 { id, '人材机编码': temp2.concat('10000F'), '名称': '', '规格型号': '', '单位': '', '单价':'0','产地': '', '供应厂商': '', '人材机类别':'2',
+                '甲供标志':'', '含量':'1', '暂估价标志':'', '主要材料标志':'true', '主材标志':'true', '设备标志':'' },
+               ];
+               return a;
+             });
+             const [newData, newHl] = handleRcjbc(selectedRowKeysTable.current[0], a);
+             if (newData) {
+               let former = myTable.current.element.children[1].scrollTop;
+               let former2 = myTable.current.element.children[1].scrollLeft;
+               myTable.current.deselectRow();
+               myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                       myTable.current.element.children[1].scrollTop = former;
+                       myTable.current.element.children[1].scrollLeft = former2;
+                         let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                         let component = null;
+                         for(let i = 0; i < getRow.length; i++) {
+                              let entry = getRow[i]._row.modules.dataTree.children;
+                              for(let j = 0; j < entry.length; j++) {
+                                   let child = entry[j];
+                                   if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                        component = child.component;
+                                        break;
+                                   }
+                                   
+                              }
+
+                         }
+                         component.select();
+               });
+               let y =[];
+               for (let i = 1; i < newHl.length; i++) {
+                 y.push({
+               'ID' : newHl[i][0],
+               '人材机编码' : newHl[i][1],
+               '名称' : newHl[i][2],
+               '规格型号': newHl[i][3],
+               '单位' : newHl[i][4],
+               '单价' : newHl[i][5],
+               '产地' : newHl[i][6],
+               '供应厂商' : newHl[i][7],
+               '人材机类别' : newHl[i][8],
+               '甲供标志': newHl[i][9],
+               '含量' : newHl[i][10],
+               '合价' : newHl[i][11],
+               '暂估价标志' : newHl[i][12],
+               '主要材料标志' : newHl[i][13],
+               '主材标志' : newHl[i][14],
+               '设备标志' : newHl[i][15],
+               'key' : newHl[i][16],
+               'bc': newHl[i][17]
+
+               });
+             }
+             setRcjhl(y);
+              if (rcjTable.current) {
+                 rcjTable.current.replaceData(y);
+              }
+          }
+            
+          };
+        
+          return (
+            <GridToolbarContainer>
+              <Button disabled={!showToolbar}
+              color="primary" startIcon={<AddIcon />} onClick={handleClick}>
+                补充
+              </Button>
+            </GridToolbarContainer>
+          );
+        }
+   
+    
+
+   
+     
+    
+
+
+
+     React.useEffect(() => {
+        
+          myTable.current = new Tabulator(myRef.current, {
+               index: "key",
+               height: 380,
+               renderVertical: "basic",
+             data: detail, //link data to table
+             reactiveData: false, //enable data reactivity
+             dataTreeStartExpanded:true,
+             dataTree: true,
+             selectableRows:1, //make rows selectable
+             editTriggerEvent:"dblclick", //trigger edit on double click
+             dataTreeStartExpanded:function(row, level){
+                 return true; //expand rows where the "driver" data field is true;
+             },
+             columns: [ //Define Table Columns
+                          {title:"序号", field:"序号", width:80, headerSort:false, frozen: true}, //never hide this column
+                          {title:"清单编码", field:"清单编码", width:120,headerSort:false, frozen: true ,formatter:"textarea" },
+                          {title:"名称", field:"名称", width:150, headerSort:false, formatter:"textarea", editor: "input", editable: editCheck}, //hide this column first
+                          {title:"项目特征", field:"项目特征", width:200 , headerSort:false, formatter:"textarea"},
+                          {title:"计算规则", field:"计算规则", width:300, headerSort:false, formatter:"textarea"},
+                          {title:"单位", field:"单位", width:100, headerSort:false},
+                          {title:"数量", field:"数量", width:100, headerSort:false, editor: "input", editable: editCheck },
+                          {title:"综合单价", field:"综合单价", width:100, headerSort:false, formatter:"money"},
+                          {title:"合价", field:"合价", width:100, headerSort:false, formatter:"money"},
+                          {title:"人工费", field:"人工费", width:100, headerSort:false, formatter:"money"},
+                          {title:"主材费", field:"主材费", width:100, headerSort:false, formatter:"money"},
+                          {title:"设备费", field:"设备费", width:100, headerSort:false, formatter:"money"},
+                          {title:"辅材费", field:"辅材费", width:100, headerSort:false, formatter:"money"},
+                          {title:"材料费", field:"材料费", width:100, headerSort:false, formatter:"money"},
+                          {title:"机械费", field:"机械费", width:100, headerSort:false, formatter:"money"},
+                          {title:"管理费", field:"管理费", width:100, headerSort:false, formatter:"money"},
+                          {title:"利润", field:"利润", width:100, headerSort:false, formatter:"money"},
+                          {title:"暂估价", field:"暂估价", width:100, headerSort:false, formatter:"money"},
+                          {title:"综合人工工日", field:"综合人工工日", width:100, headerSort:false},
+                  ]
+           }); 
+           
+           myTable.current.on("cellDblClick", function(e, cell){
+               //e - the click event object
+               //cell - cell component
+               console.log(cell);
+           });
+     
+           myTable.current.on("rowSelected", handleSelect);
+           
+     
+           myTable.current.on("cellEdited", function(cell){
+               let key = cell._cell.row.data['key'];
+               myTable.current.deselectRow();
+               if(cell._cell.column.field == '名称') {
+                    let newData = updateDeMingcheng(cell._cell.row.data['名称'], selectedRowKeysTable.current[0]);
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                    myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function() {
+                       myTable.current.element.children[1].scrollTop = former;
+                       myTable.current.element.children[1].scrollLeft = former2;
+                         let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                         let component = null;
+                         for(let i = 0; i < getRow.length; i++) {
+                              let entry = getRow[i]._row.modules.dataTree.children;
+                              for(let j = 0; j < entry.length; j++) {
+                                   let child = entry[j];
+                                   if(child.data['key'] == key) {
+                                        //console.log(child);
+                                        component = child.component;
+                                        break;
+                                   }
+                                   
+                              }
+
+                         }
+                         component.select();
+                     //    handleSelect(component);
+                      });                
+               }
+
+               else{
+
+               
+               
+               let [success, data] = updateShuliang(cell._cell.row.data['数量'], selectedRowKeysTable.current[0]);
+               if (success) {
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                                myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function() {
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                                   let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                                   let component = null;
+                                   for(let i = 0; i < getRow.length; i++) {
+                                        let entry = getRow[i]._row.modules.dataTree.children;
+                                        for(let j = 0; j < entry.length; j++) {
+                                             let child = entry[j];
+                                             if(child.data['key'] == key) {
+                                                  //console.log(child);
+                                                  component = child.component;
+                                                  break;
+                                             }
+                                             
+                                        }
+     
+                                   }
+                                   component.select();
+                                 //  handleSelect(component);
+                                });                            
+                                                            
+               }
+          }
+           });
+     
+     
+           myTable.current.on("tableBuilt", () => {
+               if (bh != null) {
+               Service.generateQingdanmingxi(name, bh, bt).then(x=>{
+                    myTable.current.replaceData(x);
+                    });
+               }
+             });
+          
+         
+        }, [bh, bt]);
+
+
+
+
+
+
+        React.useEffect(
+          () => {
+              console.log(beizhu);
+              let result = [];
+              if (beizhu != null) { 
+                  let keys = Object.keys(beizhu["BZBH"]);
+                  for(let i = 0; i < keys.length; i++) {
+                      let key = keys[i];
+                      result.push({'id': i+1, 'key': i+1, '序号': i+1, '编号': beizhu["BZBH"][key], '说明': beizhu["SM"][key], '数量': 1});//序号很重要
+                  }
+                  
+                  let newSelect = extractFuzhu(debmRef.current);
+                  setCheckedKeys_2(newSelect.map(x=>x.split('*')[0]).map(x=>Number(x)));
+                  for(let i = 0; i < newSelect.length; i++) {
+                    if (newSelect[i].includes('*')) {
+                         let xuhao = Number(newSelect[i].split('*')[0]);
+                         let coef = Number(newSelect[i].split('*')[1]);
+                         for(let j = 0; j < result.length; j++) {
+                              if (result[j]['id'] == xuhao) {
+                                   result[j]['数量'] = coef;
+                              }
+                         }
+                    }
+                  }
+                  setFuzhu(result);
+                  
+              }
+          }, [beizhu]
+        );
+
+        React.useEffect(
+          () => {
+               beizhuFKRef.current = beizhuFK;
+          }, [beizhuFK]
+      );
+
+  
+
+
+      React.useEffect(
+          () => {
+               
+               myTable.current.deselectRow();
+               if (selectedRowKeysTable.current.length > 0 ) {
+                    const [success, data, key] = changguidinge(JSON.parse(dingeclick), selectedRowKeysTable.current[0]);
+                    if (success) {
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                         myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                              let component = null;
+                              for(let i = 0; i < getRow.length; i++) {
+                                   let entry = getRow[i]._row.modules.dataTree.children;
+                                   for(let j = 0; j < entry.length; j++) {
+                                        let child = entry[j];
+                                        if(child.data['key'] == key) {
+                                             //console.log(child);
+                                             component = child.component;
+                                             break;
+                                        }
+                                        
+                                   }
+
+                              }
+                              
+                              component.select();
+                              handleSelect(component);
+
+                                   
+                               
+                          });
+                    }
+               }
+              
+          }, [dingeclick]//常规添加定额
+      );
+
+      React.useEffect(
+          () => {
+               
+                    let obj = JSON.parse(bctihuanClick);
+                    if (obj != null) {
+                        processRowUpdate({'id': obj['old'], '人材机编码': obj['newBianhao'], '名称': obj['newName'], 
+                        '规格型号': '', '单位': obj['newDW'], '单价': obj['newJia'], '产地': '', '供应厂商': '',
+                         '人材机类别':obj['RcjLb'], '甲供标志': '', '含量': '', '暂估价标志':'', '主要材料标志':'', '主材标志':'','设备标志':''});
+                    }
+                    
+               
+               
+          }, [bctihuanClick]//替换定额人材机
+      );
+
+
+      React.useEffect(
+          () => {
+               if (selectedRowKeysTable.current.length > 0 && JSON.parse(tihuanClick) != null) {
+                    const data = huan(JSON.parse(tihuanClick), selectedRowKeysTable.current[0]);
+                    myTable.current.deselectRow();
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                    myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                         let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                         let component = null;
+                         for(let i = 0; i < getRow.length; i++) {
+                              let entry = getRow[i]._row.modules.dataTree.children;
+                              for(let j = 0; j < entry.length; j++) {
+                                   let child = entry[j];
+                                   if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                        component = child.component;
+                                        break;
+                                   }
+                              }
+                         }
+                         component.select();
+                         //handleSelect(component);
+                     });
+               }
+               
+          }, [tihuanClick]//替换定额人材机
+      );
+
+
+
+      React.useEffect(
+          () => {
+               if (tuijianRef.current != null ) {
+               tuijianTable.current = new Tabulator(tuijianRef.current, {
+                    index: "key",
+                    height: 200,
+                  data: tuijian, //link data to table
+                  reactiveData: false, //enable data reactivity
+                  dataTreeStartExpanded:false,
+                  dataTree: false,
+                  selectableRows:1, //make rows selectable
+                  columns: [ //Define Table Columns
+                               {title:"ID", field:"ID", width:80, headerSort:false, }, //never hide this column
+                               {title:"定额编号", field:"定额编号", width:120,headerSort:false,  formatter:"textarea" },
+                               {title:"工程量名称", field:"工程量名称", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
+                               {title:"工作内容", field:"工作内容", width:150 , headerSort:false, formatter:"textarea"},
+                       ]
+               });
+               tuijianTable.current.on("tableBuilt", () => {
+                    tuijianTable.current.replaceData(tuijian);
+                  });
+               }
+               if (rcj2Ref.current != null ) {
+                    rcj2Table.current = new Tabulator(rcj2Ref.current, {
+                         index: "key",
+                         height: 200,
+                       data: rcjhl2, //link data to table
+                       reactiveData: false, //enable data reactivity
+                       dataTreeStartExpanded:false,
+                       dataTree: false,
+                       selectableRows:1, //make rows selectable
+                       columns: [ //Define Table Columns
+                                    {title:"人材机编码", field:"人材机编码", width:100, headerSort:false, }, //never hide this column
+                                    {title:"名称", field:"名称", width:120,headerSort:false,  formatter:"textarea" },
+                                    {title:"单位", field:"单位", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
+                                    {title:"单价", field:"单价", width:150 , headerSort:false, formatter:"money"},
+                                    {title:"合价", field:"合价", width:150 , headerSort:false, formatter:"money"},
+                                    {title:"含量", field:"含量", width:150 , headerSort:false, formatter:"textarea"},
+                            ]
+                    });
+                    rcj2Table.current.on("tableBuilt", () => {
+                         rcj2Table.current.replaceData(rcjhl2);
+                       });
+                    }
+
+               if (rcjRef.current != null ) {
+                    
+                         rcjTable.current = new Tabulator(rcjRef.current, {
+                              index: "key",
+                              height: 200,
+                            data: rcjhl, //link data to table
+                            reactiveData: false, //enable data reactivity
+                            dataTreeStartExpanded:false,
+                            dataTree: false,
+                            selectableRows:1, //make rows selectable
+                            editTriggerEvent:"dblclick",
+                            columns: [ //Define Table Columns
+                                         {title:"ID", field:"ID", width:80, headerSort:false, },
+                                         {title:"人材机编码", field:"人材机编码", width:120, headerSort:false, formatter: sparklineFormatter2}, //never hide this column
+                                         {title:"名称", field:"名称", width:120,headerSort:false,  formatter:"textarea", editor: "input", editable: editCheckRcj },
+                                         {title:"规格型号", field:"规格型号", width:80, headerSort:false, editor: "input", editable: editCheckRcj },
+                                         {title:"单位", field:"单位", width:80, headerSort:false, formatter:"textarea"}, //hide this column first
+                                         {title:"单价", field:"单价", width:80 , headerSort:false, formatter: sparklineFormatter, editor: "input", editable: editCheckJg },
+                                         {title:"产地", field:"产地", width:80, headerSort:false, },
+                                         {title:"供应厂商", field:"供应厂商", width:80, headerSort:false, },
+                                         {title:"人材机类别", field:"人材机类别", width:100, headerSort:false, },
+                                         {title:"甲供标志", field:"甲供标志", width:80 , headerSort:false, formatter:"textarea"},
+                                         {title:"含量", field:"含量", width:80 , headerSort:false, formatter:"money", formatterParams:{precision:4}, editor: "input", editable: editCheckRcj },
+                                         {title:"合价", field:"合价", width:80 , headerSort:false, formatter:"money"},
+                                         {title:"暂估价标志", field:"暂估价标志", width:100 , headerSort:false, formatter:"textarea"},
+                                         {title:"主要材料标志", field:"主要材料标志", width:100 , headerSort:false, formatter:"textarea"},
+                                         {title:"主材标志", field:"主材标志", width:80 , headerSort:false, formatter:"textarea"},
+                                         {title:"设备标志", field:"设备标志", width:80 , headerSort:false, formatter:"textarea"},
+                                       
+                                 ]
+                         });
+                         rcjTable.current.on("tableBuilt", () => {
+                              rcjTable.current.replaceData(rcjhl);
+                            });
+                         rcjTable.current.on("cellDblClick", function(e, cell){
+                              //e - the click event object
+                              //cell - cell component
+                              //let determine = !cell._cell.row.getData()['人材机编码'].includes('10000F');
+                              let determine2 = !cell._cell.row.getData()['人材机编码'].includes('000FE'); //azfy
+                              let determine3 = !cell._cell.row.getData()['人材机编码'].startsWith('D'); 
+                              //let determine4 = cell._cell.row.getData()['bc'] != 'true';
+                              if(cell._cell.column.getPosition() == 2  && !isQdrcj.current  && determine2 && determine3 ) {
+                                  tihuanCallback(cell._cell.row.position, cell._cell.column.getPosition());
+                              }
+                          });
+                         rcjTable.current.on("cellEdited", function(cell){
+                              let data =  copy(cell._cell.table.getData());
+                              for(let i = 0; i < data.length; i++) {
+                                   data[i]['合价'] = Number(data[i]['单价']) * Number(data[i]['含量']);
+                              }
+                              setRcjhl(data);
+                              if (rcjTable.current) {
+                                   rcjTable.current.replaceData(data);
+                              }
+                              let data2 = [['ID', '人材机编码', '名称', '规格型号', '单位', '单价', '产地', '供应厂商', '人材机类别', '甲供标志', '含量', '合价', '暂估价标志', '主要材料标志', '主材标志', '设备标志', 'key', 'bc']]
+                              for (let i = 0; i < data.length; i++) {
+                                   data2.push([data[i]['ID'], data[i]['人材机编码'], data[i]['名称'], data[i]['规格型号'], data[i]['单位'], 
+                                   data[i]['单价'], data[i]['产地'], data[i]['供应厂商'], data[i]['人材机类别'], 
+                                   data[i]['甲供标志'], data[i]['含量'], data[i]['合价'], data[i]['暂估价标志'], data[i]['主要材料标志'], data[i]['主材标志'], data[i]['设备标志'], data[i]['key'], data[i]['bc']]);
+                              }
+     
+                              let newData = updateDercj(selectedRowKeysTable.current[0], data2);
+                              myTable.current.deselectRow();
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                              myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function() {
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                              let component = null;
+                              for(let i = 0; i < getRow.length; i++) {
+                                     let entry = getRow[i]._row.modules.dataTree.children;
+                                     for(let j = 0; j < entry.length; j++) {
+                                           let child = entry[j];
+                                           if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                                //console.log(child);
+                                               component = child.component;
+                                                break;
+                                            }
+                                      }
+                              }
+                              component.select();  
+                              //handleSelect(component);
+                              });
+                         });
+                         
+                    }
+          }, [valueTab]
+        );
+
+     const EditableContext = React.createContext({ editingId: null, editingKey: null });
+     const [editingId, setEditingId] = React.useState(null);
+     const [editingKey, setEditingKey] = React.useState(null);
+     const onEdit = (id, dataKey) => {
+          setEditingId(id);
+          setEditingKey(dataKey);
+        };
+
+     const onEditFinished = () => {
+          console.log("edit finidhed");
+          setEditingId(null);
+          setEditingKey(null);
+          onSelectChange(checkedKeys);
+        };
+     const styles = `
+.table-cell-editing .rs-table-cell-content {
+  padding: 4px;
+}
+.table-cell-editing .rs-input {
+  width: 100%;
+}
+.table-cell:focus {
+  outline: none;
+  box-shadow: inset 0 0 0 1px #007bff;
+}
+`;
+
+const fieldMap = {
+     string: Input,
+     number: InputNumber,
+   };
+
+   function focus(ref) {
+     setTimeout(() => {
+       if (ref.current?.tagName === 'INPUT' || ref.current?.getAttribute('tabindex') === '0') {
+         ref.current.focus();
+       } else if (ref.current instanceof HTMLElement) {
+         ref.current.querySelector('input').focus();
+       }
+     }, 10);
+   }
+
+   const handleChangeFuzhuSL = (id, key, value) => {
+     const nextData = Object.assign([], fuzhu);
+     nextData.find(item => item.id === id)[key] = value;
+ 
+     setFuzhu(nextData);
+   };
+
+
+const EditableCell = ({ rowData, dataType, dataKey, onChange, ...props }) => {
+     const { editingId, editingKey, onEdit, onEditFinished } = React.useContext(EditableContext);
+     const editing = rowData.id === editingId && dataKey === editingKey;
+     const Field = fieldMap[dataType];
+     const value = rowData[dataKey];
+     const text = value;
+     const inputRef = React.useRef();
+     const cellRef = React.useRef();
+   
+     const handleEdit = () => {
+          if (fuzhuEnable) {
+             onEdit?.(rowData.id, dataKey);
+             focus(inputRef);
+          }
+     };
+   
+     const handleFinished = () => {
+       onEditFinished();
+       focus(cellRef);
+     };
+   
+     return (
+       <Cell
+         {...props}
+         ref={cellRef}
+         tabIndex={0}
+         className={editing ? 'table-cell-editing' : 'table-cell'}
+         onDoubleClick={handleEdit}
+         
+       >
+         {editing ? (
+           <Field
+             ref={inputRef}
+             defaultValue={value}
+             onBlur={handleFinished}
+             onKeyPress={e => {
+               if (e.key === 'Enter') {
+                 handleFinished();
+               }
+             }}
+             onChange={value => {
+               onChange?.(rowData.id, dataKey, value);
+             }}
+           />
+         ) : (
+           text
+         )}
+       </Cell>
+     );
+   };
+      
+
+    return (
+        <Stack spacing={2}>
+
+                   <Box>
+                   <Stack direction='row' spacing={2}>
+                   <Button variant="outlined" size="small" onClick={() => {
+                      if (selectedRowKeysTable.current.length > 0) {
+                         let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                         let hit = false;
+                         for(let i = 0; i < getRow.length; i++) {
+                              if (getRow[i]._row.data['key'] == selectedRowKeysTable.current[0]) {
+                                   hit = true;
+                              }
+                         }
+                         if (hit) {
+                              suanshiCallback();
+                         }
+                      }
+                      }}
+                   >定额(算式)</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                      if (selectedRowKeysTable.current.length > 0) {
+                         const [success, data] = danxiangdinge(selectedRowKeysTable.current[0]);
+                         if(success) {
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                              myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                                   resetUI();
+                                 });
+                         }
+                      }
+                      }}
+                   >单项定额</Button>
+                      <Button variant="outlined" size="small" onClick={() => {
+                      if (selectedRowKeysTable.current.length > 0) {
+                         let newData = shanchu(selectedRowKeysTable.current[0]);
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                         myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                             //if (newData.filter(x=>x['key'] == selectedRowKeysTable.current[0]).length == 0) {
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                                  resetUI();
+                             //}
+                         });
+                     }
+                      }}
+                   >删除</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                   let newData = undo();
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                   myTable.current.updateData(newData).then(function(){
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                         resetUI();
+                   });
+                      }}
+                   >撤销</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                   let newData = redo();
+                                          let former = myTable.current.element.children[1].scrollTop;
+                                          let former2 = myTable.current.element.children[1].scrollLeft;
+                   myTable.current.updateData(newData).then(function(){
+                                     myTable.current.element.children[1].scrollTop = former;
+                                     myTable.current.element.children[1].scrollLeft = former2;
+                      resetUI();
+                   });
+                      }}
+                   >重做</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                            console.log("save to cloud");
+                            loadingCallback();
+                      
+                      }}
+                   >保存</Button>
+                  
+                   </Stack>
+                   <div style={{width: "70vw"}}>
+                   <div ref={myRef}> 
+                  </div>
+                  </div>
+                  </Box>
+
+                   <Box >
+                   
+                   <TabContext value={valueTab}>
+                       <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
+                         <TabList sx={{minHeight: '24px'}} onChange={handleChange} aria-label="lab API tabs example">
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="人材机含量" value="1" />
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="人材机补充" value="3" />
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="定额附注" value="4" />
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="预拌砂浆" value="5" />
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="组价推荐" value="6" />
+                         </TabList>
+                       </Box>
+                       
+                       <TabPanel sx={{p: 1}} value="1">
+                        <div style={{width:"70vw"}}>
+                       <div ref={rcjRef}></div>
+                       </div>
+                       </TabPanel>
+                       <TabPanel sx={{p: 1}} value="2">
+                       <div ref={rcj2Ref}></div>
+                       </TabPanel>
+                       <TabPanel sx={{p: 1}} value="3">
+                       <Box
+                       sx={{
+                         height: 200,
+                         width: '100%',
+                         '& .actions': {
+                           color: 'text.secondary',
+                         },
+                         '& .textPrimary': {
+                           color: 'text.primary',
+                         },
+                       }}
+                     >
+                       <DataGrid disableColumnMenu disableColumnSorting
+                         hideFooter={true}
+                         rows={rcjrows}
+                         columns={rcjcolumns}
+                         processRowUpdate={processRowUpdate}
+                         slotProps={{
+                           toolbar: { setRcjrows },
+                         }}
+                         slots={{
+                              toolbar: EditToolbar,
+                            }}
+                         
+                         localeText={zhCN_MUI.components.MuiDataGrid.defaultProps.localeText}
+                         onCellDoubleClick={onCellDoubleClick}
+
+                       />
+                     </Box>
+                         </TabPanel>
+                       <TabPanel sx={{p: 1}} value="4">
+                       <Box sx={{maxHeight: `190px`}}>
+                       <CustomProvider locale={zhCN}>
+                       <EditableContext.Provider value={{ editingId, editingKey, onEdit, onEditFinished }}>
+                       <style>{styles}</style>
+                        <Table rowHeight={rowData=>{
+                         return 40;
+                        }}
+                        height={200} data = {fuzhu} id="fuzhu">
+                         <Column width={80} align="center">
+                              <HeaderCell style={{padding: 0}}>
+                                   <div style={{lineHeight: '40px'}}>
+                                        <Checkbox inline checked={checked} indeterminate={indeterminate} onChange={handleCheckAll} disabled={!fuzhuEnable}
+                                        ></Checkbox>
+                                   </div>
+                              </HeaderCell>
+                              <CheckCell dataKey="id" checkedKeys={checkedKeys} onChange={handleCheck} disabled={!fuzhuEnable}></CheckCell>
+                         </Column>
+                         <Column width={80} align="center">
+                              <HeaderCell style={{ "fontSize": "0.875rem" }}>序号</HeaderCell>
+                              <Cell dataKey="序号" style={{ "fontSize": "0.875rem" }}></Cell>
+                         </Column>
+                         <Column width={120} align="center">
+                              <HeaderCell style={{ "fontSize": "0.875rem" }}>编号</HeaderCell>
+                              <Cell dataKey="编号" style={{ "fontSize": "0.875rem" }}></Cell>
+                         </Column>
+                         <Column width={120} align="center">
+                              <HeaderCell style={{ "fontSize": "0.875rem" }}>数量</HeaderCell>
+                              <EditableCell dataKey="数量" dataType="number" style={{ "fontSize": "0.875rem" }} onChange={handleChangeFuzhuSL} />
+                         </Column>
+                         <Column fullText width={650} align="center">
+                              <HeaderCell style={{ "fontSize": "0.875rem" }}>说明</HeaderCell>
+                              <Cell dataKey="说明" style={{ "fontSize": "0.875rem" }}></Cell>
+                         </Column>
+                        </Table>
+                        </EditableContext.Provider>
+                        </CustomProvider>
+                       </Box>
+                       </TabPanel>
+                       <TabPanel sx={{p: 1}} value="5">
+                        <Box sx={{maxHeight: `190px`}}>
+                        <FormControl>
+                         <FormLabel id="demo-controlled-radio-buttons-group">说明</FormLabel>
+                          <RadioGroup
+                           aria-labelledby="demo-controlled-radio-buttons-group"
+                           name="controlled-radio-buttons-group"
+                            value={valueYuban}
+                           onChange={onSelectChange2}
+                         >
+                         <FormControlLabel  disabled = {!yubanEnable} value="0" control={<Radio />} label={
+                                <Typography sx={{fontSize: "0.875rem"}} >无</Typography>
+                            } />
+                         <FormControlLabel disabled = {!yubanEnable} value="1" control={<Radio />} label={
+                                <Typography sx={{fontSize: "0.875rem"}} >湿拌砂浆</Typography>
+                            } />
+                         <FormControlLabel disabled = {!yubanEnable} value="2" control={<Radio />} label={
+                                <Typography sx={{fontSize: "0.875rem"}} >散装干拌(混)砂浆</Typography>
+                            } />
+                         <FormControlLabel disabled = {!yubanEnable} value="3" control={<Radio />} label={
+                                <Typography sx={{fontSize: "0.875rem"}} >袋装干拌(混)砂浆</Typography>
+                            } />
+                         </RadioGroup>
+                         </FormControl>
+                       
+                        </Box>
+                       </TabPanel>
+                       
+                       <TabPanel sx={{p: 1}} value="6">
+                       <div ref={tuijianRef}></div>
+
+                       </TabPanel>
+                     </TabContext>
+                  </Box>
+                  </Stack>
+                  
+
+
+
+
+
+    );
+}

+ 2375 - 0
Service.js

@@ -0,0 +1,2375 @@
+import {copy, danxiangdinge_index, danxiangdinge_index_djcs, renameDingE, extractFuzhu, match_target, azfy, xsazfy, tjazfy, addChildren} from './utils.js';
+import { v4 as uuidv4 } from 'uuid';
+class Service{
+    
+    constructor() {
+        this.footprint = [];
+        this.cache = [];
+        //this.token_ = localStorage.getItem('token');
+        this.memory = [];
+        this.mem_pointer = -1;
+        this.cache_djcs = [];
+        this.memory_djcs = [];
+        this.mem_pointer_djcs = -1;
+        this.qufei = [];
+        this.qufeiEntry = null;
+        this.jiagongcai = [];
+        this.mapper={
+            '99090513' : ['汽车式起重机 50t', 2838.92],
+            '99090509' : ['汽车式起重机 25t', 1174.12],
+            '99090111': ['履带式起重机 提升质量50t', 1755.71],
+            '99090108': ['履带式起重机 提升质量25t', 904.68],
+            '99030306': ['静力压桩机 压力1200kN', 1508.23],
+            '99030124': ['轨道式柴油打桩机 冲击质量2.5t', 1143.91],
+            '99030106' : ['履带式柴油打桩机 冲击质量7t', 2545.82],
+            '10450518' : ['纯铝箔 140×140', 0.35],
+            '10450508' : ['纯银箔 93.3×93.3', 4.5],
+            '04050101' : ['道碴 40~80mm', 47],
+            '04034103' : ['石屑(米砂)', 40]
+        };
+        
+    }
+    setToken(token) {
+       this.token_ = token;
+    }
+    
+    ip() {
+        //return "/api"//return "http://127.0.0.1:8000"
+        return "http://www.xiaozaotongxue.com/api"
+    }
+
+    clearCache() {//set qufei will clear cache
+        this.cache = [];
+        this.footprint= [];
+        this.memory = [];
+        this.mem_pointer = -1;
+        this.cache_djcs = [];
+        this.memory_djcs = [];
+        this.mem_pointer_djcs = -1;
+    }
+
+    setQufei(data) {
+        let result = [];
+        for(let i = 0; i < data[0]['children'].length; i++) {
+            let child = data[0]['children'][i];
+            for(let j = 0; j < child['children'].length; j++) {
+                let grandchild = child['children'][j];
+                //console.log(grandchild);
+                result.push(grandchild);
+            }
+        }
+        this.qufei = result;
+    }
+    setJiagongcai(data) {
+        
+        this.jiagongcai = data;
+    }
+
+    setQufeiEntry(bh) {
+        this.qufeiEntry = this.qufei.filter(x=>x['key'] == bh)[0];
+
+    }
+
+
+    processDjcsmingxi(mingxi) {
+        this.cache_djcs = copy(mingxi);
+        for(let i = 0; i < this.cache_djcs.length; i++) {
+            let zimu = this.cache_djcs[i];
+            if (!zimu.hasOwnProperty("_children")) {
+                zimu["_children"] = [];
+            }
+            if (!zimu.hasOwnProperty("rcj")) {
+                zimu["rcj"] = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]];
+            }
+
+        }
+        for(let i = 0; i < this.cache_djcs.length; i++) {
+            let zimu = this.cache_djcs[i];
+            for(let j = 0; j < zimu["_children"].length; j++) {
+                let de = zimu["_children"][j];
+                if (!de.hasOwnProperty("dercj")) {
+                    de["dercj"] = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                    "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]];
+                }
+            }
+        }
+        this.cache_djcs = this.cache_djcs.map(x=>{
+            //x["children"] = x["__children"];
+
+            x["key"] = x["序号"];
+            x["_children"] = x["_children"].map(y=>{
+                if (!y.hasOwnProperty('key')) {
+                    y['key'] = uuidv4();
+                }
+                return y;
+            })
+            return x;
+        });
+        this.memory_djcs = [];
+        this.memory_djcs.push(copy(this.cache_djcs));
+        this.mem_pointer_djcs = 0;
+
+    }
+
+
+
+    processQingdanmingxi(mingxi) {
+        this.cache = copy(mingxi);
+        for(let i = 0; i < this.cache.length; i++) {
+            let zimu = this.cache[i];
+            if (!zimu.hasOwnProperty("__children")) {
+                zimu["__children"] = [];
+            }
+            if (!zimu.hasOwnProperty("rcj")) {
+                zimu["rcj"] = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]];
+            }
+
+        }
+        for(let i = 0; i < this.cache.length; i++) {
+            let zimu = this.cache[i];
+            for(let j = 0; j < zimu["__children"].length; j++) {
+                let de = zimu["__children"][j];
+                if (!de.hasOwnProperty("dercj")) {
+                    de["dercj"] = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                    "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]];
+                }
+            }
+        }
+        this.cache = this.cache.map(x=>{
+            x["_children"] = x["__children"];
+
+            x["key"] = x["序号"];
+            x["_children"] = x["_children"].map(y=>{
+                if (!y.hasOwnProperty('key')) {
+                    y['key'] = uuidv4();
+                }
+                return y;
+            })
+            return x;
+        });
+        this.memory = [];
+        this.footprint = [];
+        this.memory.push(copy(this.cache));
+        this.mem_pointer = 0;
+
+    }
+   
+
+
+
+
+
+
+
+    async generateRencaijihuizong2(name, id, navigate) {
+        const response = await fetch(this.ip().concat( "/rencaijihuizong2/"), {
+            method : "POST",
+            headers: {
+                "Content-type": "application/json",
+                'Authorization': `Bearer ${this.token_}`
+
+            },
+            body: JSON.stringify({
+                name: name,
+                id: id
+            })
+        });
+        if (!response.ok) {
+            if (response.status == 401) {
+                 navigate("/editor/signin");
+            }
+        } else {
+            const data = await response.json();
+            let result = [];
+            for (let i = 1; i < data.length; i++) {
+                result.push({
+                    'key': uuidv4(),
+                    'ID' : data[i][0],
+                    '编码' : data[i][1],
+                    '名称': data[i][2],
+                    '规格型号' : data[i][3],
+                    '单位' : data[i][4],
+                    '数量' : data[i][5],
+                    '单价' : data[i][6],
+                    '合价' : data[i][7],
+                    '产地' : data[i][8],
+                    '供应厂商' : data[i][9],
+                    '人材机类别' : data[i][10],
+                    '主要材料标志' : data[i][11],
+                    '主材标志' : data[i][12],
+                    '设备标志' : data[i][13],
+                    '甲供标志' : data[i][14],
+                    '暂估价标志' : data[i][15]
+                });
+            }
+            this.setQufeiEntry(id);
+            return result;
+        }
+    }
+
+
+
+
+
+
+   
+
+
+    /////////////////////////////////////qingdan//////////////////////////////////////
+
+    async generateQingdanmingxi(name, bh, bt) {
+        if (bt == 'ALL') {
+            const response = await fetch(this.ip().concat("/qingdanmingxi/"), {
+                method : "POST",
+                headers: {
+                    "Content-type": "application/json",
+                    'Authorization': `Bearer ${this.token_}`
+                },
+                body: JSON.stringify(
+                    {
+                        "bh": bh,
+                        "bt": bt,
+                        "name": name
+                    }
+                )
+            });
+            if (!response.ok) {
+                //const error = await response.json();
+                console.error('error');
+            } else {
+                const data = await response.json();
+                
+                
+                return data;
+            }
+
+        } else {
+        if (this.cache.length == 0 || this.cache[0]["biao_id"] != name || this.cache[0]["Dwgcbh"] != bh || this.cache[0]["bt"] != bt) {
+        const response = await fetch(this.ip().concat("/qingdanmingxi/"), {
+            method : "POST",
+            headers: {
+                "Content-type": "application/json",
+                'Authorization': `Bearer ${this.token_}`
+            },
+            body: JSON.stringify(
+                {
+                    "bh": bh,
+                    "bt": bt,
+                    "name": name
+                }
+            )
+        });
+        if (!response.ok) {
+            //const error = await response.json();
+            console.error('error');
+        } else {
+            const data = await response.json();
+            this.processQingdanmingxi(data);
+            this.setQufeiEntry(bh);
+            return copy(this.cache);
+        }
+        } else {
+            return copy(this.cache);
+        }
+    }
+    }
+
+
+    async generateQingdanrcj(name, bh, bt, bm) {
+        if (bt == "Djcs") {
+            let qd = this.cache_djcs.filter(x=>x["清单编码"] == bm)[0];
+            return copy(qd["rcj"]);
+        }
+        let qd = this.cache.filter(x=>x["清单编码"] == bm)[0];
+        return copy(qd["rcj"]);
+        
+    }
+    async generateDingercj(name, bh, bt, qdbm, debm, danwei, key) {
+        console.log('generateDingercj');
+        console.log(debm);
+        if (bt == 'Djcs') {
+            let qd = this.cache_djcs.filter(x=>x["清单编码"] == qdbm)[0];
+            let de = qd["_children"].filter(x=>x["清单编码"]==debm && x['key'] == key)[0];
+            return [copy(de["dercj"]), de["fuzhuEnable"]];
+        
+        }
+        let qd = this.cache.filter(x=>x["清单编码"] == qdbm)[0];
+        let de = qd["_children"].filter(x=>x["清单编码"]==debm && x['key'] == key)[0];
+        return [copy(de["dercj"]), de["fuzhuEnable"], de['yuban'], de['rcjbc']];
+        
+        
+          
+          
+        
+    }
+
+
+/////////////////////////////end of qingdan////////////////////////////////////
+
+    async generateDjcs(name, bh, navigate) {
+        if (this.cache_djcs.length == 0 || this.cache_djcs[0]["biao_id"] != name || this.cache_djcs[0]["Dwgcbh"] != bh) {
+        const response = await fetch(this.ip().concat( "/djcs/"), {
+            method : "POST",
+            headers: {
+                "Content-type": "application/json",
+                'Authorization': `Bearer ${this.token_}`
+            },
+            body: JSON.stringify(
+                {
+                    "bh": bh,
+                    "name": name
+                }
+            )
+        });
+        if (!response.ok) {
+            if (response.status == 401) {
+               navigate("/editor/signin");
+            }
+        } else {
+            const data = await response.json();
+            this.processDjcsmingxi(data);
+            this.setQufeiEntry(bh);
+            return copy(this.cache_djcs);
+        }
+        } else {
+            return copy(this.cache_djcs);
+        }
+    }
+
+
+
+
+    async save() {
+        const response = await fetch(this.ip().concat( "/save/"), {
+            method : "POST",
+            headers: {
+                "Content-type": "application/json",
+                'Authorization': `Bearer ${this.token_}`
+            },
+            body: JSON.stringify(
+                {
+                    
+                    "name": JSON.stringify(this.cache.filter(x=>this.footprint.includes(x['key'])))
+                }
+            )
+        });
+        if (!response.ok) {
+            //const error = await response.json();
+            console.error('error');
+        } else {
+            const data = await response.json();
+            this.footprint = [];
+            return data;
+        }
+    }
+
+    async save_djcs() {
+        const response = await fetch(this.ip().concat( "/savedjcs/"), {
+            method : "POST",
+            headers: {
+                "Content-type": "application/json",
+                'Authorization': `Bearer ${this.token_}`
+            },
+            body: JSON.stringify(
+                {
+                    
+                    "name": JSON.stringify(this.cache_djcs)
+                }
+            )
+        });
+        if (!response.ok) {
+            //const error = await response.json();
+            console.error('error');
+        } else {
+            const data = await response.json();
+            return data;
+        }
+    }
+
+
+
+    async tiaojia(biao_id, bh, bm, mingcheng, danwei, jiage) {
+        let glf = "";
+        let lr = "";
+        let bz = 0;//changgui
+        if (this.qufeiEntry['备注'].length == 0) {
+            //changuiqufei
+            glf = this.qufeiEntry['管理费(%)'] ;
+            lr = this.qufeiEntry['利润(%)'];
+        } else {
+            glf = this.qufeiEntry['管理费(%)'] ;
+            lr = this.qufeiEntry['利润(%)'];
+            bz = 1;
+        }
+        const response = await fetch(this.ip().concat( "/tiaojia/"), {
+            method : "POST",
+            headers: {
+                "Content-type": "application/json",
+                'Authorization': `Bearer ${this.token_}`
+            },
+            body: JSON.stringify(
+                {
+                    "biao_id": biao_id,
+                    "bh": bh,
+                    "bm": bm,
+                    "mingcheng": mingcheng,
+                    "danwei" : danwei, 
+                    "jiage": jiage,
+                    "glf" : glf,
+                    "lr" : lr,
+                    "bz" : bz
+                }
+            )
+        });
+        if (!response.ok) {
+            //const error = await response.json();
+            console.error('error');
+        } else {
+            const data = await response.json();
+            this.clearCache();
+            return data;
+        }
+    }
+
+
+
+
+
+
+
+    ///////////////////////////////////editor_code//////////////////////////////////
+
+
+    summarize_one_djcs(qd) {///根据定额汇总清单
+        let dict = {};
+        let left = [];
+        for(let i = 0; i < qd["_children"].length; i++) {
+            let de = qd["_children"][i];
+            let desl = Number(de['数量']);
+            let dercj = de['dercj'];
+            for (let j = 1; j < dercj.length; j++) {
+                let hl = copy(dercj[j]);
+                if (hl[1] == '00EXP001' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                if (hl[1] == '99EXP007' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                if (hl[1] == '99EXP022' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                if (hl[1] == '31130104' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                hl[10] = desl * Number(hl[10]);
+                hl[11] = desl * Number(hl[11]);
+                let a = hl[1];//"人材机编码", 
+                let b = a.concat(hl[2]);//"名称", 
+                let c = b.concat(hl[4]);// "单位"
+                if (dict.hasOwnProperty(c)) {
+                    dict[c].push(hl);
+                } else {
+                    dict[c] = [hl];
+                }
+
+            }
+        }
+        let result = [];
+        for(const key in dict) {
+            let list = dict[key];
+            let sum = 0;
+            let danjia = Number(list[0][5]);
+            for (let i =0 ;i < list.length; i++) {
+                sum += Number(list[i][10]);
+            }
+            let entry = [list[0][0], list[0][1], list[0][2], list[0][3], list[0][4], danjia,
+             list[0][6], list[0][7], list[0][8], list[0][9], sum, sum * danjia, list[0][12],
+             list[0][13], list[0][14], list[0][15]
+             ];
+             result.push(entry);
+
+        }
+        for (let i = 0; i < left.length; i++) {
+            result.push(left[i]);
+        }
+        let gongri = 0;
+        for(let i = 0; i < result.length; i++) {
+            if (result[i][4] == '工日') {
+                gongri += result[i][10];
+            }
+        }
+        result.sort((a, b) => Number(a[8]) - Number(b[8]));
+        qd['rcj'] = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+        "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]].concat(result);
+        qd["综合人工工日"] = gongri;
+        qd['综合单价'] = 0;
+        qd['合价'] = 0;
+        qd['人工费'] = 0;
+        qd['主材费'] = 0;
+        qd['设备费'] = 0;
+        qd['辅材费'] = 0;
+        qd['材料费'] = 0;
+        qd['机械费'] = 0;
+        qd['管理费'] = 0;
+        qd['利润'] = 0;
+        for(let i = 0; i < qd["_children"].length; i++) {
+            qd['综合单价'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['综合单价']);
+            qd['合价'] += Number(qd['_children'][i]['合价']);
+            qd['人工费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['人工费']);
+            qd['主材费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['主材费']);
+            qd['设备费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['设备费']);
+            qd['辅材费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['辅材费']);
+            qd['材料费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['材料费']);
+            qd['机械费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['机械费']);
+            qd['管理费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['管理费']);
+            qd['利润'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['利润']);   
+        }
+
+        return qd;
+    }
+
+
+    summarize_one(qd) {///根据定额汇总清单
+        qd['综合单价'] = 0;
+        qd['合价'] = 0;
+        qd['人工费'] = 0;
+        qd['主材费'] = 0;
+        qd['设备费'] = 0;
+        qd['辅材费'] = 0;
+        qd['材料费'] = 0;
+        qd['机械费'] = 0;
+        qd['管理费'] = 0;
+        qd['利润'] = 0;
+        for(let i = 0; i < qd["_children"].length; i++) {
+            if (qd["_children"][i]['azfytag'].length > 0)continue;
+            qd['综合单价'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['综合单价']);
+            qd['合价'] += Number(qd['_children'][i]['合价']);
+            qd['人工费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['人工费']);
+            qd['主材费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['主材费']);
+            qd['设备费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['设备费']);
+            qd['辅材费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['辅材费']);
+            qd['材料费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['材料费']);
+            qd['机械费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['机械费']);
+            qd['管理费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['管理费']);
+            qd['利润'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['利润']);   
+        }
+        //处理安装费用
+        //console.log(qd["_children"].length);
+        for(let i = 0; i < qd["_children"].length; i++) {
+            //console.log(i);
+            if (qd["_children"][i]['azfytag'].length > 0){
+                let tag = qd["_children"][i]['azfytag'];
+                if (tag[0] == '人工费') {
+                   let current_rgf = qd['人工费'];
+                   let added = Number(current_rgf) * Number(tag[1]) / Number(100);
+                   let added_rgf = added * Number(tag[2]) / Number(100);
+                   let added_clf = added * Number(tag[3]) / Number(100);
+                   let added_jxf = added * Number(tag[4]) / Number(100);
+                   qd["_children"][i]['人工费'] = added_rgf;
+                   qd["_children"][i]['辅材费'] = added_clf;
+                   qd["_children"][i]['材料费'] = added_clf;
+                   qd["_children"][i]['机械费'] = added_jxf;
+                   if (this.qufeiEntry['备注'].length == 0) {
+                       //changuiqufei
+                       qd["_children"][i]['管理费'] = (added_rgf + added_jxf) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                       qd["_children"][i]['利润'] = (added_rgf + added_jxf) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                   } else {
+                       qd["_children"][i]['管理费'] = (added_rgf) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                       qd["_children"][i]['利润'] = (added_rgf) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                   }
+                   
+                   qd["_children"][i]['综合单价'] = qd["_children"][i]['人工费'] + qd["_children"][i]['材料费'] + qd["_children"][i]['机械费'] + qd["_children"][i]['管理费'] +  qd["_children"][i]['利润'];
+                   qd["_children"][i]['合价'] = qd["_children"][i]['综合单价'] * Number(qd["_children"][i]['数量']) * Number(qd['数量']);
+                   let dercj = qd["_children"][i]['dercj'];
+                   for (let j = 1; j < dercj.length; j++) {
+                       dercj[j][11] = Number(added) * Number(dercj[j][10]) / Number(100);
+                   }
+                }
+                if (tag[0] == '人工费+机械费') {
+                   let current_rgf = qd['人工费'] + qd['机械费'];
+                   let added = Number(current_rgf) * Number(tag[1]) / Number(100);
+                   let added_rgf = added * Number(tag[2]) / Number(100);
+                   let added_clf = added * Number(tag[3]) / Number(100);
+                   let added_jxf = added * Number(tag[4]) / Number(100);
+                   qd["_children"][i]['人工费'] = added_rgf;
+                   qd["_children"][i]['辅材费'] = added_clf;
+                   qd["_children"][i]['材料费'] = added_clf;
+                   qd["_children"][i]['机械费'] = added_jxf;
+                   if (this.qufeiEntry['备注'].length == 0) {
+                       //changuiqufei
+                       qd["_children"][i]['管理费'] = (added_rgf + added_jxf) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                       qd["_children"][i]['利润'] = (added_rgf + added_jxf) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                   } else {
+                       qd["_children"][i]['管理费'] = (added_rgf) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                       qd["_children"][i]['利润'] = (added_rgf) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                   }
+                   
+                   qd["_children"][i]['综合单价'] = qd["_children"][i]['人工费'] + qd["_children"][i]['材料费'] + qd["_children"][i]['机械费'] + qd["_children"][i]['管理费'] +  qd["_children"][i]['利润'];
+                   qd["_children"][i]['合价'] = qd["_children"][i]['综合单价'] * Number(qd["_children"][i]['数量']) * Number(qd["数量"]);
+                   let dercj = qd["_children"][i]['dercj'];
+                   for (let j = 1; j < dercj.length; j++) {
+                       
+                       dercj[j][11] = Number(added) * Number(dercj[j][10]) / Number(100);
+                       
+                   }
+                }
+            }
+        }
+        qd['综合单价'] = 0;
+        qd['合价'] = 0;
+        qd['人工费'] = 0;
+        qd['主材费'] = 0;
+        qd['设备费'] = 0;
+        qd['辅材费'] = 0;
+        qd['材料费'] = 0;
+        qd['机械费'] = 0;
+        qd['管理费'] = 0;
+        qd['利润'] = 0;
+        for(let i = 0; i < qd["_children"].length; i++) {
+            qd['综合单价'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['综合单价']);
+            qd['合价'] += Number(qd['_children'][i]['合价']);
+            qd['人工费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['人工费']);
+            qd['主材费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['主材费']);
+            qd['设备费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['设备费']);
+            qd['辅材费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['辅材费']);
+            qd['材料费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['材料费']);
+            qd['机械费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['机械费']);
+            qd['管理费'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['管理费']);
+            qd['利润'] += Number(qd['_children'][i]['数量']) * Number(qd['_children'][i]['利润']);   
+        }
+        let dict = {};
+        let left = [];
+        for(let i = 0; i < qd["_children"].length; i++) {
+            let de = qd["_children"][i];
+            let desl = Number(de['数量']);
+            let dercj = de['dercj'];
+            for (let j = 1; j < dercj.length; j++) {
+                let hl = copy(dercj[j]);
+                if (hl[1].includes('000FE') && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                if (hl[1] == '00EXP001' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                if (hl[1] == '99EXP007' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                if (hl[1] == '99EXP022' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                if (hl[1] == '31130104' && hl[4] == '%') {
+                    left.push(hl);
+                    continue;
+                }
+                hl[10] = desl * Number(hl[10]);
+                hl[11] = desl * Number(hl[11]);
+                let a = hl[1];//"人材机编码", 
+                let b = a.concat(hl[2]);//"名称", 
+                let c = b.concat(hl[4]);// "单位"
+                if (dict.hasOwnProperty(c)) {
+                    dict[c].push(hl);
+                } else {
+                    dict[c] = [hl];
+                }
+
+            }
+        }
+        let result = [];
+        for(const key in dict) {
+            let list = dict[key];
+            let sum = 0;
+            let danjia = Number(list[0][5]);
+            for (let i =0 ;i < list.length; i++) {
+                sum += Number(list[i][10]);
+            }
+            let entry = [list[0][0], list[0][1], list[0][2], list[0][3], list[0][4], danjia,
+             list[0][6], list[0][7], list[0][8], list[0][9], sum, sum * danjia, list[0][12],
+             list[0][13], list[0][14], list[0][15]
+             ];
+             result.push(entry);
+
+        }
+        for (let i = 0; i < left.length; i++) {
+            result.push(left[i]);
+        }
+        let gongri = 0;
+        for(let i = 0; i < result.length; i++) {
+            if (result[i][4] == '工日') {
+                gongri += result[i][10];
+            }
+        }
+        result.sort((a, b) => Number(a[8]) - Number(b[8]));
+        qd['rcj'] = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+        "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]].concat(result);
+        qd["综合人工工日"] = gongri;
+        return qd;
+    }
+    summarize(data) {
+        return data.map(x=>this.summarize_one(x));
+    }
+
+    summarize_djcs(data) {
+        return data.map(x=>this.summarize_one_djcs(x));
+    }
+
+    push_op(newData) {
+        if(this.memory.length == this.mem_pointer + 1) {
+            this.memory.push(copy(newData));
+            this.mem_pointer = this.mem_pointer + 1;
+       } else{
+            this.memory.splice(this.mem_pointer + 1);
+            this.memory.push(copy(newData));
+            this.mem_pointer = this.mem_pointer + 1; 
+    
+       }
+    }
+
+    push_op_djcs(newData) {
+        if(this.memory_djcs.length == this.mem_pointer_djcs + 1) {
+            this.memory_djcs.push(copy(newData));
+            this.mem_pointer_djcs = this.mem_pointer_djcs + 1;
+       } else{
+            this.memory_djcs.splice(this.mem_pointer_djcs + 1);
+            this.memory_djcs.push(copy(newData));
+            this.mem_pointer_djcs = this.mem_pointer_djcs + 1; 
+    
+       }
+    }
+
+    undo() {
+        if (this.mem_pointer > 0) {
+            
+            let newData = this.memory[this.mem_pointer - 1];
+            this.mem_pointer = this.mem_pointer - 1;
+            this.cache = copy(newData);
+            return copy(newData);
+           
+        }
+
+        return copy(this.cache);
+    }
+
+    undo_djcs() {
+        if (this.mem_pointer_djcs > 0) {
+            
+            let newData = this.memory_djcs[this.mem_pointer_djcs - 1];
+            this.mem_pointer_djcs = this.mem_pointer_djcs - 1;
+            this.cache_djcs = copy(newData);
+            return copy(newData);
+           
+        }
+
+        return copy(this.cache_djcs);
+    }
+    
+    redo() {
+        if (this.mem_pointer + 1 != this.memory.length) {
+            let newData = this.memory[this.mem_pointer + 1];
+            this.mem_pointer = this.mem_pointer + 1;
+            this.cache = copy(newData);
+            return copy(newData);
+            }
+
+        return copy(this.cache);
+    }
+
+    redo_djcs() {
+        if (this.mem_pointer_djcs + 1 != this.memory_djcs.length) {
+            let newData = this.memory_djcs[this.mem_pointer_djcs + 1];
+            this.mem_pointer_djcs = this.mem_pointer_djcs + 1;
+            this.cache_djcs = copy(newData);
+            return copy(newData);
+            }
+
+        return copy(this.cache_djcs);
+    }
+
+    shanchu_djcs(key) {
+        if (this.cache_djcs.filter(x=>x['key'] == key).length > 0) {
+            ///qd
+            let newData = this.cache_djcs.map(x=>{
+                if (x["key"] == key) {
+                    let y = copy(x);
+                    
+                    y["_children"] = [];
+                    return y;
+                } else {
+                    return x;
+                }
+            });
+            let summarized = this.summarize_djcs(newData);
+            this.push_op_djcs(summarized);
+             /////////////////
+            this.cache_djcs = copy(summarized);
+            return copy(this.cache_djcs);
+
+        } else {
+            let qd = this.cache_djcs.filter(x=>x["_children"].filter(y=>y['key'] == key).length > 0)[0];
+            let qdbm = qd['清单编码'];
+            let newData = this.cache_djcs.map(x=>{
+                if (x["清单编码"] == qdbm) {
+                    let y = copy(x);
+                    let origin = y["_children"];
+                    let trans = origin.filter(z=>z["key"]!=key);
+                    y["_children"] = trans;
+                    return y;
+                } else {
+                    return x;
+                }
+            });
+            let summarized = this.summarize_djcs(newData);
+            this.push_op_djcs(summarized);
+            /////////////////
+            this.cache_djcs = copy(summarized);
+            return copy(this.cache_djcs);
+        }
+        
+        
+
+
+    }
+    updateFootprint(key) {
+        if (this.footprint.includes(key)) {
+
+        } else {
+            this.footprint.push(key);
+        }
+    }
+
+    shanchu(key) {
+        if (this.cache.filter(x=>x['key'] == key).length > 0) {
+            this.updateFootprint(key);
+            ///qd
+            let newData = this.cache.map(x=>{
+                if (x["key"] == key) {
+                    let y = copy(x);
+                    
+                    y["_children"] = [];
+                    return y;
+                } else {
+                    return x;
+                }
+            });
+            let summarized = this.summarize(newData);
+            this.push_op(summarized);
+             /////////////////
+             this.cache = copy(summarized);
+            return copy(this.cache);
+
+        } else {
+            let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key'] == key).length > 0)[0];
+            this.updateFootprint(qd['key']);
+            let qdbm = qd['清单编码'];
+            let newData = this.cache.map(x=>{
+                if (x["清单编码"] == qdbm) {
+                    let y = copy(x);
+                    let origin = y["_children"];
+                    let trans = origin.filter(z=>z["key"]!=key);
+                    y["_children"] = trans;
+                    return y;
+                } else {
+                    return x;
+                }
+            });
+            let summarized = this.summarize(newData);
+            this.push_op(summarized);
+            /////////////////
+            this.cache = copy(summarized);
+            return copy(this.cache);
+        }
+        
+        
+
+
+    }
+
+    //没有预拌砂浆,没有补充
+    updateDercj_djcs_(row, data, xuhao, mode=0/**0->update by view; 1-> config change */) {///change 一条定额 inplace, 汇总一条定额的rcj, xuhao is for rename
+        console.log("data updated");
+        //处理附注
+        let huan = false;
+        let qd = this.cache_djcs.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        if (de.hasOwnProperty("rcjdg")) {//新数据
+            de['dercj'] = copy(de['rcjdg']);
+
+            if (de.hasOwnProperty('fuzhu')) {//
+                
+                for(let j = 1; j < de['rcjdg'].length; j++) {
+                    let origin = Number(de['rcjdg'][j][10]);
+                    let bianhao_huan = '';
+                    let name_huan = '';
+                    let new_jia = 0;
+                    for(let i = 0; i < de['fuzhu'].length; i++) {
+                        let selected = de['fuzhu'][i];//selected is 结构化的处理信息
+                        let target = selected[0];
+                        
+                        
+                        if (match_target(de['rcjdg'][j][1], de['rcjdg'][j][2], target, selected[1])) {
+                            if (selected[2] == '系数' || selected[2] == '商品砼系数' || selected[2] == '除此机械外') {
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+
+                            } else if (selected[2] == '含量' || selected[2] == '商品砼含量') {
+                                origin = Number(selected[3]);
+                            } else if (selected[2] == '调整' || selected[2] == '商品砼调整') {
+                                origin = origin + Number(selected[3]) * Number(selected[5]);
+                            } else if (selected[2] == '调比') {
+                                origin = origin + Number(selected[3]) * Number(selected[5]) / Number(100);
+                            } else if (selected[2] == '次方') {
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+                            } else if (selected[2] == '叠加备注') {
+
+                            } else if (selected[2] == '换机械系数') {
+                                bianhao_huan = selected[4];
+                                name_huan = this.mapper[bianhao_huan][0];
+                                new_jia = this.mapper[bianhao_huan][1];
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+                            } else if (selected[2] == '换材料系数') {
+                                bianhao_huan = selected[4];
+                                name_huan = this.mapper[bianhao_huan][0];
+                                new_jia = this.mapper[bianhao_huan][1];
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+                            } else if (selected[2] == '使用泵送') {
+                                if (de['rcjdg'][j][2].includes('C20')) {
+                                    bianhao_huan = '80212103';
+                                    name_huan = '(C20泵送商品砼)';
+                                    new_jia = 342;
+                                }
+                                if (de['rcjdg'][j][2].includes('C30')) {
+                                    bianhao_huan = '80212105';
+                                    name_huan = '(C30泵送商品砼)';
+                                    new_jia = 362;
+                                }
+
+                            } else if (selected[2] == '使用非泵送') {
+                                if (de['rcjdg'][j][2].includes('C20')) {
+                                    bianhao_huan = '80212115';
+                                    name_huan = '(C20非泵送商品砼)';
+                                    new_jia = 333;
+                                }
+                                if (de['rcjdg'][j][2].includes('C30')) {
+                                    bianhao_huan = '80212117';
+                                    name_huan = '(C30非泵送商品砼)';
+                                    new_jia = 353;
+                                }
+                            }
+                            else {
+                                throw new Error('无法处理的附注'.concat(selected[2]));
+                            }
+                            
+                        }
+                        
+
+                    }
+                            
+                    if (bianhao_huan == '') {
+                                
+                    } else {
+                                de['dercj'][j][1] = bianhao_huan;//编号
+                                de['dercj'][j][2] = name_huan;//mc
+                                de['dercj'][j][5] = new_jia;//jiage
+                    }
+                                        
+                    de['dercj'][j][10] =  origin;
+                    de['dercj'][j][11] = Number(de['dercj'][j][5]) * origin;
+                }
+
+            }
+            
+            
+            for(let j = 1; j < de['dercj'].length; j++) {
+                    for (let k = 0; k < data.length; k++) {
+                        if (data[k][16] == de['dercj'][j][16]) {
+                            if (de['dercj'][j][2] == data[k][2]) {//名称
+                                
+                            } else {
+                                huan = true;
+                            }
+                            
+                        }
+                    }        
+            }
+            
+
+            if (mode == 1) {
+                data = de['dercj'];
+                huan = false;
+            } else {
+                de['dercj'] = copy(data);
+                data = de['dercj'];
+            }
+        
+
+            
+            
+        } else {////单项定额没有底稿,老数据没底搞,无法判断换部换,暂时统一认为不换
+            //强行改含量
+            de['dercj'] = copy(data);
+            data = de['dercj'];
+        }
+        //模拟formula计算每一行的合价
+        for(let i = 1; i < data.length; i++) {
+            data[i][11] = Number(data[i][10]) * Number(data[i][5]);
+        }
+        //if (data[0].length > 18)
+        //data = data.filter(x=>x[18]!='true').map(x=>[x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16]]);
+              
+        let sum = 0;
+        let rgf_sum = 0;
+        let jxf_sum = 0;
+        let clf_sum = 0;
+        let zcf_sum = 0;
+        for(let i = 1; i < data.length; i++) {
+            if (data[i][1]=='00EXP001' && data[i][4] == '%'){//回程费占人工费
+                continue;    
+            }
+            if (data[i][1]=='99EXP007' && data[i][4] == '%'){//回程费占机械费
+                continue;    
+            }
+            if (data[i][1]=='99EXP022' && data[i][4] == '%'){//回程费占机械费
+                continue;    
+            }
+            if (data[i][1]=='31130104' && data[i][4] == '%'){//回程费占材料费
+                continue;    
+            }
+            sum += Number(data[i][11]);//11-> hejia
+            if (Number(data[i][8]) == 1) {
+                rgf_sum += Number(data[i][11]);
+            }
+            if (Number(data[i][8]) == 2) {
+                clf_sum += Number(data[i][11]);
+                if (data[i][14] == 'true') {
+                    zcf_sum += Number(data[i][11]);
+                }
+            }
+            if (Number(data[i][8]) == 3) {
+                jxf_sum += Number(data[i][11]);
+            }
+        }
+        console.log("sum=".concat(sum));
+        //处理百分比费用
+        for(let i = 1; i < data.length; i++) {
+            if (data[i][1]=='00EXP001' && data[i][4] == '%'){//回程费占人工费
+                data[i][11] = Number(data[i][10]) * rgf_sum / Number(100);   
+            }
+            if (data[i][1]=='99EXP007' && data[i][4] == '%'){//回程费占机械费
+                data[i][11] = Number(data[i][10]) * jxf_sum / Number(100);    
+            }
+            if (data[i][1]=='99EXP022' && data[i][4] == '%'){//回程费占机械费
+                data[i][11] = Number(data[i][10]) * jxf_sum / Number(100);    
+            }
+            if (data[i][1]=='31130104' && data[i][4] == '%'){//回程费占材料费
+                data[i][11] = Number(data[i][10]) * clf_sum / Number(100);    
+            }
+
+        }
+        sum = 0;
+        rgf_sum = 0;
+        jxf_sum = 0;
+        clf_sum = 0;
+        zcf_sum = 0;
+        for(let i = 1; i < data.length; i++) {
+            sum += Number(data[i][11]);//11-> hejia
+            if (Number(data[i][8]) == 1) {
+                rgf_sum += Number(data[i][11]);
+            }
+            if (Number(data[i][8]) == 2) {
+                clf_sum += Number(data[i][11]);
+                if (data[i][14] == 'true') {
+                    zcf_sum += Number(data[i][11]);
+                }
+            }
+            if (Number(data[i][8]) == 3) {
+                jxf_sum += Number(data[i][11]);
+            }
+        }
+
+        
+        let shuliang = Number(qd['数量']);
+        for(let i = 0; i< qd["_children"].length; i++) {
+            if(qd["_children"][i]['key'] == row) {
+                let desl = Number(qd["_children"][i]['数量']);
+                let oldname = qd["_children"][i]['清单编码'];
+                
+                qd["_children"][i]['辅材费'] = clf_sum - zcf_sum;
+                qd["_children"][i]['材料费'] = clf_sum;
+                qd["_children"][i]['人工费'] = rgf_sum;
+                qd["_children"][i]['主材费'] = zcf_sum;
+                qd["_children"][i]['设备费'] = 0;
+                qd["_children"][i]['机械费'] = jxf_sum;
+                if (oldname.startsWith("D")) {//单项清单
+                    qd["_children"][i]['管理费'] = 0;
+                    qd["_children"][i]['利润'] = 0;
+                } else {
+                    if (this.qufeiEntry['备注'].length == 0) {
+                        //changuiqufei
+                        qd["_children"][i]['管理费'] = (rgf_sum + jxf_sum) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                        qd["_children"][i]['利润'] = (rgf_sum + jxf_sum) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                    } else {
+                        qd["_children"][i]['管理费'] = (rgf_sum) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                        qd["_children"][i]['利润'] = (rgf_sum) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                    }
+                }
+                qd["_children"][i]['综合单价'] = sum + qd["_children"][i]['管理费'] + qd["_children"][i]['利润'];
+                qd["_children"][i]['合价'] = (qd["_children"][i]['综合单价'] * shuliang * desl);
+                
+                
+                
+                qd["_children"][i]["dercj"] = this.handleJGC(copy(data));
+                qd["_children"][i]['清单编码'] = renameDingE(oldname, xuhao, huan);
+
+            }
+        }
+    }
+
+
+    updateDercj_(row, data, xuhao, yuban, rcjbc, mode=0) {///change 一条定额 inplace, 汇总一条定额的rcj, xuhao is for rename, yuban is 预拌砂浆
+        console.log("data updated");
+        //处理附注
+        let huan = false;//换
+        let data_normal = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+        "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ]];//正常部分,不包括补充
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        if (de.hasOwnProperty("rcjdg")) {//新数据
+            de['dercj'] = copy(de['rcjdg']);
+            if (de.hasOwnProperty('fuzhu')) {//没强行改过含量
+                for(let j = 1; j < de['rcjdg'].length; j++) {
+                    let origin = Number(de['rcjdg'][j][10]);
+                    let bianhao_huan = '';
+                    let name_huan = '';
+                    let new_jia = 0;
+                    for(let i = 0; i < de['fuzhu'].length; i++) {
+                        let selected = de['fuzhu'][i];//selected is 结构化的处理信息
+                        let target = selected[0];
+                        if (match_target(de['rcjdg'][j][1], de['rcjdg'][j][2], target, selected[1])) {
+                            if (selected[2] == '系数' || selected[2] == '商品砼系数' || selected[2] == '除此机械外') {
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+
+                            } else if (selected[2] == '含量' || selected[2] == '商品砼含量') {
+                                origin = Number(selected[3]);
+                            } else if (selected[2] == '调整' || selected[2] == '商品砼调整') {
+                                origin = origin + Number(selected[3]) * Number(selected[5]);
+                            } else if (selected[2] == '调比') {
+                                origin = origin + Number(selected[3]) * Number(selected[5]) / Number(100);
+                            } else if (selected[2] == '次方') {
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+                            } else if (selected[2] == '叠加备注') {
+
+                            } else if (selected[2] == '换机械系数') {
+                                bianhao_huan = selected[4];
+                                name_huan = this.mapper[bianhao_huan][0];
+                                new_jia = this.mapper[bianhao_huan][1];
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+                            } else if (selected[2] == '换材料系数') {
+                                bianhao_huan = selected[4];
+                                name_huan = this.mapper[bianhao_huan][0];
+                                new_jia = this.mapper[bianhao_huan][1];
+                                origin = origin * (Number(selected[3]) ** Number(selected[5]));
+                            } else if (selected[2] == '使用泵送') {
+                                if (de['rcjdg'][j][2].includes('C20')) {
+                                    bianhao_huan = '80212103';
+                                    name_huan = '(C20泵送商品砼)';
+                                    new_jia = 342;
+                                }
+                                if (de['rcjdg'][j][2].includes('C30')) {
+                                    bianhao_huan = '80212105';
+                                    name_huan = '(C30泵送商品砼)';
+                                    new_jia = 362;
+                                }
+
+                            } else if (selected[2] == '使用非泵送') {
+                                if (de['rcjdg'][j][2].includes('C20')) {
+                                    bianhao_huan = '80212115';
+                                    name_huan = '(C20非泵送商品砼)';
+                                    new_jia = 333;
+                                }
+                                if (de['rcjdg'][j][2].includes('C30')) {
+                                    bianhao_huan = '80212117';
+                                    name_huan = '(C30非泵送商品砼)';
+                                    new_jia = 353;
+                                }
+                            }
+                            else {
+                                throw new Error('无法处理的附注'.concat(selected[2]));
+                            }    
+                        }
+                    }       
+                    if (bianhao_huan == '') {
+                                
+                    } else {
+                                de['dercj'][j][1] = bianhao_huan;//编号
+                                de['dercj'][j][2] = name_huan;//mc
+                                de['dercj'][j][5] = new_jia;//jiage
+                    }                  
+                    de['dercj'][j][10] =  origin;
+                    de['dercj'][j][11] = Number(de['dercj'][j][5]) * origin;
+                }
+            }
+            //基于底稿判断换
+            for(let j = 1; j < de['dercj'].length; j++) {
+                for (let k = 0; k < data.length; k++) {
+                    if (data[k][16] == de['dercj'][j][16]) {
+                        let datak2 = data[k][2];
+                        if (datak2.includes('(湿拌砂浆)')) {
+                            datak2 = datak2.replace('(湿拌砂浆)', '');
+                        }
+                        if (datak2.includes('(干拌(混)砂浆)')) {
+                            datak2 = datak2.replace('(干拌(混)砂浆)', '');
+                        }
+                        if (de['dercj'][j][2] == datak2) {//名称
+                            
+                        } else {
+                            huan = true;
+                        }    
+                    }
+                }        
+            }
+            if (mode == 1) {
+                data_normal = de['dercj'];
+                huan = false;
+            } else {
+                data_normal = copy(data.filter(x=>x[17] != 'true'));
+            }
+        } else {////单项定额没有底稿,老数据没底搞,无法判断换部换,暂时统一认为不换
+            //强行改含量
+            data_normal = copy(data.filter(x=>x[17] != 'true'));
+            //data = de['dercj'];
+        }
+
+        //处理补充
+        for(let i = 0; i < rcjbc.length; i++) {
+            data_normal.push(['', rcjbc[i]['人材机编码'], rcjbc[i]['名称'], rcjbc[i]['规格型号'], rcjbc[i]['单位'], rcjbc[i]['单价'], rcjbc[i]['产地'], rcjbc[i]['供应厂商'], rcjbc[i]['人材机类别'], rcjbc[i]['甲供标志'], rcjbc[i]['含量'], '', rcjbc[i]['暂估价标志'],rcjbc[i]['主要材料标志'],rcjbc[i]['主材标志'],rcjbc[i]['设备标志'], rcjbc[i]['id'], 'true']);
+            for (let k = 0; k < data.length; k++) {
+                if (data[k][16] == rcjbc[i]['id']) {
+                    let datak2 = data[k][2];
+                    if (datak2.includes('(湿拌砂浆)')) {
+                        datak2 = datak2.replace('(湿拌砂浆)', '');
+                    }
+                    if (datak2.includes('(干拌(混)砂浆)')) {
+                        datak2 = datak2.replace('(干拌(混)砂浆)', '');
+                    }
+                    if (rcjbc[i]['名称'] == datak2) {//名称
+                        
+                    } else {
+                        if (mode == 2) {
+            
+                        } else {
+                            huan = true;
+                        }
+                    }    
+                }
+            }  
+        }
+
+        if (yuban.length > 0) {//处理预拌砂浆
+            if (yuban.includes('1')) {//与换无关
+                for(let i = 1; i < data_normal.length; i++) {
+                    if (data_normal[i][4]=='工日') {
+                        data_normal[i][10] = Number(data_normal[i][10]) - 0.45;
+                    }
+                    if (data_normal[i][2].includes('搅拌机')) {
+                        data_normal[i][10] = 0;
+                    }
+                    if (data_normal[i][2].includes('砂浆') && !data_normal[i][2].includes('搅拌机')) {
+                        data_normal[i][2] = data_normal[i][2].concat('(湿拌砂浆)')
+                    }
+                }
+                if (mode == 0) {
+                    data_normal  = copy(data);
+                } else if (mode == 1) {
+                    //data_normal = data_normal.filter(x=>x[17]!='true');
+                    //data_normal = data_normal.concat(data.filter(x=> x[17] == 'true'));
+                } else if (mode == 2) {
+                    let data_normal_2 = copy(data_normal);
+                    data_normal = data.filter(x=>x[17]!='true');
+                    data_normal = data_normal.concat(data_normal_2.filter(x=> x[17] == 'true'));
+                }
+
+            } else if (yuban.includes('2')) {//与换无关
+                
+                let added = [];
+                for(let i = 1; i < data_normal.length; i++) {
+                  let origin = 0;
+                  if (data_normal[i][4]=='工日') {
+                    data_normal[i][10] = Number(data_normal[i][10]) - 0.3;
+                  }
+                  if (data_normal[i][2].includes('搅拌机')) {
+                    data_normal[i][10] = 0;
+                  }
+                  if (data_normal[i][2].includes('砂浆') && !data_normal[i][2].includes('搅拌机')) {
+                    data_normal[i][2] = data_normal[i][2].concat('(干拌(混)砂浆)');
+                    origin = Number(data_normal[i][10]); 
+                    data_normal[i][10] = origin * 1.75;
+                    added.push(['', 'S00001', '水', '', 't', '4.70', '', '', '2', 'false', (origin * 0.29).toString(), ''/**hj */, ''/**zgj */,''/**zycl */,''/**zc */,''/**sb */,'',data_normal[i][17]]);
+                    added.push(['', 'JD0001', '其他机械费(电)', '', '度', '0.65', '', '', '3', 'false', (origin * 2.15).toString(), ''/**hj */, ''/**zgj */,''/**zycl */,''/**zc */,''/**sb */, '',data_normal[i][17]]);
+    
+                  }
+
+                }
+                data_normal = data_normal.concat(added);
+                if (mode == 0) {
+                    data_normal  = copy(data);
+                } else if (mode == 1) {
+                    //data_normal = data_normal.filter(x=>x[17]!='true');
+                    //data_normal = data_normal.concat(data.filter(x=> x[17] == 'true'));
+                } else if (mode == 2) {
+                    let data_normal_2 = copy(data_normal);
+                    data_normal = data.filter(x=>x[17]!='true');
+                    data_normal = data_normal.concat(data_normal_2.filter(x=> x[17] == 'true'));
+                }
+
+
+            } else if (yuban.includes('3')) {//与换无关
+                let added = [];
+                for(let i = 1; i < data_normal.length; i++) {
+                  let origin = 0;
+                  if (data_normal[i][4]=='工日') {
+                    data_normal[i][10] = Number(data_normal[i][10]) - 0.2;
+                  } 
+                  if (data_normal[i][2].includes('砂浆') && !data_normal[i][2].includes('搅拌机')) {
+                    data_normal[i][2] = data_normal[i][2].concat('(干拌(混)砂浆)');
+                    origin = Number(data_normal[i][10]); 
+                    data_normal[i][10] = origin * 1.75;
+                    added.push(['', 'S00001', '水', '', 't', '4.70', '', '', '2', 'false', (origin * 0.29).toString(), '', '','','','','',data_normal[i][17]]);
+
+                  }
+                }
+                data_normal = data_normal.concat(added);
+                if (mode == 0) {
+                    data_normal  = copy(data);
+                } else if (mode == 1) {
+                    //data_normal = data_normal.filter(x=>x[17]!='true');
+                    //data_normal = data_normal.concat(data.filter(x=> x[17] == 'true'));
+                } else if (mode == 2) {
+                    let data_normal_2 = copy(data_normal);
+                    data_normal = data.filter(x=>x[17]!='true');
+                    data_normal = data_normal.concat(data_normal_2.filter(x=> x[17] == 'true'));
+                }
+
+
+            } else {
+                let data_normal_2 = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+            "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ]];
+                for(let i = 1; i < data_normal.length; i++) {
+                    let bc = data_normal[i][17];
+                    let child = addChildren(10, data_normal[i][1], data_normal[i][10], data_normal[i][17], data_normal[i][16]);
+                    if (child.length > 0) {
+
+                    } else {
+                        child = addChildren(40, data_normal[i][1], data_normal[i][10], data_normal[i][17], data_normal[i][16]);
+                        if (child.length > 0) {
+
+                        } else {
+                            child = addChildren(50, data_normal[i][1], data_normal[i][10], data_normal[i][17], data_normal[i][16]);
+                        }
+                    }
+                    if (child.length > 0) {//拆分
+                        for(let j = 0; j < child.length; j++) {
+                            data_normal_2.push(child[j]);
+                            if (bc == 'true') {
+                                for (let k = 0; k < data.length; k++) {
+                                    if (data[k][16] == child[j][16]) {
+                                        let datak2 = data[k][2];
+                                    
+                                        if (child[j][2] == datak2) {//名称
+                                        
+                                        } else {
+                                            if (mode > 0) {
+
+                                            } else {
+                                                huan = true;
+                                            }
+                                        }
+                                    
+                                    }
+                                }  
+                            } else if (mode != 1){
+                                for (let k = 0; k < data.length; k++) {
+                                    if (data[k][16] == child[j][16]) {
+                                        let datak2 = data[k][2];
+                                    
+                                        if (child[j][2] == datak2) {//名称
+                                        
+                                        } else {
+                                            huan = true;
+                                        }
+                                    
+                                    }
+                                }  
+                            }
+                        }
+
+
+                    } else {
+                        data_normal_2.push(data_normal[i]);
+                    }
+                }
+                if (mode == 0) {
+                    data_normal = copy(data);
+                } else if (mode == 2) {
+                    data_normal = data.filter(x=>x[17]!='true');
+                    data_normal = data_normal.concat(data_normal_2.filter(x=> x[17] == 'true'));
+                } else if (mode == 1) {
+                    data_normal = data_normal_2;
+                    //data_normal = data_normal.concat(data.filter(x=> x[17] == 'true'));
+                }
+            }
+            
+        } else {//没有预拌
+            let data_normal_2 = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+            "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ]];
+            for(let i = 1; i < data_normal.length; i++) {
+                let bc = data_normal[i][17];
+                let child = addChildren(10, data_normal[i][1], data_normal[i][10], data_normal[i][17], data_normal[i][16]);
+                if (child.length > 0) {
+
+                } else {
+                    child = addChildren(40, data_normal[i][1], data_normal[i][10], data_normal[i][17], data_normal[i][16]);
+                    if (child.length > 0) {
+
+                    } else {
+                        child = addChildren(50, data_normal[i][1], data_normal[i][10], data_normal[i][17], data_normal[i][16]);
+                    }
+                }
+                if (child.length > 0) {//拆分
+                    for(let j = 0; j < child.length; j++) {
+                        data_normal_2.push(child[j]);
+                        if (bc == 'true') {
+                            for (let k = 0; k < data.length; k++) {
+                                if (data[k][16] == child[j][16]) {
+                                    let datak2 = data[k][2];
+                                    
+                                    if (child[j][2] == datak2) {//名称
+                                        
+                                    } else {
+                                        if (mode > 0) {
+
+                                        } else {
+                                            huan = true;
+                                        }
+                                    }
+                                    
+                                }
+                            }  
+                        } else if (mode != 1){
+                            for (let k = 0; k < data.length; k++) {
+                                if (data[k][16] == child[j][16]) {
+                                    let datak2 = data[k][2];
+                                    
+                                    if (child[j][2] == datak2) {//名称
+                                        
+                                    } else {
+                                        huan = true;
+                                    }
+                                    
+                                }
+                            }  
+                        }
+                    }
+
+
+                } else {
+                    data_normal_2.push(data_normal[i]);
+                }
+
+            }
+
+            if (mode == 0) {
+                data_normal = copy(data);
+            } else if (mode == 2) {
+                data_normal = data.filter(x=>x[17]!='true');
+                data_normal = data_normal.concat(data_normal_2.filter(x=> x[17] == 'true'));
+            } else if (mode == 1) {
+                data_normal = data_normal_2;
+                //data_normal = data_normal.concat(data.filter(x=> x[17] == 'true'));
+            }
+
+        }        
+     
+        data = copy(data_normal);
+
+        //模拟formula计算每一行的合价
+        for(let i = 1; i < data.length; i++) {
+            data[i][11] = Number(data[i][10]) * Number(data[i][5]);
+        }
+        
+             
+        let sum = 0;
+        let rgf_sum = 0;
+        let jxf_sum = 0;
+        let clf_sum = 0;
+        let zcf_sum = 0;
+        for(let i = 1; i < data.length; i++) {
+            if (data[i][1].includes('000FE') && data[i][4] == '%')continue;//azfy
+            if (data[i][1]=='00EXP001' && data[i][4] == '%'){//回程费占人工费
+                continue;    
+            }
+            if (data[i][1]=='99EXP007' && data[i][4] == '%'){//回程费占机械费
+                continue;    
+            }
+            if (data[i][1]=='99EXP022' && data[i][4] == '%'){//回程费占机械费
+                continue;    
+            }
+            if (data[i][1]=='31130104' && data[i][4] == '%'){//回程费占材料费
+                continue;    
+            }
+            sum += Number(data[i][11]);//11-> hejia
+            if (Number(data[i][8]) == 1) {
+                rgf_sum += Number(data[i][11]);
+            }
+            if (Number(data[i][8]) == 2) {
+                clf_sum += Number(data[i][11]);
+                if (data[i][14] == 'true') {
+                    zcf_sum += Number(data[i][11]);
+                }
+            }
+            if (Number(data[i][8]) == 3) {
+                jxf_sum += Number(data[i][11]);
+            }
+        }
+        console.log("sum=".concat(sum));
+        //处理百分比费用
+        for(let i = 1; i < data.length; i++) {
+            if (data[i][1]=='00EXP001' && data[i][4] == '%'){//回程费占人工费
+                data[i][11] = Number(data[i][10]) * rgf_sum / Number(100);   
+            }
+            if (data[i][1]=='99EXP007' && data[i][4] == '%'){//回程费占机械费
+                data[i][11] = Number(data[i][10]) * jxf_sum / Number(100);    
+            }
+            if (data[i][1]=='99EXP022' && data[i][4] == '%'){//回程费占机械费
+                data[i][11] = Number(data[i][10]) * jxf_sum / Number(100);    
+            }
+            if (data[i][1]=='31130104' && data[i][4] == '%'){//回程费占材料费
+                data[i][11] = Number(data[i][10]) * clf_sum / Number(100);    
+            }
+
+        }
+        sum = 0;
+        rgf_sum = 0;
+        jxf_sum = 0;
+        clf_sum = 0;
+        zcf_sum = 0;
+        for(let i = 1; i < data.length; i++) {
+            sum += Number(data[i][11]);//11-> hejia
+            if (Number(data[i][8]) == 1) {
+                rgf_sum += Number(data[i][11]);
+            }
+            if (Number(data[i][8]) == 2) {
+                clf_sum += Number(data[i][11]);
+                if (data[i][14] == 'true') {
+                    zcf_sum += Number(data[i][11]);
+                }
+            }
+            if (Number(data[i][8]) == 3) {
+                jxf_sum += Number(data[i][11]);
+            }
+        }
+        let shuliang = Number(qd['数量']);
+        for(let i = 0; i< qd["_children"].length; i++) {
+            if(qd["_children"][i]['key'] == row) {
+                let desl = Number(qd["_children"][i]['数量']);
+                let oldname = qd["_children"][i]['清单编码'];
+                
+                qd["_children"][i]['辅材费'] = clf_sum - zcf_sum;
+                qd["_children"][i]['材料费'] = clf_sum;
+                qd["_children"][i]['人工费'] = rgf_sum;
+                qd["_children"][i]['主材费'] = zcf_sum;
+                qd["_children"][i]['设备费'] = 0;
+                qd["_children"][i]['机械费'] = jxf_sum;
+                if (oldname.startsWith("D")) {//单项清单
+                    qd["_children"][i]['管理费'] = 0;
+                    qd["_children"][i]['利润'] = 0;
+                } else {
+                    if (this.qufeiEntry['备注'].length == 0) {
+                        //changuiqufei
+                        qd["_children"][i]['管理费'] = (rgf_sum + jxf_sum) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                        qd["_children"][i]['利润'] = (rgf_sum + jxf_sum) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                    } else {
+                        qd["_children"][i]['管理费'] = (rgf_sum) * Number(this.qufeiEntry['管理费(%)']) / Number(100);
+                        qd["_children"][i]['利润'] = (rgf_sum) * Number(this.qufeiEntry['利润(%)']) / Number(100);
+                    }
+                }
+                qd["_children"][i]['综合单价'] = sum + qd["_children"][i]['管理费'] + qd["_children"][i]['利润'];
+                qd["_children"][i]['合价'] = (qd["_children"][i]['综合单价'] * shuliang * desl);
+                
+                
+                
+                qd["_children"][i]["dercj"] = this.handleJGC(copy(data));
+                qd["_children"][i]['清单编码'] = renameDingE(oldname, xuhao, huan);
+
+            }
+        }
+    }
+
+    updateDercj(row, data) {
+        //是否手动设置含量
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        this.updateFootprint(qd['key']);
+        let bm = de['清单编码'];
+        let alreadyFuzhu = extractFuzhu(bm);//[xuhao]
+        
+
+
+        
+        this.updateDercj_(row, data, alreadyFuzhu, de['yuban'], de['rcjbc']);
+        //let qd = this.cache.filter(x=>x["children"].filter(y=>y['key']==row).length > 0)[0];
+
+        let newData = this.cache.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize(newData);
+        this.push_op(summarized);
+        /////////////////
+        this.cache = copy(summarized);
+        return copy(this.cache);
+
+
+    }
+
+
+    updateDercj_djcs(row, data) {
+        //是否手动设置含量
+        let qd = this.cache_djcs.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        let bm = de['清单编码'];
+        let alreadyFuzhu = extractFuzhu(bm);//[xuhao]
+        
+
+
+        
+        this.updateDercj_djcs_(row, data, alreadyFuzhu);
+        //let qd = this.cache.filter(x=>x["children"].filter(y=>y['key']==row).length > 0)[0];
+
+        let newData = this.cache_djcs.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize_djcs(newData);
+        this.push_op_djcs(summarized);
+        /////////////////
+        this.cache_djcs = copy(summarized);
+        return copy(this.cache_djcs);
+
+
+    }
+
+
+    updateBeizhu(row, selected, xuhao) {//xuhao is for rename, selected is 结构化的处理信息
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        if (!qd) return [null, null];
+        this.updateFootprint(qd['key']);
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        if (de.hasOwnProperty("rcjdg")) {//底稿
+
+        } else {///老数据不能有底稿,附注功能也不使能
+            //de['rcjdg'] = copy(de['dercj']);
+
+        }
+        de['fuzhu'] = copy(selected);
+        this.updateDercj_(row, de['dercj'], xuhao, de['yuban'], de['rcjbc'], 1);
+
+        let newData = this.cache.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize(newData);
+        this.push_op(summarized);
+        /////////////////
+        this.cache = copy(summarized);
+        return [copy(this.cache), copy(de['dercj'])];
+
+    }
+
+
+    updateBeizhu_djcs(row, selected, xuhao) {//xuhao is for rename
+        let qd = this.cache_djcs.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        if (!qd) return [null, null];
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        if (de.hasOwnProperty("rcjdg")) {//底稿
+
+        } else {///老数据不能有底稿,附注功能也不使能
+            //de['rcjdg'] = copy(de['dercj']);
+
+        }
+        de['fuzhu'] = copy(selected);
+        this.updateDercj_djcs_(row, de['dercj'], xuhao, 1);
+
+        let newData = this.cache_djcs.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize_djcs(newData);
+        this.push_op_djcs(summarized);
+        /////////////////
+        this.cache_djcs = copy(summarized);
+        return [copy(this.cache_djcs), copy(de['dercj'])];
+
+    }
+
+    huan(old_index, new_bianhao, new_name, new_jia, zhuanye, row) {
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        this.updateFootprint(qd['key']);
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        let rcj = copy(de['dercj']);
+     
+        rcj[old_index][1] = new_bianhao;
+        rcj[old_index][2] = new_name;
+        rcj[old_index][5] = new_jia;
+
+        return this.updateDercj(row, rcj);
+
+
+    }
+
+    updateShuliang(value, row) {
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        this.updateFootprint(qd['key']);
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        let origin = de['数量']
+        if (Number(origin) - Number(value) < 0.0001 && Number(origin) - Number(value) > -0.0001) {
+            return [false, null];
+        }
+        console.log("shuliang update");
+        de['数量'] = value;
+        de['合价'] = Number(qd['数量']) * Number(de['综合单价']) * Number(de['数量']);
+        let newData = this.cache.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize(newData);
+        this.push_op(summarized);
+        /////////////////
+        this.cache = copy(summarized);
+        return [true, copy(this.cache)];
+
+
+
+
+
+
+    }
+
+
+    updateDeMingcheng(value, row) {
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        this.updateFootprint(qd['key']);
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        de['名称'] = value;
+
+        let newData = this.cache.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize(newData);
+        this.push_op(summarized);
+        /////////////////
+        this.cache = copy(summarized);
+        return copy(this.cache);
+
+
+
+
+
+
+    }
+
+
+    updateShuliang_djcs(value, row) {
+        let qd = this.cache_djcs.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        let origin = de['数量']
+        if (Number(origin) - Number(value) < 0.0001 && Number(origin) - Number(value) > -0.0001) {
+            return [false, null];
+        }
+        console.log("shuliang update");
+        de['数量'] = value;
+        de['合价'] = Number(qd['数量']) * Number(de['综合单价']) * Number(de['数量']);
+        let newData = this.cache_djcs.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize_djcs(newData);
+        this.push_op_djcs(summarized);
+        /////////////////
+        this.cache_djcs = copy(summarized);
+        return [true, copy(this.cache_djcs)];
+
+
+
+
+
+
+    }
+
+    azfy_djcs_eligible(selectedRow) {
+        if (this.cache_djcs.filter(x=>x['key'] == selectedRow).length > 0) {
+            return true;
+        } else {
+            return false;
+        }
+
+    }
+
+    azfy_djcs(row, dinge, selected) {
+        let res = JSON.parse(dinge);
+        let keys = Object.keys(res['DEBH']);
+        let key = keys[0];
+        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 (res['actual_zhuanye'] == 10) {
+            tips = tjazfy(res['DEBH'][key], res['GCLMC'][key]);
+        }
+
+
+        if (tips != null) {
+            res['rgde'] = tips['rgde'];
+            res['clde'] = tips['clde'];
+            res['jxde'] = tips['jxde'];
+            res['azfytag'] = tips['azfytag'];
+        }
+        let qd = this.cache_djcs.filter(x=>x['key'] == row)[0];
+        let dercj = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ]];
+        for(let i = 0; i < selected.length; i++) {
+            let rgf = selected[i]['人工费'];
+            let clf = selected[i]['材料费'];
+            let jxf = selected[i]['机械费'];
+            let sl = selected[i]['数量'];
+            if (res['azfytag'][0] == '人工费') {
+                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(), '' ]);
+
+            }
+        }
+
+        let newKey = uuidv4();
+        if (!qd.hasOwnProperty('_children')) {
+            qd["_children"] = [];
+        }
+        qd["_children"].push({
+                    '操作': '',
+                    '序号': null,
+                    '清单编码': res['DEBH'][key],
+                    '名称': res['GCLMC'][key],
+                    '项目特征': null,
+                    '计算规则': tips != null ? tips['sm'] : '',
+                    '单位': res['DW'][key],
+                    '数量': '1',
+                    '综合单价': '0',
+                    '合价': '0',
+                    '人工费': '0',
+                    '主材费': '0',
+                    '设备费': '0',
+                    '辅材费': '0',
+                    '材料费': '0',
+                    '机械费': '0',
+                    '管理费': '0',
+                    '利润': '0',
+                    '暂估价': null,
+                    '综合人工工日': null,
+                    '备注': null,
+                    "dercj": dercj,
+                    'rcjdg': dercj.map(x=>[x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17]]),
+                    'key' :   newKey,
+                    "fuzhuEnable": false,
+                    'yuban': [],
+                    'rcjbc': [],
+                    'azfytag': []
+    
+                    
+        });
+
+        this.updateDercj_djcs_(newKey, dercj, []);
+        let summarized = this.summarize_djcs(this.cache_djcs);
+        this.push_op_djcs(copy(summarized));
+        this.cache_djcs = copy(summarized);
+                
+        return [true, copy(this.cache_djcs), newKey];
+
+    }
+
+
+    changguidinge_djcs(dingeclick, row) {
+        if (this.cache_djcs.filter(x=>x['key'] == row).length > 0) {
+            
+                let res =dingeclick;
+                let keys = Object.keys(res['DEBH']);
+                let key = keys[0];
+                //console.log(res);
+                let qd = this.cache_djcs.filter(x=>x['key'] == row)[0];
+                let dercj = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", "key", 'bc']];
+                for(let i = 0; i < res['rgde'].length; i++) {
+                    dercj.push(['', res['rgde'][i]['CLBH'], res['rgde'][i]['CLMC'], '', res['rgde'][i]['JLDW'], 
+                    res['rgde'][i]['YSJG'], '', '', '1', '', res['rgde'][i]['gr'], res['rgde'][i]['gf'],
+                    '', '', '', '', uuidv4(), "false" ]);
+                }
+                for(let i = 0; i < res['clde'].length; i++) {
+                    let hit = false;
+                    let jg = null;
+                    let bh = res['clde'][i]['CLBH'];
+                    for(let j = 0; j < this.jiagongcai.length; j++) {
+                        if (this.jiagongcai[j]['材料编号'] == bh) {
+                            hit = true;
+                            jg = this.jiagongcai[j]['单价'];
+                        }
+                    }
+                    if (hit) {
+                        dercj.push(['', res['clde'][i]['CLBH'], res['clde'][i]['CLMC'], '', res['clde'][i]['JLDW'], 
+                    jg, '', '', '2', 'true', res['clde'][i]['SL'], res['clde'][i]['HJ'],
+                    '', '', '', '', uuidv4(), 'false' ]);
+                    } else {
+                       /* if (res['clde'][i].hasOwnProperty('children')) {
+                            let parent = uuidv4();
+                            let children = [];
+                            let child_data = res['clde'][i]['children'];
+                            for(let j = 0; j < child_data.length; j++) {
+                                let id = uuidv4();
+                                children.push(id);
+                                dercj.push(['', child_data[j]['CLBH'], child_data[j]['CLMC'], '', child_data[j]['JLDW'], 
+                                   child_data[j]['YSJG'], '', '', '2', 'false', child_data[j]['SL'], child_data[j]['HJ'],
+                                   '', '', '', '', id, 'false','false', [parent], [] ]);
+                            }
+                            dercj.push(['', res['clde'][i]['CLBH'], res['clde'][i]['CLMC'], '', res['clde'][i]['JLDW'], 
+                                res['clde'][i]['YSJG'], '', '', '2', 'false', res['clde'][i]['SL'], res['clde'][i]['HJ'],
+                                '', '', '', '', parent, 'false','true', [], children ]);
+
+                        } else {*/
+                             dercj.push(['', res['clde'][i]['CLBH'], res['clde'][i]['CLMC'], '', res['clde'][i]['JLDW'], 
+                              res['clde'][i]['YSJG'], '', '', '2', 'false', res['clde'][i]['SL'], res['clde'][i]['HJ'],
+                              '', '', '', '', uuidv4(), 'false' ]);
+                        
+                    }
+                    
+                }
+                for(let i = 0; i < res['jxde'].length; i++) {
+                    dercj.push(['', res['jxde'][i]['jxbh'], res['jxde'][i]['jxmc'], '', res['jxde'][i]['DW'], 
+                    res['jxde'][i]['tbdj'], '', '', '3', '', res['jxde'][i]['sl'], res['jxde'][i]['hj'],
+                    '', '', '', '',uuidv4(), 'false' ]);
+                }
+                let newKey = uuidv4();
+                if (!qd.hasOwnProperty('_children')) {
+                    qd["_children"] = [];
+                }
+                let newdercj = copy(dercj).map(x=>[x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17]]);
+                qd["_children"].push({
+                    '操作': '',
+                    '序号': null,
+                    '清单编码': res['DEBH'][key],
+                    '名称': res['GCLMC'][key],
+                    '项目特征': null,
+                    '计算规则': null,
+                    '单位': res['DW'][key],
+                    '数量': '1',
+                    '综合单价': '0',
+                    '合价': '0',
+                    '人工费': '0',
+                    '主材费': '0',
+                    '设备费': '0',
+                    '辅材费': '0',
+                    '材料费': '0',
+                    '机械费': '0',
+                    '管理费': '0',
+                    '利润': '0',
+                    '暂估价': null,
+                    '综合人工工日': null,
+                    '备注': null,
+                    "dercj": newdercj,
+                    'rcjdg': dercj,
+                    'key' :   newKey,
+                    "fuzhuEnable": true
+    
+                    
+                });
+                this.updateDercj_djcs_(newKey, newdercj, []);
+                let summarized = this.summarize_djcs(this.cache_djcs);
+                this.push_op_djcs(copy(summarized));
+                /////////////////
+                this.cache_djcs = copy(summarized);
+                //return copy(this.cache);
+            
+
+            return [true, copy(this.cache_djcs), newKey];
+        } else {
+            return [false, null, null];
+        }
+    }
+
+
+
+    changguidinge(dingeclick, row) {
+        if (this.cache.filter(x=>x['key'] == row).length > 0) {
+            this.updateFootprint(row);
+            
+                let res = copy(dingeclick);
+                let keys = Object.keys(res['DEBH']);
+                let key = keys[0];
+                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 (res['actual_zhuanye'] == 10) {
+                    tips = tjazfy(res['DEBH'][key], res['GCLMC'][key]);
+                }
+                if (tips != null) {
+                      res['rgde'] = tips['rgde'];
+                      res['clde'] = tips['clde'];
+                      res['jxde'] = tips['jxde'];
+                }
+                let qd = this.cache.filter(x=>x['key'] == row)[0];
+                let dercj = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ]];
+                for(let i = 0; i < res['rgde'].length; i++) {
+                    dercj.push(['', res['rgde'][i]['CLBH'], res['rgde'][i]['CLMC'], '', res['rgde'][i]['JLDW'], 
+                    res['rgde'][i]['YSJG'], '', '', '1', '', res['rgde'][i]['gr'], res['rgde'][i]['gf'],
+                    '', '', '', '', uuidv4(), 'false' ]);
+                }
+                for(let i = 0; i < res['clde'].length; i++) {
+                    let hit = false;
+                    let jg = null;
+                    let bh = res['clde'][i]['CLBH'];
+                    for(let j = 0; j < this.jiagongcai.length; j++) {
+                        if (this.jiagongcai[j]['材料编号'] == bh) {
+                            hit = true;
+                            jg = this.jiagongcai[j]['单价'];
+                        }
+                    }
+                    if (hit) {
+                        dercj.push(['', res['clde'][i]['CLBH'], res['clde'][i]['CLMC'], '', res['clde'][i]['JLDW'], 
+                           jg, '', '', '2', 'true', res['clde'][i]['SL'], res['clde'][i]['HJ'],
+                           '', '', '', '', uuidv4(), 'false' ]);
+                    } else {
+                        /*if (res['clde'][i].hasOwnProperty('children') && res['clde'][i]['CLMC'].includes('砂浆')) {
+                            let parent = uuidv4();
+                            let children = [];
+                            let child_data = res['clde'][i]['children'];
+                            for(let j = 0; j < child_data.length; j++) {
+                                let id = uuidv4();
+                                children.push(id);
+                                dercj.push(['', child_data[j]['CLBH'], child_data[j]['CLMC'], '', child_data[j]['JLDW'], 
+                    child_data[j]['YSJG'], '', '', '2', 'false', child_data[j]['SL'], child_data[j]['HJ'],
+                    '', '', '', '', id, 'false','false', [parent], [] ]);
+                            }
+                            dercj.push(['', res['clde'][i]['CLBH'].toString(), res['clde'][i]['CLMC'], '', res['clde'][i]['JLDW'], 
+                    res['clde'][i]['YSJG'], '', '', '2', 'false', res['clde'][i]['SL'], res['clde'][i]['HJ'],
+                    '', '', '', '', parent, 'false','true', [], children ]);
+
+                        } else {*/
+                            dercj.push(['', res['clde'][i]['CLBH'].toString(), res['clde'][i]['CLMC'], '', res['clde'][i]['JLDW'], 
+                                res['clde'][i]['YSJG'], '', '', '2', 'false', res['clde'][i]['SL'], res['clde'][i]['HJ'],
+                                '', '', '', '', uuidv4(), 'false' ]);
+                        
+                        
+                    }
+                    
+                }
+                for(let i = 0; i < res['jxde'].length; i++) {
+                    dercj.push(['', res['jxde'][i]['jxbh'], res['jxde'][i]['jxmc'], '', res['jxde'][i]['DW'], 
+                    res['jxde'][i]['tbdj'], '', '', '3', '', res['jxde'][i]['sl'], res['jxde'][i]['hj'],
+                    '', '', '', '', uuidv4(), 'false']);
+                }
+                let newKey = uuidv4();
+                if (!qd.hasOwnProperty('_children')) {
+                    qd["_children"] = [];
+                }
+                let newdercj = copy(dercj).map(x=>[x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17]]);
+                qd["_children"].push({
+                    '操作': '',
+                    '序号': null,
+                    '清单编码': res['DEBH'][key],
+                    '名称': res['GCLMC'][key],
+                    '项目特征': null,
+                    '计算规则': tips != null ? tips['sm'] : '',
+                    '单位': res['DW'][key],
+                    '数量': '1',
+                    '综合单价': '0',
+                    '合价': '0',
+                    '人工费': '0',
+                    '主材费': '0',
+                    '设备费': '0',
+                    '辅材费': '0',
+                    '材料费': '0',
+                    '机械费': '0',
+                    '管理费': '0',
+                    '利润': '0',
+                    '暂估价': null,
+                    '综合人工工日': null,
+                    '备注': null,
+                    "dercj": newdercj,
+                    'rcjdg': (dercj),
+                    'key' :   newKey,
+                    "fuzhuEnable": true,
+                    'yuban': [],
+                    'rcjbc': [],
+                    'azfytag': tips != null ? tips['azfytag'] : []
+    
+                    
+                });
+                this.updateDercj_(newKey, dercj, [], [], [], 1);
+                let summarized = this.summarize(this.cache);
+                this.push_op(copy(summarized));
+                /////////////////
+                this.cache = copy(summarized);
+                //return copy(this.cache);
+            
+
+            return [true, copy(this.cache), newKey];
+        } else {
+            return [false, null, null];
+        }
+    }
+
+    danxiangdinge(row) {
+        let bh = danxiangdinge_index(this.cache);
+        
+        if (this.cache.filter(x=>x['key'] == row).length > 0) {
+            this.updateFootprint(row);
+            let selected = this.cache.filter(x=>x['key'] == row)[0];
+            let danwei = selected["单位"];
+            let mingcheng = selected['名称'];
+            let children = selected["_children"];
+            children.push({
+                '操作': '',
+                '序号': null,
+                '清单编码': bh,
+                '名称': mingcheng,
+                '项目特征': null,
+                '计算规则': null,
+                '单位': danwei,
+                '数量': '1',
+                '综合单价': '',
+                '合价': '',
+                '人工费': '0',
+                '主材费': '0',
+                '设备费': '0',
+                '辅材费': '',
+                '材料费': '',
+                '机械费': '0',
+                '管理费': '0',
+                '利润': '0',
+                '暂估价': null,
+                '综合人工工日': null,
+                '备注': null,
+                "dercj": [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", 'key', 'bc' ],
+                   ['', bh, mingcheng, '', danwei, '', '', '', '2', '', '1', '', '',  '', '', '', uuidv4(), '' ]
+                      ],
+                'key' :   uuidv4(),
+                "fuzhuEnable": false,
+                'yuban': [],
+                'rcjbc' : [],
+                'azfytag': []
+
+                
+            });
+            let summarized = this.summarize(this.cache);
+            this.push_op(summarized);
+            this.cache = copy(summarized);
+            
+            return [true, copy(this.cache)];
+        } else {
+            return [false,null];
+        }
+
+    }
+
+    danxiangdinge_djcs(row) {
+        let bh = danxiangdinge_index_djcs(this.cache_djcs);
+        
+        if (this.cache_djcs.filter(x=>x['key'] == row).length > 0) {
+            let selected = this.cache_djcs.filter(x=>x['key'] == row)[0];
+            let danwei = selected["单位"];
+            let mingcheng = selected['名称'];
+            let children = selected["_children"];
+            children.push({
+                
+                '序号': null,
+                '清单编码': bh,
+                '名称': mingcheng,
+                '项目特征': null,
+                '计算规则': null,
+                '单位': danwei,
+                '数量': '1',
+                '综合单价': '',
+                '合价': '',
+                '人工费': '0',
+                '主材费': '0',
+                '设备费': '0',
+                '辅材费': '',
+                '材料费': '',
+                '机械费': '0',
+                '管理费': '0',
+                '利润': '0',
+                '暂估价': null,
+                '综合人工工日': null,
+                '备注': null,
+                "dercj": [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地", 
+                "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志", "key" , "bc" ],
+                   ['', bh, mingcheng, '', danwei, '', '', '', '2', '', '1', '', '',  '', '', '', uuidv4(), "" ]
+                      ],
+                'key' :   uuidv4(),
+                "fuzhuEnable": false
+
+                
+            });
+            let summarized = this.summarize_djcs(this.cache_djcs);
+            this.push_op_djcs(summarized);
+            this.cache_djcs = copy(summarized);
+            
+            return [true, copy(this.cache_djcs)];
+        } else {
+            return [false,null];
+        }
+
+    }
+
+    handleYuban(row, selected) {
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        if (!qd) return [null, null];
+        this.updateFootprint(qd['key']);
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        let bm = de['清单编码'];
+        let alreadyFuzhu = extractFuzhu(bm);//[xuhao]
+        if (de.hasOwnProperty("rcjdg")) {//底稿
+
+        } else {///老数据不能有底稿,附注功能也不使能,预拌也不能使
+            //de['rcjdg'] = copy(de['dercj']);
+
+        }
+        de['yuban'] = copy(selected);
+        this.updateDercj_(row, de['dercj'], alreadyFuzhu, selected, de['rcjbc'], 1);
+
+        let newData = this.cache.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize(newData);
+        this.push_op(summarized);
+        /////////////////
+        this.cache = copy(summarized);
+        return [copy(this.cache), copy(de['dercj'])];
+    }
+
+    handleRcjbc(row, rcjbc) {
+        let qd = this.cache.filter(x=>x["_children"].filter(y=>y['key']==row).length > 0)[0];
+        if (!qd) return [null, null];
+        this.updateFootprint(qd['key']);
+        let de = qd["_children"].filter(x=>x['key'] == row)[0];
+        let bm = de['清单编码'];
+        let alreadyFuzhu = extractFuzhu(bm);//[xuhao]
+        if (de.hasOwnProperty("rcjdg")) {//底稿
+    
+        } else {///老数据不能有底稿,附注功能也不使能,预拌也不能使
+            //de['rcjdg'] = copy(de['dercj']);
+    
+        }
+        de['rcjbc'] = copy(rcjbc);
+        this.updateDercj_(row, de['dercj'], alreadyFuzhu, de['yuban'], rcjbc, 2);
+    
+        let newData = this.cache.map(x=>{
+            if (x['key'] == qd['key']) {
+                return qd;
+            } else {
+                return x;
+            }
+        });
+        let summarized = this.summarize(newData);
+        this.push_op(summarized);
+        /////////////////
+        this.cache = copy(summarized);
+        return [copy(this.cache), copy(de['dercj'])];
+    }
+
+    handleJGC(input) {
+        for (let i = 0;i < input.length; i++) {
+            let bh = input[i][1];
+            let hit = false;
+            let jg = 0;
+            for(let j = 0; j < this.jiagongcai.length; j++) {
+                if (this.jiagongcai[j]['材料编号'] == bh) {
+                    hit = true;
+                    //jg = this.jiagongcai[j]['单价'];
+                }
+            }
+            if (hit) {
+                input[i][9] = 'true';
+            }
+        }
+        return input;
+    }
+
+    
+}
+
+
+
+
+
+
+
+export default new Service();

+ 16 - 0
package.json

@@ -0,0 +1,16 @@
+{
+  "dependencies": {
+    "express": "^5.1.0",
+    "uuid": "^13.0.0"
+  },
+  "type": "module",
+  "name": "celery",
+  "version": "1.0.0",
+  "description": "celery -A tasks worker --loglevel=info ZAI 29b9cd63fa5f4666bf01aaf9f7c0302e.8NqXiixA3oAZgq1o",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC"
+}

+ 59 - 0
server.js

@@ -0,0 +1,59 @@
+import express from 'express'
+const app = express();
+
+// 使用中间件解析JSON格式的请求体
+app.use(express.json());
+import Service from './Service.js';
+import {copy} from './utils.js';
+
+app.post('/api/transform', (req, res) => {
+   let data = copy(req.body);
+   Service.setQufei([{ "children": [{"children":[{
+   
+   "key": "1",
+   "利润(%)": "",
+   "名称": "",
+   "备注": "",
+   "工程类型": "",
+   "工程类别": "",
+   "管理费(%)": ""
+   
+   }]}]}])
+   Service.setQufeiEntry("1")
+   Service.processQingdanmingxi([{
+      "主材费": "",
+      "人工费": "",
+      "利润": "",
+      "单位": data['dw'],
+      "合价": "",
+      "名称": data['mc'],
+      "备注": "",
+      "序号": "1",
+      "数量": data['sl'],
+      "暂估价": "",
+      "机械费": "",
+      "清单编码": data['bianma'],
+      "管理费": "",
+      "综合人工工日": "",
+      "综合单价": "",
+      "计算规则": "",
+      "设备费": "",
+      "辅材费": "",
+      "项目特征": data['tz'],
+      "操作": "",
+      "材料费": ""
+   }])
+   let result = copy(data['result'])
+   delete data.result
+   for (let i = 0; i < result.length; i++) {
+       console.log(result[i][0])
+       console.log(result[i][1])
+       let r = Service.changguidinge(JSON.parse(result[i][2]), "1")
+       r = Service.updateShuliang(result[i][1], r[2])
+   }
+   //console.log(Service.cache)
+   res.status(200).send(Service.cache);
+});
+app.listen(3000, () => {
+   console.log('Server is running on port 3000');
+});

+ 7 - 4
tasks.py

@@ -5,9 +5,11 @@ import chromadb
 client = chromadb.HttpClient(host='47.101.198.30',port=8000)
 collection = client.get_or_create_collection(name="tj_de_bge")
 from FlagEmbedding import FlagModel
-model = FlagModel('/mnt/d/Develop/bge/test2_encoder_only_base_bge-large-zh-v1.5')
+#model = FlagModel('/mnt/d/Develop/bge/test2_encoder_only_base_bge-large-zh-v1.5')
+model = FlagModel('/Users/zxp/Downloads/test2_encoder_only_base_bge-large-zh-v1.5')
 from sentence_transformers import CrossEncoder
-ce = CrossEncoder('/mnt/d/Develop/celery/final')
+#ce = CrossEncoder('/mnt/d/Develop/celery/final')
+ce = CrossEncoder('/Users/zxp/Downloads/reranker')
 with open("hunningtu_rule", "r") as f:
     content = f.read()
 obj = json.loads(content)
@@ -33,7 +35,7 @@ THRESHOLD=0.9####adjust it
 
 import os
 from openai import OpenAI
-
+import requests
 aiclient = OpenAI(
     # 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx",
     #api_key=os.getenv("DASHSCOPE_API_KEY"),
@@ -287,4 +289,5 @@ def process_data(data:dict)-> dict:
     result = [(label_name[x], huansuan(data['dw'], label_name[x])) for x in selected]  
     result = [(zuhe(x[0], label), x[1]) for x in result]  
     result = [(x[0], x[1], dedata.read_singledexilie2(10, x[0])) for x in result]
-    return {"result": result}
+    response = requests.post("http://localhost:3000/api/transform", json={'bianma': data['bianma'], 'mc': data['mc'], 'tz': data['tz'], 'dw': data['dw'], 'sl': data['sl'], 'result': result})
+    return {"result": response.json()}

+ 1791 - 0
utils.js

@@ -0,0 +1,1791 @@
+import { v4 as uuidv4 } from 'uuid';
+
+export const danxiangdinge_index = (data) => {
+    let max = 0;
+    for(let i = 0;  i< data.length; i++) {
+        if (data[i].hasOwnProperty("_children")) {
+            let child = data[i]["_children"];
+            for (let j = 0; j < child.length; j++) {
+                let de = child[j];
+                if (de["清单编码"].startsWith("D")) {
+                    let number = de["清单编码"].substring(1);
+                    let n = Number(number);
+                    if (n > max) {
+                        max = n;
+                    }
+                }
+            }
+        }
+    }
+        let result =  (max + 1).toString();
+        result = result.padStart(5, '0');
+        return "D".concat(result);
+
+    
+  };
+
+  export const danxiangdinge_index_djcs = (data) => {
+    let max = 0;
+    for(let i = 0;  i< data.length; i++) {
+        if (data[i].hasOwnProperty("_children")) {
+            let child = data[i]["_children"];
+            for (let j = 0; j < child.length; j++) {
+                let de = child[j];
+                if (de["清单编码"].startsWith("D")) {
+                    let number = de["清单编码"].substring(1);
+                    let n = Number(number);
+                    if (n > max) {
+                        max = n;
+                    }
+                }
+            }
+        }
+    }
+        let result =  (max + 1).toString();
+        result = result.padStart(5, '0');
+        return "D".concat(result);
+
+    
+  };
+
+
+export const copy = (input) => {
+    return JSON.parse(JSON.stringify(input));
+};
+
+
+
+
+export const renameDingE = (oldname, xuhao, huan) => {
+    let index = oldname.indexOf('附注', 0);
+    let raw = oldname;
+    if (index == -1) {
+
+    } else {
+        raw = oldname.substring(0, index);
+    }
+    for(let i = 0; i < xuhao.length; i++) {
+        if (xuhao[i].split('*')[1] == '1') {
+            raw = raw.concat("附注");
+            raw = raw.concat(xuhao[i].split('*')[0]);
+        } else {
+            raw = raw.concat("附注");
+            raw = raw.concat(xuhao[i]);
+        }
+        
+    }
+    if (huan && raw.indexOf('换') == -1) {
+        raw = raw.concat('换');
+    }
+    else if (!huan && raw.indexOf('换') > -1) {
+        raw = raw.replace('换', '');
+    }
+    
+    return raw;
+};
+
+export const extractFuzhu = (debm) => {
+    if (debm) {
+        let start = 0;
+        let result = [];
+        while(start < debm.length) {
+            let index = debm.indexOf('附注', start);
+            if (index == -1) break;
+            let i = index + 2;
+            for(i = index+2; i < debm.length; i++) {
+                if (debm[i] >= '0' && debm[i] <= '9') {
+
+                } else {
+                    break;
+                }
+            }
+            let find = debm.substring(index+2, i);
+            if (debm.substring(i,i+1)=='*') {
+                let j = i + 1;
+                for(j = i+1; j < debm.length; j++) {
+                    if ((debm[j] >= '0' && debm[j] <= '9') || debm[j] == '-') {
+    
+                    } else {
+                        break;
+                    }
+                }
+                find = debm.substring(index + 2, j);
+                i = j;
+            }
+            result.push((find));
+            start = i;
+
+
+        }
+        return result;
+    } else {
+        return [];
+    }
+};
+
+export const match_target = (input ,input_mc, target, mc) => {
+    if (target == '000000') return true;//全部定额
+    if (target == '000001') {//普世的人工费
+        if(input.startsWith("000")) {
+            return true;
+        } else {
+            return false;
+        }
+    } else if (target == 'J00000' && (mc == '全部机械' || mc == '所有机械')) {//普世机械费
+        if (input.startsWith('99') || input.startsWith('98') || input.startsWith('J')) {
+            return true;
+        } else {
+            return false;
+        }
+    } else if (target == 'J00000') {
+        //除此机械外
+        if (mc == '盾构推进机') {
+            if (input_mc.includes('盾构推进机') || input_mc.includes('盾构机')) {
+                return false;
+            }
+            if (input.startsWith('99') || input.startsWith('98') || input.startsWith('J')) {
+                return true;
+            } else {
+                return false;
+            }
+
+        }
+        if (mc == '载货汽车') {
+            if (input_mc.includes('载货汽车')) {
+                return false;
+            }
+            if (input.startsWith('99') || input.startsWith('98') || input.startsWith('J')) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+        if (mc.includes('交流弧焊机')) {
+            if (input_mc.includes('交流弧焊机')) {
+                return false;
+            }
+            if (input.startsWith('99') || input.startsWith('98') || input.startsWith('J')) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+        if (mc.includes('卷扬机带塔')) {
+            if (input_mc.includes('卷扬机带塔')) {
+                return false;
+            }
+            if (input.startsWith('99') || input.startsWith('98') || input.startsWith('J')) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+        if (mc.includes('双笼施工电梯')) {
+            if (input_mc.includes('双笼施工电梯')) {
+                return false;
+            }
+            if (input.startsWith('99') || input.startsWith('98') || input.startsWith('J')) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+    } else if (target == '100000') {//全部材料
+        if (input.startsWith('99')|| input.startsWith('98') || input.startsWith('J')) {
+            return false;
+        } else if (input.startsWith("000")) {
+            return false;
+        } else {
+            return true;
+        }
+    } else if (target == '800101') {//普世的砂浆
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '015103') {//槽铝
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '066121') {//面砖
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '066501') {//地砖
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '066503') {//
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '070101') {//花岗岩
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '070303') {//
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '070902') {//麻石
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '071121') {//
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    }  else if (target == '241503') {//瓷板
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+    } else if (target == '801303') {//
+            if (input.startsWith(target)) {
+                return true;
+            } else {
+                return false;
+            }
+    
+    } else if (target == '8021') {//
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    } else if (target == '80210') {//
+        if (input.startsWith(target)) {
+            return true;
+        } else {
+            return false;
+        }
+
+    }
+    return input == target;
+};
+
+const predef = {
+    "rate": [
+    [['人工费',10,25,75,0],['人工费',5,25,75,0],['人工费',5,25,75,0],['人工费',10,25,75,0],['人工费',4,25,75,0],['人工费',4,25,75,0],['人工费',4,25,75,0],['人工费',3,25,75,0],['人工费',7,25,75,0],['人工费',5,25,75,0],['人工费',5,25,75,0],['人工费',8,25,75,0],['人工费',12,25,75,0],['人工费',20,25,75,0],['人工费',8,25,75,0], ['人工费',12,25,75,0]],
+    [
+     ['人工费+机械费', 25, 50, 0, 50],['人工费+机械费', 35, 50, 0, 50],['人工费+机械费', 45, 50, 0, 50],['人工费+机械费', 55, 50, 0, 50],['人工费+机械费', 70, 50, 0, 50],['人工费+机械费', 90, 50, 0, 50], ['人工费+机械费', 25, 50, 0, 50], ['人工费+机械费', 35, 50, 0, 50],['人工费+机械费', 45, 50, 0, 50],['人工费+机械费', 55, 50, 0, 50],['人工费+机械费', 70, 50, 0, 50],['人工费+机械费', 90, 50, 0, 50],['人工费', 33, 100, 0, 0],['人工费', 25, 100, 0, 0],['人工费', 40, 100, 0, 0],['人工费', 60, 100, 0, 0],['人工费', 15, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 15, 100, 0, 0],['人工费', 20, 100, 0, 0],['人工费', 25, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 15, 100, 0, 0],['人工费', 20, 100, 0, 0],['人工费', 25, 100, 0, 0],['人工费+机械费', 30, 50, 0, 50],['人工费+机械费', 40, 50, 0, 50],['人工费+机械费', 50, 50, 0, 50],['人工费+机械费', 60, 50, 0, 50],['人工费+机械费', 70, 50, 0, 50],['人工费+机械费', 80, 50, 0, 50],['人工费+机械费', 90, 50, 0, 50],['人工费+机械费', 100, 50, 0, 50]
+    ],
+    [
+      ['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],
+    ],
+    [
+      ['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 10, 100, 0, 0],
+    ],
+    [//di 4 ce
+    ['人工费', 6, 17, 0, 83],['人工费', 9, 22, 0, 78],['人工费', 12, 33, 0, 67],['人工费', 15, 40, 0, 60],['人工费', 19, 42, 0, 58],['人工费', 23, 43, 0, 57],['人工费', 26, 50, 0, 50],['人工费', 30, 53, 0, 47],['人工费', 34, 56, 0, 44],['人工费', 37, 59, 0, 41],['人工费', 43, 58, 0, 42],['人工费', 43, 65, 0, 36],['人工费', 47, 67, 0, 33],['人工费', 50, 68, 0, 32],['人工费', 54, 69, 0, 31],['人工费', 58, 69, 0, 31],['人工费', 62, 70, 0, 30],['人工费', 65, 70, 0, 30],
+    ],
+    [//di 5 ce
+    ['人工费', 1, 100, 0, 0],['人工费', 2, 100, 0, 0],['人工费', 4, 100, 0, 0],['人工费', 6, 100, 0, 0],['人工费', 8, 100, 0, 0],['人工费', 10, 100, 0, 0],['人工费', 13, 100, 0, 0],['人工费', 16, 100, 0, 0],['人工费', 19, 100, 0, 0],['人工费', 22, 100, 0, 0],['人工费', 25, 100, 0, 0],['人工费', 28, 100, 0, 0],['人工费', 31, 100, 0, 0],['人工费', 34, 100, 0, 0],['人工费', 37, 100, 0, 0],['人工费', 40, 100, 0, 0],['人工费', 43, 100, 0, 0],['人工费', 46, 100, 0, 0],
+    ],
+    [//di 7 ce
+    ['人工费', 3, 33, 0, 67],['人工费', 5, 40, 0, 60],['人工费', 7, 43, 0, 57],['人工费', 10, 40, 0, 60],['人工费', 12, 42, 0, 58],['人工费', 15, 40, 0, 60],['人工费', 19, 42, 0, 58],['人工费', 22, 45, 0, 55],['人工费', 25, 52, 0, 48],['人工费', 28, 57, 0, 43],['人工费', 32, 59, 0, 41],['人工费', 36, 62, 0, 38],['人工费', 39, 65, 0, 35],['人工费', 41, 68, 0, 32],['人工费', 44, 70, 0, 30],['人工费', 47, 72, 0, 28],['人工费', 51, 73, 0, 27],['人工费', 54, 74, 0, 26],
+    ],
+    [//di 9 ce
+    ['人工费', 10, 10, 0, 90],['人工费', 15, 14, 0, 86],['人工费', 19, 21, 0, 79],['人工费', 23, 21, 0, 79],['人工费', 27, 26, 0, 74],['人工费', 31, 29, 0, 71],['人工费', 36, 31, 0, 69],['人工费', 40, 35, 0, 65],['人工费', 44, 39, 0, 61],['人工费', 48, 41, 0, 59],['人工费', 54, 43, 0, 57],['人工费', 56, 46, 0, 54],['人工费', 60, 48, 0, 52],['人工费', 63, 51, 0, 49],['人工费', 65, 53, 0, 47],['人工费', 67, 57, 0, 43],['人工费', 68, 60, 0, 40],['人工费', 70, 63, 0, 37],
+    ],
+    [//di 10 ce
+    ['人工费', 12, 17, 0, 83],['人工费', 17, 18, 0, 82],['人工费', 22, 18, 0, 82],['人工费', 27, 22, 0, 78],['人工费', 31, 26, 0, 74],['人工费', 35, 29, 0, 71],['人工费', 40, 33, 0, 67],['人工费', 44, 36, 0, 64],['人工费', 48, 40, 0, 60],['人工费', 53, 42, 0, 58],['人工费', 58, 43, 0, 57],['人工费', 61, 46, 0, 54],['人工费', 65, 48, 0, 52],['人工费', 68, 50, 0, 50],['人工费', 70, 52, 0, 48],['人工费', 72, 56, 0, 44],['人工费', 73, 59, 0, 41],['人工费', 75, 61, 0, 39],
+    ],
+    [//di 11 ce
+    ['人工费', 3, 33, 0, 67],['人工费', 5, 40, 0, 60],['人工费', 7, 43, 0, 57],['人工费', 10, 40, 0, 60],['人工费', 12, 42, 0, 58],['人工费', 15, 40, 0, 60],['人工费', 19, 42, 0, 58],['人工费', 22, 45, 0, 55],['人工费', 25, 52, 0, 48],['人工费', 28, 57, 0, 43],['人工费', 32, 59, 0, 41],['人工费', 36, 62, 0, 38],['人工费', 39, 65, 0, 35],['人工费', 41, 68, 0, 32],['人工费', 44, 70, 0, 30],['人工费', 47, 72, 0, 28],['人工费', 51, 73, 0, 27],['人工费', 54, 74, 0, 26],
+    ['人工费', 10, 10, 0, 90],['人工费', 15, 14, 0, 86],['人工费', 19, 21, 0, 79],['人工费', 23, 21, 0, 79],['人工费', 27, 26, 0, 74],['人工费', 31, 29, 0, 71],['人工费', 36, 31, 0, 69],['人工费', 40, 35, 0, 65],['人工费', 44, 39, 0, 61],['人工费', 48, 41, 0, 59],['人工费', 54, 43, 0, 57],['人工费', 56, 46, 0, 54],['人工费', 60, 48, 0, 52],['人工费', 63, 51, 0, 49],['人工费', 65, 53, 0, 47],['人工费', 67, 57, 0, 43],['人工费', 68, 60, 0, 40],['人工费', 70, 63, 0, 37],
+    ['人工费', 12, 17, 0, 83],['人工费', 17, 18, 0, 82],['人工费', 22, 18, 0, 82],['人工费', 27, 22, 0, 78],['人工费', 31, 26, 0, 74],['人工费', 35, 29, 0, 71],['人工费', 40, 32, 0, 68],['人工费', 44, 36, 0, 64],['人工费', 48, 40, 0, 60],['人工费', 53, 42, 0, 58],['人工费', 58, 43, 0, 57],['人工费', 61, 46, 0, 54],['人工费', 65, 48, 0, 52],['人工费', 68, 50, 0, 50],['人工费', 70, 52, 0, 48],['人工费', 72, 56, 0, 44],['人工费', 73, 59, 0, 41],['人工费', 75, 61, 0, 39],
+    ['人工费', 6, 17, 0, 83],['人工费', 9, 22, 0, 78],['人工费', 12, 33, 0, 67],['人工费', 15, 40, 0, 60],['人工费', 19, 42, 0, 58],['人工费', 23, 43, 0, 57],['人工费', 26, 50, 0, 50],['人工费', 30, 53, 0, 47],['人工费', 34, 56, 0, 44],['人工费', 37, 59, 0, 41],['人工费', 43, 58, 0, 42],['人工费', 43, 65, 0, 35],['人工费', 47, 67, 0, 33],['人工费', 50, 68, 0, 32],['人工费', 54, 69, 0, 31],['人工费', 58, 69, 0, 31],['人工费', 62, 70, 0, 30],['人工费', 65, 70, 0, 30]
+],
+ [['人工费', 35, 50, 0, 50],['人工费', 35, 50, 0, 50],['人工费', 35, 50, 0, 50],['人工费', 13, 25, 0, 75],['人工费', 35, 50, 0, 50],['人工费', 15, 20, 80, 0], ['人工费', 13, 25, 75, 0],['人工费', 13, 25, 75, 0],['人工费', 35, 50, 0, 50],]
+    ],
+    "GCLMC": [
+     ["第二册第1-5章(定额2-1~2-390)", "第二册第6章(定额2-391~2-9999)", "第三册静置设备制作(定额3-1~3-615)",
+                            "第三册除静置设备制作以外(定额3-616~3-9999)", "第四册", 
+                            "第五册", "第六册", "第七册", "第八册", "第九册", "第十册",
+                              "第十一册刷油工程(定额11-51~11-329)", 
+                              "第十一册防腐蚀工程(定额11-330~11-1689)", "第十一册绝热工程(定额11-1690~11-2327)", "第十一册除锈工程(定额11-1~11-50)刷油工程", "第十一册除锈工程(定额11-1~11-50)防腐蚀工程"],
+    ["第一册第1-6章(定额1-1~1-571)10-15m",
+                           "第一册第1-6章(定额1-1~1-571)15-20m",
+                           "第一册第1-6章(定额1-1~1-571)20-25m",
+                           "第一册第1-6章(定额1-1~1-571)25-30m",
+                           "第一册第1-6章(定额1-1~1-571)30-40m",
+                           "第一册第1-6章(定额1-1~1-571)40m以上",
+                           "第一册第8-14章(定额1-672~1-9999)10-15m",
+                           "第一册第8-14章(定额1-672~1-9999)15-20m",
+                           "第一册第8-14章(定额1-672~1-9999)20-25m",
+                           "第一册第8-14章(定额1-672~1-9999)25-30m",
+                           "第一册第8-14章(定额1-672~1-9999)30-40m",
+                           "第一册第8-14章(定额1-672~1-9999)40m以上",
+                           "第四册",
+                           "第五册5m以上到10m以内", 
+                           "第五册10-20m", 
+                           "第五册20m以上", 
+                           "第六册", "第七册", 
+                           "第九册5m以上到8m以内",
+                            "第九册8-12m",
+                            "第九册12-16m",
+                            "第九册16-20m",
+                            "第十册3.6-8m以内",
+                            "第十册8-12m以内",
+                            "第十册12-16m以内",
+                            "第十册16-20m",
+                           "第十一册6-20m",
+                           "第十一册20-30m",
+                           "第十一册30-40m",
+                           "第十一册40-50m",
+                           "第十一册50-60m",
+                           "第十一册60-70m",
+                           "第十一册80m以上",
+                           ],
+          ["第一册第1-6章", "第一册第8-14章", "第二册",
+                            "第三册", "第四册", 
+                            "第五册", "第六册", "第七册", "第八册", "第九册", 
+                              "第十一册"],
+          ["第一册第1-6章", "第一册第8-14章", "第二册",
+                            "第三册", "第四册", 
+                            "第五册", "第六册", "第七册", "第八册", "第九册", 
+                              "第十一册"],
+          [//di 4 ce
+          "9层或30m以内", 
+                           "12层或40m以内",
+                           "15层或50m以内",
+                            "18层或60m以内",
+                            "21层或70m以内",
+                            "24层或80m以内",
+                            "27层或90m以内",
+                            "30层或100m以内",
+                            "33层或110m以内",
+                            "36层或120m以内",
+                            "40层或130m以内",
+                            "42层或140m以内",
+                            "45层或150m以内",
+                            "48层或160m以内",
+                            "51层或170m以内",
+                            "54层或180m以内",
+                            "57层或190m以内",
+                            "60层或200m以内",
+          ],
+          [//di 5 ce
+          "9层或30m以内", 
+                           "12层或40m以内",
+                           "15层或50m以内",
+                            "18层或60m以内",
+                            "21层或70m以内",
+                            "24层或80m以内",
+                            "27层或90m以内",
+                            "30层或100m以内",
+                            "33层或110m以内",
+                            "36层或120m以内",
+                            "40层或130m以内",
+                            "42层或140m以内",
+                            "45层或150m以内",
+                            "48层或160m以内",
+                            "51层或170m以内",
+                            "54层或180m以内",
+                            "57层或190m以内",
+                            "60层或200m以内",
+          ],
+          [//di 7 ce
+          "9层或30m以内", 
+                           "12层或40m以内",
+                           "15层或50m以内",
+                            "18层或60m以内",
+                            "21层或70m以内",
+                            "24层或80m以内",
+                            "27层或90m以内",
+                            "30层或100m以内",
+                            "33层或110m以内",
+                            "36层或120m以内",
+                            "40层或130m以内",
+                            "42层或140m以内",
+                            "45层或150m以内",
+                            "48层或160m以内",
+                            "51层或170m以内",
+                            "54层或180m以内",
+                            "57层或190m以内",
+                            "60层或200m以内",
+          ],
+          [//di 9 ce
+          "9层或30m以内", 
+                           "12层或40m以内",
+                           "15层或50m以内",
+                            "18层或60m以内",
+                            "21层或70m以内",
+                            "24层或80m以内",
+                            "27层或90m以内",
+                            "30层或100m以内",
+                            "33层或110m以内",
+                            "36层或120m以内",
+                            "40层或130m以内",
+                            "42层或140m以内",
+                            "45层或150m以内",
+                            "48层或160m以内",
+                            "51层或170m以内",
+                            "54层或180m以内",
+                            "57层或190m以内",
+                            "60层或200m以内",
+          ],
+          [//di 10 ce
+          "9层或30m以内", 
+                           "12层或40m以内",
+                           "15层或50m以内",
+                            "18层或60m以内",
+                            "21层或70m以内",
+                            "24层或80m以内",
+                            "27层或90m以内",
+                            "30层或100m以内",
+                            "33层或110m以内",
+                            "36层或120m以内",
+                            "40层或130m以内",
+                            "42层或140m以内",
+                            "45层或150m以内",
+                            "48层或160m以内",
+                            "51层或170m以内",
+                            "54层或180m以内",
+                            "57层或190m以内",
+                            "60层或200m以内",
+          ],
+          [// di 11 ce
+              "(按通风空调工程)9层或30m以内", 
+                           "(按通风空调工程)12层或40m以内",
+                           "(按通风空调工程)15层或50m以内",
+                            "(按通风空调工程)18层或60m以内",
+                            "(按通风空调工程)21层或70m以内",
+                            "(按通风空调工程)24层或80m以内",
+                            "(按通风空调工程)27层或90m以内",
+                            "(按通风空调工程)30层或100m以内",
+                            "(按通风空调工程)33层或110m以内",
+                            "(按通风空调工程)36层或120m以内",
+                            "(按通风空调工程)40层或130m以内",
+                            "(按通风空调工程)42层或140m以内",
+                            "(按通风空调工程)45层或150m以内",
+                            "(按通风空调工程)48层或160m以内",
+                            "(按通风空调工程)51层或170m以内",
+                            "(按通风空调工程)54层或180m以内",
+                            "(按通风空调工程)57层或190m以内",
+                            "(按通风空调工程)60层或200m以内",
+                             "(按消防工程)9层或30m以内", 
+                           "(按消防工程)12层或40m以内",
+                           "(按消防工程)15层或50m以内",
+                            "(按消防工程)18层或60m以内",
+                            "(按消防工程)21层或70m以内",
+                            "(按消防工程)24层或80m以内",
+                            "(按消防工程)27层或90m以内",
+                            "(按消防工程)30层或100m以内",
+                            "(按消防工程)33层或110m以内",
+                            "(按消防工程)36层或120m以内",
+                            "(按消防工程)40层或130m以内",
+                            "(按消防工程)42层或140m以内",
+                            "(按消防工程)45层或150m以内",
+                            "(按消防工程)48层或160m以内",
+                            "(按消防工程)51层或170m以内",
+                            "(按消防工程)54层或180m以内",
+                            "(按消防工程)57层或190m以内",
+                            "(按消防工程)60层或200m以内",
+                               "(按给排水、采暖工程)9层或30m以内", 
+                           "(按给排水、采暖工程)12层或40m以内",
+                           "(按给排水、采暖工程)15层或50m以内",
+                            "(按给排水、采暖工程)18层或60m以内",
+                            "(按给排水、采暖工程)21层或70m以内",
+                            "(按给排水、采暖工程)24层或80m以内",
+                            "(按给排水、采暖工程)27层或90m以内",
+                            "(按给排水、采暖工程)30层或100m以内",
+                            "(按给排水、采暖工程)33层或110m以内",
+                            "(按给排水、采暖工程)36层或120m以内",
+                            "(按给排水、采暖工程)40层或130m以内",
+                            "(按给排水、采暖工程)42层或140m以内",
+                            "(按给排水、采暖工程)45层或150m以内",
+                            "(按给排水、采暖工程)48层或160m以内",
+                            "(按给排水、采暖工程)51层或170m以内",
+                            "(按给排水、采暖工程)54层或180m以内",
+                            "(按给排水、采暖工程)57层或190m以内",
+                            "(按给排水、采暖工程)60层或200m以内",
+                               "(按电气工程)9层或30m以内", 
+                           "(按电气工程)12层或40m以内",
+                           "(按电气工程)15层或50m以内",
+                            "(按电气工程)18层或60m以内",
+                            "(按电气工程)21层或70m以内",
+                            "(按电气工程)24层或80m以内",
+                            "(按电气工程)27层或90m以内",
+                            "(按电气工程)30层或100m以内",
+                            "(按电气工程)33层或110m以内",
+                            "(按电气工程)36层或120m以内",
+                            "(按电气工程)40层或130m以内",
+                            "(按电气工程)42层或140m以内",
+                            "(按电气工程)45层或150m以内",
+                            "(按电气工程)48层或160m以内",
+                            "(按电气工程)51层或170m以内",
+                            "(按电气工程)54层或180m以内",
+                            "(按电气工程)57层或190m以内",
+                            "(按电气工程)60层或200m以内",
+          ],
+      [
+      "第一册 站内工艺系统", 
+                            "第三册 站内工艺系统", "第四册 站内工艺系统", 
+                             "第七册", "第八册 站内工艺系统",  
+                              "第十册供暖器具安装", "第十册空调水工程管道安装", "第十册空调水工程管道附件", "第十一册 站内工艺系统"
+      ]
+    ],
+    "sm": [
+     ["第1-5章取人工费*10%,其中工资占25%,材料占75%", "第6章取人工费*5%,其中工资占25%,材料占75%", "静置设备制作取人工费*5%,其中工资占25%,材料占75%", "除静置设备制作以外的取人工费*10%,其中工资占25%,材料占75%", "取人工费*4%,其中工资占25%,材料占75%.10kv以下架空线路除外", "按单位工程人工费*4%计算,其中工资占25%", "取人工费*4%,其中工资占25%", "取人工费*3%,其中工资占25%,材料占75%", "取人工费*7%,其中工资占25%,注意单独承担的麦迪管道工程,不计取脚手架费用", "取人工费*5%,其中工资占25%", "取人工费*5%,其中工资占25%,材料占75%", "刷油工程取人工费*8%,其中工资占25%,材料占75%", "防腐蚀工程取人工费*12%,其中工资占25%,材料占75%", "绝热工程取人工费*20%,其中工资占25%,材料占75%", "刷油工程取人工费的8%,其中人工工资占25%", "防腐蚀工程取人工费的12%,其中人工工资占25%"],
+     [ "取人工费+机械费的25%", "取人工费+机械费的35%", "取人工费+机械费的45%", "取人工费+机械费的55%", "取人工费+机械费的70%", "取人工费+机械费的90%", "取人工费+机械费的25%", "取人工费+机械费的35%", "取人工费+机械费的45%", "取人工费+机械费的55%", "取人工费+机械费的70%", "取人工费+机械费的90%", "按人工费的33%.操作物高度离楼地面5m以上,20m以下的电器安装工程,已考虑超高因素的定额项目除外", "按人工费*25%计算", "按40%计算", "按60%计算" , "当操作高度距离楼地面6.00m以上按人工费*15%计算" , "按人工费*10%计算", "按15%计算", "按20%计算", "按25%计算", "按人工费*10%计算", "按人工费*15%计算", "按人工费*20%计算","按人工费*25%计算", "取人工费+机械费的30%", "取人工费+机械费的40%","取人工费+机械费的50%","取人工费+机械费的60%","取人工费+机械费的70%","取人工费+机械费的80%","取人工费+机械费的90%","取人工费+机械费的100%"],
+    ["取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%",],
+    ["取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%","取人工费*10%",],
+    ["按人工费的6%计算", "按人工费的9%计算", "按人工费的12%计算", "按人工费的15%计算", "按人工费的19%计算", "按人工费的23%计算", "按人工费的26%计算", "按人工费的30%计算", "按人工费的34%计算", "按人工费的37%计算", "按人工费的43%计算", "按人工费的43%计算", "按人工费的47%计算", "按人工费的50%计算", "按人工费的54%计算", "按人工费的58%计算", "按人工费的62%计算", "按人工费的65%计算"],
+    ["按人工费的1%计算", "按人工费的2%计算", "按人工费的4%计算", "按人工费的6%计算", "按人工费的8%计算", "按人工费的10%计算", "按人工费的13%计算", "按人工费的16%计算", "按人工费的19%计算", "按人工费的22%计算", "按人工费的25%计算", "按人工费的28%计算", "按人工费的31%计算", "按人工费的34%计算", "按人工费的37%计算", "按人工费的40%计算", "按人工费的43%计算", "按人工费的46%计算"],
+    ["按人工费的3%计算", "按人工费的5%计算", "按人工费的7%计算", "按人工费的10%计算", "按人工费的12%计算", "按人工费的15%计算", "按人工费的19%计算", "按人工费的22%计算", "按人工费的25%计算", "按人工费的28%计算", "按人工费的32%计算", "按人工费的36%计算", "按人工费的39%计算", "按人工费的41%计算", "按人工费的44%计算", "按人工费的47%计算", "按人工费的51%计算", "按人工费的54%计算"],
+    ["按人工费的10%计算", "按人工费的15%计算", "按人工费的19%计算", "按人工费的23%计算", "按人工费的27%计算", "按人工费的31%计算", "按人工费的36%计算", "按人工费的40%计算", "按人工费的44%计算", "按人工费的48%计算", "按人工费的54%计算", "按人工费的56%计算", "按人工费的60%计算", "按人工费的63%计算", "按人工费的65%计算", "按人工费的67%计算", "按人工费的68%计算", "按人工费的70%计算"],
+    ["按人工费的12%计算", "按人工费的17%计算", "按人工费的22%计算", "按人工费的27%计算", "按人工费的31%计算", "按人工费的35%计算", "按人工费的40%计算", "按人工费的44%计算", "按人工费的48%计算", "按人工费的53%计算", "按人工费的58%计算", "按人工费的61%计算", "按人工费的65%计算", "按人工费的68%计算", "按人工费的70%计算", "按人工费的72%计算", "按人工费的73%计算", "按人工费的75%计算"],
+    [
+    "按人工费的3%计算", "按人工费的5%计算", "按人工费的7%计算", "按人工费的10%计算", "按人工费的12%计算", "按人工费的15%计算", "按人工费的19%计算", "按人工费的22%计算", "按人工费的25%计算", "按人工费的28%计算", "按人工费的32%计算", "按人工费的36%计算", "按人工费的39%计算", "按人工费的41%计算", "按人工费的44%计算", "按人工费的47%计算", "按人工费的51%计算", "按人工费的54%计算",
+    "按人工费的10%计算", "按人工费的15%计算", "按人工费的19%计算", "按人工费的23%计算", "按人工费的27%计算", "按人工费的31%计算", "按人工费的36%计算", "按人工费的40%计算", "按人工费的44%计算", "按人工费的48%计算", "按人工费的54%计算", "按人工费的56%计算", "按人工费的60%计算", "按人工费的63%计算", "按人工费的65%计算", "按人工费的67%计算", "按人工费的68%计算", "按人工费的70%计算",
+    "按人工费的12%计算", "按人工费的17%计算", "按人工费的22%计算", "按人工费的27%计算", "按人工费的31%计算", "按人工费的35%计算", "按人工费的40%计算", "按人工费的44%计算", "按人工费的48%计算", "按人工费的53%计算", "按人工费的58%计算", "按人工费的61%计算", "按人工费的65%计算", "按人工费的68%计算", "按人工费的70%计算", "按人工费的72%计算", "按人工费的73%计算", "按人工费的75%计算",
+    "按人工费的6%计算", "按人工费的9%计算", "按人工费的12%计算", "按人工费的15%计算", "按人工费的19%计算", "按人工费的23%计算", "按人工费的26%计算", "按人工费的30%计算", "按人工费的34%计算", "按人工费的37%计算", "按人工费的43%计算", "按人工费的43%计算", "按人工费的47%计算", "按人工费的50%计算", "按人工费的54%计算", "按人工费的58%计算", "按人工费的62%计算", "按人工费的65%计算",
+    ],
+    ["制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "取人工费*13%计算,其中人工工资占25%", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费),其中人工工资占50%", "取人工费*15%", "按人工费13%计取", "按人工费13%计取", "制冷站(库)、空气压缩站、乙炔发生器、水压机蓄势站、小型制氧站、煤气站等工程的系统调试费,按各站工艺系统内全部安装工程人工费的35%计算(不包括间接费)", ],
+    ]
+};
+
+export const tjazfy = (debh, gclmc) => {
+    if (debh.includes("19-19")) {
+        
+        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%';
+        result['azfytag'] = ['人工费',5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-20")) {
+        
+        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'] = '取人工费的7.5%';
+        result['azfytag'] = ['人工费',7.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-21")) {
+        
+        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'] = '取人工费的10%';
+        result['azfytag'] = ['人工费',10,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-22")) {
+        
+        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'] = '取人工费的12.5%';
+        result['azfytag'] = ['人工费',12.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-23")) {
+        
+        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'] = '取人工费的15%';
+        result['azfytag'] = ['人工费',15,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-24")) {
+        
+        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'] = '取人工费的17.5%';
+        result['azfytag'] = ['人工费',17.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-25")) {
+        
+        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'] = '取人工费的20%';
+        result['azfytag'] = ['人工费',20,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-26")) {
+        
+        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'] = '取人工费的22.5%';
+        result['azfytag'] = ['人工费',22.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-27")) {
+        
+        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'] = '取人工费的25%';
+        result['azfytag'] = ['人工费',25,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-28")) {
+        
+        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'] = '取人工费的27.5%';
+        result['azfytag'] = ['人工费',27.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-29")) {
+        
+        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'] = '取人工费的30%';
+        result['azfytag'] = ['人工费',30,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-30")) {
+        
+        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'] = '取人工费的32.5%';
+        result['azfytag'] = ['人工费',32.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-31")) {
+        
+        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'] = '取人工费的35%';
+        result['azfytag'] = ['人工费',35,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-32")) {
+        
+        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'] = '取人工费的37.5%';
+        result['azfytag'] = ['人工费',37.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-33")) {
+        
+        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'] = '取人工费的40%';
+        result['azfytag'] = ['人工费',40,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-34")) {
+        
+        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'] = '取人工费的42.5%';
+        result['azfytag'] = ['人工费',42.5,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-35")) {
+        
+        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'] = '取人工费的45%';
+        result['azfytag'] = ['人工费',45,100,0,0];
+        return result;
+    }
+    else if (debh.includes("19-36")) {
+        
+        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'] = '取人工费的47.5%';
+        result['azfytag'] = ['人工费',47.5,100,0,0];
+        return result;
+    }
+
+    else {
+        return null;
+    }
+};
+
+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")) {
+            let index = predef['GCLMC'][0].indexOf(gclmc);
+            let rate = predef['rate'][0][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][0][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("-F2")) {
+            let index = predef['GCLMC'][1].indexOf(gclmc);
+            let rate = predef['rate'][1][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][1][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("-F4")) {
+            let index = predef['GCLMC'][2].indexOf(gclmc);
+            let rate = predef['rate'][2][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][2][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("-F5")) {
+            let index = predef['GCLMC'][3].indexOf(gclmc);
+            let rate = predef['rate'][3][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][3][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("4-F3")) {
+            let index = predef['GCLMC'][4].indexOf(gclmc);
+            let rate = predef['rate'][4][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][4][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("5-F3")) {
+            let index = predef['GCLMC'][5].indexOf(gclmc);
+            let rate = predef['rate'][5][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][5][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("7-F3")) {
+            let index = predef['GCLMC'][6].indexOf(gclmc);
+            let rate = predef['rate'][6][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][6][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("9-F3")) {
+            let index = predef['GCLMC'][7].indexOf(gclmc);
+            let rate = predef['rate'][7][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][7][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("10-F3")) {
+            let index = predef['GCLMC'][8].indexOf(gclmc);
+            let rate = predef['rate'][8][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][8][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("11-F3")) {
+            let index = predef['GCLMC'][9].indexOf(gclmc);
+            let rate = predef['rate'][9][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][9][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+       if (debh.includes("-F6")) {
+            let index = predef['GCLMC'][10].indexOf(gclmc);
+            let rate = predef['rate'][10][index];
+            let result = {};
+            result['rgde'] = [{'CLBH': '0000FE', 'CLMC': '人工费', 'JLDW': '%', 'YSJG': '0', 'gr': rate[2],'gf': '0' }];
+            result['clde'] = [{'CLBH': '1000FE', 'CLMC': '材料费', 'JLDW': '%', 'YSJG': '0', 'SL': rate[3],'HJ': '0' }];
+            result['jxde'] = [{'jxbh': 'J000FE', 'jxmc': '机械费', 'DW': '%', 'tbdj': '0', 'sl': rate[4], 'hj': '0' }];
+            result['sm'] = predef['sm'][10][index];
+            result['azfytag'] = rate;
+            return result;
+       }
+    } else {
+        return null;
+    }
+
+
+};
+
+const tjpbsj = ['80010103',
+'80010104',
+'80010105',
+'80010106',
+'80050103',
+'80050104',
+'80050105',
+'80050106',
+'80010121',
+'80010122',
+'80010123',
+'80010124',
+'80010125',
+'80010161',
+'80070303',
+'80070304',
+'80070305',
+'80070306',
+'80010142',
+'80050120',
+'80050121',
+'80050122',
+'80050123',
+'80050124',
+'80050125',
+'80050126',
+'80050312',
+'80050127',
+'80050311',
+'80050128',
+'80050130',
+'80050317',
+'80050129',
+'80050133',
+'80030103',
+'80030104',
+'80030105',
+'80030106',
+'80030121',
+'80050503',
+'80071505',
+'80071506',
+'80070905',
+'80070906',
+'80070907',
+'80090325',
+'80090326',
+'80071521',
+'80071511',
+'80070721',
+'80090324',
+'80071307',
+'80071331',
+'80090314',
+'80090315',
+'80071321',
+'80050108',
+'80050111',
+'80010341'];
+const tjpbsjchai = [['80010103', 202.0, 273],
+['80010103', 1.61, 277],
+['80010103', 0.3, 1173],
+['80010104', 217.0, 273],
+['80010104', 1.61, 277],
+['80010104', 0.3, 1173],
+['80010105', 223.0, 273],
+['80010105', 1.61, 277],
+['80010105', 0.3, 1173],
+['80010106', 253.0, 273],
+['80010106', 1.61, 277],
+['80010106', 0.3, 1173],
+['80050103', 174.0, 273],
+['80050103', 1.61, 277],
+['80050103', 0.1, 1369],
+['80050103', 0.3, 1173],
+['80050104', 202.0, 273],
+['80050104', 1.61, 277],
+['80050104', 0.08, 1369],
+['80050104', 0.3, 1173],
+['80050105', 230.0, 273],
+['80050105', 1.61, 277],
+['80050105', 0.05, 1369],
+['80050105', 0.3, 1173],
+['80050106', 258.0, 273],
+['80050106', 1.61, 277],
+['80050106', 0.03, 1369],
+['80050106', 0.3, 1173],
+['80010121', 765.0, 273],
+['80010121', 1.007, 277],
+['80010121', 0.3, 1173],
+['80010122', 644.0, 273],
+['80010122', 1.272, 277],
+['80010122', 0.3, 1173],
+['80010123', 557.0, 273],
+['80010123', 1.464, 277],
+['80010123', 0.3, 1173],
+['80010124', 490.0, 273],
+['80010124', 1.611, 277],
+['80010124', 0.3, 1173],
+['80010125', 408.0, 273],
+['80010125', 1.611, 277],
+['80010125', 0.3, 1173],
+['80010161', 359.0, 273],
+['80010161', 1.611, 277],
+['80010161', 0.15, 1173],
+['80070303', 765.0, 273],
+['80070303', 1.007, 277],
+['80070303', 38.25, 1371],
+['80070303', 0.3, 1173],
+['80070304', 644.0, 273],
+['80070304', 1.272, 277],
+['80070304', 32.2, 1371],
+['80070304', 0.3, 1173],
+['80070305', 557.0, 273],
+['80070305', 1.464, 277],
+['80070305', 27.85, 1371],
+['80070305', 0.3, 1173],
+['80070306', 490.0, 273],
+['80070306', 1.611, 277],
+['80070306', 24.5, 1371],
+['80070306', 0.3, 1173],
+['80010142', 644.0, 274],
+['80010142', 1.28, 277],
+['80010142', 0.3, 1173],
+['80050120', 185.0, 273],
+['80050120', 1.48, 277],
+['80050120', 0.31, 1369],
+['80050120', 0.6, 1173],
+['80050121', 130.0, 273],
+['80050121', 1.56, 277],
+['80050121', 0.32, 1369],
+['80050121', 0.6, 1173],
+['80050122', 340.0, 273],
+['80050122', 0.46, 277],
+['80050122', 0.56, 1369],
+['80050122', 0.6, 1173],
+['80050123', 306.0, 273],
+['80050123', 1.63, 277],
+['80050123', 0.13, 1369],
+['80050123', 0.6, 1173],
+['80050124', 382.0, 273],
+['80050124', 1.01, 277],
+['80050124', 0.32, 1369],
+['80050124', 0.6, 1173],
+['80050125', 204.0, 273],
+['80050125', 1.63, 277],
+['80050125', 0.17, 1369],
+['80050125', 0.6, 1173],
+['80050126', 466.0, 273],
+['80050126', 1.52, 277],
+['80050126', 0.04, 1369],
+['80050126', 0.6, 1173],
+['80050312', 371.0, 273],
+['80050312', 1.48, 277],
+['80050312', 0.15, 1369],
+['80050312', 0.6, 1173],
+['80050127', 278.0, 273],
+['80050127', 1.48, 277],
+['80050127', 0.23, 1369],
+['80050127', 0.6, 1173],
+['80050311', 453.0, 273],
+['80050311', 1.2, 277],
+['80050311', 0.19, 1369],
+['80050311', 0.6, 1173],
+['80050128', 510.0, 273],
+['80050128', 1.36, 277],
+['80050128', 0.08, 1369],
+['80050128', 0.6, 1173],
+['80050130', 583.0, 273],
+['80050130', 0.77, 277],
+['80050130', 0.24, 1369],
+['80050130', 0.6, 1173],
+['80050317', 467.0, 273],
+['80050317', 0.62, 277],
+['80050317', 0.39, 1369],
+['80050317', 0.6, 1173],
+['80050129', 391.0, 273],
+['80050129', 1.56, 277],
+['80050129', 0.1, 1369],
+['80050129', 0.6, 1173],
+['80050133', 242.0, 273],
+['80050133', 1.61, 277],
+['80050133', 0.1, 1369],
+['80050133', 0.6, 1173],
+['80030103', 1.47, 277],
+['80030103', 0.47, 1369],
+['80030103', 0.6, 1173],
+['80030104', 1.61, 277],
+['80030104', 0.4, 1369],
+['80030104', 0.6, 1173],
+['80030105', 1.61, 277],
+['80030105', 0.36, 1369],
+['80030105', 0.6, 1173],
+['80030106', 1.61, 277],
+['80030106', 0.25, 1369],
+['80030106', 0.6, 1173],
+['80030121', 1.63, 277],
+['80030121', 0.34, 1369],
+['80030121', 0.6, 1173],
+['80030121', 16.6, 114],
+['80050503', 224.0, 273],
+['80050503', 1.18, 277],
+['80050503', 0.37, 1369],
+['80050503', 0.6, 1173],
+['80050503', 26.63, 1381],
+['80071505', 1.56, 277],
+['80071505', 530.0, 292],
+['80071505', 275.0, 838],
+['80071506', 1.69, 277],
+['80071506', 468.0, 292],
+['80071506', 244.0, 838],
+['80070905', 312.96, 273],
+['80070905', 1.18, 1362],
+['80070905', 0.4, 1173],
+['80070906', 340.1, 273],
+['80070906', 1.14, 1362],
+['80070906', 0.4, 1173],
+['80070907', 411.48, 273],
+['80070907', 1.04, 1362],
+['80070907', 0.4, 1173],
+['80090325', 391.0, 293],
+['80090325', 0.672, 280],
+['80090325', 68.0, 1359],
+['80090325', 1129.0, 1380],
+['80090326', 1085.0, 273],
+['80090326', 0.32, 275],
+['80090326', 1650.0, 1358],
+['80090326', 0.4, 1173],
+['80071521', 408.0, 838],
+['80071521', 1.23, 1360],
+['80071521', 219.0, 1377],
+['80071521', 224.0, 1379],
+['80071511', 543.0, 293],
+['80071511', 1.547, 280],
+['80071511', 280.0, 838],
+['80070721', 458.0, 293],
+['80070721', 1.082, 280],
+['80070721', 0.416, 1370],
+['80070721', 412.0, 1541],
+['80070721', 70.0, 900],
+['80090324', 490.0, 273],
+['80090324', 2.467, 1361],
+['80090324', 0.4, 1173],
+['80071307', 668.0, 293],
+['80071307', 1.336, 280],
+['80071307', 337.0, 1372],
+['80071307', 167.0, 905],
+['80071307', 67.0, 906],
+['80071331', 663.0, 293],
+['80071331', 1.324, 280],
+['80071331', 233.49, 1372],
+['80071331', 17.0, 905],
+['80071331', 46.7, 906],
+['80071331', 108.0, 813],
+['80090314', 585.0, 293],
+['80090314', 1.138, 280],
+['80090314', 23.0, 909],
+['80090314', 325.3, 815],
+['80090314', 10.0, 879],
+['80090314', 10.0, 1375],
+['80090315', 599.0, 293],
+['80090315', 1.164, 280],
+['80090315', 332.6, 1373],
+['80090315', 23.5, 909],
+['80090315', 10.0, 879],
+['80090315', 10.0, 1375],
+['80071321', 655.0, 293],
+['80071321', 1.31, 280],
+['80071321', 165.0, 1372],
+['80071321', 14.0, 905],
+['80071321', 14.0, 906],
+['80071321', 33.0, 903],
+['80071321', 166.0, 894],
+['80050111', 731.0, 1526],
+['80050111', 0.95, 1527],
+['80050111', 0.4, 1173],
+['80050108', 466.0, 1526],
+['80050108', 1.03, 1527],
+['80050108', 0.4, 1173]];
+const tjpbcl = [['02290501', '麻刀', 'kg', 2.4, 114],
+['04010611', '水泥 32.5级', 'kg', 0.31, 273],
+['04010701', '白水泥', 'kg', 0.7, 274],
+['04030100', '黄砂', 't', 74.0, 275],
+['04030107', '中砂', 't', 69.37, 277],
+['04030133', '石英砂', 't', 180.0, 280],
+['04090602', '滑石粉', 'kg', 0.62, 292],
+['04090700', '石英粉', 'kg', 0.35, 293],
+['11410319', '呋喃树脂', 'kg', 18.0, 813],
+['11410324', '邻苯型不饱和聚酸树脂', 'kg', 20.0, 815],
+['11550105', '石油沥青 30#', 'kg', 5.5, 838],
+['11593507', '过氧化环乙酮二丁酯糊 50%', 'kg', 16.0, 879],
+['12060323', '煤焦油', 'kg', 2.8, 894],
+['12300325', '氟硅酸钠', 'kg', 2.8, 900],
+['12310303', '二甲苯', 'kg', 5.9, 903],
+['12310307', '乙二胺', 'kg', 15.0, 905],
+['12310308', '丙酮', 'kg', 6.0, 906],
+['12310317', '苯乙烯', 'kg', 9.7, 909],
+['31150101', '水', 'm3', 4.7, 1173],
+['01650104', '钢屑', 'kg', 2.4, 1358],
+['02070404', '聚硫橡胶', 'kg', 30.0, 1359],
+['04030121', '白云石砂 4#', 't', 133.0, 1360],
+['04030129', '重晶石砂', 't', 330.0, 1361],
+['04030139', '轻质砂', 'm3', 70.0, 1362],
+['04090120', '石灰膏', 'm3', 216.0, 1369],
+['04090605', '铸石粉', 't', 712.5, 1370],
+['04230108', '防水剂', 'kg', 5.0, 1371],
+['11410305', '环氧树脂 E42', 'kg', 19.95, 1372],
+['11410325', '双酚A不饱和聚脂树脂', 'kg', 19.0, 1373],
+['12310329', '环烷酸钴苯乙烯液', 'kg', 12.0, 1375],
+['13010102', '温石棉', 'kg', 7.79, 1377],
+['13160303', '硅藻土', 'kg', 0.38, 1379],
+['31052502', '硫磺', 'kg', 1.8, 1380],
+['31132509', '纸筋', 'kg', 1.5, 1381],
+['04010611', '复合硅酸盐水泥  32.5级', 'kg', 0.31, 1526],
+['04030107', '中(粗)砂', 't', 69.37, 1527],
+['12413531', '水玻璃', 'kg', 0.85, 1541]];
+
+const ylpbsj = ['62532',
+    '62542',
+    '62552',
+    '62562',
+    '62572',
+    '62582',
+    '62592',
+    '62602',
+    '62612',
+    '62622',
+    '62632',
+    '62643',
+    '62653',
+    '62662',
+    '62672',
+    '62682',
+    '62692',
+    '62702',
+    '62712',
+    '62722',
+    '62732',
+    '62742',
+    '62754',
+    '62762',
+    '62772',
+    '62792',
+    '62802',
+    '62812',
+    '62822',
+    '62832',
+    '62842',
+    '62852',
+    '62862',
+    '62863',
+    '62872',
+    '62882',
+    '62892',
+    '62902',
+    '62912',
+    '62922',
+    '62932',
+    '62944',
+    '63152',
+    '63162',
+    '63172',
+    '63332',
+    '63333']; 
+const ylpbsjchai =   [['62532', 0.3, 30181],
+['62532', 202.0, 29596],
+['62532', 1.61, 29714],
+['62542', 0.3, 30181],
+['62542', 217.0, 29596],
+['62542', 1.61, 29714],
+['62552', 0.3, 30181],
+['62552', 223.0, 29596],
+['62552', 1.61, 29714],
+['62562', 0.3, 30181],
+['62562', 253.0, 29596],
+['62562', 1.61, 29714],
+['62572', 0.3, 30181],
+['62572', 174.0, 29596],
+['62572', 1.61, 29714],
+['62572', 0.1, 29677],
+['62582', 0.3, 30181],
+['62582', 202.0, 29596],
+['62582', 1.61, 29714],
+['62582', 0.08, 29677],
+['62592', 0.3, 30181],
+['62592', 230.0, 29596],
+['62592', 1.61, 29714],
+['62592', 0.05, 29677],
+['62602', 0.3, 30181],
+['62602', 258.0, 29596],
+['62602', 1.61, 29714],
+['62602', 0.03, 29677],
+['62612', 0.3, 30181],
+['62612', 765.0, 29596],
+['62612', 1.007, 29714],
+['62622', 0.3, 30181],
+['62622', 644.0, 29596],
+['62622', 1.272, 29714],
+['62632', 0.3, 30181],
+['62632', 557.0, 29596],
+['62632', 1.464, 29714],
+['62643', 0.3, 30181],
+['62643', 490.0, 29596],
+['62643', 1.611, 29714],
+['62653', 0.3, 30181],
+['62653', 408.0, 29596],
+['62653', 1.611, 29714],
+['62662', 0.15, 30181],
+['62662', 359.0, 29596],
+['62662', 1.611, 29714],
+['62672', 0.3, 30181],
+['62672', 765.0, 29596],
+['62672', 1.007, 29714],
+['62672', 38.25, 29983],
+['62682', 0.3, 30181],
+['62682', 644.0, 29596],
+['62682', 1.272, 29714],
+['62682', 32.2, 29983],
+['62692', 0.3, 30181],
+['62692', 557.0, 29596],
+['62692', 1.464, 29714],
+['62692', 27.85, 29983],
+['62702', 0.3, 30181],
+['62702', 490.0, 29596],
+['62702', 1.611, 29714],
+['62702', 24.5, 29983],
+['62712', 0.3, 30181],
+['62712', 1.28, 29714],
+['62712', 644.0, 29595],
+['62722', 0.6, 30181],
+['62722', 185.0, 29596],
+['62722', 1.48, 29714],
+['62722', 0.31, 29677],
+['62732', 0.6, 30181],
+['62732', 130.0, 29596],
+['62732', 1.56, 29714],
+['62732', 0.32, 29677],
+['62742', 0.6, 30181],
+['62742', 340.0, 29596],
+['62742', 0.46, 29714],
+['62742', 0.56, 29677],
+['62754', 0.6, 30181],
+['62754', 306.0, 29596],
+['62754', 1.63, 29714],
+['62754', 0.13, 29677],
+['62762', 0.6, 30181],
+['62762', 382.0, 29596],
+['62762', 1.01, 29714],
+['62762', 0.32, 29677],
+['62772', 0.6, 30181],
+['62772', 204.0, 29596],
+['62772', 1.63, 29714],
+['62772', 0.17, 29677],
+['62792', 0.6, 30181],
+['62792', 371.0, 29596],
+['62792', 1.48, 29714],
+['62792', 0.15, 29677],
+['62802', 0.6, 30181],
+['62802', 278.0, 29596],
+['62802', 1.48, 29714],
+['62802', 0.23, 29677],
+['62812', 0.6, 30181],
+['62812', 453.0, 29596],
+['62812', 1.2, 29714],
+['62812', 0.19, 29677],
+['62822', 0.6, 30181],
+['62822', 510.0, 29596],
+['62822', 1.36, 29714],
+['62822', 0.08, 29677],
+['62832', 0.6, 30181],
+['62832', 583.0, 29596],
+['62832', 0.77, 29714],
+['62832', 0.24, 29677],
+['62842', 0.6, 30181],
+['62842', 467.0, 29596],
+['62842', 0.62, 29714],
+['62842', 0.39, 29677],
+['62852', 0.6, 30181],
+['62852', 391.0, 29596],
+['62852', 1.56, 29714],
+['62852', 0.1, 29677],
+['62862', 0.6, 30181],
+['62862', 242.0, 29596],
+['62862', 1.61, 29714],
+['62862', 0.1, 29677],
+['62863', 0.6, 30181],
+['62863', 466.0, 29596],
+['62863', 1.52, 29714],
+['62863', 0.04, 29677],
+['62872', 0.6, 30181],
+['62872', 1.47, 29714],
+['62872', 0.47, 29677],
+['62882', 0.6, 30181],
+['62882', 1.61, 29714],
+['62882', 0.4, 29677],
+['62892', 0.6, 30181],
+['62892', 1.61, 29714],
+['62892', 0.36, 29677],
+['62902', 0.6, 30181],
+['62902', 1.61, 29714],
+['62902', 0.25, 29677],
+['62912', 0.3, 30181],
+['62912', 945.0, 29596],
+['62912', 1.19, 29611],
+['62922', 0.3, 30181],
+['62922', 709.0, 29596],
+['62922', 1.38, 29611],
+['62932', 0.3, 30181],
+['62932', 567.0, 29596],
+['62932', 1.52, 29611],
+['62944', 0.3, 30181],
+['62944', 473.0, 29596],
+['62944', 1.6, 29611],
+['63152', 0.6, 30181],
+['63152', 1.63, 29714],
+['63152', 16.6, 30165],
+['63152', 0.34, 29677],
+['63162', 0.6, 30181],
+['63162', 224.0, 29596],
+['63162', 26.63, 30188],
+['63162', 1.18, 29714],
+['63162', 0.37, 29677],
+['63172', 0.5, 30181],
+['63172', 998.23, 29596],
+['63172', 24.21, 30188],
+['63172', 0.34, 29677],
+['63172', 0.005, 31054],
+['63332', 1.56, 29714],
+['63332', 275.0, 30140],
+['63332', 530.0, 30134],
+['63333', 1.69, 29714],
+['63333', 244.0, 30140],
+['63333', 468.0, 30134]];
+const ylpbcl = [['0430061', '白水泥', 'kg', 0.52, 29595],
+['0430080', '水泥 32.5级', 'kg', 0.3, 29596],
+['0530135', '白石子', 't', 106.3, 29611],
+['0530490', '石灰膏', 'm3', 118.0, 29677],
+['0530720', '中砂', 't', 36.5, 29714],
+['1730060', '防水剂', 'kg', 1.52, 29983],
+['2230080', '滑石粉', 'kg', 0.45, 30134],
+['2230131', '石油沥青 30#', 'kg', 3.69, 30140],
+['2330290', '麻刀', 'kg', 2.0, 30165],
+['2330450', '水', 'm3', 4.1, 30181],
+['2330520', '纸筋', 'kg', 0.5, 30188],
+['2359999', '其它材料费(调整)', '元', 1.0, 31054]];
+
+
+const xstjpbsj = ['0304912001',
+    '0304912002',
+    '0304912003',
+    '0304912004',
+    '0304912005',
+    '0304912006',
+    '0304912007',
+    '0304912008',
+    '0304913001',
+    '0304913002',
+    '0304913003',
+    '0304913004',
+    '0304913005',
+    '0304913006',
+    '0304913007',
+    '0304913008',
+    '0304913009',
+    '0304913010',
+    '0304913012',
+    '0304913013',
+    '0304913014',
+    '0304913015',
+    '0304913016',
+    '0304913017',
+    '0304913018',
+    '0304913019',
+    '0304913020',
+    '0304913021',
+    '0304913022',
+    '0304913023',
+    '0304913024',
+    '0304913025',
+    '0304913026',
+    '0304913027',
+    '0304913028',
+    '0304913029',
+    '0304913030',
+    '0304913031',
+    '0304913071',
+    '0304913072',
+    '0304914008',
+    '0304914009',
+    '0304914015',
+    '0304913011',
+    '0304916001',
+    '0304916002',
+    '0304916003',
+    '0304916004',
+    '0304916005',
+    '0304916006',
+    '0304916007'];
+
+const xstjpbsjchai = [['0304912001', 202.0, 263],
+['0304912001', 1.61, 5],
+['0304912001', 0.3, 353],
+['0304912002', 217.0, 263],
+['0304912002', 1.61, 5],
+['0304912002', 0.3, 353],
+['0304912003', 223.0, 263],
+['0304912003', 1.61, 5],
+['0304912003', 0.3, 353],
+['0304912004', 253.0, 263],
+['0304912004', 1.61, 5],
+['0304912004', 0.3, 353],
+['0304912005', 174.0, 263],
+['0304912005', 1.61, 5],
+['0304912005', 0.1, 38],
+['0304912005', 0.3, 353],
+['0304912006', 202.0, 263],
+['0304912006', 1.61, 5],
+['0304912006', 0.08, 38],
+['0304912006', 0.3, 353],
+['0304912007', 230.0, 263],
+['0304912007', 1.61, 5],
+['0304912007', 0.05, 38],
+['0304912007', 0.3, 353],
+['0304912008', 258.0, 263],
+['0304912008', 1.61, 5],
+['0304912008', 0.03, 38],
+['0304912008', 0.3, 353],
+['0304913001', 765.0, 263],
+['0304913001', 1.007, 5],
+['0304913001', 0.3, 353],
+['0304913002', 644.0, 263],
+['0304913002', 1.272, 5],
+['0304913002', 0.3, 353],
+['0304913003', 557.0, 263],
+['0304913003', 1.464, 5],
+['0304913003', 0.3, 353],
+['0304913004', 490.0, 263],
+['0304913004', 1.611, 5],
+['0304913004', 0.3, 353],
+['0304913005', 408.0, 263],
+['0304913005', 1.611, 5],
+['0304913005', 0.3, 353],
+['0304913006', 359.0, 263],
+['0304913006', 1.611, 5],
+['0304913006', 0.15, 353],
+['0304913012', 644.0, 266],
+['0304913012', 1.28, 5],
+['0304913012', 0.3, 353],
+['0304913013', 185.0, 263],
+['0304913013', 0.31, 38],
+['0304913013', 1.48, 5],
+['0304913013', 0.3, 353],
+['0304913014', 130.0, 263],
+['0304913014', 0.32, 38],
+['0304913014', 1.56, 5],
+['0304913014', 0.3, 353],
+['0304913015', 340.0, 263],
+['0304913015', 0.56, 38],
+['0304913015', 0.46, 5],
+['0304913015', 0.3, 353],
+['0304913016', 306.0, 263],
+['0304913016', 0.13, 38],
+['0304913016', 1.63, 5],
+['0304913016', 0.3, 353],
+['0304913017', 382.0, 263],
+['0304913017', 0.32, 38],
+['0304913017', 1.01, 5],
+['0304913017', 0.3, 353],
+['0304913018', 204.0, 263],
+['0304913018', 0.17, 38],
+['0304913018', 1.63, 5],
+['0304913018', 0.3, 353],
+['0304913019', 466.0, 263],
+['0304913019', 0.04, 38],
+['0304913019', 1.52, 5],
+['0304913019', 0.3, 353],
+['0304913020', 371.0, 263],
+['0304913020', 0.15, 38],
+['0304913020', 1.48, 5],
+['0304913020', 0.3, 353],
+['0304913021', 278.0, 263],
+['0304913021', 0.23, 38],
+['0304913021', 1.48, 5],
+['0304913021', 0.3, 353],
+['0304913022', 453.0, 263],
+['0304913022', 0.19, 38],
+['0304913022', 1.2, 5],
+['0304913022', 0.3, 353],
+['0304913023', 510.0, 263],
+['0304913023', 0.08, 38],
+['0304913023', 1.36, 5],
+['0304913023', 0.3, 353],
+['0304913024', 583.0, 263],
+['0304913024', 0.24, 38],
+['0304913024', 0.77, 5],
+['0304913024', 0.3, 353],
+['0304913025', 467.0, 263],
+['0304913025', 0.39, 38],
+['0304913025', 0.62, 5],
+['0304913025', 0.3, 353],
+['0304913026', 391.0, 263],
+['0304913026', 0.1, 38],
+['0304913026', 1.56, 5],
+['0304913026', 0.3, 353],
+['0304913027', 242.0, 263],
+['0304913027', 0.1, 38],
+['0304913027', 1.61, 5],
+['0304913027', 0.3, 353],
+['0304913028', 0.47, 38],
+['0304913028', 1.47, 5],
+['0304913028', 0.3, 353],
+['0304913029', 0.4, 38],
+['0304913029', 1.61, 5],
+['0304913029', 0.3, 353],
+['0304913030', 0.36, 38],
+['0304913030', 1.61, 5],
+['0304913030', 0.3, 353],
+['0304913031', 0.25, 38],
+['0304913031', 1.61, 5],
+['0304913031', 0.3, 353],
+['0304913071', 0.34, 38],
+['0304913071', 1.63, 5],
+['0304913071', 16.6, 1198],
+['0304913071', 0.3, 353],
+['0304913072', 224.0, 263],
+['0304913072', 0.37, 38],
+['0304913072', 1.18, 5],
+['0304913072', 26.63, 47],
+['0304913072', 0.3, 353],
+['0304914008', 1.56, 5],
+['0304914008', 275.0, 1085],
+['0304914008', 530.0, 41],
+['0304914009', 1.69, 5],
+['0304914009', 244.0, 1085],
+['0304914009', 468.0, 41],
+['0304914015', 1085.0, 263],
+['0304914015', 0.32, 6],
+['0304914015', 1650.0, 864],
+['0304914015', 0.4, 353],
+['0304913007', 765.0, 263],
+['0304913007', 1.007, 5],
+['0304913007', 38.25, 1305],
+['0304913007', 0.3, 353],
+['0304913008', 644.0, 263],
+['0304913008', 1.272, 5],
+['0304913008', 32.2, 1305],
+['0304913008', 0.3, 353],
+['0304913009', 557.0, 263],
+['0304913009', 1.464, 5],
+['0304913009', 27.85, 1305],
+['0304913009', 0.3, 353],
+['0304913010', 490.0, 263],
+['0304913010', 1.611, 5],
+['0304913010', 24.5, 1305],
+['0304913010', 0.3, 353],
+['0304913011', 408.0, 263],
+['0304913011', 1.611, 5],
+['0304913011', 0.3, 353],
+['0304913011', 20.4, 1305],
+['0304916001', 312.96, 263],
+['0304916001', 1.18, 12],
+['0304916001', 0.4, 353],
+['0304916002', 340.1, 263],
+['0304916002', 1.14, 12],
+['0304916002', 0.4, 353],
+['0304916003', 411.48, 263],
+['0304916003', 1.04, 12],
+['0304916003', 0.4, 353],
+['0304916004', 180.46, 263],
+['0304916004', 1.13, 12],
+['0304916004', 0.12, 38],
+['0304916004', 0.4, 353],
+['0304916005', 262.65, 263],
+['0304916005', 0.99, 12],
+['0304916005', 0.13, 38],
+['0304916005', 0.4, 353],
+['0304916006', 281.51, 263],
+['0304916006', 0.94, 12],
+['0304916006', 0.14, 38],
+['0304916006', 0.4, 353],
+['0304916007', 312.96, 263],
+['0304916007', 0.92, 12],
+['0304916007', 0.13, 38],
+['0304916007', 0.4, 353]];
+
+const xstjpbcl = [['0101020201', '中砂', 't', 68.5, 5],
+['0101020401', '砂', 't', 59.0, 6],
+['0101070501', '轻质砂 JML', 'm3', 70.0, 12],
+['0105010201', '石灰膏', 'm3', 160.0, 38],
+['0105050201', '滑石粉', 'kg', 0.45, 41],
+['0105060402', '纸筋', 'kg', 0.5, 47],
+['0301010102', '水泥 32.5级', 'kg', 0.31, 263],
+['0301030100', '白水泥', 'kg', 0.58, 266],
+['0612070102', '水', 'm3', 4.1, 353],
+['0512010304', '钢屑', 'kg', 0.76, 864],
+['0604010302', '石油沥青30#', 'kg', 3.69, 1085],
+['0608013501', '麻刀', 'kg', 2.0, 1198],
+['0609100611', '防水剂', 'kg', 1.52, 1305]];
+   
+export const addChildren = (zhuanye, bianhao, hl, bc, key) => {
+    if (zhuanye == 40) {
+        if (ylpbsj.includes(bianhao)) {
+            let result = [];
+            for (let i = 0; i < ylpbsjchai.length; i++) {
+                if (ylpbsjchai[i][0] == bianhao) {
+                   let  rcjid = ylpbsjchai[i][2];
+                   let sl = ylpbsjchai[i][1];
+                   for(let j = 0; j < ylpbcl.length; j++ ) {
+                    if (ylpbcl[j][4] == rcjid) {
+                        result.push(['', ylpbcl[j][0], ylpbcl[j][1], '', ylpbcl[j][2], ylpbcl[j][3], '', '', '2', '', Number(hl) * Number(sl),
+                        Number(hl) * Number(sl) * Number(ylpbcl[j][3]), '', '', '', '', key.concat('-').concat(ylpbcl[j][0]), bc,  ]);
+                    }
+                   }
+                }
+            }
+            return result;
+        } else {
+            return [];
+        }
+    }
+    else if (zhuanye == 50 || zhuanye == 60) {
+        if (xstjpbsj.includes(bianhao)) {
+            let result = [];
+            for (let i = 0; i < xstjpbsjchai.length; i++) {
+                if (xstjpbsjchai[i][0] == bianhao) {
+                   let  rcjid = xstjpbsjchai[i][2];
+                   let sl = xstjpbsjchai[i][1];
+                   for(let j = 0; j < xstjpbcl.length; j++ ) {
+                    if (xstjpbcl[j][4] == rcjid) {
+                        result.push(['', xstjpbcl[j][0], xstjpbcl[j][1], '', xstjpbcl[j][2], xstjpbcl[j][3], '', '', '2', '', Number(hl) * Number(sl),
+                        Number(hl) * Number(sl) * Number(xstjpbcl[j][3]), '', '', '', '', key.concat('-').concat(xstjpbcl[j][0]), bc,  ]);
+                    }
+                   }
+                }
+            }
+            return result;
+        } else {
+            return [];
+        }
+    }
+    
+    else {
+        if (tjpbsj.includes(bianhao)) {
+            let result = [];
+            for (let i = 0; i < tjpbsjchai.length; i++) {
+                if (tjpbsjchai[i][0] == bianhao) {
+                   let  rcjid = tjpbsjchai[i][2];
+                   let sl = tjpbsjchai[i][1];
+                   for(let j = 0; j < tjpbcl.length; j++ ) {
+                    if (tjpbcl[j][4] == rcjid) {
+                        result.push(['', tjpbcl[j][0], tjpbcl[j][1], '', tjpbcl[j][2], tjpbcl[j][3], '', '', '2', '', Number(hl) * Number(sl),
+                        Number(hl) * Number(sl) * Number(tjpbcl[j][3]), '', '', '', '', key.concat('-').concat(tjpbcl[j][0]), bc,  ]);
+                    }
+                   }
+                }
+            }
+            return result;
+        } else {
+            return [];
+        }
+    }
+};