|
1
2
3
4
5
|
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
谭毅彬
authored
|
6
|
<a-row :gutter="24"></a-row>
|
|
7
8
9
10
11
12
|
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
|
谭毅彬
authored
|
13
|
<a-button v-has="'materialMultiple:add'" @click="handleAdd" type="primary" icon="plus">{{ $t('button.new') }}</a-button>
|
|
14
|
<a-button v-has="'materialMultiple:export'" type="primary" icon="download" @click="handleExportXls('物料单位换算')">{{ $t('button.export') }}</a-button>
|
谭毅彬
authored
|
15
|
<a-upload v-has="'materialMultiple:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
|
谭毅彬
authored
|
16
|
<a-button type="primary" icon="import">{{ $t('button.import') }}</a-button>
|
|
17
18
|
</a-upload>
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
19
|
<a-menu slot="overlay" v-has="'materialMultiple:deleteBatch'">
|
谭毅彬
authored
|
20
21
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />{{$t('button.delete')}}
</a-menu-item>
|
|
22
|
</a-menu>
|
谭毅彬
authored
|
23
24
25
|
<a-button style="margin-left: 8px">{{$t('button.multiSelectActions')}}
<a-icon type="down"/>
</a-button>
|
|
26
|
</a-dropdown>
|
谭毅彬
authored
|
27
|
<j-super-query :fieldList="superFieldList" v-has="'materialMultiple:superQuery'" @handleSuperQuery="handleSuperQuery"/>
|
|
28
29
30
31
32
|
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
谭毅彬
authored
|
33
34
35
|
<i class="anticon anticon-info-circle ant-alert-icon"></i> {{ $t('button.selected') }}
<a style="font-weight: 600">{{ selectedRowKeys.length }}</a> {{ $t('button.item') }}
<a style="margin-left: 24px" @click="onClearSelected">{{ $t('button.clearAll') }}</a>
|
|
36
37
38
39
40
|
</div>
<a-table
ref="table"
size="middle"
|
谭毅彬
authored
|
41
|
:scroll="{ x: true }"
|
|
42
43
44
45
46
47
|
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
|
谭毅彬
authored
|
48
|
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
49
|
class="j-table-force-nowrap"
|
谭毅彬
authored
|
50
51
52
53
54
55
56
|
@change="handleTableChange">
<span slot="companyCode" slot-scope="companyCode">
<a-tag :key="companyCode" color=blue>
{{ solutionCompany(companyCode) }}
</a-tag>
</span>
|
|
57
58
|
<span slot="action" slot-scope="text, record">
|
谭毅彬
authored
|
59
|
<a v-has="'materialMultiple:edit'" @click="handleEdit(record)">{{$t('button.edit')}}</a>
|
|
60
|
|
谭毅彬
authored
|
61
|
<a-divider type="vertical" />
|
|
62
|
<a-dropdown>
|
谭毅彬
authored
|
63
|
<a class="ant-dropdown-link">{{$t('button.more')}} <a-icon type="down"/></a>
|
|
64
65
|
<a-menu slot="overlay">
<a-menu-item>
|
谭毅彬
authored
|
66
|
<a @click="handleDetail(record)">{{$t('button.details')}}</a>
|
|
67
|
</a-menu-item>
|
|
68
|
<a-menu-item v-has="'materialMultiple:delete'">
|
谭毅彬
authored
|
69
70
|
<a-popconfirm :title="$t('button.deletingIt')" @confirm="() => handleDelete(record.id)">
<a>{{$t('button.delete')}}</a>
|
|
71
72
73
74
75
76
77
78
79
80
81
82
83
|
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<material-multiple-modal ref="modalForm" @ok="modalFormOk"></material-multiple-modal>
</a-card>
</template>
<script>
|
|
84
|
import '@/assets/less/TableExpand.less'
|
谭毅彬
authored
|
85
86
|
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
87
|
import MaterialMultipleModal from './modules/MaterialMultipleModal'
|
谭毅彬
authored
|
88
|
import {getCompanyList} from "@api/api"
|
|
89
|
|
|
90
91
92
93
94
95
96
97
98
|
export default {
name: 'MaterialMultipleList',
mixins: [JeecgListMixin, mixinDevice],
components: {
MaterialMultipleModal
},
data() {
return {
description: '物料单位换算管理页面',
|
谭毅彬
authored
|
99
|
companyList: [],
|
|
100
101
102
103
104
105
106
|
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
|
谭毅彬
authored
|
107
108
109
|
align: 'center',
customRender: function(t, r, index) {
return parseInt(index) + 1
|
|
110
111
|
}
},
|
|
112
113
|
{
title: '物料编码',
|
谭毅彬
authored
|
114
|
align: 'center',
|
|
115
116
117
118
|
dataIndex: 'materialCode'
},
{
title: '物料名称',
|
谭毅彬
authored
|
119
|
align: 'center',
|
|
120
121
122
123
|
dataIndex: 'materialName'
},
{
title: '物料规格',
|
谭毅彬
authored
|
124
|
align: 'center',
|
|
125
126
127
|
dataIndex: 'materialSpec'
},
{
|
谭毅彬
authored
|
128
|
title: '货主',
|
谭毅彬
authored
|
129
|
align: 'center',
|
谭毅彬
authored
|
130
131
132
|
dataIndex: 'companyCode',
key: 'companyCode',
scopedSlots: {customRender: 'companyCode'}
|
|
133
134
|
},
{
|
谭毅彬
authored
|
135
136
|
title: '基准单位',
align: 'center',
|
|
137
138
139
|
dataIndex: 'unit1'
},
{
|
谭毅彬
authored
|
140
141
|
title: '转换单位',
align: 'center',
|
|
142
143
144
|
dataIndex: 'unit2'
},
{
|
谭毅彬
authored
|
145
146
|
title: '转换比率',
align: 'center',
|
|
147
148
149
|
dataIndex: 'multiple'
},
{
|
谭毅彬
authored
|
150
|
title: this.$t('system.createBy'),
|
谭毅彬
authored
|
151
|
align: 'center',
|
|
152
153
154
|
dataIndex: 'createBy'
},
{
|
谭毅彬
authored
|
155
|
title: this.$t('system.createTime'),
|
谭毅彬
authored
|
156
|
align: 'center',
|
|
157
158
159
|
dataIndex: 'createTime'
},
{
|
谭毅彬
authored
|
160
|
title: this.$t('system.updater'),
|
谭毅彬
authored
|
161
|
align: 'center',
|
|
162
163
164
|
dataIndex: 'updateBy'
},
{
|
谭毅彬
authored
|
165
|
title: this.$t('system.updateTime'),
|
谭毅彬
authored
|
166
|
align: 'center',
|
|
167
168
169
|
dataIndex: 'updateTime'
},
{
|
谭毅彬
authored
|
170
|
title: this.$t('system.options'),
|
|
171
|
dataIndex: 'action',
|
谭毅彬
authored
|
172
173
|
align: 'center',
fixed: 'right',
|
|
174
|
width: 147,
|
谭毅彬
authored
|
175
|
scopedSlots: { customRender: 'action' }
|
|
176
177
178
|
}
],
url: {
|
谭毅彬
authored
|
179
180
181
182
183
|
list: '/config/materialMultiple/list',
delete: '/config/materialMultiple/delete',
deleteBatch: '/config/materialMultiple/deleteBatch',
exportXlsUrl: '/config/materialMultiple/exportXls',
importExcelUrl: 'config/materialMultiple/importExcel'
|
|
184
185
|
},
dictOptions: {},
|
谭毅彬
authored
|
186
|
superFieldList: []
|
|
187
188
189
|
}
},
created() {
|
谭毅彬
authored
|
190
|
this.getSuperFieldList()
|
谭毅彬
authored
|
191
|
this.loadFrom();
|
|
192
193
|
},
computed: {
|
谭毅彬
authored
|
194
195
196
|
importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
|
|
197
198
|
},
methods: {
|
谭毅彬
authored
|
199
|
initDictConfig() {},
|
谭毅彬
authored
|
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
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('')
},
|
|
217
|
getSuperFieldList() {
|
谭毅彬
authored
|
218
219
220
221
222
223
224
225
|
let fieldList = []
fieldList.push({ type: 'string', value: 'materialCode', text: '物料编码', dictCode: '' })
fieldList.push({ type: 'string', value: 'materialName', text: '物料名称', dictCode: '' })
fieldList.push({ type: 'string', value: 'materialSpec', text: '物料规格', dictCode: '' })
fieldList.push({ type: 'string', value: 'companyCode', text: '货主编码', dictCode: '' })
fieldList.push({ type: 'string', value: 'unit1', text: '基准单位', dictCode: '' })
fieldList.push({ type: 'string', value: 'unit2', text: '转换单位', dictCode: '' })
fieldList.push({ type: 'double', value: 'multiple', text: '转换比率', dictCode: '' })
|
|
226
|
this.superFieldList = fieldList
|
|
227
228
|
}
}
|
|
229
|
}
|
|
230
231
|
</script>
<style scoped>
|
|
232
|
@import '~@assets/less/common.less';
|
|
233
|
</style>
|