rk
11 小时以前 511ce651667f5b2284247cc60599078b86f7963f
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
<template>
  <GlobalWindow
      :title="title"
      width="100%"
      :visible.sync="visible"
  >
    <div class="detail-box"  >
      <p class="tip-warn" style="margin-bottom: 30px;font-size: 14px;">
        <i class="el-icon-warning"></i>
        操作说明:您正针对订单<span class="red">{{ info.code }} </span>进行退款操作,该操作不可逆请谨慎操作!!</p>
      <div class="header">
        <div  class="header-b">商品信息</div>
      </div>
      <div class="info-item"  >
        <el-table  :data="info.goodsorderDetailList||[]"  stripe  border >
          <el-table-column prop="imgurl" label="商品图" min-width="80px" align="center">
            <template slot-scope="{row}">
              <el-image style="width: 50px;height: 50px;" v-if="row.imgurl && row.imgurl!=''" :src="row.imgurl" :preview-src-list="[row.imgurl]"></el-image>
            </template>
          </el-table-column>
          <el-table-column prop="name" label="商品名称"   align="center" min-width="150px">  </el-table-column>
          <el-table-column prop="categoryName" label="商品分类"   align="center" min-width="150px">  </el-table-column>
          <el-table-column prop="goodsWeight" label="重量(kg)" align="center" min-width="150px"></el-table-column>
          <el-table-column prop="price" label="销售价(元)" align="center" min-width="100px">
            <template slot-scope="{row}">
              <span>¥{{(row.price || 0).toFixed(2)}}</span>
            </template>
          </el-table-column>
          <el-table-column prop="goodsNum" label="数量" align="center" min-width="150px"></el-table-column>
          <el-table-column prop="totalPrice" label="小计(元)" align="center" min-width="150px">
            <template slot-scope="{row}">
              <span class="orange">¥{{(row.totalPrice || 0).toFixed(2)}}</span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="info-item"  >
        <div class="info-item-a">商品总价:<span> ¥{{((info.totalPrice||0)-(info.mailPrice || 0)).toFixed(2)}}</span></div>
        <div class="info-item-a">快递费:<span>¥{{(info.mailPrice||0).toFixed(2)}}</span></div>
        <div class="info-item-a">订单总价:<span> ¥{{(info.totalPrice||0).toFixed(2)}}</span></div>
      </div>
      <div class="info-item"  >
        <div class="info-item-a">积分抵扣:<span v-if="(info.integral||0)>0">-¥{{(info.integral||0).toFixed(2) +'  '}}使用{{(info.useIntegral||0)}}积分抵扣¥{{(info.integral||0).toFixed(2) +'  '}}元</span></div>
        <div class="info-item-a">优惠券:<span v-if="(info.couponPrice||0)>0">-¥{{(info.couponPrice||0).toFixed(2) +'  '}} 使用{{info.couponName}}</span></div>
        <div class="info-item-a">经销商结算:<span> ¥{{(info.totalPrice||0).toFixed(2)}}</span></div>
      </div>
      <div class="info-item"  >
        <div class="info-item-a">实付金额:<span class="red"> ¥{{(info.price||0).toFixed(2)}}</span></div>
        <div class="info-item-a">返还用户积分:<span class="orange"> {{(info.returnMemberIntegral||0)}}</span></div>
        <div class="info-item-a">返还经销商积分:<span class="orange">¥{{(info.shopSettlement || 0).toFixed(2) }}</span></div>
      </div>
      <div class="header">
        <div  class="header-b">退款内容</div>
        <div class="info-item"  >
          <el-form :model="form" ref="form" label-width="120px" label-suffix=":"  :rules="rules" inline>
            <el-form-item label="退款金额" prop="price" style="display: block;">
              <el-input type="number"  v-model="form.price" placeholder="请输入退款金额" v-trim>  <template slot="append"> 元</template>  </el-input>
              <span class="tip-warn" style="margin-bottom: 30px;font-size: 14px;">   <i class="el-icon-warning"></i>
              提示:当前订单最多可退金额为<span class="red">{{(info.price||0).toFixed(2)}}</span></span>
            </el-form-item>
            <div style="display:flex;">
              <el-form-item label="退还" prop="refundInfo"  style="display: inline;">
                <el-checkbox style="border: none;" v-model="checked1" label="退还客户优惠券" border></el-checkbox>
              </el-form-item>
              <el-form-item label="" prop="refundInfo"  style="display: inline;">
                <el-checkbox style="border: none"  v-model="checked1" label="退还客户积分" border></el-checkbox>
              </el-form-item>
            </div>
            <div style="display:flex;">
              <el-form-item label="扣除" prop="refundInfo"  style="display: inline;">
                <el-checkbox style="border: none"  v-model="checked1" label="扣除经销商已结算金额" border></el-checkbox>
              </el-form-item>
              <el-form-item label="" prop="refundInfo"  style="display: inline;">
                <el-checkbox style="border: none"  v-model="checked1" label="扣除已返客户积分" border></el-checkbox>
              </el-form-item>
              <el-form-item label="" prop="refundInfo"  style="display: inline;">
                <el-checkbox style="border: none"  v-model="checked1" label="扣除已返经销商积分" border></el-checkbox>
              </el-form-item>
            </div>
            <el-form-item label="备注" prop="refundInfo"  style="display: block;">
              <el-input type="textarea" :autosize="{ minRows: 4, maxRows:4 }" style="width: 500px;" v-model="form.cancelInfo" placeholder="请输入取消说明"  v-trim/>
            </el-form-item>
          </el-form>
        </div>
      </div>
    </div>
    <template  v-slot:footer>
      <el-button type="primary" @click="confirm">确认</el-button>
      <el-button @click="visible=false">返回</el-button>
    </template>
  </GlobalWindow>
