AllocationDetails.vue 7.4 KB

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