Files
pda-uniapp/pages/module/module.vue
T

40 lines
2.5 KiB
Vue
Raw Normal View History

2026-07-30 18:04:37 +08:00
<template>
<view v-if="user && currentModule" class="page-shell portal-page">
<PortalHeader title="业务模块" :user="user" />
<view class="portal-content">
<view class="module-hero" :class="`module-hero-${currentModule.key}`"><view class="module-hero-icon">{{ currentModule.icon }}</view><view><text class="module-hero-title">{{ currentModule.name }}</text><text class="module-hero-desc">{{ currentModule.description }}</text></view></view>
<text class="group-title">业务功能</text>
<view class="operation-list"><button v-for="operation in currentModule.operations" :key="operation.name" class="operation-item" :class="{ 'operation-item-disabled': !operation.available }" :disabled="!operation.available" @tap="openOperation(operation)"><view class="operation-icon">{{ operation.icon }}</view><view class="operation-info"><text class="operation-name">{{ operation.name }}</text><text class="operation-desc">{{ operation.description }}</text></view><text v-if="operation.available" class="operation-count">{{ overview.pendingBoxCount }}</text><text v-else class="operation-prototype">未开放</text><text v-if="operation.available" class="operation-arrow">›</text></button></view>
2026-09-11 15:38:35 +08:00
<view class="module-empty-note">当前展示“一件代发”和“出库拣货”。</view>
2026-07-30 18:04:37 +08:00
</view>
</view>
</template>
<script>
import PortalHeader from '@/components/PortalHeader.vue'
import { MODULES } from '@/data/demo-data.js'
import { session, requireSession } from '@/stores/session.js'
import { getPickingOverview } from '@/stores/picking.js'
export default {
components: { PortalHeader },
data() { return { user: session.currentUser, moduleKey: 'outbound', overview: getPickingOverview() } },
2026-09-11 11:19:47 +08:00
computed: {
currentModule() {
const module = MODULES.find((item) => item.key === this.moduleKey) || MODULES[0]
return { ...module, operations: module.operations.filter((operation) => operation.visible) }
}
},
2026-07-30 18:04:37 +08:00
onLoad(options) { this.moduleKey = options.key || 'outbound' },
onShow() { if (!requireSession()) return; this.user = session.currentUser; this.overview = getPickingOverview() },
methods: {
2026-09-11 11:15:07 +08:00
openOperation(operation) {
if (!operation.available) return
2026-09-11 11:51:35 +08:00
const routes = { '一件代发': '/pages/dropship-tasks/dropship-tasks', '出库拣货': '/pages/tasks/tasks' }
2026-09-11 11:19:47 +08:00
const url = routes[operation.name]
|| `/pages/operation/operation?module=${encodeURIComponent(this.moduleKey)}&name=${encodeURIComponent(operation.name)}`
uni.navigateTo({ url })
2026-09-11 11:15:07 +08:00
}
2026-07-30 18:04:37 +08:00
}
}
</script>