InventoryDetails.vue 6.6 KB

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