Xiaopeng Zhang 4 kuukautta sitten
vanhempi
commit
2ce5be1509
3 muutettua tiedostoa jossa 29 lisäystä ja 14 poistoa
  1. 27 12
      src/App2.js
  2. 1 1
      src/Djcs3.js
  3. 1 1
      src/Qingdan3.js

+ 27 - 12
src/App2.js

@@ -171,6 +171,8 @@ function a11yProps(index) {
     const [bctihuanClick, setBctihuanClick] = React.useState(null);
     const tihuanRowRef = React.useRef(null);
     const bctihuanRowRef = React.useRef(null);
+    const outlineRef = React.useRef(null);
+    const outlineLabelRef = React.useRef(null);
 
     const relation = React.useRef({});
     const columns =[
@@ -533,9 +535,11 @@ function a11yProps(index) {
     };
   
 
-    const clickCallback = (qdbm, debh, mc) => {
-      console.log('####################################zylb#####################'.concat(zylb.toString()));
-       //console.log(debh);
+    const clickCallback = (bt, qdbm, debh, mc) => {
+      
+       if (bt == 'Default') {
+        bt = outlineLabelRef.current;
+       }
        setExpandedQd(false);
        setExpandedDe(true);//1 jianzhu 2 zhuangshi 3 anzhuang 4 shizheng 5 yuanlin 6 guidao 7 xiushantujian 8 xiushananzhuang 9 xiushanjiagu  
        if (qdbm.startsWith("01")) {
@@ -544,7 +548,7 @@ function a11yProps(index) {
           suggestion = 50;
         }  
         setZhuanye(suggestion);
-          Service.generateSingleDingeXilie(suggestion, debh, mc).then(x=>{
+          Service.generateSingleDingeXilie(suggestion, debh, bt.concat(' ').concat(mc)).then(x=>{
             handleGenerateSingleDingeXilie(x);
            });
        
@@ -554,24 +558,23 @@ function a11yProps(index) {
           suggestion = 60;
         }   
         setZhuanye(suggestion);
-         Service.generateSingleDingeXilie(suggestion, debh, mc).then(x=>{
+         Service.generateSingleDingeXilie(suggestion, debh, bt.concat(' ').concat(mc)).then(x=>{
           handleGenerateSingleDingeXilie(x);
        });
        } else if (qdbm.startsWith("04")) {////市政
          setZhuanye(20);
-         Service.generateSingleDingeXilie(20, debh, mc).then(x=>{
+         Service.generateSingleDingeXilie(20, debh, bt.concat(' ').concat(mc)).then(x=>{
           handleGenerateSingleDingeXilie(x);
        });
        }
        else if (qdbm.startsWith("05")) {//园林
         setZhuanye(40);
-        Service.generateSingleDingeXilie(40, debh, mc).then(x=>{
+        Service.generateSingleDingeXilie(40, debh, bt.concat(' ').concat(mc)).then(x=>{
           handleGenerateSingleDingeXilie(x);
       });
        } else {
-        console.log('####################################zylb#####################'.concat(zylb.toString()));
-        setZhuanye(10);
-        Service.generateSingleDingeXilie(10, debh, mc).then(x=>{
+         setZhuanye(10);
+        Service.generateSingleDingeXilie(10, debh, bt.concat(' ').concat(mc)).then(x=>{
           handleGenerateSingleDingeXilie(x);
       });
        }
@@ -795,7 +798,17 @@ function a11yProps(index) {
         }
         else if (itemId.includes("qing dan xiang mu")) {
           let regex = /[0-9]*/; 
-          let id = itemId.match(regex)[0];     
+          let id = itemId.match(regex)[0];   
+          for (let i = 0; i < outlineRef.current.length; i++) {
+            if (outlineRef.current[i].hasOwnProperty('children')) {
+              let children = outlineRef.current[i]['children'];
+              for(let j = 0; j < children.length; j++) {
+                if (children[j]['id'] == id) {
+                  outlineLabelRef.current = children[j]['label'];
+                }
+              }
+            }
+          }    
           Service.generateQingdanxiangmu2(location["id"], id).then(x=>{
                   setValue("1");
                   setNest(false);
@@ -842,7 +855,8 @@ function a11yProps(index) {
         }
         else if (itemId.includes("qi ta xiang mu")) {
           let regex = /[0-9]*/; 
-          let id = itemId.match(regex)[0];     
+          let id = itemId.match(regex)[0];   
+          
           setValue("1");
           //setColumnHeaders(["序号", "名称", "取费基数", "计算基础", "金额", "类别"]);
           Service.generateQitaxiangmu2(location["id"], id).then(x=>{
@@ -1047,6 +1061,7 @@ function a11yProps(index) {
             Service.setJiagongcai(x);
             });
         Service.generateOutline2(location["id"]).then(x=>{
+          outlineRef.current = x;
           let y = x.map(z=>{
             z['key'] = z['id'];
             z['title'] = z['label'];

+ 1 - 1
src/Djcs3.js

@@ -179,7 +179,7 @@ export default function Djcs3({name, bh, rgde, jxde, clde, beizhu, beizhuFK, cli
                selectedRowKeysTableParent.current = row_parent['data']['key'];
 
 
-               clickCallback(row_parent['data']['清单编码'], row._row['data']['清单编码'], row._row['data']['名称']);
+               clickCallback('', row_parent['data']['清单编码'], row._row['data']['清单编码'], row._row['data']['名称']);
                Service.generateDingercj(name, bh,bt,row_parent['data']['清单编码'], row._row['data']['清单编码'], row._row['data']['单位'], row._row['data']['key']).then(x=>{
                               let y =[];
                               for (let i = 1; i < x[0].length; i++) {

+ 1 - 1
src/Qingdan3.js

@@ -476,7 +476,7 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                console.log(debm);
                let danwei = row._row['data']['单位'];
 
-               clickCallback(qdbm, debm, row._row['data']['名称']);/**dingercj need row key */
+               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 =[];