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