修复生产统计与维修记录用户数据

This commit is contained in:
2026-09-06 21:06:36 +08:00
parent 02c8fb7021
commit 5ca6ef2d5a
41 changed files with 1838 additions and 205 deletions
+12
View File
@@ -62,6 +62,18 @@ export function getProductStatistics(params = {}) {
return request.get('/produce/product-record/statistics', params)
}
export function getExceptionStatistics(params = {}) {
return request.get('/produce/exception/statistics', params)
}
export function getRepairStatistics(params = {}) {
return request.get('/produce/repair-record/statistics', params)
}
export function getTodayDashboard() {
return request.get('/produce/dashboard/today')
}
export function submitProductRecord(data) {
return request.post('/produce/product-record/record', data)
}
+13
View File
@@ -0,0 +1,13 @@
import request from '@/utils/request.js'
export function getMemberNotifications(params = {}) {
return request.get('/produce/member-notification', params)
}
export function getUnreadNotificationCount() {
return request.get('/produce/member-notification/unread-count')
}
export function markNotificationRead(id) {
return request.put('/produce/member-notification/read', { id })
}
+8 -4
View File
@@ -2,8 +2,8 @@
"name" : "scanapp",
"appid" : "__UNI__04C6DBA",
"description" : "",
"versionName" : "1.1.0",
"versionCode" : 110,
"versionName" : "1.3.0",
"versionCode" : 130,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
@@ -46,10 +46,14 @@
},
/* ios打包配置 */
"ios" : {
"dSYMs" : false
"dSYMs" : false,
"idfa" : false
},
/* SDK配置 */
"sdkConfigs" : {}
"sdkConfigs" : {},
"splashscreen" : {
"androidStyle" : "common"
}
}
},
/* 快应用特有相关 */
+6
View File
@@ -78,6 +78,12 @@
"navigationBarTitleText": "待维修订单"
}
},
{
"path": "pages/notification/index",
"style": {
"navigationBarTitleText": "生产通知"
}
},
{
"path": "pages/settings/index",
"style": {
+41 -6
View File
@@ -183,7 +183,7 @@ export default {
methods: {
getCurrentUserCode() {
const user = uni.getStorageSync('scanapp_user') || {}
return user.username || user.nickname || 'U001'
return String(user.username || user.user_code || '').trim()
},
loadPdaMode() {
const userCode = this.getCurrentUserCode()
@@ -307,6 +307,31 @@ export default {
return false
}
},
hasExistingRecordForRule(rule) {
const matchField = rule.match_field || 'process_order_no'
const valueMap = {
process_order_no: this.form.processOrderNo,
order_no: this.form.processOrderNo,
product_code: this.form.productCode,
user_code: this.currentUser.userCode
}
const currentValue = String(valueMap[matchField] || '').trim()
if (!currentValue) return false
return this.recentRecords.some((record) => {
const recordValue = String(record[matchField] || (matchField === 'order_no' ? record.process_order_no : '')).trim()
return recordValue === currentValue
})
},
getDuplicateRuleMessage(rule) {
const fieldLabels = {
order_no: '加工单号',
process_order_no: '加工单号',
product_code: '商品编码',
user_code: '用户编码'
}
const field = rule.match_field || 'process_order_no'
return `${fieldLabels[field] || '当前数据'}已录入,当前规则不允许重复扫码`
},
validateSpecificRules() {
const context = {
order_no: this.form.processOrderNo.trim(),
@@ -316,10 +341,10 @@ export default {
}
const blockedRule = this.specificRules.find((rule) => {
if (rule.apply_mode && rule.apply_mode !== 'machine' && rule.apply_mode !== 'both') return false
return Number(rule.rule_type) === 2 && this.matchSpecificRule(rule, context)
return Number(rule.rule_type) === 2 && this.matchSpecificRule(rule, context) && this.hasExistingRecordForRule(rule)
})
if (blockedRule) {
uni.showToast({ title: blockedRule.rule_name || '当前整机数据命中特定规则,禁止提交', icon: 'none' })
uni.showToast({ title: this.getDuplicateRuleMessage(blockedRule), icon: 'none' })
return false
}
return true
@@ -394,6 +419,10 @@ export default {
this.form.quantity = Math.max(1, Number(this.form.quantity || 1) - 1)
},
validateForm() {
if (!this.currentUser.userCode) {
uni.showToast({ title: '登录信息已失效,请重新登录', icon: 'none' })
return false
}
if (!this.form.processOrderNo.trim()) {
uni.showToast({ title: '请输入加工单号', icon: 'none' })
return false
@@ -430,26 +459,32 @@ export default {
return true
},
async submitEntry() {
if (this.submitting) return
await this.loadDataEntryConfig()
if (!this.validateForm()) return
this.submitting = true
try {
const processItem = this.processOptions[this.selectedProcessIndex]
const stepItem = this.stepOptions[this.selectedStepIndex]
await submitProductRecord({
const payload = {
process_order_no: this.form.processOrderNo.trim(),
product_code: this.form.productCode.trim(),
quantity: Number(this.form.quantity) || 1,
user_code: this.currentUser.userCode,
user_code: this.currentUser.userCode.trim(),
process_id: processItem?.value,
step_id: stepItem?.value,
scan_result: 1
})
}
await submitProductRecord(payload)
uni.showToast({ title: '整机录入成功', icon: 'success' })
this.resetForm()
await this.loadPageData()
} catch (error) {
console.error('[scanapp] 整机录入失败', error)
uni.showToast({
title: error?.message || '整机录入失败',
icon: 'none'
})
} finally {
this.submitting = false
}
+438 -40
View File
@@ -5,8 +5,9 @@
<text class="hero-title">扫码工作台</text>
<text class="hero-subtitle">高效完成生产扫码与库存管理</text>
</view>
<view class="hero-action">
<view class="hero-action" @tap="openNotifications">
<u-icon name="bell-fill" color="#1677ff" size="38" />
<text v-if="unreadNotificationCount > 0" class="notification-badge">{{ unreadNotificationText }}</text>
</view>
</view>
@@ -42,23 +43,32 @@
<view class="chart-header">
<view>
<text class="chart-title">今日数据</text>
<text class="chart-subtitle">扫码与异常概览</text>
<text class="chart-subtitle">扫码、异常与维修实时概览</text>
</view>
<view class="chart-badge">实时</view>
<view class="chart-badge">{{ dashboardUpdatedAt }}</view>
</view>
<view class="summary-grid">
<view v-for="item in summaries" :key="item.label" class="summary-card">
<text class="summary-value">{{ item.value }}</text>
<text class="summary-label">{{ item.label }}</text>
<view v-for="item in summaries" :key="item.label" class="summary-card" :class="[item.type, { 'has-details': item.details && item.details.length }]">
<view class="summary-main">
<text class="summary-value" :class="item.type">{{ item.value }}</text>
<text class="summary-label">{{ item.label }}</text>
</view>
<view v-if="item.details && item.details.length" class="summary-detail-list">
<view v-for="detail in item.details" :key="detail.key" class="summary-detail-row">
<text class="summary-detail-name">{{ detail.name }}</text>
<text class="summary-detail-value">{{ detail.quantity }}</text>
</view>
</view>
</view>
</view>
<view class="trend-card">
<view class="chart-section-title">扫码趋势</view>
<view class="bar-chart">
<view v-for="item in trendData" :key="item.label" class="bar-item">
<view class="bar-track">
<view v-for="item in trendData" :key="item.label" class="bar-item">
<text class="bar-value">{{ item.value }}</text>
<view class="bar-track">
<view class="bar-fill" :style="{ height: item.percent + '%', backgroundColor: item.color }"></view>
</view>
<text class="bar-label">{{ item.label }}</text>
@@ -67,16 +77,22 @@
</view>
<view class="progress-card">
<view class="chart-section-title">异常处理</view>
<view v-for="item in exceptionData" :key="item.label" class="progress-row">
<view class="progress-info">
<text class="progress-label">{{ item.label }}</text>
<text class="progress-value">{{ item.value }}%</text>
</view>
<view class="progress-track">
<view class="progress-fill" :style="{ width: item.value + '%', backgroundColor: item.color }"></view>
<view class="responsibility-header">
<view>
<text class="chart-section-title responsibility-title">不良责任订单</text>
<text class="responsibility-subtitle">本月总计 {{ responsibilityOrderTotal }} 次 · 最近 5 条</text>
</view>
</view>
<view v-if="responsibilityOrders.length" class="reporter-list">
<view v-for="item in responsibilityOrders" :key="item.key" class="reporter-row">
<view>
<text class="reporter-name">订单:{{ item.order_no }}</text>
<text class="reporter-code">不良原因:{{ item.exception_reason || '未记录不良原因' }}</text>
</view>
<text class="reporter-count">{{ item.quantity }} 次</text>
</view>
</view>
<text v-else class="breakdown-empty">本月暂无不良责任订单</text>
</view>
</view>
</view>
@@ -84,6 +100,8 @@
<script>
import { getUserInfo } from '@/api/member.js'
import { getUnreadNotificationCount } from '@/api/produce/notification.js'
import { getTodayDashboard } from '@/api/produce/data-entry.js'
export default {
data() {
@@ -94,24 +112,19 @@
levelName: '请先登录',
enabled: true
},
unreadNotificationCount: 0,
responsibilityOrders: [],
responsibilityOrderTotal: 0,
summaries: [
{ label: '订单扫码', value: '128' },
{ label: '整机扫码', value: '86' },
{ label: '异常待处理', value: '12' }
{ label: '订单扫码', value: '0', type: 'primary' },
{ label: '整机记录', value: '0', type: 'success' },
{ label: '异常提报', value: '0', type: 'warning' },
{ label: '维修完成', value: '0', type: 'danger' }
],
trendData: [
{ label: '09', percent: 42, color: '#1677ff' },
{ label: '10', percent: 68, color: '#35bfa3' },
{ label: '11', percent: 52, color: '#1677ff' },
{ label: '12', percent: 76, color: '#35bfa3' },
{ label: '13', percent: 45, color: '#1677ff' },
{ label: '14', percent: 88, color: '#35bfa3' }
],
exceptionData: [
{ label: '已处理', value: 72, color: '#19be6b' },
{ label: '待复核', value: 46, color: '#f7b733' },
{ label: '待处理', value: 28, color: '#e91f3f' }
{ label: '--:--', value: 0, percent: 0, color: '#1677ff' }
],
dashboardUpdatedAt: '等待更新',
sections: [
{
title: '扫码',
@@ -119,7 +132,6 @@
{ title: '订单模式', icon: 'order', bgColor: '#e91f3f', url: '/pages/entry/order' },
{ title: '一单多机', icon: 'grid-fill', bgColor: '#6b70e8', url: '/pages/entry/multi-machine' },
{ title: '整机模式', icon: 'scan', bgColor: '#1e9df2', url: '/pages/entry/machine' },
{ title: 'UTS 扫码原型', icon: 'scan', bgColor: '#1677ff', url: '/pages/scan/prototype' },
{ title: '异常处理', icon: 'warning-fill', bgColor: '#f7b733', url: '/pages/exception/index' },
{ title: '维修处理', icon: 'setting-fill', bgColor: '#35bfa3', url: '/pages/repair/index' }
]
@@ -135,8 +147,15 @@
]
}
},
onShow() {
this.loadMemberInfo()
computed: {
unreadNotificationText() {
return this.unreadNotificationCount > 99 ? '99+' : String(this.unreadNotificationCount)
}
},
onShow() {
this.loadMemberInfo()
this.loadNotificationCount()
this.loadTodayDashboard()
},
methods: {
async loadMemberInfo() {
@@ -163,6 +182,78 @@
console.error('[scanapp] 获取首页会员信息失败', error)
}
},
async loadNotificationCount() {
if (!this.isLoggedIn()) {
this.unreadNotificationCount = 0
return
}
try {
const data = await getUnreadNotificationCount()
this.unreadNotificationCount = Number(data?.unread_count || 0)
} catch (error) {
this.unreadNotificationCount = 0
console.error('[app] 获取未读通知数量失败', error)
}
},
async loadTodayDashboard() {
if (!this.isLoggedIn()) {
this.summaries = [
{ label: '订单扫码', value: '0', type: 'primary' },
{ label: '整机记录', value: '0', type: 'success' },
{ label: '异常提报', value: '0', type: 'warning' },
{ label: '维修完成', value: '0', type: 'danger' }
]
this.responsibilityOrders = []
this.responsibilityOrderTotal = 0
this.trendData = [{ label: '--:--', value: 0, percent: 0, color: '#1677ff' }]
this.dashboardUpdatedAt = '登录后查看'
return
}
try {
const data = await getTodayDashboard()
const summary = data?.summary || {}
this.summaries = [
{ label: '订单扫码', value: String(summary.order_scan || 0), type: 'primary', details: this.createBreakdownDetails([...(data?.order_breakdown || []), ...(data?.repair_breakdown || [])]) },
{ label: '整机记录', value: String(summary.product_scan || 0), type: 'success', details: this.createBreakdownDetails(data?.product_breakdown) },
{ label: '异常提报', value: String(summary.exception || 0), type: 'warning' },
{ label: '维修完成', value: String(summary.repair || 0), type: 'danger' }
]
this.responsibilityOrders = (Array.isArray(data?.responsibility_orders) ? data.responsibility_orders : []).map((item, index) => ({
...item,
key: `${item.order_no || 'unknown'}-${index}`,
quantity: Number(item.quantity || 0)
}))
this.responsibilityOrderTotal = Number(data?.responsibility_order_total || 0)
const trend = Array.isArray(data?.trend) ? data.trend : []
const maxTrend = Math.max(1, ...trend.map((item) => Number(item.value || 0)))
this.trendData = trend.map((item, index) => ({
label: item.label || `时段${index + 1}`,
value: Number(item.value || 0),
percent: Math.round((Number(item.value || 0) / maxTrend) * 100),
color: index % 2 === 0 ? '#1677ff' : '#35bfa3'
}))
this.dashboardUpdatedAt = data?.updated_at ? `更新于 ${this.formatDashboardTime(data.updated_at)}` : '刚刚更新'
} catch (error) {
this.dashboardUpdatedAt = '暂时无法更新'
console.error('[app] 获取首页今日数据失败', error)
}
},
formatDashboardTime(timestamp) {
const date = new Date(Number(timestamp) * 1000)
return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
},
createBreakdownDetails(items) {
const list = Array.isArray(items) ? items : []
const grouped = {}
list.forEach((item) => {
const key = `${item.process_id || 'none'}-${item.step_id || 'none'}`
if (!grouped[key]) grouped[key] = { key, name: `${item.process_name || '未记录工序'} / ${item.step_name || '未记录步骤'}`, quantity: 0 }
grouped[key].quantity += Number(item.quantity || 0)
})
return Object.values(grouped)
},
isLoggedIn() {
return Boolean(uni.getStorageSync('scanapp_token'))
},
@@ -175,7 +266,7 @@
}
uni.showModal({
title: '需要登录',
content: '登录后可访问个人资料',
content: '登录后可使用此功能',
confirmText: '去登录',
success: (res) => {
if (res.confirm) {
@@ -189,6 +280,9 @@
openProfile() {
this.requireLogin('/pages/profile/index')
},
openNotifications() {
this.requireLogin('/pages/notification/index')
},
handleMenuTap(item) {
if (item.url) {
uni.navigateTo({
@@ -240,6 +334,7 @@
}
.hero-action {
position: relative;
display: flex;
align-items: center;
justify-content: center;
@@ -250,6 +345,24 @@
box-shadow: 0 12rpx 32rpx rgba(23, 35, 61, 0.08);
}
.notification-badge {
position: absolute;
top: -10rpx;
right: -12rpx;
min-width: 30rpx;
height: 30rpx;
padding: 0 6rpx;
border: 3rpx solid #ffffff;
border-radius: 999rpx;
box-sizing: border-box;
background: #e91f3f;
color: #ffffff;
font-size: 18rpx;
font-weight: 700;
line-height: 24rpx;
text-align: center;
}
.user-card {
position: relative;
overflow: hidden;
@@ -462,19 +575,52 @@
.summary-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(2, 1fr);
gap: 16rpx;
margin-bottom: 22rpx;
}
.summary-card {
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 112rpx;
min-height: 136rpx;
padding: 18rpx 20rpx;
box-sizing: border-box;
border-radius: 22rpx;
background: #f8fbff;
background: linear-gradient(145deg, #f8fbff 0%, #f3f7fd 100%);
}
.summary-card.has-details {
align-items: stretch;
justify-content: flex-start;
min-height: 188rpx;
}
.summary-card::before {
position: absolute;
top: 20rpx;
bottom: 20rpx;
left: 0;
width: 6rpx;
border-radius: 0 6rpx 6rpx 0;
background: #1677ff;
content: '';
}
.summary-card.success::before {
background: #19be6b;
}
.summary-card.warning::before {
background: #f7a928;
}
.summary-card.danger::before {
background: #e91f3f;
}
.summary-value {
@@ -484,6 +630,30 @@
line-height: 1.3;
}
.summary-main {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.summary-card.has-details .summary-main {
flex-direction: row;
justify-content: space-between;
}
.summary-value.success {
color: #19be6b;
}
.summary-value.warning {
color: #f7a928;
}
.summary-value.danger {
color: #e91f3f;
}
.summary-label {
margin-top: 8rpx;
color: #8a94a6;
@@ -491,6 +661,138 @@
line-height: 1.3;
}
.summary-card.has-details .summary-label {
margin-top: 0;
margin-left: 12rpx;
text-align: right;
}
.summary-detail-list {
width: 100%;
margin-top: 14rpx;
padding-top: 10rpx;
border-top: 1rpx solid #eaf0f8;
}
.summary-detail-row {
display: flex;
align-items: center;
justify-content: space-between;
min-width: 0;
padding: 7rpx 10rpx;
border-radius: 10rpx;
background: rgba(255, 255, 255, 0.72);
}
.summary-detail-row + .summary-detail-row {
margin-top: 6rpx;
}
.summary-detail-name {
min-width: 0;
overflow: hidden;
color: #5f6b7a;
font-size: 18rpx;
line-height: 1.3;
text-overflow: ellipsis;
white-space: nowrap;
}
.summary-detail-value {
margin-left: 8rpx;
color: #17233d;
font-size: 20rpx;
font-weight: 700;
line-height: 1.3;
flex-shrink: 0;
}
.breakdown-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16rpx;
margin-bottom: 22rpx;
}
.breakdown-card {
min-width: 0;
padding: 20rpx;
border-radius: 22rpx;
background: #f8fbff;
}
.breakdown-header,
.breakdown-row,
.reporter-row,
.responsibility-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.breakdown-title,
.breakdown-name,
.breakdown-value,
.breakdown-total,
.breakdown-empty,
.reporter-name,
.reporter-code,
.reporter-count,
.exception-status-title {
display: block;
}
.breakdown-title {
color: #17233d;
font-size: 22rpx;
font-weight: 700;
line-height: 1.4;
}
.breakdown-total {
margin-left: 8rpx;
color: #1677ff;
font-size: 18rpx;
flex-shrink: 0;
}
.breakdown-list {
margin-top: 12rpx;
}
.breakdown-row {
padding: 10rpx 0;
border-bottom: 1rpx solid #eaf0f8;
}
.breakdown-row:last-child {
border-bottom: 0;
}
.breakdown-name {
overflow: hidden;
color: #5f6b7a;
font-size: 20rpx;
line-height: 1.35;
text-overflow: ellipsis;
white-space: nowrap;
}
.breakdown-value {
margin-left: 10rpx;
color: #17233d;
font-size: 22rpx;
font-weight: 700;
flex-shrink: 0;
}
.breakdown-empty {
margin-top: 16rpx;
color: #9aa4b4;
font-size: 20rpx;
text-align: center;
}
.trend-card,
.progress-card {
padding: 24rpx;
@@ -502,6 +804,45 @@
margin-top: 20rpx;
}
.reporter-list {
margin-bottom: 22rpx;
}
.reporter-row {
padding: 12rpx 0;
border-bottom: 1rpx solid #eaf0f8;
}
.reporter-row:last-child {
border-bottom: 0;
}
.reporter-name {
color: #5f6b7a;
font-size: 22rpx;
line-height: 1.35;
}
.reporter-code {
margin-top: 4rpx;
color: #9aa4b4;
font-size: 18rpx;
line-height: 1.3;
}
.reporter-count {
color: #f7a928;
font-size: 22rpx;
font-weight: 700;
}
.exception-status-title {
margin-bottom: 12rpx;
color: #17233d;
font-size: 22rpx;
font-weight: 700;
}
.chart-section-title {
margin-bottom: 22rpx;
color: #17233d;
@@ -509,6 +850,19 @@
font-weight: 700;
}
.responsibility-title {
margin-bottom: 0;
}
.responsibility-subtitle {
display: block;
margin-top: 6rpx;
margin-bottom: 22rpx;
color: #8a94a6;
font-size: 20rpx;
line-height: 1.4;
}
.bar-chart {
display: flex;
align-items: flex-end;
@@ -523,6 +877,13 @@
flex-direction: column;
}
.bar-value {
margin-bottom: 8rpx;
color: #5f6b7a;
font-size: 18rpx;
line-height: 1.2;
}
.bar-track {
display: flex;
align-items: flex-end;
@@ -609,11 +970,20 @@
.theme-dark .menu-item--active,
.theme-dark .summary-card,
.theme-dark .breakdown-card,
.theme-dark .trend-card,
.theme-dark .progress-card {
background: #1c2431;
}
.theme-dark .summary-detail-list {
border-color: #364152;
}
.theme-dark .summary-detail-row {
background: #222936;
}
.theme-dark .user-account,
.theme-dark .menu-title,
.theme-dark .workspace-title,
@@ -624,15 +994,43 @@
color: #f2f5fa;
}
.theme-dark .hero-subtitle,
.theme-dark .hero-subtitle,
.theme-dark .user-name,
.theme-dark .menu-desc,
.theme-dark .chart-subtitle,
.theme-dark .responsibility-subtitle,
.theme-dark .summary-label,
.theme-dark .bar-label,
.theme-dark .progress-label {
color: #aeb9ca;
}
color: #aeb9ca;
}
.theme-dark .breakdown-title,
.theme-dark .exception-status-title {
color: #f2f5fa;
}
.theme-dark .breakdown-name,
.theme-dark .reporter-name {
color: #aeb9ca;
}
.theme-dark .breakdown-value {
color: #f2f5fa;
}
.theme-dark .summary-detail-name {
color: #aeb9ca;
}
.theme-dark .summary-detail-value {
color: #f2f5fa;
}
.theme-dark .breakdown-row,
.theme-dark .reporter-row {
border-color: #364152;
}
.theme-dark .bar-track,
.theme-dark .progress-track {
+178
View File
@@ -0,0 +1,178 @@
<template>
<view class="notification-page" :class="`theme-${themeMode}`">
<view v-if="loading" class="loading-state">
<u-loading mode="circle" color="#1677ff" size="32" />
<text>正在加载通知</text>
</view>
<view v-else-if="notifications.length === 0" class="empty-state">
<u-empty mode="message" text="暂无生产通知" />
</view>
<view v-else class="notification-list">
<view
v-for="item in notifications"
:key="item.id"
class="notification-card"
:class="{ read: Number(item.status) === 1 }"
@tap="readNotification(item)"
>
<view class="notification-heading">
<view class="notification-title-wrap">
<text v-if="Number(item.status) === 0" class="unread-dot"></text>
<text class="notification-title">{{ item.title }}</text>
</view>
<text class="notification-status">{{ Number(item.status) === 0 ? '未读' : '已读' }}</text>
</view>
<text class="notification-content">{{ item.content }}</text>
<text class="notification-time">{{ item.created_date || '-' }}</text>
</view>
</view>
</view>
</template>
<script>
import { getMemberNotifications, markNotificationRead } from '@/api/produce/notification.js'
export default {
data() {
return {
loading: false,
notifications: []
}
},
onShow() {
this.loadNotifications()
},
methods: {
async loadNotifications() {
this.loading = true
try {
const data = await getMemberNotifications({ page: 1, limit: 50 })
this.notifications = Array.isArray(data?.items) ? data.items : []
} catch (error) {
this.notifications = []
console.error('[app] 获取生产通知失败', error)
} finally {
this.loading = false
}
},
async readNotification(item) {
if (Number(item.status) === 1) {
return
}
try {
await markNotificationRead(item.id)
item.status = 1
item.read_at = Math.floor(Date.now() / 1000)
} catch (error) {
console.error('[app] 标记生产通知已读失败', error)
}
}
}
}
</script>
<style lang="scss" scoped>
.notification-page {
min-height: 100vh;
padding: 24rpx;
box-sizing: border-box;
background: #f4f6fb;
}
.loading-state,
.empty-state {
display: flex;
align-items: center;
justify-content: center;
min-height: 360rpx;
flex-direction: column;
color: #7d8798;
font-size: 22rpx;
}
.loading-state text {
margin-top: 18rpx;
}
.notification-card {
margin-bottom: 18rpx;
padding: 26rpx 24rpx;
border: 1rpx solid rgba(255, 255, 255, 0.72);
border-radius: 24rpx;
background: #ffffff;
box-shadow: 0 12rpx 30rpx rgba(23, 35, 61, 0.06);
}
.notification-card.read {
background: #fafbfc;
opacity: 0.78;
}
.notification-heading,
.notification-title-wrap {
display: flex;
align-items: center;
}
.notification-heading {
justify-content: space-between;
}
.notification-title-wrap {
min-width: 0;
}
.unread-dot {
width: 14rpx;
height: 14rpx;
margin-right: 12rpx;
border-radius: 50%;
background: #e91f3f;
flex-shrink: 0;
}
.notification-title {
overflow: hidden;
color: #17233d;
font-size: 28rpx;
font-weight: 700;
line-height: 1.4;
text-overflow: ellipsis;
white-space: nowrap;
}
.notification-status {
margin-left: 16rpx;
color: #1677ff;
font-size: 20rpx;
line-height: 1.4;
flex-shrink: 0;
}
.notification-card.read .notification-status {
color: #8b8f98;
}
.notification-content,
.notification-time {
display: block;
}
.notification-content {
margin-top: 18rpx;
color: #4d5870;
font-size: 22rpx;
line-height: 1.7;
white-space: pre-line;
}
.notification-time {
margin-top: 18rpx;
color: #98a1b2;
font-size: 20rpx;
line-height: 1.4;
}
</style>
+426 -125
View File
@@ -27,7 +27,7 @@
<view class="metric-card">
<view class="section-header">
<text class="section-title">核心指标</text>
<text class="section-subtitle">近 30 天累计</text>
<text class="section-subtitle">本月累计</text>
</view>
<view class="metric-grid">
<view v-for="item in metrics" :key="item.label" class="metric-item">
@@ -37,6 +37,20 @@
</view>
</view>
<view class="process-card">
<view class="section-header">
<text class="section-title">工序步骤统计</text>
<text class="section-subtitle">本月 Top 10</text>
</view>
<view v-if="processBreakdown.length" class="process-list">
<view v-for="item in processBreakdown" :key="item.key" class="process-row">
<text class="process-name">{{ item.name }}</text>
<text class="process-count">{{ item.quantity }}</text>
</view>
</view>
<text v-else class="empty-text">本月暂无工序步骤记录</text>
</view>
<view class="trend-card">
<view class="section-header">
<text class="section-title">个人趋势</text>
@@ -52,6 +66,32 @@
</view>
</view>
<view class="calendar-card">
<view class="calendar-title-row">
<view class="calendar-title"><u-icon name="list-dot" color="#1677ff" size="34" /><text>月度总表({{ calendarMonthLabel }})</text></view>
<view class="month-actions"><text @tap="changeMonth(-1)">‹</text><text @tap="changeMonth(1)">›</text></view>
</view>
<text class="calendar-hint">日历仅显示是否有数据,点击日期查看当天统计</text>
<view class="weekday-row"><text v-for="day in weekdays" :key="day">{{ day }}</text></view>
<view v-for="(week, index) in calendarWeeks" :key="index" class="calendar-week">
<view v-for="cell in week" :key="cell.date" class="calendar-cell" :class="{ muted: !cell.currentMonth, selected: cell.date === selectedDate, today: cell.isToday, hasData: cell.hasData }" @tap="selectCalendarDate(cell)">
<text>{{ cell.day }}</text><view v-if="cell.hasData" class="data-dot"></view>
</view>
</view>
<view class="day-detail">
<view class="day-detail-header"><text>当天明细</text><text>{{ selectedDate }}</text></view>
<view class="day-metrics">
<view><text>订单扫码</text><strong>{{ selectedDaySummary.order }}</strong></view>
<view><text>整机数量</text><strong>{{ selectedDaySummary.product }}</strong></view>
<view><text>总计</text><strong>{{ selectedDaySummary.total }}</strong></view>
</view>
<view v-if="selectedDaySummary.steps.length" class="day-step-list">
<view v-for="step in selectedDaySummary.steps" :key="step.key" class="day-step-row"><text>{{ step.name }}</text><strong>{{ step.quantity }}</strong></view>
</view>
<text v-else class="day-empty">当天暂无工序数据</text>
</view>
</view>
<view class="record-card">
<view class="section-header">
<text class="section-title">最近明细</text>
@@ -72,43 +112,12 @@
</view>
</view>
<view class="split-card">
<view class="split-section">
<view class="section-header compact">
<text class="section-title">扫码类型占比</text>
</view>
<view v-for="item in typeRate" :key="item.label" class="progress-row">
<view class="progress-info">
<text class="progress-label">{{ item.label }}</text>
<text class="progress-value">{{ item.value }}%</text>
</view>
<view class="progress-track">
<view class="progress-fill" :style="{ width: item.value + '%', backgroundColor: item.color }"></view>
</view>
</view>
</view>
<view class="split-section">
<view class="section-header compact">
<text class="section-title">异常统计</text>
</view>
<view v-for="item in exceptionData" :key="item.label" class="progress-row">
<view class="progress-info">
<text class="progress-label">{{ item.label }}</text>
<text class="progress-value">{{ item.value }}%</text>
</view>
<view class="progress-track">
<view class="progress-fill" :style="{ width: item.value + '%', backgroundColor: item.color }"></view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getUserInfo } from '@/api/member.js'
import { getOrderRecentRecords, getOrderStatistics, getProductRecentRecords, getProductStatistics } from '@/api/produce/data-entry.js'
import { getExceptionStatistics, getOrderRecentRecords, getOrderStatistics, getProductRecentRecords, getProductStatistics, getRepairStatistics, getTodayDashboard } from '@/api/produce/data-entry.js'
export default {
data() {
@@ -122,23 +131,24 @@ export default {
level: '-'
},
metrics: [
{ label: '今日扫码', value: '0', type: 'primary' },
{ label: '本月累计', value: '0', type: 'success' },
{ label: '成功率', value: '0%', type: 'success' },
{ label: '异常数', value: '0', type: 'danger' }
{ label: '订单数', value: '0', type: 'primary' }, { label: '整机数', value: '0', type: 'success' },
{ label: '本月总计', value: '0', type: 'primary' }, { label: '异常提报', value: '0', type: 'warning' },
{ label: '维修量', value: '0', type: 'warning' }, { label: '责任订单', value: '0', type: 'danger' }
],
trendData: [],
processBreakdown: [],
recentRecords: [],
typeRate: [
{ label: '订单模式', value: 0, color: '#2f6cf6' },
{ label: '整机模式', value: 0, color: '#35bfa3' },
{ label: '异常记录', value: 0, color: '#f7b733' }
],
exceptionData: [
{ label: '已处理', value: 0, color: '#19be6b' },
{ label: '待复核', value: 0, color: '#f7b733' },
{ label: '待处理', value: 0, color: '#e91f3f' }
]
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
calendarMonth: new Date(),
selectedDate: '',
calendarWeeks: [],
calendarData: {},
selectedDaySummary: { order: 0, product: 0, quantity: 0, total: 0, steps: [] },
}
},
computed: {
calendarMonthLabel() {
return `${this.calendarMonth.getFullYear()}-${String(this.calendarMonth.getMonth() + 1).padStart(2, '0')}`
}
},
onLoad() {
@@ -151,13 +161,25 @@ export default {
},
async loadPageData() {
const userCode = this.getCurrentUserCode()
const today = new Date()
const dateText = (date) => date.toISOString().slice(0, 10)
const todayDate = dateText(today)
this.selectedDate = todayDate
this.buildCalendar()
const monthDate = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-01`
try {
const [profile, orderStats, productStats, orderRecent, productRecent] = await Promise.all([
const [profile, orderStats, productStats, repairStats, exceptionStats, dashboard, todayOrderStats, todayProductStats, todayRepairStats, orderRecent, productRecent] = await Promise.all([
getUserInfo(),
getOrderStatistics({ user_code: userCode }),
getProductStatistics({ user_code: userCode }),
getOrderRecentRecords({ user_code: userCode, limit: 3 }),
getProductRecentRecords({ user_code: userCode, limit: 3 })
getOrderStatistics({ user_code: userCode, start_date: monthDate, end_date: todayDate }),
getProductStatistics({ user_code: userCode, start_date: monthDate, end_date: todayDate }),
getRepairStatistics({ user_code: userCode, start_date: monthDate, end_date: todayDate }),
getExceptionStatistics({ user_code: userCode, start_date: monthDate, end_date: todayDate }),
getTodayDashboard(),
getOrderStatistics({ user_code: userCode, start_date: todayDate, end_date: todayDate }),
getProductStatistics({ user_code: userCode, start_date: todayDate, end_date: todayDate }),
getRepairStatistics({ user_code: userCode, start_date: todayDate, end_date: todayDate }),
getOrderRecentRecords({ user_code: userCode, start_date: monthDate, end_date: todayDate, limit: 3 }),
getProductRecentRecords({ user_code: userCode, start_date: monthDate, end_date: todayDate, limit: 3 })
])
this.profile = {
@@ -169,16 +191,42 @@ export default {
level: Number(profile.enabled) === 0 ? '已停用' : '稳定输出'
}
const todayTotal = Number(orderStats?.today_total || 0) + Number(productStats?.today_total || 0)
const successTotal = Number(orderStats?.success_total || 0) + Number(productStats?.success_total || 0)
const failedTotal = Number(orderStats?.failed_total || 0) + Number(productStats?.failed_total || 0)
const successRate = todayTotal > 0 ? ((successTotal / todayTotal) * 100).toFixed(1) : '0.0'
const repairTotal = Number(repairStats?.completed_today || 0)
const exceptionTotal = Number(exceptionStats?.pending || 0) + Number(exceptionStats?.review || 0) + Number(exceptionStats?.done || 0)
const monthScanTotal = Number(orderStats?.today_total || 0) + Number(productStats?.today_total || 0)
const todayTotal = Number(todayOrderStats?.today_total || 0) + Number(todayProductStats?.today_total || 0)
this.selectedDaySummary = this.makeDaySummary(todayOrderStats, todayProductStats, todayRepairStats)
const responsibilityTotal = Number(dashboard?.responsibility_order_total || 0)
this.metrics = [
{ label: '今日扫码', value: String(todayTotal), type: 'primary' },
{ label: '本月累计', value: String(todayTotal), type: 'success' },
{ label: '成功率', value: `${successRate}%`, type: 'success' },
{ label: '异常数', value: String(failedTotal), type: 'danger' }
{ label: '订单数', value: String(orderStats?.today_total || 0), type: 'primary' },
{ label: '整机数', value: String(productStats?.today_total || 0), type: 'success' },
{ label: '本月总计', value: String(monthScanTotal), type: 'primary' },
{ label: '异常提报', value: String(exceptionTotal), type: 'warning' },
{ label: '维修量', value: String(repairTotal), type: 'warning' },
{ label: '责任订单', value: String(responsibilityTotal), type: 'danger' }
]
const breakdown = [...(orderStats?.process_breakdown || []), ...(productStats?.process_breakdown || []), ...(repairStats?.process_breakdown || [])]
const grouped = {}
breakdown.forEach((item) => {
const key = `${item.process_id || 'none'}-${item.step_id || 'none'}`
if (!grouped[key]) grouped[key] = { key, name: `${item.process_name || '未记录工序'} / ${item.step_name || '未记录步骤'}`, quantity: 0 }
grouped[key].quantity += Number(item.quantity || 0)
})
this.processBreakdown = Object.values(grouped).sort((a, b) => b.quantity - a.quantity).slice(0, 10)
const trendMap = {}
;[...(orderStats?.daily_trend || []), ...(productStats?.daily_trend || [])].forEach((item) => {
trendMap[item.date] = (trendMap[item.date] || 0) + Number(item.quantity || 0)
})
const trendDates = Object.keys(trendMap).sort().slice(-7)
const maxTrend = Math.max(1, ...trendDates.map((date) => trendMap[date]))
this.trendData = trendDates.map((date, index) => ({
label: date.slice(5),
value: trendMap[date],
percent: Math.round(trendMap[date] / maxTrend * 100),
color: index % 2 ? '#35bfa3' : '#2f6cf6'
}))
this.calendarData = trendMap
this.buildCalendar()
const orderItems = Array.isArray(orderRecent?.items) ? orderRecent.items : []
const productItems = Array.isArray(productRecent?.items) ? productRecent.items : []
@@ -192,20 +240,70 @@ export default {
count: item.quantity ? `+${item.quantity}` : '1'
}))
this.typeRate = [
{ label: '订单模式', value: orderItems.length, color: '#2f6cf6' },
{ label: '整机模式', value: productItems.length, color: '#35bfa3' },
{ label: '异常记录', value: failedTotal, color: '#f7b733' }
]
this.exceptionData = [
{ label: '已处理', value: successTotal, color: '#19be6b' },
{ label: '待复核', value: failedTotal > 0 ? Math.min(failedTotal, 18) : 0, color: '#f7b733' },
{ label: '待处理', value: failedTotal > 18 ? failedTotal - 18 : 0, color: '#e91f3f' }
]
} catch (error) {
console.error('[scanapp] 统计页数据加载失败', error)
}
},
formatDate(date) {
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
},
buildCalendar() {
const year = this.calendarMonth.getFullYear()
const month = this.calendarMonth.getMonth()
const firstDay = (new Date(year, month, 1).getDay() + 6) % 7
const cells = []
for (let index = 0; index < 42; index++) {
const date = new Date(year, month, index - firstDay + 1)
const value = this.formatDate(date)
cells.push({ date: value, day: date.getDate(), currentMonth: date.getMonth() === month, isToday: value === this.formatDate(new Date()), hasData: Boolean(this.calendarData[value]) })
}
this.calendarWeeks = Array.from({ length: 6 }, (_, index) => cells.slice(index * 7, index * 7 + 7))
},
async changeMonth(offset) {
this.calendarMonth = new Date(this.calendarMonth.getFullYear(), this.calendarMonth.getMonth() + offset, 1)
const year = this.calendarMonth.getFullYear()
const month = this.calendarMonth.getMonth() + 1
const startDate = `${year}-${String(month).padStart(2, '0')}-01`
const endDate = this.formatDate(new Date(year, month, 0))
try {
const [order, product] = await Promise.all([
getOrderStatistics({ user_code: this.getCurrentUserCode(), start_date: startDate, end_date: endDate }),
getProductStatistics({ user_code: this.getCurrentUserCode(), start_date: startDate, end_date: endDate })
])
this.calendarData = [...(order?.daily_trend || []), ...(product?.daily_trend || [])].reduce((map, item) => ({ ...map, [item.date]: true }), {})
} catch (error) {
this.calendarData = {}
}
this.buildCalendar()
const firstCell = this.calendarWeeks.flat().find((cell) => cell.currentMonth)
if (firstCell) this.selectCalendarDate(firstCell)
},
async selectCalendarDate(cell) {
if (!cell.currentMonth) return
this.selectedDate = cell.date
try {
const [order, product, repair] = await Promise.all([
getOrderStatistics({ user_code: this.getCurrentUserCode(), start_date: cell.date, end_date: cell.date }),
getProductStatistics({ user_code: this.getCurrentUserCode(), start_date: cell.date, end_date: cell.date }),
getRepairStatistics({ user_code: this.getCurrentUserCode(), start_date: cell.date, end_date: cell.date })
])
this.selectedDaySummary = this.makeDaySummary(order, product, repair)
} catch (error) {
console.error('[scanapp] 日期统计加载失败', error)
}
},
makeDaySummary(order, product, repair) {
const orderTotal = Number(order?.today_total || 0)
const productTotal = Number(product?.today_total || 0)
const repairTotal = Number(repair?.completed_today || 0)
const rows = [...(order?.process_breakdown || []), ...(product?.process_breakdown || []), ...(repair?.process_breakdown || [])]
const grouped = {}
rows.forEach((item) => {
const key = `${item.process_id || 'none'}-${item.step_id || 'none'}`
if (!grouped[key]) grouped[key] = { key, name: `${item.process_name || '未记录工序'} / ${item.step_name || '未记录步骤'}`, quantity: 0 }
grouped[key].quantity += Number(item.quantity || 0)
})
return { order: orderTotal, product: productTotal, quantity: productTotal, total: orderTotal + productTotal + repairTotal, steps: Object.values(grouped).sort((a, b) => b.quantity - a.quantity) }
}
}
}
@@ -221,10 +319,11 @@ export default {
.hero-card,
.profile-card,
.calendar-card,
.metric-card,
.trend-card,
.record-card,
.split-card {
.process-card {
margin-top: 18rpx;
padding: 24rpx;
border-radius: 22rpx;
@@ -232,6 +331,179 @@ export default {
box-shadow: 0 10rpx 26rpx rgba(23, 35, 61, 0.05);
}
.calendar-title-row,
.calendar-title,
.month-actions,
.weekday-row,
.calendar-week,
.day-detail-header,
.day-metrics {
display: flex;
align-items: center;
}
.calendar-title-row,
.day-detail-header {
justify-content: space-between;
}
.calendar-title {
gap: 12rpx;
color: #17233d;
font-size: 28rpx;
font-weight: 700;
}
.month-actions text {
padding: 4rpx 14rpx;
color: #1677ff;
font-size: 36rpx;
}
.calendar-hint {
display: block;
margin-top: 16rpx;
padding: 16rpx;
border-radius: 12rpx;
background: #f5f8fd;
color: #7d8798;
font-size: 20rpx;
}
.weekday-row,
.calendar-week {
justify-content: space-between;
}
.weekday-row {
margin-top: 18rpx;
color: #9aa4b4;
font-size: 20rpx;
text-align: center;
}
.weekday-row text,
.calendar-cell {
width: 13.2%;
text-align: center;
}
.calendar-week {
margin-top: 10rpx;
}
.calendar-cell {
position: relative;
padding: 18rpx 0;
border-radius: 16rpx;
color: #303949;
font-size: 26rpx;
}
.calendar-cell.muted {
color: #c4cad5;
}
.calendar-cell.hasData::after {
content: '';
position: absolute;
bottom: 8rpx;
left: 50%;
width: 6rpx;
height: 6rpx;
border-radius: 50%;
background: #19be6b;
transform: translateX(-50%);
}
.calendar-cell.selected {
background: #2f80ed;
color: #ffffff;
box-shadow: 0 6rpx 14rpx rgba(47, 128, 237, 0.25);
}
.calendar-cell.selected.hasData::after {
background: #ffffff;
}
.day-detail {
margin-top: 18rpx;
padding: 18rpx;
border: 1rpx solid #dceafd;
border-radius: 16rpx;
background: #fbfdff;
}
.day-detail-header text:first-child {
color: #17233d;
font-size: 28rpx;
font-weight: 700;
}
.day-detail-header text:last-child {
color: #7d8798;
font-size: 20rpx;
}
.day-metrics {
gap: 12rpx;
margin-top: 16rpx;
}
.day-metrics view {
flex: 1;
padding: 14rpx 6rpx;
border-radius: 12rpx;
background: #f0f6ff;
text-align: center;
}
.day-metrics view:nth-child(2) { background: #f2fbea; }
.day-metrics view:nth-child(3) { background: #fff7e6; }
.day-metrics text,
.day-metrics strong {
display: block;
}
.day-metrics text {
color: #7d8798;
font-size: 18rpx;
}
.day-metrics strong {
margin-top: 6rpx;
color: #303949;
font-size: 28rpx;
}
.day-empty {
display: block;
margin-top: 16rpx;
color: #9aa4b4;
font-size: 20rpx;
text-align: center;
}
.day-step-list {
margin-top: 14rpx;
border-top: 1rpx solid #e7edf6;
}
.day-step-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12rpx 4rpx;
border-bottom: 1rpx solid #e7edf6;
color: #526078;
font-size: 20rpx;
}
.day-step-row strong {
color: #2f6cf6;
font-size: 22rpx;
}
.hero-card {
display: flex;
align-items: center;
@@ -370,7 +642,7 @@ export default {
.metric-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 14rpx;
}
@@ -399,6 +671,10 @@ export default {
color: #e91f3f;
}
.metric-value.warning {
color: #f7a928;
}
.metric-label {
margin-top: 6rpx;
color: #7d8798;
@@ -450,6 +726,37 @@ export default {
border-bottom: 1rpx solid #eef1f6;
}
.process-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14rpx 0;
border-bottom: 1rpx solid #eef1f6;
}
.process-row:last-child {
border-bottom: 0;
}
.process-name {
color: #4d5b70;
font-size: 22rpx;
}
.process-count {
color: #2f6cf6;
font-size: 24rpx;
font-weight: 700;
}
.empty-text {
display: block;
padding: 20rpx 0 6rpx;
color: #9aa4b4;
font-size: 20rpx;
text-align: center;
}
.record-item:last-child {
padding-bottom: 0;
border-bottom: 0;
@@ -504,74 +811,29 @@ export default {
line-height: 1.35;
}
.split-card {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 18rpx;
}
.split-section {
padding: 20rpx;
border-radius: 18rpx;
background: #f8fbff;
}
.progress-row {
margin-top: 14rpx;
}
.progress-info {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8rpx;
}
.progress-label,
.progress-value {
color: #7d8798;
font-size: 20rpx;
line-height: 1.35;
}
.progress-value {
color: #17233d;
font-weight: 700;
}
.progress-track {
height: 14rpx;
border-radius: 999rpx;
background: #e9edf4;
overflow: hidden;
}
.progress-fill {
height: 100%;
border-radius: 999rpx;
}
.theme-dark.statistics-page {
background: #151923;
}
.theme-dark .hero-card,
.theme-dark .profile-card,
.theme-dark .calendar-card,
.theme-dark .metric-card,
.theme-dark .trend-card,
.theme-dark .record-card,
.theme-dark .split-card {
.theme-dark .process-card {
border-color: #364152;
background: #222936;
box-shadow: none;
}
.theme-dark .metric-item,
.theme-dark .split-section,
.theme-dark .profile-chip {
background: #1c2431;
}
.theme-dark .profile-name,
.theme-dark .calendar-title,
.theme-dark .section-title,
.theme-dark .metric-value,
.theme-dark .record-main,
@@ -580,6 +842,7 @@ export default {
}
.theme-dark .profile-desc,
.theme-dark .calendar-hint,
.theme-dark .section-subtitle,
.theme-dark .metric-label,
.theme-dark .bar-label,
@@ -590,16 +853,54 @@ export default {
color: #aeb9ca;
}
.theme-dark .record-item,
.theme-dark .progress-track {
.theme-dark .process-name,
.theme-dark .empty-text {
color: #aeb9ca;
}
.theme-dark .process-row {
border-color: #364152;
}
.theme-dark .bar-track,
.theme-dark .progress-track {
.theme-dark .record-item {
border-color: #364152;
}
.theme-dark .bar-track {
background: #1c2431;
}
.theme-dark .calendar-hint,
.theme-dark .day-detail {
background: #1c2431;
border-color: #364152;
}
.theme-dark .calendar-cell {
color: #f2f5fa;
}
.theme-dark .calendar-cell.muted,
.theme-dark .day-detail-header text:last-child,
.theme-dark .day-metrics text,
.theme-dark .day-empty {
color: #aeb9ca;
}
.theme-dark .day-detail-header text:first-child,
.theme-dark .day-metrics strong {
color: #f2f5fa;
}
.theme-dark .day-step-list,
.theme-dark .day-step-row {
border-color: #364152;
}
.theme-dark .day-step-row {
color: #aeb9ca;
}
.theme-dark .profile-badge {
background: rgba(47, 108, 246, 0.2);
}