Browse Source

自定义薪资项

seyason 3 years ago
parent
commit
c15f8e0956
1 changed files with 38 additions and 9 deletions
  1. 38 9
      fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

+ 38 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -38,7 +38,21 @@
         ref="table"
         :height="300" style="width: 100%;">
             <el-table-column prop="name" label="姓名" sortable width="150"></el-table-column>
-            <el-table-column prop="monthCost" :label="customCols.monthCost"  width="150"></el-table-column>
+            <el-table-column :prop="index" :label="item" sortable show-overflow-tooltip v-for="(item, index) in tblCols"
+                       :key="index"></el-table-column>
+            <!-- <el-table-column prop="monthCost" label="customCols.monthCost"  width="150"></el-table-column>
+            <el-table-column prop="bonus" :label="customCols.bonus" ></el-table-column>
+            <el-table-column prop="allowance" :label="customCols.allowance" ></el-table-column>
+            <el-table-column prop="insuranceOld" :label="customCols.insuranceOld" ></el-table-column>
+            <el-table-column prop="insuranceMedical" :label="customCols.insuranceMedical" ></el-table-column>
+            <el-table-column prop="insuranceLosejob" :label="customCols.insuranceLosejob" ></el-table-column>
+            <el-table-column prop="insuranceInjury" :label="customCols.insuranceInjury" ></el-table-column>
+            <el-table-column prop="houseFund" :label="customCols.houseFund" ></el-table-column> -->
+            <!-- <el-table-column prop="field1" :label="customCols.field1" ></el-table-column>
+            <el-table-column prop="field2" :label="customCols.field2" ></el-table-column>
+            <el-table-column prop="field3" :label="customCols.field3" ></el-table-column> -->
+
+            <!-- <el-table-column prop="monthCost" :label="customCols.monthCost"  width="150"></el-table-column>
             <el-table-column prop="bonus" :label="customCols.bonus" ></el-table-column>
             <el-table-column prop="allowance" :label="customCols.allowance" ></el-table-column>
             <el-table-column prop="insuranceOld" :label="customCols.insuranceOld" ></el-table-column>
@@ -48,7 +62,8 @@
             <el-table-column prop="houseFund" :label="customCols.houseFund" ></el-table-column>
             <el-table-column prop="field1" :label="customCols.field1" ></el-table-column>
             <el-table-column prop="field2" :label="customCols.field2" ></el-table-column>
-            <el-table-column prop="field3" :label="customCols.field3" ></el-table-column>
+            <el-table-column prop="field3" :label="customCols.field3" ></el-table-column> -->
+
             <!-- <el-table-column v-for="(item,index) in customFieldList" :prop="item.prop" :label="item.label" :key="index">
                 
             </el-table-column> -->
@@ -281,6 +296,7 @@
     export default {
         data() {
             return {
+                tblCols:[],
                 costListRadio: 0,
                 costSettingLoading: false,
                 chosenNoReportUserIds:[],
@@ -299,7 +315,7 @@
                 assignNoProUser: false,
                 customFieldList:[],
                 itemDialog: false,
-                customCols:[],
+                customCols:{},
                 // showNPDialog: false,
                 npUserList:[],
                 hasNoProjectUsers: false,
@@ -598,7 +614,23 @@
                     res => {
                         if (res.code == "ok") {
                             this.customCols = res.data;
-                            this.$refs.table.doLayout();
+                            this.tblCols = [];
+                            this.tblCols.push(this.customCols.monthCost);
+                            this.tblCols.push(this.customCols.bonus);
+                            this.tblCols.push(this.customCols.allowance);
+                            this.tblCols.push(this.customCols.insuranceOld);
+                            this.tblCols.push(this.customCols.insuranceMedical);
+                            this.tblCols.push(this.customCols.insuranceLosejob);
+                            this.tblCols.push(this.customCols.insuranceInjury);
+                            if (this.customCols.field1 != null) {
+                                this.tblCols.push(this.customCols.field1);
+                            }
+                            if (this.customCols.field2 != null) {
+                                this.tblCols.push(this.customCols.field2);
+                            }
+                            if (this.customCols.field3 != null) {
+                                this.tblCols.push(this.customCols.field3);
+                            }
                         }});
                     
             },
@@ -881,11 +913,9 @@
 
         },
         created() {
-            this.getCustomColumn();
             var d = new Date();
             this.date = d.getFullYear() +'-'+ ((d.getMonth()+1) < 10? '0'+(d.getMonth()+1):d.getMonth()+1);
             
-            
         },
         mounted() {
             let height = window.innerHeight;
@@ -894,16 +924,15 @@
             window.onresize = function temp() {
                 that.tableHeight = window.innerHeight - 245;
             };
-            this.getList();
-            this.getCustomColumn();
             
+            this.getCustomColumn();
+            this.getList();
             // this.getProjects();
         },
         updated() {
             this.$nextTick(() => {
                 this.$refs['table'].doLayout();
             }) 
-            
         }
     };
 </script>