LossDetails.vue 7.2 KB

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