浏览代码

项目成本表格头冻结效果

yuhan 1 年之前
父节点
当前提交
b20a1b1f19

+ 14 - 12
src/components/layouts/UserLayout.vue

@@ -127,20 +127,22 @@
         width: 100%;
         bottom: 0;
         padding: 0 16px;
-        margin: 48px 0 24px;
+        // 修改框架
+        // margin: 48px 0 24px;
+        margin: 20px 0;
         text-align: center;
 
-        .links {
-          margin-bottom: 8px;
-          font-size: 14px;
-          a {
-            color: rgba(0, 0, 0, 0.45);
-            transition: all 0.3s;
-            &:not(:last-child) {
-              margin-right: 40px;
-            }
-          }
-        }
+        // .links {
+        //   margin-bottom: 8px;
+        //   font-size: 14px;
+        //   a {
+        //     color: rgba(0, 0, 0, 0.45);
+        //     transition: all 0.3s;
+        //     &:not(:last-child) {
+        //       margin-right: 40px;
+        //     }
+        //   }
+        // }
         .copyright {
           color: rgba(0, 0, 0, 0.45);
           font-size: 14px;

+ 3 - 1
src/components/page/GlobalFooter.vue

@@ -25,7 +25,9 @@
 <style lang="less" scoped>
   .footer {
     padding: 0 16px;
-    margin: 48px 0 24px;
+    // 修改框架
+    // margin: 48px 0 24px;
+    margin: 20px 0;
     text-align: center;
 
     .links {

+ 56 - 4
src/views/module_kzks/projectCostList/ProjectCostList.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-card :bordered="false">
+  <a-card :bordered="false" style="overflow: hidden;">
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -165,7 +165,7 @@
       <a-table
         ref="table"
         size="middle"
-        :scroll="{x:true}"
+        :scroll="{x:true,y: scrollHeight}"
         bordered
         rowKey="id"
         :columns="columns"
@@ -350,6 +350,7 @@ import { number } from 'echarts';
     },
     data () {
       return {
+        scrollHeight: 700,
         /* 分页参数 */
         ipagination:{
           current: 1,
@@ -409,7 +410,7 @@ import { number } from 'echarts';
             title:'任务号',
             fixed:"left",
             dataIndex: 'taskno',
-            width: 140,
+            width: 180,
             customHeaderCell:() => ({
               style: {
                 textAlign: 'center', // 表头居中
@@ -426,11 +427,13 @@ import { number } from 'echarts';
           {
             title:'型号',
             align:"center",
+            width: 120,
             dataIndex: 'xhname',
           },
           {
             title:'计划完成时间',
             align:"center",
+            width: 120,
             dataIndex: 'jhwcsj',
             customRender:function (text) {
               return !text?"":(text.length>10?text.substr(0,10):text)
@@ -439,11 +442,13 @@ import { number } from 'echarts';
           {
             title:'阶段',
             align:"center",
+            width: 120,
             dataIndex: 'yzjdname'
           },
           {
             title:'项目进度',
             align:"center",
+            width: 120,
             dataIndex: 'processpercent',
             customRender: (text, record) => {
               return record.id === 'amount'?null:parseInt(text)+ '%'
@@ -452,6 +457,7 @@ import { number } from 'echarts';
           {
             title:'成本进度',
             align:"center",
+            width: 120,
             dataIndex: 'costPercent',
             customRender: (text, record) => {
               return record.id === 'amount'?null:(Number(text) * 100).toFixed(0) + '%'
@@ -460,6 +466,7 @@ import { number } from 'echarts';
           {
             title:'已收款',
             align:"center",
+            width: 120,
             dataIndex: 'taskmoney',
             scopedSlots: {
               customRender: 'taskmoney',
@@ -469,6 +476,7 @@ import { number } from 'echarts';
           {
             title:'合同额',
             align:"center",
+            width: 120,
             dataIndex: 'contractfpe',
             scopedSlots: {
               customRender: 'contractfpe',
@@ -478,6 +486,7 @@ import { number } from 'echarts';
           {
             title:'预估价',
             align:"center",
+            width: 120,
             dataIndex: 'estimationcoat',
             customRender: (text, record) => {
               return record.contractfpe ? '-' : Number(text).toFixed(2)
@@ -486,6 +495,7 @@ import { number } from 'echarts';
           {
             title:'总成本',
             align:"center",
+            width: 120,
             dataIndex: 'zcb',
             customRender: (text) => {
               return (Number(text)/10000).toFixed(2)
@@ -494,6 +504,7 @@ import { number } from 'echarts';
           {
             title:'利润额',
             align:"center",
+            width: 120,
             dataIndex: 'lre',
             customRender: (text) => {
               return (Number(text)/10000).toFixed(2)
@@ -502,6 +513,7 @@ import { number } from 'echarts';
           {
             title:'利润率',
             align:"center",
+            width: 120,
             dataIndex: 'lrl',
             customRender: (text) => {
               return (Number(text) * 100).toFixed(1) + '%'
@@ -510,11 +522,13 @@ import { number } from 'echarts';
           {
             title:'研制数量',
             align:"center",
+            width: 120,
             dataIndex: 'yzsl'
           },
           {
             title:'单台利润',
             align:"center",
+            width: 120,
             dataIndex: 'oneProfit',
             customRender: (text, record) => {
               return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
@@ -523,6 +537,7 @@ import { number } from 'echarts';
           {
             title:'单台收入',
             align:"center",
+            width: 120,
             dataIndex: 'oneIncome',
             customRender: (text, record) => {
               return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
@@ -531,6 +546,7 @@ import { number } from 'echarts';
           {
             title:'单台成本',
             align:"center",
+            width: 120,
             dataIndex: 'oneCost',
             customRender: (text, record) => {
               return record.id === 'amount'?null:(Number(text)/10000).toFixed(2)
@@ -539,6 +555,7 @@ import { number } from 'echarts';
           {
             title:'材料预算',
             align:"center",
+            width: 120,
             dataIndex: 'clys',
             customRender: (text) => {
               return Number(text).toFixed(2)
@@ -547,6 +564,7 @@ import { number } from 'echarts';
           {
             title:'材料费',
             align:"center",
+            width: 120,
             dataIndex: 'clf',
             scopedSlots: {
               customRender: 'clf',
@@ -556,6 +574,7 @@ import { number } from 'echarts';
           {
             title:'专用费',
             align:"center",
+            width: 120,
             dataIndex: 'zyf',
             scopedSlots: {
               customRender: 'zyf',
@@ -565,6 +584,7 @@ import { number } from 'echarts';
           {
             title:'事务费',
             align:"center",
+            width: 120,
             dataIndex: 'swf',
             scopedSlots: {
               customRender: 'swf',
@@ -574,6 +594,7 @@ import { number } from 'echarts';
           {
             title:'外协预算',
             align:"center",
+            width: 120,
             dataIndex: 'wxys',
             customRender: (text) => {
               return Number(text).toFixed(2)
@@ -582,6 +603,7 @@ import { number } from 'echarts';
           {
             title:'外协费',
             align:"center",
+            width: 120,
             dataIndex: 'wxf',
             scopedSlots: {
               customRender: 'wxf',
@@ -591,6 +613,7 @@ import { number } from 'echarts';
           {
             title:'燃动费',
             align:"center",
+            width: 120,
             dataIndex: 'rldlf',
             customRender: (text) => {
               return (Number(text)/10000).toFixed(2)
@@ -599,6 +622,7 @@ import { number } from 'echarts';
           {
             title:'固资费',
             align:"center",
+            width: 120,
             dataIndex: 'gdzczj',
             customRender: (text) => {
               return (Number(text)/10000).toFixed(2)
@@ -607,6 +631,7 @@ import { number } from 'echarts';
           {
             title:'工时费',
             align:"center",
+            width: 120,
             dataIndex: 'gzjlwf',
             customRender: (text) => {
               return (Number(text)/10000).toFixed(2)
@@ -615,6 +640,7 @@ import { number } from 'echarts';
           {
             title:'管理费',
             align:"center",
+            width: 120,
             dataIndex: 'glf',
             customRender: (text) => {
               return (Number(text)/10000).toFixed(2)
@@ -623,6 +649,7 @@ import { number } from 'echarts';
           {
             title:'装机成本',
             align:"center",
+            width: 120,
             dataIndex: 'zjcb',
             scopedSlots: {
               customRender: 'zjcb',
@@ -632,11 +659,13 @@ import { number } from 'echarts';
           {
             title:'内部试验',
             align:"center",
+            width: 120,
             dataIndex: 'lbsy'
           },
           {
             title:'工时(h)',
             align:"center",
+            width: 120,
             dataIndex: 'workhour',
             scopedSlots: {
               customRender: 'workhour',
@@ -646,6 +675,7 @@ import { number } from 'echarts';
           {
             title:'责任部门',
             align:"center",
+            width: 120,
             dataIndex: 'zrbm'
           },
           // {
@@ -656,6 +686,7 @@ import { number } from 'echarts';
           {
             title:'下达部门',
             align:"center",
+            width: 120,
             dataIndex: 'jycs'
           },
           // {
@@ -666,66 +697,79 @@ import { number } from 'echarts';
           {
             title:'横向纵向',
             align:"center",
+            width: 120,
             dataIndex: 'hxzxname'
           },
           {
             title:'任务类型',
             align:"center",
+            width: 120,
             dataIndex: 'tasktype'
           },
           {
             title:'审计审价',
             align:"center",
+            width: 120,
             dataIndex: 'auditprice'
           },
           {
             title:'任务状态',
             align:"center",
+            width: 120,
             dataIndex: 'iflag'
           },
           {
             title:'提出单位简称',
             align:"center",
+            width: 120,
             dataIndex: 'brief'
           },
           {
             title:'父级任务',
             align:"center",
+            width: 120,
             dataIndex: 'reftaskno'
           },
           {
             title:'批产任务号',
             align:"center",
+            width: 120,
             dataIndex: 'pccode'
           },
           {
             title:'备产任务号',
             align:"center",
+            width: 120,
             dataIndex: 'bccode'
           },
           {
             title:'备料任务号',
             align:"center",
+            width: 120,
             dataIndex: 'blcode'
           },
           {
             title:'业务员',
             align:"center",
+            width: 120,
             dataIndex: 'businessManName'
           },
           {
             title:'主管设计师',
             align:"center",
+            width: 120,
             dataIndex: 'ywfzrname'
           },
           {
             title:'设计工时',
             align:"center",
+            width: 120,
             dataIndex: 'sjgs'
           },
           {
             title:'生产工时',
             align:"center",
+            width: 120,
             dataIndex: 'scgs'
           },
           // {
@@ -739,7 +783,7 @@ import { number } from 'echarts';
             dataIndex: 'action',
             align:"center",
             fixed:"right",
-            width: 100,
+            width: 150,
             scopedSlots: {
               // filterDropdown: 'filterDropdown',
               // filterIcon: 'filterIcon',
@@ -775,6 +819,14 @@ import { number } from 'echarts';
       this.initColumns();
       this.getSuperFieldList();
     },
+    mounted() {
+      console.log(window.innerHeight, this.$refs.table)
+      this.$nextTick(() => {
+        this.scrollHeight = window.innerHeight - 60 - 25 - 55 - 25
+        // this.scrollHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 60 - 52 - 50 - 56 - 60 - 34
+
+      })
+    },
     computed: {
       importExcelUrl: function(){
         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;