index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view class="page">
  3. <view class="page-container">
  4. <u-navbar class="nav-bar" title="库存管理" :autoBack="true" :placeholder="true" v-hideNav></u-navbar>
  5. <!-- 总资产成本区域 -->
  6. <view class="asset-header">
  7. <view class="asset-text-wrap">
  8. <view class="asset-title-con">
  9. <view class="asset-title">总资产成本(元)</view>
  10. <u-icon name="question-circle" size="14" color="#999999"></u-icon>
  11. </view>
  12. <text class="asset-value">{{ wareHouseCard.totalCost }}</text>
  13. </view>
  14. <u-button class="view-btn" type="text" size="mini">查看财务报表</u-button>
  15. </view>
  16. <view class="data-cards">
  17. <view class="card-item">
  18. <text class="card-label">今日上传</text>
  19. <text class="card-value">{{ wareHouseCard.uploadCostToday }}</text>
  20. </view>
  21. <view class="card-item">
  22. <text class="card-label">今日下架</text>
  23. <text class="card-value green">{{ wareHouseCard.outStockToday }}</text>
  24. </view>
  25. <view class="card-item">
  26. <text class="card-label">商品总数</text>
  27. <text class="card-value">{{ wareHouseCard.totalNum }}</text>
  28. </view>
  29. </view>
  30. <view class="search-wrapper">
  31. <u-search placeholder="搜索编号、名称、品牌..." bg-color="#f9fafb" border-radius="4rpx"
  32. :show-action="false" class="search-input-wrap"></u-search>
  33. </view>
  34. <view class="category-tabs-wrap">
  35. <u-tabs :list="tabList" :is-scroll="true" active-color="#007aff" inactive-color="#666666" font-size="28rpx"
  36. border-bottom="none" @change="switchTab" class="u-tabs-custom"></u-tabs>
  37. </view>
  38. <view class="filter-bar">
  39. <view class="sort-btn">
  40. <text class="sort-text">{{ currentSortText }}</text>
  41. <u-icon name="arrow-down" size="12" color="#666666" class="sort-icon"></u-icon>
  42. </view>
  43. <view class="price-layout-btn">
  44. <view class="price-btn" type="text">
  45. <u-icon name="eye" size="18" color="#1890ff" class="price-icon"></u-icon>
  46. <text class="price-text">价格可见</text>
  47. </view>
  48. <view class="layout-btn" type="text" size="mini">
  49. <u-icon name="grid" size="20" color="#666666"></u-icon>
  50. <!-- 筛选列 品牌、价格范围、位置、回收时间、回收人员、鉴定人员、商品属性 -->
  51. </view>
  52. </view>
  53. </view>
  54. <view class="goods-list">
  55. <view @click="handleToDetail" class="goods-item" v-for="(goods, goodsIndex) in goodsList" :key="`goods-${goodsIndex}`">
  56. <view class="goods-img-container">
  57. <image class="goods-img" :src="goods.imgUrl" mode="aspectFill" lazy-load></image>
  58. <view class="stock-indicator"
  59. v-if="goods.stock !== null && goods.stock !== undefined && goods.stock > 0"></view>
  60. </view>
  61. <view class="goods-info">
  62. <text class="goods-brand">{{ goods.brand || '' }}</text>
  63. <text class="goods-name">{{ goods.name || '' }}</text>
  64. <view class="price-group">
  65. <view class="price-items">
  66. <view class="price-item">
  67. <text class="price-type">成本价</text>
  68. <text class="price">¥{{ goods.costPrice }}</text>
  69. </view>
  70. <view class="price-item">
  71. <text class="price-type">销售价</text>
  72. <text class="price sales">¥{{ goods.salesPrice }}</text>
  73. </view>
  74. </view>
  75. <view class="price-items">
  76. <view class="price-item">
  77. <text class="price-type">同行价</text>
  78. <text class="price">¥{{ goods.peerPrice }}</text>
  79. </view>
  80. <view class="price-item">
  81. <text class="price-type">代理价</text>
  82. <text class="price">¥{{ goods.agentPrice }}</text>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="others">
  87. <view class="other-item stock" >得</view>
  88. <view class="other-item">得</view>
  89. <view class="other-item">得</view>
  90. </view>
  91. </view>
  92. <view class="more">
  93. <u-icon name="more-dot-fill" size="16" color="#666666"></u-icon>
  94. <text class="goods-stock"
  95. v-if="goods.stock !== null && goods.stock !== undefined && goods.stock > 0">数量:{{ goods.stock
  96. }}</text>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. <!-- 添加按钮 -->
  102. <view class="add-button" @click="handleAdd">
  103. <u-icon name="plus" size="36" color="#ffffff"></u-icon>
  104. </view>
  105. </view>
  106. </template>
  107. <script>
  108. export default {
  109. data() {
  110. return {
  111. wareHouseCard:{},
  112. tabList: [
  113. { name: "全部" },
  114. { name: "腕表" },
  115. { name: "箱包" },
  116. { name: "珠宝" },
  117. { name: "鞋靴" },
  118. { name: "配饰" },
  119. { name: "服饰" },
  120. { name: "其它" }
  121. ],
  122. currentSortText: '按最近更新排序',
  123. goodsList: [
  124. {
  125. imgUrl: require("./imgs/1.jpg"),
  126. brand: "ROLEX",
  127. name: "Submariner Date 126610LN",
  128. costPrice: "92,500",
  129. salesPrice: "89,000",
  130. peerPrice: "92,500",
  131. agentPrice: "89,000",
  132. stock: 1
  133. },
  134. {
  135. imgUrl: require("./imgs/1.jpg"),
  136. brand: "ROLEX",
  137. name: "Submariner Date 126610LN",
  138. costPrice: "92,500",
  139. salesPrice: "89,000",
  140. peerPrice: "92,500",
  141. agentPrice: "89,000",
  142. stock: 1
  143. },
  144. {
  145. imgUrl: require("./imgs/1.jpg"),
  146. brand: "ROLEX",
  147. name: "Submariner Date 126610LN",
  148. costPrice: "92,500",
  149. salesPrice: "89,000",
  150. peerPrice: "92,500",
  151. agentPrice: "89,000",
  152. stock: 1
  153. },
  154. {
  155. imgUrl: require("./imgs/1.jpg"),
  156. brand: "ROLEX",
  157. name: "Submariner Date 126610LN",
  158. costPrice: "92,500",
  159. salesPrice: "89,000",
  160. peerPrice: "92,500",
  161. agentPrice: "89,000",
  162. stock: 1
  163. },
  164. {
  165. imgUrl: require("./imgs/1.jpg"),
  166. brand: "ROLEX",
  167. name: "Submariner Date 126610LN",
  168. costPrice: "92,500",
  169. salesPrice: "89,000",
  170. peerPrice: "92,500",
  171. agentPrice: "89,000",
  172. stock: 1
  173. }
  174. ]
  175. };
  176. },
  177. methods: {
  178. switchTab(index) {
  179. console.log("当前选中标签索引:", index);
  180. },
  181. handleToDetail() {
  182. uni.navigateTo({
  183. url: `/pages/wareHouse/detail`
  184. });
  185. },
  186. handleAdd() {
  187. console.log("点击添加按钮");
  188. uni.navigateTo({
  189. url: `/pages/wareHouse/add`
  190. });
  191. },
  192. // 获取仓库卡片数据
  193. getCard() {
  194. uni.$u.api.getWareHouseCard().then(res => {
  195. if (res.code === 200) {
  196. this.wareHouseCard = res.data;
  197. }
  198. });
  199. },
  200. },
  201. mounted() {
  202. this.getCard();
  203. }
  204. };
  205. </script>
  206. <style lang="scss" scoped>
  207. @import "./styles/index.scss";
  208. </style>