check-item.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view class="check-item">
  3. <view class="header-box">
  4. <view class="header-box-l">
  5. <view class="header-box-name">{{ info.taskName }}</view>
  6. <view>盘点单号:{{ info.number }}</view>
  7. </view>
  8. <view>
  9. <view :class="['tips-box', curTaskStatusInfo.className]">{{
  10. curTaskStatusInfo.name
  11. }}</view>
  12. </view>
  13. </view>
  14. <view class="cont-box" @click="toDetail">
  15. <view class="cont-item">
  16. <view class="item-label">盘点仓库</view>
  17. <view class="item-val">{{ info.depotName || "-" }}</view>
  18. </view>
  19. <view class="cont-item">
  20. <view class="item-label">创建人</view>
  21. <view class="item-val">{{ info.createName || "-" }}</view>
  22. </view>
  23. <view class="cont-item">
  24. <view class="item-label">盘点负责人</view>
  25. <view class="item-val">{{ info.creatorName || "-" }}</view>
  26. </view>
  27. <view class="cont-item">
  28. <view class="item-label">货物种类</view>
  29. <view class="item-val">{{ info.categoryCount || "-" }}</view>
  30. </view>
  31. <view class="cont-item">
  32. <view class="item-label">货物总量</view>
  33. <view class="item-val">{{ info.materialCount || "-" }}</view>
  34. </view>
  35. <view class="cont-item">
  36. <view class="item-label">库位范围</view>
  37. <view class="item-val">{{ info.positionRange || "-" }}</view>
  38. </view>
  39. <view class="cont-item">
  40. <view class="item-label">创建时间</view>
  41. <view class="item-val">{{
  42. info.createTime ? $u.timeFormat(info.createTime, "yyyy-mm-dd") : "-"
  43. }}</view>
  44. </view>
  45. <view class="cont-item">
  46. <view class="item-label">盘点时间</view>
  47. <view class="item-val">{{
  48. $u.timeFormat(info.operTime, "yyyy-mm-dd")
  49. }}</view>
  50. </view>
  51. <view class="cont-item">
  52. <view class="item-label">盘点人</view>
  53. <view class="item-val">{{ info.operName || "-" }}</view>
  54. </view>
  55. </view>
  56. <view class="btn-box">
  57. <u-button
  58. class="detail-btn"
  59. type="primary"
  60. text="详情"
  61. :customStyle="customBtnStyle"
  62. @click="handleCick('详情')"
  63. v-if="status === 3 || status === 4"
  64. ></u-button>
  65. <u-button
  66. class="detail-btn"
  67. type="primary"
  68. text="去盘点"
  69. :customStyle="customBtnStyle"
  70. @click="handleCick('去盘点')"
  71. v-if="status === 1 || status === 2"
  72. ></u-button>
  73. <u-button
  74. class="detail-btn"
  75. type="primary"
  76. text="去提交"
  77. :customStyle="customBtnStyle"
  78. @click="handleCick('去提交')"
  79. v-if="status === 2"
  80. ></u-button>
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import { getTaskStatusInfoByVal } from "../../inventory-task/utils/index.js";
  86. export default {
  87. props: {
  88. info: {
  89. type: Object,
  90. default: () => {},
  91. },
  92. },
  93. computed: {
  94. status() {
  95. return this.info.taskStatus;
  96. },
  97. curTaskStatusInfo() {
  98. return getTaskStatusInfoByVal(this.info.taskStatus);
  99. },
  100. },
  101. data() {
  102. return {
  103. customBtnStyle: {
  104. width: "144rpx",
  105. height: "56rpx",
  106. borderRadius: "28rpx",
  107. background: "#0256ff",
  108. fontSize: "32rpx",
  109. borderRadius: "8rpx",
  110. marginLeft: "20rpx",
  111. },
  112. };
  113. },
  114. methods: {
  115. handleCick(btnName) {
  116. const params = {
  117. ...this.info,
  118. btnName,
  119. };
  120. this.$emit("btnClick", params);
  121. },
  122. toDetail() {
  123. let text = "";
  124. if (this.status === 3 || this.status === 4) {
  125. text = "详情";
  126. } else if (this.status === 1 || this.status === 2) {
  127. text = "去盘点";
  128. }
  129. this.handleCick(text);
  130. },
  131. },
  132. };
  133. </script>
  134. <style lang="scss" scoped>
  135. .check-item {
  136. padding: 24rpx 24rpx 0 24rpx;
  137. // border-radius: 16px;
  138. background: #fff;
  139. border-bottom: 4rpx solid #f0f6fb;
  140. .header-box {
  141. display: flex;
  142. justify-content: space-between;
  143. .header-box-l {
  144. color: #999;
  145. font-size: 28rpx;
  146. font-weight: 400;
  147. .header-box-name {
  148. color: #333;
  149. font-size: 28rpx;
  150. font-weight: 500;
  151. }
  152. }
  153. .tips-box {
  154. width: 120rpx;
  155. height: 44rpx;
  156. font-size: 22rpx;
  157. text-align: center;
  158. line-height: 44rpx;
  159. border-radius: 8rpx;
  160. }
  161. .tips-red {
  162. color: #ff3b1d;
  163. background: rgba(255, 59, 29, 0.2);
  164. }
  165. .tips-green {
  166. color: #00b97b;
  167. background: rgba(0, 185, 123, 0.2);
  168. }
  169. .tips-hui {
  170. color: #bfc8db;
  171. background: rgba(173, 181, 189, 0.26);
  172. }
  173. .tips-yellow {
  174. color: #f59701;
  175. background: rgba(245, 151, 1, 0.2);
  176. }
  177. }
  178. .cont-box {
  179. border-radius: 16rpx;
  180. background: #f6f8fa;
  181. margin-top: 16rpx;
  182. padding: 24rpx;
  183. display: grid;
  184. grid-template-columns: 33.3% 33.3% 33.3%;
  185. .cont-item {
  186. margin-bottom: 20rpx;
  187. .item-label {
  188. color: #999;
  189. font-size: 24rpx;
  190. font-weight: 400;
  191. margin-bottom: 6rpx;
  192. }
  193. .item-val {
  194. color: #000;
  195. font-size: 28rpx;
  196. font-weight: 400;
  197. }
  198. }
  199. }
  200. .btn-box {
  201. display: flex;
  202. align-items: center;
  203. justify-content: flex-end;
  204. padding: 16rpx 0 24rpx;
  205. .detail-btn {
  206. width: 144rpx;
  207. height: 56rpx;
  208. border-radius: 28rpx;
  209. background: #0256ff;
  210. font-size: 32rpx;
  211. border-radius: 8rpx;
  212. margin-right: 20rpx;
  213. }
  214. }
  215. }
  216. </style>