ReturnDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <view class="detail-view">
  3. <view class="top-view ">
  4. <view class="status-text">{{ order_detail.auditStatus === 1 ? '待审核' : order_detail.auditStatus === 2 ? '已审核' : '已驳回' }}</view>
  5. <view class="desc" v-if="order_detail.auditStatus !== 1">
  6. {{ order_detail.auditName || '' }}在{{ $u.timeFormat(order_detail.auditTime, 'yyyy-mm-dd hh:MM:ss') }}进行{{order_detail.auditStatus === 2 ? '审核' : '驳回'}}
  7. </view>
  8. </view>
  9. <view class="customer-view">
  10. <view class="title clearfix">
  11. <view class="float_left ellipsis">{{ order_detail.customerName || '' }}</view>
  12. </view>
  13. <!-- 收货地址 -->
  14. <view class="delivery-view">
  15. <view class="name-top clearfix">
  16. <view class="float_left ellipsis">{{ order_detail.realName || '--' }}</view>
  17. <view class="float_right mobile" @click="callPhone(order_detail.mobile)">
  18. <text>{{ order_detail.mobile || '--' }}</text>
  19. <u-icon name="arrow-right" size="22"></u-icon>
  20. </view>
  21. </view>
  22. <view v-if="order_detail.area" class="address-view">
  23. {{ order_detail.area.provinceName }} {{ order_detail.area.cityName }} {{ order_detail.area.districtName }} {{ order_detail.address }}
  24. </view>
  25. </view>
  26. <view class="remark">备注:{{ order_detail.remark || '无' }}</view>
  27. </view>
  28. <view class="detail-cont">
  29. <view class="info-li clearfix">
  30. <view class="label">退货单号</view>
  31. <view class="value" @click="copy(order_detail.no)">
  32. <u-icon margin-right="20" label-pos="left" :label="order_detail.no || '--'" name="copy" custom-prefix="custom-icon" size="24"></u-icon>
  33. </view>
  34. </view>
  35. <view class="info-li clearfix">
  36. <view class="label">源订单号</view>
  37. <view class="value" @click="copy(order_detail.originNo)">
  38. <u-icon margin-right="20" label-pos="left" :label="order_detail.originNo || '--'" name="copy" custom-prefix="custom-icon" size="24"></u-icon>
  39. </view>
  40. </view>
  41. <view class="info-li clearfix">
  42. <view class="label">入库状态</view>
  43. <view class="value">
  44. <text :class="[parseInt(order_detail.inStatus) === 5 ? 'success-status' : 'danger-status']">
  45. {{ parseInt(order_detail.inStatus) === 4 ? '未入库' : '已入库' }}
  46. </text>
  47. </view>
  48. </view>
  49. <view class="info-li clearfix">
  50. <view class="label">所属店铺</view>
  51. <view class="value">{{ order_detail.shopName }}</view>
  52. </view>
  53. <view class="goods-title">商品清单</view>
  54. <view class="goods-ul">
  55. <view v-for="(item, index) in order_detail.details" :key="index" class="goods-li clearfix">
  56. <view class="goods-img float_left"><image :src="item.images[0]" mode="aspectFill"></image></view>
  57. <view class="float_left info">
  58. <view class="goods-name ellipsis">{{ item.goodsName }}</view>
  59. <view class="goods-num clearfix">
  60. <view class="float_left">{{ item.unitName }};{{ item.skuName }}</view>
  61. <text class="float_right">销售量:{{ $utils.formatNub(item.saleNum) }}{{ item.unitName }}</text>
  62. </view>
  63. <view class="goods-num clearfix">
  64. <text class="float_left price">{{ $utils.formattedNumber(item.returnUnitPrice) }}</text>
  65. <text class="float_right">退货量:{{ $utils.formatNub(item.num) }}{{ item.unitName }}</text>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="info-li clearfix">
  71. <view class="label money-label">退货金额</view>
  72. <view class="value money-value">{{ $utils.formattedNumber(totalMoney) }}</view>
  73. </view>
  74. <view class="info-li clearfix">
  75. <view class="label">制单人</view>
  76. <view class="value">{{ order_detail.operatorName || '无' }}</view>
  77. </view>
  78. <view class="info-li clearfix">
  79. <view class="label">制单时间</view>
  80. <view class="value">{{ $u.timeFormat(order_detail.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  81. </view>
  82. </view>
  83. <view class="btn-bottom-view clearfix" v-if="order_detail.auditStatus === 1">
  84. <view v-if="$accessCheck($Access.ReturnWarehousingOrderDeleteOrderReturn)" class="left-btn" @click="openModel('确定要删除该退货单吗?', '删除')">
  85. <u-icon
  86. label-pos="bottom"
  87. margin-top="10rpx"
  88. custom-prefix="custom-icon"
  89. name="quxiaodingdan"
  90. color="#B8C0C8"
  91. label="删除"
  92. label-color="#62738E"
  93. label-size="20"
  94. size="40"
  95. ></u-icon>
  96. </view>
  97. <view v-if="$accessCheck($Access.ReturnWarehousingOrderUpdateOrderReturn)" class="handel-btn" @click="openModel('确定要审核通过该退货单吗?', '审核')">审核</view>
  98. <view v-if="$accessCheck($Access.ReturnWarehousingOrder_updateOrderReturn)" class="handel-btn info-btn" @click="goPage(`/pagesT/order/AddReturn?id=${order_id}`)">
  99. 编辑
  100. </view>
  101. <view v-if="$accessCheck($Access.ReturnWarehousingOrderUpdateOrderReturn)" class="handel-btn info-btn" @click="cancel_show = true">驳回</view>
  102. </view>
  103. <u-popup v-model="cancel_show" mode="bottom">
  104. <view class="pop-ul">
  105. <view class="sku-name">请输入驳回退货单原因</view>
  106. <view class="pop-li"><textarea style="width: 100%;" placeholder-class="input-pl" placeholder="请输入" v-model="cancelReason" /></view>
  107. <view class="btn" @click="rejectOrderReturn">确定</view>
  108. </view>
  109. </u-popup>
  110. <u-modal v-model="model_show" :show-cancel-button="true" :content="model_content" @confirm="modelConfirm" @cancel="modelCancel"></u-modal>
  111. </view>
  112. </template>
  113. <script>
  114. export default {
  115. data() {
  116. return {
  117. model_tag: '',
  118. model_show: false,
  119. model_content: '',
  120. order_id: 0,
  121. order_detail: { details: [] },
  122. selfRuleData: {},
  123. updata_istrue: false,
  124. cancle_istrue: false,
  125. userCenterId: false,
  126. cancelReason: '',
  127. cancel_show: false
  128. };
  129. },
  130. onPullDownRefresh() {
  131. this.getOrderOut();
  132. },
  133. computed: {
  134. userInfo() {
  135. return this.$store.state.userInfo;
  136. },
  137. totalMoney() {
  138. let num = 0;
  139. this.order_detail.details.forEach(item => {
  140. num += Number(item.returnTotalPrice);
  141. });
  142. return num;
  143. }
  144. },
  145. onLoad(options) {
  146. this.order_id = options.id;
  147. this.getOrderOut();
  148. },
  149. methods: {
  150. // 详情
  151. getOrderOut() {
  152. this.$u.api
  153. .getOrderOut(this.order_id)
  154. .then(res => {
  155. uni.stopPullDownRefresh();
  156. this.order_detail = res.data;
  157. })
  158. .catch(err => {
  159. uni.stopPullDownRefresh();
  160. });
  161. },
  162. // 打开提示框
  163. openModel(content, tag) {
  164. this.model_content = content;
  165. this.model_show = true;
  166. this.model_tag = tag;
  167. },
  168. // 审核
  169. modelConfirm() {
  170. switch (this.model_tag) {
  171. case '审核':
  172. this.auditOrderOut();
  173. break;
  174. case '删除':
  175. this.deleteOrderOut();
  176. break;
  177. }
  178. },
  179. modelCancel() {},
  180. // 退货单驳回
  181. rejectOrderReturn() {
  182. this.$u.api
  183. .rejectOrderReturn({
  184. id: this.order_detail.id,
  185. auditFailReason: this.cancelReason
  186. })
  187. .then(res => {
  188. this.$u.toast('驳回成功');
  189. this.cancel_show = false;
  190. this.getOrderOut();
  191. });
  192. },
  193. // 退货单删除
  194. deleteOrderOut() {
  195. this.$u.api.deleteOrderOut(this.order_detail.id).then(res => {
  196. this.$u.toast('删除成功');
  197. uni.navigateBack();
  198. });
  199. },
  200. // 审核订单
  201. auditOrderOut() {
  202. this.$u.api
  203. .auditOrderOut(this.order_detail.id, {
  204. auditName: this.userInfo.name
  205. })
  206. .then(res => {
  207. this.$u.toast('审核成功');
  208. this.getOrderOut();
  209. });
  210. }
  211. }
  212. };
  213. </script>
  214. <style lang="scss" scoped>
  215. .detail-view {
  216. padding-bottom: 100rpx;
  217. }
  218. .top-view {
  219. background-color: $uni-color-primary;
  220. height: 200rpx;
  221. padding: 0 30rpx;
  222. color: #ffffff;
  223. font-size: 40rpx;
  224. .desc {
  225. font-size: 24rpx;
  226. padding-top: 10rpx;
  227. }
  228. }
  229. .customer-view {
  230. width: 710rpx;
  231. background-color: #ffffff;
  232. margin: 0 auto;
  233. border-radius: 20rpx;
  234. padding: 30rpx;
  235. transform: translateY(-80rpx);
  236. box-shadow: 0px 2px 12rpx 0px rgba(76, 80, 88, 0.16);
  237. .title {
  238. padding-bottom: 20rpx;
  239. .float_left {
  240. font-size: 32rpx;
  241. font-weight: bold;
  242. width: calc(100% - 120rpx);
  243. }
  244. }
  245. .delivery-view {
  246. font-size: 24rpx;
  247. color: #6c6c6c;
  248. .name-top {
  249. margin-bottom: 10rpx;
  250. .float_left {
  251. font-size: 28rpx;
  252. width: calc(100% - 180rpx);
  253. }
  254. .mobile {
  255. color: $uni-color-primary;
  256. }
  257. }
  258. }
  259. .remark {
  260. border-top: 1px solid #eeeeee;
  261. padding-top: 20rpx;
  262. line-height: 32rpx;
  263. margin-top: 20rpx;
  264. }
  265. }
  266. .detail-cont {
  267. width: 710rpx;
  268. margin: 0 auto;
  269. background-color: #ffffff;
  270. border-radius: 20rpx;
  271. padding: 20rpx 0;
  272. overflow: hidden;
  273. transform: translateY(-50rpx);
  274. .info-li {
  275. padding: 0 30rpx;
  276. line-height: 80rpx;
  277. .label {
  278. float: left;
  279. color: #6c6c6c;
  280. }
  281. .value {
  282. float: right;
  283. }
  284. .money-label {
  285. font-weight: bold;
  286. }
  287. .money-value {
  288. font-weight: bold;
  289. font-size: 30rpx;
  290. }
  291. }
  292. .b-b {
  293. border-bottom: 1px solid #eeeeee;
  294. }
  295. .goods-title {
  296. background-color: #5e6a84;
  297. line-height: 72rpx;
  298. width: 644rpx;
  299. margin: 30rpx auto 0;
  300. color: #ffffff;
  301. border-top-left-radius: 20rpx;
  302. border-top-right-radius: 20rpx;
  303. padding: 0 24rpx;
  304. position: relative;
  305. z-index: 1;
  306. }
  307. .goods-ul {
  308. padding: 0 30rpx 30rpx;
  309. box-shadow: 0px -3px 12rpx 0px #e4eaf5;
  310. border-bottom: 1px solid #eeeeee;
  311. .goods-li {
  312. padding-top: 24rpx;
  313. .goods-img {
  314. margin-right: 20rpx;
  315. image {
  316. width: 150rpx;
  317. height: 150rpx;
  318. border-radius: 8rpx;
  319. display: block;
  320. border: 1px solid #eeeeee;
  321. }
  322. }
  323. .info {
  324. .goods-name {
  325. width: 470rpx;
  326. -webkit-line-clamp: 2;
  327. height: 68rpx;
  328. line-height: 34rpx;
  329. }
  330. .goods-num {
  331. padding-top: 10rpx;
  332. font-size: 24rpx;
  333. .float_left {
  334. &.price {
  335. font-size: 28rpx;
  336. font-weight: bold;
  337. color: $uni-color-error;
  338. }
  339. }
  340. .float_right {
  341. }
  342. }
  343. }
  344. }
  345. }
  346. }
  347. .btn-bottom-view {
  348. position: fixed;
  349. left: 0;
  350. bottom: 0;
  351. height: 98rpx;
  352. background-color: #ffffff;
  353. padding: 0 38rpx;
  354. width: 100%;
  355. overflow: hidden;
  356. box-shadow: 0px -4rpx 32rpx 0px rgba(156, 170, 175, 0.16);
  357. .left-btn {
  358. margin-top: 10rpx;
  359. float: left;
  360. }
  361. .handel-btn {
  362. margin-left: 30rpx;
  363. margin-top: 20rpx;
  364. float: right;
  365. width: 164rpx;
  366. font-size: 26rpx;
  367. height: 60rpx;
  368. line-height: 60rpx;
  369. text-align: center;
  370. border-radius: 32rpx;
  371. background-color: $uni-color-primary;
  372. border: 1rpx solid $uni-color-primary;
  373. color: #ffffff;
  374. &.info-btn {
  375. border: 1rpx solid #979797;
  376. background-color: transparent;
  377. color: #2d405e;
  378. }
  379. }
  380. }
  381. .pop-ul {
  382. line-height: 90rpx;
  383. .sku-name {
  384. font-weight: bold;
  385. padding: 0 24rpx;
  386. }
  387. .pop-li {
  388. padding: 24rpx;
  389. border-top: 1px solid #ecf0f7;
  390. }
  391. .btn {
  392. width: 100%;
  393. text-align: center;
  394. color: #ffffff;
  395. line-height: 90rpx;
  396. background-color: $uni-color-primary;
  397. }
  398. .title {
  399. text-align: center;
  400. font-size: 28rpx;
  401. line-height: 80rpx;
  402. border-bottom: 1px solid #ecf0f7;
  403. }
  404. .desc {
  405. font-size: 28rpx;
  406. line-height: 36rpx;
  407. padding-bottom: 10rpx;
  408. padding: 10rpx 20rpx 0;
  409. }
  410. .desc-tip {
  411. font-size: 24rpx;
  412. line-height: 36rpx;
  413. padding-bottom: 10rpx;
  414. padding: 10rpx 20rpx 0;
  415. color: #879bba;
  416. }
  417. .btn-view {
  418. text-align: center;
  419. padding: 20rpx 0;
  420. }
  421. }
  422. </style>