PurchaseReturnDetail.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <view class="detail-view">
  3. <view class="top-view clearfix">
  4. <view class="float_left">
  5. <text v-if="order_detail.auditStatus === 2" class="status-text">已审核</text>
  6. <text v-else class="status-text">待审核</text>
  7. </view>
  8. </view>
  9. <view class="detail-cont">
  10. <view class="info-li clearfix">
  11. <view class="label">退货单号</view>
  12. <view class="value" @click="copy(order_detail.no)">
  13. <u-icon margin-right="20" label-pos="left" :label="order_detail.no" name="copy" custom-prefix="custom-icon" size="24"></u-icon>
  14. </view>
  15. </view>
  16. <view class="info-li clearfix">
  17. <view class="label">源采购单号</view>
  18. <view class="value" @click="copy(order_detail.originNo)">
  19. <u-icon margin-right="20" label-pos="left" :label="order_detail.no" name="copy" custom-prefix="custom-icon" size="24"></u-icon>
  20. </view>
  21. </view>
  22. <view class="info-li clearfix">
  23. <view class="label">退货仓库</view>
  24. <view class="value">{{ order_detail.warehouseName }}</view>
  25. </view>
  26. <view class="info-li clearfix">
  27. <view class="label">出库状态</view>
  28. <view class="value">
  29. <text v-if="order_detail.outStatus === 5" class="success-status">已出库</text>
  30. <text v-else class="warning-status">未出库</text>
  31. </view>
  32. </view>
  33. <view class="info-li clearfix">
  34. <view class="label">采购员</view>
  35. <view class="value">{{ order_detail.buyerName }}</view>
  36. </view>
  37. <view class="info-li clearfix">
  38. <view class="label">供应商</view>
  39. <view class="value">{{ order_detail.supplierName }}</view>
  40. </view>
  41. <view class="info-li clearfix">
  42. <view class="label">制单人</view>
  43. <view class="value">{{ order_detail.operatorName }}</view>
  44. </view>
  45. <view class="info-li clearfix">
  46. <view class="label">制单时间</view>
  47. <view class="value">{{ $u.timeFormat(order_detail.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  48. </view>
  49. <block v-if="order_detail.auditStatus === 2">
  50. <view class="info-li clearfix">
  51. <view class="label">审核人</view>
  52. <view class="value">{{ order_detail.auditName }}</view>
  53. </view>
  54. <view class="info-li clearfix">
  55. <view class="label">审核时间</view>
  56. <view class="value">{{ $u.timeFormat(order_detail.auditTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  57. </view>
  58. </block>
  59. <view class="goods-title">商品清单</view>
  60. <view class="goods-ul">
  61. <view class="goods-li clearfix" v-for="(item, index) in order_detail.details" :key="index">
  62. <view class="goods-img float_left"><image src="../../static/img/goods.png" mode="aspectFill"></image></view>
  63. <view class="float_left info">
  64. <view class="goods-name ellipsis">{{ item.goodsName }}</view>
  65. <view class="goods-code clearfix">
  66. <view class="float_left">{{ item.goodsCode }}</view>
  67. <view class="float_right">采购:{{ $utils.formatNub(item.purchaseNum) }}</view>
  68. </view>
  69. <view class="goods-num clearfix">
  70. <view class="float_left">{{ item.unitName }};{{ item.skuName }}</view>
  71. <text class="float_right">退货:{{ $utils.formatNub(item.buyerNum) }}</text>
  72. </view>
  73. <view class="goods-num clearfix">
  74. <view class="float_left ">
  75. <text class="price">{{ $utils.formattedNumber(item.buyerUnitPrice) }}</text>
  76. </view>
  77. <view class="float_right">
  78. 小计:
  79. <text class="price">{{ $utils.formattedNumber(item.subtotalPrice) }}</text>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="info-li clearfix">
  86. <view class="label">其他金额</view>
  87. <view class="value">{{ $utils.formattedNumber(order_detail.otherAmount) }}</view>
  88. </view>
  89. <view class="info-li clearfix">
  90. <view class="label money-label">退货金额</view>
  91. <view class="value money-value">{{ $utils.formattedNumber(order_detail.purchaseAmount) }}</view>
  92. </view>
  93. <view class="remark-li">
  94. <view class="label">退货说明</view>
  95. <view class="remark">
  96. <text>{{ order_detail.remark || '无' }}</text>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="detail-bottom" v-if="order_detail.auditStatus === 1">
  101. <view v-if="$accessCheck($Access.PurchaseReturnOrderDelPurchaseOut)" class="handel-btn info-btn" @click="openModel('请确认是否要删除采购退货单?', '删除')">删除</view>
  102. <view v-if="$accessCheck($Access.PurchaseReturnOrderEditPurchase)" class="handel-btn" @click="goPage('/pagesT/Purchase/AddPurchaseReturn?id=' + order_id)">编辑</view>
  103. <view v-if="$accessCheck($Access.PurchaseReturnOrderUpdateAuditStatus)" class="handel-btn" @click="openModel('确定要审核通过该退货单吗?', '审核')">审核</view>
  104. </view>
  105. <u-modal v-model="model_show" :show-cancel-button="true" :content="model_content" @confirm="modelConfirm"></u-modal>
  106. </view>
  107. </template>
  108. <script>
  109. export default {
  110. data() {
  111. return {
  112. model_tag: '',
  113. model_show: false,
  114. model_content: '',
  115. order_id: 0,
  116. order_detail: {}
  117. };
  118. },
  119. onPullDownRefresh() {
  120. this.getPurchaseOutInfoById();
  121. },
  122. computed: {
  123. userInfo() {
  124. return this.$store.state.userInfo;
  125. }
  126. },
  127. onLoad(options) {
  128. this.order_id = options.id;
  129. },
  130. onShow() {
  131. this.getPurchaseOutInfoById();
  132. },
  133. methods: {
  134. // 详情
  135. getPurchaseOutInfoById() {
  136. this.$u.api
  137. .getPurchaseOutInfoById(this.order_id)
  138. .then(res => {
  139. uni.stopPullDownRefresh();
  140. this.order_detail = res.data;
  141. })
  142. .catch(err => {
  143. uni.stopPullDownRefresh();
  144. });
  145. },
  146. // 打开提示框
  147. openModel(content, tag) {
  148. this.model_content = content;
  149. this.model_show = true;
  150. this.model_tag = tag;
  151. },
  152. // 审核
  153. modelConfirm() {
  154. switch (this.model_tag) {
  155. case '审核':
  156. this.updatePurchaseOut();
  157. break;
  158. case '删除':
  159. this.delPurchaseOut();
  160. break;
  161. }
  162. },
  163. // 审核订单
  164. updatePurchaseOut() {
  165. this.$u.api
  166. .updatePurchaseOut(this.order_id, {
  167. auditStatus: '2',
  168. auditName: this.userInfo.name
  169. })
  170. .then(res => {
  171. this.$u.toast('审核成功');
  172. this.getPurchaseOutInfoById();
  173. });
  174. },
  175. // 删除采购单
  176. delPurchaseOut() {
  177. this.$u.api.delPurchaseOut(this.order_id).then(res => {
  178. this.$u.toast('已删除');
  179. setTimeout(() => {
  180. uni.navigateBack();
  181. }, 2000);
  182. });
  183. }
  184. }
  185. };
  186. </script>
  187. <style lang="scss" scoped>
  188. .detail-view {
  189. padding-bottom: 100rpx;
  190. }
  191. .top-view {
  192. background-color: $uni-color-primary;
  193. height: 200rpx;
  194. padding: 0 30rpx;
  195. color: #ffffff;
  196. font-size: 40rpx;
  197. line-height: 100rpx;
  198. .status-text {
  199. margin-right: 10rpx;
  200. }
  201. .float_right {
  202. font-size: 28rpx;
  203. }
  204. }
  205. .detail-cont {
  206. width: 710rpx;
  207. margin: 0 auto;
  208. background-color: #ffffff;
  209. border-radius: 20rpx;
  210. padding: 20rpx 0;
  211. overflow: hidden;
  212. transform: translateY(-80rpx);
  213. .info-li {
  214. padding: 0 30rpx;
  215. line-height: 80rpx;
  216. .label {
  217. float: left;
  218. color: #6c6c6c;
  219. }
  220. .value {
  221. float: right;
  222. }
  223. .money-label {
  224. font-weight: bold;
  225. }
  226. .money-value {
  227. font-weight: bold;
  228. font-size: 30rpx;
  229. }
  230. }
  231. .remark-li {
  232. padding: 0 30rpx;
  233. .label {
  234. color: #6c6c6c;
  235. line-height: 60rpx;
  236. }
  237. }
  238. .b-b {
  239. border-bottom: 1px solid #eeeeee;
  240. }
  241. .goods-title {
  242. background-color: #5e6a84;
  243. line-height: 72rpx;
  244. width: 644rpx;
  245. margin: 30rpx auto 0;
  246. color: #ffffff;
  247. border-top-left-radius: 20rpx;
  248. border-top-right-radius: 20rpx;
  249. padding: 0 24rpx;
  250. position: relative;
  251. z-index: 1;
  252. }
  253. .goods-ul {
  254. padding: 0 30rpx 30rpx;
  255. box-shadow: 0px -3px 12rpx 0px #e4eaf5;
  256. border-bottom: 1px solid #eeeeee;
  257. .goods-li {
  258. padding-top: 24rpx;
  259. .goods-img {
  260. margin-right: 20rpx;
  261. image {
  262. width: 150rpx;
  263. height: 150rpx;
  264. border-radius: 8rpx;
  265. display: block;
  266. }
  267. }
  268. .info {
  269. .goods-name {
  270. width: 470rpx;
  271. height: 34rpx;
  272. line-height: 34rpx;
  273. }
  274. .goods-code {
  275. font-size: 24rpx;
  276. padding-top: 10rpx;
  277. }
  278. .goods-num {
  279. padding-top: 10rpx;
  280. font-size: 24rpx;
  281. .price {
  282. font-size: 28rpx;
  283. font-weight: bold;
  284. color: $uni-color-error;
  285. }
  286. }
  287. }
  288. }
  289. }
  290. }
  291. </style>