Blame view

ant-design-vue-jeecg/src/views/system/task/TaskDetailHistoryList.vue 5.05 KB
陈翱 authored
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
<template>
  <a-card :bordered="false" :class="'cust-erp-sub-tab'">
    <div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{x:true}"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">

        <span slot='companyCode' slot-scope='companyCode'>
          <a-tag :key='companyCode' color='blue'>
            {{ solutionCompany(companyCode) }}
          </a-tag>
        </span>

        <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
          <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
            {{ inventoryStatus_dictText }}
          </a-tag>
        </span>

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt=""
               style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>
      </a-table>
    </div>
  </a-card>
</template>

<script>

import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import { getCompanyList } from '@api/api'

export default {
  name: "TaskDetailHistoryList",
  mixins: [JeecgListMixin],
  components: {},
  props: {
    mainId: {
      type: String,
      default: '',
      required: false
    }
  },
  watch: {
    mainId: {
      immediate: true,
      handler(val) {
        if (!this.mainId) {
          this.clearList()
        } else {
          this.queryParam['taskHeaderId'] = val
          this.loadData(1);
        }
      }
    }
  },
  data() {
    return {
      description: '任务表管理页面',
      disableMixinCreated: true,
      companyList: [],
      // 表头
      columns: [
        {
91
          title: this.$t('task.detailId'),
陈翱 authored
92
93
94
95
          align: "center",
          dataIndex: 'id'
        },
        {
96
          title: this.$t('inventory.company'),
陈翱 authored
97
98
99
100
101
102
          align: "center",
          dataIndex: 'companyCode',
          key: 'companyCode',
          scopedSlots: {customRender: 'companyCode'}
        },
        {
103
          title: this.$t('inventory.materialCode'),
陈翱 authored
104
105
106
107
          align: "center",
          dataIndex: 'materialCode'
        },
        {
108
          title: this.$t('inventory.materialName'),
陈翱 authored
109
110
111
112
          align: "center",
          dataIndex: 'materialName'
        },
        {
113
          title: this.$t('inventory.materialSpec'),
陈翱 authored
114
115
116
117
          align: "center",
          dataIndex: 'materialSpec'
        },
        {
118
          title: this.$t('inventory.materialUnit'),
陈翱 authored
119
120
121
122
          align: "center",
          dataIndex: 'materialUnit'
        },
        {
123
          title: this.$t('inventory.qty'),
陈翱 authored
124
125
126
127
          align: "center",
          dataIndex: 'qty'
        },
        {
128
          title: this.$t('inventory.batch'),
陈翱 authored
129
130
131
132
          align: "center",
          dataIndex: 'batch'
        },
        {
133
          title: this.$t('inventory.serialNumber'),
陈翱 authored
134
135
136
137
138
          align: "center",
          dataIndex: 'inventoryStatus_dictText',
          scopedSlots: {customRender: 'inventoryStatus_dictText'}
        },
        {
139
          title: this.$t('system.createBy'),
陈翱 authored
140
141
142
143
          align: "center",
          dataIndex: 'createBy'
        },
        {
144
          title: this.$t('system.createTime'),
陈翱 authored
145
146
147
148
          align: "center",
          dataIndex: 'createTime'
        },
        {
149
          title: this.$t('system.updater'),
陈翱 authored
150
151
152
153
          align: "center",
          dataIndex: 'updateBy'
        },
        {
154
          title: this.$t('system.updateTime'),
陈翱 authored
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
          align: "center",
          dataIndex: 'updateTime'
        }
      ],
      url: {
        list: "/taskHeaderHistory/taskHeaderHistory/listTaskDetailHistoryByMainId",
      },
      dictOptions: {
        taskType: [],
        isEmptyOut: [],
        isDoubleIn: [],
        status: [],
      }
    }
  },
  created() {
    this.loadFrom();
  },
  computed: {

  },
  methods: {
    loadFrom() {
      getCompanyList().then((res) => {
        if (res.success) {
          this.companyList = res.result
        }
      });
    },
    solutionCompany(value) {
      var actions = []
      Object.keys(this.companyList).some((key) => {
        if (this.companyList[key].code == ('' + value)) {
          actions.push(this.companyList[key].name)
          return true
        }
      })
      return actions.join('')
    },
    clearList() {
      this.dataSource = []
      this.selectedRowKeys = []
      this.ipagination.current = 1
    },

  }
}
</script>
<style scoped>
@import '~@assets/less/common.less'
</style>