浏览代码

拆单优化,委托查询优化

wyh 2 年之前
父节点
当前提交
1dc16f8e8f

+ 1 - 1
itdmWeb/src/views/module-iTDM/itdmGongdanMaster/itdmGongdanMasterList.vue

@@ -369,7 +369,7 @@ export default {
             console.log("提交",task)
             saveProjectJl(task).then((res) => {
               console.log("提交返回",task,res)
-              // gantt.init(that.$refs.gantt);
+              gantt.init(that.$refs.gantt);
               gantt.parse(that.tasks);
               // that.getHjlist(that.tasks.queryParam)
             })

+ 27 - 5
itdmWeb/src/views/module-iTDM/weituochaxun/ItdmWeituoYangpinList.vue

@@ -168,9 +168,9 @@
             title:'委托单位名称',
             align:"center",
             dataIndex: 'weituoClient',
-            // customRender:function (t,r,index) {
-            //   return {children: t,attrs: {rowSpan:r.rowSpan}};
-            // },
+            customRender:function (t,r,index) {
+              return {children: t,attrs: {rowSpan:r.rowSpan}};
+            },
             // customRender: (value, row, index) => {
             //   console.log(value, row, index);
             //   const obj = {
@@ -189,7 +189,10 @@
           {
             title:'样品名称',
             align:"center",
-            dataIndex: 'sampleName'
+            dataIndex: 'sampleName',
+            customRender:function (t,r,index) {
+              return {children: t,attrs: {rowSpan:r.rowSpan2}};
+            },
           },
           {
             title:'样品规格/型号',
@@ -335,12 +338,14 @@
           this.dataSource = res.result.records||res.result;
           //判断跨行
             let rowSpan = 0
+            let rowSpan2 = 0
             let weituoClient = ''
-            // let sampleName = ''
+            let sampleName = ''
             for (let i = that.dataSource.length-1; i >= 0; i--) {
               if (weituoClient == '') {
                 that.dataSource[i].rowSpan = 0
                 weituoClient = that.dataSource[i].weituoClient
+                rowSpan++
               } else {
                 if(weituoClient == that.dataSource[i].weituoClient){
                   that.dataSource[i].rowSpan = 0
@@ -353,8 +358,25 @@
                 }
                 
               }
+              if (sampleName == '') {
+                that.dataSource[i].rowSpan2 = 0
+                sampleName = that.dataSource[i].sampleName
+                rowSpan2++
+              } else {
+                if(sampleName == that.dataSource[i].sampleName){
+                  that.dataSource[i].rowSpan2 = 0
+                  rowSpan2++
+                }else{
+                  that.dataSource[i+1].rowSpan2 = rowSpan2
+                  that.dataSource[i].rowSpan2 = 0
+                  rowSpan2 = 1
+                  sampleName = that.dataSource[i].sampleName
+                }
+                
+              }
             }
             that.dataSource[0].rowSpan = rowSpan
+            that.dataSource[0].rowSpan2 = rowSpan2
             console.log(22222222222,that.dataSource)
           if(res.result.total)
           {