PurchaseDetail.vue 7.6 KB

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