商品管理.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>叁强鲜配 - 商品管理原型图</title>
  7. <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
  8. <link rel="stylesheet" href="https://unpkg.com/@element-plus/icons-vue/dist/index.css">
  9. <style>
  10. * { margin: 0; padding: 0; box-sizing: border-box; }
  11. body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #303133; }
  12. .topbar { height: 60px; background: linear-gradient(135deg, #1989fa 0%, #07c160 100%); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; color: white; }
  13. .topbar-logo h1 { font-size: 22px; font-weight: 600; }
  14. .topbar-logo span { font-size: 13px; opacity: 0.85; }
  15. .topbar-user { display: flex; align-items: center; gap: 16px; }
  16. .main-container { display: flex; min-height: calc(100vh - 60px); }
  17. .sidebar { width: 220px; background: #fff; border-right: 1px solid #e4e7ed; padding: 16px 0; }
  18. .menu-item { padding: 14px 24px; cursor: pointer; display: flex; align-items: center; gap: 12px; color: #606266; font-size: 14px; }
  19. .menu-item:hover { background: #f5f7fa; color: #1989fa; }
  20. .menu-item.active { background: #ecf5ff; color: #1989fa; border-right: 3px solid #1989fa; }
  21. .submenu { padding-left: 48px; }
  22. .content { flex: 1; padding: 24px; }
  23. .breadcrumb { font-size: 13px; color: #909399; margin-bottom: 8px; }
  24. .card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
  25. .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #ebeef5; }
  26. .card-title { font-size: 16px; font-weight: 600; }
  27. .status-tag { padding: 4px 12px; border-radius: 4px; font-size: 12px; }
  28. .status-tag.primary { background: #ecf5ff; color: #1989fa; }
  29. .status-tag.success { background: #f0f9eb; color: #07c160; }
  30. .status-tag.warning { background: #fdf6ec; color: #ff976a; }
  31. .status-tag.danger { background: #fef0f0; color: #ee0a24; }
  32. .status-tag.info { background: #f4f4f5; color: #909399; }
  33. .form-section-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; padding-left: 12px; border-left: 4px solid #1989fa; }
  34. .form-row { display: flex; gap: 12px; flex-wrap: wrap; }
  35. .page-nav { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
  36. .nav-tabs { display: flex; gap: 4px; background: #f5f7fa; padding: 4px; border-radius: 8px; margin-bottom: 20px; }
  37. .nav-tab { padding: 10px 20px; cursor: pointer; border-radius: 6px; font-size: 14px; color: #606266; }
  38. .nav-tab.active { background: #fff; color: #1989fa; font-weight: 500; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
  39. .product-img { width: 60px; height: 60px; background: #f5f7fa; border-radius: 8px; }
  40. </style>
  41. </head>
  42. <body>
  43. <!-- 顶部导航 -->
  44. <div class="topbar">
  45. <div class="topbar-logo">
  46. <h1>叁强鲜配</h1>
  47. <span>运营管理后台</span>
  48. </div>
  49. <div class="topbar-user">
  50. <el-avatar :size="32" style="background:#fff;color:#1989fa;">管</el-avatar>
  51. <span>管理员</span>
  52. </div>
  53. </div>
  54. <div class="main-container">
  55. <!-- 左侧菜单 -->
  56. <div class="sidebar">
  57. <div class="menu-item"><el-icon><DataAnalysis /></el-icon><span>首页</span></div>
  58. <div class="menu-item"><el-icon><User /></el-icon><span>用户管理</span></div>
  59. <div class="menu-item"><el-icon><Location /></el-icon><span>区域管理</span></div>
  60. <div class="menu-item active"><el-icon><Goods /></el-icon><span>商品管理</span></div>
  61. <div class="submenu">
  62. <div class="menu-item active">商品分类</div>
  63. <div class="menu-item">商品单位</div>
  64. <div class="menu-item">商品列表</div>
  65. </div>
  66. <div class="menu-item"><el-icon><Search /></el-icon><span>询价管理</span></div>
  67. <div class="menu-item"><el-icon><Ticket /></el-icon><span>报价管理</span></div>
  68. <div class="menu-item"><el-icon><PriceTag /></el-icon><span>价格管理</span></div>
  69. <div class="menu-item"><el-icon><ShoppingCart /></el-icon><span>订单管理</span></div>
  70. <div class="menu-item"><el-icon><Van /></el-icon><span>配送管理</span></div>
  71. <div class="menu-item"><el-icon><Wallet /></el-icon><span>结算管理</span></div>
  72. </div>
  73. <!-- 内容区 -->
  74. <div class="content">
  75. <div class="breadcrumb">商品管理 / 商品分类</div>
  76. <!-- Tab切换 -->
  77. <div class="nav-tabs">
  78. <div class="nav-tab active">商品分类</div>
  79. <div class="nav-tab">商品单位</div>
  80. <div class="nav-tab">商品列表</div>
  81. </div>
  82. <!-- 商品分类管理 -->
  83. <div class="card">
  84. <div class="card-header">
  85. <span class="card-title">商品分类列表</span>
  86. <el-button type="success" size="small">+ 新增分类</el-button>
  87. </div>
  88. <el-table :data="categoryList" style="width:100%" row-key="id" default-expand-all>
  89. <el-table-column prop="name" label="分类名称" width="200" />
  90. <el-table-column prop="sortOrder" label="排序" width="100" align="center" />
  91. <el-table-column prop="productCount" label="商品数量" width="120" align="center" />
  92. <el-table-column prop="isActive" label="状态" width="100">
  93. <template #default="{row}">
  94. <span :class="'status-tag '+(row.isActive?'success':'info')">{{row.isActive?'启用':'禁用'}}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column prop="createTime" label="创建时间" width="180" />
  98. <el-table-column label="操作" width="180">
  99. <template #default>
  100. <el-button type="primary" link>编辑</el-button>
  101. <el-button type="warning" link>停用</el-button>
  102. <el-button type="danger" link>删除</el-button>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. </div>
  107. <!-- 商品单位管理 -->
  108. <div class="card">
  109. <div class="card-header">
  110. <span class="card-title">商品单位列表</span>
  111. <el-button type="success" size="small">+ 新增单位</el-button>
  112. </div>
  113. <el-table :data="unitList" style="width:100%">
  114. <el-table-column prop="name" label="单位名称" width="150" />
  115. <el-table-column prop="code" label="单位编码" width="150" />
  116. <el-table-column prop="isActive" label="状态" width="100">
  117. <template #default="{row}">
  118. <span :class="'status-tag '+(row.isActive?'success':'info')">{{row.isActive?'启用':'禁用'}}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column prop="createTime" label="创建时间" width="180" />
  122. <el-table-column label="操作" width="150">
  123. <template #default>
  124. <el-button type="primary" link>编辑</el-button>
  125. <el-button type="warning" link>停用</el-button>
  126. <el-button type="danger" link>删除</el-button>
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. </div>
  131. <!-- 商品列表 -->
  132. <div class="card">
  133. <div class="form-section-title">筛选条件</div>
  134. <div class="form-row">
  135. <el-input placeholder="商品名称搜索" style="width:200px;" />
  136. <el-select placeholder="商品分类" style="width:150px;">
  137. <el-option label="全部分类" value="" />
  138. <el-option label="蔬菜" value="CAT_001" />
  139. <el-option label="水果" value="CAT_002" />
  140. <el-option label="肉类" value="CAT_003" />
  141. <el-option label="生活用品" value="CAT_004" />
  142. <el-option label="厨房用品" value="CAT_005" />
  143. </el-select>
  144. <el-select placeholder="状态" style="width:120px;">
  145. <el-option label="全部" value="" />
  146. <el-option label="启用" value="1" />
  147. <el-option label="禁用" value="0" />
  148. </el-select>
  149. <el-button type="primary">搜索</el-button>
  150. <el-button>重置</el-button>
  151. </div>
  152. </div>
  153. <div class="card">
  154. <div class="card-header">
  155. <span class="card-title">商品列表</span>
  156. <el-button type="success" size="small">+ 新增商品</el-button>
  157. </div>
  158. <el-table :data="productList" style="width:100%">
  159. <el-table-column label="商品图片" width="90">
  160. <template #default>
  161. <div class="product-img"></div>
  162. </template>
  163. </el-table-column>
  164. <el-table-column prop="name" label="商品名称" width="200" />
  165. <el-table-column prop="categoryName" label="分类" width="120" />
  166. <el-table-column prop="unitName" label="单位" width="100" />
  167. <el-table-column prop="description" label="描述" />
  168. <el-table-column prop="isActive" label="状态" width="80">
  169. <template #default="{row}">
  170. <span :class="'status-tag '+(row.isActive?'success':'info')">{{row.isActive?'启用':'禁用'}}</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column label="操作" width="150">
  174. <template #default>
  175. <el-button type="primary" link>编辑</el-button>
  176. <el-button type="danger" link>删除</el-button>
  177. </template>
  178. </el-table-column>
  179. </el-table>
  180. <div class="page-nav">
  181. <el-pagination background layout="prev, pager, next" :total="100" />
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  187. <script src="https://unpkg.com/element-plus"></script>
  188. <script src="https://unpkg.com/@element-plus/icons-vue"></script>
  189. <script>
  190. const { createApp, ref } = Vue;
  191. const app = createApp({
  192. setup() {
  193. const categoryList = ref([
  194. { id: 1, name: '蔬菜', sortOrder: 1, productCount: 25, isActive: true, createTime: '2026-01-01 10:00:00' },
  195. { id: 2, name: '水果', sortOrder: 2, productCount: 18, isActive: true, createTime: '2026-01-01 10:00:00' },
  196. { id: 3, name: '肉类', sortOrder: 3, productCount: 12, isActive: true, createTime: '2026-01-01 10:00:00' },
  197. { id: 4, name: '生活用品', sortOrder: 4, productCount: 30, isActive: true, createTime: '2026-01-01 10:00:00' },
  198. { id: 5, name: '厨房用品', sortOrder: 5, productCount: 15, isActive: true, createTime: '2026-01-01 10:00:00' },
  199. ]);
  200. const unitList = ref([
  201. { name: '斤', code: 'jin', isActive: true, createTime: '2026-01-01 10:00:00' },
  202. { name: '公斤', code: 'kg', isActive: true, createTime: '2026-01-01 10:00:00' },
  203. { name: '个', code: 'ge', isActive: true, createTime: '2026-01-01 10:00:00' },
  204. { name: '箱', code: 'xiang', isActive: true, createTime: '2026-01-01 10:00:00' },
  205. { name: '盒', code: 'he', isActive: true, createTime: '2026-01-01 10:00:00' },
  206. { name: '袋', code: 'dai', isActive: true, createTime: '2026-01-01 10:00:00' },
  207. ]);
  208. const productList = ref([
  209. { name: '新鲜猪肉', categoryName: '肉类', unitName: '斤', description: '优质新鲜猪肉', isActive: true },
  210. { name: '新鲜蔬菜', categoryName: '蔬菜', unitName: '斤', description: '新鲜时令蔬菜', isActive: true },
  211. { name: '新鲜水果', categoryName: '水果', unitName: '斤', description: '新鲜水果拼盘', isActive: true },
  212. { name: '鸡蛋', categoryName: '禽蛋', unitName: '个', description: '农家鸡蛋', isActive: true },
  213. { name: '大米', categoryName: '粮食', unitName: '斤', description: '东北大米', isActive: true },
  214. ]);
  215. return { categoryList, unitList, productList };
  216. }
  217. });
  218. app.use(ElementPlus);
  219. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  220. app.component(key, component);
  221. }
  222. app.mount('#app');
  223. </script>
  224. </body>
  225. </html>