index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. totalCost: '-',
  113. uploadCostToday: '-',
  114. outStockToday: '-',
  115. totalNum: '-'
  116. },
  117. tabList: [
  118. { name: "全部" },
  119. { name: "腕表" },
  120. { name: "箱包" },
  121. { name: "珠宝" },
  122. { name: "鞋靴" },
  123. { name: "配饰" },
  124. { name: "服饰" },
  125. { name: "其它" }
  126. ],
  127. currentSortText: '按最近更新排序',
  128. goodsList: [
  129. {
  130. imgUrl: require("./imgs/1.jpg"),
  131. brand: "ROLEX",
  132. name: "Submariner Date 126610LN",
  133. costPrice: "92,500",
  134. salesPrice: "89,000",
  135. peerPrice: "92,500",
  136. agentPrice: "89,000",
  137. stock: 1
  138. },
  139. {
  140. imgUrl: require("./imgs/1.jpg"),
  141. brand: "ROLEX",
  142. name: "Submariner Date 126610LN",
  143. costPrice: "92,500",
  144. salesPrice: "89,000",
  145. peerPrice: "92,500",
  146. agentPrice: "89,000",
  147. stock: 1
  148. },
  149. {
  150. imgUrl: require("./imgs/1.jpg"),
  151. brand: "ROLEX",
  152. name: "Submariner Date 126610LN",
  153. costPrice: "92,500",
  154. salesPrice: "89,000",
  155. peerPrice: "92,500",
  156. agentPrice: "89,000",
  157. stock: 1
  158. },
  159. {
  160. imgUrl: require("./imgs/1.jpg"),
  161. brand: "ROLEX",
  162. name: "Submariner Date 126610LN",
  163. costPrice: "92,500",
  164. salesPrice: "89,000",
  165. peerPrice: "92,500",
  166. agentPrice: "89,000",
  167. stock: 1
  168. },
  169. {
  170. imgUrl: require("./imgs/1.jpg"),
  171. brand: "ROLEX",
  172. name: "Submariner Date 126610LN",
  173. costPrice: "92,500",
  174. salesPrice: "89,000",
  175. peerPrice: "92,500",
  176. agentPrice: "89,000",
  177. stock: 1
  178. }
  179. ]
  180. };
  181. },
  182. methods: {
  183. switchTab(index) {
  184. console.log("当前选中标签索引:", index);
  185. },
  186. handleToDetail() {
  187. uni.navigateTo({
  188. url: `/pages/wareHouse/detail`
  189. });
  190. },
  191. handleAdd() {
  192. console.log("点击添加按钮");
  193. uni.navigateTo({
  194. url: `/pages/wareHouse/add`
  195. });
  196. },
  197. // 获取仓库卡片数据
  198. getCard() {
  199. uni.$u.api.getWareHouseCard().then(res => {
  200. if (res.code === 200) {
  201. this.wareHouseCard = res.data;
  202. }
  203. });
  204. },
  205. },
  206. mounted() {
  207. // this.getCard();
  208. }
  209. };
  210. </script>
  211. <style lang="scss" scoped>
  212. @import "./styles/index.scss";
  213. </style>