inventoryDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <view class="inventory-detail">
  3. <!-- 导航栏 -->
  4. <u-navbar
  5. :title="pageTitle"
  6. :autoBack="true"
  7. fixed
  8. safe-area-inset-top
  9. placeholder
  10. >
  11. <template #right>
  12. <view class="nav-right">
  13. <u-icon name="search" size="20" color="#333"></u-icon>
  14. </view>
  15. </template>
  16. </u-navbar>
  17. <!-- 基本信息 吸顶 -->
  18. <view class="info-card">
  19. <view class="info-item">
  20. <text class="info-label">盘点单号:</text>
  21. <text class="info-value">{{ inventoryInfo.code }}</text>
  22. </view>
  23. <view class="info-item">
  24. <text class="info-label">盘点人:</text>
  25. <text class="info-value">{{ inventoryInfo.operator }}</text>
  26. </view>
  27. <view class="progress-box">
  28. <view class="progress-label-box">
  29. <text class="progress-label"> 盘点进度 </text>
  30. <text class="progress-value"
  31. >{{ inventoryInfo.progress }}/{{ inventoryInfo.total }}</text
  32. >
  33. </view>
  34. <view class="progress-bar-wrap">
  35. <u-line-progress
  36. :percentage="getProgressPercentage"
  37. height="4"
  38. :show-text="false"
  39. activeColor="#4080FF"
  40. >
  41. </u-line-progress>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 筛选按钮 -->
  46. <u-sticky bgColor="#F5F6F7" :offsetTop="44">
  47. <view class="filter-wrap">
  48. <view class="filter-btn" @click="filterPopupVisible = true">
  49. <text>筛选</text>
  50. <image
  51. src="@/static/image/saixuan-icon.png"
  52. mode=""
  53. class="icon"
  54. ></image>
  55. </view>
  56. </view>
  57. </u-sticky>
  58. <!-- 商品列表 -->
  59. <view class="goods-list">
  60. <view class="goods-item" v-for="(item, index) in goodsList" :key="index">
  61. <view class="location-row">
  62. <view class="location-left">
  63. <text class="location-label">库位:</text>
  64. <text class="location-value">{{ item.location }}</text>
  65. <image
  66. src="@/static/image/bianji-icon.png"
  67. mode=""
  68. class="icon"
  69. ></image>
  70. </view>
  71. <text class="category-text">{{ item.category }}</text>
  72. </view>
  73. <view class="goods-content">
  74. <image
  75. class="goods-image"
  76. :src="item.image"
  77. mode="aspectFill"
  78. ></image>
  79. <view class="goods-info">
  80. <text class="goods-name u-line-2">{{ item.name }}</text>
  81. <view class="goods-field half-w">
  82. <text class="field-label">规格:</text>
  83. <text class="field-value">{{ item.spec }}</text>
  84. </view>
  85. <view class="goods-field half-w">
  86. <text class="field-label">盘点人:</text>
  87. <text class="field-value">{{ item.checkUser }}</text>
  88. </view>
  89. <view class="goods-field">
  90. <text class="field-label">盘点时间:</text>
  91. <text class="field-value">{{ item.checkTime }}</text>
  92. </view>
  93. <view class="stock-row">
  94. <view class="stock-item">
  95. <text class="stock-label">系统库存</text>
  96. <text class="stock-value">{{ item.systemStock }}瓶</text>
  97. </view>
  98. <view class="stock-item">
  99. <text class="stock-label">已盘库存</text>
  100. <text
  101. class="stock-value"
  102. :class="{
  103. 'stock-value-zero': item.actualStock === '未盘',
  104. 'stock-value-warning': item.actualStock === '0瓶',
  105. }"
  106. >{{ item.actualStock }}</text
  107. >
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="action-row">
  113. <u-button
  114. type="primary"
  115. size="mini"
  116. @click="handleCheck(item)"
  117. class="action-btn"
  118. >盘点</u-button
  119. >
  120. <u-button
  121. type="primary"
  122. size="mini"
  123. @click="handleRecheck(item)"
  124. class="action-btn"
  125. >重新盘点
  126. </u-button>
  127. <u-button
  128. type="warning"
  129. size="mini"
  130. plain
  131. @click="handleCheck2(item)"
  132. class="action-btn action-btn-secondary"
  133. >盘亏</u-button
  134. >
  135. </view>
  136. </view>
  137. </view>
  138. <InventoryFilterPopup
  139. :show.sync="filterPopupVisible"
  140. :defaultValues="defaultFilterValues"
  141. @confirm="handleFilterConfirm"
  142. />
  143. <actionNumPopup :show.sync="actionPop.showNumPop" />
  144. <categoryPopup :show.sync="actionPop.showCategoryPop" />
  145. <error-pop
  146. v-model="actionPop.errorShow"
  147. isCenter
  148. cancelBtnText="取消"
  149. confirmBtnText="确定"
  150. @close="actionPop.errorShow = false"
  151. @confirm="confirm"
  152. :content="actionPop.errorText"
  153. ></error-pop>
  154. </view>
  155. </template>
  156. <script>
  157. import InventoryFilterPopup from "./components/inventoryFilterPopup.vue";
  158. import actionNumPopup from "./components/actionNumPopup.vue";
  159. import categoryPopup from "./components/categoryPopup.vue";
  160. import errorPop from "@/components/error-pop/error-pop.vue";
  161. export default {
  162. components: {
  163. InventoryFilterPopup,
  164. actionNumPopup,
  165. errorPop,
  166. categoryPopup,
  167. },
  168. data() {
  169. return {
  170. pageTitle: "2025年中心仓第三季度食品盘点",
  171. loadMoreStatus: "loadmore", //加载前值为loadmore,加载中为loading,没有数据为nomore
  172. pageNum: 1,
  173. pageSize: 10,
  174. inventoryInfo: {
  175. code: "2024202244",
  176. operator: "刘双秀",
  177. progress: 105,
  178. total: 604,
  179. },
  180. goodsList: [
  181. {
  182. location: "C6-2-2",
  183. category: "母婴用品-家居旅行",
  184. image: "/static/demo/goods1.png",
  185. name: "4层汗巾儿童全棉幼儿类吸汗巾婴儿纱布毛巾1条装",
  186. spec: "4层-随机",
  187. checkUser: "刘双秀",
  188. checkTime: "2025-04-03",
  189. systemStock: "5瓶",
  190. actualStock: "未盘",
  191. isChecked: false,
  192. },
  193. {
  194. location: "C6-2-2",
  195. category: "母婴用品-家居旅行",
  196. image: "/static/demo/goods1.png",
  197. name: "4层汗巾儿童全棉幼儿类吸汗巾婴儿纱布毛巾1条装",
  198. spec: "4层-随机",
  199. checkUser: "刘双秀",
  200. checkTime: "2025-04-03",
  201. systemStock: "5瓶",
  202. actualStock: "0瓶",
  203. isChecked: true,
  204. },
  205. ],
  206. filterPopupVisible: false,
  207. defaultFilterValues: {
  208. goods: "",
  209. user: "",
  210. category: "",
  211. location: "",
  212. },
  213. actionPop: {
  214. // 盘点数量弹框状态
  215. showNumPop: false,
  216. // 警告提示弹框状态
  217. errorShow: false,
  218. errorText: "是否提交盘点?",
  219. // 修改库位弹框状态
  220. showCategoryPop: false,
  221. },
  222. };
  223. },
  224. computed: {
  225. getProgressPercentage() {
  226. return (this.inventoryInfo.progress / this.inventoryInfo.total) * 100;
  227. },
  228. },
  229. onLoad(opt) {
  230. console.log("222222", opt);
  231. // 初始化数据
  232. // this.loadData(opt.id);
  233. },
  234. methods: {
  235. async loadData(id) {
  236. try {
  237. } catch (error) {}
  238. },
  239. handleCheck(item) {
  240. uni.showToast({
  241. title: "开始盘点",
  242. icon: "none",
  243. });
  244. },
  245. handleRecheck(item) {
  246. uni.showToast({
  247. title: "开始重新盘点",
  248. icon: "none",
  249. });
  250. },
  251. handleCheck2(item) {
  252. uni.showToast({
  253. title: "开始盘点2",
  254. icon: "none",
  255. });
  256. },
  257. handleFilterConfirm(values) {
  258. this.defaultFilterValues = values;
  259. this.filterPopupVisible = false;
  260. },
  261. },
  262. };
  263. </script>
  264. <style lang="scss">
  265. .inventory-detail {
  266. min-height: 100vh;
  267. background-color: #f0f6fb;
  268. padding-bottom: 40rpx;
  269. .nav-right {
  270. padding: 0 24rpx;
  271. }
  272. .info-card {
  273. background-color: #fff;
  274. padding: 16rpx 32rpx;
  275. .info-item {
  276. display: flex;
  277. font-size: 28rpx;
  278. margin-bottom: 10rpx;
  279. .info-label {
  280. color: #666;
  281. margin-right: 8rpx;
  282. }
  283. .info-value {
  284. color: #333;
  285. }
  286. }
  287. .progress-box {
  288. .progress-label-box {
  289. display: flex;
  290. justify-content: space-between;
  291. }
  292. .progress-label {
  293. font-size: 28rpx;
  294. color: #666;
  295. display: block;
  296. margin-bottom: 16rpx;
  297. }
  298. .progress-bar-wrap {
  299. margin-bottom: 16rpx;
  300. }
  301. .progress-value {
  302. font-size: 24rpx;
  303. color: #4080ff;
  304. display: block;
  305. text-align: right;
  306. }
  307. }
  308. }
  309. .filter-wrap {
  310. display: flex;
  311. justify-content: flex-end;
  312. padding: 20rpx;
  313. .filter-btn {
  314. display: flex;
  315. align-items: center;
  316. border-radius: 8rpx;
  317. font-size: 24rpx;
  318. color: #333333;
  319. .icon {
  320. margin-left: 8rpx;
  321. width: 32rpx;
  322. height: 32rpx;
  323. }
  324. }
  325. }
  326. .goods-list {
  327. width: 710rpx;
  328. margin: 0 20rpx;
  329. border-radius: 16rpx;
  330. .goods-item {
  331. background-color: #fff;
  332. overflow: hidden;
  333. border-bottom: 1px solid #f5f6f7;
  334. .location-row {
  335. display: flex;
  336. align-items: center;
  337. padding: 24rpx 32rpx;
  338. border-bottom: 1px solid #f5f6f7;
  339. gap: 40rpx;
  340. .location-left {
  341. display: flex;
  342. align-items: center;
  343. .location-label {
  344. font-size: 28rpx;
  345. color: #333;
  346. }
  347. .location-value {
  348. font-size: 28rpx;
  349. color: #4080ff;
  350. margin: 0 8rpx;
  351. }
  352. .icon {
  353. width: 32rpx;
  354. height: 32rpx;
  355. }
  356. }
  357. .category-text {
  358. font-size: 24rpx;
  359. color: #999;
  360. }
  361. }
  362. .goods-content {
  363. padding: 24rpx 32rpx;
  364. display: flex;
  365. .goods-image {
  366. width: 160rpx;
  367. flex-basis: 160rpx;
  368. height: 160rpx;
  369. border-radius: 8rpx;
  370. background-color: #f5f6f7;
  371. }
  372. .goods-info {
  373. display: flex;
  374. flex-wrap: wrap;
  375. flex: 1;
  376. margin-left: 24rpx;
  377. .half-w {
  378. width: 50%;
  379. }
  380. .goods-name {
  381. font-size: 28rpx;
  382. line-height: 1.4;
  383. color: #333;
  384. margin-bottom: 16rpx;
  385. }
  386. .goods-field {
  387. font-size: 24rpx;
  388. color: #666;
  389. margin-bottom: 16rpx;
  390. .field-label {
  391. color: #999;
  392. }
  393. .field-value {
  394. color: #666;
  395. }
  396. }
  397. }
  398. }
  399. .stock-row {
  400. display: grid;
  401. grid-template-columns: 50% 50%;
  402. width: 100%;
  403. padding: 24rpx;
  404. background-color: #f6f8fa;
  405. border-radius: 8rpx;
  406. .stock-item {
  407. display: flex;
  408. flex-direction: column;
  409. .stock-label {
  410. font-size: 24rpx;
  411. color: #999;
  412. margin-bottom: 20rpx;
  413. }
  414. .stock-value {
  415. font-size: 24rpx;
  416. color: #333;
  417. &-zero {
  418. color: #999;
  419. }
  420. &-warning {
  421. color: #ff9900;
  422. }
  423. }
  424. }
  425. }
  426. .action-row {
  427. padding: 0 32rpx 32rpx;
  428. display: flex;
  429. justify-content: flex-end;
  430. gap: 24rpx;
  431. .action-btn {
  432. width: 140rpx;
  433. height: 56rpx;
  434. padding: 0;
  435. &-secondary {
  436. background-color: transparent;
  437. border-color: #ff9900;
  438. color: #ff9900;
  439. }
  440. }
  441. }
  442. }
  443. }
  444. }
  445. </style>