Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
app
/
sales-assist-mobile
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6d991c63
authored
Aug 03, 2026
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.0.0' of
http://192.168.3.233:8090/app/sales-assist-mobile
into v1.0.0
2 parents
41e38b7e
60f41332
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
590 additions
and
218 deletions
api/modules/orders.uts
api/modules/tasks.uts
components/EntryGrid.uvue
components/TabBar/tabbarShared.uts
pages.json
pages/common/orderEntry/components/ContractOrder.uvue
pages/common/orderEntry/components/RecentOrderEntry.uvue
pages/common/orderEntry/components/SalesOrder.uvue
pages/common/orderEntry/components/WorkOrder.uvue
pages/common/orderEntry/index.uvue
pages/reports/components/BrandReportPanel.uvue
pages/reports/components/ReportOverview.uvue
pages/reports/components/StoreReportPanel.uvue
pages/reports/reports.uvue
pages/reports/styles/common.scss
pages/reports/styles/index.vars.uts
pages/tasks/components/DailyReport.uvue
pages/tasks/components/DailyReportForm.uvue
pages/tasks/components/ReviewPanel.uvue
pages/tasks/components/StrategyPanel.uvue
pages/tasks/components/StudyPanel.uvue
pages/tasks/constants/dailyReportForm.uts
pages/tasks/styles/common.scss
pages/tasks/styles/index.vars.uts
pages/tasks/tasks.uvue
api/modules/orders.uts
View file @
6d991c6
import { request } from "@/api/modules/http/http.uts";
/**
*
* 订单列表查询(分页,pageSize=100)。可按门店/客户/状态筛选。
* GET /api/orders
*/
export function getOrdersList(params: UTSJSONObject = {} as UTSJSONObject): Promise<any> {
return request("/orders", params, "GET");
}
api/modules/tasks.uts
View file @
6d991c6
...
@@ -10,6 +10,14 @@ export function getDailyReportsList(params: UTSJSONObject = {} as UTSJSONObject)
...
@@ -10,6 +10,14 @@ export function getDailyReportsList(params: UTSJSONObject = {} as UTSJSONObject)
}
}
/**
/**
* 提交或更新日报(交车数、触客数、意向数、成交金额、备注等)。如当日已存在则更新。
* POST /api/daily-reports
*/
export function submitDailyReport(params: UTSJSONObject = {} as UTSJSONObject): Promise<any> {
return request("/daily-reports", params, "POST");
}
/**
* 查询学习任务列表,可按指派人、门店筛选
* 查询学习任务列表,可按指派人、门店筛选
* GET /api/learn-tasks
* GET /api/learn-tasks
*/
*/
...
...
components/EntryGrid.uvue
View file @
6d991c6
...
@@ -85,7 +85,7 @@ function onEntryClick(key: string): void {
...
@@ -85,7 +85,7 @@ function onEntryClick(key: string): void {
<style scoped lang="scss">
<style scoped lang="scss">
.module-entry-grid {
.module-entry-grid {
width: 100%;
width: 100%;
min-height:
40px
;
min-height:
var(--module-entry-grid-min-height, 48px)
;
height: 100%;
height: 100%;
background-color: var(--module-entry-grid-bg, #ffffff);
background-color: var(--module-entry-grid-bg, #ffffff);
border-radius: var(--module-entry-grid-radius, 8px);
border-radius: var(--module-entry-grid-radius, 8px);
...
@@ -95,7 +95,7 @@ function onEntryClick(key: string): void {
...
@@ -95,7 +95,7 @@ function onEntryClick(key: string): void {
.module-entry-grid__list {
.module-entry-grid__list {
width: 100%;
width: 100%;
min-height:
40px
;
min-height:
var(--module-entry-grid-list-min-height, var(--module-entry-grid-min-height, 48px))
;
height: 100%;
height: 100%;
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
...
@@ -108,8 +108,8 @@ function onEntryClick(key: string): void {
...
@@ -108,8 +108,8 @@ function onEntryClick(key: string): void {
.module-entry-grid__item {
.module-entry-grid__item {
flex: 1;
flex: 1;
min-height:
40px
;
min-height:
var(--module-entry-grid-item-min-height, 48px)
;
height:
40px
;
height:
var(--module-entry-grid-item-height, 48px)
;
flex-shrink: 1;
flex-shrink: 1;
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
...
@@ -129,14 +129,14 @@ function onEntryClick(key: string): void {
...
@@ -129,14 +129,14 @@ function onEntryClick(key: string): void {
}
}
.module-entry-grid__icon {
.module-entry-grid__icon {
width:
15px
;
width:
var(--module-entry-grid-icon-size, 20px)
;
height:
15px
;
height:
var(--module-entry-grid-icon-size, 20px)
;
margin-right:
4px
;
margin-right:
var(--module-entry-grid-icon-margin-right, 6px)
;
margin-bottom: 0px;
margin-bottom: 0px;
}
}
.module-entry-grid__label {
.module-entry-grid__label {
font-size:
13px
;
font-size:
var(--module-entry-grid-label-size, 15px)
;
color: var(--module-entry-grid-label-color, #202939);
color: var(--module-entry-grid-label-color, #202939);
font-weight: 400;
font-weight: 400;
}
}
...
...
components/TabBar/tabbarShared.uts
View file @
6d991c6
...
@@ -125,7 +125,8 @@ export function navigateToTab(index: number, currentTabIndex: number): void {
...
@@ -125,7 +125,8 @@ export function navigateToTab(index: number, currentTabIndex: number): void {
return;
return;
}
}
if (index == 2) {
if (index == 2) {
uni.navigateTo({ url: "/pages/common/orderEntry/index" });
// uni.navigateTo({ url: "/pages/common/orderEntry/index" });
switchTabPage("pages/common/orderEntry/index");
return;
return;
}
}
if (index == 3) {
if (index == 3) {
...
...
pages.json
View file @
6d991c6
...
@@ -190,6 +190,12 @@
...
@@ -190,6 +190,12 @@
"selectedIconPath"
:
"static/images/tabbar/home-active.png"
"selectedIconPath"
:
"static/images/tabbar/home-active.png"
},
},
{
{
"pagePath"
:
"pages/common/orderEntry/index"
,
"text"
:
"录单"
,
"iconPath"
:
"static/images/tabbar/home.png"
,
"selectedIconPath"
:
"static/images/tabbar/home-active.png"
},
{
"pagePath"
:
"pages/person/myCenter"
,
"pagePath"
:
"pages/person/myCenter"
,
"text"
:
"我的"
,
"text"
:
"我的"
,
"iconPath"
:
"static/images/tabbar/study.png"
,
"iconPath"
:
"static/images/tabbar/study.png"
,
...
...
pages/common/orderEntry/components/ContractOrder.uvue
View file @
6d991c6
...
@@ -64,9 +64,6 @@
...
@@ -64,9 +64,6 @@
</view>
</view>
<view class="submit-wrap">
<view class="submit-wrap">
<view class="submit-btn" @click="submitOrder">
<view class="submit-btn" @click="submitOrder">
<view class="check-icon-box">
<text class="check-icon-text">✓</text>
</view>
<text class="submit-btn-text">提交</text>
<text class="submit-btn-text">提交</text>
</view>
</view>
</view>
</view>
...
...
pages/common/orderEntry/components/RecentOrderEntry.uvue
View file @
6d991c6
...
@@ -27,12 +27,12 @@
...
@@ -27,12 +27,12 @@
<text class="date-month">{{ item.month }}</text>
<text class="date-month">{{ item.month }}</text>
</view>
</view>
<view class="recent-info">
<view class="recent-info">
<text class="info-name">{{ item.
n
ame }}</text>
<text class="info-name">{{ item.
customerN
ame }}</text>
<text class="info-desc">{{ item.
desc
}}</text>
<text class="info-desc">{{ item.
customerPhone
}}</text>
</view>
</view>
<view class="recent-amount">
<view class="recent-amount">
<text class="amount-text">{{ item.
a
mount }}</text>
<text class="amount-text">{{ item.
payA
mount }}</text>
<text class="status-text"
:class="item.statusClass">{{ item.status
}}</text>
<text class="status-text"
>{{ item.statusName
}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -41,96 +41,52 @@
...
@@ -41,96 +41,52 @@
<script setup lang="uts">
<script setup lang="uts">
import { ref, computed } from "vue";
import { ref, computed } from "vue";
import { getOrdersList } from "@/api/modules/orders.uts";
type RecentItem = {
type RecentItem = {
id: string;
orderNo: string;
storeId: number;
customerId: number;
customerName: string;
customerPhone: string;
staffId: string;
sceneId: number | null;
totalAmount: number;
discountAmount: number;
payAmount: number;
status: number;
statusName: string;
payType: number | null;
payTime: string | null;
remark: string | null;
createdAt: string;
items: any[];
day: string;
day: string;
month: string;
month: string;
name: string;
desc: string;
amount: string;
status: string;
statusClass: string;
};
};
const recentList = ref<RecentItem[]>([
const recentList = ref<RecentItem[]>([]);
{
day: "10",
month: "07/10",
name: "刘先生",
desc: "发动机延保3年 · 销售单",
amount: "¥3500",
status: "已完成",
statusClass: "status-done"
},
{
day: "15",
month: "07/15",
name: "黄先生",
desc: "4K行车记录仪 · 销售单",
amount: "¥999",
status: "已完成",
statusClass: "status-done"
},
{
day: "16",
month: "07/15",
name: "先生",
desc: "4K记录仪 · 销售单",
amount: "¥999",
status: "已完成",
statusClass: "status-done"
},
{
day: "17",
month: "07/17",
name: "张先生",
desc: "4K行车记录仪 · 销售单",
amount: "¥999",
status: "已完成",
statusClass: "status-done"
},
{
day: "18",
month: "07/18",
name: "李先生",
desc: "4K行车记录仪 · 销售单",
amount: "¥999",
status: "已完成",
statusClass: "status-done"
},
{
day: "19",
month: "07/19",
name: "王先生",
desc: "4K行车记录仪 · 销售单",
amount: "¥999",
status: "已完成",
statusClass: "status-done"
},
{
day: "20",
month: "07/20",
name: "张先生",
desc: "4K行车记录仪 · 销售单",
amount: "¥999",
status: "已完成",
statusClass: "status-done"
},
{
day: "21",
month: "07/21",
name: "张先生",
desc: "4K行车记录仪 · 销售单",
amount: "¥999",
status: "已完成",
statusClass: "status-done"
},
]);
function goAll(): void {
function goAll(): void {
uni.showToast({ title: "查看全部", icon: "none" });
uni.showToast({ title: "查看全部", icon: "none" });
}
}
function onRecentClick(item: RecentItem): void {
function onRecentClick(item: RecentItem): void {
uni.showToast({ title: `
${item.name} ${item.desc}
`, icon: "none" });
uni.showToast({ title: `
1
`, icon: "none" });
}
}
const getRecentList = async (): Promise<void> => {
try {
const data = await getOrdersList() as RecentItem[];
for (let i = 0; i < data.length; i++) {
data[i].day = data[i].createdAt.split("T")[0].split("-")[2];
data[i].month = data[i].createdAt.split("T")[0].split("-")[1] + "/" + data[i].day;
}
recentList.value = data;
} catch (error) {
console.error("获取最近录单列表失败:", error);
}
};
onMounted(() => {
getRecentList();
});
</script>
</script>
<style scoped lang="scss">
<style scoped lang="scss">
...
...
pages/common/orderEntry/components/SalesOrder.uvue
View file @
6d991c6
...
@@ -48,9 +48,6 @@
...
@@ -48,9 +48,6 @@
</view>
</view>
<view class="submit-wrap">
<view class="submit-wrap">
<view class="submit-btn" @click="submitOrder">
<view class="submit-btn" @click="submitOrder">
<view class="check-icon-box">
<text class="check-icon-text">✓</text>
</view>
<text class="submit-btn-text">提交</text>
<text class="submit-btn-text">提交</text>
</view>
</view>
</view>
</view>
...
...
pages/common/orderEntry/components/WorkOrder.uvue
View file @
6d991c6
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<text class="form-label">预约时间</text>
<text class="form-label">预约时间</text>
<view class="form-select" @click="openTimePicker">
<view class="form-select" @click="openTimePicker">
<text class="form-select-text" :class="{ placeholder: form.appointmentTime == '' }">
<text class="form-select-text" :class="{ placeholder: form.appointmentTime == '' }">
{{ form.appointmentTime == "" ? "
yyyy-mm日 --:--
" : form.appointmentTime }}
{{ form.appointmentTime == "" ? "
请选择预约时间
" : form.appointmentTime }}
</text>
</text>
<uni-icons type="calendar" size="14" color="#999999"></uni-icons>
<uni-icons type="calendar" size="14" color="#999999"></uni-icons>
</view>
</view>
...
@@ -56,9 +56,6 @@
...
@@ -56,9 +56,6 @@
</view>
</view>
<view class="submit-wrap">
<view class="submit-wrap">
<view class="submit-btn" @click="submitOrder">
<view class="submit-btn" @click="submitOrder">
<view class="check-icon-box">
<text class="check-icon-text">✓</text>
</view>
<text class="submit-btn-text">提交</text>
<text class="submit-btn-text">提交</text>
</view>
</view>
</view>
</view>
...
...
pages/common/orderEntry/index.uvue
View file @
6d991c6
<template>
<template>
<layout-root :page-vars="pageVars">
<!-- <layout-root :page-vars="pageVars"> -->
<view class="navbar-wrapper">
<TabBarShell ref="shellRef" :active-tab-index="1" :page-vars="pageVars as UTSJSONObject">
<app-navbar
<view class="navbar-wrapper">
:fixed="false"
<!-- <app-navbar
:placeholder="false"
:fixed="false"
title="录单"
:placeholder="false"
bg-color="#fff"
title="录单"
:border="false"
bg-color="#fff"
:auto-back="false"
:border="false"
:safe-area-inset-top="false"
:auto-back="false"
@leftClick="back"
:safe-area-inset-top="false"
/>
@leftClick="back"
</view>
/> -->
</view>
<view class="order-entry-container" :style="contentStyle">
<view class="order-entry-container" :style="contentStyle">
<view class="tab-box">
<view class="tab-box">
<view v-for="(tab, idx) in tabs" :key="idx" :class="['tab-item', tabActiveIndex == idx ? 'active-tab' : '']" @click="onTabChange(idx)">
<view
v-for="(tab, idx) in tabs"
:key="idx"
:class="['tab-item', tabActiveIndex == idx ? 'active-tab' : '']"
@click="onTabChange(idx)"
>
<un-icon
<un-icon
:label="tab.name"
:label="tab.name"
:name="tab.iconType"
:name="tab.iconType"
:class="['tab-icon', tabActiveIndex == idx ? 'active-icon' : '']"
:class="['tab-icon', tabActiveIndex == idx ? 'active-icon' : '']"
></un-icon>
></un-icon>
<text :class="tabActiveIndex == idx ? 'tab-text active' : 'tab-text'">
<text :class="tabActiveIndex == idx ? 'tab-text active' : 'tab-text'">
{{ tab.name }}
{{ tab.name }}
</text>
</text>
...
@@ -31,10 +36,13 @@
...
@@ -31,10 +36,13 @@
<RecentOrderEntry />
<RecentOrderEntry />
</scroll-view>
</scroll-view>
</view>
</view>
</layout-root>
</TabBarShell>
<!-- </layout-root> -->
</template>
</template>
<script setup lang="uts">
<script setup lang="uts">
import TabBarShell from "@/components/TabBar/TabBarShell.uvue";
import pageVars from "./styles/index.vars";
import pageVars from "./styles/index.vars";
import { ref, computed, getCurrentInstance, onMounted, nextTick, onResize } from "vue";
import { ref, computed, getCurrentInstance, onMounted, nextTick, onResize } from "vue";
import { calcWindowTopInsetPx } from "@/utils/safe-area.uts";
import { calcWindowTopInsetPx } from "@/utils/safe-area.uts";
...
@@ -54,20 +62,26 @@ const navbarHeight = ref(0);
...
@@ -54,20 +62,26 @@ const navbarHeight = ref(0);
const windowHeight = ref(uni.getSystemInfoSync().windowHeight);
const windowHeight = ref(uni.getSystemInfoSync().windowHeight);
const statusBarHeight = ref(0);
const statusBarHeight = ref(0);
const contentStyle = computed((): string => {
const contentStyle = computed((): string => {
return `height: ${windowHeight.value - navbarHeight.value - statusBarHeight.value}px`;
return `height: ${windowHeight.value - statusBarHeight.value}px`;
// return `height: ${windowHeight.value - navbarHeight.value - statusBarHeight.value}px`;
});
});
function measureNavbarHeight(): void {
function measureNavbarHeight(): void {
uni.createSelectorQuery().in(currentInstance!.proxy).select('.navbar-wrapper').boundingClientRect().exec((ret) => {
uni
if (ret.length > 0) {
.createSelectorQuery()
navbarHeight.value = (ret[0] as NodeInfo).height!;
.in(currentInstance!.proxy)
}
.select(".navbar-wrapper")
});
.boundingClientRect()
.exec((ret) => {
if (ret.length > 0) {
navbarHeight.value = (ret[0] as NodeInfo).height!;
}
});
}
}
onMounted(() => {
onMounted(() => {
statusBarHeight.value = calcWindowTopInsetPx(uni.getWindowInfo());
nextTick(() => {
nextTick(() => {
statusBarHeight.value = calcWindowTopInsetPx(uni.getWindowInfo());
measureNavbarHeight();
measureNavbarHeight();
});
});
});
});
...
...
pages/reports/components/BrandReportPanel.uvue
View file @
6d991c6
...
@@ -11,8 +11,6 @@
...
@@ -11,8 +11,6 @@
<text class="reports-metric-card__value"
<text class="reports-metric-card__value"
:class="item.valueClass">{{ item.value }}</text>
:class="item.valueClass">{{ item.value }}</text>
<text class="reports-metric-card__label">{{ item.label }}</text>
<text class="reports-metric-card__label">{{ item.label }}</text>
<text class="reports-metric-card__trend"
:class="item.trendClass">{{ item.trend }}</text>
</view>
</view>
</view>
</view>
...
...
pages/reports/components/ReportOverview.uvue
View file @
6d991c6
...
@@ -11,8 +11,6 @@
...
@@ -11,8 +11,6 @@
<text class="reports-metric-card__value"
<text class="reports-metric-card__value"
:class="item.valueClass">{{ item.value }}</text>
:class="item.valueClass">{{ item.value }}</text>
<text class="reports-metric-card__label">{{ item.label }}</text>
<text class="reports-metric-card__label">{{ item.label }}</text>
<text class="reports-metric-card__trend"
:class="item.trendClass">{{ item.trend }}</text>
</view>
</view>
</view>
</view>
...
...
pages/reports/components/StoreReportPanel.uvue
View file @
6d991c6
...
@@ -4,6 +4,16 @@
...
@@ -4,6 +4,16 @@
scroll-y="true"
scroll-y="true"
:show-scrollbar="false"
:show-scrollbar="false"
@scrolltolower="onScrollToLower">
@scrolltolower="onScrollToLower">
<view class="reports-metric-grid">
<view v-for="(item, index) in storeOverviewMetrics"
:key="index"
class="reports-metric-card">
<text class="reports-metric-card__value"
:class="item.valueClass">{{ item.value }}</text>
<text class="reports-metric-card__label">{{ item.label }}</text>
</view>
</view>
<view class="store-report-list">
<view class="store-report-list">
<view v-for="(item, index) in visibleStoreReports"
<view v-for="(item, index) in visibleStoreReports"
:key="index"
:key="index"
...
@@ -32,7 +42,7 @@
...
@@ -32,7 +42,7 @@
</template>
</template>
<script setup lang="uts">
<script setup lang="uts">
import { onMounted, ref } from "vue";
import {
computed,
onMounted, ref } from "vue";
import { STORE_REPORTS, STORE_REPORT_METRIC_CONFIGS, type StoreReport, type StoreReportMetricConfig } from "../constants/storeReportData.uts";
import { STORE_REPORTS, STORE_REPORT_METRIC_CONFIGS, type StoreReport, type StoreReportMetricConfig } from "../constants/storeReportData.uts";
...
@@ -46,6 +56,12 @@ type StoreMetricItem = {
...
@@ -46,6 +56,12 @@ type StoreMetricItem = {
valueClass: string
valueClass: string
}
}
type StoreOverviewMetric = {
label: string
value: string
valueClass: string
}
const allStoreReports: StoreReport[] = STORE_REPORTS;
const allStoreReports: StoreReport[] = STORE_REPORTS;
const visibleStoreReports = ref<StoreReport[]>([]);
const visibleStoreReports = ref<StoreReport[]>([]);
...
@@ -53,6 +69,48 @@ const loadedCount = ref<number>(0);
...
@@ -53,6 +69,48 @@ const loadedCount = ref<number>(0);
const hasMore = ref<boolean>(true);
const hasMore = ref<boolean>(true);
let lastScrollToLowerAt = 0;
let lastScrollToLowerAt = 0;
function parseMetricNumber(value: string): number {
const cleaned = value.replace(/[^\d.-]/g, "");
const parsed = parseFloat(cleaned);
if (isNaN(parsed)) return 0;
return parsed;
}
function formatRevenue(value: number): string {
return "¥" + `${Math.round(value)}`;
}
function getStoreAverageConversion(): number {
let total = 0;
let count = 0;
for (let i = 0; i < allStoreReports.length; i++) {
const item = allStoreReports[i] as StoreReport;
if (item.conversionRate != "-") {
total = total + parseMetricNumber(item.conversionRate);
count++;
}
}
if (count <= 0) return 0;
return Math.round(total / count);
}
const storeOverviewMetrics = computed((): StoreOverviewMetric[] => {
let revenueTotal = 0;
let orderTotal = 0;
for (let i = 0; i < allStoreReports.length; i++) {
const item = allStoreReports[i] as StoreReport;
revenueTotal = revenueTotal + parseMetricNumber(item.revenue);
orderTotal = orderTotal + parseMetricNumber(item.orders);
}
const conversion = getStoreAverageConversion();
return [
{ label: "总营收", value: formatRevenue(revenueTotal), valueClass: "reports-metric-card__value--blue" } as StoreOverviewMetric,
{ label: "总订单", value: `${Math.round(orderTotal)}单`, valueClass: "reports-metric-card__value--green" } as StoreOverviewMetric,
{ label: "门店数", value: `${allStoreReports.length}`, valueClass: "reports-metric-card__value--black" } as StoreOverviewMetric,
{ label: "平均转化", value: `${conversion}%`, valueClass: "reports-metric-card__value--red" } as StoreOverviewMetric
] as StoreOverviewMetric[];
});
function appendStoreReports(): void {
function appendStoreReports(): void {
if (!hasMore.value) return;
if (!hasMore.value) return;
const nextList = [] as StoreReport[];
const nextList = [] as StoreReport[];
...
...
pages/reports/reports.uvue
View file @
6d991c6
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
:key="index"
:key="index"
class="reports-entry-overview__stat">
class="reports-entry-overview__stat">
<text class="reports-entry-overview__label">{{ item.label }}</text>
<text class="reports-entry-overview__label">{{ item.label }}</text>
<text class="reports-entry-overview__value">{{ item.value }}</text>
<text class="reports-entry-overview__value"
:class="item.valueClass">{{ item.value }}</text>
</view>
</view>
</view>
</view>
<view class="reports-entry-overview__progress">
<view class="reports-entry-overview__progress">
...
@@ -65,6 +66,7 @@ const activeEntryKey = ref<ReportEntryKey>("personal");
...
@@ -65,6 +66,7 @@ const activeEntryKey = ref<ReportEntryKey>("personal");
type ReportOverviewItem = {
type ReportOverviewItem = {
label: string
label: string
value: string
value: string
valueClass: string
}
}
type ReportEntryOverview = {
type ReportEntryOverview = {
...
@@ -160,10 +162,10 @@ function createPersonalOverview(): ReportEntryOverview {
...
@@ -160,10 +162,10 @@ function createPersonalOverview(): ReportEntryOverview {
const progress = parseMetricNumber(conversion);
const progress = parseMetricNumber(conversion);
return {
return {
items: [
items: [
{ label: "销售额", value: revenue } as ReportOverviewItem,
{ label: "销售额", value: revenue
, valueClass: "reports-metric-card__value--blue"
} as ReportOverviewItem,
{ label: "订单", value: orders } as ReportOverviewItem,
{ label: "订单", value: orders
, valueClass: "reports-metric-card__value--green"
} as ReportOverviewItem,
{ label: "质检分", value: score } as ReportOverviewItem,
{ label: "质检分", value: score
, valueClass: "reports-metric-card__value--orange"
} as ReportOverviewItem,
{ label: "转化率", value: conversion } as ReportOverviewItem
{ label: "转化率", value: conversion
, valueClass: "reports-metric-card__value--red"
} as ReportOverviewItem
] as ReportOverviewItem[],
] as ReportOverviewItem[],
progress: progress,
progress: progress,
desc: `个人转化率 ${conversion},本月订单 ${orders}`
desc: `个人转化率 ${conversion},本月订单 ${orders}`
...
@@ -177,10 +179,10 @@ function createStoreOverview(): ReportEntryOverview {
...
@@ -177,10 +179,10 @@ function createStoreOverview(): ReportEntryOverview {
const conversion = `${progress}%`;
const conversion = `${progress}%`;
return {
return {
items: [
items: [
{ label: "门店数", value: `${STORE_REPORTS.length}` } as ReportOverviewItem,
{ label: "门店数", value: `${STORE_REPORTS.length}`
, valueClass: "reports-metric-card__value--black"
} as ReportOverviewItem,
{ label: "总营收", value: revenue } as ReportOverviewItem,
{ label: "总营收", value: revenue
, valueClass: "reports-metric-card__value--blue"
} as ReportOverviewItem,
{ label: "总订单", value: orders } as ReportOverviewItem,
{ label: "总订单", value: orders
, valueClass: "reports-metric-card__value--green"
} as ReportOverviewItem,
{ label: "平均转化", value: conversion } as ReportOverviewItem
{ label: "平均转化", value: conversion
, valueClass: "reports-metric-card__value--red"
} as ReportOverviewItem
] as ReportOverviewItem[],
] as ReportOverviewItem[],
progress: progress,
progress: progress,
desc: `汇总 ${STORE_REPORTS.length} 家门店,平均转化率 ${conversion}`
desc: `汇总 ${STORE_REPORTS.length} 家门店,平均转化率 ${conversion}`
...
@@ -195,10 +197,10 @@ function createBrandOverview(): ReportEntryOverview {
...
@@ -195,10 +197,10 @@ function createBrandOverview(): ReportEntryOverview {
const progress = parseMetricNumber(conversion);
const progress = parseMetricNumber(conversion);
return {
return {
items: [
items: [
{ label: "品牌营收", value: revenue } as ReportOverviewItem,
{ label: "品牌营收", value: revenue
, valueClass: "reports-metric-card__value--blue"
} as ReportOverviewItem,
{ label: "订单", value: orders } as ReportOverviewItem,
{ label: "订单", value: orders
, valueClass: "reports-metric-card__value--green"
} as ReportOverviewItem,
{ label: "转化率", value: conversion } as ReportOverviewItem,
{ label: "转化率", value: conversion
, valueClass: "reports-metric-card__value--red"
} as ReportOverviewItem,
{ label: "展业门店", value: stores } as ReportOverviewItem
{ label: "展业门店", value: stores
, valueClass: "reports-metric-card__value--black"
} as ReportOverviewItem
] as ReportOverviewItem[],
] as ReportOverviewItem[],
progress: progress,
progress: progress,
desc: `品牌转化率 ${conversion},展业门店 ${stores}`
desc: `品牌转化率 ${conversion},展业门店 ${stores}`
...
@@ -213,10 +215,10 @@ function createSummaryOverview(): ReportEntryOverview {
...
@@ -213,10 +215,10 @@ function createSummaryOverview(): ReportEntryOverview {
const progress = parseMetricNumber(score);
const progress = parseMetricNumber(score);
return {
return {
items: [
items: [
{ label: "总营收", value: revenue } as ReportOverviewItem,
{ label: "总营收", value: revenue
, valueClass: "reports-metric-card__value--blue"
} as ReportOverviewItem,
{ label: "总订单", value: orders } as ReportOverviewItem,
{ label: "总订单", value: orders
, valueClass: "reports-metric-card__value--green"
} as ReportOverviewItem,
{ label: "销售", value: sales } as ReportOverviewItem,
{ label: "销售", value: sales
, valueClass: "reports-metric-card__value--black"
} as ReportOverviewItem,
{ label: "质检分", value: score } as ReportOverviewItem
{ label: "质检分", value: score
, valueClass: "reports-metric-card__value--black"
} as ReportOverviewItem
] as ReportOverviewItem[],
] as ReportOverviewItem[],
progress: progress,
progress: progress,
desc: `汇总 ${SUMMARY_STORES.length} 家门店,平均质检分 ${score}`
desc: `汇总 ${SUMMARY_STORES.length} 家门店,平均质检分 ${score}`
...
...
pages/reports/styles/common.scss
View file @
6d991c6
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
}
}
.reports-metric-grid
{
.reports-metric-grid
{
display
:
flex
;
display
:
var
(
--
reports-metric-grid-display
,
flex
)
;
flex-direction
:
row
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
justify-content
:
space-between
;
...
@@ -185,12 +185,12 @@
...
@@ -185,12 +185,12 @@
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
margin-bottom
:
8px
;
margin-bottom
:
var
(
--
reports-metric-card-gap
,
8px
)
;
}
}
.reports-metric-card__value
{
.reports-metric-card__value
{
font-size
:
27px
;
font-size
:
var
(
--
reports-metric-value-size
,
27px
)
;
line-height
:
30px
;
line-height
:
var
(
--
reports-metric-value-line-height
,
30px
)
;
font-weight
:
700
;
font-weight
:
700
;
}
}
...
@@ -215,14 +215,14 @@
...
@@ -215,14 +215,14 @@
}
}
.reports-metric-card__label
{
.reports-metric-card__label
{
margin-top
:
4px
;
margin-top
:
var
(
--
reports-metric-label-margin-top
,
4px
)
;
font-size
:
13px
;
font-size
:
var
(
--
reports-metric-label-size
,
13px
)
;
color
:
var
(
--
reports-text-secondary
,
#8b97aa
);
color
:
var
(
--
reports-text-secondary
,
#8b97aa
);
}
}
.reports-metric-card__trend
{
.reports-metric-card__trend
{
margin-top
:
3px
;
margin-top
:
var
(
--
reports-metric-trend-margin-top
,
3px
)
;
font-size
:
12px
;
font-size
:
var
(
--
reports-metric-trend-size
,
12px
)
;
font-weight
:
600
;
font-weight
:
600
;
}
}
...
...
pages/reports/styles/index.vars.uts
View file @
6d991c6
...
@@ -13,12 +13,19 @@ export default {
...
@@ -13,12 +13,19 @@ export default {
"--reports-layout-padding": "10px 0 0",
"--reports-layout-padding": "10px 0 0",
"--reports-entry-flex": "0 0 auto",
"--reports-entry-flex": "0 0 auto",
"--reports-entry-width": "100%",
"--reports-entry-width": "100%",
"--reports-entry-height": "
38
px",
"--reports-entry-height": "
50
px",
"--reports-entry-min-height": "
38
px",
"--reports-entry-min-height": "
50
px",
"--reports-entry-margin-right": "0px",
"--reports-entry-margin-right": "0px",
"--reports-entry-margin-bottom": "12px",
"--reports-entry-margin-bottom": "12px",
"--reports-entry-grid-wrap-height": "
38
px",
"--reports-entry-grid-wrap-height": "
50
px",
"--reports-entry-grid-wrap-margin-top": "0px",
"--reports-entry-grid-wrap-margin-top": "0px",
"--module-entry-grid-min-height": "50px",
"--module-entry-grid-list-min-height": "50px",
"--module-entry-grid-item-min-height": "50px",
"--module-entry-grid-item-height": "50px",
"--module-entry-grid-icon-size": "22px",
"--module-entry-grid-icon-margin-right": "7px",
"--module-entry-grid-label-size": "15px",
"--reports-entry-overview-display": "none",
"--reports-entry-overview-display": "none",
"--reports-entry-overview-margin": "0px",
"--reports-entry-overview-margin": "0px",
"--reports-entry-overview-padding": "0px",
"--reports-entry-overview-padding": "0px",
...
@@ -28,9 +35,17 @@ export default {
...
@@ -28,9 +35,17 @@ export default {
"--reports-content-border": "0px solid transparent",
"--reports-content-border": "0px solid transparent",
"--reports-content-radius": "0px",
"--reports-content-radius": "0px",
"--reports-content-padding": "0px",
"--reports-content-padding": "0px",
"--reports-metric-card-width": "48.8%",
"--reports-metric-grid-display": "flex",
"--reports-metric-card-height": "94px",
"--reports-metric-card-width": "24%",
"--reports-metric-card-margin-bottom": "8px",
"--reports-metric-card-height": "54px",
"--reports-metric-card-margin-bottom": "5px",
"--reports-metric-card-gap": "5px",
"--reports-metric-value-size": "16px",
"--reports-metric-value-line-height": "18px",
"--reports-metric-label-margin-top": "1px",
"--reports-metric-label-size": "10px",
"--reports-metric-trend-margin-top": "1px",
"--reports-metric-trend-size": "11px",
"--reports-chart-height": "184px",
"--reports-chart-height": "184px",
"--reports-chart-bar-width": "40px",
"--reports-chart-bar-width": "40px",
"--reports-chart-gap": "8px",
"--reports-chart-gap": "8px",
...
@@ -69,9 +84,17 @@ export default {
...
@@ -69,9 +84,17 @@ export default {
"--reports-content-border": "1px solid #e6edf8",
"--reports-content-border": "1px solid #e6edf8",
"--reports-content-radius": "16px",
"--reports-content-radius": "16px",
"--reports-content-padding": "16px",
"--reports-content-padding": "16px",
"--reports-metric-grid-display": "none",
"--reports-metric-card-width": "23.5%",
"--reports-metric-card-width": "23.5%",
"--reports-metric-card-height": "108px",
"--reports-metric-card-height": "86px",
"--reports-metric-card-margin-bottom": "16px",
"--reports-metric-card-margin-bottom": "12px",
"--reports-metric-card-gap": "8px",
"--reports-metric-value-size": "24px",
"--reports-metric-value-line-height": "28px",
"--reports-metric-label-margin-top": "3px",
"--reports-metric-label-size": "12px",
"--reports-metric-trend-margin-top": "2px",
"--reports-metric-trend-size": "11px",
"--reports-chart-height": "220px",
"--reports-chart-height": "220px",
"--reports-chart-bar-width": "54px",
"--reports-chart-bar-width": "54px",
"--reports-chart-gap": "18px",
"--reports-chart-gap": "18px",
...
@@ -97,7 +120,7 @@ export default {
...
@@ -97,7 +120,7 @@ export default {
"--reports-entry-grid-wrap-margin-top": "10px",
"--reports-entry-grid-wrap-margin-top": "10px",
"--reports-entry-overview-margin": "10px 10px 0",
"--reports-entry-overview-margin": "10px 10px 0",
"--reports-entry-overview-padding": "10px",
"--reports-entry-overview-padding": "10px",
"--reports-metric-card-height": "
92
px",
"--reports-metric-card-height": "
78
px",
"--reports-chart-height": "176px",
"--reports-chart-height": "176px",
"--reports-chart-bar-width": "42px",
"--reports-chart-bar-width": "42px",
"--reports-chart-gap": "12px",
"--reports-chart-gap": "12px",
...
...
pages/tasks/components/DailyReport.uvue
View file @
6d991c6
...
@@ -4,6 +4,16 @@
...
@@ -4,6 +4,16 @@
@back="onBackToList" />
@back="onBackToList" />
<view v-else
<view v-else
class="daily-list-module">
class="daily-list-module">
<view class="tasks-summary-grid">
<view v-for="(item, index) in dailySummaryItems"
:key="index"
class="tasks-summary-card">
<text class="tasks-summary-card__value"
:class="item.valueClass">{{ item.value }}</text>
<text class="tasks-summary-card__label">{{ item.label }}</text>
</view>
</view>
<view class="daily-list-toolbar">
<view class="daily-list-toolbar">
<view class="daily-list-toolbar__text">
<view class="daily-list-toolbar__text">
<text class="daily-list-toolbar__title">日报记录</text>
<text class="daily-list-toolbar__title">日报记录</text>
...
@@ -70,7 +80,7 @@
...
@@ -70,7 +80,7 @@
</template>
</template>
<script setup lang="uts">
<script setup lang="uts">
import { onMounted, ref } from "vue";
import {
computed,
onMounted, ref } from "vue";
import { getDailyReportsList } from "@/api/modules/tasks.uts";
import { getDailyReportsList } from "@/api/modules/tasks.uts";
import DailyReportForm from "./DailyReportForm.uvue";
import DailyReportForm from "./DailyReportForm.uvue";
...
@@ -91,6 +101,12 @@ type DailyReportItem = {
...
@@ -91,6 +101,12 @@ type DailyReportItem = {
stats: DailyReportStat[]
stats: DailyReportStat[]
}
}
type TaskSummaryCardItem = {
label: string
value: string
valueClass: string
}
type DailyReportsResponse = {
type DailyReportsResponse = {
data: UTSJSONObject[]
data: UTSJSONObject[]
}
}
...
@@ -105,6 +121,39 @@ const hasMore = ref<boolean>(true);
...
@@ -105,6 +121,39 @@ const hasMore = ref<boolean>(true);
const showCreateForm = ref<boolean>(false);
const showCreateForm = ref<boolean>(false);
let lastScrollToLowerAt = 0;
let lastScrollToLowerAt = 0;
function parseNumberText(value: string): number {
const cleaned = value.replace(/[^\d.-]/g, "");
const parsed = parseFloat(cleaned);
if (isNaN(parsed)) return 0;
return parsed;
}
function formatSummaryAmount(value: number): string {
return "¥" + `${Math.round(value)}`;
}
const dailySummaryItems = computed((): TaskSummaryCardItem[] => {
let carsTotal = 0;
let contactsTotal = 0;
let leadsTotal = 0;
let revenueTotal = 0;
for (let i = 0; i < reports.value.length; i++) {
const item = reports.value[i] as DailyReportItem;
if (item.stats.length >= 4) {
carsTotal = carsTotal + parseNumberText(item.stats[0].value);
contactsTotal = contactsTotal + parseNumberText(item.stats[1].value);
leadsTotal = leadsTotal + parseNumberText(item.stats[2].value);
revenueTotal = revenueTotal + parseNumberText(item.stats[3].value);
}
}
return [
{ label: "交车", value: `${Math.round(carsTotal)}`, valueClass: "tasks-summary-card__value--blue" } as TaskSummaryCardItem,
{ label: "触客", value: `${Math.round(contactsTotal)}`, valueClass: "tasks-summary-card__value--green" } as TaskSummaryCardItem,
{ label: "线索", value: `${Math.round(leadsTotal)}`, valueClass: "tasks-summary-card__value--orange" } as TaskSummaryCardItem,
{ label: "营收", value: formatSummaryAmount(revenueTotal), valueClass: "tasks-summary-card__value--black" } as TaskSummaryCardItem
] as TaskSummaryCardItem[];
});
function readValue(data: UTSJSONObject, key: string, fallback: string = ""): string {
function readValue(data: UTSJSONObject, key: string, fallback: string = ""): string {
const value = data[key];
const value = data[key];
return value != null && `${value}` != "" ? `${value}` : fallback;
return value != null && `${value}` != "" ? `${value}` : fallback;
...
...
pages/tasks/components/DailyReportForm.uvue
View file @
6d991c6
<template>
<template>
<view class="daily-report-module">
<view class="daily-report-module">
<view class="daily-form-toolbar">
<view class="daily-form-toolbar">
<view class="daily-form-back"
<view class="daily-form-back" @click="onBackClick">
@click="onBackClick">
<text class="daily-form-back__icon">‹</text>
<text class="daily-form-back__icon">‹</text>
<text class="daily-form-back__text">返回列表</text>
<text class="daily-form-back__text">返回列表</text>
</view>
</view>
</view>
</view>
<view class="daily-form">
<view class="daily-form">
<view class="daily-form__title-row">
<view class="daily-form__title-row">
<image
<image class="daily-form__title-icon"
class="daily-form__title-icon"
mode="aspectFit"
mode="aspectFit"
src="/static/images/tabbar/record-active.png" />
src="/static/images/tabbar/record-active.png"
<text class="daily-form__title">日报</text>
/>
</view>
<text class="daily-form__title">日报</text>
</view>
<CustomForm
:items="dailyReportFormItems"
<CustomForm
submit-text="提交日报"
:items="dailyReportFormItems"
@submit="onSubmitDailyReport">
submit-text="提交日报"
</CustomForm>
@submit="onSubmitDailyReport"
</view>
></CustomForm>
</view>
</view>
</view>
</template>
</template>
<script setup lang="uts">
<script setup lang="uts">
import CustomForm from "@/components/CustomForm.uvue";
import CustomForm from "@/components/CustomForm.uvue";
import { submitDailyReport } from "@/api/modules/tasks.uts";
import { formatDateOnly } from "@/utils/format-utils.uts";
import { DAILY_REPORT_FORM_ITEMS } from "../constants/dailyReportForm.uts";
import { DAILY_REPORT_FORM_ITEMS } from "../constants/dailyReportForm.uts";
import { storage } from "@/utils/storage.uts";
import { toStr } from "@/utils/common.uts";
const dailyReportFormItems = DAILY_REPORT_FORM_ITEMS;
const dailyReportFormItems = DAILY_REPORT_FORM_ITEMS;
const emit = defineEmits<{
const emit = defineEmits<{
back: []
back: [];
}>();
}>();
function onSubmitDailyReport(data: UTSJSONObject): void {
function onSubmitDailyReport(data: UTSJSONObject): void {
console.log("[DailyReportForm] submit", data);
const storeInfo = storage.parse("storeInfo");
uni.showToast({ title: "提交成功", icon: "success" });
const storeId = toStr(storeInfo["storeId"]);
const params = {
...data,
date: formatDateOnly(Date.now()),
storeId: storeId
} as UTSJSONObject;
console.log("[DailyReportForm] submit params", params);
submitDailyReport(params)
.then((res) => {
console.log("[DailyReportForm] submit success", res);
uni.showToast({ title: "提交成功", icon: "success" });
emit("back");
})
.catch((error) => {
console.error("[DailyReportForm] submit error", error);
uni.showToast({ title: "提交失败,请重试", icon: "error" });
});
}
}
function onBackClick(): void {
function onBackClick(): void {
emit("back");
emit("back");
}
}
</script>
</script>
...
...
pages/tasks/components/ReviewPanel.uvue
View file @
6d991c6
<template>
<template>
<view class="review-module">
<view class="review-module">
<view class="tasks-summary-grid">
<view v-for="(item, index) in reviewSummaryItems"
:key="index"
class="tasks-summary-card">
<text class="tasks-summary-card__value"
:class="item.valueClass">{{ item.value }}</text>
<text class="tasks-summary-card__label">{{ item.label }}</text>
</view>
</view>
<view class="review-panel">
<view class="review-panel">
<view class="review-tabs">
<view class="review-tabs">
<view v-for="(tab, index) in reviewTabs"
<view v-for="(tab, index) in reviewTabs"
...
@@ -80,6 +90,12 @@ import { PENDING_REVIEW_ITEMS, REVIEW_TABS, REVIEWED_ITEMS, type ReviewItem, typ
...
@@ -80,6 +90,12 @@ import { PENDING_REVIEW_ITEMS, REVIEW_TABS, REVIEWED_ITEMS, type ReviewItem, typ
type ReviewAction = "pass" | "reject";
type ReviewAction = "pass" | "reject";
type TaskSummaryCardItem = {
label: string
value: string
valueClass: string
}
const reviewTabs = REVIEW_TABS;
const reviewTabs = REVIEW_TABS;
const activeTabKey = ref<ReviewTabKey>("pending");
const activeTabKey = ref<ReviewTabKey>("pending");
const confirmVisible = ref<boolean>(false);
const confirmVisible = ref<boolean>(false);
...
@@ -87,6 +103,33 @@ const confirmAction = ref<ReviewAction>("pass");
...
@@ -87,6 +103,33 @@ const confirmAction = ref<ReviewAction>("pass");
const confirmActionText = ref<string>("通过");
const confirmActionText = ref<string>("通过");
const confirmItemTitle = ref<string>("");
const confirmItemTitle = ref<string>("");
function countReviewedByStatus(status: ReviewStatus): number {
let count = 0;
for (let i = 0; i < REVIEWED_ITEMS.length; i++) {
const item = REVIEWED_ITEMS[i] as ReviewItem;
if (item.status == status) {
count++;
}
}
return count;
}
function getPercent(part: number, total: number): number {
if (total <= 0) return 0;
return Math.round(part * 100 / total);
}
const passedCount = countReviewedByStatus("passed");
const rejectedCount = countReviewedByStatus("rejected");
const reviewPassRate = getPercent(passedCount, REVIEWED_ITEMS.length);
const reviewSummaryItems: TaskSummaryCardItem[] = [
{ label: "待审核", value: `${PENDING_REVIEW_ITEMS.length}`, valueClass: "tasks-summary-card__value--blue" } as TaskSummaryCardItem,
{ label: "已通过", value: `${passedCount}`, valueClass: "tasks-summary-card__value--green" } as TaskSummaryCardItem,
{ label: "已驳回", value: `${rejectedCount}`, valueClass: "tasks-summary-card__value--red" } as TaskSummaryCardItem,
{ label: "通过率", value: `${reviewPassRate}%`, valueClass: "tasks-summary-card__value--black" } as TaskSummaryCardItem
] as TaskSummaryCardItem[];
const reviewItems = computed((): ReviewItem[] => {
const reviewItems = computed((): ReviewItem[] => {
if (activeTabKey.value == "reviewed") return REVIEWED_ITEMS;
if (activeTabKey.value == "reviewed") return REVIEWED_ITEMS;
return PENDING_REVIEW_ITEMS;
return PENDING_REVIEW_ITEMS;
...
...
pages/tasks/components/StrategyPanel.uvue
View file @
6d991c6
<template>
<template>
<view class="strategy-module">
<view class="strategy-module">
<view class="tasks-summary-grid">
<view v-for="(item, index) in strategySummaryItems"
:key="index"
class="tasks-summary-card">
<text class="tasks-summary-card__value"
:class="item.valueClass">{{ item.value }}</text>
<text class="tasks-summary-card__label">{{ item.label }}</text>
</view>
</view>
<view class="strategy-panel">
<view class="strategy-panel">
<scroll-view
<scroll-view
class="strategy-scroll"
class="strategy-scroll"
...
@@ -37,10 +47,44 @@
...
@@ -37,10 +47,44 @@
</template>
</template>
<script setup lang="uts">
<script setup lang="uts">
import { STRATEGY_ITEMS } from "../constants/strategyData.uts";
import { STRATEGY_ITEMS, type StrategyItem } from "../constants/strategyData.uts";
type TaskSummaryCardItem = {
label: string
value: string
valueClass: string
}
const strategies = STRATEGY_ITEMS;
const strategies = STRATEGY_ITEMS;
function countStrategyByStatus(statusText: string): number {
let count = 0;
for (let i = 0; i < strategies.length; i++) {
const item = strategies[i] as StrategyItem;
if (item.statusText == statusText) {
count++;
}
}
return count;
}
function getPercent(part: number, total: number): number {
if (total <= 0) return 0;
return Math.round(part * 100 / total);
}
const activeCount = countStrategyByStatus("进行中");
const pendingCount = countStrategyByStatus("待开始");
const doneCount = countStrategyByStatus("已完成");
const strategyProgress = getPercent(doneCount, strategies.length);
const strategySummaryItems: TaskSummaryCardItem[] = [
{ label: "进行中", value: `${activeCount}`, valueClass: "tasks-summary-card__value--blue" } as TaskSummaryCardItem,
{ label: "待开始", value: `${pendingCount}`, valueClass: "tasks-summary-card__value--orange" } as TaskSummaryCardItem,
{ label: "已完成", value: `${doneCount}`, valueClass: "tasks-summary-card__value--green" } as TaskSummaryCardItem,
{ label: "完成率", value: `${strategyProgress}%`, valueClass: "tasks-summary-card__value--black" } as TaskSummaryCardItem
] as TaskSummaryCardItem[];
function onStrategyClick(index: number): void {
function onStrategyClick(index: number): void {
uni.navigateTo({
uni.navigateTo({
url: "/pages/tasks/strategyDetail?index=" + `${index}`
url: "/pages/tasks/strategyDetail?index=" + `${index}`
...
...
pages/tasks/components/StudyPanel.uvue
View file @
6d991c6
<template>
<template>
<view class="study-module">
<view class="study-module">
<view class="tasks-summary-grid">
<view v-for="(item, index) in studySummaryItems"
:key="index"
class="tasks-summary-card">
<text class="tasks-summary-card__value"
:class="item.valueClass">{{ item.value }}</text>
<text class="tasks-summary-card__label">{{ item.label }}</text>
</view>
</view>
<view class="study-course-panel">
<view class="study-course-panel">
<scroll-view
<scroll-view
class="study-course-scroll"
class="study-course-scroll"
...
@@ -54,7 +64,7 @@
...
@@ -54,7 +64,7 @@
</template>
</template>
<script setup lang="uts">
<script setup lang="uts">
import { onMounted, ref } from "vue";
import {
computed,
onMounted, ref } from "vue";
import { getLearnTasksList } from "@/api/modules/tasks.uts";
import { getLearnTasksList } from "@/api/modules/tasks.uts";
...
@@ -65,6 +75,12 @@ type StudyCourse = {
...
@@ -65,6 +75,12 @@ type StudyCourse = {
statusText: string
statusText: string
}
}
type TaskSummaryCardItem = {
label: string
value: string
valueClass: string
}
const DEFAULT_PAGE_NUM = 1;
const DEFAULT_PAGE_NUM = 1;
const SCROLL_LOWER_INTERVAL_MS = 500;
const SCROLL_LOWER_INTERVAL_MS = 500;
...
@@ -74,6 +90,39 @@ const loading = ref<boolean>(false);
...
@@ -74,6 +90,39 @@ const loading = ref<boolean>(false);
const hasMore = ref<boolean>(true);
const hasMore = ref<boolean>(true);
let lastScrollToLowerAt = 0;
let lastScrollToLowerAt = 0;
function isDoneStatus(statusText: string): boolean {
return statusText.indexOf("瀹屾垚") >= 0 || statusText.indexOf("完成") >= 0;
}
function isLearningStatus(statusText: string): boolean {
return statusText.indexOf("瀛︿範") >= 0 || statusText.indexOf("学习") >= 0;
}
const studySummaryItems = computed((): TaskSummaryCardItem[] => {
let learningCount = 0;
let doneCount = 0;
let pendingCount = 0;
let progressTotal = 0;
for (let i = 0; i < courses.value.length; i++) {
const item = courses.value[i] as StudyCourse;
progressTotal = progressTotal + item.progress;
if (isDoneStatus(item.statusText)) {
doneCount++;
} else if (isLearningStatus(item.statusText)) {
learningCount++;
} else {
pendingCount++;
}
}
const averageProgress = courses.value.length > 0 ? Math.round(progressTotal / courses.value.length) : 0;
return [
{ label: "学习中", value: `${learningCount}`, valueClass: "tasks-summary-card__value--blue" } as TaskSummaryCardItem,
{ label: "已完成", value: `${doneCount}`, valueClass: "tasks-summary-card__value--green" } as TaskSummaryCardItem,
{ label: "待开始", value: `${pendingCount}`, valueClass: "tasks-summary-card__value--orange" } as TaskSummaryCardItem,
{ label: "进度", value: `${averageProgress}%`, valueClass: "tasks-summary-card__value--black" } as TaskSummaryCardItem
] as TaskSummaryCardItem[];
});
function toProgress(value: any | null): number {
function toProgress(value: any | null): number {
if (value == null) return 0;
if (value == null) return 0;
const raw = parseFloat(`${value}`);
const raw = parseFloat(`${value}`);
...
...
pages/tasks/constants/dailyReportForm.uts
View file @
6d991c6
...
@@ -11,7 +11,7 @@ export const DAILY_REPORT_FORM_ITEMS: CustomFormItem[] = [
...
@@ -11,7 +11,7 @@ export const DAILY_REPORT_FORM_ITEMS: CustomFormItem[] = [
message: "请输入交车数"
message: "请输入交车数"
},
},
{
{
key: "c
ustomerTouch
Count",
key: "c
ontact
Count",
label: "触客数",
label: "触客数",
type: "input",
type: "input",
inputType: "number",
inputType: "number",
...
@@ -19,6 +19,24 @@ export const DAILY_REPORT_FORM_ITEMS: CustomFormItem[] = [
...
@@ -19,6 +19,24 @@ export const DAILY_REPORT_FORM_ITEMS: CustomFormItem[] = [
required: true,
required: true,
message: "请输入触客数"
message: "请输入触客数"
},
},
{
key: "intentionCount",
label: "意向客户数",
type: "input",
inputType: "number",
placeholder: "0",
required: true,
message: "请输入意向客户数"
},
{
key: "dealAmount",
label: "成交金额",
type: "input",
inputType: "number",
placeholder: "0",
required: true,
message: "请输入成交金额"
},
// {
// {
// key: "customerLevel",
// key: "customerLevel",
// label: "客户级别",
// label: "客户级别",
...
...
pages/tasks/styles/common.scss
View file @
6d991c6
...
@@ -152,6 +152,65 @@
...
@@ -152,6 +152,65 @@
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.tasks-summary-grid
{
display
:
var
(
--
tasks-summary-grid-display
,
flex
);
flex-direction
:
row
;
flex-wrap
:
nowrap
;
justify-content
:
space-between
;
margin-bottom
:
var
(
--
tasks-summary-grid-margin-bottom
,
8px
);
flex-shrink
:
0
;
}
.tasks-summary-card
{
width
:
var
(
--
tasks-summary-card-width
,
24%
);
height
:
var
(
--
tasks-summary-card-height
,
54px
);
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
background-color
:
#ffffff
;
border-radius
:
8px
;
box-sizing
:
border-box
;
}
.tasks-summary-card__value
{
font-size
:
var
(
--
tasks-summary-value-size
,
16px
);
line-height
:
var
(
--
tasks-summary-value-line-height
,
18px
);
font-weight
:
700
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.tasks-summary-card__value--blue
{
color
:
var
(
--
tasks-primary
,
#2f6af7
);
}
.tasks-summary-card__value--green
{
color
:
#16a34a
;
}
.tasks-summary-card__value--orange
{
color
:
#ff9f1c
;
}
.tasks-summary-card__value--red
{
color
:
#ef3e52
;
}
.tasks-summary-card__value--black
{
color
:
#111827
;
}
.tasks-summary-card__label
{
margin-top
:
1px
;
font-size
:
var
(
--
tasks-summary-label-size
,
10px
);
color
:
#8b97aa
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
.task-card
{
.task-card
{
width
:
100%
;
width
:
100%
;
background-color
:
var
(
--
tasks-bg-card
,
#ffffff
);
background-color
:
var
(
--
tasks-bg-card
,
#ffffff
);
...
...
pages/tasks/styles/index.vars.uts
View file @
6d991c6
...
@@ -20,18 +20,32 @@ export default {
...
@@ -20,18 +20,32 @@ export default {
"--tasks-content-padding": "0px",
"--tasks-content-padding": "0px",
"--tasks-entry-panel-flex": "0 0 auto",
"--tasks-entry-panel-flex": "0 0 auto",
"--tasks-entry-panel-width": "100%",
"--tasks-entry-panel-width": "100%",
"--tasks-entry-panel-height": "
4
0px",
"--tasks-entry-panel-height": "
5
0px",
"--tasks-entry-panel-min-height": "
4
0px",
"--tasks-entry-panel-min-height": "
5
0px",
"--tasks-entry-panel-margin-right": "0px",
"--tasks-entry-panel-margin-right": "0px",
"--tasks-entry-panel-margin-bottom": "12px",
"--tasks-entry-panel-margin-bottom": "12px",
"--tasks-entry-grid-wrap-height": "
4
0px",
"--tasks-entry-grid-wrap-height": "
5
0px",
"--tasks-entry-grid-wrap-margin-top": "0px",
"--tasks-entry-grid-wrap-margin-top": "0px",
"--module-entry-grid-min-height": "50px",
"--module-entry-grid-list-min-height": "50px",
"--module-entry-grid-item-min-height": "50px",
"--module-entry-grid-item-height": "50px",
"--module-entry-grid-icon-size": "22px",
"--module-entry-grid-icon-margin-right": "7px",
"--module-entry-grid-label-size": "15px",
"--tasks-entry-overview-display": "none",
"--tasks-entry-overview-display": "none",
"--tasks-entry-overview-margin": "0px",
"--tasks-entry-overview-margin": "0px",
"--tasks-entry-overview-padding": "0px",
"--tasks-entry-overview-padding": "0px",
"--tasks-entry-overview-border-top": "0px solid transparent",
"--tasks-entry-overview-border-top": "0px solid transparent",
"--tasks-entry-overview-radius": "0px",
"--tasks-entry-overview-radius": "0px",
"--tasks-entry-overview-bg": "transparent",
"--tasks-entry-overview-bg": "transparent",
"--tasks-summary-grid-display": "flex",
"--tasks-summary-grid-margin-bottom": "8px",
"--tasks-summary-card-width": "24%",
"--tasks-summary-card-height": "54px",
"--tasks-summary-value-size": "16px",
"--tasks-summary-value-line-height": "18px",
"--tasks-summary-label-size": "10px",
"--tasks-daily-form-padding": "16px",
"--tasks-daily-form-padding": "16px",
"--tasks-daily-field-width": "48%",
"--tasks-daily-field-width": "48%",
"--tasks-daily-textarea-height": "60px",
"--tasks-daily-textarea-height": "60px",
...
@@ -151,6 +165,13 @@ export default {
...
@@ -151,6 +165,13 @@ export default {
"--tasks-entry-overview-border-top": "0px solid transparent",
"--tasks-entry-overview-border-top": "0px solid transparent",
"--tasks-entry-overview-radius": "10px",
"--tasks-entry-overview-radius": "10px",
"--tasks-entry-overview-bg": "#f8fbff",
"--tasks-entry-overview-bg": "#f8fbff",
"--tasks-summary-grid-display": "none",
"--tasks-summary-grid-margin-bottom": "0px",
"--tasks-summary-card-width": "24%",
"--tasks-summary-card-height": "54px",
"--tasks-summary-value-size": "16px",
"--tasks-summary-value-line-height": "18px",
"--tasks-summary-label-size": "10px",
"--tasks-daily-form-padding": "20px",
"--tasks-daily-form-padding": "20px",
"--tasks-daily-field-width": "48%",
"--tasks-daily-field-width": "48%",
"--tasks-daily-textarea-height": "72px",
"--tasks-daily-textarea-height": "72px",
...
...
pages/tasks/tasks.uvue
View file @
6d991c6
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
:key="index"
:key="index"
class="tasks-entry-overview__stat">
class="tasks-entry-overview__stat">
<text class="tasks-entry-overview__label">{{ item.label }}</text>
<text class="tasks-entry-overview__label">{{ item.label }}</text>
<text class="tasks-entry-overview__value">{{ item.value }}</text>
<text class="tasks-entry-overview__value"
:class="item.valueClass">{{ item.value }}</text>
</view>
</view>
</view>
</view>
<view class="tasks-entry-overview__progress">
<view class="tasks-entry-overview__progress">
...
@@ -64,6 +65,7 @@ const activeEntryKey = ref<TaskEntryKey>("daily");
...
@@ -64,6 +65,7 @@ const activeEntryKey = ref<TaskEntryKey>("daily");
type TaskSummaryItem = {
type TaskSummaryItem = {
label: string
label: string
value: string
value: string
valueClass: string
}
}
type TaskOverview = {
type TaskOverview = {
...
@@ -74,10 +76,10 @@ type TaskOverview = {
...
@@ -74,10 +76,10 @@ type TaskOverview = {
const DAILY_OVERVIEW = {
const DAILY_OVERVIEW = {
items: [
items: [
{ label: "待提交", value: "1" } as TaskSummaryItem,
{ label: "待提交", value: "1"
, valueClass: "tasks-summary-card__value--blue"
} as TaskSummaryItem,
{ label: "已提交", value: "3" } as TaskSummaryItem,
{ label: "已提交", value: "3"
, valueClass: "tasks-summary-card__value--green"
} as TaskSummaryItem,
{ label: "待补充", value: "1" } as TaskSummaryItem,
{ label: "待补充", value: "1"
, valueClass: "tasks-summary-card__value--orange"
} as TaskSummaryItem,
{ label: "完成率", value: "75%" } as TaskSummaryItem
{ label: "完成率", value: "75%"
, valueClass: "tasks-summary-card__value--black"
} as TaskSummaryItem
] as TaskSummaryItem[],
] as TaskSummaryItem[],
progress: 75,
progress: 75,
desc: "日报完成率 75%,还有 1 份待提交"
desc: "日报完成率 75%,还有 1 份待提交"
...
@@ -85,10 +87,10 @@ const DAILY_OVERVIEW = {
...
@@ -85,10 +87,10 @@ const DAILY_OVERVIEW = {
const STUDY_OVERVIEW = {
const STUDY_OVERVIEW = {
items: [
items: [
{ label: "学习中", value: "3" } as TaskSummaryItem,
{ label: "学习中", value: "3"
, valueClass: "tasks-summary-card__value--blue"
} as TaskSummaryItem,
{ label: "已完成", value: "5" } as TaskSummaryItem,
{ label: "已完成", value: "5"
, valueClass: "tasks-summary-card__value--green"
} as TaskSummaryItem,
{ label: "待开始", value: "2" } as TaskSummaryItem,
{ label: "待开始", value: "2"
, valueClass: "tasks-summary-card__value--orange"
} as TaskSummaryItem,
{ label: "平均进度", value: "62%" } as TaskSummaryItem
{ label: "平均进度", value: "62%"
, valueClass: "tasks-summary-card__value--black"
} as TaskSummaryItem
] as TaskSummaryItem[],
] as TaskSummaryItem[],
progress: 62,
progress: 62,
desc: "学习平均进度 62%,优先完成进行中的课程"
desc: "学习平均进度 62%,优先完成进行中的课程"
...
@@ -129,10 +131,10 @@ function createStrategyOverview(): TaskOverview {
...
@@ -129,10 +131,10 @@ function createStrategyOverview(): TaskOverview {
const progress = getPercent(doneCount, total);
const progress = getPercent(doneCount, total);
return {
return {
items: [
items: [
{ label: "进行中", value: `${activeCount}` } as TaskSummaryItem,
{ label: "进行中", value: `${activeCount}`
, valueClass: "tasks-summary-card__value--blue"
} as TaskSummaryItem,
{ label: "待开始", value: `${pendingCount}` } as TaskSummaryItem,
{ label: "待开始", value: `${pendingCount}`
, valueClass: "tasks-summary-card__value--orange"
} as TaskSummaryItem,
{ label: "已完成", value: `${doneCount}` } as TaskSummaryItem,
{ label: "已完成", value: `${doneCount}`
, valueClass: "tasks-summary-card__value--green"
} as TaskSummaryItem,
{ label: "完成率", value: `${progress}%` } as TaskSummaryItem
{ label: "完成率", value: `${progress}%`
, valueClass: "tasks-summary-card__value--black"
} as TaskSummaryItem
] as TaskSummaryItem[],
] as TaskSummaryItem[],
progress: progress,
progress: progress,
desc: `策略完成率 ${progress}%,当前 ${activeCount} 项进行中`
desc: `策略完成率 ${progress}%,当前 ${activeCount} 项进行中`
...
@@ -147,10 +149,10 @@ function createReviewOverview(): TaskOverview {
...
@@ -147,10 +149,10 @@ function createReviewOverview(): TaskOverview {
const progress = getPercent(passedCount, reviewedTotal);
const progress = getPercent(passedCount, reviewedTotal);
return {
return {
items: [
items: [
{ label: "待审阅", value: `${pendingCount}` } as TaskSummaryItem,
{ label: "待审阅", value: `${pendingCount}`
, valueClass: "tasks-summary-card__value--blue"
} as TaskSummaryItem,
{ label: "已通过", value: `${passedCount}` } as TaskSummaryItem,
{ label: "已通过", value: `${passedCount}`
, valueClass: "tasks-summary-card__value--green"
} as TaskSummaryItem,
{ label: "已驳回", value: `${rejectedCount}` } as TaskSummaryItem,
{ label: "已驳回", value: `${rejectedCount}`
, valueClass: "tasks-summary-card__value--red"
} as TaskSummaryItem,
{ label: "通过率", value: `${progress}%` } as TaskSummaryItem
{ label: "通过率", value: `${progress}%`
, valueClass: "tasks-summary-card__value--black"
} as TaskSummaryItem
] as TaskSummaryItem[],
] as TaskSummaryItem[],
progress: progress,
progress: progress,
desc: `审阅通过率 ${progress}%,当前还有 ${pendingCount} 条待处理`
desc: `审阅通过率 ${progress}%,当前还有 ${pendingCount} 条待处理`
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment