From c06965849f7f85fac75746845004647b629c47fb Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期一, 27 十一月 2023 14:42:55 +0800
Subject: [PATCH] feat: 报工列表弹窗/对接上报接口/报工弹窗回显
---
src/views/dashboard/components/ProcessingInfo.vue | 53 +++++++++++++++++++++++------------------------------
1 files changed, 23 insertions(+), 30 deletions(-)
diff --git a/src/views/dashboard/components/ProcessingInfo.vue b/src/views/dashboard/components/ProcessingInfo.vue
index f29a18e..ff2172b 100644
--- a/src/views/dashboard/components/ProcessingInfo.vue
+++ b/src/views/dashboard/components/ProcessingInfo.vue
@@ -1,24 +1,17 @@
<template>
<div class="processing-info">
<div class="step">
- <el-steps
- v-if="task?.AllProcedures"
- :active="task.CurrentProcedureIndex ?? 0"
- finish-status="success"
- class="steps"
- >
- <el-step v-for="(item, index) in task.AllProcedures" :key="index" icon="" :title="item"></el-step>
- </el-steps>
+ <TaskStep :active="task?.CurrentProcedureIndex ?? 0" :steps="task?.AllProcedures ?? []"></TaskStep>
</div>
<div class="details">
<div class="row">
- <div class="col">宸ュ崟缂栧彿: {{ task?.Order?.workOrderId || '' }}</div>
- <div class="col">璁㈠崟缂栧彿: {{ task?.Order?.orderId || '' }}</div>
+ <div class="col">宸ュ崟缂栧彿: {{ task?.Order?.workOrderId ?? '--' }}</div>
+ <div class="col">璁㈠崟缂栧彿: {{ task?.Order?.orderId ?? '--' }}</div>
</div>
<div class="row">
<div class="col">浜у搧鍚嶇О: {{ task?.Order?.productName || '--' }}</div>
- <div class="col">鏁伴噺: {{ task?.Order?.amount || 0 }}{{ task?.Order?.unit }}</div>
+ <div class="col">鏁伴噺: {{ task?.Order?.amount ?? '--' }}{{ task?.Order?.unit }}</div>
</div>
<div class="row">
<div class="col">浜よ揣鏃ユ湡: {{ task?.Order?.deliverDate || '--' }}</div>
@@ -33,8 +26,8 @@
<div class="col">閫氶亾: {{ isNumber(task?.Channel) ? CHANNEL_NAME_MAP[task?.Channel] : '--' }}</div>
</div>
<div class="row">
- <div class="col">瀹㈡埛鍚嶇О: {{ task?.Order?.customer || '' }}</div>
- <div class="col">鍙傛暟瑕佹眰: {{ task?.Order?.parameter || '' }}</div>
+ <div class="col">瀹㈡埛鍚嶇О: {{ task?.Order?.customer || '--' }}</div>
+ <div class="col">鍙傛暟瑕佹眰: {{ task?.Order?.parameter || '--' }}</div>
</div>
</div>
<div class="process">
@@ -55,14 +48,12 @@
<script setup lang="ts">
// 鍔犲伐淇℃伅缁勪欢
import type { Task } from '@/api/task'
-import { computed, onUnmounted, toRefs, watch } from 'vue'
+import { computed, toRefs } from 'vue'
import { useDateFormat } from '@vueuse/core'
-import { useRequest } from 'vue-hooks-plus'
-import { getProductProgress } from '@/api'
-import type { ProductProgressParams } from '@/api'
import { isNumber } from 'lodash-es'
import { CHANNEL_NAME_MAP } from '@/common/constants'
import { usePLCStore } from '@/stores/plc'
+import TaskStep from '@/views/dashboard/components/TaskStep.vue'
const props = defineProps<{
task?: Task
@@ -101,19 +92,18 @@
* 璁$畻瀹屾垚杩涘害, 浠诲姟鐘舵�佹湭鐢熶骇鍥哄畾涓� 0% 宸插畬鎴愬浐瀹氫负 100% 鐢熶骇涓垯浠巔lc鑾峰彇
*/
const processingPercent = computed(() => {
- if (task?.value?.Procedure?.Status === 1) {
- return 0
- }
+ // if (task?.value?.Procedure?.Status === 1) {
+ // return 0
+ // }
if (task?.value?.Procedure?.Status === 3) {
return 100
}
+ // if (task?.value?.Procedure?.Status === 2 || task?.value?.Procedure?.Status === 1) {
+ // return calculateProgress(plcStore.plcInfo as Statistics)
+ // }
- if (task?.value?.Procedure?.Status === 2) {
- return calculateProgress(plcStore.plcInfo as Statistics)
- }
-
- return 0
+ return calculateProgress(plcStore.plcInfo as Statistics)
})
/**
@@ -124,7 +114,7 @@
if (!timestamp) {
return '--'
}
- const time = useDateFormat(timestamp * 1000, 'YYYY-MM-DD', { locales: 'zh-cn' })
+ const time = useDateFormat(timestamp * 1000, 'YYYY-MM-DD HH:mm:ss', { locales: 'zh-cn' })
return time.value
}
</script>
@@ -133,9 +123,8 @@
.step {
width: 100%;
- height: 66px;
+ height: 46px;
overflow-x: auto;
- margin-top: -5px;
padding: 0 20px;
.steps {
height: 100%;
@@ -153,7 +142,7 @@
}
}
.details {
- font-size: 18px;
+ font-size: 17px;
padding: 10px 20px;
color: $text-color;
.row {
@@ -168,7 +157,7 @@
}
}
.process {
- font-size: 18px;
+ font-size: 17px;
padding: 10px 20px;
color: $text-color;
display: flex;
@@ -179,8 +168,12 @@
}
:deep(.el-progress-bar__outer) {
border-radius: 8px;
+ background-color: #13235a;
}
:deep(.el-progress-bar__inner) {
border-radius: 8px;
}
+:deep(.el-step__icon .is-icon) {
+ background-color: transparent;
+}
</style>
--
Gitblit v1.8.0