complementLogDialog.vue
3.6 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
<!-- 补库存标签码日志弹窗 -->
<template>
<GLDialog title="补库存标签码日志" :visible.sync="dialogVisible" class="complementLogDialog" width="700px" mode="mid" :destroy-on-close="true" :close-on-click-modal="false" okText="关闭" :hasFooter="false" :before-close="handleClose" @onOk="handleClose" @onCancel="handleClose">
<div class="complement-log-content">
<div class="section-title">
产品基础信息
</div>
<div class="info-box">
<el-row>
<el-col class="info-item" :span="24">
<span class="label">产品名称:</span>
<span class="value">{{ row.upgradeGoodsName || '-' }}</span>
</el-col>
<el-col class="info-item" :span="24">
<span class="label">产品编码:</span>
<span class="value">{{ row.productCode || '-' }}</span>
</el-col>
<el-col class="info-item" :span="24">
<span class="label">产品ID:</span>
<span class="value">{{ row.upgradeCommodityCode || '-' }}</span>
</el-col>
</el-row>
</div>
<div class="section-title" style="margin-top: 20px;">
操作日志
</div>
<div class="d2-container-content">
<GLTable ref="logTable" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable>
</div>
</div>
</GLDialog>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'ComplementLogDialog',
props: {
visibleSync: {
type: Boolean,
default: false
},
row: {
type: Object,
default: () => ({})
}
},
data() {
const tableColumns = []
if (this.row && this.row.isFilm) {
tableColumns.push({
label: '库存数量',
prop: 'stockNum',
formatter: cellValue => {
return cellValue.stockNum || cellValue.stockNum == 0 ? `${cellValue.stockNum}米` : '-'
}
})
}
tableColumns.push(
{
label: '操作人',
prop: 'createdBy'
},
{
label: '操作时间',
prop: 'createdDate',
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '-'
}
}
)
return {
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableSearchForm: {},
getListApi: this.$apis.stockManage.labelCodeRecodeLog,
tableParams: {
listName: 'list',
tableColumns: tableColumns
}
}
},
computed: {
dialogVisible: {
get() {
return this.visibleSync
},
set(newVal) {
this.$emit('update:visibleSync', newVal)
}
}
},
methods: {
handleClose(done) {
this.dialogVisible = false
if (typeof done === 'function') done()
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = {
upgradeGoodsId: this.row.upgradeGoodsId,
merchantId: this.row.yqMerchantId
}
resolve()
})
}
}
}
</script>
<style scoped lang="scss">
.complement-log-content {
padding: 0 10px 20px 10px;
.section-title {
font-size: 16px;
font-weight: bold;
color: #333;
margin-bottom: 15px;
}
.info-box {
padding: 0 20px;
.info-item {
margin-bottom: 12px;
font-size: 14px;
.label {
color: #666;
display: inline-block;
width: 80px;
text-align: right;
}
.value {
color: #333;
}
}
}
}
</style>