index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <view class="refund-wrapper" :style="viewColor">
  3. <view class="form-box">
  4. <view class="form-item item-txt">
  5. <text class="label">审核</text>
  6. <view class="picker acea-row">
  7. <view :class="status == 1 ? 'on' : ''" class="agree-count" @click="status = 1"><text class="icon-agree"></text>同意</view>
  8. <view :class="status == -1 ? 'on' : ''" class="agree-count" @click="status = -1"><text class="icon-agree"></text>拒绝</view>
  9. </view>
  10. </view>
  11. </view>
  12. <view v-if="status == 1" class="form-box">
  13. <view class="form-item item-txt">
  14. <text class="label">商品实际支付(元)</text>
  15. <view class="picker">
  16. {{orderInfo.total_price}}
  17. </view>
  18. </view>
  19. <view class="form-item item-txt">
  20. <text class="label">运费实际支付(元)</text>
  21. <view class="picker">
  22. {{orderInfo.total_postage}}
  23. </view>
  24. </view>
  25. <view class="form-item item-txt">
  26. <text class="label">商品购买数量(件)</text>
  27. <view class="picker">
  28. {{orderInfo.total_num}}
  29. </view>
  30. </view>
  31. <view class="form-item item-txt">
  32. <text class="label">申请退款金额(元)</text>
  33. <view class="picker">
  34. {{orderInfo.refund_price}}
  35. </view>
  36. </view>
  37. <view class="form-item item-txt">
  38. <text class="label">申请退款数量(件)</text>
  39. <view class="picker">
  40. {{orderInfo.refund_num}}
  41. </view>
  42. </view>
  43. </view>
  44. <view v-if="orderInfo.refund_type == 2 && status == 1" class="form-box">
  45. <view class="form-item item-txt">
  46. <text class="label">收货人</text>
  47. <view class="picker">
  48. <input style="text-align: right;" maxlength="10" class="p-color" type="text" placeholder="请输入姓名" v-model="refundInfo.mer_delivery_user">
  49. </view>
  50. </view>
  51. <view class="form-item item-txtarea">
  52. <text class="label">收货地址</text>
  53. <view class="txtarea"><textarea v-model="refundInfo.mer_delivery_address" value="" placeholder="请输入地址" /></view>
  54. </view>
  55. <view class="form-item item-txt">
  56. <text class="label">手机号</text>
  57. <view class="picker">
  58. <input style="text-align: right;" class="p-color" type="text" placeholder="请输入手机号" v-model="refundInfo.phone">
  59. </view>
  60. </view>
  61. </view>
  62. <view v-if="status == -1" class="form-box">
  63. <view class="form-item item-txtarea">
  64. <text class="label">拒绝理由</text>
  65. <view class="txtarea"><textarea v-model="fail_message" value="" placeholder-class="coarea" placeholder="请填写拒绝退款的理由" /></view>
  66. </view>
  67. </view>
  68. <view class="confirm-btn">
  69. <view class="btn-box" @click="bindComfirm">确认提交</view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. // +----------------------------------------------------------------------
  75. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  76. // +----------------------------------------------------------------------
  77. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  78. // +----------------------------------------------------------------------
  79. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  80. // +----------------------------------------------------------------------
  81. // | Author: CRMEB Team <admin@crmeb.com>
  82. // +----------------------------------------------------------------------
  83. import { getRefundOrderInfo, refundOrderSubmit } from '@/api/admin.js'
  84. import { mapGetters } from "vuex";
  85. export default{
  86. components:{},
  87. computed: mapGetters(['viewColor']),
  88. data(){
  89. return {
  90. order_id:0,
  91. mer_id: 0,
  92. type: 0,
  93. isShowBox:false,
  94. refund_price:'',
  95. refund_order_id:'',//退款id
  96. status: '',
  97. order_status: false,
  98. status: 1,
  99. fail_message: '',
  100. refundInfo: {
  101. mer_delivery_user: '',
  102. mer_delivery_address: '',
  103. phone: '',
  104. },
  105. orderInfo: {}
  106. }
  107. },
  108. onLoad(options) {
  109. this.order_id = options.id
  110. this.mer_id = options.merId
  111. Promise.all([this.getOrderInfo()])
  112. },
  113. methods:{
  114. // 获取退款订单信息
  115. getOrderInfo(){
  116. let that = this;
  117. getRefundOrderInfo(that.mer_id, that.order_id).then(
  118. res => {
  119. that.orderInfo = res.data
  120. that.refundInfo = res.data.refund_info
  121. },
  122. err => {
  123. that.$util.Tips({title: err});
  124. }
  125. );
  126. },
  127. // 提交
  128. async bindComfirm(){
  129. let that = this
  130. if(that.status == -1){
  131. if (!that.fail_message) {
  132. return that.$util.Tips({
  133. title: '请填写拒绝理由'
  134. })
  135. }
  136. }
  137. let params = {
  138. status: that.status,
  139. fail_message: that.fail_message
  140. }
  141. if(that.orderInfo.refund_type == 2){
  142. if (!that.refundInfo.mer_delivery_user) {
  143. return that.$util.Tips({
  144. title: '请填写收货人姓名'
  145. })
  146. }
  147. if (!that.refundInfo.mer_delivery_address) {
  148. return that.$util.Tips({
  149. title: '请填写收货地址'
  150. })
  151. }
  152. if (!that.refundInfo.phone) {
  153. return that.$util.Tips({
  154. title: '请填写手机号'
  155. })
  156. }else if(!(/^1[3456789]\d{9}$/.test(that.refundInfo.phone))){
  157. return that.$util.Tips({
  158. title: '请填写正确的手机号码'
  159. })
  160. }
  161. params.mer_delivery_user = that.refundInfo.mer_delivery_user
  162. params.mer_delivery_address = that.refundInfo.mer_delivery_address
  163. params.phone = that.refundInfo.phone
  164. }
  165. refundOrderSubmit(that.mer_id,that.order_id,params).then(
  166. res => {
  167. that.$util.Tips({title: res.message});
  168. setTimeout(res => {
  169. uni.redirectTo({
  170. url:`/pages/admin/orderList/index?types=6&merId=${that.mer_id}`
  171. })
  172. }, 1000)
  173. },
  174. err => {
  175. that.$util.Tips({title: err});
  176. }
  177. );
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="scss">
  183. .refund-wrapper{
  184. .form-box{
  185. padding-left: 30rpx;
  186. margin-top: 18rpx;
  187. background-color: #fff;
  188. .form-item{
  189. display: flex;
  190. justify-content: space-between;
  191. border-bottom: 1px solid #f0f0f0;
  192. font-size: 30rpx;
  193. }
  194. .item-txt{
  195. align-items: center;
  196. width: 100%;
  197. padding:30rpx 30rpx 30rpx 0;
  198. }
  199. .item-txtarea{
  200. padding:30rpx 30rpx 30rpx 0;
  201. textarea{
  202. display: block;
  203. width: 500rpx;
  204. height: 100rpx;
  205. font-size: 30rpx;
  206. }
  207. .coarea{
  208. color: #ccc;
  209. }
  210. }
  211. .icon-jiantou{
  212. margin-left: 10rpx;
  213. font-size: 28rpx;
  214. color: #BBBBBB;
  215. }
  216. .agree-count{
  217. margin-left: 30rpx;
  218. .icon-agree{
  219. display: inline-block;
  220. width: 24rpx;
  221. height: 24rpx;
  222. background: #CCCCCC;
  223. border-radius: 100%;
  224. position: relative;
  225. top: 2rpx;
  226. margin-right: 8rpx;
  227. &::after{
  228. content: "";
  229. display: inline-block;
  230. width: 8rpx;
  231. height: 8rpx;
  232. border-radius: 100%;
  233. background-color: #fff;
  234. position: absolute;
  235. top: 8rpx;
  236. left: 8rpx;
  237. }
  238. }
  239. &.on{
  240. .icon-agree{
  241. background: #2291F8;
  242. }
  243. }
  244. }
  245. }
  246. .confirm-btn{
  247. position: fixed;
  248. bottom: 0;
  249. padding: 20rpx 30rpx;
  250. background: #fff;
  251. width: 100%;
  252. .btn-box{
  253. width:100%;
  254. height:86rpx;
  255. line-height: 86rpx;
  256. text-align: center;
  257. color: #fff;
  258. background: #2291F8;
  259. border-radius:43rpx;
  260. font-size: 32rpx;
  261. }
  262. }
  263. }
  264. </style>