-
{{ $t('common_add.similarRechargeRecords') }}
- · {{ ReadCookiesTime }} {{ $t('common_add.buy') }} 【{{ addConsume.goodsName.value }}】({{
+
{{ $t('common_add.similarCosumeRecords') }}
+ · {{ ReadCookiesValue.payTime }} {{ $t('common_add.buy') }} 【{{ ReadCookiesValue.goodsName }}】【{{ $t('common_add.orderStatus') }}: {{ orderStatus }}】({{
$t('common_add.operator') }}: {{ adminData.adminName }})
diff --git a/src/views/home.vue b/src/views/home.vue
index 650e8d6..d6421b6 100644
--- a/src/views/home.vue
+++ b/src/views/home.vue
@@ -19,6 +19,7 @@ import {findMenuById,permissionMapping} from "@/utils/menuTreePermission.js"
import {useMessageStore} from '@/store/index.js'
// 国际化
import { useI18n } from 'vue-i18n'
+import { has } from 'lodash'
const {t} = useI18n();
// ------------------ ICONS ------------------
@@ -158,15 +159,19 @@ const selectStatusById = () => {
status.push(0);
}
+ //地区财务审核
+ if (hasPermission(permissionMapping.area_finance_collection_approved)) {
+ status.push(1);
+ }
+ //和地区负责人审核
+ if (hasPermission(permissionMapping.area_manager_collection_approved)) {
+ status.push(7);
+ }
+
//地区客服收款
if (hasPermission(permissionMapping.collection_area_submit)) {
status.push(2);
}
- // 地区负责人收款待审核
- // else if (hasPermission(permissionMapping.area_manager_collection_pending)) {
- // status.push(0);
- // }
-
// ===== 退款流程状态 =====
// 地区财务退款审核
@@ -211,7 +216,8 @@ const getMessage = async () => {
});
if (res?.data) {
- const cleanList = res.data.filter(i => i.flag !== 1)
+ const list = Array.isArray(res.data) ? res.data : (Array.isArray(res.data?.list) ? res.data.list : [])
+ const cleanList = list.filter(i => i.flag !== 1)
messageStore.setMessages(cleanList)
}
} catch (e) {
@@ -282,6 +288,27 @@ const toggleShowAll = () => showAll.value = !showAll.value
const scrollContainer = ref(null)
const scrollToTop = () => scrollContainer.value?.scrollTo({top: 0, behavior: 'smooth'})
+const getPathByQueryId = (queryId) => {
+ const qid = Number(queryId)
+ if (!Number.isFinite(qid)) return null
+
+ const matchedRoutes = router.getRoutes().filter(r => {
+ const pid = r.meta?.permissionId
+ if (Array.isArray(pid)) return pid.includes(qid)
+ return pid === qid
+ })
+
+ if (!matchedRoutes.length) return null
+
+ matchedRoutes.sort((a, b) => {
+ const aDepth = typeof a.path === 'string' ? a.path.split('/').length : 0
+ const bDepth = typeof b.path === 'string' ? b.path.split('/').length : 0
+ return bDepth - aDepth
+ })
+
+ return matchedRoutes[0]?.path || null
+}
+
// 点击消息 → 已读 + 跳转
const handleMessageClick = async (item) => {
const res = await API({
@@ -292,7 +319,22 @@ const handleMessageClick = async (item) => {
if (res.code === 200) {
closeMessageDialog()
- await router.push(getOrderPage(item.status))
+ const targetPath = item?.queryId ? getPathByQueryId(item.queryId) : null
+ const messageStatus = Number(item?.status)
+
+ // 1是代表收款处理的已通过,7是代表的收款处理(负责人)的已通过
+ let tab = null
+ if (messageStatus === 1 && targetPath?.includes('/moneyManage/receiveDetail/receiveFinance')) {
+ tab = 'pass'
+ } else if (messageStatus === 7 && targetPath?.includes('/moneyManage/receiveDetail/receiveManager')) {
+ tab = 'pass'
+ }
+
+ if (targetPath && tab) {
+ await router.push({ path: targetPath, query: { tab } })
+ } else {
+ await router.push(targetPath || getOrderPage(item.status) || '/noPermission')
+ }
await getMessage()
ElMessage.success(t('elmessage.jumpSuccess'))
} else {
@@ -456,7 +498,7 @@ onMounted(() => getMessage())
-
+
getMessage())
-
[{{ item.marketName }}]
-
[{{item.name}}{{ item.jwcode }}]{{ t('home.orderNeedsReview') }}
+
[{{ item.marketName }}]
+
+
[{{item.name}}{{ item.jwcode }}]{{ item.desc}}
-import {onMounted, ref} from 'vue'
+import {onMounted, ref,onUnmounted} from 'vue'
import {ElMessage} from 'element-plus'
import request from '@/util/http'
import {useRouter} from 'vue-router'
@@ -34,7 +34,78 @@ function getMachineId() {
}
}
-const form = ref({account: null, password: '', token: '', machineId: machineId1.value})
+const form = ref({account: null, password: '', token: '', machineId: machineId1.value, captcha: '', uuid: ''})
+const formRef = ref(null)
+const rules = {
+ account: [
+ { required: true, message: '请输入账号', trigger: 'blur' }
+ ],
+ password: [
+ { required: true, message: '请输入密码', trigger: 'blur' }
+ ],
+ captcha: [
+ { required: true, message: '请输入验证码', trigger: 'blur' }
+ ]
+}
+const captchaUrl = ref('')
+const isCaptchaCooldown = ref(false)
+let captchaCooldownTimer = null
+let cooldownStartTime = 0 // 冷却开始时间(时间戳)
+const COOLDOWN_TOTAL = 5 * 1000 // 总冷却时长:5 秒(转毫秒)
+
+// 启动验证码冷却定时器
+const startCaptchaCooldown = () => {
+ isCaptchaCooldown.value = true
+ cooldownStartTime = Date.now()
+ captchaCooldownTimer = setTimeout(() => {
+ isCaptchaCooldown.value = false // 冷却结束
+ cooldownStartTime = 0 // 重置开始时间
+ }, COOLDOWN_TOTAL)
+}
+
+const getCaptchaRemainingSeconds = () => {
+ if (!isCaptchaCooldown.value || cooldownStartTime === 0) {
+ return 0
+ }
+ const elapsed = Date.now() - cooldownStartTime
+ const remainingMs = Math.max(COOLDOWN_TOTAL - elapsed, 0)
+ const remainingSeconds = Math.ceil(remainingMs / 1000)
+ return remainingSeconds
+}
+
+const clearCaptchaCooldown = () => {
+ if (captchaCooldownTimer) {
+ clearTimeout(captchaCooldownTimer)
+ captchaCooldownTimer = null
+ }
+ isCaptchaCooldown.value = false
+ cooldownStartTime = 0
+}
+// 获取验证码
+const getCaptcha = async () => {
+ if (isCaptchaCooldown.value) {
+ ElMessage.warning('验证码获取太频繁,请' + getCaptchaRemainingSeconds() + '秒后再试')
+ return
+ }
+
+ try {
+ let uuid = Date.now()
+ localStorage.setItem('uuid', uuid)
+ const res = await request({
+ url: '/captcha' + '?uuid=' + uuid,
+ method: 'get',
+ responseType: 'blob',
+ })
+ if (captchaUrl.value) {
+ URL.revokeObjectURL(captchaUrl.value);
+ }
+ captchaUrl.value = URL.createObjectURL(res);
+
+ startCaptchaCooldown()
+ } catch (error) {
+ console.error('获取验证码失败', error)
+ }
+}
const adminRoleId = ref(null)
@@ -42,6 +113,12 @@ const adminRoleId = ref(null)
const adminStore = useAdminStore()
//调用方法
const login = async function () {
+ if (!formRef.value) return
+ try {
+ await formRef.value.validate()
+ } catch (err) {
+ return
+ }
if(loading.value) {
console.log('正在登录,请稍后')
@@ -51,11 +128,15 @@ const login = async function () {
loading.value = true
try {
+ let params = {
+ ...form.value,
+ uuid: localStorage.getItem('uuid')
+ }
const result = await request({
url: '/admin/login',
- data: form.value
+ data: params
})
- console.log('传给后端的参数', form.value)
+ console.log('传给后端的参数', params)
if (result.code === 200) {
// 本地存储token
@@ -64,7 +145,7 @@ const login = async function () {
// 存储用户信息
adminStore.setAdminData(result.data)
-
+
// 本页面使用 adminRoleId
adminRoleId.value = result.data.roleId
@@ -97,8 +178,10 @@ const login = async function () {
} else {
form.value.password = ''
form.value.account = ''
+ form.value.captcha = ''
ElMessage.error(result.msg)
loading.value = false //登录失败时重置loading状态
+ getCaptcha()
}
} catch (error) {
console.log('请求失败', error)
@@ -161,16 +244,22 @@ const selectMarket = async function () {
onMounted(() => {
getMachineId()
+ getCaptcha()
+})
+onUnmounted(() => {
+ clearCaptchaCooldown()
})
-
+
+
+
-
+
熵盾管理系统 V1.0
@@ -185,7 +274,20 @@ onMounted(() => {
required
/>
-
+
+
+
+
+
+
+
+
+

+
点击刷新二维码
+
+
+
+