zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
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
<template>
    <div class="viewLayer">
        <div class="viewContent">
            <div class="contentItem">
                <div class="left">
                    <label for="">订单号:</label>
                    <input type="text"
                           disabled
                           v-model="backData.ovderNum">
                </div>
                <div class="right">
                    <label for="">订单金额:</label>
                    <input type="text"
                           disabled
                           v-model="backData.ovderMoney">
                </div>
            </div>
            <div class="contentItem">
                <div class="left">
                    <label for="">子订单:</label>
                    <input type="text"
                           disabled
                           v-model="backData.sonOrderNum">
                </div>
                <div class="right">
                    <label for="">子订单金额:</label>
                    <input type="text"
                           disabled
                           v-model="backData.sonOrderMoney">
                </div>
            </div>
            <div class="contentItem">
                <div class="left">
                    <label for="">交易时间:</label>
                    <input type="text"
                           disabled
                           v-model="backData.time">
                </div>
                <div class="right">
                    <label for="">支付状态:</label>
                    <input type="text"
                           disabled
                           v-model="backData.payStatus">
                </div>
            </div>
            <div class="contentItem">
                <div class="left">
                    <label for="">接入机构:</label>
                    <input type="text"
                           disabled
                           v-model="backData.institution">
                </div>
                <div class="right">
                    <label for="">支付公司:</label>
                    <input type="text"
                           disabled
                           v-model="backData.company">
                </div>
            </div>
            <div class="contentItem">
                <div class="left">
                    <label for="">商户号:</label>
                    <input type="text"
                           disabled
                           v-model="backData.mer">
                </div>
                <div class="right">
                    <label for="">交易类型:</label>
                    <input type="text"
                           disabled
                           v-model="backData.transType">
                </div>
            </div>
            <div class="contentItem">
                <div class="left"
                     disabled>
                    <label for="">支付订单号:</label>
                    <input type="text"
                           disabled
                           v-model="backData.payOrderNum">
                </div>
                <div class="right">
                    <label for="">备注:</label>
                    <input type="text"
                           disabled
                           v-model="backData.notes">
                </div>
            </div>
            <div class="other">
                <div class="remask">
                    <label for="">退款:</label>
                    <input type="text"
                           placeholder="请输入退款金额"
                           @blur="check"
                           v-model.trim="refoundMoney">
                </div>
                <div class="remask">
                    <label for="">备注:</label>
                    <input type="text"
                           placeholder="请输入备注内容">
                </div>
            </div>
            <div class="btn">
                <el-button type="primary"
                           @click="cancel">取消</el-button>
            </div>
        </div>
 
    </div>
    <!-- </div> -->
</template>
 
<script>
export default {
    data() {
        return {
            refoundMoney: "",
            loading: false,
            dialogVisible: false,
            backData: {
                ovderNum: "",
                orderMoney: "",
                sonOrderNum: "",
                sonOrderMoney: "",
                time: "",
                payStatus: "",
                institution: "",
                company: "",
                mer: "",
                transType: "",
                payOrderNum: "",
                notes: ""
            }
        };
    },
    mounted() {
        this.getData();
    },
    methods: {
        // 取消按钮
        cancel() {
            this.$emit("isCancel");
        },
        // 模拟请求数据
        getData() {
            const that = this;
            setTimeout(function () {
                that.backData = {
                    ovderNum: "423423",
                    ovderMoney: "5654",
                    sonOrderNum: "4234234",
                    sonOrderMoney: "5435",
                    time: "2017-12-3",
                    payStatus: "已处理",
                    institution: "世联大袋",
                    company: "腾讯",
                    mer: "3423432",
                    transType: "三要素",
                    payOrderNum: "4342332",
                    notes: "很好,verygood"
                };
            }, 200);
        },
        // 检查数据
        check() {
            if (!this.refoundMoney || this.refoundMoney === "") {
                return;
            }
            this.refoundMoney = parseFloat(this.refoundMoney);
            this.backData.sonOrderMoney = parseFloat(this.backData.sonOrderMoney);
            if (this.refoundMoney > this.backData.sonOrderMoney) {
                alert("对不起,退款金额不能大于子订单金额,请重新输入");
                this.refoundMoney = "";
            } else {
                // 发送请求
                console.log("退款成功");
            }
        }
    }
};
</script>
 
 
<style lang="less" scoped>
.viewLayer {
  width: 100%;
  margin: 30px auto 0px;
  background-color: #fff;
  border-radius: 6px;
  font-size: 14px;
  .title {
    background-color: #e4e4e4;
    height: 56px;
    line-height: 40px;
    border-radius: 6px;
    padding: 6px;
    font-size: 16px;
  }
  .viewContent {
    padding: 0px 16px;
    padding-bottom: 20px;
    .contentItem {
      width: 100%;
      height: 56px;
      padding: 10px 0px;
      label {
        display: inline-block;
        width: 120px;
        text-align: right;
        height: 36px;
        line-height: 56px;
      }
      input {
        width: 240px;
        height: 36px;
        outline: none;
        border-radius: 4px;
        padding: 0px 8px;
        border: 1px solid #ccc;
      }
      input:disabled {
        background-color: #fff;
      }
      .left {
        width: 50%;
        float: left;
      }
      .right {
        width: 50%;
        float: right;
      }
    }
    .line {
      width: 100%;
      height: 1px;
      background-color: #aaa;
      margin: 16px 0px;
    }
    > h5 {
      margin: 6px 0px;
      font-size: 16px;
    }
    .btn {
      width: 70px;
      margin: 20px auto;
    }
    .other {
      margin-top: 40px;
      padding-top: 30px;
      border-top: 1px solid #ccc;
      .remask {
        width: 360px;
        height: 46px;
        padding: 8px 0px;
        margin: 0 auto;
        > label {
          display: inline-block;
          width: 70px;
          text-align: right;
          height: 100%;
          line-height: 30px;
        }
        > input {
          display: inline-block;
          outline: none;
          border: 1px solid #ccc;
          width: 280px;
          height: 30px;
          border-radius: 4px;
        }
      }
    }
  }
}
</style>