You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

383 lines
6.9 KiB

  1. <template>
  2. <div class="pda-container">
  3. <!-- 头部栏 -->
  4. <div class="header-bar">
  5. <div class="header-left" @click="$router.back()">
  6. <i class="el-icon-arrow-left"></i>
  7. <span>仓库盘点</span>
  8. </div>
  9. <div class="header-right" @click="$router.push({ path: '/' })">
  10. 首页
  11. </div>
  12. </div>
  13. <!-- 搜索框 -->
  14. <div class="search-container">
  15. <el-input
  16. clearable
  17. v-model="searchValue"
  18. placeholder="请扫描盘点单号"
  19. prefix-icon="el-icon-search"
  20. @keyup.enter.native="onSearch"
  21. ref="searchInput"
  22. />
  23. </div>
  24. <!-- 盘点单列表 -->
  25. <div class="content-area">
  26. <div
  27. v-for="item in list"
  28. :key="item.reportId"
  29. class="inbound-card"
  30. @click="goToDetail(item)">
  31. <div class="card-title">
  32. <span class="title-label">盘点单号</span>
  33. <span class="title-value">{{ item.reportId }}</span>
  34. </div>
  35. <div class="card-details">
  36. <div class="detail-item">
  37. <div class="detail-label">标签张数</div>
  38. <div class="detail-value">
  39. <span class="qualified">{{ item.checkedCount }}</span><span class="total">{{ item.totalCount }}</span>
  40. </div>
  41. </div>
  42. <div class="detail-item">
  43. <div class="detail-label">物料总数</div>
  44. <div class="detail-value">
  45. <span class="qualified">{{ item.checkedQty }}</span><span class="total">{{ item.totalQty }}</span>
  46. </div>
  47. </div>
  48. <div class="detail-item">
  49. <div class="detail-label">盘点状态</div>
  50. <div class="detail-value status-value">
  51. <span class="status-tag" :class="'status-' + item.status">{{ item.statusDesc }}</span>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- 空状态 -->
  57. <div v-if="list.length === 0 && !loading" class="empty-state">
  58. <i class="el-icon-box"></i>
  59. <p>暂无盘点单</p>
  60. </div>
  61. <!-- 加载状态 -->
  62. <div v-if="loading" class="loading-state">
  63. <i class="el-icon-loading"></i>
  64. <p>加载中...</p>
  65. </div>
  66. </div>
  67. </div>
  68. </template>
  69. <script>
  70. import { countingWIPTodayList } from '@/api/warehouse/countingWIP.js'
  71. export default {
  72. name: 'CountingList',
  73. data() {
  74. return {
  75. searchValue: '',
  76. list: [],
  77. loading: false
  78. }
  79. },
  80. mounted() {
  81. // 聚焦搜索框
  82. this.$nextTick(() => {
  83. if (this.$refs.searchInput) {
  84. this.$refs.searchInput.focus()
  85. }
  86. })
  87. // 加载数据
  88. this.getList()
  89. },
  90. methods: {
  91. // 搜索
  92. onSearch() {
  93. this.getList()
  94. },
  95. // 获取列表
  96. getList() {
  97. this.loading = true
  98. const params = {
  99. reportId: this.searchValue
  100. }
  101. countingWIPTodayList(params).then(({ data }) => {
  102. if (data && data.code === 0) {
  103. this.list = data.list || []
  104. } else {
  105. this.$message.error(data.msg || '查询失败')
  106. }
  107. this.loading = false
  108. }).catch(() => {
  109. this.loading = false
  110. this.$message.error('查询失败')
  111. })
  112. },
  113. // 跳转到明细页
  114. goToDetail(item) {
  115. this.$router.push({
  116. name: 'countingDetail',
  117. query: {
  118. site: item.site,
  119. buNo: item.buNo,
  120. reportId: item.reportId,
  121. totalCount: item.totalCount,
  122. totalQty: item.totalQty,
  123. checkedCount: item.checkedCount,
  124. checkedQty: item.checkedQty
  125. }
  126. })
  127. }
  128. }
  129. }
  130. </script>
  131. <style scoped>
  132. .pda-container {
  133. width: 100vw;
  134. height: 100vh;
  135. display: flex;
  136. flex-direction: column;
  137. background: #f5f5f5;
  138. }
  139. /* 头部栏 */
  140. .header-bar {
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. padding: 8px 16px;
  145. background: #17B3A3;
  146. color: white;
  147. height: 40px;
  148. min-height: 40px;
  149. }
  150. .header-left {
  151. display: flex;
  152. align-items: center;
  153. cursor: pointer;
  154. font-size: 16px;
  155. font-weight: 500;
  156. }
  157. .header-left i {
  158. margin-right: 8px;
  159. font-size: 18px;
  160. }
  161. .header-right {
  162. cursor: pointer;
  163. font-size: 16px;
  164. font-weight: 500;
  165. }
  166. /* 搜索容器 */
  167. .search-container {
  168. padding: 12px 16px;
  169. background: white;
  170. }
  171. /* 内容区域 */
  172. .content-area {
  173. flex: 1;
  174. overflow-y: auto;
  175. padding: 12px 16px;
  176. }
  177. /* 入库卡片 */
  178. .inbound-card {
  179. background: white;
  180. border-radius: 8px;
  181. margin-bottom: 12px;
  182. padding: 16px;
  183. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  184. cursor: pointer;
  185. transition: all 0.2s ease;
  186. }
  187. .inbound-card:hover {
  188. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  189. transform: translateY(-1px);
  190. }
  191. .inbound-card:active {
  192. transform: translateY(0);
  193. }
  194. /* 卡片标题 */
  195. .card-title {
  196. margin-bottom: 12px;
  197. }
  198. .title-label {
  199. font-size: 12px;
  200. color: #666;
  201. display: block;
  202. margin-bottom: 4px;
  203. }
  204. .title-value {
  205. font-size: 16px;
  206. font-weight: bold;
  207. color: #333;
  208. margin-left: 20px;
  209. }
  210. /* 卡片详情 */
  211. .card-details {
  212. display: flex;
  213. justify-content: space-between;
  214. align-items: flex-start;
  215. gap: 4px;
  216. }
  217. .detail-item {
  218. flex: 1;
  219. text-align: center;
  220. min-width: 60px;
  221. max-width: 90px;
  222. }
  223. .detail-label {
  224. font-size: 11px;
  225. color: #666;
  226. margin-bottom: 4px;
  227. line-height: 1.2;
  228. margin-left: -12px;
  229. }
  230. .detail-value {
  231. font-size: 13px;
  232. color: #333;
  233. line-height: 1.2;
  234. margin-left: -12px;
  235. }
  236. .detail-value .qualified {
  237. color: #17B3A3;
  238. font-weight: 500;
  239. }
  240. .detail-value .total {
  241. color: #333;
  242. font-weight: 500;
  243. }
  244. .detail-value .total::before {
  245. content: '/';
  246. color: #333;
  247. }
  248. .detail-value.status-value {
  249. margin-left: 0;
  250. }
  251. .status-tag {
  252. display: inline-block;
  253. padding: 3px 10px;
  254. border-radius: 12px;
  255. font-size: 11px;
  256. color: #fff;
  257. font-weight: 500;
  258. }
  259. .status-0 {
  260. background-color: #909399;
  261. }
  262. .status-1 {
  263. background-color: #409EFF;
  264. }
  265. .status-2 {
  266. background-color: #E6A23C;
  267. }
  268. .status-3 {
  269. background-color: #67C23A;
  270. }
  271. /* 空状态 */
  272. .empty-state {
  273. display: flex;
  274. flex-direction: column;
  275. align-items: center;
  276. justify-content: center;
  277. padding: 60px 20px;
  278. color: #999;
  279. }
  280. .empty-state i {
  281. font-size: 48px;
  282. margin-bottom: 16px;
  283. }
  284. .empty-state p {
  285. font-size: 14px;
  286. margin: 0;
  287. }
  288. /* 加载状态 */
  289. .loading-state {
  290. display: flex;
  291. flex-direction: column;
  292. align-items: center;
  293. justify-content: center;
  294. padding: 60px 20px;
  295. color: #17B3A3;
  296. }
  297. .loading-state i {
  298. font-size: 24px;
  299. margin-bottom: 12px;
  300. animation: spin 1s linear infinite;
  301. }
  302. @keyframes spin {
  303. from { transform: rotate(0deg); }
  304. to { transform: rotate(360deg); }
  305. }
  306. .loading-state p {
  307. font-size: 14px;
  308. margin: 0;
  309. }
  310. /* 响应式设计 */
  311. @media (max-width: 360px) {
  312. .header-bar {
  313. padding: 8px 12px;
  314. }
  315. .search-container {
  316. padding: 8px 12px;
  317. }
  318. .content-area {
  319. padding: 8px 12px;
  320. }
  321. .inbound-card {
  322. padding: 12px;
  323. }
  324. .card-details {
  325. flex-wrap: wrap;
  326. gap: 6px;
  327. }
  328. .detail-item {
  329. flex: 0 0 48%;
  330. margin-bottom: 6px;
  331. min-width: 60px;
  332. }
  333. }
  334. </style>