|
1
2
3
4
5
6
7
8
|
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="容器类型">
|
|
9
10
11
12
13
14
15
16
17
18
|
<a-select
show-search
placeholder="请选择容器类型"
option-filter-prop="children"
v-model="queryParam.containerTypeCode"
>
<a-select-option v-for="item in containerTypeList" :key="item.name" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
|
|
19
20
21
22
23
24
25
|
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="物料编码">
<a-input placeholder="请输入物料编码" v-model="queryParam.materialCode"></a-input>
</a-form-item>
</a-col>
|
|
26
27
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="是否可用">
|
|
28
|
<j-dict-select-tag placeholder="请选择是否可用" v-model="queryParam.enable" dictCode="enable_status"/>
|
|
29
30
|
</a-form-item>
</a-col>
|
|
31
32
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
33
34
|
<a-button type="primary" @click="searchQuery" icon="search">{{ $t('button.search') }}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('button.reset') }}</a-button>
|
|
35
36
37
38
39
40
41
42
43
|
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
|
|
44
45
|
<a-button @click="handleAdd" v-has="'containerCapacity:add'" type="primary" icon="plus">{{ $t('button.new') }}</a-button>
<a-button v-has="'containerCapacity:export'" type="primary" icon="download" @click="handleExportXls('容器容量管理')">{{ $t('button.export') }}</a-button>
|
|
46
47
48
49
50
51
52
53
54
|
<a-upload
v-has="'containerCapacity:import'"
name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
@change="handleImportExcel"
>
|
|
55
|
<a-button type="primary" icon="import">{{ $t('button.import') }}</a-button>
|
|
56
57
|
</a-upload>
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
58
|
<a-menu slot="overlay" v-has="'containerCapacity:deleteBatch'">
|
|
59
|
<a-menu-item key="1" @click="batchDel">
|
|
60
|
<a-icon type="delete"/>{{$t('button.delete')}}
|
|
61
|
</a-menu-item>
|
|
62
|
</a-menu>
|
|
63
|
<a-button style="margin-left: 8px">{{$t('button.multiSelectActions')}}
|
|
64
|
<a-icon type="down"/>
|
|
65
|
</a-button>
|
|
66
|
</a-dropdown>
|
|
67
68
|
<j-super-query :fieldList="superFieldList" v-has="'containerCapacity:superQuery'"
@handleSuperQuery="handleSuperQuery"/>
|
|
69
70
71
72
73
|
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
|
74
75
76
|
<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>
|
|
77
78
79
80
81
|
</div>
<a-table
ref="table"
size="middle"
|
|
82
|
:scroll="{ x: true }"
|
|
83
84
85
86
87
88
|
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
|
|
89
|
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
90
|
class="j-table-force-nowrap"
|
|
91
92
93
94
95
96
97
|
@change="handleTableChange"
>
<span slot="containerTypeCode" slot-scope="containerTypeCode">
<a-tag :key="containerTypeCode" color="pink">
{{ solutionContainerType(containerTypeCode) }}
</a-tag>
</span>
|
|
98
99
100
101
102
103
|
<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>
|
|
104
105
106
107
108
109
110
|
<img
v-else
:src="getImgView(text)"
height="25px"
alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"
/>
|
|
111
112
113
|
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
|
114
|
<a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
|
|
115
116
117
118
|
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
|
|
119
|
<a v-has="'containerCapacity:edit'" @click="handleEdit(record)">{{$t('button.edit')}}<a-divider type="vertical"/></a>
|
|
120
|
<a-dropdown>
|
|
121
|
<a class="ant-dropdown-link">{{$t('button.more')}} <a-icon type="down"/></a>
|
|
122
123
|
<a-menu slot="overlay">
<a-menu-item>
|
|
124
|
<a @click="handleDetail(record)">{{$t('button.details')}}</a>
|
|
125
|
</a-menu-item>
|
|
126
|
<a-menu-item v-has="'containerCapacity:delete'">
|
|
127
128
|
<a-popconfirm :title="$t('button.deletingIt')" @confirm="() => handleDelete(record.id)">
<a>{{$t('button.delete')}}</a>
|
|
129
130
131
132
133
134
135
136
137
138
139
140
141
|
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<container-capacity-modal ref="modalForm" @ok="modalFormOk"></container-capacity-modal>
</a-card>
</template>
<script>
|
|
142
|
import '@/assets/less/TableExpand.less'
|
|
143
144
|
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
|
|
145
|
import ContainerCapacityModal from './modules/ContainerCapacityModal'
|
|
146
147
|
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import {getZoneList, getContainerTypeList} from '@/api/api'
|
|
148
|
|
|
149
150
151
152
153
154
155
156
157
|
export default {
name: 'ContainerCapacityList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ContainerCapacityModal
},
data() {
return {
description: '容器容量管理管理页面',
|
|
158
|
containerTypeList: [],
|
|
159
160
161
162
163
164
165
|
// 表头
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
|
|
166
|
align: 'center',
|
|
167
|
customRender: function (t, r, index) {
|
|
168
|
return parseInt(index) + 1
|
|
169
170
|
}
},
|
|
171
172
|
{
title: '容器类型',
|
|
173
174
175
|
align: 'center',
dataIndex: 'containerTypeCode',
key: 'containerTypeCode',
|
|
176
|
scopedSlots: {customRender: 'containerTypeCode'}
|
|
177
178
179
|
},
{
title: '物料编码',
|
|
180
|
align: 'center',
|
|
181
182
183
184
|
dataIndex: 'materialCode'
},
{
title: '物料名称',
|
|
185
|
align: 'center',
|
|
186
187
188
189
|
dataIndex: 'materialName'
},
{
title: '物料单位',
|
|
190
|
align: 'center',
|
|
191
192
193
194
|
dataIndex: 'materialUnit'
},
{
title: '存放数量',
|
|
195
|
align: 'center',
|
|
196
197
198
199
|
dataIndex: 'qty'
},
{
title: '是否可用',
|
|
200
|
align: 'center',
|
|
201
202
203
|
dataIndex: 'enable_dictText'
},
{
|
|
204
|
title: this.$t('system.createBy'),
|
|
205
|
align: 'center',
|
|
206
207
208
|
dataIndex: 'createBy'
},
{
|
|
209
|
title: this.$t('system.createTime'),
|
|
210
|
align: 'center',
|
|
211
212
213
|
dataIndex: 'createTime'
},
{
|
|
214
|
title: this.$t('system.updater'),
|
|
215
|
align: 'center',
|
|
216
217
218
|
dataIndex: 'updateBy'
},
{
|
|
219
|
title: this.$t('system.updateTime'),
|
|
220
|
align: 'center',
|
|
221
222
223
|
dataIndex: 'updateTime'
},
{
|
|
224
|
title: this.$t('system.options'),
|
|
225
|
dataIndex: 'action',
|
|
226
227
|
align: 'center',
fixed: 'right',
|
|
228
|
width: 147,
|
|
229
|
scopedSlots: {customRender: 'action'}
|
|
230
231
232
|
}
],
url: {
|
|
233
234
235
236
237
|
list: '/config/containerCapacity/list',
delete: '/config/containerCapacity/delete',
deleteBatch: '/config/containerCapacity/deleteBatch',
exportXlsUrl: '/config/containerCapacity/exportXls',
importExcelUrl: 'config/containerCapacity/importExcel'
|
|
238
239
|
},
dictOptions: {},
|
|
240
|
superFieldList: []
|
|
241
242
243
|
}
},
created() {
|
|
244
245
|
this.getSuperFieldList()
this.loadFrom()
|
|
246
247
|
},
computed: {
|
|
248
|
importExcelUrl: function () {
|
|
249
250
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
|
|
251
252
|
},
methods: {
|
|
253
254
|
initDictConfig() {
},
|
|
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
solutionContainerType(value) {
var actions = []
Object.keys(this.containerTypeList).some(key => {
if (this.containerTypeList[key].code == '' + value) {
actions.push(this.containerTypeList[key].name)
return true
}
})
return actions.join('')
},
loadFrom() {
getContainerTypeList().then(res => {
if (res.success) {
this.containerTypeList = res.result
}
})
|
|
271
|
},
|
|
272
|
getSuperFieldList() {
|
|
273
|
let fieldList = []
|
|
274
275
276
277
278
279
280
281
282
283
284
285
|
fieldList.push({type: 'string', value: 'containerTypeCode', text: '容器类型', dictCode: ''})
fieldList.push({type: 'string', value: 'warehouseCode', text: '仓库编码', dictCode: ''})
fieldList.push({type: 'string', value: 'companyCode', text: '货主', dictCode: ''})
fieldList.push({type: 'string', value: 'materialCode', text: '物料编码', dictCode: ''})
fieldList.push({type: 'string', value: 'materialName', text: '物料名称', dictCode: ''})
fieldList.push({type: 'string', value: 'materialUnit', text: '物料单位', dictCode: ''})
fieldList.push({type: 'BigDecimal', value: 'qty', text: '存放数量', dictCode: ''})
fieldList.push({type: 'int', value: 'enable', text: '是否可用', dictCode: 'enable_status'})
fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''})
fieldList.push({type: 'datetime', value: 'createTime', text: '创建日期'})
fieldList.push({type: 'string', value: 'updateBy', text: '更新人', dictCode: ''})
fieldList.push({type: 'datetime', value: 'updateTime', text: '更新日期'})
|
|
286
|
this.superFieldList = fieldList
|
|
287
288
|
}
}
|
|
289
|
}
|
|
290
291
|
</script>
<style scoped>
|
|
292
|
@import '~@assets/less/common.less';
|
|
293
|
</style>
|