relateTwoStep.vue
3.21 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
<template>
<div class="relate-two-step">
<div class="box">
<div class="container">
<div class="title">数据校验结果</div>
<div class="content">
<div class="row">
<div class="m-b-16">
<div class="m-b-2" v-for="(item, index) in checkedList.trade" :key="index">
<span class="label">交易参考号:</span>
{{item.tradeNo}}
</div>
</div>
<div class="m-b-16">
<div class="m-b-2" v-for="(item, index) in checkedList.order" :key="index">
<span class="label">主订单号:</span>
{{item.orderCode}}
</div>
</div>
<div class="success-txt">校验通过,请点击“完成”进行关联!</div>
</div>
</div>
</div>
</div>
<div class="flex">
<div class="footer">
<el-button @click="handlePreStep" :loading="isConfirm">上一步</el-button>
<el-button type="primary" @click="handleConfirm" :loading="isConfirm">完成</el-button>
</div>
</div>
</div>
</template>
<script>
import orderManage from "@api/orderManage"
export default {
name: "relateTwoStep",
props: {
checkedList: {
type: Object,
default: () => {
return {
trade: [],
order: []
}
}
}
},
data() {
return {
isConfirm: false
}
},
mounted() {
},
watch: {},
methods: {
handlePreStep() {
if (this.isConfirm) {
return true
}
this.$emit('handlePreStep')
},
handleConfirm() {
if (this.isConfirm) {
return true
}
const params = {
tradeNos: this.checkedList.trade.map(item => item.tradeNo),
orderCodes: this.checkedList.order.map(item => item.orderCode),
}
this.isConfirm = true
orderManage.batchWaitOrderApi(params).then(res => {
console.log(res)
if (res) {
this.$message.success("关联成功")
this.$router.push({
name: "orderSupplement"
})
}
}).finally(() => {
this.isConfirm = false
})
},
}
}
</script>
<style lang="scss" scoped>
.relate-two-step {
.flex {
display: flex;
justify-content: center;
}
.m-b-16 {
margin-bottom: 16px;
}
.m-b-2 {
margin-bottom: 2px;
}
.box {
display: flex;
justify-content: center;
.container {
width: 416px;
height: 544px;
border-radius: 2px;
opacity: 1;
border: 1px solid #e5e5e5;
}
.title {
box-sizing: border-box;
width: 100%;
height: 40px;
line-height: 40px;
color: #333333;
font-size: 16px;
text-align: center;
border-bottom: 1px solid #e5e5e5;
background: #f8faff;
}
.content {
box-sizing: border-box;
height: 456px;
overflow: scroll;
padding: 16px;
}
.row {
color: #333333;
font-size: 14px;
.label {
color: #666666;
}
}
}
.success-txt {
color: #2cca74;
font-size: 14px;
}
.footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
}
}
</style>