单据、业务中心、公告和工作通知
This commit is contained in:
+21
-12
@@ -2,14 +2,20 @@
|
||||
<view class="page edge">
|
||||
<fy-header :title="title" back />
|
||||
<fy-scroll class="edge-scroll" @refresh="load">
|
||||
<view v-if="loading" class="empty">加载中…</view>
|
||||
<view v-else-if="!rows.length" class="empty">暂无记录</view>
|
||||
<view v-for="r in rows" :key="r.id || r.no" class="card item" @click="open(r)">
|
||||
<view>
|
||||
<text class="t">{{ r.title || r.no || r.typeLabel }}</text>
|
||||
<text class="s">{{ r.status || '' }} · {{ r.createdAt || r.date || '' }}</text>
|
||||
<view v-if="loading" class="empty">
|
||||
<wd-skeleton theme="paragraph" />
|
||||
</view>
|
||||
<text class="amt">{{ r.amount != null ? '¥' + r.amount : '' }}</text>
|
||||
<wd-status-tip v-else-if="!rows.length" image="content" tip="暂无记录" />
|
||||
<view v-for="r in rows" :key="r.id || r.no" class="card item" @click="open(r)">
|
||||
<view class="main">
|
||||
<text class="t">{{ r.title || r.no || r.typeLabel }}</text>
|
||||
<text class="s">{{ r.createdAt || r.date || '' }}</text>
|
||||
</view>
|
||||
<view class="side">
|
||||
<text v-if="r.amount != null" class="amt">¥{{ r.amount }}</text>
|
||||
<wd-tag v-if="r.status" type="primary" plain>{{ r.status }}</wd-tag>
|
||||
</view>
|
||||
<text class="arr">›</text>
|
||||
</view>
|
||||
</fy-scroll>
|
||||
</view>
|
||||
@@ -54,9 +60,12 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.item { margin: 16rpx 24rpx; padding: 24rpx; display: flex; justify-content: space-between; }
|
||||
.t { display: block; font-size: 28rpx; font-weight: 600; }
|
||||
.s { font-size: 22rpx; color: #6B7280; }
|
||||
.amt { color: #1677FF; font-weight: 700; }
|
||||
.empty { padding: 80rpx; text-align: center; color: #6B7280; }
|
||||
.item { margin: 16rpx 24rpx; padding: 24rpx; display: flex; align-items: center; }
|
||||
.main { flex: 1; min-width: 0; }
|
||||
.t { display: block; font-size: 28rpx; font-weight: 650; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.s { display: block; margin-top: 8rpx; font-size: 24rpx; color: #6B7280; }
|
||||
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8rpx; margin-left: 16rpx; }
|
||||
.amt { color: #1677FF; font-weight: 700; font-size: 28rpx; }
|
||||
.arr { color: #C4C9D4; font-size: 32rpx; margin-left: 8rpx; }
|
||||
.empty { padding: 80rpx 40rpx; }
|
||||
</style>
|
||||
|
||||
+24
-26
@@ -1,36 +1,33 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="page edge">
|
||||
<fy-header title="工作通知" back />
|
||||
<fy-scroll class="edge-scroll" @refresh="load">
|
||||
<view class="bar">
|
||||
<text>审批 · 协同 · 投标 · 用章 · 公告</text>
|
||||
<text class="badge">{{ items.length }} 项待办</text>
|
||||
<text class="count">{{ items.length }} 项待办</text>
|
||||
</view>
|
||||
<view v-if="!items.length" class="empty">暂无待办通知</view>
|
||||
<wd-status-tip v-if="!items.length" image="content" tip="暂无待办通知" />
|
||||
<view v-for="t in items" :key="t.no || t.id" class="card item" @click="open(t)">
|
||||
<view class="stripe" />
|
||||
<view class="body">
|
||||
<view class="top">
|
||||
<text class="kind">{{ t.typeLabel || t.tag || t.type || '待办' }}</text>
|
||||
<text class="time">{{ t.createdAt || t.time || '' }}</text>
|
||||
</view>
|
||||
<view class="main">
|
||||
<text class="type">{{ t.typeLabel || t.tag || t.type || '待办' }}</text>
|
||||
<text class="title">{{ t.title || t.summary || t.no }}</text>
|
||||
<text class="sub">{{ t.submitter || t.applicant || '' }}{{ t.dept ? ' · ' + t.dept : '' }}</text>
|
||||
<view class="acts">
|
||||
<text class="go">去办理</text>
|
||||
</view>
|
||||
<text class="sub">{{ metaOf(t) }}</text>
|
||||
</view>
|
||||
<text class="arr">›</text>
|
||||
</view>
|
||||
</fy-scroll>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FyHeader from '../../components/fy-header.vue'
|
||||
import FyScroll from '../../components/fy-scroll.vue'
|
||||
import { store } from '../../utils/store.js'
|
||||
import { asList, fmtTime } from '../../utils/format.js'
|
||||
import { oaGet } from '../../utils/api.js'
|
||||
|
||||
export default {
|
||||
components: { FyHeader },
|
||||
components: { FyHeader, FyScroll },
|
||||
data() {
|
||||
return { items: [] }
|
||||
},
|
||||
@@ -51,6 +48,11 @@ export default {
|
||||
const conv = store.conversations.find((c) => c.type === 'work')
|
||||
if (conv) conv.unread = 0
|
||||
},
|
||||
metaOf(t) {
|
||||
const who = [t.submitter || t.applicant, t.dept].filter(Boolean).join(' · ')
|
||||
const time = t.createdAt || t.time || ''
|
||||
return [who, time].filter(Boolean).join(' · ')
|
||||
},
|
||||
open(t) {
|
||||
const no = t.no || t.id || ''
|
||||
if (String(t.source || t.type || '') === 'work' || t.taskId) {
|
||||
@@ -64,16 +66,12 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.bar { margin: 16rpx 24rpx; background: #F3F6FB; border-radius: 16rpx; padding: 16rpx 20rpx; display: flex; justify-content: space-between; font-size: 22rpx; color: #4B5563; }
|
||||
.item { margin: 0 24rpx 20rpx; display: flex; overflow: hidden; }
|
||||
.stripe { width: 8rpx; background: #1677FF; }
|
||||
.body { flex: 1; padding: 24rpx; }
|
||||
.top { display: flex; justify-content: space-between; }
|
||||
.kind { font-size: 28rpx; font-weight: 700; }
|
||||
.time { font-size: 22rpx; color: #6B7280; }
|
||||
.title { display: block; font-size: 28rpx; font-weight: 600; margin: 12rpx 0 6rpx; }
|
||||
.sub { font-size: 22rpx; color: #6B7280; }
|
||||
.acts { margin-top: 16rpx; }
|
||||
.go { color: #1677FF; font-size: 24rpx; font-weight: 600; }
|
||||
.empty { text-align: center; color: #6B7280; padding: 80rpx; }
|
||||
.bar { margin: 16rpx 24rpx 8rpx; padding: 0 8rpx; display: flex; justify-content: space-between; align-items: center; font-size: 22rpx; color: #6B7280; }
|
||||
.count { color: #1677FF; font-weight: 600; }
|
||||
.item { margin: 16rpx 24rpx; padding: 24rpx; display: flex; align-items: center; }
|
||||
.main { flex: 1; min-width: 0; }
|
||||
.type { display: inline-block; font-size: 22rpx; color: #1677FF; background: #E8F1FF; border-radius: 8rpx; padding: 2rpx 10rpx; }
|
||||
.title { display: block; margin-top: 10rpx; font-size: 28rpx; font-weight: 650; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.sub { display: block; margin-top: 6rpx; font-size: 24rpx; color: #6B7280; }
|
||||
.arr { color: #C4C9D4; font-size: 32rpx; margin-left: 8rpx; }
|
||||
</style>
|
||||
|
||||
+25
-15
@@ -1,23 +1,28 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view class="page edge">
|
||||
<fy-header :title="title" back />
|
||||
<view v-if="!allowed" class="deny">当前账号没有「{{ title }}」查看权限</view>
|
||||
<view v-else>
|
||||
<scroll-view scroll-x class="tabs">
|
||||
<text v-for="t in tabs" :key="t.id" class="tab" :class="{ on: tab === t.id }" @click="switchTab(t)">{{ t.title }}</text>
|
||||
</scroll-view>
|
||||
<view v-if="loading" class="empty">加载中…</view>
|
||||
<view v-else-if="!rows.length" class="empty">暂无数据</view>
|
||||
<fy-scroll v-else class="edge-scroll" @refresh="load">
|
||||
<wd-tabs v-if="tabs.length" v-model="tab" slidable="always" @change="onTab">
|
||||
<wd-tab v-for="t in tabs" :key="t.id" :title="t.title" :name="t.id" />
|
||||
</wd-tabs>
|
||||
<view v-if="loading" class="empty">
|
||||
<wd-skeleton theme="paragraph" />
|
||||
</view>
|
||||
<wd-status-tip v-else-if="!rows.length" image="content" tip="暂无数据" />
|
||||
<view v-for="r in rows" :key="r.id || r.no || r.code" class="card item">
|
||||
<view class="main">
|
||||
<text class="t">{{ titleOf(r) }}</text>
|
||||
<text class="s">{{ subOf(r) }}</text>
|
||||
<text v-if="subOf(r)" class="s">{{ subOf(r) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</fy-scroll>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FyHeader from '../../components/fy-header.vue'
|
||||
import FyScroll from '../../components/fy-scroll.vue'
|
||||
import { store } from '../../utils/store.js'
|
||||
import { ERP_MODULES, ERP_TABS } from '../../utils/catalog.js'
|
||||
import { asList, firstText } from '../../utils/format.js'
|
||||
@@ -25,7 +30,7 @@ import { oaGet } from '../../utils/api.js'
|
||||
import { canMenu } from '../../utils/perms.js'
|
||||
|
||||
export default {
|
||||
components: { FyHeader },
|
||||
components: { FyHeader, FyScroll },
|
||||
data() {
|
||||
return { id: '', tab: '', rows: [], loading: false }
|
||||
},
|
||||
@@ -45,6 +50,12 @@ export default {
|
||||
if (this.allowed) this.load()
|
||||
},
|
||||
methods: {
|
||||
onTab(e) {
|
||||
const id = (e && e.name) || this.tab
|
||||
if (id === this.tab && this.rows.length) return
|
||||
this.tab = id
|
||||
this.load()
|
||||
},
|
||||
switchTab(t) {
|
||||
this.tab = t.id
|
||||
this.load()
|
||||
@@ -110,11 +121,10 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tabs { white-space: nowrap; padding: 16rpx 16rpx 0; }
|
||||
.tab { display: inline-block; padding: 12rpx 20rpx; font-size: 24rpx; color: #6B7280; }
|
||||
.tab.on { color: #1677FF; font-weight: 700; border-bottom: 4rpx solid #1677FF; }
|
||||
.item { margin: 16rpx 24rpx; padding: 24rpx; }
|
||||
.t { display: block; font-weight: 600; font-size: 28rpx; }
|
||||
.s { font-size: 22rpx; color: #6B7280; }
|
||||
.empty, .deny { padding: 80rpx 40rpx; text-align: center; color: #6B7280; }
|
||||
.main { min-width: 0; }
|
||||
.t { display: block; font-weight: 650; font-size: 28rpx; color: #111827; }
|
||||
.s { display: block; margin-top: 8rpx; font-size: 24rpx; color: #6B7280; }
|
||||
.empty { padding: 40rpx 28rpx; }
|
||||
.deny { padding: 120rpx 40rpx; text-align: center; color: #6B7280; font-size: 28rpx; }
|
||||
</style>
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
<fy-scroll class="edge-scroll" @refresh="load">
|
||||
<wd-status-tip v-if="!rows.length" image="content" tip="暂无公告" />
|
||||
<view v-for="r in rows" :key="r.id" class="card item">
|
||||
<text class="t">{{ r.title }}</text>
|
||||
<view class="top">
|
||||
<text class="chip">公告</text>
|
||||
<text class="s">{{ r.createdAt || r.publishAt || '' }}</text>
|
||||
</view>
|
||||
<text class="t">{{ r.title }}</text>
|
||||
<text class="c">{{ r.content || r.summary || '' }}</text>
|
||||
</view>
|
||||
</fy-scroll>
|
||||
@@ -32,9 +35,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.item { margin: 16rpx 28rpx; padding: 28rpx; }
|
||||
.t { display: block; font-weight: 650; font-size: 30rpx; line-height: 1.45; }
|
||||
.s { display: block; font-size: 24rpx; color: #6B7280; margin-top: 10rpx; }
|
||||
.c { display: block; font-size: 28rpx; margin-top: 16rpx; color: #374151; line-height: 1.65; }
|
||||
.empty { padding: 120rpx 40rpx; text-align: center; color: #6B7280; font-size: 28rpx; }
|
||||
.item { margin: 16rpx 24rpx; padding: 28rpx 24rpx; }
|
||||
.top { display: flex; align-items: center; justify-content: space-between; }
|
||||
.s { font-size: 22rpx; color: #9CA3AF; }
|
||||
.t { display: block; margin-top: 16rpx; font-weight: 650; font-size: 30rpx; line-height: 1.45; color: #111827; }
|
||||
.c { display: block; font-size: 26rpx; margin-top: 12rpx; color: #4B5563; line-height: 1.65; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user