index.uvue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <uni-navbar-lite :showLeft=false :show-right=false title="工作台"></uni-navbar-lite>
  3. <view class="page-container">
  4. <!-- view>
  5. <text class="page-header"> 工作台 </text>
  6. </view> -->
  7. <!-- 头部背景图 -->
  8. <!-- <image class="header-bg" src="/static/images/workbench/1.png" mode="widthFix"></image> -->
  9. <scroll-view class="page-content">
  10. <!-- 库区管理 -->
  11. <view class="section">
  12. <view class="section-header">
  13. <view class="section-indicator"></view>
  14. <text class="section-title">库区管理</text>
  15. </view>
  16. <view class="management-grid">
  17. <view v-for="(item, index) in managementList" :key="index" class="management-item" @click="handleManagementClick(item)" :style="{ backgroundColor: item.bgColor }">
  18. <view class="management-icon-box">
  19. <image class="management-icon" :src="item.icon" mode="aspectFit"></image>
  20. </view>
  21. <text class="management-title">{{ item.title }}</text>
  22. <view v-if="item.badge" class="management-badge">
  23. <text class="badge-text">{{ item.badge }}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 生产板块 -->
  29. <view class="section production-section" v-if="productionList.length > 0">
  30. <view class="section-header">
  31. <view class="section-indicator"></view>
  32. <text class="section-title">生产管理</text>
  33. </view>
  34. <view class="management-grid">
  35. <view v-for="(item, index) in productionList" :key="index" class="management-item" @click="handleManagementClick(item)" :style="{ backgroundColor: item.bgColor }">
  36. <view class="management-icon-box">
  37. <image class="management-icon" :src="item.icon" mode="aspectFit"></image>
  38. </view>
  39. <text class="management-title">{{ item.title }}</text>
  40. <view v-if="item.badge" class="management-badge">
  41. <text class="badge-text">{{ item.badge }}</text>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 基础资料板块 -->
  47. <view class="section data-section" v-if="dataList.length > 0">
  48. <view class="section-header">
  49. <view class="section-indicator"></view>
  50. <text class="section-title">基础资料</text>
  51. </view>
  52. <view class="management-grid">
  53. <view v-for="(item, index) in dataList" :key="index" class="management-item" @click="handleManagementClick(item)" :style="{ backgroundColor: item.bgColor }">
  54. <view class="management-icon-box">
  55. <image class="management-icon" :src="item.icon" mode="aspectFit"></image>
  56. </view>
  57. <text class="management-title">{{ item.title }}</text>
  58. <view v-if="item.badge" class="management-badge">
  59. <text class="badge-text">{{ item.badge }}</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </scroll-view>
  65. <!-- 底部 TabBar -->
  66. <custom-tabbar :current="1" />
  67. </view>
  68. </template>
  69. <script setup lang="uts">
  70. import { ref } from 'vue'
  71. // 库区管理功能类型
  72. type ManagementItem = {
  73. id: number
  74. title: string
  75. icon: string
  76. bgColor: string
  77. path: string
  78. badge: string
  79. }
  80. // 库区管理功能列表
  81. const managementList = ref<ManagementItem[]>([
  82. {
  83. id: 1,
  84. title: '物料申请',
  85. icon: '/static/images/workbench/8.png',
  86. bgColor: '#E3F2FD',
  87. path: '/pages/apply/index',
  88. badge: ''
  89. },
  90. {
  91. id: 2,
  92. title: '库存盘点',
  93. icon: '/static/images/workbench/9.png',
  94. bgColor: '#FFF3E0',
  95. path: '',
  96. badge: ''
  97. },
  98. {
  99. id: 3,
  100. title: '库存管理',
  101. icon: '/static/images/workbench/10.png',
  102. bgColor: '#FCE4EC',
  103. path: '',
  104. badge: ''
  105. },
  106. ])
  107. // 生产管理功能列表
  108. const productionList = ref<ManagementItem[]>([
  109. {
  110. id: 4,
  111. title: '生产汇报',
  112. icon: '/static/images/workbench/5.png',
  113. bgColor: '#E8F5E9',
  114. path: '/pages/pro/index',
  115. badge: ''
  116. },
  117. ])
  118. // 基础资料功能列表
  119. const dataList = ref<ManagementItem[]>([
  120. {
  121. id: 5,
  122. title: '系统物料',
  123. icon: '/static/images/workbench/4.png',
  124. bgColor: '#EDE7F6',
  125. path: '/pages/item/index',
  126. badge: ''
  127. },
  128. ])
  129. // 库区管理功能点击
  130. const handleManagementClick = (item: ManagementItem): void => {
  131. if (item.path.length > 0) {
  132. uni.navigateTo({
  133. url: item.path,
  134. fail: (err: any) => {
  135. console.log('导航失败', err)
  136. }
  137. })
  138. } else {
  139. uni.showToast({
  140. title: item.title,
  141. icon: 'none'
  142. })
  143. }
  144. }
  145. </script>
  146. <style lang="scss">
  147. .page-container {
  148. flex: 1;
  149. background-color: #f5f8fe;
  150. padding-top: env(safe-area-inset-top);
  151. background-color: #e8f0f9;
  152. padding: 20rpx;
  153. }
  154. .page-header{
  155. font-size: 32rpx;
  156. color: #333333;
  157. font-weight: bold;
  158. padding-top:20px;
  159. padding-bottom: 10px;
  160. }
  161. .page-content {
  162. flex: 1;
  163. padding: 10rpx;
  164. padding-bottom: 150rpx;
  165. box-sizing: border-box;
  166. // border-radius: 24rpx;
  167. // border: 1rpx solid rgba(255, 255, 255, 0.3);
  168. // background: #f5f8fe;
  169. // background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, #f5f8fe 100%);
  170. // backdrop-filter: blur(20rpx);
  171. }
  172. .header-bg {
  173. position: absolute;
  174. top: 0;
  175. left: 0;
  176. width: 100%;
  177. height: auto;
  178. z-index: 0;
  179. }
  180. .quick-cards {
  181. flex-direction: row;
  182. flex-wrap: wrap;
  183. justify-content: space-between;
  184. .quick-card {
  185. position: relative;
  186. width: 212rpx;
  187. height: 120rpx;
  188. margin-bottom: 20rpx;
  189. overflow: hidden;
  190. border-radius: 16rpx;
  191. &-bg {
  192. position: absolute;
  193. top: 0;
  194. left: 0;
  195. width: 226rpx;
  196. height: 140rpx;
  197. z-index: 0;
  198. }
  199. &-content {
  200. position: relative;
  201. z-index: 1;
  202. padding: 20rpx;
  203. height: 140rpx;
  204. justify-content: flex-start;
  205. }
  206. &-title {
  207. font-size: 28rpx;
  208. color: #333333;
  209. font-weight: bold;
  210. }
  211. .management-badge {
  212. position: absolute;
  213. top: 20rpx;
  214. right: 20rpx;
  215. width: 32rpx;
  216. height: 32rpx;
  217. background-color: #ff3b30;
  218. border-radius: 16rpx;
  219. justify-content: center;
  220. align-items: center;
  221. .badge-text {
  222. font-size: 20rpx;
  223. color: #ffffff;
  224. line-height: 20rpx;
  225. }
  226. }
  227. }
  228. }
  229. .section {
  230. padding: 0 20rpx 30rpx;
  231. background: #ffffff;
  232. border-radius: 16rpx;
  233. &-header {
  234. flex-direction: row;
  235. align-items: center;
  236. padding: 30rpx 10rpx 20rpx;
  237. }
  238. &-indicator {
  239. width: 6rpx;
  240. height: 32rpx;
  241. background-color: #007aff;
  242. border-radius: 3rpx;
  243. margin-right: 12rpx;
  244. }
  245. &-title {
  246. font-size: 36rpx;
  247. color: #333333;
  248. font-weight: bold;
  249. }
  250. }
  251. .production-section {
  252. margin-top: 30rpx;
  253. }
  254. .data-section {
  255. margin-top: 30rpx;
  256. }
  257. .management-grid {
  258. flex-direction: row;
  259. flex-wrap: wrap;
  260. justify-content: space-between;
  261. .management-item {
  262. position: relative;
  263. width: 192rpx;
  264. height: 156rpx;
  265. margin-bottom: 24rpx;
  266. background-color: #edf5ff;
  267. border-radius: 8rpx;
  268. align-items: flex-start;
  269. justify-content: center;
  270. padding: 24rpx;
  271. box-sizing: border-box;
  272. .management-icon-box {
  273. width: 64rpx;
  274. height: 64rpx;
  275. justify-content: center;
  276. align-items: center;
  277. margin-bottom: 16rpx;
  278. }
  279. .management-icon {
  280. width: 100%;
  281. height: 100%;
  282. }
  283. .management-title {
  284. font-weight: bold;
  285. font-size: 24rpx;
  286. color: #333333;
  287. text-align: center;
  288. }
  289. .management-badge {
  290. position: absolute;
  291. top: 20rpx;
  292. right: 20rpx;
  293. width: 32rpx;
  294. height: 32rpx;
  295. background-color: #ff3b30;
  296. border-radius: 16rpx;
  297. justify-content: center;
  298. align-items: center;
  299. .badge-text {
  300. font-size: 20rpx;
  301. color: #ffffff;
  302. line-height: 20rpx;
  303. }
  304. }
  305. }
  306. }
  307. </style>