CompareA.vue
2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
  <div>
    <a-card style="min-width: 500px;">
      <p style="color: #00A0E9;font-size: 20px">部件I:{{this.ver1_1}}</p><p style="color: red;font-size: 20px">系统报工总工时:{{this.totalTime}}</p>
    </a-card>
    <a-table
      ref="table"
      size="middle"
      :scroll="{x:true}"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :loading="loading"
      :rowSelection="{selectedRowKeys: selectedRowKeys}"
      class="j-table-force-nowrap" >
    </a-table>
  </div>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import {queryCompareWorkList} from "../../../api/api";
  export default {
    name: "CompareA",
    props:['ver1','ver1_1'],
    mixins:[JeecgListMixin, mixinDevice],
    components:{
    },
    data () {
      return {
        dataSource:[],
        totalTime:'',
        columns: [
          {
            title:'部件名称',
            align:"center",
            dataIndex: 'materialname'
          },
          {
            title:'图号',
            align:"center",
            dataIndex: 'spec'
          },
          {
            title:'工艺',
            align:"center",
            dataIndex: 'name'
          },
          {
            title:'工时(分钟)',
            align:"center",
            dataIndex: 'time'
          },
          {
            title:'报工人',
            align:"center",
            dataIndex: 'realname'
          }
        ],
      }
    },
    created () {
    },
    methods: {
      search1(){
        var vers =this.ver1.split(",");
        let params = {
          'id': vers[0],
          'spec': vers[1]
        }
        queryCompareWorkList(params).then((res) => {
          if (res.success) {
            this.dataSource = res.result
          }
          let total = 0
          this.dataSource.forEach(data => {
            total +=Number.parseInt(data.time)
          })
          this.totalTime=total
        })
      }
    }
  }
</script>
<style scoped>
</style>