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