AssetInventoryCheck.html 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>开始盘点</title>
  6. <meta
  7. name="viewport"
  8. content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no"
  9. />
  10. <meta name="apple-mobile-web-app-capable" content="yes" />
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  12. <link rel="stylesheet" href="../../js/vant@2.12/index.css" />
  13. <script src="../../js/vant@2.12/vue.js"></script>
  14. <script src="../../js/vant@2.12/vant.js"></script>
  15. <style>
  16. /* 防止Vue模板闪烁 */
  17. [v-cloak] {
  18. display: none !important;
  19. }
  20. /* 页面加载动画 */
  21. .page-loading {
  22. position: fixed;
  23. top: 0;
  24. left: 0;
  25. right: 0;
  26. bottom: 0;
  27. background: #f5f5f5;
  28. display: flex;
  29. align-items: center;
  30. justify-content: center;
  31. flex-direction: column;
  32. z-index: 9999;
  33. }
  34. .page-loading .loading-text {
  35. margin-top: 16px;
  36. color: #666;
  37. font-size: 14px;
  38. }
  39. body {
  40. background: #f5f5f5;
  41. min-height: 100vh;
  42. margin: 0;
  43. padding: 0;
  44. }
  45. .main-container {
  46. background: #f5f5f5;
  47. min-height: calc(100vh - 46px);
  48. padding-bottom: 20px;
  49. }
  50. .fixed-header {
  51. position: fixed;
  52. top: 46px;
  53. left: 0;
  54. right: 0;
  55. z-index: 999;
  56. background: #f5f5f5;
  57. }
  58. .steps-container {
  59. background: white;
  60. padding: -2px 16px 16px;
  61. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  62. }
  63. .info-card {
  64. background: white;
  65. padding: 0 16px;
  66. }
  67. .info-row {
  68. display: flex;
  69. padding: 8px 0;
  70. font-size: 14px;
  71. color: #333;
  72. line-height: 1.6;
  73. }
  74. .info-label {
  75. color: #666;
  76. margin-right: 8px;
  77. flex-shrink: 0;
  78. }
  79. .info-value {
  80. color: #333;
  81. font-weight: 500;
  82. }
  83. .tabs-wrapper {
  84. position: fixed;
  85. top: 186px;
  86. left: 0;
  87. right: 0;
  88. bottom: 0;
  89. z-index: 998;
  90. background: #f5f5f5;
  91. padding: 0 6px;
  92. }
  93. .tabs-container {
  94. background: white;
  95. border-radius: 8px;
  96. overflow: hidden;
  97. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  98. height: 100%;
  99. }
  100. /* 重写Vant Tabs样式 */
  101. .tabs-container .van-tabs__content {
  102. height: calc(100vh - 230px);
  103. }
  104. .tabs-container .van-tab__pane {
  105. height: 100%;
  106. overflow: hidden;
  107. }
  108. .tab-content {
  109. height: calc(100vh - 230px);
  110. overflow-y: auto;
  111. -webkit-overflow-scrolling: touch;
  112. }
  113. .asset-item {
  114. padding: 16px;
  115. border-bottom: 1px solid #f0f0f0;
  116. background: white;
  117. }
  118. .asset-item:last-child {
  119. border-bottom: none;
  120. }
  121. /* 待盘明细样式 */
  122. .pending-item {
  123. position: relative;
  124. }
  125. .pending-item::before {
  126. content: "";
  127. position: absolute;
  128. left: 0;
  129. top: 50%;
  130. transform: translateY(-50%);
  131. width: 4px;
  132. height: 60%;
  133. background: #ff9800;
  134. border-radius: 2px;
  135. }
  136. .pending-item .asset-name {
  137. font-size: 15px;
  138. color: #333;
  139. font-weight: 500;
  140. margin-bottom: 8px;
  141. padding-left: 12px;
  142. }
  143. .pending-item .asset-no {
  144. font-size: 13px;
  145. color: #999;
  146. padding-left: 12px;
  147. }
  148. .pending-badge {
  149. display: inline-block;
  150. background: #fff7e6;
  151. color: #ff9800;
  152. padding: 2px 8px;
  153. border-radius: 4px;
  154. font-size: 12px;
  155. margin-left: 8px;
  156. }
  157. /* 已盘样式 */
  158. .checked-item {
  159. position: relative;
  160. background: #f6ffed;
  161. }
  162. .checked-item::before {
  163. content: "";
  164. position: absolute;
  165. left: 0;
  166. top: 50%;
  167. transform: translateY(-50%);
  168. width: 4px;
  169. height: 60%;
  170. background: #52c41a;
  171. border-radius: 2px;
  172. }
  173. .checked-item .asset-header {
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-between;
  177. margin-bottom: 8px;
  178. padding-left: 12px;
  179. }
  180. .checked-item .asset-name {
  181. font-size: 15px;
  182. color: #333;
  183. font-weight: 500;
  184. flex: 1;
  185. }
  186. .checked-icon {
  187. color: #52c41a;
  188. font-size: 20px;
  189. }
  190. .checked-item .asset-no {
  191. font-size: 13px;
  192. color: #666;
  193. padding-left: 12px;
  194. }
  195. .checked-time {
  196. font-size: 12px;
  197. color: #999;
  198. margin-top: 6px;
  199. padding-left: 12px;
  200. }
  201. .empty-state {
  202. text-align: center;
  203. padding: 60px 20px;
  204. color: #999;
  205. }
  206. .empty-icon {
  207. font-size: 64px;
  208. margin-bottom: 16px;
  209. }
  210. .loading-more {
  211. text-align: center;
  212. padding: 16px;
  213. color: #999;
  214. font-size: 14px;
  215. }
  216. </style>
  217. </head>
  218. <body>
  219. <!-- 页面加载指示器 -->
  220. <div class="page-loading" id="pageLoading">
  221. <van-loading size="24px" color="#1890ff">加载中...</van-loading>
  222. </div>
  223. <div id="app" v-cloak>
  224. <!-- 顶部导航栏 -->
  225. <van-nav-bar
  226. title="开始盘点"
  227. left-text="返回"
  228. left-arrow
  229. @click-left="goBack"
  230. :fixed="true"
  231. >
  232. <template #right>
  233. <span @click="goToSync" style="color: #1890ff; font-size: 14px"
  234. >去同步</span
  235. >
  236. </template>
  237. </van-nav-bar>
  238. <!-- 固定头部区域 -->
  239. <div class="fixed-header">
  240. <!-- 步骤条 -->
  241. <div class="steps-container">
  242. <van-steps :active="1" active-color="#1890ff">
  243. <van-step>选择盘点单</van-step>
  244. <van-step>开始盘点</van-step>
  245. </van-steps>
  246. </div>
  247. <!-- 盘点单信息 -->
  248. <div class="info-card">
  249. <div class="info-row">
  250. <span class="info-label">盘点名称:</span>
  251. <span class="info-value">{{ inventoryInfo.name }}</span>
  252. </div>
  253. <div class="info-row">
  254. <span class="info-label">盘点单号:</span>
  255. <span class="info-value">{{ inventoryInfo.documentNo }}</span>
  256. </div>
  257. </div>
  258. </div>
  259. <!-- Tab切换区域(固定) -->
  260. <div class="tabs-wrapper">
  261. <div class="tabs-container">
  262. <van-tabs
  263. v-model="activeTab"
  264. color="#1890ff"
  265. @change="onTabChange"
  266. swipeable
  267. >
  268. <!-- 待盘明细 -->
  269. <van-tab :title="'待盘(' + pendingTotal + ')'">
  270. <div class="tab-content">
  271. <van-list
  272. v-model="pendingLoading"
  273. :finished="pendingFinished"
  274. finished-text="没有更多了"
  275. @load="onLoadPending"
  276. >
  277. <div
  278. v-for="item in displayedPendingList"
  279. :key="item.id"
  280. class="asset-item pending-item"
  281. >
  282. <div class="asset-name">
  283. {{ item.assetName }}
  284. <span class="pending-badge">待盘</span>
  285. </div>
  286. <div class="asset-no">资产编号: {{ item.no }}</div>
  287. </div>
  288. </van-list>
  289. <!-- 空状态 -->
  290. <div
  291. v-if="displayedPendingList.length === 0 && !pendingLoading"
  292. class="empty-state"
  293. >
  294. <div class="empty-icon">✅</div>
  295. <div>暂无待盘资产</div>
  296. </div>
  297. </div>
  298. </van-tab>
  299. <!-- 已盘 -->
  300. <van-tab :title="'已盘(' + checkedTotal + ')'">
  301. <div class="tab-content">
  302. <van-list
  303. v-model="checkedLoading"
  304. :finished="checkedFinished"
  305. finished-text="没有更多了"
  306. @load="onLoadChecked"
  307. >
  308. <div
  309. v-for="item in displayedCheckedList"
  310. :key="item.id"
  311. class="asset-item checked-item"
  312. >
  313. <div class="asset-header">
  314. <span class="asset-name">{{ item.assetName }}</span>
  315. <van-icon name="checked" class="checked-icon" />
  316. </div>
  317. <div class="asset-no">资产编号: {{ item.no }}</div>
  318. <div class="checked-time">
  319. 盘点时间: {{ item.checkTime }}
  320. </div>
  321. </div>
  322. </van-list>
  323. <!-- 空状态 -->
  324. <div
  325. v-if="displayedCheckedList.length === 0 && !checkedLoading"
  326. class="empty-state"
  327. >
  328. <div class="empty-icon">📦</div>
  329. <div>暂无已盘资产</div>
  330. </div>
  331. </div>
  332. </van-tab>
  333. </van-tabs>
  334. </div>
  335. </div>
  336. </div>
  337. <script type="text/javascript" src="../../js/UrlApi.js"></script>
  338. <script
  339. src="../../js/jquery-2.2.0.min.js"
  340. type="text/javascript"
  341. charset="utf-8"
  342. ></script>
  343. <script
  344. src="../../js/promise.min.js"
  345. type="text/javascript"
  346. charset="utf-8"
  347. ></script>
  348. <script
  349. src="../../js/common.js"
  350. type="text/javascript"
  351. charset="utf-8"
  352. ></script>
  353. <script
  354. src="../../js/IndexDbFactory.js"
  355. type="text/javascript"
  356. charset="utf-8"
  357. ></script>
  358. <script
  359. src="./AssetInventoryCheck.js"
  360. type="text/javascript"
  361. charset="utf-8"
  362. ></script>
  363. <script
  364. src="../../js/RfidMiddlewareApi.js"
  365. type="text/javascript"
  366. charset="utf-8"
  367. ></script>
  368. </body>
  369. </html>