taskDetail.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="inventory-task-detail">
  3. <!-- 导航栏 -->
  4. <u-navbar
  5. title="盘点任务详情"
  6. :autoBack="true"
  7. fixed
  8. safe-area-inset-top
  9. placeholder
  10. bgColor="#FFFFFF"
  11. ></u-navbar>
  12. <!-- 任务信息卡片 -->
  13. <view class="info-card">
  14. <view class="task-title">
  15. {{ taskInfo.taskName }}
  16. <view
  17. class="task-status"
  18. :class="{ 'status-completed': taskInfo.taskStatus === 3 }"
  19. >
  20. {{ curTaskStatusInfo.name2 }}
  21. </view>
  22. </view>
  23. <view class="task-number"> 盘点单号:{{ taskInfo.number }} </view>
  24. <!-- 统计信息 -->
  25. <view class="statistics">
  26. <view class="stat-item">
  27. <view class="stat-label">盘点商品</view>
  28. <view class="stat-value highlight">
  29. {{ taskInfo.finishCount }}/{{ taskInfo.itemCount }}
  30. </view>
  31. </view>
  32. <view class="stat-item">
  33. <view class="stat-label">差异率</view>
  34. <view class="stat-value">{{ taskInfo.differenceRate }}</view>
  35. </view>
  36. <view class="stat-item">
  37. <view class="stat-label">准确率</view>
  38. <view class="stat-value">{{ taskInfo.accuracyRate }}</view>
  39. </view>
  40. </view>
  41. <!-- 详情按钮 -->
  42. <view class="action-btn" @click="viewDetail"> 查看盘点详情 </view>
  43. <!-- 详细信息列表 -->
  44. <view class="info-list">
  45. <view class="info-item">
  46. <text class="info-label">盘点类型</text>
  47. <text class="info-value">{{ curTaskTyoeInfo.name }}</text>
  48. </view>
  49. <view class="info-item">
  50. <text class="info-label">盘点仓库</text>
  51. <text class="info-value">{{ taskInfo.depotName }}</text>
  52. </view>
  53. <view class="info-item">
  54. <text class="info-label">盘点范围</text>
  55. <text class="info-value">{{ taskInfo.positionRange }}</text>
  56. </view>
  57. <view class="info-item">
  58. <text class="info-label">参与人员</text>
  59. <text class="info-value">{{ taskInfo.operBy }}</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import { taskStocktakingDetail } from "@/common/request/apis/inventoryTask";
  67. import { getTaskTypeInfoByVal, getTaskStatusInfoByVal } from "./utils/index.js";
  68. export default {
  69. data() {
  70. return {
  71. taskInfo: {},
  72. };
  73. },
  74. computed: {
  75. curTaskStatusInfo() {
  76. return getTaskStatusInfoByVal(this.taskInfo.taskStatus);
  77. },
  78. curTaskTyoeInfo() {
  79. return getTaskTypeInfoByVal(this.taskInfo.taskType);
  80. },
  81. },
  82. onLoad(opt) {
  83. this.loadData(opt.id);
  84. },
  85. methods: {
  86. viewDetail() {
  87. // 跳转到盘点详情页面
  88. uni.navigateTo({
  89. url: "/pages/inventory-task/inventoryDetail",
  90. });
  91. },
  92. async loadData(id) {
  93. try {
  94. const res = await taskStocktakingDetail(id);
  95. console.log("res====", res);
  96. this.taskInfo = res.data;
  97. } catch (error) {}
  98. },
  99. },
  100. };
  101. </script>
  102. <style lang="scss">
  103. .inventory-task-detail {
  104. min-height: 100vh;
  105. background-color: #f5f7fa;
  106. padding-bottom: 30rpx;
  107. .info-card {
  108. padding: 30rpx;
  109. background-color: #ffffff;
  110. border-radius: 20rpx;
  111. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
  112. .task-title {
  113. font-size: 32rpx;
  114. font-weight: 500;
  115. color: #333333;
  116. line-height: 44rpx;
  117. display: flex;
  118. justify-content: space-between;
  119. align-items: center;
  120. .task-status {
  121. font-size: 24rpx;
  122. padding: 4rpx 16rpx;
  123. background-color: #e3f2fd;
  124. color: #2196f3;
  125. border-radius: 20rpx;
  126. font-weight: normal;
  127. &.status-completed {
  128. background-color: #e8f5e9;
  129. color: #4caf50;
  130. }
  131. }
  132. }
  133. .task-number {
  134. font-size: 28rpx;
  135. color: #666666;
  136. margin-top: 16rpx;
  137. margin-bottom: 30rpx;
  138. }
  139. .statistics {
  140. display: flex;
  141. justify-content: space-between;
  142. background-color: #f7f8fa;
  143. border-radius: 10rpx;
  144. padding: 30rpx 0;
  145. margin-bottom: 30rpx;
  146. .stat-item {
  147. flex: 1;
  148. display: flex;
  149. flex-direction: column;
  150. align-items: center;
  151. .stat-label {
  152. font-size: 24rpx;
  153. color: #999999;
  154. margin-bottom: 10rpx;
  155. }
  156. .stat-value {
  157. font-size: 28rpx;
  158. color: #333333;
  159. font-weight: 500;
  160. &.highlight {
  161. color: #4080ff;
  162. }
  163. }
  164. }
  165. }
  166. .action-btn {
  167. height: 88rpx;
  168. background-color: #4080ff;
  169. border-radius: 16rpx;
  170. color: #ffffff;
  171. font-size: 30rpx;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. margin-bottom: 40rpx;
  176. }
  177. .info-list {
  178. padding: 20rpx;
  179. .info-item {
  180. display: flex;
  181. justify-content: space-between;
  182. padding: 20rpx 0;
  183. &:last-child {
  184. border-bottom: none;
  185. }
  186. .info-label {
  187. font-size: 28rpx;
  188. color: #666666;
  189. }
  190. .info-value {
  191. font-size: 28rpx;
  192. color: #333333;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. </style>