refundDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <view style="padding-bottom: 70px;">
  3. <view class="box">
  4. <view class="tits">商品信息</view>
  5. <view class="list product">
  6. <view class="lis ddflex" v-for="(pro, index) in refundDetail.productList" :key="index">
  7. <image :src="pro.image" mode="aspectFill" class="cimage"></image>
  8. <view class="zhinfo fflex">
  9. <view class="zhtit">{{pro.title}}</view>
  10. <view v-if="pro.specsList && pro.specsList.length > 0" class="guige">
  11. 规格:
  12. <text v-for="(itemGuige, index) in pro.specsList" :key="index" class="guige" decode="true">{{ itemGuige.value }}&nbsp;</text>
  13. </view>
  14. <view class="jiage">
  15. <view class="price">
  16. <span>¥</span>
  17. {{ pro.money }}
  18. </view>
  19. <view class="num">×{{ pro.quantity }}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="box">
  26. <view class="tits">售后信息</view>
  27. <view class="refund-list">
  28. <view class="li ddflex">
  29. <view class="label">订单号</view>
  30. <view class="li-r li-color fflex">{{refundDetail.orderId}}</view>
  31. </view>
  32. <view class="li ddflex">
  33. <view class="label">申请售后时间</view>
  34. <view class="li-r fflex">{{refundDetail.createdDate}}</view>
  35. </view>
  36. <!-- <view class="li ddflex">
  37. <view class="label">发货单号</view>
  38. <view class="li-r fflex">{{refundDetail.deliverId}}</view>
  39. </view>
  40. <view class="li ddflex">
  41. <view class="label">退款单号</view>
  42. <view class="li-r fflex">{{refundDetail.id}}</view>
  43. </view> -->
  44. <view class="li ddflex">
  45. <view class="label">退款类型</view>
  46. <view class="li-r fflex">{{refundDetail.refundType == 1 ? '只退款' : '退货并退款'}}</view>
  47. </view>
  48. <view class="li ddflex">
  49. <view class="label">退款金额</view>
  50. <view class="li-r li-red fflex">¥{{refundDetail.refundMoney}}</view>
  51. </view>
  52. <view class="li ddflex">
  53. <view class="label">退款状态</view>
  54. <view class="li-r fflex">{{refundDetail.refundStateName}}</view>
  55. </view>
  56. <view class="li ddflex">
  57. <view class="label">售后原因</view>
  58. <view class="li-r fflex">{{refundDetail.refundReasonName ? refundDetail.refundReasonName : '无理由退款'}}</view>
  59. </view>
  60. <view class="li ddflex">
  61. <view class="label">备注</view>
  62. <view class="li-r fflex">{{refundDetail.remarks ? refundDetail.remarks : '暂无'}}</view>
  63. </view>
  64. <view class="li" v-if="refundDetail.imgUrl&&refundDetail.imgUrl.length>0">
  65. <view class="label">售后凭证</view>
  66. <view class="imgbox">
  67. <image :src="it" mode="aspectFill" v-for="(it,index) in refundDetail.imgUrl" :key="index" @click="preview(index)"></image>
  68. </view>
  69. </view>
  70. <view class="li ddflex" v-if="refundDetail.refundFalseRes">
  71. <view class="label">商家留言</view>
  72. <view class="li-r fflex">{{refundDetail.refundFalseRes}}</view>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="box" v-if="refundDetail.express.express">
  77. <view class="tits">物流信息</view>
  78. <view class="refund-list">
  79. <view class="li ddflex">
  80. <view class="label">快递公司</view>
  81. <view class="li-r fflex">{{refundDetail.express.express}}</view>
  82. </view>
  83. <view class="li ddflex">
  84. <view class="label">快递编号</view>
  85. <view class="li-r fflex">{{refundDetail.express.expressNo}}</view>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="bot">
  90. <view class="sta-btn" @click="back">返回</view>
  91. <view class="sta-btn red" @click="showPop(0)" v-if="refundDetail.refundState == 30 || refundDetail.refundState == 39">售后审核</view>
  92. <view class="sta-btn" @click="showPop(1)" v-if="refundDetail.refundState == 36">退货确认</view>
  93. </view>
  94. <view class="chufangy" v-if="refundDetail.refundState == 40">请您到后台管理页面进行退款支付操作</view>
  95. <view class="ceng" v-if="isShowPop" @click="hidePop"></view>
  96. <view class="popup" v-if="isShowPop">
  97. <view class="pop-lis ddflex">
  98. <view class="pop-tit">售后类型</view>
  99. <view class="pop-type ddflex fflex">
  100. <view :class="'lis ddflex' + (psSwyIndex == index+1 ? ' active':'')" v-for="(item,index) in actions" :key="index" @click="onSelect(index)"><image :src="'static/images/' + (psSwyIndex == index+1 ? 'xyico_h.png' : 'xyico.png')"></image>{{item.name}}</view>
  101. </view>
  102. </view>
  103. <view class="pop-lis ddflex">
  104. <view class="pop-tit">退款金额<text>*实付金额</text></view>
  105. <view class="pop-money fflex">¥{{refundDetail.refundMoney}}</view>
  106. </view>
  107. <view class="pop-lis ddflex">
  108. <view class="pop-tit">审核</view>
  109. <view class="pop-type ddflex fflex">
  110. <view :class="'lis ddflex' + (checkState == 0 ? ' active':'')" @click="checkStates(0)"><image :src="'static/images/' + (checkState == 0 ? 'xyico_h.png' : 'xyico.png')"></image>拒绝</view>
  111. <view :class="'lis ddflex' + (checkState == 1 ? ' active':'')" @click="checkStates(1)"><image :src="'static/images/' + (checkState == 1 ? 'xyico_h.png' : 'xyico.png')"></image>通过</view>
  112. </view>
  113. </view>
  114. <textarea v-model="refundFalseRes" placeholder="请输入审核失败原因" placeholder-class="placeholder" class="reason" v-if="checkState == 0"></textarea>
  115. <view class="pop-btn ddflex">
  116. <view class="pop-cancel" @click="hidePop">取消</view>
  117. <view class="pop-confirm" @click="confirm">{{popType == 0 ? '审核' : '退货'}}确认</view>
  118. </view>
  119. </view>
  120. </view>
  121. </template>
  122. <script>
  123. const req = require('../utils/request');
  124. const utils = require("../utils/util");
  125. export default {
  126. data() {
  127. return {
  128. refundReason: {},
  129. refundFalseRes: '',
  130. refundType: '',
  131. refundMethod: '',
  132. action: false,
  133. psSwyIndex: 0,
  134. actions: [
  135. {
  136. name: '只退款'
  137. },
  138. {
  139. name: '退货并退款'
  140. }
  141. ],
  142. refundTypenum: 1,//默认1只退款
  143. refundDetail: {},
  144. imgUrl: [],
  145. imgIndex: 0,
  146. imgShow: false,
  147. show: false,
  148. refundId: '',
  149. active: 0,
  150. radio: 2,
  151. checkState: 1,
  152. isShowPop: false,
  153. popType: 0
  154. };
  155. },
  156. onLoad(opt) {
  157. this.refundId = opt.id;
  158. console.log('id》》》》》》');
  159. this.refundDataShow();
  160. },
  161. methods: {
  162. // 退款类型切换
  163. onSelect(index) {
  164. if(this.refundDetail.refundState == 36) return false;
  165. this.psSwyIndex = index + 1;
  166. this.refundDetail.refundType = index + 1
  167. },
  168. // 图片切换下标
  169. imgonChange(index) {
  170. this.imgIndex = index;
  171. },
  172. showPop(index){
  173. this.isShowPop = true
  174. this.popType = index
  175. },
  176. hidePop(){
  177. this.isShowPop = false
  178. },
  179. checkStates(index){
  180. this.checkState = index
  181. },
  182. preview(index){
  183. uni.previewImage({
  184. current: index,//点击显示的图片
  185. urls: this.refundDetail.imgUrl,//全部图片
  186. })
  187. },
  188. // 售后信息详情
  189. refundDataShow() {
  190. req.getRequest(
  191. '/api/v3/store/refund/detail',
  192. {
  193. id: this.refundId
  194. },
  195. res => {
  196. if (res.refundMethod == 1) {
  197. this.refundMethod = '邮寄';
  198. } else if (res.refundMethod == 2) {
  199. this.refundMethod = '送回门店';
  200. } else if (res.refundMethod == 3) {
  201. this.refundMethod = '货物拒收';
  202. }
  203. // res.dto.forEach(it => {
  204. // const pattern = /[`~!@#$^&*()=|{}':;',\\\[\]\.<>\/?~!@#¥……&*()——|{}【】';:""' + - - _ % 。,、?\s]/g;
  205. // it.userName = it.userName.replace(pattern, '');
  206. // });
  207. this.psSwyIndex = res.refundType
  208. this.refundDetail = res;
  209. if (res.imgUrl) {
  210. res.imgUrl = res.imgUrl.split(',');
  211. }
  212. // console.log(res.dto.length);
  213. // this.active = res.dto.length - 1;
  214. },
  215. true
  216. );
  217. },
  218. // 二次确认框
  219. confirm() {
  220. console.log(this.checkState);
  221. if (this.checkState == -1) {
  222. req.msg('请您选择审核成功或审核失败');
  223. } else {
  224. this.showDialog();
  225. }
  226. },
  227. showDialog() {
  228. var tha=this;
  229. var msg = '';
  230. if (this.refundDetail.refundState == 40 && this.checkState == 1) {
  231. msg = '是否确认退款?';
  232. } else if (this.refundDetail.refundState == 40 && this.checkState == 0) {
  233. msg = '您确定拒绝退款?';
  234. } else if (this.checkState == 0 && (this.refundDetail.refundState == 39 || this.refundDetail.refundState == 30)) {
  235. msg = '您确认要拒绝客户的售后审核吗?';
  236. } else if (this.checkState == 1 && this.refundDetail.refundState != 40) {
  237. msg = '请确认是否发货,发货后的售后就让客户先退货!';
  238. } else if (this.refundDetail.refundState == 36 && this.checkState == 0) {
  239. msg = '您确认客户退回的商品不能入库,您要结束本次售后服务?';
  240. }
  241. uni.showModal({
  242. title: '提示',
  243. content: msg,
  244. success(res) {
  245. if (res.confirm) {
  246. // 售后申请
  247. if (tha.refundDetail.refundState == 39 || tha.refundDetail.refundState == 30) {
  248. console.log('您确认要拒绝客户的售后审核吗?');
  249. tha.applyRefund();
  250. }
  251. // 退款支付
  252. if (tha.refundDetail.refundState == 40) {
  253. req.msg('请您到后台管理页面进行最后一步退款操作');
  254. }
  255. // 退货中
  256. if (tha.refundDetail.refundState == 36) {
  257. tha.goodRefund();
  258. }
  259. } else if (res.cancel) {
  260. }
  261. }
  262. });
  263. },
  264. back() {
  265. uni.navigateBack(); // 返回上一层
  266. },
  267. radioChange: function(evt) {
  268. this.checkState = evt.detail.value;
  269. },
  270. applyRefund() {
  271. if (this.checkState == 1) {
  272. this.refundFalseRes = '';
  273. }
  274. // if (this.checkState == '') {
  275. // req.msg('请您选择审核成功或审核失败');
  276. // }
  277. let dto = {
  278. id: this.refundDetail.id,
  279. orderId: this.refundDetail.orderId,
  280. checkState: this.checkState,
  281. refundType: this.psSwyIndex
  282. };
  283. if (this.checkState == 0) {
  284. dto.refundFalseRes = this.refundFalseRes;
  285. }
  286. //+ JSON.stringify(dto)
  287. req.putRequestJson('/api/orderRefund/apply?'+utils.convertUrlObj(dto), dto, res => {
  288. req.msg('操作成功');
  289. this.hidePop()
  290. this.refundDataShow();
  291. console.log(res);
  292. });
  293. },
  294. goodRefund() {
  295. if (this.checkState == 1) {
  296. this.refundFalseRes = '';
  297. }
  298. let dto = {
  299. id: this.refundDetail.id,
  300. orderId: this.refundDetail.orderId,
  301. checkState: this.checkState,
  302. refundType: this.psSwyIndex
  303. };
  304. // if (dto.checkState == '') {
  305. // req.msg('请您选择审核成功或审核失败');
  306. // }
  307. if (this.checkState == 0) {
  308. dto.refundFalseRes = this.refundFalseRes;
  309. }
  310. //+ JSON.stringify(dto)
  311. req.putRequestJson('/api/orderRefund/goodRefund?'+utils.convertUrlObj(dto), dto, res => {
  312. req.msg('操作成功');
  313. this.hidePop()
  314. this.refundDataShow();
  315. console.log(res);
  316. });
  317. }
  318. }
  319. };
  320. </script>
  321. <style scoped>
  322. @import './static/css/main.css';
  323. </style>