1
2
3
<template>
<a-card :bordered="false" :class="'cust-erp-sub-tab'">
<!-- 操作按钮区域 -->
4
<!-- <div class="table-operator" v-if="mainId"> -->
谭毅彬
authored
about a year ago
5
6
<!-- <a-button @click="handleAdd" v-has="'taskDetail:add'" type="primary" icon="plus">新增</a-button> -->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('任务详情')">导出</a-button>
7
8
9
10
11
12
13
<a-upload
name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
@change="handleImportExcel">
14
<a-button type="primary" icon="import">导入</a-button>
15
</a-upload> -->
谭毅彬
authored
about a year ago
16
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">
17
<a-menu slot="overlay" v-has="'taskDetail:deleteBatch'">
18
<a-menu-item key="1" @click="batchDel">
19
<a-icon type="delete"/> 删除
20
</a-menu-item>
21
</a-menu>
22
23
24
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
25
26
</a-dropdown> -->
<!-- </div> -->
27
28
29
<!-- table区域-begin -->
<div>
30
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
31
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
32
style="font-weight: 600">{{ selectedRowKeys.length }}</a> 项
33
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
34
</div> -->
35
36
37
38
39
40
<a-table
ref="table"
size="middle"
bordered
rowKey="id"
谭毅彬
authored
about a year ago
41
:scroll="{ x: true }"
42
43
44
45
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
谭毅彬
authored
about a year ago
46
47
48
49
@change="handleTableChange"
>
<span slot="companyCode" slot-scope="companyCode">
<a-tag :key="companyCode" color="blue">
50
51
52
53
{{ solutionCompany(companyCode) }}
</a-tag>
</span>
54
55
56
57
58
59
<span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText">
<a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)">
{{ inventoryStatus_dictText }}
</a-tag>
</span>
60
61
62
63
64
<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>
谭毅彬
authored
about a year ago
65
66
67
68
69
70
71
<img
v-else
:src="getImgView(text)"
height="25px"
alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"
/>
72
73
74
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
谭毅彬
authored
about a year ago
75
<a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
76
77
78
79
80
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
谭毅彬
authored
about a year ago
81
82
83
84
85
86
87
88
89
90
<adjustment-doc-modal
ref="adjustmentModal"
@ok="modalFormOk"
:id="record.id"
:taskHeaderId="record.taskHeaderId"
/>
<a v-if="record.taskType == 700 && record.status != 100" @click="createMany(record)"
>实盘登记<a-divider type="vertical"
/></a>
谭毅彬
authored
about a year ago
91
<a v-if="record.taskType == 1400 && record.status != 100" @click="qualityRegister(record)"
谭毅彬
authored
about a year ago
92
93
94
>质检登记<a-divider type="vertical"
/></a>
<a v-has="'taskDetail:edit'" @click="handleEdit(record)">编辑<a-divider type="vertical"/></a>
95
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
96
<a v-has="'taskDetail:delete'">删除</a>
97
98
99
100
</a-popconfirm>
</span>
</a-table>
</div>
谭毅彬
authored
about a year ago
101
<quality-register-detail-modal ref="qualityRegisterModal" @ok="modalFormOk"/>
102
103
104
105
106
<taskDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></taskDetail-modal>
</a-card>
</template>
<script>
谭毅彬
authored
about a year ago
107
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
108
import { getCompanyList } from '@api/api'
谭毅彬
authored
about a year ago
109
110
111
import TaskDetailModal from './modules/TaskDetailModal'
import AdjustmentDocModal from '../stocktaking/modules/AdjustmentDocModal'
import QualityRegisterDetailModal from './modules/QualityRegisterDetailModal'
112
113
export default {
谭毅彬
authored
about a year ago
114
name: 'TaskDetailList',
115
mixins: [JeecgListMixin],
谭毅彬
authored
about a year ago
116
117
118
119
120
components: {
TaskDetailModal,
AdjustmentDocModal,
QualityRegisterDetailModal,
},
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
props: {
mainId: {
type: String,
default: '',
required: false
}
},
watch: {
mainId: {
immediate: true,
handler(val) {
if (!this.mainId) {
this.clearList()
} else {
this.queryParam['taskHeaderId'] = val
谭毅彬
authored
about a year ago
136
this.loadData(1)
137
138
}
}
139
140
141
142
143
144
}
},
data() {
return {
description: '任务表管理页面',
disableMixinCreated: true,
145
companyList: [],
146
147
148
149
// 表头
columns: [
{
title: '任务详情ID',
谭毅彬
authored
about a year ago
150
align: 'center',
151
152
153
154
dataIndex: 'id'
},
{
title: '货主',
谭毅彬
authored
about a year ago
155
align: 'center',
156
157
dataIndex: 'companyCode',
key: 'companyCode',
谭毅彬
authored
about a year ago
158
scopedSlots: { customRender: 'companyCode' }
159
160
161
},
{
title: '物料编码',
谭毅彬
authored
about a year ago
162
align: 'center',
163
164
165
166
dataIndex: 'materialCode'
},
{
title: '物料名称',
谭毅彬
authored
about a year ago
167
align: 'center',
168
169
170
171
dataIndex: 'materialName'
},
{
title: '物料规格',
谭毅彬
authored
about a year ago
172
align: 'center',
173
174
175
176
dataIndex: 'materialSpec'
},
{
title: '物料单位',
谭毅彬
authored
about a year ago
177
align: 'center',
178
179
180
181
dataIndex: 'materialUnit'
},
{
title: '数量',
谭毅彬
authored
about a year ago
182
align: 'center',
183
184
185
186
dataIndex: 'qty'
},
{
title: '批次',
谭毅彬
authored
about a year ago
187
align: 'center',
188
189
190
dataIndex: 'batch'
},
{
肖超群
authored
about a year ago
191
192
193
194
195
title: '序列号',
align: 'center',
dataIndex: 'sn'
},
{
196
title: '库存状态',
谭毅彬
authored
about a year ago
197
align: 'center',
198
dataIndex: 'inventoryStatus_dictText',
谭毅彬
authored
about a year ago
199
scopedSlots: { customRender: 'inventoryStatus_dictText' }
200
},
201
202
{
title: '创建人',
谭毅彬
authored
about a year ago
203
align: 'center',
204
205
206
207
dataIndex: 'createBy'
},
{
title: '创建日期',
谭毅彬
authored
about a year ago
208
align: 'center',
209
210
211
212
dataIndex: 'createTime'
},
{
title: '更新人',
谭毅彬
authored
about a year ago
213
align: 'center',
214
215
216
217
dataIndex: 'updateBy'
},
{
title: '更新日期',
谭毅彬
authored
about a year ago
218
align: 'center',
219
220
221
222
223
dataIndex: 'updateTime'
},
{
title: '操作',
dataIndex: 'action',
谭毅彬
authored
about a year ago
224
225
align: 'center',
fixed: 'right',
226
width: 147,
谭毅彬
authored
about a year ago
227
scopedSlots: { customRender: 'action' }
228
}
229
230
],
url: {
谭毅彬
authored
about a year ago
231
232
233
234
235
list: '/task/taskHeader/listTaskDetailByMainId',
delete: '/task/taskHeader/deleteTaskDetail',
deleteBatch: '/task/taskHeader/deleteBatchTaskDetail',
exportXlsUrl: '/task/taskHeader/exportTaskDetail',
importUrl: '/task/taskHeader/importTaskDetail'
236
237
238
239
240
},
dictOptions: {
taskType: [],
isEmptyOut: [],
isDoubleIn: [],
谭毅彬
authored
about a year ago
241
status: []
242
243
}
}
244
245
},
created() {
谭毅彬
authored
about a year ago
246
this.loadFrom()
247
248
249
},
computed: {
importExcelUrl() {
谭毅彬
authored
about a year ago
250
return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`
251
252
253
}
},
methods: {
254
255
getStatusColor(status) {
const colors = {
谭毅彬
authored
about a year ago
256
257
良品: 'green',
报废品: 'purple',
258
'待确认 ': 'grey',
谭毅彬
authored
about a year ago
259
次品: 'red',
260
default: 'blue'
谭毅彬
authored
about a year ago
261
262
}
return colors[status] || colors.default
263
},
264
loadFrom() {
谭毅彬
authored
about a year ago
265
getCompanyList().then(res => {
266
267
268
if (res.success) {
this.companyList = res.result
}
谭毅彬
authored
about a year ago
269
})
270
271
272
},
solutionCompany(value) {
var actions = []
谭毅彬
authored
about a year ago
273
274
Object.keys(this.companyList).some(key => {
if (this.companyList[key].code == '' + value) {
275
276
277
278
279
280
actions.push(this.companyList[key].name)
return true
}
})
return actions.join('')
},
281
282
283
284
clearList() {
this.dataSource = []
this.selectedRowKeys = []
this.ipagination.current = 1
285
},
286
createMany(record) {
谭毅彬
authored
about a year ago
287
288
this.$refs.adjustmentModal.edit(record)
this.$refs.adjustmentModal.title = '实盘登记'
289
},
肖超群
authored
about a year ago
290
qualityRegister(record) {
谭毅彬
authored
about a year ago
291
292
293
this.$refs.qualityRegisterModal.edit(record)
this.$refs.qualityRegisterModal.title = '质检登记'
}
294
}
295
}
296
297
</script>
<style scoped>
谭毅彬
authored
about a year ago
298
@import '~@assets/less/common.less';
299
</style>