orderDetail.vue
3.91 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
<!-- 核销订单详情 -->
<template>
<div class="order-detail">
<div class="edit-box points">
<div class="container m-b-20 all-page">
<p class="page-title">订单信息</p>
<el-form label-width="100px" class="m-t-12" :inline="true">
<el-row v-for="(item, index) in detailFormDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label" class="row-item">
<span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
</el-form>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium" type="primary">取消</el-button>
</GLFooter>
</div>
</template>
<script>
export default {
name: 'orderDetail',
data() {
return {
size: 'small',
title: '查看订单',
editChildRef: 'editChildRef',
routeInfo: {
orderCode: ''
},
detailForm: {},
orderRefund: null,
orderGoods: [],
// 订单信息
detailFormDataRow: [],
detailFormData: [
{
label: '项目名称',
name: 'bizRelName'
},
{
label: '消费积分',
name: 'integralValue'
},
{
label: '客户昵称',
name: 'customerWechatName'
},
{
label: '手机号',
name: 'customerPhone'
},
{
label: '核销员工',
name: 'verificationStaff'
},
{
label: '结算状态',
name: 'settlementStatusTxt'
},
{
label: '核算日期',
name: 'verificationTime'
},
{
label: '订单编号',
name: 'orderCode'
},
{
label: '操作人',
name: 'updatedBy'
},
{
label: '商户名称',
name: 'merchantName'
}
],
// 基本数据
baseData: {
refundTypeList: [
{ confId: '1', confName: '退款退货' },
{ confId: '2', confName: '退款不退货' },
{ confId: '3', confName: '众筹订单退款' }
],
shareStaffTypeList: [
{ confId: '1', confName: '个微' },
{ confId: '2', confName: '企微' }
]
}
}
},
created() {
this.formToRow('detailFormData')
},
mounted() {
// this.setMinHeight('.edit-box')
this.routeInfo = this.$route.query
this.getInfo()
},
methods: {
formToRow(formName, numOfRow = 3) {
var rowNum = Math.ceil(this[formName].length / numOfRow)
for (var i = 0; i < rowNum; i++) {
for (var j = 0; j < numOfRow; j++) {
if (j == 0) {
this[formName + 'Row'][i] = {
rowList: []
}
}
if (i * numOfRow + j < this[formName].length) {
this[formName + 'Row'][i].rowList.push(this[formName][i * numOfRow + j])
}
}
}
console.log(this.detailFormDataRow)
},
getInfo() {
this.$apis.points.getOrderDetail({ id: this.routeInfo.id }).then(res => {
this.detailForm = res
this.detailForm.settlementStatusTxt = this.detailForm.settlementStatus ? '已结算' : '未结算'
})
},
handleCancel() {
this.$router.push({
path: '/pointsList/index'
})
}
}
}
</script>
<style>
.order-detail .el-form--inline .el-form-item {
margin: 0;
}
.order-detail .el-form--inline .el-form-item__content {
height: 30px;
}
.order-detail .form-img .el-form--inline .el-form-item__content {
height: auto !important;
}
.m-t-12 {
margin-top: 12px;
}
.order-detail .flex {
justify-content: flex-start;
}
.order-detail .row-item {
width: 33%;
}
.detail-txt {
display: inline-block;
width: 220px;
}
</style>