liuhj преди 1 седмица
родител
ревизия
33c3575b84
променени са 1 файла, в които са добавени 27 реда и са изтрити 7 реда
  1. 27 7
      src/components/OP/AffairsBackward.vue

+ 27 - 7
src/components/OP/AffairsBackward.vue

@@ -31,7 +31,10 @@
                 </div>
             </el-form>    
         </div>
-        <div style="margin-top: 20px;font-size: 15px;font-weight: 600;color: red;">PS:插入行与删除行并未进行保存操作,需要保存请点击保存按钮!!!</div>
+        <div style="display: flex;justify-content: space-between;align-items: center;">
+            <div style="margin-top: 20px;font-size: 15px;font-weight: 600;color: red;">PS:插入行与删除行并未进行保存操作,需要保存请点击保存按钮!!!</div>
+            <el-button size="mini" @click="pushxiangmu" type="primary">添加项目</el-button>
+        </div>
         <el-table :data="tableDatass" :span-method="objectSpanMethod" border style="width: 100%; ">
             <el-table-column prop="title" label="项目" width="180">
                 <template slot-scope="scope">
@@ -55,11 +58,11 @@
             </el-table-column>
              <el-table-column prop="remark" label="操作" width="150">
                 <template slot-scope="scope">
-                     <el-button class="czbtn" size="mini" type="primary" @click="insertTaskAbove(scope.$index,scope.row)">插入行↑</el-button>
+                    <el-button style="width:80px;" class="czbtn" size="mini" type="primary" @click="insertTaskAbove(scope.$index,scope.row)">插入行↑</el-button>
                     <br />
-                    <el-button style="margin: 10px 0;" size="mini" @click="deleterow(scope.$index,scope.row)" type="danger">删 除</el-button>
+                    <el-button style="margin: 10px 0;width:80px;" size="mini" @click="deleterow(scope.$index,scope.row)" type="danger">删 除</el-button>
                     <br />
-                    <el-button size="mini" @click="insertTaskBelow(scope.$index,scope.row)" type="primary">插入行↓</el-button>
+                    <el-button style="width:80px;" size="mini" @click="insertTaskBelow(scope.$index,scope.row)" type="primary">插入行↓</el-button>
                 </template>
             </el-table-column>
         </el-table>
@@ -389,7 +392,6 @@ export default {
                 }
             }
             this.porojectindex=val;
-            
             // for (let b = 0; b < this.porojectindex.length; b++) {
             //     // this.tableDatass.splice( this.porojectindex,1)
             //     for (let m = 0; m < this.porojectname.length; m++) {
@@ -397,11 +399,29 @@ export default {
             //         this.tableDatass.splice(this.porojectindex[b],1,this.porojectname[m])
             //     }
             // }
-            // this.tableDatass=this.porojectname.concat(this.tableDatass)
+            // this.tableDatass=this.porojectname.concat(this.tableDatass);
             this.unflattenData();
             this.flattenData();
             this.getSpanArr();
         },
+        //添加项目
+        pushxiangmu(){
+            this.unflattenData();
+            console.log(this.tableData);
+            var obj={
+                title:'新项目',
+                itmes:[{
+                    id:0,
+                    dataDetails:'',
+                    details:'',
+                    remark:'',
+                    identification:'新项目',
+                }]
+            }
+            this.tableData.push(obj);
+            this.flattenData();
+            this.getSpanArr();
+        },
         //获得焦点
         huodejiaodian(val){
             this.porojectname=[];
@@ -434,4 +454,4 @@ export default {
         margin-bottom: 0;
     }
 </style>
- 
+