diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 2519eb8..082066d 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -255,6 +255,7 @@ const local: App.I18n.Schema = { signstatistics: '质量会签统计', professionalstatistics: '本专业变更统计', factoryoverview: '全工厂统计概览', + workshopstatistics: '本车间变更统计', systemmanage_setting: '系统配置', }, form: { diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index 679e18d..e9988ee 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -47,4 +47,5 @@ export const views: Record Promise import("@/views/systemManage/setting/index.vue"), systemmanage_template: () => import("@/views/systemManage/template/index.vue"), systemmanage_user: () => import("@/views/systemManage/user/index.vue"), + workshopstatistics: () => import("@/views/workshopStatistics/index.vue"), }; diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index 9146bb4..33e4048 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -384,5 +384,16 @@ export const generatedRoutes: GeneratedRoute[] = [ } } ] + }, + { + name: 'workshopstatistics', + path: '/workshopstatistics', + component: 'layout.base$view.workshopstatistics', + meta: { + title: '本车间变更统计', + icon: 'ix:barchart', + order: 3, + i18nKey: 'route.workshopstatistics' + } } ]; diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index 56eb71a..457d689 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -198,7 +198,8 @@ const routeMap: RouteMap = { "systemmanage_role": "/systemmanage/role", "systemmanage_setting": "/systemmanage/setting", "systemmanage_template": "/systemmanage/template", - "systemmanage_user": "/systemmanage/user" + "systemmanage_user": "/systemmanage/user", + "workshopstatistics": "/workshopstatistics" }; /** diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index e3c6ecd..7a54274 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -53,6 +53,7 @@ declare module "@elegant-router/types" { "systemmanage_setting": "/systemmanage/setting"; "systemmanage_template": "/systemmanage/template"; "systemmanage_user": "/systemmanage/user"; + "workshopstatistics": "/workshopstatistics"; }; /** @@ -101,6 +102,7 @@ declare module "@elegant-router/types" { | "riskstatistics" | "signstatistics" | "systemmanage" + | "workshopstatistics" >; /** @@ -149,6 +151,7 @@ declare module "@elegant-router/types" { | "systemmanage_setting" | "systemmanage_template" | "systemmanage_user" + | "workshopstatistics" >; /** diff --git a/src/views/home/modules/ringChart.vue b/src/views/home/modules/ringChart.vue index b95fc98..c5f5968 100644 --- a/src/views/home/modules/ringChart.vue +++ b/src/views/home/modules/ringChart.vue @@ -6,7 +6,9 @@ defineOptions({ name: 'RingChart' }); -const props = defineProps<{ data?: { name: string; value: number; money: number; rate: number }[]; colors?: string[]; range?: string }>(); +const props = defineProps<{ data?: { name: string; value: number; fee: number }[]; total?: number }>(); + +const chartData = ref<{ name: string; value: number; fee: number; rate: number }[]>([]); const { domRef, updateOptions } = useEcharts(() => ({ tooltip: { @@ -43,16 +45,16 @@ const { domRef, updateOptions } = useEcharts(() => ({ } }, formatter: function (name: string) { - var info = props.data?.find((item: { name: string }) => item.name === name); + var info = chartData.value?.find((item: { name: string }) => item.name === name); if(info){ - return '{name|'+name+'} {count|'+(info.value)+' 起}{rate|'+(info.rate)+' %} {money|'+(info.money)+' 万元}'; + return '{name|'+name+'} {count|'+(info.value)+' 起}{rate|'+(info.rate)+' %} {money|'+(info.fee)+' 万元}'; }else{ return name; } } }, title: { - text: `{a|19}\n{b|已验收}`, + text: `{a|${(props.total || 0)}}\n{b|已验收}`, textStyle: { rich: { a: { @@ -72,7 +74,7 @@ const { domRef, updateOptions } = useEcharts(() => ({ } } }, - left: '45%', + left: '43%', top: '21%', }, series: [ @@ -100,8 +102,18 @@ const { domRef, updateOptions } = useEcharts(() => ({ function init() { updateOptions(opts => { - opts.series[0].data = props.data || []; - opts.series[0].color = props.colors || []; + const data:any = props.data?.map((item:any) => { + const rate = item.count === 0 ? 0 : (Math.round((item.count / (props.total || 0)) * 100) / 100)*100; + return { + name: item.label, + value: item.count, + fee: item.fee, + rate: rate + } + }); + chartData.value = data; + opts.series[0].data = chartData.value; + opts.series[0].color = ["#52c41a", "#faad14", "#ff4d4f"]; return opts; }); } diff --git a/src/views/home/modules/template10.vue b/src/views/home/modules/template10.vue index 13a36e3..dd4bcda 100644 --- a/src/views/home/modules/template10.vue +++ b/src/views/home/modules/template10.vue @@ -23,12 +23,6 @@ let timer: any = null; // 首页数据 const homeData = ref(null); -const highRisk = [ - { title: "聚合反应温度控制上限调整", why: "涉及工艺安全边界,建议参与 HAZOP 分析" }, - { title: "R-101 搅拌提速至 180rpm", why: "搅拌轴强度与密封形式需校核" }, -]; - - // 跳转变更申请页面、变更台账、我的任务、发起变更 const jumpTo = (key: string,qid:number = 0) => { if(key==='my_initiatechange' && qid){ @@ -66,12 +60,6 @@ const tick = () => { timer = setTimeout(tick, delay); } -// 匹配对象 -const matchObj = (list:any,val:number) => { - const obj = list.find((item:any) => item.value == val); - return obj || null; -} - // 获取数据 const getData = async () => { loading.value = true; @@ -277,7 +265,7 @@ onUnmounted(() => {

点击进入台账按阶段查看

- 审判中 14 + 审批中 14 已通过 6 待验收 9 待关闭 7 diff --git a/src/views/home/modules/template7.vue b/src/views/home/modules/template7.vue index ff60663..6b79088 100644 --- a/src/views/home/modules/template7.vue +++ b/src/views/home/modules/template7.vue @@ -6,18 +6,12 @@ import { useRouterPush } from '@/hooks/common/router'; import { getColorWithOpacity, tagTextColor, tagBgColor, tagBorderColor } from '@/utils/common'; import RingChart from "./ringChart.vue"; import { systemConfigApi } from "@/service/api/system"; +import { urgeApi } from "@/service/api/change"; import { homeManagerApi } from "@/service/api/statistics"; const themeStore = useThemeStore(); const { routerPushByKey } = useRouterPush(); -const DEPT_ACCEPT2 = [ - { name: "完全达到", value: 13, money: 61.2, rate: 68 }, - { name: "基本达到", value: 4, money: 19.8, rate: 21 }, - { name: "未达到", value: 2, money: 5.4, rate: 11 }, -]; -const ACCEPT_COLORS2 = ["#52c41a", "#faad14", "#ff4d4f"]; - const DATE_RANGE_OPTIONS = [ { label: "近一年", value: 'year' }, { label: "近半年", value: 'half_year' }, @@ -27,6 +21,8 @@ const DATE_RANGE_OPTIONS = [ ] const loading = ref(false); +// 催办按钮loading +const btnLoading = ref(false); // 日期范围 const dateRange = ref('year'); // 自定义日期范围 @@ -44,7 +40,6 @@ let timer: any = null; // 首页数据 const homeData = ref(null); - // 时间范围改变 const timeChange = (type: string, value: number | null) => { if(type === 'start'){ @@ -54,20 +49,16 @@ const timeChange = (type: string, value: number | null) => { } } -// 跳转变更申请页面、变更台账、我的任务、发起变更 +// 跳转页面 const jumpTo = (key: string,qid:number = 0) => { - if(key==='my_initiatechange' && qid){ - routerPushByKey(key,{ query: { id: qid.toString() } }); - }else if(key==='details_closedoc' && qid){ + if(key==='details_index' && qid){ + routerPushByKey(key,{ query: { id: qid.toString(),key:'home' } }); + }else if(key==='details_approval' && qid){ routerPushByKey(key,{ query: { id: qid.toString(),key:'home' } }); }else{ routerPushByKey(key as any); } } -// 打开变更详情 -const openDetail = (row: any) => { - routerPushByKey("details_index",{ query: { id: row?.change_id?.toString(),key:'home' } }); -}; // 获取当前时间字符串 const getCurrentTimeStr = () => { @@ -89,6 +80,16 @@ const tick = () => { timer = setTimeout(tick, delay); } +// 催办 +const urge = async (change_id:number) => { + btnLoading.value = true; + const {error} = await urgeApi(change_id); + if(!error){ + window.$message?.success('催办成功'); + } + btnLoading.value = false; +} + // 匹配对象 const matchObj = (list:any,val:number) => { const obj = list.find((item:any) => item.value == val); @@ -101,7 +102,6 @@ const getData = async () => { const {data,error} = await homeManagerApi(); if(!error){ homeData.value = data; - console.log(data) } loading.value = false; } @@ -152,7 +152,7 @@ onUnmounted(() => {
- +

{

我的工作台

- +

{{clock}}

- + 车间变更看板 @@ -187,24 +187,25 @@ onUnmounted(() => {
-

含超期未审 · 请优先处理

+

含超期未审 · 请优先处理

+

属地变更审批

重要变更未关闭

@@ -221,7 +222,7 @@ onUnmounted(() => {
@@ -232,13 +233,13 @@ onUnmounted(() => {

超期未关闭

@@ -258,19 +259,19 @@ onUnmounted(() => {

审批待办

属地变更审批

- + 我的任务
-