|
@@ -1,14 +1,21 @@
|
|
<template>
|
|
<template>
|
|
- <!-- <a-table :columns="columns" :data-source="data" bordered :scroll="{ x: 4750 }" :pagination="ipagination" rowKey="id"> -->
|
|
|
|
- <a-table :columns="columns" :data-source="data" bordered :scroll="{ x: 4750 }" :pagination="false" rowKey="id">
|
|
|
|
- </a-table>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <!-- <a-table :columns="columns" :data-source="data" bordered :scroll="{ x: 4750 }" :pagination="ipagination" rowKey="id"> -->
|
|
|
|
+ <a-table :columns="columns" :data-source="tableData" bordered :scroll="{ x: 4750 }" :pagination="false" rowKey="id">
|
|
|
|
+ </a-table>
|
|
|
|
+ <div>单选/多选</div>
|
|
|
|
+ <lineBarChart :xAxisData="xAxisData" :seriesData="seriesData" style="height: 300px;"></lineBarChart>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+import lineBarChart from './components/lineBarChart.vue'
|
|
|
|
+
|
|
const columns = [
|
|
const columns = [
|
|
{
|
|
{
|
|
title:'任务号',
|
|
title:'任务号',
|
|
fixed:"left",
|
|
fixed:"left",
|
|
- dataIndex: 'taskno',
|
|
|
|
|
|
+ dataIndex: 'taskno'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'任务名称',
|
|
title:'任务名称',
|
|
@@ -44,97 +51,116 @@ const columns = [
|
|
{
|
|
{
|
|
title:'研制数量',
|
|
title:'研制数量',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'yzsl'
|
|
|
|
|
|
+ dataIndex: 'yzsl',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'单台收入',
|
|
title:'单台收入',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'oneIncome'
|
|
|
|
|
|
+ dataIndex: 'oneIncome',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'单台成本',
|
|
title:'单台成本',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'oneCost'
|
|
|
|
|
|
+ dataIndex: 'oneCost',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'单台利润',
|
|
title:'单台利润',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'oneProfit'
|
|
|
|
|
|
+ dataIndex: 'oneProfit',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'利润额',
|
|
title:'利润额',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'lre'
|
|
|
|
|
|
+ dataIndex: 'lre',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'利润率',
|
|
title:'利润率',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'lrl'
|
|
|
|
|
|
+ dataIndex: 'lrl',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'预估价',
|
|
title:'预估价',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'estimationcoat'
|
|
|
|
|
|
+ dataIndex: 'estimationcoat',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'合同额',
|
|
title:'合同额',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'contractfpe',
|
|
dataIndex: 'contractfpe',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'已收款',
|
|
title:'已收款',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'taskmoney',
|
|
dataIndex: 'taskmoney',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'总成本',
|
|
title:'总成本',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'zcb'
|
|
|
|
|
|
+ dataIndex: 'zcb',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'材料费',
|
|
title:'材料费',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'clf',
|
|
dataIndex: 'clf',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'专用费',
|
|
title:'专用费',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'zyf',
|
|
dataIndex: 'zyf',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'事务费',
|
|
title:'事务费',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'swf',
|
|
dataIndex: 'swf',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'外协费',
|
|
title:'外协费',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'wxf',
|
|
dataIndex: 'wxf',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'燃料动力费',
|
|
title:'燃料动力费',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'rldlf'
|
|
|
|
|
|
+ dataIndex: 'rldlf',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'固定资产折旧',
|
|
title:'固定资产折旧',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'gdzczj'
|
|
|
|
|
|
+ dataIndex: 'gdzczj',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'工资及劳务费',
|
|
title:'工资及劳务费',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'gzjlwf'
|
|
|
|
|
|
+ dataIndex: 'gzjlwf',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'管理费',
|
|
title:'管理费',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'glf'
|
|
|
|
|
|
+ dataIndex: 'glf',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'装机成本',
|
|
title:'装机成本',
|
|
align:"center",
|
|
align:"center",
|
|
dataIndex: 'zjcb',
|
|
dataIndex: 'zjcb',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'内部试验',
|
|
title:'内部试验',
|
|
@@ -144,7 +170,8 @@ const columns = [
|
|
{
|
|
{
|
|
title:'工时(h)',
|
|
title:'工时(h)',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'workhour'
|
|
|
|
|
|
+ dataIndex: 'workhour',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'责任部门',
|
|
title:'责任部门',
|
|
@@ -209,47 +236,90 @@ const columns = [
|
|
{
|
|
{
|
|
title:'设计工时',
|
|
title:'设计工时',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'sjgs'
|
|
|
|
|
|
+ dataIndex: 'sjgs',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title:'生产工时',
|
|
title:'生产工时',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'scgs'
|
|
|
|
|
|
+ dataIndex: 'scgs',
|
|
|
|
+ isEcharts: true,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
-const data = [];
|
|
|
|
|
|
+const tableData = [];
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- props: {
|
|
|
|
- // 对比表格数据
|
|
|
|
- duibiList: {
|
|
|
|
- type: Array,
|
|
|
|
- default: ()=>{},
|
|
|
|
- required: false
|
|
|
|
- }
|
|
|
|
|
|
+ components: { lineBarChart },
|
|
|
|
+ props: {
|
|
|
|
+ // 对比表格数据
|
|
|
|
+ duibiList: {
|
|
|
|
+ type: Array,
|
|
|
|
+ default: ()=>{},
|
|
|
|
+ required: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ tableData,
|
|
|
|
+ columns,
|
|
|
|
+ /* 分页参数 */
|
|
|
|
+ ipagination:{
|
|
|
|
+ current: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageSizeOptions: ['10', '20', '30'],
|
|
|
|
+ showTotal: (total, range) => {
|
|
|
|
+ return range[0] + "-" + range[1] + " 共" + total + "条"
|
|
|
|
+ },
|
|
|
|
+ showQuickJumper: true,
|
|
|
|
+ showSizeChanger: true,
|
|
|
|
+ total: 0
|
|
|
|
+ },
|
|
|
|
+ //
|
|
|
|
+ // xAxisData: [],
|
|
|
|
+ // seriesData: [
|
|
|
|
+ // {
|
|
|
|
+ // name: '合同数量',
|
|
|
|
+ // data: [10, 11, 13, 11, 12, 12, 9],
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // name: '开票数量',
|
|
|
|
+ // data: [112, 58, 69, 78, 99, 102],
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // name: '金额',
|
|
|
|
+ // data: [33, 23, 56, 48, 46, 55],
|
|
|
|
+ // }
|
|
|
|
+ // ]
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ xAxisData(){
|
|
|
|
+ var data = this.tableData.map(res => {
|
|
|
|
+ return res.taskno
|
|
|
|
+ })
|
|
|
|
+ console.log(data)
|
|
|
|
+ return data
|
|
},
|
|
},
|
|
- data() {
|
|
|
|
|
|
+ seriesData(){
|
|
|
|
+ var arr = columns.filter(cur => cur.isEcharts)
|
|
|
|
+ var data = arr.map(res => {
|
|
|
|
+ var liData = this.tableData.map((item) => {
|
|
|
|
+ return item[res.dataIndex]
|
|
|
|
+ })
|
|
|
|
+ console.log(liData)
|
|
return {
|
|
return {
|
|
- data,
|
|
|
|
- columns,
|
|
|
|
- /* 分页参数 */
|
|
|
|
- ipagination:{
|
|
|
|
- current: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- pageSizeOptions: ['10', '20', '30'],
|
|
|
|
- showTotal: (total, range) => {
|
|
|
|
- return range[0] + "-" + range[1] + " 共" + total + "条"
|
|
|
|
- },
|
|
|
|
- showQuickJumper: true,
|
|
|
|
- showSizeChanger: true,
|
|
|
|
- total: 0
|
|
|
|
- },
|
|
|
|
- };
|
|
|
|
|
|
+ name: res.title,
|
|
|
|
+ data: liData
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ console.log(data)
|
|
|
|
+ return data
|
|
},
|
|
},
|
|
- created(){
|
|
|
|
- console.log(this.duibiList)
|
|
|
|
- this.data = this.duibiList
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ created(){
|
|
|
|
+ console.log(this.duibiList)
|
|
|
|
+ this.tableData = this.duibiList
|
|
|
|
+ }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|