TblTradeTenderInfoSubTable.vue
10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<template>
<div>
<a-table
ref="table1"
rowKey="id"
size="middle"
:scroll="{x:true}"
bordered
:loading="loading"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
@change="handleTableChange"
>
<!-- 内嵌table区域 begin -->
<template slot="expandedRowRender" slot-scope="record">
<TblTradeInquiryInfoList :record="record" />
</template>
<!-- 内嵌table区域 end -->
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<div style="font-size: 12px;font-style: italic;">
<span v-if="!text">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" alt="" style="max-width:80px;height:25px;" />
</div>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
ghost
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
<span>下载</span>
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<!-- 状态:1-询价中,2-询价审批中,3-询价审批通过 -->
<div v-if="record.status == '1'">
<a @click="handleAdd(record)">询价</a>
<a-divider type="vertical" />
<!-- <a @click="handleSubmit(record)">提交</a> -->
<a-popconfirm title="确定提交吗?" @confirm="() => handleSubmit(record)">
<a>提交</a>
</a-popconfirm>
</div>
<a @click="handleApproval(record)" v-has="'inquiry:approval'" v-if="record.status == '2'">审批</a>
<!-- <a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown> -->
</span>
</a-table>
<tbl-trade-inquiry-info-modal ref="modalForm" @ok="modalFormOk" ></tbl-trade-inquiry-info-modal>
<tbl-trade-bid-sub-modal ref="approvalModalForm" @ok="modalFormOk" :formType="'sp'"/>
</div>
</template>
<script>
import { getAction, postAction } from '@api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { mixinDevice } from '@/utils/mixin'
import TblTradeInquiryInfoList from '../TblTradeInquiryInfoList'
import '@/assets/less/TableExpand.less'
import TblTradeInquiryInfoModal from '../modules/TblTradeInquiryInfoModal'
import TblTradeBidSubModal from '../modules/TblTradeBidSubModal'
export default {
name: 'TblTradeTenderInfoSubTable',
mixins: [JeecgListMixin, mixinDevice],
components: {
TblTradeInquiryInfoList,
TblTradeInquiryInfoModal,
TblTradeBidSubModal
},
props: {
record: {
type: Object,
default: null
}
},
data() {
return {
description: '贸易招标信息内嵌列表',
disableMixinCreated: true,
loading: false,
dataSource: [],
columns: [
// {
// title: '询价标书文件号',
// align: 'center',
// dataIndex: 'xjbswjh',
// },
{
title: '物料编码',
align: 'center',
dataIndex: 'code'
},
{
title: '标段(包)名称',
align: 'center',
dataIndex: 'tenderName'
},
{
title: '物料长描述',
align: 'center',
dataIndex: 'miaoshu'
},
{
title: '品牌',
align: 'center',
dataIndex: 'pinpai'
},
{
title: '计量单位',
align: 'center',
dataIndex: 'jldw'
},
{
title: '需求数量',
align: 'center',
dataIndex: 'xqsl'
},
{
title: '需求交货期',
align: 'center',
dataIndex: 'xqjhq'
},
{
title: '需求单位',
align: 'center',
dataIndex: 'xqdw'
},
{
title: '备注',
align: 'center',
dataIndex: 'bz'
},
// {
// title: '税率',
// align: 'center',
// dataIndex: 'sl',
// },
// {
// title: '响应单价',
// align: 'center',
// dataIndex: 'xydj',
// },
// {
// title: '响应数量',
// align: 'center',
// dataIndex: 'xysl',
// },
// {
// title: '响应交货期',
// align: 'center',
// dataIndex: 'xyjhq',
// },
// {
// title: '响应说明',
// align: 'center',
// dataIndex: 'xysm',
// },
// {
// title: '响应品牌',
// align: 'center',
// dataIndex: 'xypp',
// },
// {
// title: '响应币种',
// align: 'center',
// dataIndex: 'xybz',
// },
// {
// title: '交货期否决项',
// align: 'center',
// dataIndex: 'jhqfjx',
// },
// {
// title: '付款方式否决项',
// align: 'center',
// dataIndex: 'fkfsfjx',
// },
// {
// title: '规格型号否决项',
// align: 'center',
// dataIndex: 'ggxhfjx',
// },
// {
// title: '品牌否决项',
// align: 'center',
// dataIndex: 'ppfjx',
// },
// {
// title: '询价标书文件号',
// align: 'center',
// dataIndex: 'xjbswjh',
// },
// {
// title: '项目类型',
// align: 'center',
// dataIndex: 'xmlx',
// },
// {
// title: '送货地址',
// align: 'center',
// dataIndex: 'shdz'
// },
// {
// title: '优先等级',
// align: 'center',
// dataIndex: 'yxdj'
// },
// {
// title: '询价计划完成日期',
// align: 'center',
// dataIndex: 'xjjhwcsj'
// },
// {
// title: '标的类型',
// align: 'center',
// dataIndex: 'bdlx'
// },
{
title: '库存数据',
align: 'center',
dataIndex: 'kcsj'
},
{
title: '在途库存',
align: 'center',
dataIndex: 'ztkc'
},
{
title: '最近中标单价',
align: 'center',
dataIndex: 'zjzbdj'
},
// {
// title: '中标次数',
// align: 'center',
// dataIndex: 'zbcs'
// },
{
title: '最后一次中标时间',
align: 'center',
dataIndex: 'zhzbsj'
},
// {
// title: '最后一次未中标时间',
// align: 'center',
// dataIndex: 'zhwzbsj'
// },
{
title: '操作',
dataIndex: 'action',
align: 'center',
width: 147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: '/trade/tblTradePriceInquiry/queryTblTradeTenderInfoByMainId',
submit: '/trade/tblTradeTenderInfo/submit',
getBidSubData: '/trade/tblTradeBidSub/getBidSubData'
},
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
}
}
},
watch: {
record: {
immediate: true,
handler() {
if (this.record != null) {
this.loadData(this.record)
}
}
}
},
methods: {
modalFormOk() {
this.loadData(this.record)
this.$emit('refresh')
},
handleAdd(record) {
this.$refs.modalForm.tradeId = record.id
this.$refs.modalForm.wlbm = record.code
this.$refs.modalForm.add()
this.$refs.modalForm.title = '询价'
this.$refs.modalForm.disableSubmit = false
},
loadData(record) {
this.loading = true
this.dataSource = []
getAction(this.url.list, {
id: record.xjbswjh
}).then((res) => {
if (res.success) {
this.dataSource = res.result.records
}
}).finally(() => {
this.loading = false
})
},
handleTableChange(pagination, filters, sorter) {
// 分页、排序、筛选变化时触发
// TODO 筛选
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field
this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
}
this.ipagination = pagination
// this.loadData(this.record);
},
handleApproval(record) {
postAction(this.url.getBidSubData, { tradeId: record.id }).then(res => {
if (res.success) {
console.log(res)
this.$refs.approvalModalForm.edit(res.result)
} else {
this.$message.error(res.message)
}
})
},
handleSubmit(record) {
postAction(this.url.submit, record).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData(this.record)
this.$emit('refresh')
} else {
this.$message.error(res.message)
}
})
}
}
}
</script>
<style scoped>
</style>