</template>
 
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import BaseOpera from '@/components/base/BaseOpera'
import { shopDetail } from '@/api/business/shop'
export default {
  name: 'OperaOrderRefundWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      title: '',
      visible2: false,
      visible: false,
      tabelHeight: null,
      info: {},
      shopInfo: {},
      rules: {
        price: [
          { required: true, message: '请输入退款金额', tigger: 'blur' }
        ]
      },
      // 搜索
      form: {
        id: '',
        checked1:false,
        price: 0,
        type: null
      }
    }
  },
  created () {
    this.config({
      module: '订单信息表',
      api: '/business/goodsorder',
      'field.id': 'id',
      'field.main': 'id'
    })
  },
  methods: {
    successBiz () {
      this.loadInfo()
      this.$emit('success')
    },
    loadInfo () {
      shopDetail(this.info.distributionShopId).then(res => {
        this.shopInfo = res || this.shopInfo
      })
    },
    open (title, info) {
      this.title = title
      this.visible = true
      this.info = info || {}
      this.form.price = ''
 
      if (this.info.distributionShopId != null) {
        this.loadInfo()
      }
    },
    confirm () {
      this.$refs.form.validate((valid) => {
        if (!valid) {
          return
        }
        this.$dialog.messageWaring(`确定进行退款该订单:${this.info.code}?`)
          .then(() => {
            this.isWorking = true
            this.api.orderRefund(this.form)
              .then(() => {
                this.visible = false
                this.$tip.apiSuccess('退款成功')
                this.$emit('success')
              }).catch(e => {
                this.$tip.apiFailed(e)
              })
              .finally(() => {
                this.isWorking = false
              })
          })
 
        // 调用新建接口
      })
    }
  }
}
</script>
<style scoped  lang="scss">
.table-pagination{
  position: fixed !important;
  bottom: 50px;
}
.header-b{
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
}
.header-red-btn{
  display: inline-block;
  font-size: 12px;
  background-color:  red;
  padding: 2px 10px 3px 10px;
  margin-left: 20px;
  color: white;
  cursor: pointer;
  border-radius: 5px ;
}
.header-blue-btn{
  display: inline-block;
  font-size: 12px;
  background-color:  #216EEE;
  padding: 2px 10px 3px 10px;
  margin-left: 20px;
  color: white;
  cursor: pointer;
  border-radius: 5px ;
}
.header-grey{
  display: inline-block;
  font-size: 12px;
  border: 1px solid grey;
  padding: 2px 10px;
  margin-left: 20px;
  color: grey;
  border-radius: 5px ;
}
.header-orange{
  display: inline-block;
  font-size: 12px;
  border: 1px solid orange;
  padding: 2px 10px;
  margin-left: 20px;
  color: orange;
  border-radius: 5px ;
}
.header-btn{
  display: inline-block;
  border: none;
  padding: 2px 10px;
  margin-left: 20px;
}
.info-item{
  display: flex;
  width: 100%;
  margin: 15px;
}
.info-item-a{
  flex: 1;
  font-size: 14px;
 
}
.info-item-a span{
}
.info-item-a  .btn{
  font-size: 12px !important;
  cursor: pointer !important;
}
</style>